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


C++ RemoveStatusEffect函数代码示例

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


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

示例1: CStatusEffect

CStatusEffect* CStatusEffectContainer::StealStatusEffect()
{

    std::vector<uint16> dispelableList;
    for (uint16 i = 0; i < m_StatusEffectList.size(); ++i)
    {
        if (m_StatusEffectList.at(i)->GetFlag() & EFFECTFLAG_DISPELABLE &&
            m_StatusEffectList.at(i)->GetDuration() > 0)
        {
            dispelableList.push_back(i);
        }
	}
    if (!dispelableList.empty())
    {
        uint16 rndIdx = WELL512::GetRandomNumber(dispelableList.size());
        uint16 effectIndex = dispelableList.at(rndIdx);

        CStatusEffect* oldEffect = m_StatusEffectList.at(effectIndex);

        //make a copy
        CStatusEffect* EffectCopy = new CStatusEffect(oldEffect->GetStatusID(), oldEffect->GetIcon(), oldEffect->GetPower(), oldEffect->GetTickTime()/1000, oldEffect->GetDuration()/1000);

        RemoveStatusEffect(effectIndex);

        return EffectCopy;
    }
    return 0;
}
开发者ID:DomingoSeven,项目名称:darkstar,代码行数:28,代码来源:status_effect_container.cpp

示例2: DSP_DEBUG_BREAK_IF

void CStatusEffectContainer::CheckEffects(time_point tick)
{
    DSP_DEBUG_BREAK_IF(m_POwner == nullptr);

    if (!m_POwner->isDead())
    {
        if ((tick - m_EffectCheckTime) < 1s && (tick - m_EffectCheckTime > 0s))
        {
            return;
        }

        m_POwner->PAI->EventHandler.triggerListener("EFFECT_TICK", m_POwner);
        m_EffectCheckTime = tick;

        for (uint16 i = 0; i < m_StatusEffectList.size(); ++i)
        {
            CStatusEffect* PStatusEffect = m_StatusEffectList.at(i);

            if (PStatusEffect->GetTickTime() != 0 &&
                PStatusEffect->GetLastTick() + std::chrono::milliseconds(PStatusEffect->GetTickTime()) <= tick)
            {
                PStatusEffect->SetLastTick(tick);
                luautils::OnEffectTick(m_POwner, PStatusEffect);
            }

            if (PStatusEffect->GetDuration() != 0 &&
                std::chrono::milliseconds(PStatusEffect->GetDuration()) + PStatusEffect->GetStartTime() <= tick && i < m_StatusEffectList.size())
            {
                RemoveStatusEffect(i--);
            }
        }
    }
}
开发者ID:Deadwing888,项目名称:darkstar,代码行数:33,代码来源:status_effect_container.cpp

示例3: DSP_DEBUG_BREAK_IF

void CStatusEffectContainer::CheckEffects(uint32 tick)
{
	DSP_DEBUG_BREAK_IF(m_POwner == nullptr);

	if (!m_POwner->isDead())
	{
		if ((tick - m_EffectCheckTime) < 1000 )
		{
			return;
		}

		m_EffectCheckTime = tick;

		for (uint16 i = 0; i < m_StatusEffectList.size(); ++i)
		{
			CStatusEffect* PStatusEffect = m_StatusEffectList.at(i);

			if (PStatusEffect->GetTickTime() != 0 &&
				PStatusEffect->GetLastTick() + PStatusEffect->GetTickTime() <= tick)
			{
				PStatusEffect->SetLastTick(tick);
				luautils::OnEffectTick(m_POwner,PStatusEffect);
			}

			if (PStatusEffect->GetDuration() != 0 &&
				PStatusEffect->GetDuration() + PStatusEffect->GetStartTime() <= tick && i <m_StatusEffectList.size())
			{
				RemoveStatusEffect(i--);
			}
		}
    }
}
开发者ID:DomingoSeven,项目名称:darkstar,代码行数:32,代码来源:status_effect_container.cpp

示例4: RemoveStatusEffect

void CStatusEffectContainer::DelStatusEffectsByFlag(uint32 flag, bool silent)
{
    for (uint16 i = 0; i < m_StatusEffectList.size(); ++i)
	{
        if (m_StatusEffectList.at(i)->GetFlag() & flag)
		{
			RemoveStatusEffect(i--, silent);
		}
	}
}
开发者ID:DomingoSeven,项目名称:darkstar,代码行数:10,代码来源:status_effect_container.cpp

示例5: RemoveStatusEffect

void CStatusEffectContainer::DelStatusEffectsByType(uint16 Type)
{
if(Type <= 0) return;
for (uint16 i = 0; i < m_StatusEffectList.size(); ++i)
{
if (m_StatusEffectList.at(i)->GetType() == Type)
{
RemoveStatusEffect(i--, true);
}
}
}
开发者ID:will4wachter,项目名称:Project1,代码行数:11,代码来源:status_effect_container.cpp

示例6: RemoveStatusEffect

bool CStatusEffectContainer::DispelStatusEffect(bool RemoveAll)
{
	for (uint32 i = 0; i < m_StatusEffectList.size(); ++i)
	{
		if (m_StatusEffectList.at(i)->GetFlag() == EFFECTFLAG_DISPELABLE)
		{
			RemoveStatusEffect(i--);
			if (!RemoveAll) return true;
		}
	}
	return false;
}
开发者ID:Laterus,项目名称:Darkstar-Linux-Fork,代码行数:12,代码来源:status_effect_container.cpp


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