X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy.cpp;h=1d9d19729dbe404146296c325aeaa4c48fe28197;hb=8d5a5f453122c39664e534eaef259e59050eba6d;hp=b8bcb6f0f51c52e2d06aa004e9480a2a54d68548;hpb=b915debdcb7a40e9dc5fbc973ca045c786e9d4b2;p=supertux.git diff --git a/src/badguy.cpp b/src/badguy.cpp index b8bcb6f0f..1d9d19729 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -34,6 +34,7 @@ #include "level.h" #include "sector.h" #include "tilemap.h" +#include "statistics.h" Sprite* img_mriceblock_flat_left; Sprite* img_mriceblock_flat_right; @@ -404,20 +405,27 @@ void BadGuy::check_horizontal_bump(bool checkcliff) { float halfheight = base.height / 2; - if (dir == LEFT && issolid( base.x, (int) base.y + halfheight)) + if (dir == LEFT && issolid( base.x, base.y + halfheight)) { if (kind == BAD_MRICEBLOCK && mode == KICK) + { Sector::current()->trybreakbrick(Vector(base.x, base.y + halfheight), false); + Sector::current()->tryemptybox(Vector(base.x, base.y + halfheight), dir); + } dir = RIGHT; physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y()); return; } - if (dir == RIGHT && issolid( base.x + base.width, (int)base.y + halfheight)) + if (dir == RIGHT && issolid( base.x + base.width, base.y + halfheight)) { if (kind == BAD_MRICEBLOCK && mode == KICK) + { Sector::current()->trybreakbrick( - Vector(base.x + base.width, (int) base.y + halfheight), false); + Vector(base.x + base.width, base.y + halfheight), false); + Sector::current()->tryemptybox( + Vector(base.x + base.width, base.y + halfheight), dir); + } dir = LEFT; physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y()); @@ -1063,6 +1071,7 @@ BadGuy::squish(Player* player) Sector::current()->add_score(Vector(base.x, base.y), 25 * player_status.score_multiplier); SoundManager::get()->play_sound(IDToSound(SND_SQUISH), get_pos(), Sector::current()->player->get_pos()); + player_status.score_multiplier++; return; @@ -1114,6 +1123,7 @@ BadGuy::squish(Player* player) Sector::current()->add_score(Vector(base.x, base.y), 25 * player_status.score_multiplier); + player_status.score_multiplier++; // simply remove the fish... @@ -1149,7 +1159,7 @@ BadGuy::squish(Player* player) player->bounce(this); base.y += 66 - base.height; - + Sector::current()->add_score(Vector(base.x, base.y), 25 * player_status.score_multiplier); player_status.score_multiplier++; @@ -1167,6 +1177,9 @@ BadGuy::kill_me(int score) if(kind == BAD_BOMB) return; + if(mode != HELD) + global_stats.add_points(BADGUYS_KILLED_STAT, 1); + dying = DYING_FALLING; if(kind == BAD_MRICEBLOCK) { set_sprite(img_mriceblock_falling_left, img_mriceblock_falling_right);