1
This commit is contained in:
parent
40bdf9fa7d
commit
496e9a11eb
@ -1746,7 +1746,9 @@ void Room::AirDrop(int appear_time, int box_id, int airdrop_id)
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
++airdrop_times_;
|
||||
ShuaMon(box_pos, thing_meta->airdrop_mon_list);
|
||||
ShuaMon(box_pos,
|
||||
thing_meta->airdrop_mon_list,
|
||||
std::max(thing_meta->i->width(), thing_meta->i->height()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3788,8 +3790,9 @@ void Room::ForwardGasRing(int n)
|
||||
}
|
||||
}
|
||||
|
||||
void Room::ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list)
|
||||
void Room::ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list, float radius)
|
||||
{
|
||||
int last_hero_idx = 0;
|
||||
for (int hero_id : airdrop_mon_list) {
|
||||
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id);
|
||||
if (hero_meta) {
|
||||
@ -3797,12 +3800,14 @@ void Room::ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list)
|
||||
Creature* master = nullptr;
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
a8::Vec2 born_dir = center;
|
||||
a8::Vec2 born_offset(10, 10);
|
||||
a8::Vec2 born_offset(hero_meta->i->radius() + 1 + radius + (50 * i),
|
||||
hero_meta->i->radius() + 1 + radius + (50 * i));
|
||||
born_offset.Rotate(born_dir.CalcAngle(a8::Vec2::UP));
|
||||
born_offset.Rotate(i * 0.5);
|
||||
born_offset.Rotate((last_hero_idx + i) * 0.5);
|
||||
|
||||
a8::Vec2 hero_pos = center + born_offset;
|
||||
a8::Vec2 dir = center;
|
||||
a8::Vec2 dir = born_offset;
|
||||
dir.Normalize();
|
||||
|
||||
CircleCollider collider;
|
||||
collider.pos = hero_pos;
|
||||
@ -3822,6 +3827,7 @@ void Room::ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list)
|
||||
if (!hero) {
|
||||
abort();
|
||||
}
|
||||
last_hero_idx = i;
|
||||
}
|
||||
}//end for i
|
||||
}//end if
|
||||
|
@ -255,7 +255,7 @@ private:
|
||||
size_t GetRoomMaxPlayerNum();
|
||||
void InitAndroidAI();
|
||||
void ForwardGasRing(int n);
|
||||
void ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list);
|
||||
void ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list, float radius);
|
||||
|
||||
#ifdef DEBUG
|
||||
void InitDebugInfo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user