OpenXcom
1.0
Open-source clone of the original X-Com
|
A projectile state. More...
#include <ProjectileFlyBState.h>
Public Member Functions | |
ProjectileFlyBState (BattlescapeGame *parent, BattleAction action) | |
Creates a new ProjectileFly class. | |
ProjectileFlyBState (BattlescapeGame *parent, BattleAction action, Position origin) | |
Sets up an ProjectileFlyBState. | |
~ProjectileFlyBState () | |
Cleans up the ProjectileFly. More... | |
void | init () |
Initializes the state. More... | |
void | cancel () |
Handles a cancel request. More... | |
void | think () |
Runs state functionality every cycle. More... | |
void | setOriginVoxel (Position pos) |
Set the origin voxel, used for the blaster launcher. More... | |
void | targetFloor () |
Set the boolean flag to angle a blaster bomb towards the floor. | |
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... | |
Static Public Member Functions | |
static bool | validThrowRange (BattleAction *action, Position origin, Tile *target) |
Validates the throwing range. More... | |
static int | getMaxThrowDistance (int weight, int strength, int level) |
Calculates the maximum throwing range. More... | |
A projectile state.
OpenXcom::ProjectileFlyBState::~ProjectileFlyBState | ( | ) |
Cleans up the ProjectileFly.
Deletes the ProjectileFlyBState.
|
virtual |
Handles a cancel request.
Flying projectiles cannot be cancelled, but they can be "skipped".
Reimplemented from OpenXcom::BattleState.
|
static |
Calculates the maximum throwing range.
Validates the throwing range.
weight | the weight of the object. |
strength | the strength of the thrower. |
level | the difference in height between the thrower and the target. |
|
virtual |
Initializes the state.
Initializes the sequence:
Reimplemented from OpenXcom::BattleState.
void OpenXcom::ProjectileFlyBState::setOriginVoxel | ( | Position | pos | ) |
Set the origin voxel, used for the blaster launcher.
pos | the origin voxel. |
|
virtual |
Runs state functionality every cycle.
Animates the projectile (moves to the next point in its trajectory).
If the animation is finished the projectile sprite is removed from the map, and this state is finished.
Reimplemented from OpenXcom::BattleState.
|
static |