diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 866ecd2..9c58a82 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1615,7 +1615,7 @@ void Human::_UpdateAssaultMove() std::set target_list; for (auto& cell : grid_list) { for (Human* hum : cell->human_list) { - if (hum->team_id != team_id && hum->pos.Distance(skill_target_pos) < hum->GetRadius()) { + if (hum->team_id != team_id && hum->pos.Distance(skill_target_pos) < phase->param3.GetDouble()) { if (!hum->HasBuffEffect(kBET_Invincible)) { float power = phase->param1.GetDouble() + ability.atk; float def = hum->ability.def; @@ -1623,11 +1623,25 @@ void Human::_UpdateAssaultMove() hum->DecHP(finally_dmg, entity_uniid, name, 0); target_list.insert(hum); } - a8::Vec2 push_dir = skill_dir; + a8::Vec2 push_dir = hum->pos - skill_target_pos; if (std::abs(push_dir.x) > FLT_EPSILON || std::abs(push_dir.y) > FLT_EPSILON) { push_dir.Normalize(); + skill_dir.Normalize(); + a8::Vec2 old_push_dir = push_dir; + push_dir.x = old_push_dir.y; + push_dir.y = old_push_dir.x; + if (skill_dir.CalcAngle(push_dir) < 0.001f) { + push_dir = skill_dir; + } hum->PushHuman(push_dir, phase->param2.GetDouble()); + } else { + push_dir = skill_dir; + if (std::abs(push_dir.x) > FLT_EPSILON || + std::abs(push_dir.y) > FLT_EPSILON) { + push_dir.Normalize(); + hum->PushHuman(push_dir, phase->param2.GetDouble()); + } } } } diff --git a/server/gameserver/metadata.cc b/server/gameserver/metadata.cc index 355d629..4eda79a 100644 --- a/server/gameserver/metadata.cc +++ b/server/gameserver/metadata.cc @@ -339,9 +339,14 @@ namespace MetaData auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param2", {idx})); phase.param2_str = reflection->GetString(*(metatable::Skill*)i, field_desc); } + { + auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param3", {idx})); + phase.param3_str = reflection->GetString(*(metatable::Skill*)i, field_desc); + } if (phase.func_id != kSkill_FuncNone) { phase.param1 = a8::XValue(phase.param1_str); phase.param2 = a8::XValue(phase.param2_str); + phase.param3 = a8::XValue(phase.param3_str); phases.push_back(phase); } } diff --git a/server/gameserver/metadata.h b/server/gameserver/metadata.h index ef748c0..503f15d 100755 --- a/server/gameserver/metadata.h +++ b/server/gameserver/metadata.h @@ -151,9 +151,11 @@ namespace MetaData SkillFunc_e func_id = kSkill_FuncNone; a8::XValue param1; a8::XValue param2; + a8::XValue param3; std::string param1_str; std::string param2_str; + std::string param3_str; }; struct Skill diff --git a/server/tools/protobuild/metatable.proto b/server/tools/protobuild/metatable.proto index 14f3b0c..f8588d5 100755 --- a/server/tools/protobuild/metatable.proto +++ b/server/tools/protobuild/metatable.proto @@ -125,16 +125,19 @@ message Skill optional int32 phase1_func = 21; optional string phase1_param1 = 22; optional string phase1_param2 = 23; + optional string phase1_param3 = 24; optional int32 phase2_time_offset = 30; optional int32 phase2_func = 31; optional string phase2_param1 = 32; optional string phase2_param2 = 33; + optional string phase2_param3 = 34; optional int32 phase3_time_offset = 40; optional int32 phase3_func = 41; optional string phase3_param1 = 42; optional string phase3_param2 = 43; + optional string phase3_param3 = 44; }