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