1
This commit is contained in:
parent
f987ab039a
commit
2cd1317c85
@ -508,16 +508,7 @@ void Obstacle::OnBulletHit(Bullet* bullet)
|
||||
}
|
||||
}
|
||||
if (IsDead(bullet->room)) {
|
||||
if (meta->i->damage_dia() > 0.01f &&
|
||||
meta->i->damage() > 0.01f) {
|
||||
Explosion explosion;
|
||||
explosion.IndifferenceAttack(
|
||||
bullet->room,
|
||||
GetPos(),
|
||||
meta->i->damage_dia(),
|
||||
meta->i->damage(),
|
||||
meta->i->explosion_effect());
|
||||
}
|
||||
ProcDieExplosion(bullet->room);
|
||||
bullet->sender.Get()->DropItems(this);
|
||||
}
|
||||
BroadcastFullState(bullet->room);
|
||||
@ -558,16 +549,7 @@ void Obstacle::OnExplosionHit(Explosion* e)
|
||||
Die(e->GetRoom());
|
||||
}
|
||||
if (IsDead(e->GetRoom())) {
|
||||
if (meta->i->damage_dia() > 0.01f &&
|
||||
meta->i->damage() > 0.01f) {
|
||||
Explosion explosion;
|
||||
explosion.IndifferenceAttack(
|
||||
e->GetRoom(),
|
||||
GetPos(),
|
||||
meta->i->damage_dia(),
|
||||
meta->i->damage(),
|
||||
meta->i->explosion_effect());
|
||||
}
|
||||
ProcDieExplosion(e->GetRoom());
|
||||
if (meta->i->drop() != 0) {
|
||||
e->GetRoom()->ScatterDrop(GetPos(), meta->i->drop());
|
||||
}
|
||||
@ -882,10 +864,10 @@ bool Obstacle::ProcSpecEvent(Creature* c, ColliderComponent* collider)
|
||||
{
|
||||
if (c->team_id != GetTeamId(c->room)) {
|
||||
AddObstacleBuff(c);
|
||||
Die(c->room);
|
||||
#if 0
|
||||
Explosion();
|
||||
#endif
|
||||
Die(c->room);
|
||||
BroadcastFullState(c->room);
|
||||
return true;
|
||||
}
|
||||
@ -898,3 +880,16 @@ bool Obstacle::ProcSpecEvent(Creature* c, ColliderComponent* collider)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Obstacle::ProcDieExplosion(Room* room)
|
||||
{
|
||||
if (meta->i->damage_dia() > 0.01f) {
|
||||
Explosion explosion;
|
||||
explosion.IndifferenceAttack(
|
||||
room,
|
||||
GetPos(),
|
||||
meta->i->damage_dia(),
|
||||
meta->i->damage(),
|
||||
meta->i->explosion_effect());
|
||||
}
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ protected:
|
||||
void ClearObstacleBuff(Creature* c);
|
||||
bool IsHalfWallCollider();
|
||||
bool ProcSpecEvent(Creature* c, ColliderComponent* collider);
|
||||
void ProcDieExplosion(Room* room);
|
||||
|
||||
protected:
|
||||
CircleCollider* self_collider_ = nullptr;
|
||||
|
@ -160,15 +160,7 @@ void RoomObstacle::UpdateTimerFunc()
|
||||
}
|
||||
}
|
||||
Die(room);
|
||||
{
|
||||
Explosion explosion;
|
||||
explosion.IndifferenceAttack(
|
||||
room,
|
||||
GetPos(),
|
||||
meta->i->damage_dia(),
|
||||
meta->i->damage(),
|
||||
meta->i->explosion_effect());
|
||||
}
|
||||
ProcDieExplosion(room);
|
||||
BroadcastFullState(room);
|
||||
if (room->xtimer.GetRunningTimer()) {
|
||||
room->xtimer.DeleteTimer(room->xtimer.GetRunningTimer());
|
||||
@ -182,8 +174,7 @@ void RoomObstacle::UpdateTimerFunc()
|
||||
void RoomObstacle::SpecExplosion()
|
||||
{
|
||||
++explosion_times_;
|
||||
if (meta->i->damage_dia() > 0.01f &&
|
||||
meta->i->damage() > 0.01f) {
|
||||
if (meta->i->damage_dia() > 0.01f) {
|
||||
if (!grid_list_) {
|
||||
grid_list_ = new std::set<GridCell*>();
|
||||
room->grid_service->GetAllCellsByXy(room, GetPos().x, GetPos().y, *grid_list_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user