19 #ifndef OPENXCOM_DOGFIGHTSTATE_H
20 #define OPENXCOM_DOGFIGHTSTATE_H
22 #include "../Engine/State.h"
29 const int STANDOFF_DIST = 560;
34 class InteractiveSurface;
39 class CraftWeaponProjectile;
48 Timer *_animTimer, *_moveTimer, *_w1Timer, *_w2Timer, *_ufoWtimer, *_ufoEscapeTimer, *_craftDamageAnimTimer;
49 Surface *_window, *_battle, *_range1, *_range2, *_damage;
51 ImageButton *_btnStandoff, *_btnCautious, *_btnStandard, *_btnAggressive, *_btnDisengage, *_btnUfo;
54 Text *_txtAmmo1, *_txtAmmo2, *_txtDistance, *_txtStatus, *_txtInterceptionNumber;
58 int _timeout, _currentDist, _targetDist, _ufoFireInterval;
59 bool _end, _destroyUfo, _destroyCraft, _ufoBreakingOff, _weapon1Enabled, _weapon2Enabled, _minimized, _endDogfight, _animatingHit;
60 std::vector<CraftWeaponProjectile*> _projectiles;
61 static const int _ufoBlobs[8][13][13];
62 static const int _projectileBlobs[4][6][3];
64 int _ufoSize, _craftHeight, _currentCraftDamageColor, _interceptionNumber;
65 size_t _interceptionsCount;
66 int _x, _y, _minimizedIconX, _minimizedIconY;
93 void setStatus(
const std::string &status);
125 void recolor(
const int weaponNo,
const bool currentState);
Represents a craft stored in a base.
Definition: Craft.h:44
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void btnAggressiveClick(Action *action)
Handler for clicking the Aggressive Attack button.
Definition: DogfightState.cpp:1376
void move()
Moves the craft.
Definition: DogfightState.cpp:735
A game state that receives user input and reacts accordingly.
Definition: State.h:44
void setMinimized(const bool minimized)
Sets state minimized or maximized.
Definition: DogfightState.cpp:1633
Timer used to run code in fixed intervals.
Definition: Timer.h:37
DogfightState(Game *game, Globe *globe, Craft *craft, Ufo *ufo)
Creates the Dogfight state.
Definition: DogfightState.cpp:237
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
bool dogfightEnded() const
Checks if the dogfight should be ended.
Definition: DogfightState.cpp:1803
void ufoBreakOff()
Makes the UFO break off the interception... or at least tries to.
Definition: DogfightState.cpp:1451
void drawCraftDamage()
Updates craft damage.
Definition: DogfightState.cpp:612
Interactive globe view of the world.
Definition: Globe.h:44
void maximumDistance()
Sets the craft to the maximum distance required to fire a weapon.
Definition: DogfightState.cpp:1237
Text string displayed on screen.
Definition: Text.h:41
void btnCautiousClick(Action *action)
Handler for clicking the Cautious Attack button.
Definition: DogfightState.cpp:1330
void btnStandoffClick(Action *action)
Handler for clicking the Standoff button.
Definition: DogfightState.cpp:1316
void minimumDistance()
Sets the craft to the minimum distance required to fire a weapon.
Definition: DogfightState.cpp:1211
void setInterceptionsCount(const size_t count)
Sets interceptions count.
Definition: DogfightState.cpp:1681
bool isMinimized() const
Returns true if state is minimized.
Definition: DogfightState.cpp:1624
void drawProjectile(const CraftWeaponProjectile *p)
Draws projectiles.
Definition: DogfightState.cpp:1506
void previewClick(Action *action)
Handler for clicking the Preview graphic.
Definition: DogfightState.cpp:1433
void ufoFireWeapon()
Each time a UFO will try to fire it's cannons a calculation is made.
Definition: DogfightState.cpp:1189
void animate()
Animates the window.
Definition: DogfightState.cpp:664
int getInterceptionNumber() const
Gets interception number.
Definition: DogfightState.cpp:1831
void moveWindow()
Moves window to new position.
Definition: DogfightState.cpp:1774
void btnDisengageClick(Action *action)
Handler for clicking the Disengage button.
Definition: DogfightState.cpp:1399
void animateCraftDamage()
Animates craft damage.
Definition: DogfightState.cpp:595
void btnUfoClick(Action *action)
Handler for clicking the Ufo button.
Definition: DogfightState.cpp:1414
void weapon2Click(Action *action)
Toggles usage of weapon 2.
Definition: DogfightState.cpp:1572
void btnMinimizeClick(Action *action)
Handler for clicking the Minimize button.
Definition: DogfightState.cpp:1274
Shows a dogfight (interception) between a player craft and an UFO.
Definition: DogfightState.h:45
void btnMinimizedIconClick(Action *action)
Handler for clicking the minimized interception window icon.
Definition: DogfightState.cpp:1642
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
void setInterceptionNumber(const int number)
Sets interception number.
Definition: DogfightState.cpp:1672
void drawUfo()
Draws UFO.
Definition: DogfightState.cpp:1465
void weapon1Click(Action *action)
Toggles usage of weapon 1.
Definition: DogfightState.cpp:1562
Represents an alien UFO on the map.
Definition: Ufo.h:41
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
void setStatus(const std::string &status)
Changes the status text.
Definition: DogfightState.cpp:1264
void recolor(const int weaponNo, const bool currentState)
Changes colors of weapon icons, range indicators and ammo texts base on current weapon state...
Definition: DogfightState.cpp:1583
void calculateWindowPosition()
Calculates window position according to opened interception windows.
Definition: DogfightState.cpp:1692
~DogfightState()
Cleans up the Dogfight state.
Definition: DogfightState.cpp:550
void fireWeapon1()
Fires a shot from the first weapon equipped on the craft.
Definition: DogfightState.cpp:1136
void think()
Runs the timers.
Definition: DogfightState.cpp:571
void btnStandardClick(Action *action)
Handler for clicking the Standard Attack button.
Definition: DogfightState.cpp:1353
Ufo * getUfo() const
Gets pointer to the UFO in this dogfight.
Definition: DogfightState.cpp:1812
void fireWeapon2()
Fires a shot from the second weapon equipped on the craft.
Definition: DogfightState.cpp:1162
Definition: CraftWeaponProjectile.h:36