Removed unused all tracks and win GOTM cup challenges.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1839 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
7ba2e36d89
commit
4deda4e3ee
@ -93,7 +93,6 @@ supertuxkart_SOURCES = main.cpp \
|
||||
traffic.cpp \
|
||||
player.hpp \
|
||||
challenges/challenge.hpp challenges/challenge.cpp \
|
||||
challenges/all_tracks.cpp challenges/all_tracks.hpp \
|
||||
challenges/energy_math_class.cpp challenges/energy_math_class.hpp\
|
||||
challenges/penguin_playground_gp.cpp challenges/penguin_playground_gp.hpp \
|
||||
challenges/race_track_time.cpp challenges/race_track_time.hpp\
|
||||
|
@ -1,96 +0,0 @@
|
||||
// $Id: all_tracks.cpp 1259 2007-09-24 12:28:19Z hiker $
|
||||
//
|
||||
// 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 <algorithm>
|
||||
#include "challenges/all_tracks.hpp"
|
||||
#include "world.hpp"
|
||||
#include "track_manager.hpp"
|
||||
|
||||
char *ALLTRACKS[] = {"beach", "bsodcastle", "islandtrack", "lighthouse",
|
||||
"littlevolcano", "olivermath", "race", "sandtrack",
|
||||
"startrack", "subseatrack", "tuxtrack", "volcano",
|
||||
""};
|
||||
|
||||
AllTracks::AllTracks() : Challenge("alltracks", "All Tracks")
|
||||
{
|
||||
for(int i=0;; i++)
|
||||
{
|
||||
if(ALLTRACKS[i][0]==0) break;
|
||||
m_all_tracks.push_back(ALLTRACKS[i]);
|
||||
}
|
||||
setChallengeDescription("Finish one race\nin each track");
|
||||
setFeatureDescription("New track: SnowTuxPeak\nnow available");
|
||||
setFeature("snowtuxpeak");
|
||||
} // AllTracks
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void AllTracks::loadState(const lisp::Lisp* config)
|
||||
{
|
||||
config->getVector("solved-tracks", m_raced_tracks);
|
||||
// Remove the finished tracks from the list of all tracks, so that
|
||||
// startRace picks a track that wasn't used before.
|
||||
for(std::vector<std::string>::iterator i=m_raced_tracks.begin();
|
||||
i!=m_raced_tracks.end(); i++)
|
||||
{
|
||||
std::vector<std::string>::iterator p=std::find(m_all_tracks.begin(),
|
||||
m_all_tracks.end(),*i);
|
||||
m_all_tracks.erase(p);
|
||||
}
|
||||
} // loadState
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void AllTracks::saveState(lisp::Writer* writer)
|
||||
{
|
||||
writer->write("solved-tracks\t", m_raced_tracks);
|
||||
} // saveState
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void AllTracks::setRace() const
|
||||
{
|
||||
assert(m_all_tracks.size()>0);
|
||||
race_manager->setRaceMode(RaceManager::RM_QUICK_RACE);
|
||||
race_manager->setTrack(m_all_tracks[0]);
|
||||
race_manager->setDifficulty(RaceManager::RD_EASY);
|
||||
race_manager->setNumLaps(1);
|
||||
race_manager->setNumKarts(4);
|
||||
race_manager->setNumPlayers(1);
|
||||
|
||||
} // setRace
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool AllTracks::raceFinished()
|
||||
{
|
||||
// If the current track is not yet in the list of raced tracks, add it:
|
||||
std::string track_name = world->getTrack()->getIdent();
|
||||
if(std::find(m_raced_tracks.begin(), m_raced_tracks.end(), track_name)
|
||||
==m_raced_tracks.end())
|
||||
{
|
||||
m_raced_tracks.push_back(track_name);
|
||||
std::vector<std::string>::iterator p=std::find(m_all_tracks.begin(),
|
||||
m_all_tracks.end(),
|
||||
track_name);
|
||||
// In case that a track was raced (for the first time) that's not
|
||||
// in the list of tracks to race ...
|
||||
if(p!=m_all_tracks.end()) m_all_tracks.erase(p);
|
||||
}
|
||||
|
||||
// Check if all tracks are finished. If so, unlock feature
|
||||
return (m_all_tracks.size()==0);
|
||||
} // raceFinished
|
||||
//-----------------------------------------------------------------------------
|
@ -1,41 +0,0 @@
|
||||
// $Id: all_tracks.hpp 1259 2007-09-24 12:28:19Z hiker $
|
||||
//
|
||||
// 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 HEADER_ALL_TRACKS_H
|
||||
#define HEADER_ALL_TRACKS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "challenges/challenge.hpp"
|
||||
|
||||
class AllTracks : public Challenge
|
||||
{
|
||||
private:
|
||||
std::vector<std::string> m_raced_tracks;
|
||||
std::vector<std::string> m_all_tracks;
|
||||
public:
|
||||
AllTracks();
|
||||
virtual void loadState(const lisp::Lisp* config);
|
||||
virtual void saveState(lisp::Writer* writer);
|
||||
virtual bool raceFinished();
|
||||
virtual void setRace() const;
|
||||
}; // AllTracks
|
||||
|
||||
#endif
|
@ -1,61 +0,0 @@
|
||||
// $Id: win_gotm_cup.cpp 1259 2007-09-24 12:28:19Z hiker $
|
||||
//
|
||||
// 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 <algorithm>
|
||||
#include "translation.hpp"
|
||||
#include "challenges/win_gotm_cup.hpp"
|
||||
#include "world.hpp"
|
||||
#include "race_manager.hpp"
|
||||
#include "cup_data.hpp"
|
||||
|
||||
WinGOTMCup::WinGOTMCup() : Challenge("wingotmcup", _("Win GOTM Cup"))
|
||||
{
|
||||
setChallengeDescription(_("Win the GOTM Cup\non level 'racer'\nwith at least\nthree computer opponents."));
|
||||
setFeatureDescription(_("New track\n'Amazonian Journey'\navailable"));
|
||||
// The energymathclass challenge must be done, otherwise GP can't be selected
|
||||
addDependency("energymathclass");
|
||||
setFeature("jungle");
|
||||
} // WinGOTMCup
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void WinGOTMCup::setRace() const {
|
||||
race_manager->setRaceMode(RaceManager::RM_GRAND_PRIX);
|
||||
CupData cup("gotm.cup");
|
||||
race_manager->setGrandPrix(cup);
|
||||
race_manager->setDifficulty(RaceManager::RD_HARD);
|
||||
race_manager->setNumKarts(4);
|
||||
race_manager->setNumPlayers(1);
|
||||
} // setRace
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool WinGOTMCup::grandPrixFinished()
|
||||
{
|
||||
if (race_manager->getRaceMode() != RaceManager::RM_GRAND_PRIX ||
|
||||
race_manager->getDifficulty()!= RaceManager::RD_HARD ||
|
||||
race_manager->getNumKarts() < 4 ||
|
||||
race_manager->getNumPlayers() > 1) return false;
|
||||
// Check if the player was number one:
|
||||
for(int i=0; i<(int)race_manager->getNumKarts(); i++)
|
||||
{
|
||||
const Kart* k=world->getKart(i);
|
||||
if(k->isPlayerKart() && !k->isEliminated()) return k->getPosition()==1;
|
||||
}
|
||||
return false;
|
||||
} // raceFinished
|
||||
//-----------------------------------------------------------------------------
|
@ -1,36 +0,0 @@
|
||||
// $Id: win_gotm_cup.hpp 1259 2007-09-24 12:28:19Z hiker $
|
||||
//
|
||||
// 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 HEADER_WIN_GOTM_CUP_H
|
||||
#define HEADER_WIN_GOTM_CUP_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "challenges/challenge.hpp"
|
||||
|
||||
class WinGOTMCup: public Challenge
|
||||
{
|
||||
public:
|
||||
WinGOTMCup();
|
||||
virtual bool grandPrixFinished();
|
||||
virtual void setRace() const;
|
||||
}; // WinGOTMCup
|
||||
|
||||
#endif
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "unlock_manager.hpp"
|
||||
|
||||
//#include "challenges/all_tracks.hpp"
|
||||
#include "challenges/energy_math_class.hpp"
|
||||
#include "challenges/penguin_playground_gp.hpp"
|
||||
#include "challenges/race_track_time.hpp"
|
||||
@ -45,7 +44,6 @@ UnlockManager::UnlockManager()
|
||||
|
||||
// Add all challenges:
|
||||
Challenge *c;
|
||||
//c=new AllTracks(); m_all_challenges[c->getId()]=c;
|
||||
c=new EnergyMathClass(); m_all_challenges[c->getId()]=c;
|
||||
c=new PenguinPlaygroundGP(); m_all_challenges[c->getId()]=c;
|
||||
c=new RaceTrackTime(); m_all_challenges[c->getId()]=c;
|
||||
|
Loading…
Reference in New Issue
Block a user