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

#include <DamageFX.h>

Public Member Functions

 DamageFX ()
 
void clear ()
 
void doDamageFX (DamageType t, Real damageAmount, const Object *source, const Object *victim) const
 
UnsignedInt getDamageFXThrottleTime (DamageType t, const Object *source) const
 
const FieldParsegetFieldParse () const
 

Detailed Description

A DamageFX is an object used to describe how an object reacts to taking a particular type of damage. (Note that "reacts" here implies only audio-video effects, not logic effects, damage modifiers, etc.)

Conceptually speaking, every unit with a Body module has a DamageFX object. When it receives damage, it asks its DamageFX module to produce an appropriate a/v effect, which can vary by type of damage (eg, explosion, armor-piercing, flame, etc) and amount ("minor" or "major").

Notes:

– Every particular damage-type within a DamageFX can have a "minor" and/or "major" effect; basically, if the damage done exceeds a specified threshold (or if there isn't a "minor" effect), the major effect is used.

DamageFX is shared between multiple units; there should generally only be one instance of any particular class. The implication is that it should not require private data storage to do what it needs to do, aside from stuff initialized at object instantiation time. To help enforce this, all it's methods are declared 'const'. If you can't implement the damage you need within this framework, please don't simply de-const things, because it could lead to very strange side-effects. Instead, the system will have to be enhanced to allow for multiple instances of each DamageFX.

Definition at line 74 of file DamageFX.h.

Constructor & Destructor Documentation

◆ DamageFX()

DamageFX::DamageFX ( )

Definition at line 66 of file DamageFX.cpp.

Member Function Documentation

◆ clear()

void DamageFX::clear ( )

Definition at line 73 of file DamageFX.cpp.

◆ doDamageFX()

void DamageFX::doDamageFX ( DamageType t,
Real damageAmount,
const Object * source,
const Object * victim ) const

This is the main public access point to the system: when you want to execute the a/v fx used for a specific damage type, call this method. (It is OK for source and/or victim to be null, but you should pass them when available.)

Definition at line 91 of file DamageFX.cpp.

◆ getDamageFXThrottleTime()

UnsignedInt DamageFX::getDamageFXThrottleTime ( DamageType t,
const Object * source ) const

Definition at line 85 of file DamageFX.cpp.

◆ getFieldParse()

const FieldParse * DamageFX::getFieldParse ( ) const

Definition at line 121 of file DamageFX.cpp.


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