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

#include <ActiveBody.h>

Inherits BodyModule.

Inherited by HighlanderBody, ImmortalBody, StructureBody, and UndeadBody.

Public Member Functions

 ActiveBody (Thing *thing, const ModuleData *moduleData)
 
virtual void onDelete (void)
 
virtual void attemptDamage (DamageInfo *damageInfo)
 try to damage this object
 
virtual Real estimateDamage (DamageInfoInput &damageInfo) const
 
virtual void attemptHealing (DamageInfo *damageInfo)
 try to heal this object
 
virtual Real getHealth () const
 get current health
 
virtual BodyDamageType getDamageState () const
 
virtual void setDamageState (BodyDamageType newState)
 control damage state directly. Will adjust hitpoints.
 
virtual void setAflame (Bool setting)
 This is a major change like a damage state.
 
virtual UnsignedInt getSubdualDamageHealRate () const
 
virtual Real getSubdualDamageHealAmount () const
 
virtual Bool hasAnySubdualDamage () const
 
virtual Real getCurrentSubdualDamageAmount () const
 
virtual const DamageInfogetLastDamageInfo () const
 return info on last damage dealt to this object
 
virtual UnsignedInt getLastDamageTimestamp () const
 return frame of last damage dealt
 
virtual UnsignedInt getLastHealingTimestamp () const
 return frame of last damage dealt
 
virtual ObjectID getClearableLastAttacker () const
 
virtual void clearLastAttacker ()
 
void onVeterancyLevelChanged (VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback=TRUE)
 I just achieved this level right this moment.
 
virtual void setArmorSetFlag (ArmorSetType ast)
 
virtual void clearArmorSetFlag (ArmorSetType ast)
 
virtual Bool testArmorSetFlag (ArmorSetType ast)
 
virtual void setInitialHealth (Int initialPercent)
 Sets the inital load health %.
 
virtual void setMaxHealth (Real maxHealth, MaxHealthChangeType healthChangeType=SAME_CURRENTHEALTH)
 Sets the inital max health.
 
virtual Bool getFrontCrushed () const
 
virtual Bool getBackCrushed () const
 
virtual void setFrontCrushed (Bool v)
 
virtual void setBackCrushed (Bool v)
 
virtual Real getMaxHealth () const
 return max health
 
virtual Real getInitialHealth () const
 
virtual Real getPreviousHealth () const
 return previous health
 
virtual void setIndestructible (Bool indestructible)
 
virtual Bool isIndestructible (void) const
 
virtual void internalChangeHealth (Real delta)
 change health
 
virtual void evaluateVisualCondition ()
 
virtual void updateBodyParticleSystems (void)
 
virtual Bool isSubdued () const
 
virtual Bool canBeSubdued () const
 
virtual void onSubdualChange (Bool isNowSubdued)
 Override this if you want a totally different effect than DISABLED_SUBDUED.
 
- Public Member Functions inherited from BodyModule
 BodyModule (Thing *thing, const ModuleData *moduleData)
 
virtual BodyModuleInterfacegetBody ()
 
virtual void applyDamageScalar (Real scalar)
 
virtual Real getDamageScalar () const
 
- Public Member Functions inherited from BehaviorModule
 BehaviorModule (Thing *thing, const ModuleData *moduleData)
 
virtual CollideModuleInterfacegetCollide ()
 
virtual ContainModuleInterfacegetContain ()
 
virtual CreateModuleInterfacegetCreate ()
 
virtual DamageModuleInterfacegetDamage ()
 
virtual DestroyModuleInterfacegetDestroy ()
 
virtual DieModuleInterfacegetDie ()
 
virtual SpecialPowerModuleInterfacegetSpecialPower ()
 
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
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

void validateArmorAndDamageFX () const
 
void doDamageFX (const DamageInfo *damageInfo)
 
void createParticleSystems (const AsciiString &boneBaseName, const ParticleSystemTemplate *systemTemplate, Int maxSystems)
 
void deleteAllParticleSystems (void)
 
void setCorrectDamageState ()
 
Bool shouldRetaliate (Object *obj)
 
Bool shouldRetaliateAgainstAggressor (Object *obj, Object *damager)
 
virtual void internalAddSubdualDamage (Real delta)
 change health
 
- Protected Member Functions inherited from BodyModule
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
 

Additional Inherited Members

- Static Public Member Functions inherited from BodyModule
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 Attributes inherited from BodyModule
Real m_damageScalar
 

Detailed Description

Definition at line 67 of file ActiveBody.h.

Constructor & Destructor Documentation

◆ ActiveBody()

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

Definition at line 162 of file ActiveBody.cpp.

Member Function Documentation

◆ attemptDamage()

void ActiveBody::attemptDamage ( DamageInfo * damageInfo)
virtual

try to damage this object

Implements BodyModule.

Reimplemented in HighlanderBody, HiveStructureBody, and UndeadBody.

Definition at line 345 of file ActiveBody.cpp.

◆ attemptHealing()

void ActiveBody::attemptHealing ( DamageInfo * damageInfo)
virtual

try to heal this object

Todo
we need to figure out what has changed so we don't have to hack this (CBD 11-1-2002)

Implements BodyModule.

Definition at line 796 of file ActiveBody.cpp.

◆ canBeSubdued()

Bool ActiveBody::canBeSubdued ( ) const
virtual

Definition at line 1266 of file ActiveBody.cpp.

◆ clearArmorSetFlag()

virtual void ActiveBody::clearArmorSetFlag ( ArmorSetType ast)
inlinevirtual

Implements BodyModule.

Definition at line 101 of file ActiveBody.h.

◆ clearLastAttacker()

virtual void ActiveBody::clearLastAttacker ( )
inlinevirtual

Reimplemented from BodyModule.

Definition at line 96 of file ActiveBody.h.

◆ createParticleSystems()

void ActiveBody::createParticleSystems ( const AsciiString & boneBaseName,
const ParticleSystemTemplate * systemTemplate,
Int maxSystems )
protected

Create up to maxSystems particle systems of type particleSystemName and attach to bones specified by the bone base name. If there are more bones than maxSystems then the bones will be randomly selected

Definition at line 976 of file ActiveBody.cpp.

◆ deleteAllParticleSystems()

void ActiveBody::deleteAllParticleSystems ( void )
protected

Delete all the body particle systems

Definition at line 1082 of file ActiveBody.cpp.

◆ doDamageFX()

void ActiveBody::doDamageFX ( const DamageInfo * damageInfo)
protected

Definition at line 321 of file ActiveBody.cpp.

◆ estimateDamage()

Real ActiveBody::estimateDamage ( DamageInfoInput & damageInfo) const
virtual

Estimate the (unclipped) damage that would be done to this object by the given damage (taking bonuses, armor, etc into account), but DO NOT alter the body in any way. (This is used by the AI system to choose weapons.)

Implements BodyModule.

Definition at line 288 of file ActiveBody.cpp.

◆ evaluateVisualCondition()

void ActiveBody::evaluateVisualCondition ( )
virtual

Given the current damage state of the object, evaluate the visual model conditions that have a visual impact on the object

Reimplemented from BodyModule.

Definition at line 954 of file ActiveBody.cpp.

◆ getBackCrushed()

virtual Bool ActiveBody::getBackCrushed ( ) const
inlinevirtual

Reimplemented from BodyModule.

Definition at line 108 of file ActiveBody.h.

◆ getClearableLastAttacker()

virtual ObjectID ActiveBody::getClearableLastAttacker ( ) const
inlinevirtual

Reimplemented from BodyModule.

Definition at line 95 of file ActiveBody.h.

◆ getCurrentSubdualDamageAmount()

virtual Real ActiveBody::getCurrentSubdualDamageAmount ( ) const
inlinevirtual

Reimplemented from BodyModule.

Definition at line 90 of file ActiveBody.h.

◆ getDamageState()

BodyDamageType ActiveBody::getDamageState ( ) const
virtual

Implements BodyModule.

Definition at line 1330 of file ActiveBody.cpp.

◆ getFrontCrushed()

virtual Bool ActiveBody::getFrontCrushed ( ) const
inlinevirtual

Reimplemented from BodyModule.

Definition at line 107 of file ActiveBody.h.

◆ getHealth()

Real ActiveBody::getHealth ( ) const
virtual

get current health

Implements BodyModule.

Definition at line 1323 of file ActiveBody.cpp.

◆ getInitialHealth()

Real ActiveBody::getInitialHealth ( ) const
virtual

Reimplemented from BodyModule.

Definition at line 1365 of file ActiveBody.cpp.

◆ getLastDamageInfo()

virtual const DamageInfo * ActiveBody::getLastDamageInfo ( ) const
inlinevirtual

return info on last damage dealt to this object

Reimplemented from BodyModule.

Definition at line 92 of file ActiveBody.h.

◆ getLastDamageTimestamp()

virtual UnsignedInt ActiveBody::getLastDamageTimestamp ( ) const
inlinevirtual

return frame of last damage dealt

Reimplemented from BodyModule.

Definition at line 93 of file ActiveBody.h.

◆ getLastHealingTimestamp()

virtual UnsignedInt ActiveBody::getLastHealingTimestamp ( ) const
inlinevirtual

return frame of last damage dealt

Reimplemented from BodyModule.

Definition at line 94 of file ActiveBody.h.

◆ getMaxHealth()

Real ActiveBody::getMaxHealth ( ) const
virtual

return max health

Reimplemented from BodyModule.

Definition at line 1337 of file ActiveBody.cpp.

◆ getPreviousHealth()

virtual Real ActiveBody::getPreviousHealth ( ) const
inlinevirtual

return previous health

Reimplemented from BodyModule.

Definition at line 116 of file ActiveBody.h.

◆ getSubdualDamageHealAmount()

Real ActiveBody::getSubdualDamageHealAmount ( ) const
virtual

Reimplemented from BodyModule.

Definition at line 1351 of file ActiveBody.cpp.

◆ getSubdualDamageHealRate()

UnsignedInt ActiveBody::getSubdualDamageHealRate ( ) const
virtual

Reimplemented from BodyModule.

Definition at line 1344 of file ActiveBody.cpp.

◆ hasAnySubdualDamage()

Bool ActiveBody::hasAnySubdualDamage ( ) const
virtual

Reimplemented from BodyModule.

Definition at line 1358 of file ActiveBody.cpp.

◆ internalAddSubdualDamage()

void ActiveBody::internalAddSubdualDamage ( Real delta)
protectedvirtual

change health

Definition at line 1256 of file ActiveBody.cpp.

◆ internalChangeHealth()

void ActiveBody::internalChangeHealth ( Real delta)
virtual

change health

Simple changing of the health value, it does NOT track any transition states for the event of "damage" or the event of "death". If you with to kill an object and give these modules a chance to react to that event use the proper damage method calls. No game logic should go in here. This is the low level math and flag maintenance. Game stuff goes in attemptDamage and attemptHealing.

Implements BodyModule.

Reimplemented in ImmortalBody.

Definition at line 1212 of file ActiveBody.cpp.

◆ isIndestructible()

virtual Bool ActiveBody::isIndestructible ( void ) const
inlinevirtual

Reimplemented from BodyModule.

Definition at line 119 of file ActiveBody.h.

◆ isSubdued()

Bool ActiveBody::isSubdued ( ) const
virtual

Definition at line 1316 of file ActiveBody.cpp.

◆ onDelete()

void ActiveBody::onDelete ( void )
virtual

onDelete() will be called on all modules contained by an object or drawable before the actual deletion of each of those modules happens

Reimplemented from Module.

Definition at line 198 of file ActiveBody.cpp.

◆ onSubdualChange()

void ActiveBody::onSubdualChange ( Bool isNowSubdued)
virtual

Override this if you want a totally different effect than DISABLED_SUBDUED.

Definition at line 1274 of file ActiveBody.cpp.

◆ onVeterancyLevelChanged()

void ActiveBody::onVeterancyLevelChanged ( VeterancyLevel oldLevel,
VeterancyLevel newLevel,
Bool provideFeedback = TRUE )
virtual

I just achieved this level right this moment.

Implements BodyModule.

Definition at line 1412 of file ActiveBody.cpp.

◆ setAflame()

void ActiveBody::setAflame ( Bool setting)
virtual

This is a major change like a damage state.

Implements BodyModule.

Definition at line 1506 of file ActiveBody.cpp.

◆ setArmorSetFlag()

virtual void ActiveBody::setArmorSetFlag ( ArmorSetType ast)
inlinevirtual

Implements BodyModule.

Definition at line 100 of file ActiveBody.h.

◆ setBackCrushed()

virtual void ActiveBody::setBackCrushed ( Bool v)
inlinevirtual

Reimplemented from BodyModule.

Definition at line 111 of file ActiveBody.h.

◆ setCorrectDamageState()

void ActiveBody::setCorrectDamageState ( )
protected
Todo
srj – bleah, this is an icky way to do it. oh well.
Todo
I had to change this to a Z only version to keep it from disappearing from the PartitionManager for a frame. That didn't used to happen.

Definition at line 208 of file ActiveBody.cpp.

◆ setDamageState()

void ActiveBody::setDamageState ( BodyDamageType newState)
virtual

control damage state directly. Will adjust hitpoints.

Implements BodyModule.

Definition at line 240 of file ActiveBody.cpp.

◆ setFrontCrushed()

virtual void ActiveBody::setFrontCrushed ( Bool v)
inlinevirtual

Reimplemented from BodyModule.

Definition at line 110 of file ActiveBody.h.

◆ setIndestructible()

void ActiveBody::setIndestructible ( Bool indestructible)
virtual

Set or unset the overridable indestructible flag in the body

Reimplemented from BodyModule.

Definition at line 1374 of file ActiveBody.cpp.

◆ setInitialHealth()

void ActiveBody::setInitialHealth ( Int initialPercent)
virtual

Sets the inital load health %.

Simple setting of the health value, it does NOT track any transition states for the event of "damage" or the event of "death".

Reimplemented from BodyModule.

Definition at line 879 of file ActiveBody.cpp.

◆ setMaxHealth()

void ActiveBody::setMaxHealth ( Real maxHealth,
MaxHealthChangeType healthChangeType = SAME_CURRENTHEALTH )
virtual

Sets the inital max health.

Simple setting of the health value, it does NOT track any transition states for the event of "damage" or the event of "death".

Reimplemented from BodyModule.

Definition at line 897 of file ActiveBody.cpp.

◆ shouldRetaliate()

Bool ActiveBody::shouldRetaliate ( Object * obj)
protected

Definition at line 761 of file ActiveBody.cpp.

◆ shouldRetaliateAgainstAggressor()

Bool ActiveBody::shouldRetaliateAgainstAggressor ( Object * obj,
Object * damager )
protected

Definition at line 730 of file ActiveBody.cpp.

◆ testArmorSetFlag()

virtual Bool ActiveBody::testArmorSetFlag ( ArmorSetType ast)
inlinevirtual

Implements BodyModule.

Definition at line 102 of file ActiveBody.h.

◆ updateBodyParticleSystems()

void ActiveBody::updateBodyParticleSystems ( void )
virtual

Reimplemented from BodyModule.

Definition at line 1111 of file ActiveBody.cpp.

◆ validateArmorAndDamageFX()

void ActiveBody::validateArmorAndDamageFX ( ) const
protected

Definition at line 267 of file ActiveBody.cpp.


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