}
void
-Bomb::write(LispWriter& )
+Bomb::write(lisp::Writer& )
{
// bombs are only temporarily so don't write them out...
}
return ABORT_MOVE;
}
+HitResponse
+Bomb::collision_badguy(BadGuy& badguy, const CollisionHit& )
+{
+ if(state == 1)
+ badguy.kill_fall();
+ return ABORT_MOVE;
+}
+
void
Bomb::active_action(float )
{
switch(state) {
case 0:
if(timer.check()) {
- state = 1;
- sprite->set_action("explosion");
- timer.start(EXPLOSIONTIME);
+ explode();
}
break;
case 1:
}
void
+Bomb::explode()
+{
+ state = 1;
+ sprite->set_action("explosion");
+ SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(),
+ Sector::current()->player->get_pos());
+ timer.start(EXPLOSIONTIME);
+}
+
+void
Bomb::kill_fall()
{
+ explode();
}
+