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 _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;
107 void setStatus(
enum UfoStatus status) {_status = status; }
void setTrajectoryPoint(size_t np)
Sets the UFO's progress on the trajectory track.
Definition: Ufo.h:137
int getVisibility() const
Gets the UFO's visibility.
Definition: Ufo.cpp:592
void setHyperDetected(bool hyperdetected)
Sets the UFO's hyper detection status.
Definition: Ufo.cpp:662
int getHitFrame() const
Gets the UFO's hit frame.
Definition: Ufo.cpp:745
bool isInBattlescape() const
Gets if the UFO is in battlescape.
Definition: Ufo.cpp:551
bool isDestroyed() const
Gets if the UFO has been destroyed.
Definition: Ufo.cpp:429
Represents an ongoing alien mission.
Definition: AlienMission.h:46
std::string getType() const
Gets the UFO's type.
Definition: Ufo.cpp:215
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:336
~Ufo()
Cleans up the UFO.
Definition: Ufo.cpp:62
void setHitFrame(int frame)
Sets the UFO's hit frame.
Definition: Ufo.cpp:736
int getShootingAt() const
Get which interceptor this ufo is engaging.
Definition: Ufo.cpp:682
int getLandId() const
Gets the UFO's landing site ID.
Definition: Ufo.cpp:700
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:419
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:234
enum UfoStatus getStatus() const
Gets the UFO status.
Definition: Ufo.h:105
int getEscapeCountdown() const
Gets the escape timer for dogfights.
Definition: Ufo.cpp:763
std::string getDirection() const
Gets the UFO's direction.
Definition: Ufo.cpp:367
void setStatus(enum UfoStatus status)
Set the UFO's status.
Definition: Ufo.h:107
bool getDetected() const
Gets the UFO's detection status.
Definition: Ufo.cpp:327
virtual void load(const YAML::Node &node)
Loads the moving target from YAML.
Definition: MovingTarget.cpp:46
const UfoTrajectory & getTrajectory() const
Gets the UFO's trajectory.
Definition: Ufo.h:139
AlienMission * getMission() const
Gets the UFO's mission object.
Definition: Ufo.h:141
std::string getDefaultName(Language *lang) const
Gets the UFO's default name.
Definition: Ufo.cpp:244
bool getHyperDetected() const
Gets the UFO's hyper detection status.
Definition: Ufo.cpp:653
bool getInterceptionProcessed() const
Gets if the ufo has had its timers decremented on this cycle of interception updates.
Definition: Ufo.cpp:801
std::string getAltitude() const
Gets the UFO's altitude.
Definition: Ufo.cpp:376
void setAltitude(const std::string &altitude)
Sets the UFO's altitude.
Definition: Ufo.cpp:401
void setMissionInfo(AlienMission *mission, const UfoTrajectory *trajectory)
Sets the UFO's mission information.
Definition: Ufo.cpp:640
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:581
void setFireCountdown(int time)
Sets the number of ticks until the ufo fires its weapon.
Definition: Ufo.cpp:772
void setDamage(int damage)
Sets the UFO's amount of damage.
Definition: Ufo.cpp:306
void setShootingAt(int target)
Set which interceptor this ufo is engaging.
Definition: Ufo.cpp:691
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:135
size_t getSecondsRemaining() const
Gets the UFO's seconds left on the ground.
Definition: Ufo.cpp:347
const std::string & getMissionType() const
Gets the UFO's Mission type.
Definition: Ufo.cpp:627
void setInterceptionProcessed(bool processed)
Sets a flag denoting that this ufo has had its timers decremented.
Definition: Ufo.cpp:792
std::string getMarkerName() const
Gets the UFO's marker name.
Definition: Ufo.cpp:261
void setInBattlescape(bool inbattle)
Sets the UFO's battlescape status.
Definition: Ufo.cpp:560
int getFireCountdown() const
Gets the number of ticks until the ufo is ready to fire.
Definition: Ufo.cpp:781
Represents an alien UFO on the map.
Definition: Ufo.h:40
int getCrashId() const
Gets the UFO's crash site ID.
Definition: Ufo.cpp:718
int getAltitudeInt() const
Gets the UFO's altitude.
Definition: Ufo.cpp:385
void setShotDownByCraftId(const CraftId &craftId)
Sets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:576
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:99
void setSecondsRemaining(size_t seconds)
Sets the UFO's seconds left on the ground.
Definition: Ufo.cpp:358
void setDestination(Target *dest)
Sets the UFO's destination.
Definition: Ufo.cpp:671
void think()
Handles UFO logic.
Definition: Ufo.cpp:518
int getMarker() const
Gets the UFO's marker sprite.
Definition: Ufo.cpp:278
Represents a specific type of UFO.
Definition: RuleUfo.h:35
int getDamage() const
Gets the UFO's amount of damage.
Definition: Ufo.cpp:297
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
void setLandId(int id)
Sets the UFO's landing site ID.
Definition: Ufo.cpp:709
void setCrashId(int id)
Sets the UFO's crash site ID.
Definition: Ufo.cpp:727
const std::string & getAlienRace() const
Gets the UFO's alien race.
Definition: Ufo.cpp:571
const RuleUfo * getRules() const
Gets the UFO's ruleset.
Definition: Ufo.cpp:224
Definition: BaseInfoState.cpp:40
void setEscapeCountdown(int time)
Sets the countdown timer for escaping a dogfight.
Definition: Ufo.cpp:754
virtual YAML::Node save() const
Saves the moving target to YAML.
Definition: MovingTarget.cpp:59