From: LMH Date: Tue, 2 Jul 2013 08:42:12 +0000 (-1000) Subject: Restored coin-cost for reset points and added a coin penalty for aborting a level... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b42adf8f6178d08befa1e7275e96dd9c798c0216;p=supertux.git Restored coin-cost for reset points and added a coin penalty for aborting a level to discourage powerup farming --- diff --git a/src/object/player.cpp b/src/object/player.cpp index 9647aedb7..fbb89fa37 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -1307,6 +1307,21 @@ Player::kill(bool completely) return; } + if (player_status->coins >= 25 && !GameSession::current()->get_reset_point_sectorname().empty()) + { + for (int i = 0; i < 5; i++) + { + // the numbers: starting x, starting y, velocity y + Sector::current()->add_object(new FallingCoin(get_pos() + + Vector(graphicsRandom.rand(5), graphicsRandom.rand(-32,18)), + graphicsRandom.rand(-100,100))); + } + player_status->coins -= std::max(player_status->coins/10, 25); + } + else + { + GameSession::current()->set_reset_point("", Vector()); + } physic.enable_gravity(true); physic.set_gravity_modifier(1.0f); // Undo jump_early_apex safe_timer.stop(); diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index 56c2a9bc2..2ff948399 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -399,6 +399,9 @@ GameSession::process_menu() case MNID_ABORTLEVEL: MenuManager::set_current(0); g_screen_manager->exit_screen(); + //Coin penalty for aborting a level + if (player_status->coins >= 25) + player_status->coins -= std::max(player_status->coins/10, 25); break; } }