1
This commit is contained in:
parent
e1cf1ddaa9
commit
0a4ceb85ab
@ -648,10 +648,27 @@ bool Obstacle::DoInteraction(Human* sender)
|
||||
void Obstacle::OnCollisionTrigger(Creature* c, OptResult& opt_result)
|
||||
{
|
||||
opt_result = kOptPass;
|
||||
if (meta->i->thing_type() == kObstacleSpring) {
|
||||
AddObstacleBuff(c);
|
||||
a8::SetBitFlag(c->status, CS_Collisioning);
|
||||
opt_result = kOptBreak;
|
||||
switch (meta->i->thing_type() == kObstacleSpring) {
|
||||
case kObstacleSpring:
|
||||
{
|
||||
AddObstacleBuff(c);
|
||||
a8::SetBitFlag(c->status, CS_Collisioning);
|
||||
opt_result = kOptBreak;
|
||||
}
|
||||
break;
|
||||
case kObstacleMine:
|
||||
case kObstacleTrap:
|
||||
{
|
||||
AddObstacleBuff(c);
|
||||
Explosion();
|
||||
Die(c->room);
|
||||
BroadcastFullState(c->room);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@ class Obstacle : public Entity
|
||||
virtual bool CanThroughable(Bullet* bullet);
|
||||
virtual bool DoInteraction(Human* sender);
|
||||
virtual void OnCollisionTrigger(Creature* c, OptResult& opt_result);
|
||||
virtual void Explosion() {};
|
||||
void Explosion(Bullet* bullet);
|
||||
void SetDoorInfo(Building* building, int door_id_x);
|
||||
bool IsDoor();
|
||||
|
@ -24,9 +24,9 @@ class RoomObstacle : public Obstacle
|
||||
void Active();
|
||||
void DetachFromMaster();
|
||||
virtual void Die(Room* room) override;
|
||||
virtual void Explosion() override;
|
||||
|
||||
private:
|
||||
void Explosion();
|
||||
void SpecExplosion();
|
||||
void ActiveSelfExplosion();
|
||||
void ActiveMine();
|
||||
|
Loading…
x
Reference in New Issue
Block a user