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:
parent
f86d726406
commit
cdf1bcfa22
13 changed files with 185 additions and 68 deletions
|
@ -146,7 +146,7 @@ multifire(void)
|
|||
if (item.land.lnd_own != player->cnum)
|
||||
continue;
|
||||
|
||||
if (fland.lnd_dam == 0) {
|
||||
if (lchr[fland.lnd_type].l_dam == 0) {
|
||||
pr("Unit %d cannot fire!\n", fland.lnd_uid);
|
||||
continue;
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ multifire(void)
|
|||
fx = fland.lnd_x;
|
||||
fy = fland.lnd_y;
|
||||
|
||||
if (fland.lnd_dam == 0) {
|
||||
if (lchr[fland.lnd_type].l_dam == 0) {
|
||||
pr("Unit %d cannot fire!\n", fland.lnd_uid);
|
||||
continue;
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ multifire(void)
|
|||
continue;
|
||||
}
|
||||
if (target == targ_ship) {
|
||||
if (chance(fland.lnd_acc / 100.0))
|
||||
if (chance(lnd_acc(&fland) / 100.0))
|
||||
dam = ldround(dam / 2.0, 1);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue