Skip to content

Commit 6cb9601

Browse files
authored
Merge pull request #47 from Andreas-W/kodiak_genpower
Kodiak genpower ability
2 parents 5638448 + f610a0f commit 6cb9601

File tree

11 files changed

+1545
-2
lines changed

11 files changed

+1545
-2
lines changed

Core/GameEngine/Source/Common/System/GameMemoryInitPools_GeneralsMD.inl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ static PoolSizeRec PoolSizes[] =
186186
{ "ParticleUplinkCannonUpdate", 16, 16 },
187187
{ "SpectreGunshipUpdate", 8, 8 },
188188
{ "SpectreGunshipDeploymentUpdate", 8, 8 },
189+
{ "KodiakUpdate", 8, 8 },
190+
{ "KodiakDeploymentUpdate", 8, 8 },
189191
{ "BaikonurLaunchPower", 4, 4 },
190192
{ "RadiusDecalUpdate", 16, 16 },
191193
{ "RadiusDecalBehavior", 32, 32 },

GeneralsMD/Code/GameEngine/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ set(GAMEENGINE_SRC
491491
Include/GameLogic/Module/WeaponBonusUpgrade.h
492492
Include/GameLogic/Module/WeaponSetUpgrade.h
493493
Include/GameLogic/Module/WorkerAIUpdate.h
494+
Include/GameLogic/Module/KodiakDeploymentUpdate.h
495+
Include/GameLogic/Module/KodiakUpdate.h
494496
Include/GameLogic/Object.h
495497
Include/GameLogic/ObjectCreationList.h
496498
Include/GameLogic/ObjectIter.h
@@ -1082,6 +1084,8 @@ set(GAMEENGINE_SRC
10821084
Source/GameLogic/Object/Update/WaveGuideUpdate.cpp
10831085
Source/GameLogic/Object/Update/WeaponBonusUpdate.cpp
10841086
Source/GameLogic/Object/Update/ArmorDamageScalarUpdate.cpp
1087+
Source/GameLogic/Object/Update/KodiakDeploymentUpdate.cpp
1088+
Source/GameLogic/Object/Update/KodiakUpdate.cpp
10851089
Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp
10861090
Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp
10871091
Source/GameLogic/Object/Upgrade/CommandSetUpgrade.cpp

GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ContainModule.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ class ContainModuleInterface
213213
virtual short getRiderSlot(ObjectID riderID) const = 0; // get the slot occupied by the object.
214214
virtual short getPortableSlot(ObjectID portableID) const = 0; // get the slot occupied by the object.
215215
virtual const ContainedItemsList* getAddOnList() const = 0;
216+
virtual ContainedItemsList* getAddOnList() = 0;
216217
};
217218
//-------------------------------------------------------------------------------------------------
218219

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
// FILE: KodiakDeploymentUpdate.h //////////////////////////////////////////////////////////////////////////
2+
// Desc: Update module to handle deployment of the Kodiak Generals special power.from command center
3+
///////////////////////////////////////////////////////////////////////////////////////////////////
4+
5+
#pragma once
6+
7+
#ifndef __KODIAK_DEPLOYMENT_UPDATE_H_
8+
#define __KODIAK_DEPLOYMENT_UPDATE_H_
9+
10+
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
11+
#include "Common/KindOf.h"
12+
#include "GameLogic/Module/SpecialPowerUpdateModule.h"
13+
#include "SpecialPowerModule.h"
14+
#include <GameClient/RadiusDecal.h>
15+
#include "SpectreGunshipDeploymentUpdate.h"
16+
17+
// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
18+
class SpecialPowerModule;
19+
class ParticleSystem;
20+
class FXList;
21+
class AudioEventRTS;
22+
enum ParticleSystemID CPP_11(: Int);
23+
enum ScienceType CPP_11(: Int);
24+
25+
//#define MAX_OUTER_NODES 16
26+
27+
//#define PUCK
28+
29+
30+
//enum GunshipCreateLocType CPP_11(: Int)
31+
//{
32+
// CREATE_GUNSHIP_AT_EDGE_NEAR_SOURCE,
33+
// CREATE_GUNSHIP_AT_EDGE_FARTHEST_FROM_SOURCE,
34+
// CREATE_GUNSHIP_AT_EDGE_NEAR_TARGET,
35+
// CREATE_GUNSHIP_AT_EDGE_FARTHEST_FROM_TARGET,
36+
//};
37+
38+
39+
40+
//-------------------------------------------------------------------------------------------------
41+
//-------------------------------------------------------------------------------------------------
42+
class KodiakDeploymentUpdateModuleData : public ModuleData
43+
{
44+
public:
45+
SpecialPowerTemplate *m_specialPowerTemplate;
46+
ScienceType m_extraRequiredScience; ///< science required (if any) to actually execute this power
47+
WeaponTemplate *m_howitzerWeaponTemplate;
48+
AsciiString m_gunshipTemplateName;
49+
AsciiString m_gattlingTemplateName;
50+
// AsciiString m_howitzerTemplateName;
51+
RadiusDecalTemplate m_attackAreaDecalTemplate;
52+
RadiusDecalTemplate m_targetingReticleDecalTemplate;
53+
UnsignedInt m_orbitFrames;
54+
Real m_attackAreaRadius;
55+
Real m_targetingReticleRadius;
56+
Real m_gunshipOrbitRadius;
57+
GunshipCreateLocType m_createLoc;
58+
59+
60+
const ParticleSystemTemplate * m_gattlingStrafeFXParticleSystem;
61+
62+
KodiakDeploymentUpdateModuleData();
63+
static void buildFieldParse(MultiIniFieldParse& p);
64+
65+
private:
66+
67+
};
68+
69+
//enum GunshipDeployStatus CPP_11(: Int)
70+
//{
71+
// GUNSHIPDEPLOY_STATUS_INSERTING,
72+
// GUNSHIPDEPLOY_STATUS_ORBITING,
73+
// GUNSHIPDEPLOY_STATUS_DEPARTING,
74+
// GUNSHIPDEPLOY_STATUS_IDLE,
75+
//};
76+
77+
78+
//-------------------------------------------------------------------------------------------------
79+
/** The default update module */
80+
//-------------------------------------------------------------------------------------------------
81+
class KodiakDeploymentUpdate : public SpecialPowerUpdateModule
82+
{
83+
84+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( KodiakDeploymentUpdate, "KodiakDeploymentUpdate" )
85+
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( KodiakDeploymentUpdate, KodiakDeploymentUpdateModuleData );
86+
87+
public:
88+
89+
KodiakDeploymentUpdate( Thing *thing, const ModuleData* moduleData );
90+
// virtual destructor prototype provided by memory pool declaration
91+
92+
// SpecialPowerUpdateInterface
93+
virtual Bool initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions );
94+
virtual Bool isSpecialAbility() const { return false; }
95+
virtual Bool isSpecialPower() const { return true; }
96+
virtual Bool isActive() const {return FALSE;}
97+
virtual SpecialPowerUpdateInterface* getSpecialPowerUpdateInterface() { return this; }
98+
virtual CommandOption getCommandOption() const { return (CommandOption)0; }
99+
virtual Bool isPowerCurrentlyInUse( const CommandButton *command = NULL ) const { return FALSE; };
100+
virtual ScienceType getExtraRequiredScience() const { return getKodiakDeploymentUpdateModuleData()->m_extraRequiredScience; } //Does this object have more than one special power module with the same spTemplate?
101+
102+
virtual void onObjectCreated();
103+
virtual UpdateSleepTime update();
104+
105+
void cleanUp();
106+
107+
108+
109+
virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const { return FALSE; };
110+
virtual Bool doesSpecialPowerHaveOverridableDestination() const { return FALSE; } //Does it have it, even if it's not active?
111+
virtual void setSpecialPowerOverridableDestination( const Coord3D *loc ) {};
112+
113+
// Disabled conditions to process (termination conditions!)
114+
virtual DisabledMaskType getDisabledTypesToProcess() const { return MAKE_DISABLED_MASK4( DISABLED_SUBDUED, DISABLED_UNDERPOWERED, DISABLED_EMP, DISABLED_HACKED ); }
115+
116+
protected:
117+
118+
119+
120+
SpecialPowerModuleInterface* m_specialPowerModule;
121+
Coord3D m_initialTargetPosition;
122+
ObjectID m_gunshipID;
123+
124+
125+
};
126+
127+
128+
#endif // __SPECTRE_GUNSHIP_DEPLOYMENT_UPDATE_H_
129+
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
// FILE: KodiakUpdate.h //////////////////////////////////////////////////////////////////////////
2+
// Desc: Update module to handle weapon firing of the Kodiak Generals special power.
3+
///////////////////////////////////////////////////////////////////////////////////////////////////
4+
5+
#pragma once
6+
7+
#ifndef __KODIAK_UPDATE_H_
8+
#define __KODIAK_UPDATE_H_
9+
10+
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
11+
#include "Common/KindOf.h"
12+
#include "GameLogic/Module/SpecialPowerUpdateModule.h"
13+
#include "SpecialPowerModule.h"
14+
#include <GameClient/RadiusDecal.h>
15+
#include "UpdateModule.h"
16+
#include "SpectreGunshipUpdate.h"
17+
18+
// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
19+
class SpecialPowerModule;
20+
class ParticleSystem;
21+
class FXList;
22+
class AudioEventRTS;
23+
enum ParticleSystemID CPP_11(: Int);
24+
25+
//#define MAX_OUTER_NODES 16
26+
//#define TRACKERS
27+
28+
//#define PUCK
29+
30+
//-------------------------------------------------------------------------------------------------
31+
//-------------------------------------------------------------------------------------------------
32+
class KodiakUpdateModuleData : public ModuleData
33+
{
34+
public:
35+
SpecialPowerTemplate *m_specialPowerTemplate;
36+
37+
RadiusDecalTemplate m_attackAreaDecalTemplate;
38+
RadiusDecalTemplate m_targetingReticleDecalTemplate;
39+
UnsignedInt m_orbitFrames;
40+
UnsignedInt m_mainTargetingRate;
41+
UnsignedInt m_sideTargetingRate;
42+
UnsignedInt m_aaTargetingRate;
43+
UnsignedInt m_turretRecenterFramesBeforeExit;
44+
UnsignedInt m_initialAttackDelayFrames;
45+
46+
Real m_attackAreaRadius;
47+
Real m_sideAttackAreaRadius;
48+
Real m_aaAttackAreaRadius;
49+
Real m_targetingReticleRadius;
50+
Real m_gunshipOrbitRadius;
51+
Real m_missileLockRadius;
52+
UnsignedInt m_numMainTurrets;
53+
UnsignedInt m_numSideTurrets;
54+
UnsignedInt m_numAATurrets;
55+
56+
Real m_missileScatterRadius;
57+
std::vector<Coord2D> m_scatterTargets; ///< targets for missile attack, amount of targets should match clip size of primary weapon
58+
59+
//const ParticleSystemTemplate * m_gattlingStrafeFXParticleSystem;
60+
61+
KodiakUpdateModuleData();
62+
static void buildFieldParse(MultiIniFieldParse& p);
63+
64+
65+
static void parseScatterTarget(INI* ini, void* instance, void* /*store*/, const void* /*userData*/);
66+
private:
67+
68+
};
69+
70+
//-------------------------------------------------------------------------------------------------
71+
/** The default update module */
72+
//-------------------------------------------------------------------------------------------------
73+
class KodiakUpdate : public SpecialPowerUpdateModule
74+
{
75+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( KodiakUpdate, "KodiakUpdate" )
76+
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( KodiakUpdate, KodiakUpdateModuleData );
77+
78+
public:
79+
80+
KodiakUpdate( Thing *thing, const ModuleData* moduleData );
81+
// virtual destructor prototype provided by memory pool declaration
82+
83+
// SpecialPowerUpdateInterface
84+
virtual Bool initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions );
85+
virtual Bool isSpecialAbility() const { return false; }
86+
virtual Bool isSpecialPower() const { return true; }
87+
virtual Bool isActive() const {return m_status < GUNSHIP_STATUS_DEPARTING;}
88+
virtual SpecialPowerUpdateInterface* getSpecialPowerUpdateInterface() { return this; }
89+
virtual CommandOption getCommandOption() const { return (CommandOption)0; }
90+
virtual Bool isPowerCurrentlyInUse( const CommandButton *command = NULL ) const;
91+
92+
virtual void onObjectCreated();
93+
virtual UpdateSleepTime update();
94+
95+
void cleanUp();
96+
97+
98+
99+
virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const;
100+
virtual Bool doesSpecialPowerHaveOverridableDestination() const { return true; } //Does it have it, even if it's not active?
101+
virtual void setSpecialPowerOverridableDestination( const Coord3D *loc );
102+
103+
// Disabled conditions to process (termination conditions!)
104+
virtual DisabledMaskType getDisabledTypesToProcess() const { return MAKE_DISABLED_MASK4( DISABLED_SUBDUED, DISABLED_UNDERPOWERED, DISABLED_EMP, DISABLED_HACKED ); }
105+
static void parseScatterTarget(INI* ini, void* instance, void* /*store*/, const void* /*userData*/);
106+
protected:
107+
108+
void setLogicalStatus( GunshipStatus newStatus ) { m_status = newStatus; }
109+
void disengageAndDepartAO( Object *gunship );
110+
111+
Bool isPointOffMap( const Coord3D& testPos ) const;
112+
Bool isFairDistanceFromShip( Object *target );
113+
114+
SpecialPowerModuleInterface* m_specialPowerModule;
115+
116+
void friend_enableAfterburners(Bool v);
117+
118+
119+
120+
121+
Coord3D m_initialTargetPosition;
122+
Coord3D m_overrideTargetDestination;
123+
Coord3D m_movementPosition;
124+
Coord3D m_positionToShootAt;
125+
126+
127+
GunshipStatus m_status;
128+
129+
UnsignedInt m_orbitEscapeFrame;
130+
131+
RadiusDecal m_attackAreaDecal;
132+
RadiusDecal m_targetingReticleDecal;
133+
134+
#if defined TRACKERS
135+
RadiusDecal m_howitzerTrackerDecal;
136+
#endif
137+
138+
AudioEventRTS m_afterburnerSound;
139+
140+
};
141+
142+
143+
#endif // __KODIAK_UPDATE_H_
144+

GeneralsMD/Code/GameEngine/Include/GameLogic/Module/MultiAddOnContain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class MultiAddOnContain : public TransportContain
132132
virtual short getRiderSlot(ObjectID riderID) const;
133133
virtual short getPortableSlot(ObjectID riderID) const;
134134
virtual const ContainedItemsList* getAddOnList() const { return &m_addOnList; }
135+
virtual ContainedItemsList* getAddOnList() { return &m_addOnList; }
135136

136137
private:
137138
void parseAddOnEntry(INI* ini, void* instance, void* store, const void* /*userData*/);

GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OpenContain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ class OpenContain : public UpdateModule,
258258
virtual short getRiderSlot(ObjectID riderID) const { return -1; }
259259
virtual short getPortableSlot(ObjectID portableID) const { return -1; }
260260
virtual const ContainedItemsList* getAddOnList() const { return NULL; }
261+
virtual ContainedItemsList* getAddOnList() { return NULL; }
261262

262263
void pruneDeadWanters();
263264

GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@
145145
#include "GameLogic/Module/ParticleUplinkCannonUpdate.h"
146146
#include "GameLogic/Module/SpectreGunshipUpdate.h"
147147
#include "GameLogic/Module/SpectreGunshipDeploymentUpdate.h"
148+
#include "GameLogic/Module/KodiakUpdate.h"
149+
#include "GameLogic/Module/KodiakDeploymentUpdate.h"
148150
#include "GameLogic/Module/BaikonurLaunchPower.h"
149151
#include "GameLogic/Module/BattlePlanUpdate.h"
150152
#include "GameLogic/Module/LifetimeUpdate.h"
@@ -450,6 +452,8 @@ void ModuleFactory::init( void )
450452
addModule( ParticleUplinkCannonUpdate );
451453
addModule( SpectreGunshipUpdate );
452454
addModule( SpectreGunshipDeploymentUpdate );
455+
addModule( KodiakUpdate );
456+
addModule( KodiakDeploymentUpdate );
453457
addModule( BaikonurLaunchPower );
454458
addModule( BattlePlanUpdate );
455459
addModule( ProjectileStreamUpdate );

0 commit comments

Comments
 (0)