Move the definitions of structs SENSOR_STATS, ECM_STATS, REPAIR_STATS and CONSTRUCT_STATS from statsdef.h into a single definition in stats-db2.tpl

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5509 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-07-11 19:40:49 +00:00
parent dd90404594
commit 859be18724
6 changed files with 375 additions and 52 deletions

View File

@ -322,7 +322,7 @@ typedef struct _function_upgrade
//common stats
// FUNCTION_STATS;
// struct _repair_stats* pRepair; /*The repair unit to be upgraded*/
// struct REPAIR_STATS* pRepair; /*The repair unit to be upgraded*/
// UDWORD repairPoints; /*The percentage to increase the repair points by*/
// UDWORD buildPoints; /*The number of build points required to upgrade
// the structure*/
@ -356,8 +356,8 @@ typedef struct _function_upgrade
// //common stats
// FUNCTION_STATS;
//
// struct _sensor_stats* pSensor; /*The Sensor fitted, if any*/
// struct _ecm_stats* pECM; /*The ECM fitted, if any*/
// struct SENSOR_STATS* pSensor; /*The Sensor fitted, if any*/
// struct ECM_STATS* pECM; /*The ECM fitted, if any*/
// UDWORD weaponCapacity; /*The size of weapon in system points that may
// be added. 0 = no weapons can be added*/
//} DEFENSIVE_STRUCTURE_FUNCTION;

View File

@ -444,4 +444,298 @@ typedef struct PROPULSION_STATS
PROPULSION_TYPE propulsionType;
} PROPULSION_STATS;
typedef struct SENSOR_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 */
/**
* Sensor range.
*/
UDWORD range;
/**
* Sensor power (put against ecm power).
*/
UDWORD power;
/**
* specifies whether the Sensor is default or for the Turret.
*/
UDWORD location;
/**
* used for combat
*/
SENSOR_TYPE type;
/**
* Time delay before the associated weapon droids 'know' where the attack is
* from.
*/
UDWORD time;
/**
* The turret mount to use.
*/
iIMDShape* pMountGraphic;
} SENSOR_STATS;
typedef struct ECM_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 */
/**
* ECM range.
*/
UDWORD range;
/**
* ECM power (put against sensor power).
*/
UDWORD power;
/**
* Specifies whether the ECM is default or for the Turret.
*/
UDWORD location;
/**
* The turret mount to use.
*/
iIMDShape* pMountGraphic;
} ECM_STATS;
typedef struct REPAIR_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 */
/**
* How much damage is restored to Body Points and armour each Repair Cycle.
*/
UDWORD repairPoints;
/**
* Whether armour can be repaired or not.
*/
bool repairArmour;
/**
* Specifies whether the Repair is default or for the Turret.
*/
UDWORD location;
/**
* Time delay for repair cycle.
*/
UDWORD time;
/**
* The turret mount to use.
*/
iIMDShape* pMountGraphic;
} REPAIR_STATS;
typedef struct CONSTRUCT_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 */
/**
* The number of points contributed each cycle
*/
UDWORD constructPoints;
/**
* The turret mount to use
*/
iIMDShape* pMountGraphic;
} CONSTRUCT_STATS;
#endif // __INCLUDED_DB_TEMPLATE_SCHEMA_STRUCTDEF_STATS_DB2_TPL_H__

View File

@ -206,6 +206,67 @@ enum SENSOR_TYPE
SUPER_SENSOR
end;
struct SENSOR
%inherit COMPONENT;
%nomacro;
# Sensor range.
UDWORD range;
# Sensor power (put against ecm power).
UDWORD power;
# specifies whether the Sensor is default or for the Turret.
UDWORD location;
# used for combat
enum SENSOR_TYPE type;
# Time delay before the associated weapon droids 'know' where the attack is
# from.
UDWORD time;
# The turret mount to use.
IMD_model pMountGraphic;
end;
struct ECM
%inherit COMPONENT;
%nomacro;
# ECM range.
UDWORD range;
# ECM power (put against sensor power).
UDWORD power;
# Specifies whether the ECM is default or for the Turret.
UDWORD location;
# The turret mount to use.
IMD_model pMountGraphic;
end;
struct REPAIR
%inherit COMPONENT;
%nomacro;
# How much damage is restored to Body Points and armour each Repair Cycle.
UDWORD repairPoints;
# Whether armour can be repaired or not.
bool repairArmour;
# Specifies whether the Repair is default or for the Turret.
UDWORD location;
# Time delay for repair cycle.
UDWORD time;
# The turret mount to use.
IMD_model pMountGraphic;
end;
enum FIREONMOVE
%valprefix "FOM_";
@ -219,6 +280,17 @@ enum FIREONMOVE
YES
end;
struct CONSTRUCT
%inherit COMPONENT;
%nomacro;
# The number of points contributed each cycle
UDWORD constructPoints;
# The turret mount to use
IMD_model pMountGraphic;
end;
enum TRAVEL_MEDIUM
%valprefix "";

View File

@ -1346,7 +1346,7 @@ BOOL loadRepairStats(const char *pRepairData, UDWORD bufferSize)
{
const unsigned int NumRepair = numCR(pRepairData, bufferSize);
REPAIR_STATS sStats, * const psStats = &sStats;
unsigned int i = 0, designable;
unsigned int i = 0, designable, repairArmour;
char RepairName[MAX_STR_LENGTH], dummy[MAX_STR_LENGTH],
GfxFile[MAX_STR_LENGTH], mountGfx[MAX_STR_LENGTH],
location[MAX_STR_LENGTH];
@ -1371,7 +1371,7 @@ BOOL loadRepairStats(const char *pRepairData, UDWORD bufferSize)
%[^','],%[^','],%d,%d,%d",
(char*)&RepairName, (char*)&dummy, &psStats->buildPower,&psStats->buildPoints,
&psStats->weight, &dummyVal, &dummyVal,
&psStats->repairArmour, (char*)&location, (char*)&GfxFile, (char*)&mountGfx,
&repairArmour, (char*)&location, (char*)&GfxFile, (char*)&mountGfx,
&psStats->repairPoints, &psStats->time,&designable);
if (!allocateStatName((BASE_STATS *)psStats, RepairName))
@ -1407,6 +1407,8 @@ BOOL loadRepairStats(const char *pRepairData, UDWORD bufferSize)
psStats->time = 1;
}
psStats->repairArmour = (repairArmour != 0);
//set design flag
psStats->designable = (designable != 0);

View File

@ -68,42 +68,6 @@ typedef struct _brain_stats
struct _weapon_stats* psWeaponStat; ///< weapon stats associated with this brain - for Command Droids
} BRAIN_STATS;
typedef struct _sensor_stats
{
/* Common stats */
STATS_COMPONENT;
UDWORD range; ///< Sensor range
UDWORD power; ///< Sensor power (put against ecm power)
UDWORD location; ///< specifies whether the Sensor is default or for the Turret
SENSOR_TYPE type; ///< used for combat
UDWORD time; ///< time delay before associated weapon droids 'know' where the attack is from
iIMDShape* pMountGraphic; ///< The turret mount to use
} SENSOR_STATS;
typedef struct _ecm_stats
{
/* Common stats */
STATS_COMPONENT;
UDWORD range; ///< ECM range
UDWORD power; ///< ECM power (put against sensor power)
UDWORD location; ///< specifies whether the ECM is default or for the Turret
iIMDShape* pMountGraphic; ///< The turret mount to use
} ECM_STATS;
typedef struct _repair_stats
{
/* Common stats */
STATS_COMPONENT;
UDWORD repairPoints; ///< How much damage is restored to Body Points and armour each Repair Cycle
BOOL repairArmour; ///< whether armour can be repaired or not
UDWORD location; ///< specifies whether the Repair is default or for the Turret
UDWORD time; ///< time delay for repair cycle
iIMDShape* pMountGraphic; ///< The turret mount to use
} REPAIR_STATS;
typedef struct _weapon_stats
{
/* Common stats */
@ -163,15 +127,6 @@ typedef struct _weapon_stats
SDWORD iAudioImpactID;
} WEAPON_STATS;
typedef struct _construct_stats
{
/* Common stats */
STATS_COMPONENT;
UDWORD constructPoints; ///< The number of points contributed each cycle
iIMDShape* pMountGraphic; ///< The turret mount to use
} CONSTRUCT_STATS;
/************************************************************************************
* Additional stats tables
************************************************************************************/

View File

@ -148,9 +148,9 @@ typedef struct _structure_stats
UDWORD sizeModifier; /*The larger the target, the easier to hit*/
iIMDShape *pIMD; /*The IMD to draw for this structure */
iIMDShape *pBaseIMD; /*The base IMD to draw for this structure */
struct _ecm_stats *pECM; /*Which ECM is standard for the structure -
struct ECM_STATS *pECM; /*Which ECM is standard for the structure -
if any*/
struct _sensor_stats *pSensor; /*Which Sensor is standard for the structure -
struct SENSOR_STATS *pSensor; /*Which Sensor is standard for the structure -
if any*/
UDWORD weaponSlots; /*Number of weapons that can be attached to the
building*/