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


C++ SpellItem::targetId方法代码示例

本文整理汇总了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;
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:27,代码来源:spellshell.cpp

示例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();
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:25,代码来源:spellshell.cpp

示例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;
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:18,代码来源:spellshell.cpp

示例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;
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:16,代码来源:spellshell.cpp

示例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();
        }
    }

}
开发者ID:carriercomm,项目名称:showeq,代码行数:41,代码来源:spellshell.cpp


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