本文整理汇总了C++中CMonster::GetActModify方法的典型用法代码示例。如果您正苦于以下问题:C++ CMonster::GetActModify方法的具体用法?C++ CMonster::GetActModify怎么用?C++ CMonster::GetActModify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMonster
的用法示例。
在下文中一共展示了CMonster::GetActModify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckTracer
bool FightStateScript::CheckTracer(BaseType::EntityType *entity)
{
if(m_State == TRACING)
{
int ret = m_SkillTracer.Run(entity);
if(ret == SkillTracer::TIMEOUT ||
ret == SkillTracer::FAILED)
{
OnUseSkillEnd(ret);
}
if(ret == SkillTracer::Okay)
{
MonsterAI *ai = dynamic_cast<MonsterAI*>(entity);
CMonster *monster = dynamic_cast<CMonster*>(entity->GetOwner());
CServerRegion *region = dynamic_cast<CServerRegion*>(monster->GetFather());
CMoveShape *target = AIUtils::FindShape(region, m_SkillTracer.m_TargetID);
if(target == NULL)
{
OnUseSkillEnd(SkillTracer::FAILED);
}
else
{
ai->BeginSkill(m_SkillTracer.m_SkillID, m_SkillTracer.m_SkillLvl, target);
long actTime = monster->GetActModify(m_SkillTracer.m_SkillID);
ai->SetTimer(AIDriver::SCRIPT_EVENT, actTime);
}
}
return true;
}
return false;
}
示例2: ReceiveEvent
void FightStateScript::ReceiveEvent(BaseType::EntityType *entity, const BaseType::EventType &ev)
{
SelfType::ReceiveEvent(entity, ev);
if(ev.Type() == ET_SCRIPT_USESKILL)
{
const ScriptUseSkillEvent &sev = (const ScriptUseSkillEvent&) ev;
CMonster *monster = dynamic_cast<CMonster*>(entity->GetOwner());
CServerRegion *region = dynamic_cast<CServerRegion*>(monster->GetFather());
MonsterAI *ai = dynamic_cast<MonsterAI*>(entity);
long id = sev.id;
long lvl = sev.lvl;
long actTime = monster->GetActModify(sev.id);
if(sev.type == ScriptUseSkillEvent::SHAPE)
{
if(sev.trace)
{
// trace the target
m_SkillTracer.Init(id, lvl, sev.targetId, sev.traceTime);
m_skillScriptID = sev.scriptId;
m_State = TRACING;
entity->Resume(0);
return ;
}
else
{
CMoveShape *target = AIUtils::FindShape(region, sev.targetId);
if(target == NULL)
{
OnUseSkillEnd(SkillTracer::FAILED);
return ;
}
ai->BeginSkill(id, lvl, target);
}
}
else if(sev.type == ScriptUseSkillEvent::CELL)
{
ai->BeginSkill(id, lvl, sev.x, sev.y);
}
m_skillScriptID = sev.scriptId;
// register act time timer
ai->SetTimer(AIDriver::SCRIPT_EVENT, actTime);
}
else if(ev.Type() == ET_SCRIPT_SKILLEND)
{
OnUseSkillEnd(SkillTracer::Okay);
}
else if(ev.Type() == ET_KILL)
{
entity->ChangeState(ST_DEAD);
}
}