Skip to content

Commit

Permalink
Restored coin-cost for reset points and added a coin penalty for abor…
Browse files Browse the repository at this point in the history
…ting a level to discourage powerup farming
  • Loading branch information
LMH0013 committed Jul 8, 2013
1 parent d88b92c commit b42adf8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/object/player.cpp
Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions src/supertux/game_session.cpp
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit b42adf8

Please sign in to comment.