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
|
@ -163,16 +163,6 @@ struct mchrstr {
|
|||
|
||||
extern struct mchrstr mchr[SHP_TYPE_MAX + 2];
|
||||
|
||||
#define SHP_DEF(b, t) (t ? (b * (logx(t, 40.0) < 1.0 ? 1.0 : \
|
||||
logx(t, 40.0))) : b)
|
||||
#define SHP_SPD(b, t) (t ? (b * (logx(t, 35.0) < 1.0 ? 1.0 : \
|
||||
logx(t, 35.0))) : b)
|
||||
#define SHP_VIS(b, t) (b * (1 - (sqrt(t) / 50)))
|
||||
#define SHP_RNG(b, t) (t ? (b * (logx(t, 35.0) < 1.0 ? 1.0 : \
|
||||
logx(t, 35.0))) : b)
|
||||
#define SHP_FIR(b, t) (t ? (b * (logx(t, 60.0) < 1.0 ? 1.0 : \
|
||||
logx(t, 60.0))) : b)
|
||||
|
||||
/* Work required for building 100% */
|
||||
#define SHP_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
|
||||
|
||||
|
@ -187,4 +177,10 @@ enum {
|
|||
SHP_TORP_SHELLS = 3 /* number of shells used by a torpedo */
|
||||
};
|
||||
|
||||
extern int m_armor(struct mchrstr *, int);
|
||||
extern int m_speed(struct mchrstr *, int);
|
||||
extern int m_visib(struct mchrstr *, int);
|
||||
extern int m_frnge(struct mchrstr *, int);
|
||||
extern int m_glim(struct mchrstr *, int);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue