* #include droiddef.h in cmddroiddef.h as we use some of its contents there

* Don't use tabs for lining things out in columns (use spaces instead, tabs are for indentation only)
 * Make every comment describing a structure field or enum-item a Doxygen comment


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3604 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-01-30 21:09:55 +00:00
parent 8e7e72ef36
commit 0185827de0
3 changed files with 105 additions and 108 deletions

View File

@ -25,21 +25,22 @@
#define __INCLUDED_CMDDROIDDEF_H__
#include "statsdef.h"
#include "droiddef.h"
// the maximum number of command droids per side
#define MAX_CMDDROIDS 5
typedef struct _command_droid
{
COMPONENT_STATS; // define the command droid as a COMPONENT
// so it fits into the design screen
// define the command droid as a COMPONENT so it fits into the design screen
COMPONENT_STATS;
UDWORD died;
SWORD aggression;
SWORD survival;
SWORD nWeapStat;
UWORD kills;
struct _droid *psDroid;
UDWORD died;
SWORD aggression;
SWORD survival;
SWORD nWeapStat;
UWORD kills;
DROID* psDroid;
} COMMAND_DROID;
#endif // __INCLUDED_CMDDROIDDEF_H__

View File

@ -52,29 +52,29 @@
// to update the DroidSelectionWeights lookup table in Display.c
typedef enum _droid_type
{
DROID_WEAPON, // Weapon droid
DROID_SENSOR, // Sensor droid
DROID_ECM, // ECM droid
DROID_CONSTRUCT, // Constructor droid
DROID_PERSON, // person
DROID_CYBORG, // cyborg-type thang
DROID_TRANSPORTER, // guess what this is!
DROID_COMMAND, // Command droid
DROID_REPAIR, // Repair droid
DROID_DEFAULT, // Default droid
DROID_CYBORG_CONSTRUCT, //cyborg constructor droid - new for update 28/5/99
DROID_CYBORG_REPAIR, //cyborg repair droid - new for update 28/5/99
DROID_CYBORG_SUPER, //cyborg repair droid - new for update 7/6/99
DROID_ANY, // Any droid, Only used as a parameter for intGotoNextDroidType(droidtype).
DROID_WEAPON, ///< Weapon droid
DROID_SENSOR, ///< Sensor droid
DROID_ECM, ///< ECM droid
DROID_CONSTRUCT, ///< Constructor droid
DROID_PERSON, ///< person
DROID_CYBORG, ///< cyborg-type thang
DROID_TRANSPORTER, ///< guess what this is!
DROID_COMMAND, ///< Command droid
DROID_REPAIR, ///< Repair droid
DROID_DEFAULT, ///< Default droid
DROID_CYBORG_CONSTRUCT, ///< cyborg constructor droid - new for update 28/5/99
DROID_CYBORG_REPAIR, ///< cyborg repair droid - new for update 28/5/99
DROID_CYBORG_SUPER, ///< cyborg repair droid - new for update 7/6/99
DROID_ANY, ///< Any droid. Only used as a parameter for intGotoNextDroidType(DROID_TYPE).
} DROID_TYPE;
#define MAX_STATS (255)
typedef struct _component
{
// UDWORD nStat;
UBYTE nStat; // Allowing a maximum of 255 stats per file
//UDWORD hitPoints; NOT USED?
// UDWORD nStat;
UBYTE nStat; ///< Allowing a maximum of 255 stats per file
// UDWORD hitPoints; // NOT USED?
/* Possibly a set of function pointers here to be called when
* damage is done to a component, power is low ...
@ -86,9 +86,9 @@ typedef struct _component
typedef struct _order_list
{
SDWORD order;
void *psOrderTarget; //this needs to cope with objects and stats
UWORD x, y, x2, y2; //line build requires two sets of coords
SDWORD order;
void* psOrderTarget; ///< this needs to cope with objects and stats
UWORD x, y, x2, y2; ///< line build requires two sets of coords
} ORDER_LIST;
// maximum number of characters in a droid name
@ -99,132 +99,127 @@ typedef struct _droid_template
// On the PC the pName entry in STATS_BASE is redundant and can be assumed to be NULL,
STATS_BASE; /* basic stats */
// on the PC this contains the full editable ascii name of the template
char aName[DROID_MAXNAME];
/// on the PC this contains the full editable UTF-8 encoded name of the template
char aName[DROID_MAXNAME];
UBYTE NameVersion; // Version number used in name (e.g. Viper Mk "I" would be stored as 1 - Viper Mk "X" as 10)
UBYTE NameVersion; //< Version number used in name (e.g. Viper Mk "I" would be stored as 1 - Viper Mk "X" as 10)
/* The droid components. This array is indexed by COMPONENT_TYPE
* so the ECM would be accessed using asParts[COMP_ECM].
* COMP_BRAIN is an index into the asCommandDroids array NOT asBrainStats
*/
SDWORD asParts[DROID_MAXCOMP];
SDWORD asParts[DROID_MAXCOMP];
UDWORD buildPoints; ///< total build points required to manufacture the droid
UDWORD powerPoints; ///< total power points required to build/maintain the droid
UDWORD storeCount; ///< used to load in weaps and progs
UDWORD buildPoints; /*total build points required to manufacture
the droid*/
UDWORD powerPoints; /*total power points required to build/maintain
the droid */
UDWORD storeCount; /*used to load in weaps and progs*/
/* The weapon systems */
UDWORD numWeaps; /* Number of weapons*/
UDWORD asWeaps[DROID_MAXWEAPS]; /* weapon indices */
DROID_TYPE droidType; // The type of droid
UDWORD multiPlayerID; // multiplayer unique descriptor(cant use id's for templates)
// used for save games as well now - AB 29/10/98
struct _droid_template *psNext; /* Pointer to next template*/
UDWORD numWeaps; ///< Number of weapons
UDWORD asWeaps[DROID_MAXWEAPS]; ///< weapon indices
DROID_TYPE droidType; ///< The type of droid
UDWORD multiPlayerID; ///< multiplayer unique descriptor(cant use id's for templates). Used for save games as well now - AB 29/10/98
struct _droid_template* psNext; ///< Pointer to next template
} DROID_TEMPLATE;
typedef struct _droid
{
/* The common structure elements for all objects */
BASE_ELEMENTS(struct _droid);
//Ascii name of the droid - This is generated from the droid template and can not be changed by the game player after creation.
char aName[DROID_MAXNAME];
/// UTF-8 name of the droid. This is generated from the droid template and cannot be changed by the game player after creation.
char aName[DROID_MAXNAME];
DROID_TYPE droidType; // The type of droid
DROID_TYPE droidType; ///< The type of droid
/* Possibly a set of function pointers here to be called when
* damage is done to a component, power is low ...
*/
// DROID_TEMPLATE *pTemplate; //defines the droids components
// DROID_TEMPLATE* pTemplate; ///< defines the droids components
/* Holds the specifics for the component parts - allows damage
* per part to be calculated. Indexed by COMPONENT_TYPE.
* Weapons need to be dealt with separately.
* COMP_BRAIN is an index into the asCommandDroids array NOT asBrainStats
/** Holds the specifics for the component parts - allows damage
* per part to be calculated. Indexed by COMPONENT_TYPE.
* Weapons need to be dealt with separately.
* COMP_BRAIN is an index into the asCommandDroids array NOT asBrainStats
*/
COMPONENT asBits[DROID_MAXCOMP];
COMPONENT asBits[DROID_MAXCOMP];
/* The other droid data. These are all derived from the components
* but stored here for easy access
*/
UDWORD weight;
UDWORD baseSpeed; //the base speed dependant on propulsion type
UDWORD sensorRange;
UDWORD sensorPower;
UDWORD ECMMod;
UDWORD originalBody; //the original body points
UDWORD body; // the current body points
float experience;
UWORD turretRotation[DROID_MAXWEAPS]; // Watermelon:turretRotation info for multiple turrents :)
UWORD turretPitch[DROID_MAXWEAPS]; //* Watermelon:turrentPitch info for multiple turrents :)
UBYTE NameVersion; // Version number used for generating on-the-fly names (e.g. Viper Mk "I" would be stored as 1 - Viper Mk "X" as 10) - copied from droid template
UDWORD weight;
UDWORD baseSpeed; ///< the base speed dependant on propulsion type
UDWORD sensorRange;
UDWORD sensorPower;
UDWORD ECMMod;
UDWORD originalBody; ///< the original body points
UDWORD body; ///< the current body points
float experience;
UWORD turretRotation[DROID_MAXWEAPS]; ///< Watermelon:turretRotation info for multiple turrents :)
UWORD turretPitch[DROID_MAXWEAPS]; ///< Watermelon:turrentPitch info for multiple turrents :)
UBYTE NameVersion; ///< Version number used for generating on-the-fly names (e.g. Viper Mk "I" would be stored as 1 - Viper Mk "X" as 10) - copied from droid template
SWORD resistance; //used in Electronic Warfare
SWORD resistance; ///< used in Electronic Warfare
UDWORD numWeaps; // Watermelon:Re-enabled this,I need this one in droid.c
WEAPON asWeaps[DROID_MAXWEAPS];
UDWORD numWeaps; ///< Watermelon:Re-enabled this,I need this one in droid.c
WEAPON asWeaps[DROID_MAXWEAPS];
// The group the droid belongs to
struct _droid_group *psGroup;
struct _droid *psGrpNext;
struct _structure *psBaseStruct; //a structure that this droid might be associated with
//for vtols its the rearming pad
struct _droid_group* psGroup;
struct _droid* psGrpNext;
struct _structure* psBaseStruct; ///< a structure that this droid might be associated with. For VTOLs this is the rearming pad
// queued orders
SDWORD listSize;
ORDER_LIST asOrderList[ORDER_LIST_MAX];
SDWORD listSize;
ORDER_LIST asOrderList[ORDER_LIST_MAX];
/* Order data */
SDWORD order;
UWORD orderX, orderY;
UWORD orderX2, orderY2;
SDWORD order;
UWORD orderX, orderY;
UWORD orderX2, orderY2;
UDWORD lastHitWeapon;
UDWORD timeLastHit;
BOOL bTargetted;
UDWORD lastHitWeapon;
UDWORD timeLastHit;
BOOL bTargetted;
BASE_OBJECT *psTarget; // Order target
BASE_STATS *psTarStats; // What to build etc
BASE_OBJECT* psTarget; ///< Order target
BASE_STATS* psTarStats; ///< What to build etc
#ifdef DEBUG
// these are to help tracking down dangling pointers
char targetFunc[MAX_EVENT_NAME_LEN];
int targetLine;
char actionTargetFunc[DROID_MAXWEAPS][MAX_EVENT_NAME_LEN];
int actionTargetLine[DROID_MAXWEAPS];
char baseFunc[MAX_EVENT_NAME_LEN];
int baseLine;
char targetFunc[MAX_EVENT_NAME_LEN];
int targetLine;
char actionTargetFunc[DROID_MAXWEAPS][MAX_EVENT_NAME_LEN];
int actionTargetLine[DROID_MAXWEAPS];
char baseFunc[MAX_EVENT_NAME_LEN];
int baseLine;
#endif
// secondary order data
UDWORD secondaryOrder;
UDWORD secondaryOrder;
UDWORD lastSync; // multiplayer synchronization value.
UDWORD lastSync; ///< multiplayer synchronization value.
/* Action data */
SDWORD action;
UDWORD actionX,actionY;
BASE_OBJECT *psActionTarget[DROID_MAXWEAPS]; // Action target object
UDWORD actionStarted; // Game time action started
UDWORD actionPoints; // number of points done by action since start
//UWORD actionHeight; // height to level the ground to for foundation,
SDWORD action;
UDWORD actionX, actionY;
BASE_OBJECT* psActionTarget[DROID_MAXWEAPS]; ///< Action target object
UDWORD actionStarted; ///< Game time action started
UDWORD actionPoints; ///< number of points done by action since start
// UWORD actionHeight; ///< height to level the ground to for foundation,
// possibly use it for other data as well? Yup! - powerAccrued!
UWORD powerAccrued; // renamed the above variable since this is what its used for now!
UWORD powerAccrued; ///< renamed the above variable since this is what its used for now!
UBYTE illumination;
UBYTE updateFlags;
UBYTE illumination;
UBYTE updateFlags;
/* Movement control data */
MOVE_CONTROL sMove;
// void *lastTile;
MOVE_CONTROL sMove;
// void *lastTile;
/* anim data */
ANIM_OBJECT *psCurAnim;
SDWORD iAudioID;
ANIM_OBJECT *psCurAnim;
SDWORD iAudioID;
} DROID;
#endif // __INCLUDED_DROIDDEF_H__

View File

@ -20,16 +20,17 @@
/** \file
* Definitions for the weapons.
*/
#ifndef __INCLUDED_WEAPONDEF_H__
#define __INCLUDED_WEAPONDEF_H__
typedef struct _weapon
{
UDWORD nStat; // The stats for the weapon type
UDWORD hitPoints;
UDWORD ammo;
UDWORD lastFired; // When the weapon last fired
UDWORD recoilValue;
UDWORD nStat; ///< The stats for the weapon type
UDWORD hitPoints;
UDWORD ammo;
UDWORD lastFired; ///< When the weapon last fired
UDWORD recoilValue;
} WEAPON;
#endif // __INCLUDED_WEAPONDEF_H__