diff --git a/src/stats-db2.h b/src/stats-db2.h index ef45f9111..e93f35478 100644 --- a/src/stats-db2.h +++ b/src/stats-db2.h @@ -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 */ diff --git a/src/stats-db2.tpl b/src/stats-db2.tpl index 708a8bcf8..3da0253d8 100644 --- a/src/stats-db2.tpl +++ b/src/stats-db2.tpl @@ -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; diff --git a/src/statsdef.h b/src/statsdef.h index 6094d3c2b..c2175cc90 100644 --- a/src/statsdef.h +++ b/src/statsdef.h @@ -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 ************************************************************************************/