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

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5512 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-07-11 22:03:38 +00:00
parent 65dee90e74
commit 1a17b936c9
4 changed files with 381 additions and 61 deletions

View File

@ -676,6 +676,282 @@ typedef struct REPAIR_STATS
iIMDShape* pMountGraphic; iIMDShape* pMountGraphic;
} REPAIR_STATS; } REPAIR_STATS;
typedef struct WEAPON_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 */
/**
* Max distance to target for short range shot
*/
UDWORD shortRange;
/**
* Max distance to target for long range shot
*/
UDWORD longRange;
/**
* Min distance to target for shot
*/
UDWORD minRange;
/**
* Chance to hit at short range
*/
UDWORD shortHit;
/**
* Chance to hit at long range
*/
UDWORD longHit;
/**
* Time between each weapon fire
*/
UDWORD firePause;
/**
* The number of explosions per shot
*/
UDWORD numExplosions;
/**
* The number of rounds per salvo(magazine)
*/
UBYTE numRounds;
/**
* Time to reload the round of ammo (salvo fire)
*/
UDWORD reloadTime;
/**
* How much damage the weapon causes
*/
UDWORD damage;
/**
* Basic blast radius of weapon
*/
UDWORD radius;
/**
* Chance to hit in the blast radius
*/
UDWORD radiusHit;
/**
* Damage done in the blast radius
*/
UDWORD radiusDamage;
/**
* How long the round burns
*/
UDWORD incenTime;
/**
* Damage done each burn cycle
*/
UDWORD incenDamage;
/**
* Burn radius of the round
*/
UDWORD incenRadius;
/**
* speed ammo travels at
*/
UDWORD flightSpeed;
/**
* how high the ammo travels for indirect fire
*/
UDWORD indirectHeight;
/**
* indicates whether the droid has to stop before firing
*/
FIREONMOVE fireOnMove;
/**
* the class of weapon
*/
WEAPON_CLASS weaponClass;
/**
* the subclass to which the weapon belongs
*/
WEAPON_SUBCLASS weaponSubClass;
/**
* which projectile model to use for the bullet
*/
MOVEMENT_MODEL movementModel;
/**
* which type of warhead is associated with the weapon
*/
WEAPON_EFFECT weaponEffect;
/**
* used to compare with weight to see if recoils or not
*/
UDWORD recoilValue;
/**
* amount the weapon(turret) can rotate 0 = none
*/
UBYTE rotate;
/**
* max amount the turret can be elevated up
*/
UBYTE maxElevation;
/**
* min amount the turret can be elevated down
*/
SBYTE minElevation;
/**
* flag to make the (explosion) effect face the player when drawn
*/
UBYTE facePlayer;
/**
* flag to make the inflight effect face the player when drawn
*/
UBYTE faceInFlight;
/**
* size of the effect 100 = normal, 50 = half etc
*/
UBYTE effectSize;
/**
* flag to indicate whether the effect lights up the world
*/
bool lightWorld;
/**
* indicates how good in the air - SHOOT_ON_GROUND, SHOOT_IN_AIR or both
*/
UBYTE surfaceToAir;
/**
* number of attack runs a VTOL droid can do with this weapon
*/
UBYTE vtolAttackRuns;
/**
* flag to indicate whether pentrate droid or not
*/
bool penetrate;
/**
* Graphics control stats
* How long a direct fire weapon is visible. Measured in 1/100 sec.
*/
UDWORD directLife;
/**
* How long a blast radius is visible
*/
UDWORD radiusLife;
/**
* Graphics used for the weapon
* The turret mount to use
*/
iIMDShape* pMountGraphic;
/**
* The muzzle flash
*/
iIMDShape* pMuzzleGraphic;
/**
* The ammo in flight
*/
iIMDShape* pInFlightGraphic;
/**
* The ammo hitting a target
*/
iIMDShape* pTargetHitGraphic;
/**
* The ammo missing a target
*/
iIMDShape* pTargetMissGraphic;
/**
* The ammo hitting water
*/
iIMDShape* pWaterHitGraphic;
/**
* The trail used for in flight
*/
iIMDShape* pTrailGraphic;
/**
* Audio
*/
SDWORD iAudioFireID;
SDWORD iAudioImpactID;
} WEAPON_STATS;
typedef struct CONSTRUCT_STATS typedef struct CONSTRUCT_STATS
{ {
/* BEGIN of inherited "COMPONENT" definition */ /* BEGIN of inherited "COMPONENT" definition */

View File

@ -280,6 +280,109 @@ enum FIREONMOVE
YES YES
end; end;
struct WEAPON
%inherit COMPONENT;
%nomacro;
# Max distance to target for short range shot
UDWORD shortRange;
# Max distance to target for long range shot
UDWORD longRange;
# Min distance to target for shot
UDWORD minRange;
# Chance to hit at short range
UDWORD shortHit;
# Chance to hit at long range
UDWORD longHit;
# Time between each weapon fire
UDWORD firePause;
# The number of explosions per shot
UDWORD numExplosions;
# The number of rounds per salvo(magazine)
UBYTE numRounds;
# Time to reload the round of ammo (salvo fire)
UDWORD reloadTime;
# How much damage the weapon causes
UDWORD damage;
# Basic blast radius of weapon
UDWORD radius;
# Chance to hit in the blast radius
UDWORD radiusHit;
# Damage done in the blast radius
UDWORD radiusDamage;
# How long the round burns
UDWORD incenTime;
# Damage done each burn cycle
UDWORD incenDamage;
# Burn radius of the round
UDWORD incenRadius;
# speed ammo travels at
UDWORD flightSpeed;
# how high the ammo travels for indirect fire
UDWORD indirectHeight;
# indicates whether the droid has to stop before firing
enum FIREONMOVE fireOnMove;
# the class of weapon
enum WEAPON_CLASS weaponClass;
# the subclass to which the weapon belongs
enum WEAPON_SUBCLASS weaponSubClass;
# which projectile model to use for the bullet
enum MOVEMENT_MODEL movementModel;
# which type of warhead is associated with the weapon
enum WEAPON_EFFECT weaponEffect;
# used to compare with weight to see if recoils or not
UDWORD recoilValue;
# amount the weapon(turret) can rotate 0 = none
UBYTE rotate;
# max amount the turret can be elevated up
UBYTE maxElevation;
# min amount the turret can be elevated down
SBYTE minElevation;
# flag to make the (explosion) effect face the player when drawn
UBYTE facePlayer;
# flag to make the inflight effect face the player when drawn
UBYTE faceInFlight;
# size of the effect 100 = normal, 50 = half etc
UBYTE effectSize;
# flag to indicate whether the effect lights up the world
bool lightWorld;
# indicates how good in the air - SHOOT_ON_GROUND, SHOOT_IN_AIR or both
UBYTE surfaceToAir;
# number of attack runs a VTOL droid can do with this weapon
UBYTE vtolAttackRuns;
# flag to indicate whether pentrate droid or not
bool penetrate;
# Graphics control stats
# How long a direct fire weapon is visible. Measured in 1/100 sec.
UDWORD directLife;
# How long a blast radius is visible
UDWORD radiusLife;
# Graphics used for the weapon
# The turret mount to use
IMD_model pMountGraphic;
# The muzzle flash
IMD_model pMuzzleGraphic;
# The ammo in flight
IMD_model pInFlightGraphic;
# The ammo hitting a target
IMD_model pTargetHitGraphic;
# The ammo missing a target
IMD_model pTargetMissGraphic;
# The ammo hitting water
IMD_model pWaterHitGraphic;
# The trail used for in flight
IMD_model pTrailGraphic;
# Audio
SDWORD iAudioFireID;
SDWORD iAudioImpactID;
end;
struct CONSTRUCT struct CONSTRUCT
%inherit COMPONENT; %inherit COMPONENT;
%nomacro; %nomacro;

View File

@ -65,68 +65,9 @@ typedef struct _brain_stats
STATS_COMPONENT; STATS_COMPONENT;
UDWORD progCap; ///< Program capacity UDWORD progCap; ///< Program capacity
struct _weapon_stats* psWeaponStat; ///< weapon stats associated with this brain - for Command Droids struct WEAPON_STATS* psWeaponStat; ///< weapon stats associated with this brain - for Command Droids
} BRAIN_STATS; } BRAIN_STATS;
typedef struct _weapon_stats
{
/* Common stats */
STATS_COMPONENT;
UDWORD shortRange; ///< Max distance to target for short range shot
UDWORD longRange; ///< Max distance to target for long range shot
UDWORD minRange; ///< Min distance to target for shot
UDWORD shortHit; ///< Chance to hit at short range
UDWORD longHit; ///< Chance to hit at long range
UDWORD firePause; ///< Time between each weapon fire
UDWORD numExplosions; ///< The number of explosions per shot
UBYTE numRounds; ///< The number of rounds per salvo(magazine)
UDWORD reloadTime; ///< Time to reload the round of ammo (salvo fire)
UDWORD damage; ///< How much damage the weapon causes
UDWORD radius; ///< Basic blast radius of weapon
UDWORD radiusHit; ///< Chance to hit in the blast radius
UDWORD radiusDamage; ///< Damage done in the blast radius
UDWORD incenTime; ///< How long the round burns
UDWORD incenDamage; ///< Damage done each burn cycle
UDWORD incenRadius; ///< Burn radius of the round
UDWORD flightSpeed; ///< speed ammo travels at
UDWORD indirectHeight; ///< how high the ammo travels for indirect fire
FIREONMOVE fireOnMove; ///< indicates whether the droid has to stop before firing
WEAPON_CLASS weaponClass; ///< the class of weapon
WEAPON_SUBCLASS weaponSubClass; ///< the subclass to which the weapon belongs
MOVEMENT_MODEL movementModel; ///< which projectile model to use for the bullet
WEAPON_EFFECT weaponEffect; ///< which type of warhead is associated with the weapon
UDWORD recoilValue; ///< used to compare with weight to see if recoils or not
UBYTE rotate; ///< amount the weapon(turret) can rotate 0 = none
UBYTE maxElevation; ///< max amount the turret can be elevated up
SBYTE minElevation; ///< min amount the turret can be elevated down
UBYTE facePlayer; ///< flag to make the (explosion) effect face the player when drawn
UBYTE faceInFlight; ///< flag to make the inflight effect face the player when drawn
UBYTE effectSize; ///< size of the effect 100 = normal, 50 = half etc
BOOL lightWorld; ///< flag to indicate whether the effect lights up the world
UBYTE surfaceToAir; ///< indicates how good in the air - SHOOT_ON_GROUND, SHOOT_IN_AIR or both
UBYTE vtolAttackRuns; ///< number of attack runs a VTOL droid can do with this weapon
BOOL penetrate; ///< flag to indicate whether pentrate droid or not
/* Graphics control stats */
UDWORD directLife; ///< How long a direct fire weapon is visible. Measured in 1/100 sec.
UDWORD radiusLife; ///< How long a blast radius is visible
/* Graphics used for the weapon */
iIMDShape* pMountGraphic; ///< The turret mount to use
iIMDShape* pMuzzleGraphic; ///< The muzzle flash
iIMDShape* pInFlightGraphic; ///< The ammo in flight
iIMDShape* pTargetHitGraphic; ///< The ammo hitting a target
iIMDShape* pTargetMissGraphic; ///< The ammo missing a target
iIMDShape* pWaterHitGraphic; ///< The ammo hitting water
iIMDShape* pTrailGraphic; ///< The trail used for in flight
/* Audio */
SDWORD iAudioFireID;
SDWORD iAudioImpactID;
} WEAPON_STATS;
/************************************************************************************ /************************************************************************************
* Additional stats tables * Additional stats tables
************************************************************************************/ ************************************************************************************/

View File

@ -156,7 +156,7 @@ typedef struct _structure_stats
building*/ building*/
UDWORD numWeaps; /*Number of weapons for default */ UDWORD numWeaps; /*Number of weapons for default */
struct _weapon_stats *psWeapStat[STRUCT_MAXWEAPS]; struct WEAPON_STATS *psWeapStat[STRUCT_MAXWEAPS];
UDWORD numFuncs; /*Number of functions for default*/ UDWORD numFuncs; /*Number of functions for default*/
SDWORD defaultFunc; /*The default function*/ SDWORD defaultFunc; /*The default function*/