OpenXcom
1.0
Open-source clone of the original X-Com
|
Explosion state not only handles explosions, but also bullet impacts! Refactoring tip : ImpactBState. More...
#include <ExplosionBState.h>
Public Member Functions | |
ExplosionBState (BattlescapeGame *parent, Position center, BattleItem *item, BattleUnit *unit, Tile *tile=0, bool lowerWeapon=false) | |
Creates a new ExplosionBState class. More... | |
~ExplosionBState () | |
Cleans up the ExplosionBState. More... | |
void | init () |
Initializes the state. More... | |
void | cancel () |
Handles a cancel request. More... | |
void | think () |
Runs state functionality every cycle. More... | |
std::string | getResult () const |
Gets the result of the state. | |
Public Member Functions inherited from OpenXcom::BattleState | |
BattleState (BattlescapeGame *parent, BattleAction action) | |
Creates a new BattleState linked to the game. More... | |
BattleState (BattlescapeGame *parent) | |
Creates a new BattleState linked to the game. More... | |
virtual | ~BattleState () |
Cleans up the BattleState. More... | |
BattleAction | getAction () const |
Gets a copy of the action. More... | |
Explosion state not only handles explosions, but also bullet impacts! Refactoring tip : ImpactBState.
OpenXcom::ExplosionBState::ExplosionBState | ( | BattlescapeGame * | parent, |
Position | center, | ||
BattleItem * | item, | ||
BattleUnit * | unit, | ||
Tile * | tile = 0 , |
||
bool | lowerWeapon = false |
||
) |
Creates a new ExplosionBState class.
Sets up an ExplosionBState.
parent | Pointer to the BattleScape. |
center | Center position in voxelspace. |
item | Item involved in the explosion (eg grenade). |
unit | Unit involved in the explosion (eg unit throwing the grenade). |
tile | Tile the explosion is on. |
lowerWeapon | Whether the unit causing this explosion should now lower their weapon. |
OpenXcom::ExplosionBState::~ExplosionBState | ( | ) |
Cleans up the ExplosionBState.
Deletes the ExplosionBState.
|
virtual |
|
virtual |
Initializes the state.
Initializes the explosion.
The animation and sound starts here. If the animation is finished, the actual effect takes place.
Reimplemented from OpenXcom::BattleState.
|
virtual |
Runs state functionality every cycle.
Animates explosion sprites.
If their animation is finished remove them from the list. If the list is empty, this state is finished and the actual calculations take place.
Reimplemented from OpenXcom::BattleState.