Skip to content

Commit 1eecc01

Browse files
authored
[GEN] Backport SpecialPowerUpdate changes from Zero Hour (#791)
1 parent ce5d683 commit 1eecc01

36 files changed

+199
-92
lines changed

Generals/Code/GameEngine/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ set(GAMEENGINE_SRC
391391
Include/GameLogic/Module/SpecialPowerCompletionDie.h
392392
Include/GameLogic/Module/SpecialPowerCreate.h
393393
Include/GameLogic/Module/SpecialPowerModule.h
394+
Include/GameLogic/Module/SpecialPowerUpdateModule.h
394395
Include/GameLogic/Module/SpyVisionSpecialPower.h
395396
Include/GameLogic/Module/SpyVisionUpdate.h
396397
Include/GameLogic/Module/SquishCollide.h

Generals/Code/GameEngine/Include/Common/GameType.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ enum FormationID CPP_11(: Int)
5858
FORCE_FORMATIONID_TO_LONG_SIZE = 0x7ffffff
5959
};
6060

61+
#define INVALID_ANGLE -100.0f
62+
6163
class INI;
6264

6365
//-------------------------------------------------------------------------------------------------

Generals/Code/GameEngine/Include/Common/SpecialPower.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class SpecialPowerTemplate : public Overridable
123123
UnsignedInt getViewObjectDuration( void ) const { return getFO()->m_viewObjectDuration; }
124124
Real getViewObjectRange( void ) const { return getFO()->m_viewObjectRange; }
125125
Real getRadiusCursorRadius() const { return getFO()->m_radiusCursorRadius; }
126+
Bool isShortcutPower() const { return getFO()->m_shortcutPower; }
126127

127128
private:
128129

@@ -142,6 +143,7 @@ class SpecialPowerTemplate : public Overridable
142143
Real m_radiusCursorRadius; ///< size of radius cursor, if any
143144
Bool m_publicTimer; ///< display a countdown timer for this special power for all to see
144145
Bool m_sharedNSync; ///< If true, this is a special that is shared between all of a player's command centers
146+
Bool m_shortcutPower; ///< Is this shortcut power capable of being fired by the side panel?
145147

146148
static const FieldParse m_specialPowerFieldParse[]; ///< the parse table
147149

Generals/Code/GameEngine/Include/GameLogic/AI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ class AIGroup : public MemoryPoolObject, public Snapshot
892892
void groupHackInternet( CommandSourceType cmdSource ); ///< Begin hacking the internet for free cash from the heavens.
893893
void groupDoSpecialPower( UnsignedInt specialPowerID, UnsignedInt commandOptions );
894894
void groupDoSpecialPowerAtObject( UnsignedInt specialPowerID, Object *object, UnsignedInt commandOptions );
895-
void groupDoSpecialPowerAtLocation( UnsignedInt specialPowerID, const Coord3D *location, const Object *object, UnsignedInt commandOptions );
895+
void groupDoSpecialPowerAtLocation( UnsignedInt specialPowerID, const Coord3D *location, Real angle, const Object *object, UnsignedInt commandOptions );
896896
#ifdef ALLOW_SURRENDER
897897
void groupSurrender( const Object *objWeSurrenderedTo, Bool surrender, CommandSourceType cmdSource );
898898
#endif

Generals/Code/GameEngine/Include/GameLogic/Module/BaikonurLaunchPower.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class BaikonurLaunchPower : public SpecialPowerModule
8080
BaikonurLaunchPower( Thing *thing, const ModuleData *moduleData );
8181

8282
virtual void doSpecialPower( UnsignedInt commandOptions );
83-
virtual void doSpecialPowerAtLocation( const Coord3D *loc, UnsignedInt commandOptions );
83+
virtual void doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions );
8484

8585
protected:
8686

Generals/Code/GameEngine/Include/GameLogic/Module/BattlePlanUpdate.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
3636
#include "Common/KindOf.h"
37-
#include "GameLogic/Module/UpdateModule.h"
37+
#include "GameLogic/Module/SpecialPowerUpdateModule.h"
3838

3939
// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
4040
class SpecialPowerModule;
@@ -137,12 +137,13 @@ class BattlePlanUpdate : public UpdateModule, public SpecialPowerUpdateInterface
137137
// virtual destructor prototype provided by memory pool declaration
138138

139139
// SpecialPowerUpdateInterface
140-
virtual void initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, UnsignedInt commandOptions, Int locationCount );
140+
virtual Bool initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions );
141141
virtual Bool isSpecialAbility() const { return false; }
142142
virtual Bool isSpecialPower() const { return true; }
143143
virtual Bool isActive() const {return m_status != TRANSITIONSTATUS_IDLE;}
144144
virtual SpecialPowerUpdateInterface* getSpecialPowerUpdateInterface() { return this; }
145-
virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const { return false; }
145+
virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const { return false; } //Is it active now?
146+
virtual Bool doesSpecialPowerHaveOverridableDestination() const { return false; } //Does it have it, even if it's not active?
146147
virtual void setSpecialPowerOverridableDestination( const Coord3D *loc ) {}
147148
virtual Bool isPowerCurrentlyInUse( const CommandButton *command = NULL ) const;
148149

Generals/Code/GameEngine/Include/GameLogic/Module/CashHackSpecialPower.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class CashHackSpecialPower : public SpecialPowerModule
7878
// virtual destructor provided by memory pool object
7979

8080
virtual void doSpecialPowerAtObject( Object *obj, UnsignedInt commandOptions );
81-
virtual void doSpecialPowerAtLocation( const Coord3D *loc, UnsignedInt commandOptions );
81+
virtual void doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions );
8282

8383
protected:
8484

Generals/Code/GameEngine/Include/GameLogic/Module/CleanupAreaPower.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CleanupAreaPower : public SpecialPowerModule
7373
CleanupAreaPower( Thing *thing, const ModuleData* moduleData );
7474
// virtual destructor prototype defined by MemoryPoolObject
7575

76-
virtual void doSpecialPowerAtLocation( const Coord3D *loc, UnsignedInt commandOptions );
76+
virtual void doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions );
7777
};
7878

7979
#endif

Generals/Code/GameEngine/Include/GameLogic/Module/DefectorSpecialPower.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class DefectorSpecialPower : public SpecialPowerModule
7676
// virtual destructor prototype provided by memory pool object
7777

7878
virtual void doSpecialPowerAtObject( Object *obj, UnsignedInt commandOptions );
79-
virtual void doSpecialPowerAtLocation( const Coord3D *loc, UnsignedInt commandOptions );
79+
virtual void doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions );
8080

8181
protected:
8282

Generals/Code/GameEngine/Include/GameLogic/Module/DemoralizeSpecialPower.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class DemoralizeSpecialPower : public SpecialPowerModule
7575
// virtual destructor prototype provided by memory pool object
7676

7777
virtual void doSpecialPowerAtObject( const Object *obj, UnsignedInt commandOptions );
78-
virtual void doSpecialPowerAtLocation( const Coord3D *loc, UnsignedInt commandOptions );
78+
virtual void doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions );
7979

8080
protected:
8181

0 commit comments

Comments
 (0)