OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
OpenXcom::ProjectileFlyBState Class Reference

A projectile state. More...

#include <ProjectileFlyBState.h>

Inheritance diagram for OpenXcom::ProjectileFlyBState:
OpenXcom::BattleState

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...
 

Detailed Description

A projectile state.

Constructor & Destructor Documentation

OpenXcom::ProjectileFlyBState::~ProjectileFlyBState ( )

Cleans up the ProjectileFly.

Deletes the ProjectileFlyBState.

Member Function Documentation

void OpenXcom::ProjectileFlyBState::cancel ( )
virtual

Handles a cancel request.

Flying projectiles cannot be cancelled, but they can be "skipped".

Reimplemented from OpenXcom::BattleState.

int OpenXcom::ProjectileFlyBState::getMaxThrowDistance ( int  weight,
int  strength,
int  level 
)
static

Calculates the maximum throwing range.

Validates the throwing range.

Parameters
weightthe weight of the object.
strengththe strength of the thrower.
levelthe difference in height between the thrower and the target.
Returns
the maximum throwing range.
void OpenXcom::ProjectileFlyBState::init ( )
virtual

Initializes the state.

Initializes the sequence:

  • checks if the shot is valid,
  • calculates the base accuracy.

Reimplemented from OpenXcom::BattleState.

void OpenXcom::ProjectileFlyBState::setOriginVoxel ( Position  pos)

Set the origin voxel, used for the blaster launcher.

Parameters
posthe origin voxel.
void OpenXcom::ProjectileFlyBState::think ( )
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.

bool OpenXcom::ProjectileFlyBState::validThrowRange ( BattleAction action,
Position  origin,
Tile target 
)
static

Validates the throwing range.

Parameters
actionPointer to throw action.
originPosition to throw from.
targetTile to throw to.
Returns
True when the range is valid.

The documentation for this class was generated from the following files: