|
| Powerup (AbstractKart *kart_) |
| Constructor, stores the kart to which this powerup belongs.
|
|
| ~Powerup () |
| Frees the memory for the sound effects.
|
|
void | set (PowerupManager::PowerupType _type, int n=1) |
| Sets the collected items.
|
|
void | setNum (int n=1) |
| Sets the amount of the current collected item.
|
|
void | reset () |
| Resets the powerup, called at begin of a race.
|
|
Material * | getIcon () const |
| Returns the icon for the currently collected powerup.
|
|
void | adjustSound () |
| Does the sound configuration.
|
|
void | use () |
| Use (fire) this powerup.
|
|
void | hitBonusBox (const ItemState &item) |
| This function is called when a bnous box is it.
|
|
void | saveState (BareNetworkString *buffer) const |
| Save the powerup state.
|
|
void | rewindTo (BareNetworkString *buffer) |
| Restore a powerup state.
|
|
void | update (int ticks) |
|
int | getNum () const |
| Returns the number of powerups.
|
|
PowerupManager::PowerupType | getType () const |
| Returns the type of this powerup.
|
|
|
SFXBase * | m_sound_use |
| Sound effect that is being played.
|
|
PowerupManager::PowerupType | m_type |
| The powerup type.
|
|
int | m_number |
| Number of collected powerups.
|
|
AbstractKart * | m_kart |
| The owner (kart) of this powerup.
|
|
std::set< int > | m_played_sound_ticks |
|
◆ Powerup()
Constructor, stores the kart to which this powerup belongs.
- Parameters
-
kart | The kart to which this powerup belongs. |
◆ getIcon()
Returns the icon for the currently collected powerup.
Used in the race_gui to display the collected item.
◆ hitBonusBox()
void Powerup::hitBonusBox |
( |
const ItemState & |
item_state | ) |
|
This function is called when a bnous box is it.
This function can be called on a server (in which case item and add_info are not used), or on a client, in which case the item and additional info is used to make sure server and clients are synched correctly.
- Parameters
-
n | |
item_state | The item_state (bonux box) that was hit. This is necessary for servers so that the clients can be informed which item was collected. |
◆ rewindTo()
Restore a powerup state.
Called from the kart rewinder when restoring a state.
- Parameters
-
buffer | Buffer with the state of this powerup object. |
◆ saveState()
Save the powerup state.
Called from the kart rewinder when saving the kart state or when a new powerup even is saved.
- Parameters
-
buffer | The buffer into which to save the state. |
◆ set()
void Powerup::set |
( |
PowerupManager::PowerupType |
type, |
|
|
int |
n = 1 |
|
) |
| |
Sets the collected items.
The number of items is increased if the same item is currently collected, otherwise replaces the existing item. It also sets item specific sounds.
- Parameters
-
type | Thew new type. |
n | Number of items of the given type. |
◆ setNum()
void Powerup::setNum |
( |
int |
n = 1 | ) |
|
Sets the amount of the current collected item.
- Parameters
-
The documentation for this class was generated from the following files: