This commit is contained in:
aozhiwei 2021-05-12 19:24:48 +08:00
parent 496e9a11eb
commit a87c3cf085
5 changed files with 19 additions and 3 deletions

View File

@ -121,7 +121,7 @@ namespace MetaData
}
{
std::vector<std::string> strings;
a8::Split(i->airdrop_mon(), strings, '|');
a8::Split(i->monster_list(), strings, '|');
for (const std::string& tmp_str : strings) {
airdrop_mon_list.push_back(a8::XValue(tmp_str));
}

View File

@ -1138,6 +1138,11 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg)
int item_id = a8::XValue(cmds[1]);
int item_num = a8::XValue(cmds[2]);
GMAddItem(item_id, item_num);
} else if (cmd == "shuaguai" && cmds.size() >= 3) {
int hero_id = a8::XValue(cmds[1]);
int hero_num = a8::XValue(cmds[2]);
std::vector<int> mons = std::vector<int>{hero_id};
room->ShuaMon(GetPos(), mons, 100);
} else if (cmd == "addbuff" && cmds.size() >= 2) {
int buff_id = a8::XValue(cmds[1]);
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);

View File

@ -1746,9 +1746,11 @@ void Room::AirDrop(int appear_time, int box_id, int airdrop_id)
},
&xtimer_attacher_.timer_list_);
++airdrop_times_;
#if 1
ShuaMon(box_pos,
thing_meta->airdrop_mon_list,
std::max(thing_meta->i->width(), thing_meta->i->height()));
#endif
}
}
@ -3828,6 +3830,15 @@ void Room::ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list, f
abort();
}
last_hero_idx = i;
#ifdef DEBUG
BroadcastDebugMsg(a8::Format("ShuaMon pos:%d,%d hero_id:%d",
{
hero_pos.x,
hero_pos.y,
hero->meta->i->id()
}));
#endif
break;
}
}//end for i
}//end if

View File

@ -176,6 +176,7 @@ public:
RoomObstacle* CreateObstacle(int id, float x, float y);
int AllocUniid();
Incubator* GetIncubator() { return incubator_;};
void ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list, float radius);
private:
void ShuaAndroid();
@ -255,7 +256,6 @@ private:
size_t GetRoomMaxPlayerNum();
void InitAndroidAI();
void ForwardGasRing(int n);
void ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list, float radius);
#ifdef DEBUG
void InitDebugInfo();

View File

@ -60,7 +60,7 @@ message MapThing
optional int32 explosion_interval = 18;
optional int32 explosion_times = 19;
optional int32 explosion_float = 20;
optional string airdrop_mon = 21;
optional string monster_list = 21;
}
message SafeArea