![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
The battlescape data that gets written to disk when the game is saved. More...
#include <SavedBattleGame.h>
Public Member Functions | |
SavedBattleGame () | |
Creates a new battle save, based on the current generic save. More... | |
~SavedBattleGame () | |
Cleans up the saved game. More... | |
void | load (const YAML::Node &node, Mod *mod, SavedGame *savedGame) |
Loads a saved battle game from YAML. More... | |
YAML::Node | save () const |
Saves a saved battle game to YAML. More... | |
void | initMap (int mapsize_x, int mapsize_y, int mapsize_z, bool resetTerrain=true) |
Sets the dimensions of the map and initializes it. More... | |
void | initUtilities (Mod *mod) |
Initialises the pathfinding and tileengine. More... | |
std::vector< MapDataSet * > * | getMapDataSets () |
Gets the game's mapdatafiles. More... | |
void | setMissionType (const std::string &missionType) |
Sets the mission type. More... | |
std::string | getMissionType () const |
Gets the mission type. More... | |
void | setGlobalShade (int shade) |
Sets the global shade. More... | |
int | getGlobalShade () const |
Gets the global shade. More... | |
Tile ** | getTiles () const |
Gets a pointer to the tiles, a tile is the smallest component of battlescape. More... | |
std::vector< Node * > * | getNodes () |
Gets a pointer to the list of nodes. More... | |
std::vector< BattleItem * > * | getItems () |
Gets a pointer to the list of items. More... | |
std::vector< BattleUnit * > * | getUnits () |
Gets a pointer to the list of units. More... | |
int | getMapSizeX () const |
Gets terrain size x. More... | |
int | getMapSizeY () const |
Gets terrain size y. More... | |
int | getMapSizeZ () const |
Gets terrain size z. More... | |
int | getMapSizeXYZ () const |
Gets terrain x*y*z. More... | |
int | getTileIndex (Position pos) const |
Converts coordinates into a unique index. More... | |
void | getTileCoords (int index, int *x, int *y, int *z) const |
Converts a tile index to its coordinates. More... | |
Tile * | getTile (Position pos) const |
Gets the Tile at a given position on the map. More... | |
BattleUnit * | getSelectedUnit () const |
Gets the currently selected unit. More... | |
void | setSelectedUnit (BattleUnit *unit) |
Sets the currently selected unit. More... | |
BattleUnit * | selectPreviousPlayerUnit (bool checkReselect=false, bool setReselect=false, bool checkInventory=false) |
Selects the previous soldier. More... | |
BattleUnit * | selectNextPlayerUnit (bool checkReselect=false, bool setReselect=false, bool checkInventory=false) |
Selects the next soldier. More... | |
BattleUnit * | selectUnit (Position pos) |
Selects the unit with position on map. More... | |
Pathfinding * | getPathfinding () const |
Gets the pathfinding object. More... | |
TileEngine * | getTileEngine () const |
Gets a pointer to the tileengine. More... | |
UnitFaction | getSide () const |
Gets the playing side. More... | |
int | getTurn () const |
Gets the turn number. More... | |
void | endTurn () |
Ends the turn. More... | |
void | setDebugMode () |
Sets debug mode. More... | |
bool | getDebugMode () const |
Gets debug mode. More... | |
void | loadMapResources (Mod *mod) |
Load map resources. More... | |
void | resetUnitTiles () |
Resets tiles units are standing on. More... | |
void | removeItem (BattleItem *item) |
Removes an item from the game. More... | |
void | setAborted (bool flag) |
Sets whether the mission was aborted. More... | |
bool | isAborted () const |
Checks if the mission was aborted. More... | |
void | setObjectiveCount (int counter) |
Sets how many objectives need to be destroyed. More... | |
void | addDestroyedObjective () |
increments the objective counter. More... | |
bool | allObjectivesDestroyed () const |
Checks if all the objectives are destroyed. More... | |
int * | getCurrentItemId () |
Gets the current item ID. More... | |
Node * | getSpawnNode (int nodeRank, BattleUnit *unit) |
Gets a spawn node. More... | |
Node * | getPatrolNode (bool scout, BattleUnit *unit, Node *fromNode) |
Gets a patrol node. More... | |
void | prepareNewTurn () |
Carries out new turn preparations. More... | |
void | reviveUnconsciousUnits () |
Revives unconscious units (healthcheck). More... | |
void | removeUnconsciousBodyItem (BattleUnit *bu) |
Removes the body item that corresponds to the unit. | |
bool | setUnitPosition (BattleUnit *bu, Position position, bool testOnly=false) |
Sets or tries to set a unit of a certain size on a certain position of the map. More... | |
bool | addFallingUnit (BattleUnit *unit) |
Adds this unit to the vector of falling units. More... | |
std::list< BattleUnit * > * | getFallingUnits () |
Gets the vector of falling units. More... | |
void | setUnitsFalling (bool fall) |
Toggles the switch that says "there are units falling, start the fall state". More... | |
bool | getUnitsFalling () const |
Checks the status of the switch that says "there are units falling". More... | |
BattlescapeState * | getBattleState () |
Gets a pointer to the BattlescapeState. More... | |
BattlescapeGame * | getBattleGame () |
Gets a pointer to the BattlescapeGame. More... | |
void | setBattleState (BattlescapeState *bs) |
Sets the pointer to the BattlescapeState. More... | |
BattleUnit * | getHighestRankedXCom () |
Gets the highest ranked, living XCom unit. More... | |
int | getMoraleModifier (BattleUnit *unit=0) |
Gets the morale modifier for XCom based on the highest ranked, living XCom unit, or the modifier for the unit passed to this function. More... | |
bool | eyesOnTarget (UnitFaction faction, BattleUnit *unit) |
Checks whether a particular faction has eyes on *unit (whether any unit on that faction sees *unit). More... | |
bool | placeUnitNearPosition (BattleUnit *unit, const Position &entryPoint, bool largeFriend) |
Attempts to place a unit on or near entryPoint. More... | |
void | resetTurnCounter () |
Resets the turn counter. | |
void | resetTiles () |
Resets the visibility of all tiles on the map. More... | |
const std::vector< Position > & | getTileSearch () const |
get an 11x11 grid of positions (-10 to +10) to check. More... | |
bool | isCheating () const |
check if the AI has engaged cheat mode. More... | |
BattleActionType | getTUReserved () const |
get the reserved fire mode. More... | |
void | setTUReserved (BattleActionType reserved) |
set the reserved fire mode. More... | |
bool | getKneelReserved () const |
get whether we are reserving TUs to kneel. More... | |
void | setKneelReserved (bool reserved) |
set whether we are reserving TUs to kneel. More... | |
std::vector< Position > & | getStorageSpace () |
give me access to the storage tiles vector. More... | |
void | randomizeItemLocations (Tile *t) |
move all the leftover items to random locations in the storage tiles vector. More... | |
std::vector< std::vector< std::pair< int, int > > > & | getModuleMap () |
get a reference to the baseModules map. More... | |
void | calculateModuleMap () |
calculate the number of map modules remaining More... | |
SavedGame * | getGeoscapeSave () |
a shortcut to the geoscape save. More... | |
int | getDepth () const |
get the depth of the battlescape game. More... | |
void | setDepth (int depth) |
set the depth of the battlescape game. More... | |
void | setPaletteByDepth (State *state) |
uses the depth variable to set a palette. More... | |
void | setAmbientSound (int sound) |
sets the ambient sound effect; More... | |
int | getAmbientSound () const |
gets the ambient sound effect; More... | |
std::vector< BattleItem * > * | getGuaranteedRecoveredItems () |
gets the list of items we're guaranteed. More... | |
std::vector< BattleItem * > * | getConditionalRecoveredItems () |
gets the list of items we MIGHT get. More... | |
std::string & | getMusic () |
Get the name of the music track. More... | |
void | setMusic (const std::string &track) |
Set the name of the music track. More... | |
void | setObjectiveType (int type) |
Sets the objective type for this mission. More... | |
SpecialTileType | getObjectiveType () const |
Gets the objective type of this mission. More... | |
void | setAmbientVolume (double volume) |
sets the ambient sound effect; More... | |
double | getAmbientVolume () const |
gets the ambient sound effect; More... | |
int | getTurnLimit () const |
Gets the turn limit for this mission. More... | |
ChronoTrigger | getChronoTrigger () const |
Gets the action that triggers when the timer runs out. More... | |
void | setTurnLimit (int limit) |
Sets the turn limit for this mission. More... | |
void | setChronoTrigger (ChronoTrigger trigger) |
Sets the action that triggers when the timer runs out. More... | |
void | setCheatTurn (int turn) |
Sets the turn to start the aliens cheating. More... | |
bool | isBeforeGame () const |
Check whether the battle has actually commenced or not. | |
bool | isItemUsable (RuleItem *item) const |
Checks if an item is usable on this map. More... | |
void | resetUnitHitStates () |
Reset all the unit hit state flags. More... | |
The battlescape data that gets written to disk when the game is saved.
A saved game holds all the variable info in a game like mapdata, soldiers, items, etc.
OpenXcom::SavedBattleGame::SavedBattleGame | ( | ) |
Creates a new battle save, based on the current generic save.
Initializes a brand new battlescape saved game.
OpenXcom::SavedBattleGame::~SavedBattleGame | ( | ) |
Cleans up the saved game.
Deletes the game content from memory.
void OpenXcom::SavedBattleGame::addDestroyedObjective | ( | ) |
increments the objective counter.
Sets whether the objective is destroyed.
bool OpenXcom::SavedBattleGame::addFallingUnit | ( | BattleUnit * | unit | ) |
Adds this unit to the vector of falling units.
Adds this unit to the vector of falling units, if it doesn't already exist.
unit | The unit. |
bool OpenXcom::SavedBattleGame::allObjectivesDestroyed | ( | ) | const |
Checks if all the objectives are destroyed.
Returns whether the objectives are destroyed.
void OpenXcom::SavedBattleGame::calculateModuleMap | ( | ) |
calculate the number of map modules remaining
calculate the number of map modules remaining by counting the map objects on the top floor who have the baseModule flag set.
we store this data in the grid as outlined in the comments above, in pairs representing initial and current values.
void OpenXcom::SavedBattleGame::endTurn | ( | ) |
Ends the turn.
Ends the current turn and progresses to the next one.
bool OpenXcom::SavedBattleGame::eyesOnTarget | ( | UnitFaction | faction, |
BattleUnit * | unit | ||
) |
Checks whether a particular faction has eyes on *unit (whether any unit on that faction sees *unit).
Checks whether anyone on a particular faction is looking at the unit.
Similar to getSpottingUnits() but returns a bool and stops searching if one positive hit is found.
faction | Faction to check through. |
unit | Whom to spot. |
int OpenXcom::SavedBattleGame::getAmbientSound | ( | ) | const |
gets the ambient sound effect;
get the ambient battlescape sound effect.
double OpenXcom::SavedBattleGame::getAmbientVolume | ( | ) | const |
gets the ambient sound effect;
Gets the ambient sound effect volume.
BattlescapeGame * OpenXcom::SavedBattleGame::getBattleGame | ( | ) |
Gets a pointer to the BattlescapeGame.
Gets the BattlescapeState.
BattlescapeState * OpenXcom::SavedBattleGame::getBattleState | ( | ) |
Gets a pointer to the BattlescapeState.
Gets the BattlescapeState.
ChronoTrigger OpenXcom::SavedBattleGame::getChronoTrigger | ( | ) | const |
Gets the action that triggers when the timer runs out.
Gets the action type to perform when the timer expires.
std::vector< BattleItem * > * OpenXcom::SavedBattleGame::getConditionalRecoveredItems | ( | ) |
gets the list of items we MIGHT get.
get the list of items we're not guaranteed to take with us (ie: items that were NOT in the skyranger)
int * OpenXcom::SavedBattleGame::getCurrentItemId | ( | ) |
Gets the current item ID.
bool OpenXcom::SavedBattleGame::getDebugMode | ( | ) | const |
Gets debug mode.
Gets the current debug mode.
int OpenXcom::SavedBattleGame::getDepth | ( | ) | const |
get the depth of the battlescape game.
check the depth of the battlescape.
std::list< BattleUnit * > * OpenXcom::SavedBattleGame::getFallingUnits | ( | ) |
Gets the vector of falling units.
Gets all units in the battlescape that are falling.
SavedGame * OpenXcom::SavedBattleGame::getGeoscapeSave | ( | ) |
a shortcut to the geoscape save.
get a pointer to the geoscape save
int OpenXcom::SavedBattleGame::getGlobalShade | ( | ) | const |
Gets the global shade.
std::vector< BattleItem * > * OpenXcom::SavedBattleGame::getGuaranteedRecoveredItems | ( | ) |
gets the list of items we're guaranteed.
get the list of items we're guaranteed to take with us (ie: items that were in the skyranger)
BattleUnit * OpenXcom::SavedBattleGame::getHighestRankedXCom | ( | ) |
Gets the highest ranked, living XCom unit.
std::vector< BattleItem * > * OpenXcom::SavedBattleGame::getItems | ( | ) |
Gets a pointer to the list of items.
Gets the list of items.
bool OpenXcom::SavedBattleGame::getKneelReserved | ( | ) | const |
get whether we are reserving TUs to kneel.
Gets the kneel reservation setting.
std::vector< MapDataSet * > * OpenXcom::SavedBattleGame::getMapDataSets | ( | ) |
Gets the game's mapdatafiles.
Gets the array of mapblocks.
int OpenXcom::SavedBattleGame::getMapSizeX | ( | ) | const |
Gets terrain size x.
Gets the map width.
int OpenXcom::SavedBattleGame::getMapSizeXYZ | ( | ) | const |
Gets terrain x*y*z.
Gets the map size in tiles.
int OpenXcom::SavedBattleGame::getMapSizeY | ( | ) | const |
Gets terrain size y.
Gets the map length.
int OpenXcom::SavedBattleGame::getMapSizeZ | ( | ) | const |
Gets terrain size z.
Gets the map height.
std::string OpenXcom::SavedBattleGame::getMissionType | ( | ) | const |
Gets the mission type.
std::vector< std::vector< std::pair< int, int > > > & OpenXcom::SavedBattleGame::getModuleMap | ( | ) |
get a reference to the baseModules map.
Return a reference to the base module destruction map this map contains information on how many destructible base modules remain at any given grid reference in the basescape, using [x][y] format.
-1 for "no items" 0 for "destroyed" and any actual number represents how many left.
int OpenXcom::SavedBattleGame::getMoraleModifier | ( | BattleUnit * | unit = 0 | ) |
Gets the morale modifier for XCom based on the highest ranked, living XCom unit, or the modifier for the unit passed to this function.
Gets the morale modifier for.
unit | Unit. |
std::string & OpenXcom::SavedBattleGame::getMusic | ( | ) |
Get the name of the music track.
Get the music track for the current battle.
std::vector< Node * > * OpenXcom::SavedBattleGame::getNodes | ( | ) |
Gets a pointer to the list of nodes.
Gets the list of nodes.
SpecialTileType OpenXcom::SavedBattleGame::getObjectiveType | ( | ) | const |
Gets the objective type of this mission.
Get the objective type for the current battle.
Pathfinding * OpenXcom::SavedBattleGame::getPathfinding | ( | ) | const |
Gets the pathfinding object.
Node * OpenXcom::SavedBattleGame::getPatrolNode | ( | bool | scout, |
BattleUnit * | unit, | ||
Node * | fromNode | ||
) |
Gets a patrol node.
Finds a fitting node where a unit can patrol to.
scout | Is the unit scouting? |
unit | Pointer to the unit (to get its position). |
fromNode | Pointer to the node the unit is at. |
BattleUnit * OpenXcom::SavedBattleGame::getSelectedUnit | ( | ) | const |
Gets the currently selected unit.
UnitFaction OpenXcom::SavedBattleGame::getSide | ( | ) | const |
Gets the playing side.
Gets the side currently playing.
Node * OpenXcom::SavedBattleGame::getSpawnNode | ( | int | nodeRank, |
BattleUnit * | unit | ||
) |
Gets a spawn node.
Finds a fitting node where a unit can spawn.
nodeRank | Rank of the node (this is not the rank of the alien!). |
unit | Pointer to the unit (to get its position). |
std::vector< Position > & OpenXcom::SavedBattleGame::getStorageSpace | ( | ) |
give me access to the storage tiles vector.
Gives access to the "storage space" vector, for distribution of items in base defense missions.
void OpenXcom::SavedBattleGame::getTileCoords | ( | int | index, |
int * | x, | ||
int * | y, | ||
int * | z | ||
) | const |
Converts a tile index to its coordinates.
Converts a tile index to coordinates.
index | The (unique) tileindex. |
x | Pointer to the X coordinate. |
y | Pointer to the Y coordinate. |
z | Pointer to the Z coordinate. |
TileEngine * OpenXcom::SavedBattleGame::getTileEngine | ( | ) | const |
Gets a pointer to the tileengine.
Gets the terrain modifier object.
|
inline |
Converts coordinates into a unique index.
getTile() calls this every time, so should be inlined along with it.
pos | The position to convert. |
Tile ** OpenXcom::SavedBattleGame::getTiles | ( | ) | const |
Gets a pointer to the tiles, a tile is the smallest component of battlescape.
Gets the array of tiles.
const std::vector< Position > & OpenXcom::SavedBattleGame::getTileSearch | ( | ) | const |
get an 11x11 grid of positions (-10 to +10) to check.
BattleActionType OpenXcom::SavedBattleGame::getTUReserved | ( | ) | const |
get the reserved fire mode.
Gets the TU reserved type.
int OpenXcom::SavedBattleGame::getTurn | ( | ) | const |
Gets the turn number.
Gets the current turn number.
int OpenXcom::SavedBattleGame::getTurnLimit | ( | ) | const |
Gets the turn limit for this mission.
Gets the maximum number of turns we have before this mission ends.
std::vector< BattleUnit * > * OpenXcom::SavedBattleGame::getUnits | ( | ) |
Gets a pointer to the list of units.
Gets the list of units.
bool OpenXcom::SavedBattleGame::getUnitsFalling | ( | ) | const |
Checks the status of the switch that says "there are units falling".
Returns whether there are any units falling in the battlescape.
void OpenXcom::SavedBattleGame::initMap | ( | int | mapsize_x, |
int | mapsize_y, | ||
int | mapsize_z, | ||
bool | resetTerrain = true |
||
) |
Sets the dimensions of the map and initializes it.
Initializes the array of tiles and creates a pathfinding object.
mapsize_x | |
mapsize_y | |
mapsize_z |
void OpenXcom::SavedBattleGame::initUtilities | ( | Mod * | mod | ) |
Initialises the pathfinding and tileengine.
Initializes the map utilities.
mod | Pointer to mod. |
bool OpenXcom::SavedBattleGame::isAborted | ( | ) | const |
Checks if the mission was aborted.
Returns whether the mission was aborted or successful.
bool OpenXcom::SavedBattleGame::isCheating | ( | ) | const |
check if the AI has engaged cheat mode.
is the AI allowed to cheat?
bool OpenXcom::SavedBattleGame::isItemUsable | ( | RuleItem * | item | ) | const |
Checks if an item is usable on this map.
Checks if an item can be used in the current battlescape conditions.
Loads a saved battle game from YAML.
Loads the saved battle game from a YAML file.
node | YAML node. |
mod | for the saved game. |
savedGame | Pointer to saved game. |
void OpenXcom::SavedBattleGame::loadMapResources | ( | Mod * | mod | ) |
Load map resources.
Loads the resources required by the map in the battle save.
mod | Pointer to the mod. |
bool OpenXcom::SavedBattleGame::placeUnitNearPosition | ( | BattleUnit * | unit, |
const Position & | entryPoint, | ||
bool | largeFriend | ||
) |
Attempts to place a unit on or near entryPoint.
Places a unit on or near a position.
unit | The unit to place. |
entryPoint | The position around which to attempt to place the unit. |
void OpenXcom::SavedBattleGame::prepareNewTurn | ( | ) |
Carries out new turn preparations.
Carries out new turn preparations such as fire and smoke spreading.
void OpenXcom::SavedBattleGame::randomizeItemLocations | ( | Tile * | t | ) |
move all the leftover items to random locations in the storage tiles vector.
Move all the leftover items in base defense missions to random locations in the storage facilities.
t | the tile where all our goodies are initially stored. |
void OpenXcom::SavedBattleGame::removeItem | ( | BattleItem * | item | ) |
Removes an item from the game.
Eg. when ammo item is depleted.
item | The Item to remove. |
void OpenXcom::SavedBattleGame::resetTiles | ( | ) |
Resets the visibility of all tiles on the map.
Resets visibility of all the tiles on the map.
void OpenXcom::SavedBattleGame::resetUnitHitStates | ( | ) |
Reset all the unit hit state flags.
Resets all unit hit state flags.
void OpenXcom::SavedBattleGame::resetUnitTiles | ( | ) |
Resets tiles units are standing on.
Resets all the units to their current standing tile(s).
void OpenXcom::SavedBattleGame::reviveUnconsciousUnits | ( | ) |
Revives unconscious units (healthcheck).
Checks for units that are unconscious and revives them if they shouldn't be.
Revived units need a tile to stand on. If the unit's current position is occupied, then all directions around the tile are searched for a free tile to place the unit in. If no free tile is found the unit stays unconscious.
YAML::Node OpenXcom::SavedBattleGame::save | ( | ) | const |
Saves a saved battle game to YAML.
Saves the saved battle game to a YAML file.
BattleUnit * OpenXcom::SavedBattleGame::selectNextPlayerUnit | ( | bool | checkReselect = false , |
bool | setReselect = false , |
||
bool | checkInventory = false |
||
) |
Selects the next soldier.
Selects the next player unit.
checkReselect | Whether to check if we should reselect a unit. |
setReselect | Don't reselect a unit. |
checkInventory | Whether to check if the unit has an inventory. |
BattleUnit * OpenXcom::SavedBattleGame::selectPreviousPlayerUnit | ( | bool | checkReselect = false , |
bool | setReselect = false , |
||
bool | checkInventory = false |
||
) |
Selects the previous soldier.
Selects the previous player unit.
checkReselect | Whether to check if we should reselect a unit. |
setReselect | Don't reselect a unit. |
checkInventory | Whether to check if the unit has an inventory. |
BattleUnit * OpenXcom::SavedBattleGame::selectUnit | ( | Position | pos | ) |
Selects the unit with position on map.
Selects the unit at the given position on the map.
pos | Position. |
void OpenXcom::SavedBattleGame::setAborted | ( | bool | flag | ) |
Sets whether the mission was aborted.
Sets whether the mission was aborted or successful.
flag | True, if the mission was aborted, or false, if the mission was successful. |
void OpenXcom::SavedBattleGame::setAmbientSound | ( | int | sound | ) |
sets the ambient sound effect;
set the ambient battlescape sound effect.
sound | the intended sound. |
void OpenXcom::SavedBattleGame::setAmbientVolume | ( | double | volume | ) |
sets the ambient sound effect;
Sets the ambient sound effect volume.
volume | the ambient volume. |
void OpenXcom::SavedBattleGame::setBattleState | ( | BattlescapeState * | bs | ) |
Sets the pointer to the BattlescapeState.
Sets the BattlescapeState.
bs | A Pointer to a BattlescapeState. |
void OpenXcom::SavedBattleGame::setCheatTurn | ( | int | turn | ) |
Sets the turn to start the aliens cheating.
Sets the turn at which the players become exposed to the AI.
turn | the turn to start cheating. |
void OpenXcom::SavedBattleGame::setChronoTrigger | ( | ChronoTrigger | trigger | ) |
Sets the action that triggers when the timer runs out.
Sets the action type to occur when the timer runs out.
trigger | the action type to perform. |
void OpenXcom::SavedBattleGame::setDebugMode | ( | ) |
Sets debug mode.
Turns on debug mode.
void OpenXcom::SavedBattleGame::setDepth | ( | int | depth | ) |
set the depth of the battlescape game.
depth | the intended depth 0-3. |
void OpenXcom::SavedBattleGame::setGlobalShade | ( | int | shade | ) |
Sets the global shade.
shade | The global shade. |
void OpenXcom::SavedBattleGame::setKneelReserved | ( | bool | reserved | ) |
set whether we are reserving TUs to kneel.
Sets the kneel reservation setting.
reserved | Should we reserve an extra 4 TUs to kneel? |
void OpenXcom::SavedBattleGame::setMissionType | ( | const std::string & | missionType | ) |
Sets the mission type.
missionType | The mission type. |
void OpenXcom::SavedBattleGame::setMusic | ( | const std::string & | track | ) |
Set the name of the music track.
Set the music track for this battle.
track | the track name. |
void OpenXcom::SavedBattleGame::setObjectiveCount | ( | int | counter | ) |
Sets how many objectives need to be destroyed.
increments the number of objectives to be destroyed.
void OpenXcom::SavedBattleGame::setObjectiveType | ( | int | type | ) |
Sets the objective type for this mission.
Set the objective type for the current battle.
the | objective type. |
void OpenXcom::SavedBattleGame::setPaletteByDepth | ( | State * | state | ) |
uses the depth variable to set a palette.
uses the depth variable to choose a palette.
state | the state to set the palette for. |
void OpenXcom::SavedBattleGame::setSelectedUnit | ( | BattleUnit * | unit | ) |
Sets the currently selected unit.
unit | Pointer to BattleUnit. |
void OpenXcom::SavedBattleGame::setTUReserved | ( | BattleActionType | reserved | ) |
set the reserved fire mode.
Sets the TU reserved type.
reserved | A battleactiontype. |
void OpenXcom::SavedBattleGame::setTurnLimit | ( | int | limit | ) |
Sets the turn limit for this mission.
limit | the turn limit. |
bool OpenXcom::SavedBattleGame::setUnitPosition | ( | BattleUnit * | bu, |
Position | position, | ||
bool | testOnly = false |
||
) |
Sets or tries to set a unit of a certain size on a certain position of the map.
Places units on the map.
Handles large units that are placed on multiple tiles.
bu | The unit to be placed. |
position | The position to place the unit. |
testOnly | If true then just checks if the unit can be placed at the position. |
void OpenXcom::SavedBattleGame::setUnitsFalling | ( | bool | fall | ) |
Toggles the switch that says "there are units falling, start the fall state".
fall | True if there are any units falling in the battlescape. |