New unit stat development functions
The macros defining unit stat development in tech are somewhat inconvenient to use. Define more convenient functions, and hide away the macros near the function definitions.
This commit is contained in:
parent
3d0e083aec
commit
0219bf086a
10 changed files with 222 additions and 118 deletions
|
@ -142,32 +142,6 @@ struct lchrstr {
|
|||
#define L_TRAIN bit(11) /* train unit - neato */
|
||||
#define L_HEAVY bit(12) /* heavy unit - can't go on trains */
|
||||
|
||||
#define LND_ATTDEF(b, t) (((b) * (1.0 + ((sqrt((t)) / 100.0) * 4.0))) \
|
||||
> 127 ? 127 : \
|
||||
((b) * (1.0 + ((sqrt((t)) / 100.0) * 4.0))))
|
||||
#define LND_SPD(b, t) ((b * (1.0 + ((sqrt(t) / 100.0) * 2.1))) > 127 \
|
||||
? 127 : (b * (1.0 + ((sqrt(t) / 100.0) * 2.1))))
|
||||
#define LND_VUL(b, t) ((b * (1.0 - ((sqrt(t) / 100.0) * 1.1))) < 0 \
|
||||
? 0 : (b * (1.0 - ((sqrt(t) / 100.0) * 1.1))))
|
||||
#define LND_VIS(b, t) (b)
|
||||
#define LND_SPY(b, t) (b)
|
||||
#define LND_RAD(b, t) (b)
|
||||
#define LND_FRG(b, t) ((t) ? \
|
||||
((b) * (logx((t), 35.0) < 1.0 ? 1.0 : \
|
||||
logx((t), 35.0))) : (b))
|
||||
#define LND_DAM(b, t) ((t) ? \
|
||||
((b) * (logx((t), 60.0) < 1.0 ? 1.0 : \
|
||||
logx((t), 60.0))) : (b))
|
||||
#define LND_ACC(b, t) ((b * (1.0 - ((sqrt(t) / 100.0) * 1.1))) < 0 \
|
||||
? 0 : (b * (1.0 - ((sqrt(t) / 100.0) * 1.1))))
|
||||
#define LND_AMM(b, t) (b)
|
||||
#define LND_AAF(b, t) ((b * (1.0 + ((sqrt(t) / 100.0) * 3.0))) > 127 \
|
||||
? 127 : (b * (1.0 + ((sqrt(t) / 100.0) * 3.0))))
|
||||
#define LND_FC(b, t) (b)
|
||||
#define LND_FU(b, t) (b)
|
||||
#define LND_XPL(b, t) (b)
|
||||
#define LND_MXL(b, t) (b)
|
||||
|
||||
/* Work required for building 100% */
|
||||
#define LND_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
|
||||
|
||||
|
@ -184,6 +158,15 @@ enum {
|
|||
LND_AIROPS_EFF = 50 /* min. efficiency for air ops */
|
||||
};
|
||||
|
||||
extern float l_att(struct lchrstr *, int);
|
||||
extern float l_def(struct lchrstr *, int);
|
||||
extern int l_vul(struct lchrstr *, int);
|
||||
extern int l_spd(struct lchrstr *, int);
|
||||
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);
|
||||
|
||||
/* src/lib/subs/lndsub.c */
|
||||
extern void lnd_sweep(struct emp_qelem *, int, int, natid);
|
||||
extern int lnd_interdict(struct emp_qelem *, coord, coord, natid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue