Spore ModAPI  2.4.0
API for creating C++ mods for Spore
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
Simulator::cCombatant Class Referenceabstract

Any object that has hit points and can combat other units. More...

#include <cCombatant.h>

Inheritance diagram for Simulator::cCombatant:
Simulator::cBuilding Simulator::cCreatureBase Simulator::cGameDataUFO Simulator::cInteractiveOrnament Simulator::cOrnament Simulator::cVehicle Simulator::cCreatureAnimal

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 cSpatialObjectToSpatialObject ()=0
 Returns the cSpatialObject that corresponds to this combatant. More...
 
virtual cGameDataToGameData ()=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 cSpaceToolDataGetWeapon ()
 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 cCombatantGetTarget ()
 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< cCombatantfield_28
 
float mMaxHealthPoints
 
intrusive_ptr< Objectfield_30
 
int field_34
 
float mHealthPoints
 
int mLastAttacker
 
float mArmorProbability
 
intrusive_ptr< cCombatantfield_44
 
intrusive_ptr< cCombatantmpTarget
 
Vector3 field_4C
 
vector< Vector3mAimPoints
 
bool field_6C
 
uint32_t field_70
 
Vector3 field_74
 
bool field_80
 
bool field_81
 
vector< cGonzagoTimerfield_84
 
cGonzagoTimer field_98
 
int field_B8
 
int field_BC
 
intrusive_ptr< Objectfield_C0
 
intrusive_ptr< Objectfield_C4
 

Detailed Description

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:

Constructor & Destructor Documentation

◆ ~cCombatant()

virtual Simulator::cCombatant::~cCombatant ( )
virtual

Member Function Documentation

◆ AddHostileUnit()

virtual void Simulator::cCombatant::AddHostileUnit ( cCombatant combatant)
virtual

◆ AddRef()

virtual int Simulator::cCombatant::AddRef ( )
pure virtual

Same as Object::AddRef().

◆ Cast()

virtual void* Simulator::cCombatant::Cast ( uint32_t  type)
virtual

Same as Object::Cast(uint32_t)

◆ func18h()

virtual int Simulator::cCombatant::func18h ( float  ,
int  ,
int  ,
int  ,
int   
)
virtual

◆ func20h()

virtual Math::Vector3 Simulator::cCombatant::func20h ( )
virtual

◆ func28h()

virtual Math::Vector3 Simulator::cCombatant::func28h ( int  )
virtual

◆ func2Ch()

virtual void Simulator::cCombatant::func2Ch ( bool  )
virtual

◆ func30h()

virtual Math::Vector3 Simulator::cCombatant::func30h ( )
virtual

◆ func34h()

virtual uint32_t Simulator::cCombatant::func34h ( )
virtual

◆ func38h()

virtual void Simulator::cCombatant::func38h ( )
virtual

◆ func3Ch()

virtual bool Simulator::cCombatant::func3Ch ( )
virtual

◆ func48h()

virtual void Simulator::cCombatant::func48h ( int  ,
int   
)
virtual

◆ func4Ch()

virtual void Simulator::cCombatant::func4Ch ( int  )
virtual

◆ GetMaxHitPoints()

virtual float Simulator::cCombatant::GetMaxHitPoints ( )
virtual

◆ GetPoliticalID()

virtual uint32_t Simulator::cCombatant::GetPoliticalID ( )
pure virtual

Returns this object political ID, used to identify the cGameData.

◆ GetRandomAimIndex()

virtual int Simulator::cCombatant::GetRandomAimIndex ( )
virtual

Generates a random index that allows to select from the existing aim points.

◆ GetTarget()

virtual cCombatant* Simulator::cCombatant::GetTarget ( )
virtual

Returns the current target, that is, the combatant that this class is attacking, or nullptr if the class is not in combat.

◆ GetWeapon()

virtual cSpaceToolData* Simulator::cCombatant::GetWeapon ( )
virtual

Returns the weapon tool used by this combatant. This is only available for vehicles.

◆ GetWeaponRange()

float Simulator::cCombatant::GetWeaponRange ( )
inline

Returns the maximum range of this combatant's weapon.

If this combatant does not use weapon tools, returns 0.

◆ IsInWeaponRange()

virtual bool Simulator::cCombatant::IsInWeaponRange ( cCombatant other)
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.

◆ IsWeaponCharged()

virtual bool Simulator::cCombatant::IsWeaponCharged ( int  = 0)
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.

◆ Release()

virtual int Simulator::cCombatant::Release ( )
pure virtual

◆ SetHealthPoints()

void Simulator::cCombatant::SetHealthPoints ( float  healthPoints)
inline

◆ SetTarget()

virtual void Simulator::cCombatant::SetTarget ( cCombatant target)
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.

Parameters
targetThe new target combatant.

◆ ToGameData()

virtual cGameData* Simulator::cCombatant::ToGameData ( )
pure virtual

Returns the cGameData that corresponds to this combatant.

◆ ToSpatialObject()

virtual cSpatialObject* Simulator::cCombatant::ToSpatialObject ( )
pure virtual

Returns the cSpatialObject that corresponds to this combatant.

◆ Write()

virtual bool Simulator::cCombatant::Write ( void *  arg_0)
virtual

Member Data Documentation

◆ field_0C

map<int, int> Simulator::cCombatant::field_0C
protected

◆ field_28

intrusive_ptr<cCombatant> Simulator::cCombatant::field_28
protected

◆ field_30

intrusive_ptr<Object> Simulator::cCombatant::field_30
protected

◆ field_34

int Simulator::cCombatant::field_34
protected

◆ field_44

intrusive_ptr<cCombatant> Simulator::cCombatant::field_44
protected

◆ field_4C

Vector3 Simulator::cCombatant::field_4C
protected

◆ field_6C

bool Simulator::cCombatant::field_6C
protected

◆ field_70

uint32_t Simulator::cCombatant::field_70
protected

◆ field_74

Vector3 Simulator::cCombatant::field_74
protected

◆ field_8

bool Simulator::cCombatant::field_8
protected

◆ field_80

bool Simulator::cCombatant::field_80
protected

◆ field_81

bool Simulator::cCombatant::field_81
protected

◆ field_84

vector<cGonzagoTimer> Simulator::cCombatant::field_84
protected

◆ field_9

bool Simulator::cCombatant::field_9
protected

◆ field_98

cGonzagoTimer Simulator::cCombatant::field_98
protected

◆ field_B8

int Simulator::cCombatant::field_B8
protected

◆ field_BC

int Simulator::cCombatant::field_BC
protected

◆ field_C0

intrusive_ptr<Object> Simulator::cCombatant::field_C0
protected

◆ field_C4

intrusive_ptr<Object> Simulator::cCombatant::field_C4
protected

◆ mAimPoints

vector<Vector3> Simulator::cCombatant::mAimPoints
protected

◆ mArmorProbability

float Simulator::cCombatant::mArmorProbability
protected

◆ mHealthPoints

float Simulator::cCombatant::mHealthPoints
protected

◆ mLastAttacker

int Simulator::cCombatant::mLastAttacker
protected

◆ mMaxHealthPoints

float Simulator::cCombatant::mMaxHealthPoints
protected

◆ mpTarget

intrusive_ptr<cCombatant> Simulator::cCombatant::mpTarget
protected

◆ TYPE

const uint32_t Simulator::cCombatant::TYPE = 0x13F94D4
static

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