当前位置: 首页>>代码示例>>C++>>正文


C++ CBattleEntity::isDead方法代码示例

本文整理汇总了C++中CBattleEntity::isDead方法的典型用法代码示例。如果您正苦于以下问题:C++ CBattleEntity::isDead方法的具体用法?C++ CBattleEntity::isDead怎么用?C++ CBattleEntity::isDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBattleEntity的用法示例。


在下文中一共展示了CBattleEntity::isDead方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getValidTarget

CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint8 validTargetFlags)
{

    DSP_DEBUG_BREAK_IF(actionTargetID == 0);

    CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->loc.zone->GetEntity(actionTargetID, TYPE_MOB | TYPE_PC | TYPE_PET);

    if (PTarget == NULL)
    {
        return NULL;
    }

    if (validTargetFlags & TARGET_ENEMY)
    {
        if (!PTarget->isDead())
        {
            if (PTarget->objtype == TYPE_MOB ||
                (PTarget->objtype == TYPE_PC && ((CCharEntity*)PTarget)->m_PVPFlag))
            {
                return PTarget;
            }
        }
    }

    if (PTarget->objtype == TYPE_PC)
    {
        if ((validTargetFlags & TARGET_SELF) && PTarget->targid == m_PBattleEntity->targid)
        {
            return PTarget;
        }
        if (validTargetFlags & TARGET_PLAYER)
        {
            return PTarget;
        }
        if ((validTargetFlags & TARGET_PLAYER_PARTY) && (m_PBattleEntity->PParty != NULL && m_PBattleEntity->PParty == PTarget->PParty))
        {
            return PTarget;
        }
        if ((validTargetFlags & TARGET_PLAYER_PARTY_PIANISSIMO) && (m_PBattleEntity->StatusEffectContainer->HasStatusEffect(EFFECT_PIANISSIMO)) &&
            (m_PBattleEntity->PParty != NULL && m_PBattleEntity->PParty == PTarget->PParty))
        {
            return PTarget;
        }
        if ((validTargetFlags & TARGET_PLAYER_DEAD) && PTarget->isDead())
        {
            return PTarget;
        }
        return NULL;
    }
    return NULL;
}
开发者ID:Apocalypse612,项目名称:darkstar,代码行数:51,代码来源:targetfind.cpp

示例2: GetHighestTH

uint8 CEnmityContainer::GetHighestTH()
{
    CBattleEntity* PEntity = nullptr;
    uint8 THLvl = 0;

    for (auto it = m_EnmityList.cbegin(); it != m_EnmityList.cend(); ++it)
    {
        const EnmityObject_t& PEnmityObject = it->second;
        PEntity = PEnmityObject.PEnmityOwner;

        if (PEntity != nullptr && !PEntity->isDead() && IsWithinEnmityRange(PEntity) && PEnmityObject.maxTH > THLvl)
            THLvl = PEnmityObject.maxTH;
    }

    return THLvl;
}
开发者ID:LegionXI,项目名称:darkstar,代码行数:16,代码来源:enmity_container.cpp

示例3: GetHighestTH

uint8 CEnmityContainer::GetHighestTH()
{
    CBattleEntity* PEntity = nullptr;
    uint8 THLvl = 0;

    for (EnmityList_t::iterator it = m_EnmityList.begin(); it != m_EnmityList.end(); ++it)
    {
        EnmityObject_t* PEnmityObject = it->second;
        PEntity = PEnmityObject->PEnmityOwner;

        if (PEntity != nullptr && !PEntity->isDead() && IsWithinEnmityRange(PEntity) && PEnmityObject->maxTH > THLvl)
            THLvl = PEnmityObject->maxTH;
    }

    return THLvl;
}
开发者ID:Badfortune,项目名称:darkstar,代码行数:16,代码来源:enmity_container.cpp

示例4: CharOnTarget

void CMagicState::CharOnTarget(apAction_t* action, int16 ce, int16 ve)
{
    if(m_PEntity->objtype != TYPE_PC)
    {
        return;
    }

    CBattleEntity* PTarget = action->ActionTarget;
    bool enmityApplied = false;

    if (m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_TRANQUILITY) && m_PSpell->getSpellGroup() == SPELLGROUP_WHITE)
    {
        m_PEntity->addModifier(MOD_ENMITY, -m_PEntity->StatusEffectContainer->GetStatusEffect(EFFECT_TRANQUILITY)->GetPower());
    }
    if (m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_EQUANIMITY) && m_PSpell->getSpellGroup() == SPELLGROUP_BLACK)
    {
        m_PEntity->addModifier(MOD_ENMITY, -m_PEntity->StatusEffectContainer->GetStatusEffect(EFFECT_EQUANIMITY)->GetPower());
    }

    if (PTarget->objtype == TYPE_MOB && PTarget->allegiance != m_PEntity->allegiance)
    {
        if (PTarget->isDead())
        {
            ((CMobEntity*)PTarget)->m_DropItemTime = m_PSpell->getAnimationTime();
        }

        ((CMobEntity*)PTarget)->m_OwnerID.id = m_PEntity->id;
        ((CMobEntity*)PTarget)->m_OwnerID.targid = m_PEntity->targid;
        ((CMobEntity*)PTarget)->PEnmityContainer->UpdateEnmity(m_PEntity, ce, ve);
        enmityApplied = true;
    }
    else if (PTarget->allegiance == m_PEntity->allegiance)
    {
        battleutils::GenerateInRangeEnmity(m_PEntity, ce, ve);
        enmityApplied = true;
    }

    if (m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_TRANQUILITY) && m_PSpell->getSpellGroup() == SPELLGROUP_WHITE)
    {
        m_PEntity->delModifier(MOD_ENMITY, -m_PEntity->StatusEffectContainer->GetStatusEffect(EFFECT_TRANQUILITY)->GetPower());
        if (enmityApplied)
            m_PEntity->StatusEffectContainer->DelStatusEffect(EFFECT_TRANQUILITY);
    }
    if (m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_EQUANIMITY) && m_PSpell->getSpellGroup() == SPELLGROUP_BLACK)
    {
        m_PEntity->delModifier(MOD_ENMITY, -m_PEntity->StatusEffectContainer->GetStatusEffect(EFFECT_EQUANIMITY)->GetPower());
        if (enmityApplied)
            m_PEntity->StatusEffectContainer->DelStatusEffect(EFFECT_EQUANIMITY);
    }

    if(action->param > 0 && m_PSpell->dealsDamage() && m_PSpell->getSpellGroup() == SPELLGROUP_BLUE &&
        m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_CHAIN_AFFINITY) && ((CBlueSpell*)m_PSpell)->getPrimarySkillchain() != 0)
    {

        SUBEFFECT effect = battleutils::GetSkillChainEffect(PTarget, (CBlueSpell*)m_PSpell);
        if (effect != SUBEFFECT_NONE)
        {
            uint16 skillChainDamage = battleutils::TakeSkillchainDamage(m_PEntity, PTarget, action->param);


            action->addEffectParam = skillChainDamage;
            action->addEffectMessage = 287 + effect;
            action->additionalEffect = effect;

        }
        if (m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_SEKKANOKI) || m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_MEIKYO_SHISUI))
        {
            m_PEntity->health.tp = (m_PEntity->health.tp > 1000 ? m_PEntity->health.tp - 1000 : 0);
        }
        else
        {
            m_PEntity->health.tp = 0;
        }

        m_PEntity->StatusEffectContainer->DelStatusEffectSilent(EFFECT_CHAIN_AFFINITY);
    }
}
开发者ID:Celyste,项目名称:darkstar,代码行数:77,代码来源:magic_state.cpp

示例5: getValidTarget

CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint8 validTargetFlags)
{

    DSP_DEBUG_BREAK_IF(actionTargetID == 0);

    CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_MOB | TYPE_PC | TYPE_PET);

    if (PTarget == nullptr)
    {
        return nullptr;
    }

    if (PTarget->objtype == TYPE_PC)
    {
        if ((validTargetFlags & TARGET_SELF) && PTarget->targid == m_PBattleEntity->targid)
        {
            return PTarget;
        }
        if (validTargetFlags & TARGET_PLAYER)
        {
            return PTarget;
        }
        if ((validTargetFlags & TARGET_PLAYER_PARTY) && (m_PBattleEntity->PParty != nullptr && m_PBattleEntity->PParty == PTarget->PParty))
        {
            return PTarget;
        }
        if ((validTargetFlags & TARGET_PLAYER_PARTY_PIANISSIMO) && (m_PBattleEntity->StatusEffectContainer->HasStatusEffect(EFFECT_PIANISSIMO)) &&
            (m_PBattleEntity->PParty != nullptr && m_PBattleEntity->PParty == PTarget->PParty))
        {
            return PTarget;
        }
        if ((validTargetFlags & TARGET_PLAYER_DEAD) && PTarget->isDead())
        {
            return PTarget;
        }
        return nullptr;
    }

	if (PTarget->objtype == TYPE_MOB)
	{
		if (validTargetFlags & TARGET_PLAYER_DEAD && ((CMobEntity*)PTarget)->m_Behaviour & BEHAVIOUR_RAISABLE
			&& PTarget->isDead())
		{
			return PTarget;
		}

        if (validTargetFlags & TARGET_NPC)
        {
            if (PTarget->allegiance == m_PBattleEntity->allegiance && (PTarget == m_PBattleEntity ||
                !(((CMobEntity*)PTarget)->m_Behaviour & BEHAVIOUR_NOHELP)))
            {
                return PTarget;
            }
        }
	}

    if (validTargetFlags & TARGET_ENEMY)
    {
        if (!PTarget->isDead())
        {
            if (PTarget->allegiance == (m_PBattleEntity->allegiance % 2 == 0 ? m_PBattleEntity->allegiance + 1 : m_PBattleEntity->allegiance - 1))
            {
                return PTarget;
            }
        }
    }

    return nullptr;
}
开发者ID:Anthiam,项目名称:darkstar,代码行数:69,代码来源:targetfind.cpp


注:本文中的CBattleEntity::isDead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。