19#ifndef THREE_STRIKES_BATTLE_HPP
20#define THREE_STRIKES_BATTLE_HPP
23#include "modes/world_with_rank.hpp"
24#include "tracks/track_object.hpp"
25#include "states_screens/race_gui_base.hpp"
49 return (time == k.time) ? (lives < k.lives) : (time < k.time);
92 std::vector<AbstractKart*> m_spare_tire_karts;
93 int m_next_sta_spawn_ticks;
100 std::vector<BattleInfo> m_kart_info;
103 std::vector<BattleEvent> m_battle_events;
109 virtual void init() OVERRIDE;
117 virtual
void reset(
bool restart=false) OVERRIDE;
120 std::vector<
RaceGUIBase::KartIconDisplayInfo> *info) OVERRIDE;
124 virtual const std::string&
getIdent() const OVERRIDE;
126 virtual
bool kartHit(
int kart_id,
int hitter = -1) OVERRIDE;
128 virtual
void update(
int ticks) OVERRIDE;
135 virtual
void loadCustomModels() OVERRIDE;
141 void addKartLife(
unsigned int id);
143 int getKartLife(
unsigned int id)
const {
return m_kart_info[id].m_lives; }
145 bool spareTireKartsSpawned()
const;
147 void spawnSpareTireKarts();
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Definition: physical_object.hpp:40
Definition: ptr_vector.hpp:44
An abstract base class for the two race guis (race_gui and race_result gui)
Definition: race_gui_base.hpp:50
An implementation of WorldWithRank, to provide the 3 strikes battle game mode.
Definition: three_strikes_battle.hpp:37
virtual bool kartHit(int kart_id, int hitter=-1) OVERRIDE
Called when a kart is hit.
Definition: three_strikes_battle.cpp:216
virtual void terminateRace() OVERRIDE
Called when the race finishes, i.e.
Definition: three_strikes_battle.cpp:498
float m_tire_radius[4]
The radius of the karts original tires.
Definition: three_strikes_battle.hpp:76
virtual void kartAdded(AbstractKart *kart, scene::ISceneNode *node) OVERRIDE
Adds two tires to each of the kart.
Definition: three_strikes_battle.cpp:178
virtual void reset(bool restart=false) OVERRIDE
Called when a battle is restarted.
Definition: three_strikes_battle.cpp:98
int m_total_rescue
Profiling usage.
Definition: three_strikes_battle.hpp:87
virtual bool raceHasLaps() OVERRIDE
Called when it is needed to know whether this kind of race involves counting laps.
Definition: three_strikes_battle.hpp:122
virtual void enterRaceOverState() OVERRIDE
Called when the race is finished, but it still leaves some time for an end of race animation,...
Definition: three_strikes_battle.cpp:542
int m_insert_tire
Indicates the number of tires that should be inserted into the track.
Definition: three_strikes_battle.hpp:67
virtual bool isRaceOver() OVERRIDE
The battle is over if only one kart is left, or no player kart.
Definition: three_strikes_battle.cpp:477
virtual void getKartsDisplayInfo(std::vector< RaceGUIBase::KartIconDisplayInfo > *info) OVERRIDE
Returns the data to display in the race gui.
Definition: three_strikes_battle.cpp:507
std::string m_tire_dir
The directory of the original kart tires.
Definition: three_strikes_battle.hpp:79
core::vector3df m_tire_position
For tires that are blown away.
Definition: three_strikes_battle.hpp:70
std::vector< BattleInfo > m_kart_info
This vector contains an 'BattleInfo' struct for every kart in the race.
Definition: three_strikes_battle.hpp:60
float m_tire_rotation
A rotation to apply to the tires when inserting them.
Definition: three_strikes_battle.hpp:82
virtual void update(int ticks) OVERRIDE
Update the world and the track.
Definition: three_strikes_battle.cpp:357
ThreeStrikesBattle()
Constructor.
Definition: three_strikes_battle.cpp:51
virtual void init() OVERRIDE
Initialises the three strikes battle.
Definition: three_strikes_battle.cpp:72
virtual ~ThreeStrikesBattle()
Destructor.
Definition: three_strikes_battle.cpp:83
core::vector3df m_tire_offsets[4]
The original locations of the tires of a kart.
Definition: three_strikes_battle.hpp:73
irr::scene::IMesh * m_tire
The mesh of the tire which is displayed when a kart loses a life.
Definition: three_strikes_battle.hpp:63
void updateKartRanks()
Updates the ranking of the karts.
Definition: three_strikes_battle.cpp:445
virtual const std::string & getIdent() const OVERRIDE
Returns the internal identifier for this race.
Definition: three_strikes_battle.cpp:348
A WorldWithRank is a world where the karts are ranked.
Definition: world_with_rank.hpp:39
Used to show a nice graph when battle is over.
Definition: three_strikes_battle.hpp:98
Definition: three_strikes_battle.hpp:54
Definition: three_strikes_battle.hpp:42