Skip to content

Commit 4fdff27

Browse files
V0.1 and part of V1.0
1 parent e878018 commit 4fdff27

21 files changed

Lines changed: 464 additions & 59 deletions

File tree

GeneralsMD/Code/GameEngine/Include/Common/Player.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class Player : public Snapshot
236236
const Money *getMoney() const { return &m_money; }
237237

238238
UnsignedInt getSupplyBoxValue();///< Many things can affect the alue of a crate, but at heart it is a GlobalData ratio.
239-
239+
AIPlayer* getAIPlayer() { return m_ai; }
240240
Energy *getEnergy() { return &m_energy; }
241241
const Energy *getEnergy() const { return &m_energy; }
242242

@@ -535,8 +535,11 @@ class Player : public Snapshot
535535
const Team *getDefaultTeam() const { DEBUG_ASSERTCRASH(m_defaultTeam!=nullptr,("default team is null")); return m_defaultTeam; }
536536

537537
void setBuildList(BuildListInfo *pBuildList); ///< sets the build list.
538+
void clearBuildList();
538539
BuildListInfo *getBuildList( void ) { return m_pBuildList; } ///< returns the build list. (build list might be modified by the solo AI)
539540
void addToBuildList(Object *obj); ///< Adds this to the build list. Used for factories placed instead of in build list.
541+
void addToBuildListAdvancedEPO(const ThingTemplate* tmpl, const Coord3D& location, Real bAngle, INT rebuildTimes, BOOLEAN exactPositionOnly);
542+
void addToBuildListAdvanced(Object* obj, INT rebuildTimes, BOOLEAN exactPositionOnly);
540543
void addToPriorityBuildList(AsciiString templateName, Coord3D *pos, Real angle); ///< Adds this to the build list. Used for factories placed instead of in build list.
541544

542545
/// get the relationship between this->that.

GeneralsMD/Code/GameEngine/Include/GameLogic/AIPlayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ class AIPlayer : public MemoryPoolObject,
209209

210210
/// Calculates the closest construction zone location based on a template.
211211
Bool calcClosestConstructionZoneLocation( const ThingTemplate *constructTemplate, Coord3D *location );
212+
virtual Bool startTraining(WorkOrder* order, Bool busyOK, AsciiString teamName); ///< find a production building that can handle the order, and start building
212213

213214
protected:
214215

@@ -226,7 +227,6 @@ class AIPlayer : public MemoryPoolObject,
226227
virtual void queueDozer(void);
227228
virtual Bool selectTeamToBuild( void ); ///< determine the next team to build
228229
virtual Bool selectTeamToReinforce( Int minPriority ); ///< determine the next team to reinforce
229-
virtual Bool startTraining( WorkOrder *order, Bool busyOK, AsciiString teamName); ///< find a production building that can handle the order, and start building
230230
virtual Bool isAGoodIdeaToBuildTeam( TeamPrototype *proto ); ///< return true if team should be built
231231
virtual void processBaseBuilding( void ); ///< do base-building behaviors
232232
virtual void processTeamBuilding( void ); ///< do team-building behaviors

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class CreateObjectDieModuleData : public DieModuleData
4444
public:
4545

4646
const ObjectCreationList* m_ocl; ///< object creaton list to make
47+
const ObjectCreationList* m_waterOcl;
4748
Bool m_transferPreviousHealth; ///< Transfers previous health before death to the new object created.
4849
Bool m_transferSelection; ///< Transfers selection state before death to the new object created.
4950

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class FXListDieModuleData : public DieModuleData
4545
{
4646
public:
4747
const FXList *m_defaultDeathFX; ///< default fx to make
48+
const FXList *m_defaultDeathWaterFX;
4849
UpgradeMuxData m_upgradeMuxData;
4950
Bool m_orientToObject;
5051
Bool m_initiallyActive;
@@ -64,6 +65,7 @@ class FXListDieModuleData : public DieModuleData
6465
{
6566
{ "StartsActive", INI::parseBool, nullptr, offsetof( FXListDieModuleData, m_initiallyActive ) },
6667
{ "DeathFX", INI::parseFXList, nullptr, offsetof( FXListDieModuleData, m_defaultDeathFX ) },
68+
{ "WaterDeathFX", INI::parseFXList, nullptr, offsetof(FXListDieModuleData, m_defaultDeathWaterFX) },
6769
{ "OrientToObject", INI::parseBool, nullptr, offsetof( FXListDieModuleData, m_orientToObject ) },
6870
{ 0, 0, 0, 0 }
6971
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class InstantDeathBehaviorModuleData : public DieModuleData
4747
public:
4848
FXListVec m_fx;
4949
OCLVec m_ocls;
50+
FXListVec m_waterFx;
51+
OCLVec m_waterOcls;
5052
WeaponTemplateVec m_weapons;
5153

5254
InstantDeathBehaviorModuleData();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ class SlowDeathBehaviorModuleData : public UpdateModuleData
8282
UnsignedInt m_destructionDelayVariance;
8383
FXListVec m_fx[SD_PHASE_COUNT];
8484
OCLVec m_ocls[SD_PHASE_COUNT];
85+
FXListVec m_waterFx[SD_PHASE_COUNT];
86+
OCLVec m_waterOcls[SD_PHASE_COUNT];
8587
WeaponTemplateVec m_weapons[SD_PHASE_COUNT];
8688
Real m_flingForce;
8789
Real m_flingForceVariance;

GeneralsMD/Code/GameEngine/Include/GameLogic/ScriptActions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,4 +387,8 @@ class ScriptActions : public ScriptActionsInterface
387387
void doNamedSetTrainHeld( const AsciiString &locoName, const Bool set );
388388
void doEnableObjectSound(const AsciiString& objectName, Bool enable);
389389

390+
void doAIClearBuildList(const AsciiString& player);
391+
void doAIAddToBuildList(const AsciiString& player, const AsciiString& object, Coord3D* coords, Real angle, BOOLEAN initbuilt, INT rebuildTimes, BOOLEAN exactPositionOnly);
392+
void doPlayerBuildUnit(const AsciiString& unitName, const AsciiString& playerName);
393+
390394
};

GeneralsMD/Code/GameEngine/Include/GameLogic/Scripts.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,10 @@ class ScriptAction : public MemoryPoolObject // This is the action class.
543543
TEAM_SET_BOOBYTRAPPED, ///< Add boobytrap to all units on team.
544544
SHOW_WEATHER, ///< show map defined weather.
545545
AI_PLAYER_BUILD_TYPE_NEAREST_TEAM, ///< Tell the ai player to build an object nearest team.
546+
AI_CLEAR_BUILDLIST,
547+
AI_ADD_TO_BUILDLIST,
548+
AI_ADD_TO_BUILDLIST_ADVANCED,
549+
AI_PLAYER_BUILDS_UNNAMED,
546550
// add new items here, please
547551
NUM_ITEMS
548552
};

GeneralsMD/Code/GameEngine/Include/GameLogic/SidesList.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ class BuildListInfo : public MemoryPoolObject, public Snapshot
287287
Bool m_unsellable;
288288
Bool m_repairable;
289289
Bool m_automaticallyBuild; ///< If true, the ai will build. If false, script has to enable this.
290+
Bool m_exactPositionOnly;
290291

291292

292293
// For WorldBuilder use only:
@@ -317,6 +318,8 @@ class BuildListInfo : public MemoryPoolObject, public Snapshot
317318
void setWhiner(Bool whiner) {m_whiner = whiner;}
318319
void setUnsellable(Bool unsellable) {m_unsellable = unsellable;}
319320
void setRepairable(Bool repairable) {m_repairable = repairable;}
321+
void setExactPositionOnly(Bool b) { m_exactPositionOnly = b; }
322+
Bool isExactPositionOnly() const { return m_exactPositionOnly; }
320323

321324
public:
322325
BuildListInfo *getNext(void) const {return m_nextBuildList;}

GeneralsMD/Code/GameEngine/Include/GameLogic/Weapon.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ class WeaponTemplate : public MemoryPoolObject
451451
const FXList* getWaterProjectileDetonateFX(VeterancyLevel v) const { return m_projectileWaterDetonateFXs[v]; }
452452
const ObjectCreationList* getFireOCL(VeterancyLevel v) const { return m_fireOCLs[v]; }
453453
const ObjectCreationList* getProjectileDetonationOCL(VeterancyLevel v) const { return m_projectileDetonationOCLs[v]; }
454+
const ObjectCreationList* getProjectileWaterDetonationOCL(VeterancyLevel v) const { return m_projectileWaterDetonationOCLs[v]; }
454455
const ParticleSystemTemplate* getProjectileExhaust(VeterancyLevel v) const { return m_projectileExhausts[v]; }
455456

456457
const AudioEventRTS& getFireSound() const { return m_fireSound; }
@@ -525,9 +526,11 @@ class WeaponTemplate : public MemoryPoolObject
525526
const ThingTemplate* m_projectileTmpl; ///< direct access to projectile object type to "fire"
526527
AsciiString m_fireOCLNames[LEVEL_COUNT]; ///< Name of OCL to create at firing
527528
AsciiString m_projectileDetonationOCLNames[LEVEL_COUNT]; ///< Name of OCL to create at firing at missile's end
529+
AsciiString m_projectileWaterDetonationOCLNames[LEVEL_COUNT]; ///< Name of OCL to create at firing at missile's end
528530
const ParticleSystemTemplate* m_projectileExhausts[LEVEL_COUNT]; ///< Templates of particle systems for projectile exhaust
529531
const ObjectCreationList* m_fireOCLs[LEVEL_COUNT]; ///< Post-loaded lookup of name string for ease and speed
530532
const ObjectCreationList* m_projectileDetonationOCLs[LEVEL_COUNT]; ///< Post-loaded lookup of name string for ease and speed (and subsystem init order)
533+
const ObjectCreationList* m_projectileWaterDetonationOCLs[LEVEL_COUNT];
531534
const FXList* m_fireFXs[LEVEL_COUNT]; ///< weapon is fired fx
532535
const FXList* m_projectileDetonateFXs[LEVEL_COUNT]; ///< if we have a projectile, fx for projectile blowing up
533536
const FXList* m_projectileWaterDetonateFXs[LEVEL_COUNT]; ///< water-specific detonation fx

0 commit comments

Comments
 (0)