From e360400b6b93161029c3edbc3ac257198b9be664 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 29 Jul 2020 14:36:47 +0800 Subject: [PATCH] rename zombieai -> zombiemodeai --- server/gameserver/android.cc | 4 +-- .../{zombie.ai.cc => zombiemode.ai.cc} | 34 +++++++++---------- .../{zombie.ai.h => zombiemode.ai.h} | 6 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) rename server/gameserver/{zombie.ai.cc => zombiemode.ai.cc} (95%) rename server/gameserver/{zombie.ai.h => zombiemode.ai.h} (87%) diff --git a/server/gameserver/android.cc b/server/gameserver/android.cc index 24269b1..fdb14dc 100644 --- a/server/gameserver/android.cc +++ b/server/gameserver/android.cc @@ -3,13 +3,13 @@ #include "android.h" #include "metamgr.h" #include "android.ai.h" -#include "zombie.ai.h" +#include "zombiemode.ai.h" #include "room.h" #include "app.h" Android::Android():Human() { - ai = new ZombieAI; + ai = new ZombieModeAI; ai->owner = this; #if 0 ++PerfMonitor::Instance()->entity_num[ET_Android]; diff --git a/server/gameserver/zombie.ai.cc b/server/gameserver/zombiemode.ai.cc similarity index 95% rename from server/gameserver/zombie.ai.cc rename to server/gameserver/zombiemode.ai.cc index 47f8c15..4ecb8de 100644 --- a/server/gameserver/zombie.ai.cc +++ b/server/gameserver/zombiemode.ai.cc @@ -2,7 +2,7 @@ #include -#include "zombie.ai.h" +#include "zombiemode.ai.h" #include "android.h" #include "room.h" #include "metamgr.h" @@ -53,17 +53,17 @@ ai级别 8: 跑动射击 */ -ZombieAI::ZombieAI() +ZombieModeAI::ZombieModeAI() { node_ = new ZombieAINode(); } -ZombieAI::~ZombieAI() +ZombieModeAI::~ZombieModeAI() { A8_SAFE_DELETE(node_); } -void ZombieAI::Update(int delta_time) +void ZombieModeAI::Update(int delta_time) { Human* hum = (Human*)owner; if (hum->poisoning) { @@ -81,7 +81,7 @@ void ZombieAI::Update(int delta_time) UpdateAI(); } -float ZombieAI::GetAttackRate() +float ZombieModeAI::GetAttackRate() { if (!node_->ai_meta) { return 1; @@ -90,7 +90,7 @@ float ZombieAI::GetAttackRate() } } -void ZombieAI::UpdateAI() +void ZombieModeAI::UpdateAI() { Human* hum = (Human*)owner; if (a8::HasBitFlag(hum->status, HS_Disable)) { @@ -145,7 +145,7 @@ void ZombieAI::UpdateAI() } } -void ZombieAI::UpdateIdle() +void ZombieModeAI::UpdateIdle() { Human* hum = (Human*)owner; if (hum->room->GetFrameNo() > node_->frameno + node_->param1) { @@ -153,7 +153,7 @@ void ZombieAI::UpdateIdle() } } -void ZombieAI::UpdateThinking() +void ZombieModeAI::UpdateThinking() { Human* hum = (Human*)owner; if (hum->room->GetGasData().gas_mode == GasInactive || @@ -183,7 +183,7 @@ void ZombieAI::UpdateThinking() } } -void ZombieAI::UpdateAttack() +void ZombieModeAI::UpdateAttack() { Human* myself = (Human*)owner; if (!node_->target || node_->target->dead) { @@ -245,7 +245,7 @@ void ZombieAI::UpdateAttack() } } -void ZombieAI::UpdateRandomWalk() +void ZombieModeAI::UpdateRandomWalk() { Human* hum = (Human*)owner; if (hum->room->GetFrameNo() > node_->frameno + node_->param1) { @@ -253,7 +253,7 @@ void ZombieAI::UpdateRandomWalk() } } -void ZombieAI::UpdatePursuit() +void ZombieModeAI::UpdatePursuit() { Human* myself = (Human*)owner; float distance = myself->GetPos().Distance(node_->target->GetPos()); @@ -266,7 +266,7 @@ void ZombieAI::UpdatePursuit() } } -void ZombieAI::DoMove() +void ZombieModeAI::DoMove() { Human* hum = (Human*)owner; if (std::abs(hum->move_dir.x) > FLT_EPSILON || @@ -290,7 +290,7 @@ void ZombieAI::DoMove() } } -void ZombieAI::ChangeToState(ZombieState_e to_state) +void ZombieModeAI::ChangeToState(ZombieState_e to_state) { Human* hum = (Human*)owner; switch (to_state) { @@ -361,7 +361,7 @@ void ZombieAI::ChangeToState(ZombieState_e to_state) node_->exec_frame_num = 0; } -Human* ZombieAI::GetTarget() +Human* ZombieModeAI::GetTarget() { if (GetAiLevel() <= 1) { return nullptr; @@ -411,7 +411,7 @@ Human* ZombieAI::GetTarget() return target; } -float ZombieAI::GetAttackRange() +float ZombieModeAI::GetAttackRange() { float attack_range = 0; Human* myself = (Human*)owner; @@ -424,7 +424,7 @@ float ZombieAI::GetAttackRange() return attack_range; } -void ZombieAI::DoShot() +void ZombieModeAI::DoShot() { Human* myself = (Human*)owner; if (!node_->target) { @@ -464,7 +464,7 @@ void ZombieAI::DoShot() } } -int ZombieAI::GetAttackTimes() +int ZombieModeAI::GetAttackTimes() { Human* myself = (Human*)owner; if (myself->curr_weapon) { diff --git a/server/gameserver/zombie.ai.h b/server/gameserver/zombiemode.ai.h similarity index 87% rename from server/gameserver/zombie.ai.h rename to server/gameserver/zombiemode.ai.h index 59abe5f..66cccb8 100644 --- a/server/gameserver/zombie.ai.h +++ b/server/gameserver/zombiemode.ai.h @@ -13,12 +13,12 @@ enum ZombieState_e class Human; class ZombieAINode; -class ZombieAI : public AIComponent +class ZombieModeAI : public AIComponent { public: - ZombieAI(); - virtual ~ZombieAI() override; + ZombieModeAI(); + virtual ~ZombieModeAI() override; virtual void Update(int delta_time) override; float GetAttackRate();