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 | List of all members
OpenXcom::BattlescapeGenerator Class Reference

A utility class that generates the initial battlescape data. More...

#include <BattlescapeGenerator.h>

Public Member Functions

 BattlescapeGenerator (Game *game)
 Creates a new BattlescapeGenerator class. More...
 
 ~BattlescapeGenerator ()
 Cleans up the BattlescapeGenerator. More...
 
void setCraft (Craft *craft)
 Sets the XCom craft. More...
 
void setUfo (Ufo *ufo)
 Sets the ufo. More...
 
void setWorldTexture (int texture)
 Sets the polygon texture. More...
 
void setWorldShade (int shade)
 Sets the polygon shade. More...
 
void setAlienRace (const std::string &alienRace)
 Sets the alien race. More...
 
void setAlienItemlevel (int alienItemLevel)
 Sets the alien item level. More...
 
void setBase (Base *base)
 Sets the XCom base. More...
 
void setTerrorSite (TerrorSite *site)
 Sets the terror site. More...
 
void setAlienBase (AlienBase *base)
 Sets the alien base. More...
 
void run ()
 Runs the generator. More...
 
void nextStage ()
 Sets up the next stage (for cydonia/tftd terror missions). More...
 
bool placeUnitNearFriend (BattleUnit *unit)
 Finds a spot near a friend to spawn at. More...
 
void runInventory (Craft *craft)
 Generates an inventory battlescape. More...
 
void loadWeapons ()
 Load all Xcom weapons. More...
 

Detailed Description

A utility class that generates the initial battlescape data.

Taking into account mission type, craft and ufo involved, terrain type,...

Constructor & Destructor Documentation

OpenXcom::BattlescapeGenerator::BattlescapeGenerator ( Game game)

Creates a new BattlescapeGenerator class.

Sets up a BattlescapeGenerator.

Parameters
gamepointer to Game object.
OpenXcom::BattlescapeGenerator::~BattlescapeGenerator ( )

Cleans up the BattlescapeGenerator.

Deletes the BattlescapeGenerator.

Member Function Documentation

void OpenXcom::BattlescapeGenerator::loadWeapons ( )

Load all Xcom weapons.

Loads all XCom weaponry before anything else is distributed.

void OpenXcom::BattlescapeGenerator::nextStage ( )

Sets up the next stage (for cydonia/tftd terror missions).

Switches an existing battlescapesavegame to a new stage.

bool OpenXcom::BattlescapeGenerator::placeUnitNearFriend ( BattleUnit unit)

Finds a spot near a friend to spawn at.

Places a unit near a friendly unit.

Parameters
unitPointer to the unit in question.
Returns
If we successfully placed the unit.
void OpenXcom::BattlescapeGenerator::run ( )

Runs the generator.

Starts the generator; it fills up the battlescapesavegame with data.

void OpenXcom::BattlescapeGenerator::runInventory ( Craft craft)

Generates an inventory battlescape.

Creates a mini-battle-save for managing inventory from the Geoscape.

Kids, don't try this at home!

Parameters
craftPointer to craft to manage.
void OpenXcom::BattlescapeGenerator::setAlienBase ( AlienBase base)

Sets the alien base.

Sets the alien base involved in the battle.

Parameters
basePointer to alien base.
void OpenXcom::BattlescapeGenerator::setAlienItemlevel ( int  alienItemLevel)

Sets the alien item level.

This is used to determine how advanced the equipment of the aliens will be. note: this only applies to "New Battle" type games. we intentionally don't alter the month for those, because we're using monthsPassed -1 for new battle in other sections of code.

  • this value should be from 0 to the size of the itemLevel array in the ruleset (default 9).
  • at a certain number of months higher item levels appear more and more and lower ones will gradually disappear
    Parameters
    alienItemLevelAlienItemLevel.
void OpenXcom::BattlescapeGenerator::setAlienRace ( const std::string &  alienRace)

Sets the alien race.

Sets the alien race on the mission.

This is used to determine the various alien types to spawn.

Parameters
alienRaceAlien (main) race.
void OpenXcom::BattlescapeGenerator::setBase ( Base base)

Sets the XCom base.

Sets the XCom base involved in the battle.

Parameters
basePointer to XCom base.
void OpenXcom::BattlescapeGenerator::setCraft ( Craft craft)

Sets the XCom craft.

Sets the XCom craft involved in the battle.

Parameters
craftPointer to XCom craft.
void OpenXcom::BattlescapeGenerator::setTerrorSite ( TerrorSite terror)

Sets the terror site.

Sets the terror site involved in the battle.

Parameters
terrorPointer to terror site.
void OpenXcom::BattlescapeGenerator::setUfo ( Ufo ufo)

Sets the ufo.

Sets the ufo involved in the battle.

Parameters
ufoPointer to UFO.
void OpenXcom::BattlescapeGenerator::setWorldShade ( int  shade)

Sets the polygon shade.

Sets the world shade where a ufo crashed.

This is used to determine the battlescape light level.

Parameters
shadeShade of the polygon on the globe.
void OpenXcom::BattlescapeGenerator::setWorldTexture ( int  texture)

Sets the polygon texture.

Sets the world texture where a ufo crashed.

This is used to determine the terrain.

Parameters
textureTexture id of the polygon on the globe.

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