添加技能阶段时间处理
This commit is contained in:
parent
0d49fb2337
commit
b188d479a1
@ -429,6 +429,9 @@ void AndroidNewAI::UpdateNewAI()
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (hum->playing_skill) {
|
||||||
|
hum->UpdateSkill();
|
||||||
|
}
|
||||||
++node_.exec_frame_num;
|
++node_.exec_frame_num;
|
||||||
hum->shot_hold = false;
|
hum->shot_hold = false;
|
||||||
switch (node_.main_state) {
|
switch (node_.main_state) {
|
||||||
|
@ -482,6 +482,12 @@ bool Creature::CanUseSkill(int skill_id)
|
|||||||
if (!skill) {
|
if (!skill) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (dead) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (playing_skill) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return skill->GetCurrTimes() > 0;
|
return skill->GetCurrTimes() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,7 +568,7 @@ void Creature::ResetSkill()
|
|||||||
|
|
||||||
void Creature::UpdateSkill()
|
void Creature::UpdateSkill()
|
||||||
{
|
{
|
||||||
if (CurrentSkill()) {
|
if (CurrentSkill() && !dead) {
|
||||||
if (curr_skill_phase < CurrentSkill()->meta->phases.size()) {
|
if (curr_skill_phase < CurrentSkill()->meta->phases.size()) {
|
||||||
MetaData::SkillPhase* phase = &CurrentSkill()->meta->phases[curr_skill_phase];
|
MetaData::SkillPhase* phase = &CurrentSkill()->meta->phases[curr_skill_phase];
|
||||||
if (phase->time_offset >= CurrentSkill()->GetPassedTime()) {
|
if (phase->time_offset >= CurrentSkill()->GetPassedTime()) {
|
||||||
@ -572,6 +578,8 @@ void Creature::UpdateSkill()
|
|||||||
} else {
|
} else {
|
||||||
playing_skill = false;
|
playing_skill = false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
playing_skill = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ class Creature : public MoveableEntity
|
|||||||
std::function<bool ()> on_move_collision;
|
std::function<bool ()> on_move_collision;
|
||||||
bool poisoning = false;
|
bool poisoning = false;
|
||||||
long long poisoning_time = 0;
|
long long poisoning_time = 0;
|
||||||
|
bool playing_skill = false;
|
||||||
|
|
||||||
Weapon car_weapon;
|
Weapon car_weapon;
|
||||||
a8::Vec2 buff_vec2_param1;
|
a8::Vec2 buff_vec2_param1;
|
||||||
@ -140,6 +141,7 @@ class Creature : public MoveableEntity
|
|||||||
Weapon* GetCurrWeapon() { return curr_weapon_; };
|
Weapon* GetCurrWeapon() { return curr_weapon_; };
|
||||||
void SetCurrWeapon(Weapon* weapon);
|
void SetCurrWeapon(Weapon* weapon);
|
||||||
void ResetAllSkillCd();
|
void ResetAllSkillCd();
|
||||||
|
void UpdateSkill();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -148,7 +150,6 @@ private:
|
|||||||
virtual void DoSkillPreProc(int skill_id, int target_id, const a8::Vec2& target_pos);
|
virtual void DoSkillPreProc(int skill_id, int target_id, const a8::Vec2& target_pos);
|
||||||
virtual void DoSkillPostProc(bool used, int skill_id, int target_id, const a8::Vec2& target_pos);
|
virtual void DoSkillPostProc(bool used, int skill_id, int target_id, const a8::Vec2& target_pos);
|
||||||
|
|
||||||
void UpdateSkill();
|
|
||||||
void ProcSkillPhase(MetaData::SkillPhase* phase);
|
void ProcSkillPhase(MetaData::SkillPhase* phase);
|
||||||
void ProcBuffEffect(Creature* caster, Buff* buff);
|
void ProcBuffEffect(Creature* caster, Buff* buff);
|
||||||
void TriggerOneObjectBuff(Skill* skill, Creature* target, BuffTriggerType_e trigger_type);
|
void TriggerOneObjectBuff(Skill* skill, Creature* target, BuffTriggerType_e trigger_type);
|
||||||
@ -177,7 +178,6 @@ private:
|
|||||||
|
|
||||||
a8::Vec2 skill_dir_;
|
a8::Vec2 skill_dir_;
|
||||||
float skill_param1 = 0;
|
float skill_param1 = 0;
|
||||||
bool playing_skill = false;
|
|
||||||
size_t curr_skill_phase = 0;
|
size_t curr_skill_phase = 0;
|
||||||
Skill* curr_skill_ = nullptr;
|
Skill* curr_skill_ = nullptr;
|
||||||
int skill_target_id_ = 0;
|
int skill_target_id_ = 0;
|
||||||
|
@ -129,6 +129,9 @@ void Player::InternalUpdate(int delta_time)
|
|||||||
if (has_use_item_id) {
|
if (has_use_item_id) {
|
||||||
UpdateUseItemId();
|
UpdateUseItemId();
|
||||||
}
|
}
|
||||||
|
if (playing_skill) {
|
||||||
|
UpdateSkill();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +93,9 @@ void ZombieModeAI::UpdateAI()
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (hum->playing_skill) {
|
||||||
|
hum->UpdateSkill();
|
||||||
|
}
|
||||||
++node_->exec_frame_num;
|
++node_->exec_frame_num;
|
||||||
hum->shot_hold = false;
|
hum->shot_hold = false;
|
||||||
switch (node_->main_state) {
|
switch (node_->main_state) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user