#include "badguy/bomb.hpp"
#include "badguy/mrbomb.hpp"
#include "object/explosion.hpp"
+#include "object/player.hpp"
#include "sprite/sprite.hpp"
#include "sprite/sprite_manager.hpp"
#include "supertux/object_factory.hpp"
bool
MrBomb::collision_squished(GameObject& object)
{
+ Player* player = dynamic_cast<Player*>(&object);
+ if(player && player->is_invincible()) {
+ player->bounce(*this);
+ kill_fall();
+ return true;
+ }
if(is_valid()) {
remove_me();
Sector::current()->add_object(new Bomb(get_pos(), dir, sprite_name ));
bool
MrIceBlock::collision_squished(GameObject& object)
{
+ Player* player = dynamic_cast<Player*>(&object);
+ if(player && (player->does_buttjump || player->is_invincible())) {
+ player->bounce(*this);
+ kill_fall();
+ return true;
+ }
+
switch(ice_state) {
case ICESTATE_KICKED:
{
// fall through
case ICESTATE_NORMAL:
{
- Player* player = dynamic_cast<Player*>(&object);
squishcount++;
- if ((squishcount >= MAXSQUISHES) || (player && player->does_buttjump)) {
+ if (squishcount >= MAXSQUISHES) {
kill_fall();
return true;
}
break;
}
- Player* player = dynamic_cast<Player*>(&object);
if (player) player->bounce(*this);
return true;
}
bool
Snail::collision_squished(GameObject& object)
{
+ Player* player = dynamic_cast<Player*>(&object);
+ if(player && (player->does_buttjump || player->is_invincible())) {
+ kill_fall();
+ player->bounce(*this);
+ return true;
+ }
+
switch(state) {
case STATE_KICKED:
case STATE_NORMAL:
{
- Player* player = dynamic_cast<Player*>(&object);
squishcount++;
- if ((squishcount >= MAX_SNAIL_SQUISHES) || (player && player->does_buttjump)) {
+ if (squishcount >= MAX_SNAIL_SQUISHES) {
kill_fall();
return true;
}
}
- Player* player = dynamic_cast<Player*>(&object);
if (player) player->bounce(*this);
return true;
}