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


C++ UnSummon函数代码示例

本文整理汇总了C++中UnSummon函数的典型用法代码示例。如果您正苦于以下问题:C++ UnSummon函数的具体用法?C++ UnSummon怎么用?C++ UnSummon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: GetOwner

void Totem::Update(uint32 update_diff, uint32 time )
{
    Unit *owner = GetOwner();
    if (!owner || !owner->isAlive() || !isAlive())
    {
        UnSummon();                                         // remove self
        return;
    }

    if (m_duration <= update_diff)
    {
        UnSummon();                                         // remove self
        return;
    }
    else
        m_duration -= update_diff;

    // Grounding totem + polymorph = unsummon
    if(GetCreatureInfo()->Entry == 5925 && HasAuraType(SPELL_AURA_MOD_CONFUSE))
    {
        UnSummon();                                         // remove self
        return;
    }

    Creature::Update( update_diff, time );
}
开发者ID:Nedj,项目名称:Mysteria4,代码行数:26,代码来源:Totem.cpp

示例2: UnSummon

void Totem::Update(uint32 time) {
	if (!m_owner->isAlive() || !isAlive()) {
		UnSummon(); // remove self
		return;
	}

	if (m_duration <= time) {
		UnSummon(); // remove self
		return;
	} else
		m_duration -= time;

	Creature::Update(time);
}
开发者ID:ProjectStarGate,项目名称:StarGate-Plus-EMU,代码行数:14,代码来源:Totem.cpp

示例3: UnSummon

void Puppet::Update(uint32 time)
{
    Minion::Update(time);
    //check if caster is channelling?
    if (IsInWorld() && !isAlive())
        UnSummon();
}
开发者ID:AwkwardDev,项目名称:Project-WoW,代码行数:7,代码来源:TemporarySummon.cpp

示例4: GetOwner

void Totem::Update(uint32 update_diff, uint32 time )
{
    Unit *owner = GetOwner();
    if (!owner || !owner->isAlive() || !isAlive())
    {
        UnSummon();                                         // remove self
        return;
    }

    if (m_duration <= update_diff)
    {
        UnSummon();                                         // remove self
        return;
    }
    else
        m_duration -= update_diff;

    Creature::Update( update_diff, time );
}
开发者ID:Deffender,项目名称:mangos1,代码行数:19,代码来源:Totem.cpp

示例5: UnSummon

void Puppet::Update(uint32 time) {
	Minion::Update(time);
	//check if caster is channelling?
	if (IsInWorld()) {
		if (!isAlive()) {
			UnSummon();
			// TODO: why long distance .die does not remove it
		}
	}
}
开发者ID:rexy,项目名称:ArkCORE,代码行数:10,代码来源:TemporarySummon.cpp

示例6: GetOwner

void Totem::Update( uint32 time )
{
    Unit *owner = GetOwner();
    if (!owner || !owner->isAlive() || !this->isAlive())
    {
        UnSummon();                                         // remove self
        return;
    }

    if (m_duration <= time)
    {
        UnSummon();                                         // remove self
        return;
    }
    else
        m_duration -= time;

    Creature::Update( time );
}
开发者ID:Bootz,项目名称:TC-One,代码行数:19,代码来源:Totem.cpp

示例7: UnSummon

void TempSummon::Update(uint32 diff)
{
    Creature::Update(diff);

    if (m_deathState == DEAD)
    {
        UnSummon();
        return;
    }
    switch (m_type)
    {
        case TEMPSUMMON_MANUAL_DESPAWN:
            break;
        case TEMPSUMMON_TIMED_DESPAWN:
        {
            if (m_timer <= diff)
            {
                UnSummon();
                return;
            }

            m_timer -= diff;
            break;
        }
        case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
        {
            if (!IsInCombat())
            {
                if (m_timer <= diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;

            break;
        }

        case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
        {
            if (m_deathState == CORPSE)
            {
                if (m_timer <= diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= diff;
            }
            break;
        }
        case TEMPSUMMON_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (m_deathState == CORPSE || m_deathState == DEAD)
            {
                UnSummon();
                return;
            }

            break;
        }
        case TEMPSUMMON_DEAD_DESPAWN:
        {
            if (m_deathState == DEAD)
            {
                UnSummon();
                return;
            }
            break;
        }
        case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (m_deathState == CORPSE || m_deathState == DEAD)
            {
                UnSummon();
                return;
            }

            if (!IsInCombat())
            {
                if (m_timer <= diff)
                {
                    UnSummon();
                    return;
                }
                else
                    m_timer -= diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;
            break;
        }
        case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
//.........这里部分代码省略.........
开发者ID:oMadMano,项目名称:MistyWorld_6xx,代码行数:101,代码来源:TemporarySummon.cpp

示例8: switch

void TemporarySummon::Update( uint32 update_diff,  uint32 diff )
{
    switch(m_type)
    {
        case TEMPSUMMON_MANUAL_DESPAWN:
            break;
        case TEMPSUMMON_TIMED_DESPAWN:
        {
            if (m_timer <= update_diff)
            {
                UnSummon();
                return;
            }

            m_timer -= update_diff;
            break;
        }
        case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
        {
            if (!isInCombat())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= update_diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;

            break;
        }

        case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
        {
            if (IsCorpse())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= update_diff;
            }
            break;
        }
        case TEMPSUMMON_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (isDead())
            {
                UnSummon();
                return;
            }

            break;
        }
        case TEMPSUMMON_DEAD_DESPAWN:
        {
            if (IsDespawned())
            {
                UnSummon();
                return;
            }
            break;
        }
        case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (isDead())
            {
                UnSummon();
                return;
            }

            if (m_timer <= update_diff)
            {
                UnSummon();
                return;
            }
            else
                m_timer -= update_diff;

            break;
        }
        case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (IsDespawned())
            {
                UnSummon();
                return;
            }

            if (m_timer <= update_diff)
            {
                UnSummon();
//.........这里部分代码省略.........
开发者ID:SeTM,项目名称:mangos,代码行数:101,代码来源:TemporarySummon.cpp

示例9: switch

void TemporarySummon::Update(uint32 update_diff,  uint32 diff)
{
    switch (m_type)
    {
        case TEMPSUMMON_MANUAL_DESPAWN:
            break;
        case TEMPSUMMON_TIMED_DESPAWN:
        {
            if (m_timer <= update_diff)
            {
                UnSummon();
                return;
            }

            m_timer -= update_diff;
            break;
        }
        case TEMPSUMMON_TIMED_OOC_DESPAWN:
        {
            if (!IsInCombat())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= update_diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;

            break;
        }

        case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
        {
            if (IsCorpse())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= update_diff;
            }
            if (IsDespawned())
            {
                UnSummon();
                return;
            }
            break;
        }
        case TEMPSUMMON_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (IsDead())
            {
                UnSummon();
                return;
            }

            break;
        }
        case TEMPSUMMON_DEAD_DESPAWN:
        {
            if (IsDespawned())
            {
                UnSummon();
                return;
            }
            break;
        }
        case TEMPSUMMON_TIMED_OOC_OR_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (IsDead())
            {
                UnSummon();
                return;
            }

            if (!IsInCombat())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
                    return;
                }
                else
                    m_timer -= update_diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;
            break;
        }
        case TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
//.........这里部分代码省略.........
开发者ID:Chuck5ta,项目名称:server-3,代码行数:101,代码来源:TemporarySummon.cpp

示例10: switch

void TemporarySpawn::Update(uint32 update_diff,  uint32 diff)
{
    switch (m_type)
    {
        case TEMPSPAWN_MANUAL_DESPAWN:
            break;

        case TEMPSPAWN_TIMED_DESPAWN:
        {
            if (m_timer <= update_diff)
            {
                UnSummon();
                return;
            }

            m_timer -= update_diff;
            break;
        }

        case TEMPSPAWN_TIMED_OOC_DESPAWN:
        {
            if (isAlive())
            {
                if (!isInCombat())
                {
                    if (m_timer <= update_diff)
                    {
                        UnSummon();
                        return;
                    }

                    m_timer -= update_diff;
                }
                else if (m_timer != m_lifetime)
                    m_timer = m_lifetime;
            }
            else if (IsDespawned())
            {
                UnSummon();
                return;
            }
            break;
        }

        case TEMPSPAWN_CORPSE_TIMED_DESPAWN:
        {
            if (IsCorpse())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= update_diff;
            }
            if (IsDespawned())
            {
                UnSummon();
                return;
            }
            break;
        }

        case TEMPSPAWN_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (isDead())
            {
                UnSummon();
                return;
            }

            break;
        }

        case TEMPSPAWN_DEAD_DESPAWN:
        {
            if (IsDespawned())
            {
                UnSummon();
                return;
            }
            break;
        }

        case TEMPSPAWN_TIMED_OOC_OR_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (isDead())
            {
                UnSummon();
                return;
            }

            if (!isInCombat())
            {
                if (m_timer <= update_diff)
                {
                    UnSummon();
//.........这里部分代码省略.........
开发者ID:killerwife,项目名称:mangos-tbc,代码行数:101,代码来源:TemporarySpawn.cpp

示例11: UnSummon

void TempSummon::Update(uint32 diff)
{
    Creature::Update(diff);

    if (m_deathState == DEAD)
    {
        UnSummon();
        return;
    }
    switch (m_type)
    {
        case TEMPSUMMON_MANUAL_DESPAWN:
            break;
        case TEMPSUMMON_TIMED_DESPAWN:
        {
            if (m_timer <= diff)
            {
                if (IsAIEnabled)
                    AI()->JustDespawned();

                UnSummon();
                return;
            }

            m_timer -= diff;
            break;
        }
        case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
        {
            if (!isInCombat())
            {
                if (m_timer <= diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;

            break;
        }

        case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
        {
            if (m_deathState == CORPSE)
            {
                if (m_timer <= diff)
                {
                    UnSummon();
                    return;
                }

                m_timer -= diff;
            }
            break;
        }
        case TEMPSUMMON_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (m_deathState == CORPSE || m_deathState == DEAD)
            {
                UnSummon();
                return;
            }

            break;
        }
        case TEMPSUMMON_DEAD_DESPAWN:
        {
            if (m_deathState == DEAD)
            {
                UnSummon();
                return;
            }
            break;
        }
        case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
        {
            // if m_deathState is DEAD, CORPSE was skipped
            if (m_deathState == CORPSE || m_deathState == DEAD)
            {
                UnSummon();
                return;
            }

            if (!isInCombat())
            {
                if (m_timer <= diff)
                {
                    UnSummon();
                    return;
                }
                else
                    m_timer -= diff;
            }
            else if (m_timer != m_lifetime)
                m_timer = m_lifetime;
//.........这里部分代码省略.........
开发者ID:Exodius,项目名称:JadeCore548,代码行数:101,代码来源:TemporarySummon.cpp

示例12: switch


//.........这里部分代码省略.........
            // if m_deathState is DEAD, CORPSE was skipped
            ua = isDead() ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;
            break;
        }
        case TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN:
        {
            if (IsDespawned())
                ua = TSUA_UNSUMMON;
            else
                ua = (!isInCombat() && isAlive()) ? TSUA_CHECK_TIMER : TSUA_RESET_TIMER;
            break;
        }
        case TEMPSUMMON_TIMED_OOC_OR_CORPSE_DESPAWN:
        {
            if (isDead())
                ua = TSUA_UNSUMMON;
            else
                ua = isInCombat() ? TSUA_RESET_TIMER : TSUA_CHECK_TIMER;
            break;
        }
        case TEMPSUMMON_LOST_OWNER_DESPAWN:
        case TEMPSUMMON_DEAD_OR_LOST_OWNER_DESPAWN:
        {
            if (m_type == TEMPSUMMON_DEAD_OR_LOST_OWNER_DESPAWN && IsDespawned())
                ua = TSUA_UNSUMMON;
            else if (!GetSummoner())
            {
                m_type = TEMPSUMMON_TIMED_DESPAWN;
                m_lifetime = DEFAULT_DESPAWN_DELAY;
                ua = TSUA_RESET_TIMER;
            }
            break;
        }
        case TEMPSUMMON_TIMED_OR_DEAD_OR_LOST_OWNER_DESPAWN:
        {
            ua = (IsDespawned() || !GetSummoner()) ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;
            break;
        }
        case TEMPSUMMON_TIMED_OR_DEAD_OR_LOST_UNIQUENESS_DESPAWN:
        {
            ua = IsDespawned() ? TSUA_UNSUMMON : TSUpdateActions(TSUA_CHECK_UNIQUENESS | TSUA_CHECK_TIMER);
            break;
        }
        case TEMPSUMMON_DEAD_OR_LOST_UNIQUENESS_DESPAWN:
        {
            ua = IsDespawned() ? TSUA_UNSUMMON : TSUA_CHECK_UNIQUENESS;
            break;
        }
        default:
            ua = TSUA_UNSUMMON;
            sLog.outError("Temporary summoned %s have unknown type %u of", GetGuidStr().c_str(), m_type);
            break;
    }

    if (ua & TSUA_RESET_TIMER)
    {
        if (m_timer != m_lifetime)
            m_timer = m_lifetime;
    }
    else if (ua & TSUA_CHECK_TIMER)
    {
        if (m_timer <= update_diff)
            ua = TSUA_UNSUMMON;
        else
            m_timer -= update_diff;
    }

    if (ua & TSUA_CHECK_UNIQUENESS)
    {
        std::list<Creature*> tlist;
        MaNGOS::AllIdenticalObjectsInRangeCheck check(this, GetMap()->GetVisibilityDistance());
        MaNGOS::CreatureListSearcher<MaNGOS::AllIdenticalObjectsInRangeCheck> searcher(tlist, check);
        Cell::VisitGridObjects(this, searcher, GetMap()->GetVisibilityDistance(), true);

        for (std::list<Creature*>::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
        {
            Creature* pCre = *itr;
            if (!pCre || !pCre->isAlive() || !pCre->IsTemporarySummon())
                continue;

            if (((TemporarySummon*)pCre)->GetTempSummonType() == GetTempSummonType() &&
                ((TemporarySummon*)pCre)->GetSummonerGuid() == GetSummonerGuid())
            {
                ua = TSUA_UNSUMMON;
                break;
            }
        }
    }

    if (ua & TSUA_UNSUMMON)
    {
        UnSummon();
        return;
    }

    if (!m_isActive)
        return;

    Creature::Update(update_diff, diff);
}
开发者ID:AnthoDevMoP,项目名称:mangos4,代码行数:101,代码来源:TemporarySummon.cpp


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