20 #include "MovingTarget.h" 22 #include <yaml-cpp/yaml.h> 43 static const char *ALTITUDE_STRING[];
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 CraftId _shotDownByCraftId;
55 size_t _trajectoryPoint;
56 bool _detected, _hyperDetected, _processedIntercept;
57 int _shootingAt, _hitFrame, _fireCountdown, _escapeCountdown;
59 void calculateSpeed();
71 YAML::Node
save(
bool newBattle)
const;
109 void setStatus(
enum UfoStatus status) {_status = status; }
void setTrajectoryPoint(size_t np)
Sets the UFO's progress on the trajectory track.
Definition: Ufo.h:139
int getVisibility() const
Gets the UFO's visibility.
Definition: Ufo.cpp:616
void setHyperDetected(bool hyperdetected)
Sets the UFO's hyper detection status.
Definition: Ufo.cpp:686
int getHitFrame() const
Gets the UFO's hit frame.
Definition: Ufo.cpp:769
bool isInBattlescape() const
Gets if the UFO is in battlescape.
Definition: Ufo.cpp:575
bool isDestroyed() const
Gets if the UFO has been destroyed.
Definition: Ufo.cpp:453
Represents an ongoing alien mission.
Definition: AlienMission.h:46
void setId(int id)
Sets the UFO's ID.
Definition: Ufo.cpp:270
Ufo(const RuleUfo *rules)
Creates a UFO of the specified type.
Definition: Ufo.cpp:49
void setDetected(bool detected)
Sets the UFO's detection status.
Definition: Ufo.cpp:360
~Ufo()
Cleans up the UFO.
Definition: Ufo.cpp:62
void setHitFrame(int frame)
Sets the UFO's hit frame.
Definition: Ufo.cpp:760
int getShootingAt() const
Get which interceptor this ufo is engaging.
Definition: Ufo.cpp:706
int getLandId() const
Gets the UFO's landing site ID.
Definition: Ufo.cpp:724
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:99
bool isCrashed() const
Gets if the UFO has crashed.
Definition: Ufo.cpp:443
std::wstring getDefaultName(Language *lang) const
Gets the UFO's default name.
Definition: Ufo.cpp:280
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
void changeRules(const RuleUfo *rules)
Sets the UFO's ruleset.
Definition: Ufo.cpp:251
enum UfoStatus getStatus() const
Gets the UFO status.
Definition: Ufo.h:107
int getEscapeCountdown() const
Gets the escape timer for dogfights.
Definition: Ufo.cpp:787
std::string getDirection() const
Gets the UFO's direction.
Definition: Ufo.cpp:391
void setStatus(enum UfoStatus status)
Set the UFO's status.
Definition: Ufo.h:109
bool getDetected() const
Gets the UFO's detection status.
Definition: Ufo.cpp:351
virtual void load(const YAML::Node &node)
Loads the moving target from YAML.
Definition: MovingTarget.cpp:56
const UfoTrajectory & getTrajectory() const
Gets the UFO's trajectory.
Definition: Ufo.h:141
AlienMission * getMission() const
Gets the UFO's mission object.
Definition: Ufo.h:143
bool getHyperDetected() const
Gets the UFO's hyper detection status.
Definition: Ufo.cpp:677
bool getInterceptionProcessed() const
Gets if the ufo has had its timers decremented on this cycle of interception updates.
Definition: Ufo.cpp:825
std::string getAltitude() const
Gets the UFO's altitude.
Definition: Ufo.cpp:400
void setAltitude(const std::string &altitude)
Sets the UFO's altitude.
Definition: Ufo.cpp:425
void setMissionInfo(AlienMission *mission, const UfoTrajectory *trajectory)
Sets the UFO's mission information.
Definition: Ufo.cpp:664
Contains strings used throughout the game for localization.
Definition: Language.h:39
CraftId getShotDownByCraftId() const
Gets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:605
void setFireCountdown(int time)
Sets the number of ticks until the ufo fires its weapon.
Definition: Ufo.cpp:796
void setDamage(int damage)
Sets the UFO's amount of damage.
Definition: Ufo.cpp:330
void setShootingAt(int target)
Set which interceptor this ufo is engaging.
Definition: Ufo.cpp:715
Holds information about a specific trajectory.
Definition: UfoTrajectory.h:47
size_t getTrajectoryPoint() const
Gets the UFO's progress on the trajectory track.
Definition: Ufo.h:137
size_t getSecondsRemaining() const
Gets the UFO's seconds left on the ground.
Definition: Ufo.cpp:371
const std::string & getMissionType() const
Gets the UFO's Mission type.
Definition: Ufo.cpp:651
void setInterceptionProcessed(bool processed)
Sets a flag denoting that this ufo has had its timers decremented.
Definition: Ufo.cpp:816
YAML::Node saveId() const
Saves the UFO's ID to YAML.
Definition: Ufo.cpp:229
void setInBattlescape(bool inbattle)
Sets the UFO's battlescape status.
Definition: Ufo.cpp:584
int getFireCountdown() const
Gets the number of ticks until the ufo is ready to fire.
Definition: Ufo.cpp:805
Represents an alien UFO on the map.
Definition: Ufo.h:40
int getCrashId() const
Gets the UFO's crash site ID.
Definition: Ufo.cpp:742
int getAltitudeInt() const
Gets the UFO's altitude.
Definition: Ufo.cpp:409
void setShotDownByCraftId(const CraftId &craftId)
Sets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:600
Base class for moving targets on the globe with a certain speed and destination.
Definition: MovingTarget.h:29
void load(const YAML::Node &node, const Mod &ruleset, SavedGame &game)
Loads the UFO from YAML.
Definition: Ufo.cpp:112
void setSecondsRemaining(size_t seconds)
Sets the UFO's seconds left on the ground.
Definition: Ufo.cpp:382
void setDestination(Target *dest)
Sets the UFO's destination.
Definition: Ufo.cpp:695
void think()
Handles UFO logic.
Definition: Ufo.cpp:542
int getMarker() const
Gets the UFO's marker.
Definition: Ufo.cpp:300
Represents a specific type of UFO.
Definition: RuleUfo.h:35
int getDamage() const
Gets the UFO's amount of damage.
Definition: Ufo.cpp:321
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:33
void setLandId(int id)
Sets the UFO's landing site ID.
Definition: Ufo.cpp:733
void setCrashId(int id)
Sets the UFO's crash site ID.
Definition: Ufo.cpp:751
const std::string & getAlienRace() const
Gets the UFO's alien race.
Definition: Ufo.cpp:595
const RuleUfo * getRules() const
Gets the UFO's ruleset.
Definition: Ufo.cpp:241
Definition: BaseInfoState.cpp:40
void setEscapeCountdown(int time)
Sets the countdown timer for escaping a dogfight.
Definition: Ufo.cpp:778
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:261