本文整理汇总了C++中SpellItem::targetId方法的典型用法代码示例。如果您正苦于以下问题:C++ SpellItem::targetId方法的具体用法?C++ SpellItem::targetId怎么用?C++ SpellItem::targetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpellItem
的用法示例。
在下文中一共展示了SpellItem::targetId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindSpell
SpellItem* SpellShell::FindSpell(int spell_id, int caster_id, int target_id)
{
bool target = true;
const Spell* spell = m_spells->spell(spell_id);
if (spell)
target = (spell->targetType() != 6);
for(QValueList<SpellItem*>::Iterator it = m_spellList.begin();
it != m_spellList.end(); it++) {
SpellItem *i = *it;
//loop to trap a spell being added that is already cast on self.
if ((i->spellId() == spell_id) && (i->casterId() == i->targetId()))
if (caster_id == target_id)
return i;
if ((i->spellId() == spell_id) && (i->targetId() == target_id))
{
if ( (target) && (target_id) )
{
if (i->targetId() == target_id)
return i;
}
else return i;
}
}
return NULL;
}
示例2: killSpawn
void SpellShell::killSpawn(const Item* deceased)
{
uint16_t id = deceased->id();
SpellItem* spell;
if (m_lastPlayerSpell && (m_lastPlayerSpell->targetId() == id))
m_lastPlayerSpell = 0;
QValueList<SpellItem*>::Iterator it = m_spellList.begin();
while(it != m_spellList.end())
{
spell = *it;
if (spell->targetId() == id)
{
it = m_spellList.remove(it);
emit delSpell(spell);
delete spell;
}
else
++it;
}
if (m_spellList.count() == 0)
m_timer->stop();
}
示例3: findSpell
SpellItem* SpellShell::findSpell(uint16_t spellId,
uint16_t targetId, const QString& targetName)
{
for(QValueList<SpellItem*>::Iterator it = m_spellList.begin();
it != m_spellList.end();
it++)
{
SpellItem *i = *it;
if (i->spellId() == spellId)
{
if ((i->targetId() == targetId) ||
((i->targetId() == 0) && (i->targetName() == targetName)))
return i;
}
}
return NULL;
}
示例4: FindSpell
SpellItem* SpellShell::FindSpell(int spell_id, int caster_id, int target_id)
{
for(QValueList<SpellItem*>::Iterator it = m_spellList.begin();
it != m_spellList.end(); it++) {
SpellItem *i = *it;
if ((i->spellId() == spell_id) && (i->casterId() == caster_id)) {
struct spellInfoStruct *info;
info = spell_info(spell_id);
if ( (info->target) && (target_id) ) {
if (i->targetId() == target_id)
return i;
} else return i;
}
}
return NULL;
}
示例5: killSpawn
void SpellShell::killSpawn(const Item* deceased)
{
uint16_t id = deceased->id();
if (id == m_player->id())
{
// We're dead. No more buffs for us.
clear();
}
else
{
SpellItem* spell;
if (m_lastPlayerSpell && (m_lastPlayerSpell->targetId() == id))
{
m_lastPlayerSpell = 0;
}
QValueList<SpellItem*>::Iterator it = m_spellList.begin();
while(it != m_spellList.end())
{
spell = *it;
if (spell->targetId() == id)
{
it = m_spellList.remove(it);
emit delSpell(spell);
delete spell;
}
else
{
++it;
}
}
if (m_spellList.count() == 0)
{
m_timer->stop();
}
}
}