1
This commit is contained in:
parent
5c5f1a49b5
commit
ed3c30052e
@ -273,19 +273,22 @@ void RoomObstacle::SpecExplosion()
|
|||||||
grid_list_ = new std::set<GridCell*>();
|
grid_list_ = new std::set<GridCell*>();
|
||||||
room->grid_service->GetAllCellsByXy(room, GetPos().x, GetPos().y, *grid_list_);
|
room->grid_service->GetAllCellsByXy(room, GetPos().x, GetPos().y, *grid_list_);
|
||||||
}
|
}
|
||||||
|
a8::Vec2 bomb_born_offset = a8::Vec2::UP;
|
||||||
|
bomb_born_offset.Rotate(a8::RandAngle());
|
||||||
|
bomb_born_offset = bomb_born_offset * a8::RandEx(1, std::max(2, meta->i->explosion_float()));
|
||||||
|
a8::Vec2 bomb_pos = GetPos() + bomb_born_offset;
|
||||||
std::set<Entity*> objects;
|
std::set<Entity*> objects;
|
||||||
room->grid_service->TouchAllLayerHumanList
|
room->grid_service->TouchAllLayerHumanList
|
||||||
(
|
(
|
||||||
room->GetRoomIdx(),
|
room->GetRoomIdx(),
|
||||||
*grid_list_,
|
*grid_list_,
|
||||||
[this, &objects] (Human* hum, bool& stop)
|
[this, &objects, &bomb_pos] (Human* hum, bool& stop)
|
||||||
{
|
{
|
||||||
float distance = (hum->GetPos() - GetPos()).Norm();
|
float distance = (hum->GetPos() - bomb_pos).Norm();
|
||||||
if (master.Get()->team_id != hum->team_id && distance < meta->i->damage_dia()) {
|
if (master.Get()->team_id != hum->team_id && distance < meta->i->damage_dia()) {
|
||||||
objects.insert(hum);
|
objects.insert(hum);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
a8::Vec2 bomb_pos = GetPos();
|
|
||||||
room->frame_event.AddExplosionEx(master,
|
room->frame_event.AddExplosionEx(master,
|
||||||
meta->i->thing_id(),
|
meta->i->thing_id(),
|
||||||
bomb_pos,
|
bomb_pos,
|
||||||
|
@ -57,6 +57,7 @@ message MapThing
|
|||||||
optional int32 explosion_effect = 15;
|
optional int32 explosion_effect = 15;
|
||||||
optional int32 explosion_interval = 18;
|
optional int32 explosion_interval = 18;
|
||||||
optional int32 explosion_times = 19;
|
optional int32 explosion_times = 19;
|
||||||
|
optional int32 explosion_float = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SafeArea
|
message SafeArea
|
||||||
|
Loading…
x
Reference in New Issue
Block a user