From f98124ec0a2cb9ce1a271285f9790b83e9452ac8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 15 Mar 2021 13:38:47 +0800 Subject: [PATCH] 1 --- server/gameserver/constant.h | 2 ++ server/gameserver/human.cc | 25 +++++++++++++++---------- server/gameserver/metamgr.cc | 1 - server/gameserver/metamgr.h | 1 - 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index b66878e5..14331150 100755 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -399,5 +399,7 @@ const int TERMINATOR_BUFF_ID = 1033; const int TURN_OVER_SKILL_ID = 41001; const int HUNLUAN_BUFFID = 6001; + +const int kThroughWall_BUFFID = 6003; const int FLY_BUFFID = 7001; const int JUMP_BUFFID = 7002; diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 6aa6d88b..af7cb1ba 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1351,19 +1351,23 @@ void Human::DoJump() { if (HasBuffEffect(kBET_Fly)) { RemoveBuffByEffectId(kBET_Fly); + MustBeAddBuff(this, kThroughWall_BUFFID); MustBeAddBuff(this, JUMP_BUFFID); jump_frameno_ = room->GetFrameNo(); SyncAroundPlayers(__FILE__, __LINE__, __func__); - room->xtimer.AddDeadLineTimerAndAttach - (MetaMgr::Instance()->jump_time * SERVER_FRAME_RATE, - a8::XParams() - .SetSender(this), - [] (const a8::XParams& param) - { - Human* hum = (Human*)param.sender.GetUserData(); - hum->OnLand(); - }, - &xtimer_attacher.timer_list_); + MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(JUMP_BUFFID); + if (buff_meta) { + room->xtimer.AddDeadLineTimerAndAttach + (buff_meta->i->duration_time() * SERVER_FRAME_RATE, + a8::XParams() + .SetSender(this), + [] (const a8::XParams& param) + { + Human* hum = (Human*)param.sender.GetUserData(); + hum->OnLand(); + }, + &xtimer_attacher.timer_list_); + } } } @@ -4280,6 +4284,7 @@ void Human::OnBuffRemove(const Buff& buff) void Human::OnLand() { //着陆 + RemoveBuffByEffectId(kBET_Jump); RemoveBuffByEffectId(kBET_ThroughWall); if (IsCollisionInMapService()) { a8::Vec2 old_pos = GetPos(); diff --git a/server/gameserver/metamgr.cc b/server/gameserver/metamgr.cc index 37f55ce1..55bf4590 100755 --- a/server/gameserver/metamgr.cc +++ b/server/gameserver/metamgr.cc @@ -180,7 +180,6 @@ public: } } - MetaMgr::Instance()->jump_time = MetaMgr::Instance()->GetSysParamAsFloat("jump_time"); MetaMgr::Instance()->K = MetaMgr::Instance()->GetSysParamAsFloat("K"); MetaMgr::Instance()->kill_param = MetaMgr::Instance()->GetSysParamAsFloat("kill_parameter"); MetaMgr::Instance()->rank_param = MetaMgr::Instance()->GetSysParamAsFloat("rank_parameter"); diff --git a/server/gameserver/metamgr.h b/server/gameserver/metamgr.h index e3ffdb0e..05e307a5 100755 --- a/server/gameserver/metamgr.h +++ b/server/gameserver/metamgr.h @@ -61,7 +61,6 @@ class MetaMgr : public a8::Singleton int zbmode_game_duration = 60 * 2; int zbmode_player_num = 15; int zbmode_init_zombie_num = 2; - int jump_time = 10; float K = 100.0f; float kill_param = 0.0f; float rank_param = 0.0f;