OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents an alien UFO on the map. More...
#include <Ufo.h>
Public Member Functions | |
Ufo (RuleUfo *rules) | |
Creates a UFO of the specified type. More... | |
~Ufo () | |
Cleans up the UFO. More... | |
void | load (const YAML::Node &node, const Ruleset &ruleset, SavedGame &game) |
Loads the UFO from YAML. More... | |
YAML::Node | save (bool newBattle) const |
Saves the UFO to YAML. More... | |
YAML::Node | saveId () const |
Saves the UFO's ID to YAML. More... | |
RuleUfo * | getRules () const |
Gets the UFO's ruleset. More... | |
int | getId () const |
Gets the UFO's ID. More... | |
void | setId (int id) |
Sets the UFO's ID. More... | |
std::wstring | getName (Language *lang) const |
Gets the UFO's name. More... | |
int | getDamage () const |
Gets the UFO's amount of damage. More... | |
void | setDamage (int damage) |
Sets the UFO's amount of damage. More... | |
bool | getDetected () const |
Gets the UFO's detection status. More... | |
void | setDetected (bool detected) |
Sets the UFO's detection status. More... | |
size_t | getSecondsRemaining () const |
Gets the UFO's seconds left on the ground. More... | |
void | setSecondsRemaining (size_t seconds) |
Sets the UFO's seconds left on the ground. More... | |
std::string | getDirection () const |
Gets the UFO's direction. More... | |
std::string | getAltitude () const |
Gets the UFO's altitude. More... | |
void | setAltitude (const std::string &altitude) |
Sets the UFO's altitude. More... | |
enum UfoStatus | getStatus () const |
Gets the UFO status. | |
void | setStatus (enum UfoStatus status) |
Set the UFO's status. | |
bool | isCrashed () const |
Gets if the UFO has crashed. More... | |
bool | isDestroyed () const |
Gets if the UFO has been destroyed. More... | |
void | think () |
Handles UFO logic. More... | |
void | setInBattlescape (bool inbattle) |
Sets the UFO's battlescape status. More... | |
bool | isInBattlescape () const |
Gets if the UFO is in battlescape. More... | |
const std::string & | getAlienRace () const |
Gets the UFO's alien race. More... | |
void | setShotDownByCraftId (const int id) |
Sets the ID of craft which shot down the UFO. | |
int | getShotDownByCraftId () const |
Gets the ID of craft which shot down the UFO. | |
int | getVisibility () const |
Gets the UFO's visibility. More... | |
const std::string & | getMissionType () const |
Gets the UFO's Mission type. More... | |
void | setMissionInfo (AlienMission *mission, const UfoTrajectory *trajectory) |
Sets the UFO's mission information. More... | |
bool | getHyperDetected () const |
Gets the UFO's hyper detection status. More... | |
void | setHyperDetected (bool hyperdetected) |
Sets the UFO's hyper detection status. More... | |
size_t | getTrajectoryPoint () const |
Gets the UFO's progress on the trajectory track. | |
void | setTrajectoryPoint (size_t np) |
Sets the UFO's progress on the trajectory track. | |
const UfoTrajectory & | getTrajectory () const |
Gets the UFO's trajectory. | |
AlienMission * | getMission () const |
Gets the UFO's mission object. | |
void | setDestination (Target *dest) |
Sets the UFO's destination. More... | |
int | getShootingAt () const |
Get which interceptor this ufo is engaging. | |
void | setShootingAt (int target) |
Set which interceptor this ufo is engaging. | |
int | getLandId () const |
Gets the UFO's landing site ID. | |
void | setLandId (int id) |
Sets the UFO's landing site ID. | |
int | getCrashId () const |
Gets the UFO's crash site ID. | |
void | setCrashId (int id) |
Sets the UFO's crash site ID. | |
void | setHitFrame (int frame) |
Sets the UFO's hit frame. | |
int | getHitFrame () |
Gets the UFO's hit frame. | |
Public Member Functions inherited from OpenXcom::MovingTarget | |
virtual | ~MovingTarget () |
Cleans up the moving target. More... | |
void | load (const YAML::Node &node) |
Loads the moving target from YAML. More... | |
virtual YAML::Node | save () const |
Saves the moving target to YAML. More... | |
Target * | getDestination () const |
Gets the moving target's destination. More... | |
int | getSpeed () const |
Gets the moving target's speed. More... | |
void | setSpeed (int speed) |
Sets the moving target's speed. More... | |
bool | reachedDestination () const |
Has the moving target reached its destination? More... | |
void | move () |
Move towards the destination. More... | |
Public Member Functions inherited from OpenXcom::Target | |
virtual | ~Target () |
Cleans up the target. More... | |
void | load (const YAML::Node &node) |
Loads the moving target from YAML. More... | |
double | getLongitude () const |
Gets the target's longitude. More... | |
void | setLongitude (double lon) |
Sets the target's longitude. More... | |
double | getLatitude () const |
Gets the target's latitude. More... | |
void | setLatitude (double lat) |
Sets the target's latitude. More... | |
std::vector< Target * > * | getFollowers () |
Gets the target's followers. More... | |
double | getDistance (const Target *target) const |
Gets the distance to another target. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from OpenXcom::MovingTarget | |
MovingTarget () | |
Creates a moving target. More... | |
Protected Member Functions inherited from OpenXcom::Target | |
Target () | |
Creates a target. More... | |
Represents an alien UFO on the map.
Contains variable info about a UFO like position, damage, speed, etc.
OpenXcom::Ufo::Ufo | ( | RuleUfo * | rules | ) |
Creates a UFO of the specified type.
Initializes a UFO of the specified type.
rules | Pointer to ruleset. |
OpenXcom::Ufo::~Ufo | ( | ) |
Cleans up the UFO.
Make sure our mission forget's us, and we only delete targets we own (waypoints).
const std::string & OpenXcom::Ufo::getAlienRace | ( | ) | const |
Gets the UFO's alien race.
Returns the alien race currently residing in the UFO.
std::string OpenXcom::Ufo::getAltitude | ( | ) | const |
Gets the UFO's altitude.
Returns the current altitude of the UFO.
int OpenXcom::Ufo::getDamage | ( | ) | const |
Gets the UFO's amount of damage.
Returns the amount of damage this UFO has taken.
bool OpenXcom::Ufo::getDetected | ( | ) | const |
Gets the UFO's detection status.
Returns whether this UFO has been detected by radars.
std::string OpenXcom::Ufo::getDirection | ( | ) | const |
Gets the UFO's direction.
Returns the current direction the UFO is heading in.
bool OpenXcom::Ufo::getHyperDetected | ( | ) | const |
Gets the UFO's hyper detection status.
Returns whether this UFO has been detected by hyper-wave.
int OpenXcom::Ufo::getId | ( | ) | const |
Gets the UFO's ID.
Returns the UFO's unique ID.
If it's 0, this UFO has never been detected.
const std::string & OpenXcom::Ufo::getMissionType | ( | ) | const |
Gets the UFO's Mission type.
Returns the Mission type of the UFO.
|
virtual |
Gets the UFO's name.
Returns the UFO's unique identifying name.
lang | Language to get strings from. |
Implements OpenXcom::Target.
RuleUfo * OpenXcom::Ufo::getRules | ( | ) | const |
Gets the UFO's ruleset.
Returns the ruleset for the UFO's type.
size_t OpenXcom::Ufo::getSecondsRemaining | ( | ) | const |
Gets the UFO's seconds left on the ground.
Returns the amount of remaining seconds the UFO has left on the ground.
After this many seconds thet UFO will take off, if landed, or disappear, if crashed.
int OpenXcom::Ufo::getVisibility | ( | ) | const |
Gets the UFO's visibility.
Returns a UFO's visibility to radar detection.
The UFO's size and altitude affect the chances of it being detected by radars.
bool OpenXcom::Ufo::isCrashed | ( | ) | const |
Gets if the UFO has crashed.
Returns if this UFO took enough damage to cause it to crash.
bool OpenXcom::Ufo::isDestroyed | ( | ) | const |
Gets if the UFO has been destroyed.
Returns if this UFO took enough damage to cause it to crash.
bool OpenXcom::Ufo::isInBattlescape | ( | ) | const |
Gets if the UFO is in battlescape.
Gets the UFO's battlescape status.
Loads the UFO from YAML.
Loads the UFO from a YAML file.
node | YAML node. |
ruleset | The game rules. Use to access the trajectory rules. |
game | The game data. Used to find the UFO's mission. |
YAML::Node OpenXcom::Ufo::save | ( | bool | newBattle | ) | const |
Saves the UFO to YAML.
Saves the UFO to a YAML file.
|
virtual |
Saves the UFO's ID to YAML.
Saves the UFO's unique identifiers to a YAML file.
Reimplemented from OpenXcom::Target.
void OpenXcom::Ufo::setAltitude | ( | const std::string & | altitude | ) |
Sets the UFO's altitude.
Changes the current altitude of the UFO.
altitude | Altitude. |
void OpenXcom::Ufo::setDamage | ( | int | damage | ) |
Sets the UFO's amount of damage.
Changes the amount of damage this UFO has taken.
damage | Amount of damage. |
|
virtual |
Sets the UFO's destination.
Handle destination changes, making sure to delete old waypoint destinations.
dest | Pointer to the new destination. |
Reimplemented from OpenXcom::MovingTarget.
void OpenXcom::Ufo::setDetected | ( | bool | detected | ) |
Sets the UFO's detection status.
Changes whether this UFO has been detected by radars.
detected | Detection status. |
void OpenXcom::Ufo::setHyperDetected | ( | bool | hyperdetected | ) |
Sets the UFO's hyper detection status.
Changes whether this UFO has been detected by hyper-wave.
hyperdetected | Detection status. |
void OpenXcom::Ufo::setId | ( | int | id | ) |
Sets the UFO's ID.
Changes the UFO's unique ID.
id | Unique ID. |
void OpenXcom::Ufo::setInBattlescape | ( | bool | inbattle | ) |
Sets the UFO's battlescape status.
inbattle | . |
void OpenXcom::Ufo::setMissionInfo | ( | AlienMission * | mission, |
const UfoTrajectory * | trajectory | ||
) |
Sets the UFO's mission information.
Sets the mission information of the UFO.
The UFO will start at the first point of the trajectory. The actual UFO information is not changed here, this only sets the information kept on behalf of the mission.
mission | Pointer to the actual mission object. |
trajectory | Pointer to the actual mission trajectory. |
void OpenXcom::Ufo::setSecondsRemaining | ( | size_t | seconds | ) |
Sets the UFO's seconds left on the ground.
Changes the amount of remaining seconds the UFO has left on the ground.
After this many seconds thet UFO will take off, if landed, or disappear, if crashed.
seconds | Amount of seconds. |
void OpenXcom::Ufo::think | ( | ) |
Handles UFO logic.
Moves the UFO to its destination.