diff --git a/src/Makefile.am b/src/Makefile.am index c14009177..3ef1d8786 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -104,6 +104,7 @@ supertuxkart_SOURCES = main.cpp \ challenges/city_time.cpp challenges/city_time.hpp \ challenges/island_follow.cpp challenges/island_follow.hpp \ challenges/worlds_end_gp.cpp challenges/worlds_end_gp.hpp \ + challenges/tollway_head2head.cpp challenges/tollway_head2head.hpp \ lisp/lisp.cpp lisp/lisp.hpp \ lisp/lexer.cpp lisp/lexer.hpp \ lisp/parser.cpp lisp/parser.hpp \ diff --git a/src/challenges/city_time.cpp b/src/challenges/city_time.cpp index 9bfe3e3ed..a7c579df6 100644 --- a/src/challenges/city_time.cpp +++ b/src/challenges/city_time.cpp @@ -22,9 +22,9 @@ #include "world.hpp" #include "race_manager.hpp" -CityTime::CityTime() : Challenge("citytime", _("Finish the City track in 5:00")) +CityTime::CityTime() : Challenge("citytime", _("Finish the City track in 5:20")) { - setChallengeDescription(_("Finish 3 laps on the City track\nwith 3 AI karts\nin under 5:00 minutes.")); + setChallengeDescription(_("Finish 3 laps on the City track\nwith 3 AI karts\nin under 5:20 minutes.")); setFeatureDescription(_("New track: SnowTux Peak\nnow available")); setFeature("snowtuxpeak"); addDependency("junglefollow"); @@ -45,7 +45,7 @@ bool CityTime::raceFinished() std::string track_name = world->getTrack()->getIdent(); if(track_name!="city" ) return false; // wrong track Kart* kart=world->getPlayerKart(0); - if(kart->getFinishTime()>300) return false; // too slow + if(kart->getFinishTime()>320) return false; // too slow if(kart->getLap()!=3 ) return false; // wrong number of laps if(race_manager->getNumKarts()<4) return false; //not enough AI karts return true; diff --git a/src/challenges/energy_shifting_sands.cpp b/src/challenges/energy_shifting_sands.cpp index 1761f3c0a..cd2fd104c 100644 --- a/src/challenges/energy_shifting_sands.cpp +++ b/src/challenges/energy_shifting_sands.cpp @@ -25,7 +25,7 @@ EnergyShiftingSands::EnergyShiftingSands() : Challenge("energyshiftingsands", _("Collect the Pharaohs Treasure")) { setChallengeDescription(_("Collect at least 9 coins\non 3 laps of Shifting Sands\nin under 2:20 minutes.")); - setFeatureDescription(_("New Grand Prix: To the Moon and Back\nnow available")); + setFeatureDescription(_("New Grand Prix:\nTo the Moon and Back\nnow available")); setFeature("To the Moon and Back"); // The energymathclass challenge must be done, otherwise GP can't be selected addDependency("energymathclass"); diff --git a/src/challenges/island_follow.cpp b/src/challenges/island_follow.cpp index dc523a632..07f77b654 100644 --- a/src/challenges/island_follow.cpp +++ b/src/challenges/island_follow.cpp @@ -22,7 +22,7 @@ #include "world.hpp" #include "race_manager.hpp" -IslandFollow::IslandFollow() : Challenge("islandfollow", _("Win Follow the Leader on a Desert Island")) +IslandFollow::IslandFollow() : Challenge("islandfollow", _("Follow the Leader on a\nDesert Island")) { setChallengeDescription(_("Win a Follow the Leader race\nwith 3 AI karts\non a Desert Island.")); setFeatureDescription(_("New Grand Prix: At World's End\nnow available")); diff --git a/src/challenges/jungle_follow.cpp b/src/challenges/jungle_follow.cpp index d019a0689..e81975f45 100644 --- a/src/challenges/jungle_follow.cpp +++ b/src/challenges/jungle_follow.cpp @@ -22,7 +22,7 @@ #include "world.hpp" #include "race_manager.hpp" -JungleFollow::JungleFollow() : Challenge("junglefollow", _("Win Follow the Leader in the Jungle")) +JungleFollow::JungleFollow() : Challenge("junglefollow", _("Follow the Leader in the Jungle")) { setChallengeDescription(_("Win a Follow the Leader race\nwith 3 AI karts\nin the Amazonian Jungle.")); setFeatureDescription(_("New track: City\nnow available")); diff --git a/src/challenges/moon_and_back_gp.cpp b/src/challenges/moon_and_back_gp.cpp index 91b4c3075..0c58878ec 100644 --- a/src/challenges/moon_and_back_gp.cpp +++ b/src/challenges/moon_and_back_gp.cpp @@ -22,9 +22,9 @@ #include "race_manager.hpp" #include "world.hpp" -MoonAndBackGP::MoonAndBackGP() : Challenge("moonandbackgp",_("Finish To the Moon and Back Grand Prix")) +MoonAndBackGP::MoonAndBackGP() : Challenge("moonandbackgp",_("Win To the Moon and Back\nGrand Prix")) { - setChallengeDescription(_("Finish the To the Moon and Back\nGrand Prix with 3 'Racer' Level AI karts\nin the top 3.")); + setChallengeDescription(_("Win the To the Moon and Back\nGrand Prix with 3 'Racer'\nLevel AI karts.")); setFeatureDescription(_("New Grand Prix: Snag Drive\nnow available")); setFeature("Snag Drive"); //gp3 // The energyshiftingsands challenge must be done, otherwise gp2 can't be selected diff --git a/src/challenges/penguin_playground_gp.cpp b/src/challenges/penguin_playground_gp.cpp index 618bc2e37..91a79ed85 100644 --- a/src/challenges/penguin_playground_gp.cpp +++ b/src/challenges/penguin_playground_gp.cpp @@ -22,9 +22,9 @@ #include "race_manager.hpp" #include "world.hpp" -PenguinPlaygroundGP::PenguinPlaygroundGP() : Challenge("penguinplaygroundgp", _("Finish Penguin Playground Grand Prix")) +PenguinPlaygroundGP::PenguinPlaygroundGP() : Challenge("penguinplaygroundgp", _("Win Penguin Playground Grand\nPrix")) { - setChallengeDescription(_("Finish the Penguin Playground Grand\nPrix with 3 'Racer' Level AI karts\nin the top 3.")); + setChallengeDescription(_("Win Penguin Playground Grand\nPrix with 3 'Racer' Level AI karts.")); setFeatureDescription(_("New game mode\n'Follow Leader'\nnow available")); setFeature("followleader"); // The energymathclass challenge must be done, otherwise GP can't be selected diff --git a/src/challenges/tollway_head2head.cpp b/src/challenges/tollway_head2head.cpp new file mode 100644 index 000000000..542608b06 --- /dev/null +++ b/src/challenges/tollway_head2head.cpp @@ -0,0 +1,51 @@ +// $Id$ +// +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2008 Joerg Henrichs +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be ruseful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "translation.hpp" +#include "tollway_head2head.hpp" +#include "world.hpp" +#include "race_manager.hpp" + +TollwayHead2Head::TollwayHead2Head() : Challenge("tollwayhead", _("Win a Head to Head on\nTux Tollway")) +{ + setChallengeDescription(_("Win a 1 lap Head to Head\non Tux Tollway against 1 'Driver'\nlevel AI kart.")); + setFeatureDescription(_("New track: Fort Magma\nnow available")); + setFeature("fortmagma"); +} // TollwayTime + +//----------------------------------------------------------------------------- +void TollwayHead2Head::setRace() const { + race_manager->setRaceMode(RaceManager::RM_QUICK_RACE); + race_manager->setTrack("tuxtrack"); + race_manager->setDifficulty(RaceManager::RD_HARD); + race_manager->setNumLaps(1); + race_manager->setNumKarts(2); + race_manager->setNumPlayers(1); +} // setRace + +//----------------------------------------------------------------------------- +bool TollwayHead2Head::raceFinished() +{ + std::string track_name = world->getTrack()->getIdent(); + if(track_name!="tuxtrack" ) return false; // wrong track + Kart* kart=world->getPlayerKart(0); + if(kart->getLap()!=1 ) return false; // wrong number of laps + if(race_manager->getNumKarts()!=2 ) return false; //wrong number of AI karts + return true; +} // raceFinished diff --git a/src/challenges/tollway_head2head.hpp b/src/challenges/tollway_head2head.hpp new file mode 100644 index 000000000..2ade55341 --- /dev/null +++ b/src/challenges/tollway_head2head.hpp @@ -0,0 +1,35 @@ +// $Id$ +// +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2008 Joerg Henrichs +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#ifndef TOLLWAY_HEAD2HEAD_H +#define TOLLWAY_HEAD2HEAD_H + + +#include "challenge.hpp" + +class TollwayHead2Head : public Challenge +{ +public: + TollwayHead2Head(); + virtual bool raceFinished(); + virtual void setRace() const; +}; // TollwayHead2Head + + +#endif /*TOLLWAY_HEAD2HHEAD*/ diff --git a/src/challenges/tollway_time.cpp b/src/challenges/tollway_time.cpp index 46bf6e1c6..f921ab265 100644 --- a/src/challenges/tollway_time.cpp +++ b/src/challenges/tollway_time.cpp @@ -24,7 +24,7 @@ TollwayTime::TollwayTime() : Challenge("tollwaytime", _("Finish Tux Tollway track in 3:00")) { - setChallengeDescription(_("Finish 3 laps on the Tux Tollway track\nwith 3 AI karts\nin under 3:00 minutes.")); + setChallengeDescription(_("Finish 3 laps on the Tux Tollway\ntrack with 3 AI karts\nin under 3:00 minutes.")); setFeatureDescription(_("New track: Canyon\nnow available")); setFeature("canyon"); } // TollwayTime diff --git a/src/challenges/worlds_end_gp.cpp b/src/challenges/worlds_end_gp.cpp index 407c3157d..ed85d54b8 100644 --- a/src/challenges/worlds_end_gp.cpp +++ b/src/challenges/worlds_end_gp.cpp @@ -22,9 +22,9 @@ #include "race_manager.hpp" #include "world.hpp" -WorldsEndGP::WorldsEndGP() : Challenge("worldsendgp",_("Win the At World's End Grand Prix")) +WorldsEndGP::WorldsEndGP() : Challenge("worldsendgp",_("Win the At World's End\nGrand Prix")) { - setChallengeDescription(_("Come first in the At World's End\nGrand Prix with 3 'Racer' Level AI karts.")); + setChallengeDescription(_("Come first in the At World's End\nGrand Prix with 3 'Racer'\nLevel AI karts.")); setFeatureDescription(_("New Grand Prix: All Tracks GP\nand Bonus Preview: Skidding\nnow available.\nSelect 'skidding' as difficulty.")); setFeature("All tracks"); setFeature("skidding"); // Add Skidding Preview @@ -33,6 +33,7 @@ WorldsEndGP::WorldsEndGP() : Challenge("worldsendgp",_("Win the At World's End G addDependency("tollwaytime"); addDependency("junglefollow"); addDependency("citytime"); + addDependency("tollwayhead"); } //----------------------------------------------------------------------------- diff --git a/src/unlock_manager.cpp b/src/unlock_manager.cpp index 596a30c27..385b5693b 100755 --- a/src/unlock_manager.cpp +++ b/src/unlock_manager.cpp @@ -30,6 +30,7 @@ #include "challenges/city_time.hpp" #include "challenges/island_follow.hpp" #include "challenges/worlds_end_gp.hpp" +#include "challenges/tollway_head2head.hpp" #include "user_config.hpp" UnlockManager* unlock_manager=0; @@ -55,6 +56,7 @@ UnlockManager::UnlockManager() c=new CityTime(); m_all_challenges[c->getId()]=c; c=new IslandFollow(); m_all_challenges[c->getId()]=c; c=new WorldsEndGP(); m_all_challenges[c->getId()]=c; + c=new TollwayHead2Head(); m_all_challenges[c->getId()]=c; computeActive(); } // UnlockManager