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