This commit is contained in:
aozhiwei 2021-07-23 04:08:00 +00:00
parent bf5e70c166
commit 37ea336545
7 changed files with 8 additions and 8 deletions

View File

@ -535,7 +535,7 @@ void AndroidAI::ChangeToStateNewAI(AndroidStateEx_e to_state)
Creature* AndroidAI::GetTarget() Creature* AndroidAI::GetTarget()
{ {
if (GetAiLevel() <= 1) { if (ai_meta->i->attack_range() <= 0) {
return nullptr; return nullptr;
} }
Human* myself = (Human*)owner; Human* myself = (Human*)owner;

View File

@ -514,3 +514,5 @@ const long long SPEC_MAP_OBJECT_FLAGS = A8_DEFINE_RANGE_BIT(long long, kCollider
const float DEFAULT_FLY_DISTANCE = 5.0f; const float DEFAULT_FLY_DISTANCE = 5.0f;
const int MAP_BLOCK_START_ID = 1000000000; const int MAP_BLOCK_START_ID = 1000000000;
const int ANDROID_AI_ID_START = 1001;

View File

@ -379,11 +379,9 @@ void HeroAI::ChangeToStateAI(HeroState_e to_state)
Creature* HeroAI::GetTarget() Creature* HeroAI::GetTarget()
{ {
#if 0 if (ai_meta->i->attack_range() <= 0) {
if (GetAiLevel() <= 1) {
return nullptr; return nullptr;
} }
#endif
Hero* myself = (Hero*)owner; Hero* myself = (Hero*)owner;
if (myself->room->GetGasData().gas_mode == GasInactive) { if (myself->room->GetGasData().gas_mode == GasInactive) {
return nullptr; return nullptr;

View File

@ -249,7 +249,7 @@ void Hero::InitAI()
#ifdef DEBUG #ifdef DEBUG
abort(); abort();
#endif #endif
ai_meta = MetaMgr::Instance()->GetHeroAI(1001); ai_meta = MetaMgr::Instance()->GetHeroAI(ANDROID_AI_ID_START);
} }
if (!ai_meta) { if (!ai_meta) {
abort(); abort();

View File

@ -694,7 +694,7 @@ private:
item.Init(); item.Init();
ai_hash[item.i->id()] = &item; ai_hash[item.i->id()] = &item;
if (item.i->ai_kind() == kAI_Android) { if (item.i->ai_kind() == kAI_Android) {
android_ai_hash[a8::MakeInt64(meta.ai_level(), meta.ai_mode())] = &item; android_ai_hash[a8::MakeInt64(meta.id() - ANDROID_AI_ID_START + 1, meta.ai_mode())] = &item;
} }
} }

View File

@ -379,7 +379,7 @@ void ZombieModeAI::ChangeToState(ZombieState_e to_state)
Creature* ZombieModeAI::GetTarget() Creature* ZombieModeAI::GetTarget()
{ {
if (GetAiLevel() <= 1) { if (ai_meta->i->attack_range() <= 0) {
return nullptr; return nullptr;
} }
Human* myself = (Human*)owner; Human* myself = (Human*)owner;

View File

@ -340,7 +340,7 @@ message KillPoint
message AI message AI
{ {
optional int32 id = 13; optional int32 id = 13;
optional int32 ai_level = 1; //optional int32 ai_level = 1;
optional int32 pursuit_radius = 2; optional int32 pursuit_radius = 2;
optional int32 attack_interval = 3; optional int32 attack_interval = 3;
optional int32 attack_times = 4; optional int32 attack_times = 4;