19 #ifndef OPENXCOM_UFO_H
20 #define OPENXCOM_UFO_H
22 #include "MovingTarget.h"
24 #include <yaml-cpp/yaml.h>
44 enum UfoStatus { FLYING, LANDED, CRASHED, DESTROYED };
47 int _id, _crashId, _landId, _damage;
48 std::string _direction, _altitude;
49 enum UfoStatus _status;
50 size_t _secondsRemaining;
52 int _shotDownByCraftId;
55 size_t _trajectoryPoint;
56 bool _detected, _hyperDetected;
57 int _shootingAt, _hitFrame;
59 void calculateSpeed();
68 YAML::Node
save(
bool newBattle)
const;
98 enum UfoStatus
getStatus()
const {
return _status; }
100 void setStatus(
enum UfoStatus status) {_status = status; }
void setTrajectoryPoint(size_t np)
Sets the UFO's progress on the trajectory track.
Definition: Ufo.h:130
void setHyperDetected(bool hyperdetected)
Sets the UFO's hyper detection status.
Definition: Ufo.cpp:625
Represents an ongoing alien mission.
Definition: AlienMission.h:45
void setId(int id)
Sets the UFO's ID.
Definition: Ufo.cpp:243
size_t getSecondsRemaining() const
Gets the UFO's seconds left on the ground.
Definition: Ufo.cpp:326
void setDetected(bool detected)
Sets the UFO's detection status.
Definition: Ufo.cpp:315
~Ufo()
Cleans up the UFO.
Definition: Ufo.cpp:55
void setHitFrame(int frame)
Sets the UFO's hit frame.
Definition: Ufo.cpp:671
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:80
int getDamage() const
Gets the UFO's amount of damage.
Definition: Ufo.cpp:276
enum UfoStatus getStatus() const
Gets the UFO status.
Definition: Ufo.h:98
bool isCrashed() const
Gets if the UFO has crashed.
Definition: Ufo.cpp:382
void setStatus(enum UfoStatus status)
Set the UFO's status.
Definition: Ufo.h:100
const UfoTrajectory & getTrajectory() const
Gets the UFO's trajectory.
Definition: Ufo.h:132
int getLandId() const
Gets the UFO's landing site ID.
Definition: Ufo.cpp:651
AlienMission * getMission() const
Gets the UFO's mission object.
Definition: Ufo.h:134
void setAltitude(const std::string &altitude)
Sets the UFO's altitude.
Definition: Ufo.cpp:364
void setMissionInfo(AlienMission *mission, const UfoTrajectory *trajectory)
Sets the UFO's mission information.
Definition: Ufo.cpp:603
bool isDestroyed() const
Gets if the UFO has been destroyed.
Definition: Ufo.cpp:392
Contains strings used throughout the game for localization.
Definition: Language.h:42
void setDamage(int damage)
Sets the UFO's amount of damage.
Definition: Ufo.cpp:285
Set of rules and stats for a game.
Definition: Ruleset.h:69
RuleUfo * getRules() const
Gets the UFO's ruleset.
Definition: Ufo.cpp:224
std::string getDirection() const
Gets the UFO's direction.
Definition: Ufo.cpp:346
void setShootingAt(int target)
Set which interceptor this ufo is engaging.
Definition: Ufo.cpp:646
int getShotDownByCraftId() const
Gets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:544
Holds information about a specific trajectory.
Definition: UfoTrajectory.h:49
size_t getTrajectoryPoint() const
Gets the UFO's progress on the trajectory track.
Definition: Ufo.h:128
bool getDetected() const
Gets the UFO's detection status.
Definition: Ufo.cpp:306
virtual YAML::Node save() const
Saves the moving target to YAML.
Definition: MovingTarget.cpp:69
int getId() const
Gets the UFO's ID.
Definition: Ufo.cpp:234
const std::string & getMissionType() const
Gets the UFO's Mission type.
Definition: Ufo.cpp:590
bool getHyperDetected() const
Gets the UFO's hyper detection status.
Definition: Ufo.cpp:616
int getShootingAt() const
Get which interceptor this ufo is engaging.
Definition: Ufo.cpp:641
int getCrashId() const
Gets the UFO's crash site ID.
Definition: Ufo.cpp:661
void setInBattlescape(bool inbattle)
Sets the UFO's battlescape status.
Definition: Ufo.cpp:523
int getHitFrame()
Gets the UFO's hit frame.
Definition: Ufo.cpp:676
Represents an alien UFO on the map.
Definition: Ufo.h:41
YAML::Node saveId() const
Saves the UFO's ID to YAML.
Definition: Ufo.cpp:212
const std::string & getAlienRace() const
Gets the UFO's alien race.
Definition: Ufo.cpp:534
Ufo(RuleUfo *rules)
Creates a UFO of the specified type.
Definition: Ufo.cpp:43
Base class for moving targets on the globe with a certain speed and destination.
Definition: MovingTarget.h:31
void setSecondsRemaining(size_t seconds)
Sets the UFO's seconds left on the ground.
Definition: Ufo.cpp:337
void setDestination(Target *dest)
Sets the UFO's destination.
Definition: Ufo.cpp:634
void think()
Handles UFO logic.
Definition: Ufo.cpp:481
Represents a specific type of UFO.
Definition: RuleUfo.h:37
std::wstring getName(Language *lang) const
Gets the UFO's name.
Definition: Ufo.cpp:253
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
void setShotDownByCraftId(const int id)
Sets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:539
void setLandId(int id)
Sets the UFO's landing site ID.
Definition: Ufo.cpp:656
void setCrashId(int id)
Sets the UFO's crash site ID.
Definition: Ufo.cpp:666
void load(const YAML::Node &node, const Ruleset &ruleset, SavedGame &game)
Loads the UFO from YAML.
Definition: Ufo.cpp:105
std::string getAltitude() const
Gets the UFO's altitude.
Definition: Ufo.cpp:355
bool isInBattlescape() const
Gets if the UFO is in battlescape.
Definition: Ufo.cpp:514
int getVisibility() const
Gets the UFO's visibility.
Definition: Ufo.cpp:555