This commit is contained in:
aozhiwei 2023-05-23 10:35:00 +08:00
parent 3b6771554f
commit 5a39f74711
4 changed files with 17 additions and 0 deletions

View File

@ -3288,3 +3288,13 @@ void Creature::AdjustPos()
GetMutablePos().SetZ(0);
}
}
Skill* Creature::GetMainSkill()
{
for (auto& pair : skill_hash_) {
if (pair.second->IsMainSkill()) {
return pair.second.get();
}
}
return nullptr;
}

View File

@ -190,6 +190,7 @@ class Creature : public MoveableEntity
void ClearBuffList();
void TriggerBuff(Skill* skill, std::set<Creature*>& target_list, BuffTriggerType_e trigger_type);
Skill* GetSkill(int skill_id);
Skill* GetMainSkill();
int GetSkillTargetId() { return skill_target_id_; };
void AddSkill(int skill_id);
void ClearSkill();

View File

@ -492,3 +492,8 @@ void Skill::CancelMinorMode()
}
}
}
bool Skill::IsMainSkill()
{
return owner->GetBattleContext()->IsMainSkill(this);
}

View File

@ -45,6 +45,7 @@ class Skill
void CancelMinorMode();
void ProcSkillPhase(const mt::SkillPhase* phase);
bool Actived() { return actived_; }
bool IsMainSkill();
private:
void InitActiveSkill();