Don't store land unit stats in struct lndstr, part 1

New lnd_att(), lnd_def(), lnd_vul(), lnd_spd(), lnd_vis(), lnd_frg(),
lnd_acc(), lnd_dam(), lnd_aaf() replace the struct lndstr members with
the same names.

Make land unit selectors att, def, vul, spd, vis, frg, acc, dam, aaf
virtual.
This commit is contained in:
Markus Armbruster 2008-03-04 21:20:23 +01:00
parent f86d726406
commit cdf1bcfa22
13 changed files with 185 additions and 68 deletions

View file

@ -79,18 +79,9 @@ struct lndstr {
short lnd_land; /* pointer to transporting unit */
unsigned char lnd_nland;
short lnd_access; /* Last tick mob was updated (MOB_ACCESS) */
float lnd_att; /* attack multiplier */
float lnd_def; /* defense multiplier */
int lnd_vul; /* vulnerability (0-100) */
int lnd_spd; /* speed */
int lnd_vis; /* visibility */
int lnd_spy; /* Seeing distance */
int lnd_rad; /* reaction radius */
int lnd_frg; /* firing range */
int lnd_acc; /* firing accuracy */
int lnd_dam; /* # of guns firing */
int lnd_ammo; /* firing ammu used per shot */
int lnd_aaf; /* aa fire */
unsigned char lnd_fuelc; /* fuel capacity */
unsigned char lnd_fuelu; /* fuel used per 10 mob */
unsigned char lnd_maxlight; /* maximum number of xlight planes */
@ -166,6 +157,15 @@ extern int l_frg(struct lchrstr *, int);
extern int l_acc(struct lchrstr *, int);
extern int l_dam(struct lchrstr *, int);
extern int l_aaf(struct lchrstr *, int);
extern float lnd_att(struct lndstr *);
extern float lnd_def(struct lndstr *);
extern int lnd_vul(struct lndstr *);
extern int lnd_spd(struct lndstr *);
extern int lnd_vis(struct lndstr *);
extern int lnd_frg(struct lndstr *);
extern int lnd_acc(struct lndstr *);
extern int lnd_dam(struct lndstr *);
extern int lnd_aaf(struct lndstr *);
extern int lnd_fire(struct lndstr *);
extern double lnd_fire_range(struct lndstr *);