#include "audio/sound_manager.hpp"
#include "badguy/bomb.hpp"
#include "badguy/short_fuse.hpp"
+#include "object/bullet.hpp"
#include "object/explosion.hpp"
#include "object/player.hpp"
#include "sprite/sprite.hpp"
sprite = sprite_manager->create( sprite_name );
}
-/* ShortFuse created by a dispenser always gets default sprite atm.*/
-ShortFuse::ShortFuse(const Vector& pos, Direction d) :
- WalkingBadguy(pos, d, "images/creatures/short_fuse/short_fuse.sprite", "left", "right")
-{
- walk_speed = 80;
- max_drop_height = 16;
- sound_manager->preload("sounds/explosion.wav");
-}
-
void
ShortFuse::explode (void)
{
return ABORT_MOVE;
}
+HitResponse
+ShortFuse::collision_bullet (Bullet& bullet, const CollisionHit& )
+{
+ // All bullets cause the unstable short fuse to explode
+ bullet.remove_me();
+ explode();
+ return ABORT_MOVE;
+}
+
void
ShortFuse::kill_fall (void)
{
{
public:
ShortFuse(const Reader& reader);
- ShortFuse(const Vector& pos, Direction d);
protected:
HitResponse collision_player (Player& player, const CollisionHit& hit);
+ HitResponse collision_bullet (Bullet& bullet, const CollisionHit& );
bool collision_squished (GameObject& object);
void kill_fall (void);
void explode (void);