This commit is contained in:
aozhiwei 2021-03-19 16:20:56 +08:00
parent 568e52a485
commit 883b1373c1
2 changed files with 8 additions and 2 deletions

View File

@ -372,6 +372,7 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std:
break; break;
case kST_EnemyAndSelf: case kST_EnemyAndSelf:
{ {
#if 0
TouchAllLayerHumanList TouchAllLayerHumanList
( (
[this, skill, &target_pos, &target_list] (Human* hum, bool& stop) [this, skill, &target_pos, &target_list] (Human* hum, bool& stop)
@ -381,6 +382,7 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std:
target_list.insert(hum); target_list.insert(hum);
} }
}); });
#endif
} }
break; break;
case kST_SingleEnemyAndSelf: case kST_SingleEnemyAndSelf:
@ -470,8 +472,10 @@ void Creature::DoSkill(int skill_id, int target_id, const a8::Vec2& target_pos)
DoSkillPreProc(skill_id, target_id, target_pos); DoSkillPreProc(skill_id, target_id, target_pos);
skill_target_id_ = target_id; skill_target_id_ = target_id;
skill_target_pos_ = target_pos; skill_target_pos_ = target_pos;
if (CanUseSkill(skill_id)) { Skill* skill = GetSkill(skill_id);
if (skill && CanUseSkill(skill_id)) {
ResetSkill(); ResetSkill();
curr_skill_ = skill;
playing_skill = true; playing_skill = true;
CurrentSkill()->last_use_frameno = room->GetFrameNo(); CurrentSkill()->last_use_frameno = room->GetFrameNo();
if (CurrentSkill()->meta->i->skill_target() == kST_Self if (CurrentSkill()->meta->i->skill_target() == kST_Self
@ -511,6 +515,7 @@ void Creature::DoSkillPostProc(bool used, int skill_id, int target_id, const a8:
void Creature::ResetSkill() void Creature::ResetSkill()
{ {
curr_skill_ = nullptr;
curr_skill_phase = 0; curr_skill_phase = 0;
skill_dir = a8::Vec2(); skill_dir = a8::Vec2();
skill_target_pos_ = a8::Vec2(); skill_target_pos_ = a8::Vec2();
@ -596,7 +601,7 @@ MetaData::SkillPhase* Creature::GetCurrSkillPhase()
Skill* Creature::CurrentSkill() Skill* Creature::CurrentSkill()
{ {
return nullptr; return curr_skill_;
} }
void Creature::ProcBuffEffect(Creature* caster, Buff* buff) void Creature::ProcBuffEffect(Creature* caster, Buff* buff)

View File

@ -90,6 +90,7 @@ private:
float skill_param1 = 0; float skill_param1 = 0;
bool playing_skill = false; bool playing_skill = false;
size_t curr_skill_phase = 0; size_t curr_skill_phase = 0;
Skill* curr_skill_ = nullptr;
int skill_target_id_ = 0; int skill_target_id_ = 0;
a8::Vec2 skill_target_pos_; a8::Vec2 skill_target_pos_;
std::map<int, Skill*> skill_hash_; std::map<int, Skill*> skill_hash_;