This commit is contained in:
aozhiwei 2021-03-18 15:36:04 +08:00
parent fbb35b6e3d
commit a87564932e
5 changed files with 13 additions and 5 deletions

View File

@ -1337,7 +1337,7 @@ void Human::DoJump()
} }
} }
void Human::DoSkill(int target_id, const a8::Vec2& target_pos) void Human::DoSkill(int skill_id, int target_id, const a8::Vec2& target_pos)
{ {
skill_target_id_ = target_id; skill_target_id_ = target_id;
skill_target_pos_ = target_pos; skill_target_pos_ = target_pos;
@ -1381,6 +1381,11 @@ void Human::DoSkill(int target_id, const a8::Vec2& target_pos)
use_skill = false; use_skill = false;
} }
int Human::SelectSkillId()
{
return 0;
}
void Human::DoGetOn(int obj_uniid) void Human::DoGetOn(int obj_uniid)
{ {
if (room->GetGasData().gas_mode == GasInactive) { if (room->GetGasData().gas_mode == GasInactive) {

View File

@ -195,7 +195,8 @@ class Human : public Creature
bool HasNoDownedTeammate(); bool HasNoDownedTeammate();
bool CanUseSkill(); bool CanUseSkill();
void DoJump(); void DoJump();
void DoSkill(int target_id, const a8::Vec2& target_pos); void DoSkill(int skill_id, int target_id, const a8::Vec2& target_pos);
virtual int SelectSkillId();
void DoGetOn(int obj_uniid); void DoGetOn(int obj_uniid);
void DoGetDown(); void DoGetDown();
void FindLocation(); void FindLocation();

View File

@ -393,7 +393,7 @@ void Player::UpdateUseSkill()
if (HasBuffEffect(kBET_Vertigo)) { if (HasBuffEffect(kBET_Vertigo)) {
return; return;
} }
DoSkill(skill_target_id, a8::Vec2()); DoSkill(use_skill_id, skill_target_id, a8::Vec2());
} }
void Player::Shot() void Player::Shot()
@ -1111,7 +1111,8 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
} }
if (msg.has_use_skill()) { if (msg.has_use_skill()) {
use_skill = msg.use_skill(); use_skill = msg.use_skill();
skill_target_id = msg.skill_target_id_(); use_skill_id = msg.skill_id();
skill_target_id = msg.skill_target_id();
} else { } else {
use_skill = false; use_skill = false;
} }

View File

@ -58,6 +58,7 @@ class Player : public Human
bool jump = false; bool jump = false;
bool use_skill = false; bool use_skill = false;
int use_skill_id = 0;
int skill_target_id = 0; int skill_target_id = 0;
bool get_down = false; bool get_down = false;

View File

@ -477,7 +477,7 @@ void ZombieModeAI::DoShot()
void ZombieModeAI::DoSkill() void ZombieModeAI::DoSkill()
{ {
Human* myself = (Human*)owner; Human* myself = (Human*)owner;
myself->DoSkill(node_->target->GetEntityUniId(), node_->target->GetPos()); myself->DoSkill(myself->SelectSkillId(), node_->target->GetEntityUniId(), node_->target->GetPos());
} }
int ZombieModeAI::GetAttackTimes() int ZombieModeAI::GetAttackTimes()