diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 9860e40..d30f74c 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -2000,17 +2000,7 @@ void Human::WinExp(Human* sender, int exp) room->frame_event.AddZombieIdChg(this); OnMetaChange(); if (GetRace() == kZombieRace && meta->i->level() == 3) { - room->TouchPlayerList - ( - a8::XParams() - .SetParam1(meta->i->name()), - [] (Player* hum, a8::XParams& param) - { - hum->SendSysPiaoMsg(a8::Format("%s出现了", {param.param1.GetString()}), - a8::MkRgb(255, 0, 0), - 3); - } - ); + room->OnZombieAppear(this); } } } diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 763fb48..4f1ede5 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1455,6 +1455,24 @@ void Room::AirDrop(int appear_time, int box_id, int airdrop_id) } } +void Room::OnZombieAppear(Human* hum) +{ + if (hum->GetRace() == kZombieRace && hum->meta->i->level() == 3 && !sent_zombie_boss_notify) { + sent_zombie_boss_notify = true; + TouchPlayerList + ( + a8::XParams() + .SetParam1(hum->meta->i->name()), + [] (Player* hum, a8::XParams& param) + { + hum->SendSysPiaoMsg(a8::Format("%s出现了", {param.param1.GetString()}), + a8::MkRgb(255, 0, 0), + 3); + } + ); + } +} + void Room::AdjustAirDropPos(MetaData::MapThing* thing_meta, a8::Vec2& box_pos) { if (room_type_ == RT_NewBrid) { diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 4f6b461..ef5400a 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -137,6 +137,7 @@ public: void RemoveRescue(Human* hum); void NotifyCountdown(const std::string& msg, int time); void NotifySysPiao(const std::string& msg, int color, int duration); + void OnZombieAppear(Human* hum); private: int AllocUniid(); @@ -237,6 +238,7 @@ private: const std::vector* buildings_ = nullptr; const std::vector* level0room_spec_things_ = nullptr; Human* first_newbie_ = nullptr; + bool sent_zombie_boss_notify = false; bool waiting_start_ = false; GasData gas_data_;