![]() |
Spore ModAPI
2.4.0
API for creating C++ mods for Spore
|
Any object that has hit points and can combat other units. More...
#include <cCombatant.h>
Public Member Functions | |
virtual | ~cCombatant () |
void | SetHealthPoints (float healthPoints) |
float | GetWeaponRange () |
Returns the maximum range of this combatant's weapon. More... | |
virtual bool | Write (void *arg_0) |
virtual cSpatialObject * | ToSpatialObject ()=0 |
Returns the cSpatialObject that corresponds to this combatant. More... | |
virtual cGameData * | ToGameData ()=0 |
Returns the cGameData that corresponds to this combatant. More... | |
virtual uint32_t | GetPoliticalID ()=0 |
Returns this object political ID, used to identify the cGameData. More... | |
virtual cSpaceToolData * | GetWeapon () |
Returns the weapon tool used by this combatant. This is only available for vehicles. More... | |
virtual int | func18h (float, int, int, int, int) |
virtual void | AddHostileUnit (cCombatant *combatant) |
virtual Math::Vector3 | func20h () |
virtual int | GetRandomAimIndex () |
Generates a random index that allows to select from the existing aim points. More... | |
virtual Math::Vector3 | func28h (int) |
virtual void | func2Ch (bool) |
virtual Math::Vector3 | func30h () |
virtual uint32_t | func34h () |
virtual void | func38h () |
virtual bool | func3Ch () |
virtual bool | IsInWeaponRange (cCombatant *other) |
Returns true if the other combatant is inside the maximum range of this combatant's weapon. More... | |
virtual bool | IsWeaponCharged (int=0) |
Returns true if the weapon has enough ammo (if it uses ammo) and is not recharging. More... | |
virtual void | func48h (int, int) |
virtual void | func4Ch (int) |
virtual void | SetTarget (cCombatant *target) |
Sets the target combatant; if it is not nullptr, this object will start attacking the given combatant. More... | |
virtual cCombatant * | GetTarget () |
Returns the current target, that is, the combatant that this class is attacking, or nullptr if the class is not in combat. More... | |
virtual float | GetMaxHitPoints () |
virtual void * | Cast (uint32_t type) |
Same as Object::Cast(uint32_t) More... | |
virtual int | AddRef ()=0 |
Same as Object::AddRef(). More... | |
virtual int | Release ()=0 |
Same as Object::Release(). More... | |
Static Public Attributes | |
static const uint32_t | TYPE = 0x13F94D4 |
Protected Attributes | |
bool | field_8 |
bool | field_9 |
map< int, int > | field_0C |
intrusive_ptr< cCombatant > | field_28 |
float | mMaxHealthPoints |
intrusive_ptr< Object > | field_30 |
int | field_34 |
float | mHealthPoints |
int | mLastAttacker |
float | mArmorProbability |
intrusive_ptr< cCombatant > | field_44 |
intrusive_ptr< cCombatant > | mpTarget |
Vector3 | field_4C |
vector< Vector3 > | mAimPoints |
bool | field_6C |
uint32_t | field_70 |
Vector3 | field_74 |
bool | field_80 |
bool | field_81 |
vector< cGonzagoTimer > | field_84 |
cGonzagoTimer | field_98 |
int | field_B8 |
int | field_BC |
intrusive_ptr< Object > | field_C0 |
intrusive_ptr< Object > | field_C4 |
Any object that has hit points and can combat other units.
This class acts more as a container of different variables (like the target combatant, number of hit points, etc), and therefore it barely has any combat logic on it. The combat logic is managed externally, by the cCombatSimulator class.
Combatants can only fight with other combatants, and can only attack one of them at a time. To do so, use the SetTarget() method. If the class has no target, it won't attack anyone.
Several attributes can be saved into the game data:
|
virtual |
|
virtual |
|
pure virtual |
Same as Object::AddRef().
|
virtual |
Same as Object::Cast(uint32_t)
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
pure virtual |
Returns this object political ID, used to identify the cGameData.
|
virtual |
Generates a random index that allows to select from the existing aim points.
|
virtual |
Returns the current target, that is, the combatant that this class is attacking, or nullptr if the class is not in combat.
|
virtual |
Returns the weapon tool used by this combatant. This is only available for vehicles.
|
inline |
Returns the maximum range of this combatant's weapon.
If this combatant does not use weapon tools, returns 0.
|
virtual |
Returns true if the other combatant is inside the maximum range of this combatant's weapon.
If this combatant does not use weapon tools, returns false.
|
virtual |
Returns true if the weapon has enough ammo (if it uses ammo) and is not recharging.
If this combatant does not use weapon tools, returns false.
|
pure virtual |
Same as Object::Release().
|
inline |
|
virtual |
Sets the target combatant; if it is not nullptr, this object will start attacking the given combatant.
There can only be one target at a time.
target | The new target combatant. |
|
pure virtual |
Returns the cGameData that corresponds to this combatant.
|
pure virtual |
Returns the cSpatialObject that corresponds to this combatant.
|
virtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |