* Move the definition of struct BRAIN_STATS from statsdef.h to stats-db2.tpl

* Make it possible to declare "references" to struct WEAPON by adding a %fetchRowById code block


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5525 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-07-12 21:45:42 +00:00
parent 8344514617
commit 13c4c559c5
3 changed files with 76 additions and 9 deletions

View File

@ -952,6 +952,68 @@ typedef struct WEAPON_STATS
SDWORD iAudioImpactID;
} WEAPON_STATS;
typedef struct BRAIN_STATS
{
/* BEGIN of inherited "COMPONENT" definition */
/* BEGIN of inherited "BASE" definition */
/**
* Unique ID of the item
*/
UDWORD ref;
/**
* Unique language independant name that can be used to identify a specific
* stats instance
*
* Unique across all instances
*/
char* pName;
/* END of inherited "BASE" definition */
/**
* Power required to build this component
*/
UDWORD buildPower;
/**
* Build points (which are rate-limited in the construction units) required
* to build this component.
*/
UDWORD buildPoints;
/**
* Weight of this component
*/
UDWORD weight;
/**
* Body points of this component
*/
UDWORD body;
/**
* Indicates whether this component is "designable" and can thus be used in
* the design screen.
*/
bool designable;
/**
* The "base" IMD model representing this component in 3D space.
*
* This field is optional and can be NULL to indicate that it has no value
*/
iIMDShape* pIMD;
/* END of inherited "COMPONENT" definition */
/**
* Program capacity
*/
UDWORD progCap;
/**
* Weapon stats associated with this brain - for Command Droids
*/
WEAPON_STATS* psWeaponStat;
} BRAIN_STATS;
typedef struct CONSTRUCT_STATS
{
/* BEGIN of inherited "COMPONENT" definition */

View File

@ -283,6 +283,9 @@ end;
struct WEAPON
%inherit COMPONENT;
%nomacro;
%fetchRowById Row Id
$Row = statsGetWeapon($Id - 1);
end;
# Max distance to target for short range shot
UDWORD shortRange;
@ -383,6 +386,17 @@ struct WEAPON
SDWORD iAudioImpactID;
end;
struct BRAIN
%inherit COMPONENT;
%nomacro;
# Program capacity
UDWORD progCap;
# Weapon stats associated with this brain - for Command Droids
struct WEAPON psWeaponStat;
end;
struct CONSTRUCT
%inherit COMPONENT;
%nomacro;

View File

@ -59,15 +59,6 @@ typedef struct _body_stats
iIMDShape* pFlameIMD; ///< pointer to which flame graphic to use - for VTOLs only at the moment
} BODY_STATS;
typedef struct _brain_stats
{
/* Common stats */
STATS_COMPONENT;
UDWORD progCap; ///< Program capacity
struct WEAPON_STATS* psWeaponStat; ///< weapon stats associated with this brain - for Command Droids
} BRAIN_STATS;
/************************************************************************************
* Additional stats tables
************************************************************************************/