Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
SpecialPowerModule Class Reference

#include <SpecialPowerModule.h>

Inherits BehaviorModule, and SpecialPowerModuleInterface.

Inherited by BaikonurLaunchPower, CashBountyPower, CashHackSpecialPower, CleanupAreaPower, DefectorSpecialPower, FireWeaponPower, OCLSpecialPower, SpecialAbility, and SpyVisionSpecialPower.

Public Member Functions

 SpecialPowerModule (Thing *thing, const ModuleData *moduleData)
 
virtual SpecialPowerModuleInterfacegetSpecialPower ()
 
Bool isModuleForPower (const SpecialPowerTemplate *specialPowerTemplate) const
 is this module for the specified special power
 
Bool isReady (void) const
 is this special power available now
 
Real getPercentReady (void) const
 get the percent ready (1.0 = ready now, 0.5 = half charged up etc.)
 
UnsignedInt getReadyFrame (void) const
 get the frame at which we are ready
 
AsciiString getPowerName (void) const
 
void syncReadyFrameToStatusQuo (void)
 
const SpecialPowerTemplategetSpecialPowerTemplate (void) const
 
ScienceType getRequiredScience (void) const
 
void onSpecialPowerCreation (void)
 
void setReadyFrame (UnsignedInt frame)
 
UnsignedInt getReadyFrame (void)
 
void pauseCountdown (Bool pause)
 
virtual void doSpecialPower (UnsignedInt commandOptions)
 
virtual void doSpecialPowerAtObject (Object *obj, UnsignedInt commandOptions)
 
virtual void doSpecialPowerAtLocation (const Coord3D *loc, Real angle, UnsignedInt commandOptions)
 
virtual void doSpecialPowerUsingWaypoints (const Waypoint *way, UnsignedInt commandOptions)
 
virtual void markSpecialPowerTriggered (const Coord3D *location)
 
virtual void startPowerRecharge ()
 
virtual const AudioEventRTSgetInitiateSound () const
 
virtual Bool isScriptOnly () const
 
virtual const ThingTemplategetReferenceThingTemplate () const
 
- Public Member Functions inherited from BehaviorModule
 BehaviorModule (Thing *thing, const ModuleData *moduleData)
 
virtual BodyModuleInterfacegetBody ()
 
virtual CollideModuleInterfacegetCollide ()
 
virtual ContainModuleInterfacegetContain ()
 
virtual CreateModuleInterfacegetCreate ()
 
virtual DamageModuleInterfacegetDamage ()
 
virtual DestroyModuleInterfacegetDestroy ()
 
virtual DieModuleInterfacegetDie ()
 
virtual UpdateModuleInterfacegetUpdate ()
 
virtual UpgradeModuleInterfacegetUpgrade ()
 
virtual StealthUpdategetStealth ()
 
virtual SpyVisionUpdategetSpyVisionUpdate ()
 
virtual ParkingPlaceBehaviorInterfacegetParkingPlaceBehaviorInterface ()
 
virtual RebuildHoleBehaviorInterfacegetRebuildHoleBehaviorInterface ()
 
virtual BridgeBehaviorInterfacegetBridgeBehaviorInterface ()
 
virtual BridgeTowerBehaviorInterfacegetBridgeTowerBehaviorInterface ()
 
virtual BridgeScaffoldBehaviorInterfacegetBridgeScaffoldBehaviorInterface ()
 
virtual OverchargeBehaviorInterfacegetOverchargeBehaviorInterface ()
 
virtual TransportPassengerInterfacegetTransportPassengerInterface ()
 
virtual CaveInterfacegetCaveInterface ()
 
virtual LandMineInterfacegetLandMineInterface ()
 
virtual DieModuleInterfacegetEjectPilotDieInterface ()
 
virtual ProjectileUpdateInterfacegetProjectileUpdateInterface ()
 
virtual AIUpdateInterfacegetAIUpdateInterface ()
 
virtual ExitInterfacegetUpdateExitInterface ()
 
virtual DockUpdateInterfacegetDockUpdateInterface ()
 
virtual RailedTransportDockUpdateInterfacegetRailedTransportDockUpdateInterface (void)
 
virtual SlowDeathBehaviorInterfacegetSlowDeathBehaviorInterface ()
 
virtual SpecialPowerUpdateInterfacegetSpecialPowerUpdateInterface ()
 
virtual SlavedUpdateInterfacegetSlavedUpdateInterface ()
 
virtual ProductionUpdateInterfacegetProductionUpdateInterface ()
 
virtual HordeUpdateInterfacegetHordeUpdateInterface ()
 
virtual PowerPlantUpdateInterfacegetPowerPlantUpdateInterface ()
 
virtual SpawnBehaviorInterfacegetSpawnBehaviorInterface ()
 
virtual CountermeasuresBehaviorInterfacegetCountermeasuresBehaviorInterface ()
 
virtual const CountermeasuresBehaviorInterfacegetCountermeasuresBehaviorInterface () const
 
- Public Member Functions inherited from ObjectModule
 ObjectModule (Thing *thing, const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual void onCapture (Player *oldOwner, Player *newOwner)
 
virtual void onDisabledEdge (Bool nowDisabled)
 
- Public Member Functions inherited from Module
 Module (const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual NameKeyType getModuleNameKey () const =0
 
NameKeyType getModuleTagNameKey () const
 
virtual void onObjectCreated ()
 
virtual void onDrawableBoundToObject ()
 
virtual void preloadAssets (TimeOfDay timeOfDay)
 preload any assets we might have for this time of day
 
virtual void onDelete (void)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static Int getInterfaceMask ()
 
- Static Public Member Functions inherited from BehaviorModule
static Int getInterfaceMask ()
 
static ModuleType getModuleType ()
 
- Static Public Member Functions inherited from Module
static ModuleDatafriend_newModuleData (INI *ini)
 

Protected Member Functions

Bool initiateIntentToDoSpecialPower (const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions)
 
void triggerSpecialPower (const Coord3D *location)
 
void createViewObject (const Coord3D *location)
 
void resolveSpecialPower (void)
 
void aboutToDoSpecialPower (const Coord3D *location)
 
- Protected Member Functions inherited from BehaviorModule
virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Protected Member Functions inherited from ObjectModule
ObjectgetObject ()
 
const ObjectgetObject () const
 
- Protected Member Functions inherited from Module
const ModuleDatagetModuleData () const
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Protected Attributes

UnsignedInt m_availableOnFrame
 on this frame, this special power is available
 
Int m_pausedCount
 Reference count of sources pausing me.
 
UnsignedInt m_pausedOnFrame
 
Real m_pausedPercent
 

Detailed Description

Definition at line 97 of file SpecialPowerModule.h.

Constructor & Destructor Documentation

◆ SpecialPowerModule()

SpecialPowerModule::SpecialPowerModule ( Thing * thing,
const ModuleData * moduleData )

Definition at line 100 of file SpecialPowerModule.cpp.

Member Function Documentation

◆ aboutToDoSpecialPower()

void SpecialPowerModule::aboutToDoSpecialPower ( const Coord3D * location)
protected

Definition at line 534 of file SpecialPowerModule.cpp.

◆ createViewObject()

void SpecialPowerModule::createViewObject ( const Coord3D * location)
protected

Definition at line 486 of file SpecialPowerModule.cpp.

◆ doSpecialPower()

void SpecialPowerModule::doSpecialPower ( UnsignedInt commandOptions)
virtual

◆ doSpecialPowerAtLocation()

void SpecialPowerModule::doSpecialPowerAtLocation ( const Coord3D * loc,
Real angle,
UnsignedInt commandOptions )
virtual

◆ doSpecialPowerAtObject()

void SpecialPowerModule::doSpecialPowerAtObject ( Object * obj,
UnsignedInt commandOptions )
virtual

◆ doSpecialPowerUsingWaypoints()

void SpecialPowerModule::doSpecialPowerUsingWaypoints ( const Waypoint * way,
UnsignedInt commandOptions )
virtual

Implements SpecialPowerModuleInterface.

Definition at line 730 of file SpecialPowerModule.cpp.

◆ getInitiateSound()

const AudioEventRTS & SpecialPowerModule::getInitiateSound ( ) const
virtual

Implements SpecialPowerModuleInterface.

Definition at line 149 of file SpecialPowerModule.cpp.

◆ getInterfaceMask()

static Int SpecialPowerModule::getInterfaceMask ( )
inlinestatic

Definition at line 108 of file SpecialPowerModule.h.

◆ getPercentReady()

Real SpecialPowerModule::getPercentReady ( void ) const
virtual

get the percent ready (1.0 = ready now, 0.5 = half charged up etc.)

Get the percentage ready a special power is to use 1.0f = ready now 0.5f = 50% ready 0.2f = 20% ready etc ...

Implements SpecialPowerModuleInterface.

Definition at line 321 of file SpecialPowerModule.cpp.

◆ getPowerName()

AsciiString SpecialPowerModule::getPowerName ( void ) const
virtual

Implements SpecialPowerModuleInterface.

Definition at line 257 of file SpecialPowerModule.cpp.

◆ getReadyFrame() [1/2]

UnsignedInt SpecialPowerModule::getReadyFrame ( void )
inline

Definition at line 133 of file SpecialPowerModule.h.

◆ getReadyFrame() [2/2]

UnsignedInt SpecialPowerModule::getReadyFrame ( void ) const
virtual

get the frame at which we are ready

Implements SpecialPowerModuleInterface.

Definition at line 780 of file SpecialPowerModule.cpp.

◆ getReferenceThingTemplate()

virtual const ThingTemplate * SpecialPowerModule::getReferenceThingTemplate ( ) const
inlinevirtual

Implements SpecialPowerModuleInterface.

Reimplemented in OCLSpecialPower.

Definition at line 166 of file SpecialPowerModule.h.

◆ getRequiredScience()

ScienceType SpecialPowerModule::getRequiredScience ( void ) const
virtual

Implements SpecialPowerModuleInterface.

Definition at line 241 of file SpecialPowerModule.cpp.

◆ getSpecialPower()

virtual SpecialPowerModuleInterface * SpecialPowerModule::getSpecialPower ( )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 111 of file SpecialPowerModule.h.

◆ getSpecialPowerTemplate()

const SpecialPowerTemplate * SpecialPowerModule::getSpecialPowerTemplate ( void ) const
virtual

Implements SpecialPowerModuleInterface.

Definition at line 249 of file SpecialPowerModule.cpp.

◆ initiateIntentToDoSpecialPower()

Bool SpecialPowerModule::initiateIntentToDoSpecialPower ( const Object * targetObj,
const Coord3D * targetPos,
const Waypoint * way,
UnsignedInt commandOptions )
protected

Definition at line 430 of file SpecialPowerModule.cpp.

◆ isModuleForPower()

Bool SpecialPowerModule::isModuleForPower ( const SpecialPowerTemplate * specialPowerTemplate) const
virtual

is this module for the specified special power

Is this module designed for the power identier template passed in?

Implements SpecialPowerModuleInterface.

Definition at line 266 of file SpecialPowerModule.cpp.

◆ isReady()

Bool SpecialPowerModule::isReady ( void ) const
virtual

is this special power available now

Is this special power ready to use

Implements SpecialPowerModuleInterface.

Definition at line 289 of file SpecialPowerModule.cpp.

◆ isScriptOnly()

Bool SpecialPowerModule::isScriptOnly ( ) const
virtual

Implements SpecialPowerModuleInterface.

Definition at line 378 of file SpecialPowerModule.cpp.

◆ markSpecialPowerTriggered()

void SpecialPowerModule::markSpecialPowerTriggered ( const Coord3D * location)
virtual

Now, there are special powers that require some preliminary processing before the actual special power triggers. When the ini setting "UpdateModuleStartsAttack" is true, then the update module will call the doSpecialPower a second time. This function then resets the power recharge, and tells the scriptengine that the attack has started.

A good example of something that uses this is the Black Lotus - capture building hack attack. When the user initiates the attack, the doSpecialPower is called, which triggers the update module. The update module then orders the unit to move within range, and it isn't until the hacker start the physical attack, that the timer is reset and the attack technically begins.

Implements SpecialPowerModuleInterface.

Definition at line 526 of file SpecialPowerModule.cpp.

◆ onSpecialPowerCreation()

void SpecialPowerModule::onSpecialPowerCreation ( void )
virtual

Implements SpecialPowerModuleInterface.

Definition at line 202 of file SpecialPowerModule.cpp.

◆ pauseCountdown()

void SpecialPowerModule::pauseCountdown ( Bool pause)
virtual

Implements SpecialPowerModuleInterface.

Definition at line 752 of file SpecialPowerModule.cpp.

◆ resolveSpecialPower()

void SpecialPowerModule::resolveSpecialPower ( void )
protected

Definition at line 180 of file SpecialPowerModule.cpp.

◆ setReadyFrame()

void SpecialPowerModule::setReadyFrame ( UnsignedInt frame)
virtual

Implements SpecialPowerModuleInterface.

Definition at line 169 of file SpecialPowerModule.cpp.

◆ startPowerRecharge()

void SpecialPowerModule::startPowerRecharge ( )
virtual

start the recharge process for this special power. public because some powers call it repeatedly.

A special power has been used ... start the recharge process by computing the frame we will become fully available on in the future again

Implements SpecialPowerModuleInterface.

Definition at line 389 of file SpecialPowerModule.cpp.

◆ syncReadyFrameToStatusQuo()

void SpecialPowerModule::syncReadyFrameToStatusQuo ( void )

◆ triggerSpecialPower()

void SpecialPowerModule::triggerSpecialPower ( const Coord3D * location)
protected

Definition at line 474 of file SpecialPowerModule.cpp.

Member Data Documentation

◆ m_availableOnFrame

UnsignedInt SpecialPowerModule::m_availableOnFrame
protected

on this frame, this special power is available

Definition at line 176 of file SpecialPowerModule.h.

◆ m_pausedCount

Int SpecialPowerModule::m_pausedCount
protected

Reference count of sources pausing me.

Definition at line 177 of file SpecialPowerModule.h.

◆ m_pausedOnFrame

UnsignedInt SpecialPowerModule::m_pausedOnFrame
protected

Definition at line 178 of file SpecialPowerModule.h.

◆ m_pausedPercent

Real SpecialPowerModule::m_pausedPercent
protected

Definition at line 179 of file SpecialPowerModule.h.


The documentation for this class was generated from the following files: