-GameSession::try_cheats()
-{
- if(currentsector == 0)
- return;
- Player& tux = *currentsector->player;
-
- // Cheating words (the goal of this is really for debugging,
- // but could be used for some cheating, nothing wrong with that)
- if(main_controller->check_cheatcode("grow")) {
- tux.set_bonus(GROWUP_BONUS, false);
- }
- if(main_controller->check_cheatcode("fire")) {
- tux.set_bonus(FIRE_BONUS, false);
- }
- if(main_controller->check_cheatcode("ice")) {
- tux.set_bonus(ICE_BONUS, false);
- }
- if(main_controller->check_cheatcode("lifeup")) {
- player_status->lives++;
- }
- if(main_controller->check_cheatcode("lifedown")) {
- player_status->lives--;
- }
- if(main_controller->check_cheatcode("grease")) {
- tux.physic.set_velocity_x(tux.physic.get_velocity_x()*3);
- }
- if(main_controller->check_cheatcode("invincible")) {
- // be invincle for the rest of the level
- tux.invincible_timer.start(10000);
- }
- if(main_controller->check_cheatcode("shrink")) {
- // remove powerups
- tux.kill(tux.SHRINK);
- }
- if(main_controller->check_cheatcode("kill")) {
- // kill Tux, but without losing a life
- player_status->lives++;
- tux.kill(tux.KILL);
- }
-#if 0
- if(main_controller->check_cheatcode("grid")) {
- // toggle debug grid
- debug_grid = !debug_grid;
- }
-#endif
- if(main_controller->check_cheatcode("hover")) {
- // toggle hover ability on/off
- tux.enable_hover = !tux.enable_hover;
- }
- if(main_controller->check_cheatcode("gotoend")) {
- // goes to the end of the level
- tux.move(Vector(
- (currentsector->solids->get_width()*32) - (SCREEN_WIDTH*2), 0));
- currentsector->camera->reset(
- Vector(tux.get_pos().x, tux.get_pos().y));
- }
- if(main_controller->check_cheatcode("finish")) {
- // finish current sector
- exit_status = ES_LEVEL_FINISHED;
- // don't add points to stats though...
- }
- // temporary to help player's choosing a flapping
- if(main_controller->check_cheatcode("marek")) {
- tux.flapping_mode = Player::MAREK_FLAP;
- }
- if(main_controller->check_cheatcode("ricardo")) {
- tux.flapping_mode = Player::RICARDO_FLAP;
- }
- if(main_controller->check_cheatcode("ryan")) {
- tux.flapping_mode = Player::RYAN_FLAP;
- }
-}
-
-void