本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}