From dfe106e9538f1680963d926edcce00ad36ecf275 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 28 Jul 2020 17:46:03 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 24 ++++++++++++++++++++++++ server/gameserver/metamgr.cc | 1 + server/gameserver/metamgr.h | 1 + server/gameserver/room.cc | 4 ++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 0262129..f77a9d8 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -552,6 +552,15 @@ bool Human::IsCollisionInMapService() DropItems(obstacle); } obstacle->BroadcastFullState(room); + if (obstacle->IsEntitySubType(EST_RoomObstacle)) { + bool is_terminator_airdrop_box = ((RoomObstacle*)obstacle)->is_terminator_airdrop_box; + if (is_terminator_airdrop_box && GetRace() == kHumanRace) { + MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(TERMINATOR_BUFF_ID); + if (buff_meta) { + AddBuff(this, buff_meta, 1); + } + } + } } else { Global::last_collider = collider; return true; @@ -3042,6 +3051,21 @@ void Human::ProcBuffEffect(Human* caster, Buff* buff) int i = 0; } break; + case kBET_Terminator: + { + if (GetRace() == kHumanRace && + MetaMgr::Instance()->terminator_meta && + meta != MetaMgr::Instance()->terminator_meta) { + WinExp(this, MetaMgr::Instance()->terminator_meta->i->exp() + 1); + room->NotifySysPiao("终结者出现", a8::MkRgb(255, 0, 0), 3); + } + } + break; + case kBET_PlayShotAni: + { + + } + break; default: { } diff --git a/server/gameserver/metamgr.cc b/server/gameserver/metamgr.cc index 3a7f45e..73f57b4 100755 --- a/server/gameserver/metamgr.cc +++ b/server/gameserver/metamgr.cc @@ -345,6 +345,7 @@ public: if (!MetaMgr::Instance()->android_meta) { abort(); } + MetaMgr::Instance()->terminator_meta = MetaMgr::Instance()->GetPlayer(5005); } #endif Check(); diff --git a/server/gameserver/metamgr.h b/server/gameserver/metamgr.h index 183f65d..de59096 100755 --- a/server/gameserver/metamgr.h +++ b/server/gameserver/metamgr.h @@ -131,6 +131,7 @@ class MetaMgr : public a8::Singleton int map_cell_width = 64 * 8; MetaData::Player* human_meta = nullptr; MetaData::Player* android_meta = nullptr; + MetaData::Player* terminator_meta = nullptr; private: MetaDataLoader* loader_ = nullptr; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 8f42764..5afce72 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1415,8 +1415,8 @@ void Room::AirDrop(int appear_time, int box_id, int airdrop_id) { Room* room = (Room*)param.sender.GetUserData(); if (!room->IsGameOver()) { - int airdrop_id = a8::Low32(param.param1.GetInt()); - int box_id = a8::High32(param.param1.GetInt()); + int airdrop_id = a8::Low32(param.param1.GetInt64()); + int box_id = a8::High32(param.param1.GetInt64()); RoomObstacle* obstacle = room->CreateObstacle ( box_id,