From b89eeb0f85c1735fa105bd281060e743152a566f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 28 Jul 2020 10:10:06 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 30 ++++++++++++++++++++---------- server/gameserver/human.h | 1 - server/gameserver/types.cc | 1 - 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index dc4e643..54f0c1b 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -470,10 +470,6 @@ void Human::Shot(a8::Vec2& target_dir, bool& shot_ok) shot_ok = true; } -void Human::DirectShot(MetaData::Equip* bullet_meta, int skill_id, bool& shot_ok) -{ -} - void Human::TankShot(a8::Vec2& target_dir) { if (!tank_weapon.meta) { @@ -3394,12 +3390,26 @@ void Human::ProcSkillPhase(MetaData::SkillPhase* phase) break; case kSkill_Shot: { - MetaData::Equip* bullet_meta = MetaMgr::Instance()->GetEquip(phase->param1.GetInt()); - if (bullet_meta) { - a8::Vec2 old_attack_dir = attack_dir; - bool shot_ok = false; - DirectShot(bullet_meta, skill_meta_->i->skill_id(), shot_ok); - attack_dir = old_attack_dir; + MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(phase->param1.GetInt()); + if (weapon_meta) { + MetaData::EquipUpgrade* weapon_upgrade_meta = + MetaMgr::Instance()->GetEquipUpgrade(weapon_meta->i->id()); + MetaData::Equip* bullet_meta = + MetaMgr::Instance()->GetEquip(weapon_meta->i->use_bullet()); + if (weapon_upgrade_meta && bullet_meta) { + a8::Vec2 old_attack_dir = attack_dir; + InternalShot + ( + this, + weapon_meta, + weapon_upgrade_meta, + bullet_meta, + 1, + skill_meta_->i->skill_id(), + 5, + false); + attack_dir = old_attack_dir; + } } } break; diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 3fdfb11..d5d70e6 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -171,7 +171,6 @@ class Human : public MoveableEntity long long GetRealDeadFrameNo(Room* room); void FillMFTeamData(cs::MFTeamData* team_data, bool is_game_over); void Shot(a8::Vec2& target_dir, bool& shot_ok); - void DirectShot(MetaData::Equip* bullet_meta, int skill_id, bool& shot_ok); void TankShot(a8::Vec2& target_dir); void RecalcSelfCollider(); bool IsCollisionInMapService(); diff --git a/server/gameserver/types.cc b/server/gameserver/types.cc index 667e895..6065e3a 100644 --- a/server/gameserver/types.cc +++ b/server/gameserver/types.cc @@ -88,4 +88,3 @@ a8::Vec2 BornPoint::RandPoint() const } return born_point; } -