From 1034e78b2586c189c9ea24026095381567944b11 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 20 Apr 2023 11:59:49 +0800 Subject: [PATCH] 1 --- server/gameserver/mt/Param.cc | 5 +++++ server/gameserver/mt/Param.h | 1 + server/gameserver/room.cc | 31 +++++++++++++++++++++++++++++-- server/gameserver/room.h | 1 + 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/server/gameserver/mt/Param.cc b/server/gameserver/mt/Param.cc index d479c961..83d9a79c 100644 --- a/server/gameserver/mt/Param.cc +++ b/server/gameserver/mt/Param.cc @@ -1,6 +1,7 @@ #include "precompile.h" #include "mt/Param.h" +#include "mt/SafeArea.h" IMPL_TABLE(mt::Param) mt::Param::S mt::Param::s_; @@ -64,6 +65,10 @@ namespace mt s_.newbie_room_skills.push_back(a8::XValue(str)); } } + { + const mt::SafeArea* p = mt::SafeArea::GetById(GetIntParam("newbie_room_area")); + s_.newbie_room_area.push_back(p); + } #endif #ifdef DEBUG s_.match_team_time = 6; diff --git a/server/gameserver/mt/Param.h b/server/gameserver/mt/Param.h index 21481f2f..870e1657 100644 --- a/server/gameserver/mt/Param.h +++ b/server/gameserver/mt/Param.h @@ -24,6 +24,7 @@ namespace mt int newbie_room_hero_id = 0; int newbie_room_weapon_id = 0; std::vector newbie_room_skills; + std::vector newbie_room_area; int downed_relive_recover_hp = 0; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 5f0e5cdd..4e8f9a04 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1214,7 +1214,9 @@ void Room::UpdateGas() void Room::UpdateGasInactive() { - if (IsPveRoom()) { + if (IsNewBieRoom()) { + UpdateGasInactiveNewBie(); + } else if (IsPveRoom()) { UpdateGasInactivePve(); } else { UpdateGasInactivePvp(); @@ -1307,9 +1309,34 @@ void Room::UpdateGasInactivePve() } } +void Room::UpdateGasInactiveNewBie() +{ + { + auto first_safearea = mt::Param::s().newbie_room_area.at(0); + gas_data_.SetGasMode(GasWaiting); + gas_data_.gas_start_frameno = GetFrameNo(); + battle_start_frameno_ = GetFrameNo(); + gas_data_.old_area_meta = first_safearea; + gas_data_.new_area_meta = mt::Param::s().newbie_room_area.at(0); + gas_data_.gas_start_frameno = GetFrameNo(); + gas_data_.pos_new = glm::vec2(gas_data_.new_area_meta->x1(), + gas_data_.new_area_meta->y1()); + gas_data_.pos_old = gas_data_.pos_new; + gas_data_.pos_old_bk = gas_data_.pos_old; + gas_data_.rad_old = gas_data_.old_area_meta->rad(); + gas_data_.rad_new = gas_data_.new_area_meta->rad(); + gas_data_.gas_progress = 0; + } + NotifyUiUpdate(); + ClearPostBattleAutoFreeList(); + OnBattleStart(); + NotifyGameStart(); + InitAndroidAI(); +} + void Room::UpdateGasWaiting() { - if (IsPveRoom()) { + if (IsPveRoom() || IsNewBieRoom()) { } else { if (GetFrameNo() - gas_data_.gas_start_frameno >= diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 6c571867..123372c4 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -246,6 +246,7 @@ private: void UpdateGasInactive(); void UpdateGasInactivePvp(); void UpdateGasInactivePve(); + void UpdateGasInactiveNewBie(); void UpdateGasWaiting(); void UpdateGasMoving(); void UpdateGasJump();