config: Make work to build units independently configurable
The work required for build and repairs is traditionally a function of build materials: 20 + lcm + 2*hcm for ships, planes and land units, and (lcm + 2*hcm + oil + rad)/5 for nukes. Make it independently configurable instead, via new ship-chr, plane-chr, land-chr, nuke-chr selector bwork, backed by new struct mchrstr member m_bwork, struct plchrstr member pl_bwork, struct lchrstr member l_bwork, struct nchrstr member n_bwork. Keep the required work exactly the same for now. Clients that compute work from materials need to be updated. Easy, since build work is now exposed in xdump. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
14af586b57
commit
68c7c08a58
19 changed files with 319 additions and 351 deletions
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Steve McClure, 1998-2000
|
||||
* Markus Armbruster, 2004-2015
|
||||
* Markus Armbruster, 2004-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -211,23 +211,21 @@ build_ship(struct sctstr *sp, int type, int tlev)
|
|||
{
|
||||
struct mchrstr *mp = &mchr[type];
|
||||
short mat[I_MAX+1];
|
||||
int work;
|
||||
struct shpstr ship;
|
||||
|
||||
memset(mat, 0, sizeof(mat));
|
||||
mat[I_LCM] = mp->m_lcm;
|
||||
mat[I_HCM] = mp->m_hcm;
|
||||
work = SHP_BLD_WORK(mp->m_lcm, mp->m_hcm);
|
||||
|
||||
if (sp->sct_type != SCT_HARBR && !player->god) {
|
||||
pr("Ships must be built in harbours.\n");
|
||||
return 0;
|
||||
}
|
||||
if (!sector_can_build(sp, mat, work, SHIP_MINEFF, mp->m_name))
|
||||
if (!sector_can_build(sp, mat, mp->m_bwork, SHIP_MINEFF, mp->m_name))
|
||||
return 0;
|
||||
if (!build_can_afford(mp->m_cost, SHIP_MINEFF, mp->m_name))
|
||||
return 0;
|
||||
build_charge(sp, mat, work, mp->m_cost, SHIP_MINEFF);
|
||||
build_charge(sp, mat, mp->m_bwork, mp->m_cost, SHIP_MINEFF);
|
||||
|
||||
ef_blank(EF_SHIP, pick_unused_unit_uid(EF_SHIP), &ship);
|
||||
ship.shp_x = sp->sct_x;
|
||||
|
@ -264,23 +262,21 @@ build_land(struct sctstr *sp, int type, int tlev)
|
|||
{
|
||||
struct lchrstr *lp = &lchr[type];
|
||||
short mat[I_MAX+1];
|
||||
int work;
|
||||
struct lndstr land;
|
||||
|
||||
memset(mat, 0, sizeof(mat));
|
||||
mat[I_LCM] = lp->l_lcm;
|
||||
mat[I_HCM] = lp->l_hcm;
|
||||
work = LND_BLD_WORK(lp->l_lcm, lp->l_hcm);
|
||||
|
||||
if (sp->sct_type != SCT_HEADQ && !player->god) {
|
||||
pr("Land units must be built in headquarters.\n");
|
||||
return 0;
|
||||
}
|
||||
if (!sector_can_build(sp, mat, work, LAND_MINEFF, lp->l_name))
|
||||
if (!sector_can_build(sp, mat, lp->l_bwork, LAND_MINEFF, lp->l_name))
|
||||
return 0;
|
||||
if (!build_can_afford(lp->l_cost, LAND_MINEFF, lp->l_name))
|
||||
return 0;
|
||||
build_charge(sp, mat, work, lp->l_cost, LAND_MINEFF);
|
||||
build_charge(sp, mat, lp->l_bwork, lp->l_cost, LAND_MINEFF);
|
||||
|
||||
ef_blank(EF_LAND, pick_unused_unit_uid(EF_LAND), &land);
|
||||
land.lnd_x = sp->sct_x;
|
||||
|
@ -316,7 +312,6 @@ build_nuke(struct sctstr *sp, int type, int tlev)
|
|||
{
|
||||
struct nchrstr *np = &nchr[type];
|
||||
short mat[I_MAX+1];
|
||||
int work;
|
||||
struct nukstr nuke;
|
||||
|
||||
if (sp->sct_type != SCT_NUKE && !player->god) {
|
||||
|
@ -333,13 +328,12 @@ build_nuke(struct sctstr *sp, int type, int tlev)
|
|||
mat[I_HCM] = np->n_hcm;
|
||||
mat[I_OIL] = np->n_oil;
|
||||
mat[I_RAD] = np->n_rad;
|
||||
work = NUK_BLD_WORK(np->n_lcm, np->n_hcm, np->n_oil, np->n_rad);
|
||||
|
||||
if (!sector_can_build(sp, mat, work, 100, np->n_name))
|
||||
if (!sector_can_build(sp, mat, np->n_bwork, 100, np->n_name))
|
||||
return 0;
|
||||
if (!build_can_afford(np->n_cost, 100, np->n_name))
|
||||
return 0;
|
||||
build_charge(sp, mat, work, np->n_cost, 100);
|
||||
build_charge(sp, mat, np->n_bwork, np->n_cost, 100);
|
||||
|
||||
ef_blank(EF_NUKE, pick_unused_unit_uid(EF_NUKE), &nuke);
|
||||
nuke.nuk_x = sp->sct_x;
|
||||
|
@ -362,24 +356,22 @@ build_plane(struct sctstr *sp, int type, int tlev)
|
|||
{
|
||||
struct plchrstr *pp = &plchr[type];
|
||||
short mat[I_MAX+1];
|
||||
int work;
|
||||
struct plnstr plane;
|
||||
|
||||
memset(mat, 0, sizeof(mat));
|
||||
mat[I_MILIT] = pp->pl_crew;
|
||||
mat[I_LCM] = pp->pl_lcm;
|
||||
mat[I_HCM] = pp->pl_hcm;
|
||||
work = PLN_BLD_WORK(pp->pl_lcm, pp->pl_hcm);
|
||||
|
||||
if (sp->sct_type != SCT_AIRPT && !player->god) {
|
||||
pr("Planes must be built in airports.\n");
|
||||
return 0;
|
||||
}
|
||||
if (!sector_can_build(sp, mat, work, PLANE_MINEFF, pp->pl_name))
|
||||
if (!sector_can_build(sp, mat, pp->pl_bwork, PLANE_MINEFF, pp->pl_name))
|
||||
return 0;
|
||||
if (!build_can_afford(pp->pl_cost, PLANE_MINEFF, pp->pl_name))
|
||||
return 0;
|
||||
build_charge(sp, mat, work, pp->pl_cost, PLANE_MINEFF);
|
||||
build_charge(sp, mat, pp->pl_bwork, pp->pl_cost, PLANE_MINEFF);
|
||||
|
||||
ef_blank(EF_PLANE, pick_unused_unit_uid(EF_PLANE), &plane);
|
||||
plane.pln_x = sp->sct_x;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* Known contributors to this file:
|
||||
* Dave Pare, 1986
|
||||
* Steve McClure, 1996-2000
|
||||
* Markus Armbruster, 2004-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -106,7 +107,7 @@ lupgr(void)
|
|||
}
|
||||
n++;
|
||||
lp = &lchr[(int)land.lnd_type];
|
||||
avail = (LND_BLD_WORK(lp->l_lcm, lp->l_hcm) * UPGR_COST + 99) / 100;
|
||||
avail = (lp->l_bwork * UPGR_COST + 99) / 100;
|
||||
if (sect.sct_avail < avail) {
|
||||
pr("Not enough available work in %s to upgrade a %s\n",
|
||||
xyas(sect.sct_x, sect.sct_y, player->cnum), lp->l_name);
|
||||
|
@ -186,7 +187,7 @@ supgr(void)
|
|||
}
|
||||
n++;
|
||||
mp = &mchr[(int)ship.shp_type];
|
||||
avail = (SHP_BLD_WORK(mp->m_lcm, mp->m_hcm) * UPGR_COST + 99) / 100;
|
||||
avail = (mp->m_bwork * UPGR_COST + 99) / 100;
|
||||
if (sect.sct_avail < avail) {
|
||||
pr("Not enough available work in %s to upgrade a %s\n",
|
||||
xyas(sect.sct_x, sect.sct_y, player->cnum), mp->m_name);
|
||||
|
@ -271,7 +272,7 @@ pupgr(void)
|
|||
continue;
|
||||
n++;
|
||||
pp = &plchr[(int)plane.pln_type];
|
||||
avail = (PLN_BLD_WORK(pp->pl_lcm, pp->pl_hcm) * UPGR_COST + 99) / 100;
|
||||
avail = (pp->pl_bwork * UPGR_COST + 99) / 100;
|
||||
if (sect.sct_avail < avail) {
|
||||
pr("Not enough available work in %s to upgrade a %s\n",
|
||||
xyas(sect.sct_x, sect.sct_y, player->cnum), pp->pl_name);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* nsc.c: Empire selection global structures
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2004-2014
|
||||
* Markus Armbruster, 2004-2016
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -271,6 +271,7 @@ struct castr mchr_ca[] = {
|
|||
{"glim", fldoff(m_glim), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"nxlight", fldoff(m_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"nchoppers", fldoff(m_nchoppers), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"bwork", fldoff(m_bwork), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"tech", fldoff(m_tech), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(m_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"flags", fldoff(m_flags), NSC_INT, 0, NULL,
|
||||
|
@ -306,8 +307,9 @@ struct castr plchr_ca[] = {
|
|||
{"name", fldoff(pl_name), NSC_STRING, 0, NULL, EF_BAD, 0},
|
||||
{"l_build", fldoff(pl_lcm), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"h_build", fldoff(pl_hcm), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(pl_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"bwork", fldoff(pl_bwork), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"tech", fldoff(pl_tech), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(pl_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"acc", fldoff(pl_acc), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"load", fldoff(pl_load), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"att", fldoff(pl_att), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
|
@ -367,6 +369,7 @@ struct castr lchr_ca[] = {
|
|||
NSC_IVEC(fldoff(l_item), ""),
|
||||
{"l_build", fldoff(l_lcm), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"h_build", fldoff(l_hcm), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"bwork", fldoff(l_bwork), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"tech", fldoff(l_tech), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(l_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"att", fldoff(l_att), NSC_FLOAT, 0, NULL, EF_BAD, 0},
|
||||
|
@ -408,8 +411,9 @@ struct castr nchr_ca[] = {
|
|||
{"r_build", fldoff(n_rad), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"blast", fldoff(n_blast), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"dam", fldoff(n_dam), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(n_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"bwork", fldoff(n_bwork), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"tech", fldoff(n_tech), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(n_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"weight", fldoff(n_weight), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"flags", fldoff(n_flags), NSC_INT, 0, NULL,
|
||||
EF_NUKE_CHR_FLAGS, NSC_BITS},
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# land.config: Land unit characteristics
|
||||
#
|
||||
# Known contributors to this file:
|
||||
# Markus Armbruster, 2006-2011
|
||||
# Markus Armbruster, 2006-2016
|
||||
#
|
||||
# Derived from land.c; known contributors:
|
||||
# Thomas Ruschak, 1992
|
||||
|
@ -43,29 +43,29 @@
|
|||
# econfig key custom_tables.
|
||||
|
||||
config land-chr
|
||||
type name l_b h_b tech cost ...
|
||||
0 "cav cavalry" 10 5 30 500
|
||||
1 "linf light infantry" 8 4 40 300
|
||||
2 "inf infantry" 10 5 50 500
|
||||
3 "mtif motor inf" 15 10 190 400
|
||||
4 "mif mech inf" 15 10 190 800
|
||||
5 "mar marines" 10 5 140 1000
|
||||
6 "sup supply" 10 5 50 500
|
||||
7 "tra train" 100 50 40 3500
|
||||
8 "spy infiltrator" 10 5 40 750
|
||||
9 "com commando" 10 5 55 1500
|
||||
10 "aau aa unit" 20 10 70 500
|
||||
11 "art artillery" 20 10 35 800
|
||||
12 "lat lt artillery" 20 10 70 500
|
||||
13 "hat hvy artillery" 40 20 100 800
|
||||
14 "mat mech artillery" 20 10 200 1000
|
||||
15 "eng engineer" 10 5 130 3000
|
||||
16 "meng mech engineer" 10 5 260 4500
|
||||
17 "lar lt armor" 10 5 150 600
|
||||
18 "har hvy armor" 20 10 120 500
|
||||
19 "arm armor" 20 10 170 1000
|
||||
20 "sec security" 10 5 170 600
|
||||
21 "rad radar unit" 10 5 270 1000
|
||||
type name l_b h_b bwork tech cost ...
|
||||
0 "cav cavalry" 10 5 40 30 500
|
||||
1 "linf light infantry" 8 4 36 40 300
|
||||
2 "inf infantry" 10 5 40 50 500
|
||||
3 "mtif motor inf" 15 10 55 190 400
|
||||
4 "mif mech inf" 15 10 55 190 800
|
||||
5 "mar marines" 10 5 40 140 1000
|
||||
6 "sup supply" 10 5 40 50 500
|
||||
7 "tra train" 100 50 220 40 3500
|
||||
8 "spy infiltrator" 10 5 40 40 750
|
||||
9 "com commando" 10 5 40 55 1500
|
||||
10 "aau aa unit" 20 10 60 70 500
|
||||
11 "art artillery" 20 10 60 35 800
|
||||
12 "lat lt artillery" 20 10 60 70 500
|
||||
13 "hat hvy artillery" 40 20 100 100 800
|
||||
14 "mat mech artillery" 20 10 60 200 1000
|
||||
15 "eng engineer" 10 5 40 130 3000
|
||||
16 "meng mech engineer" 10 5 40 260 4500
|
||||
17 "lar lt armor" 10 5 40 150 600
|
||||
18 "har hvy armor" 20 10 60 120 500
|
||||
19 "arm armor" 20 10 60 170 1000
|
||||
20 "sec security" 10 5 40 170 600
|
||||
21 "rad radar unit" 10 5 40 270 1000
|
||||
/config
|
||||
|
||||
config land-chr
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# nuke.c: Nuke characteristics
|
||||
#
|
||||
# Known contributors to this file:
|
||||
# Markus Armbruster, 2006-2011
|
||||
# Markus Armbruster, 2006-2016
|
||||
#
|
||||
# Derived from nuke.c.
|
||||
#
|
||||
|
@ -40,18 +40,18 @@
|
|||
# econfig key custom_tables.
|
||||
|
||||
config nuke-chr
|
||||
type name l_b h_b o_b r_b bla dam cost tech wei flags
|
||||
0 "10kt fission" 50 50 25 70 3 70 10000 280 4 ()
|
||||
1 "15kt fission" 50 50 25 80 3 90 15000 290 5 ()
|
||||
2 "50kt fission" 60 60 30 90 3 100 25000 300 6 ()
|
||||
3 "100kt fission" 75 75 40 120 4 125 30000 310 8 ()
|
||||
4 "5kt fusion" 15 15 15 30 2 80 12500 315 1 ()
|
||||
5 "75kt fusion" 40 40 35 50 3 90 20000 320 3 ()
|
||||
6 "250kt fusion" 50 50 45 60 4 110 25000 330 4 ()
|
||||
7 "500kt fusion" 60 60 50 80 5 120 35000 340 5 ()
|
||||
8 "1mt fusion" 75 75 50 110 6 150 40000 350 5 ()
|
||||
9 "60kt neutron" 60 60 30 100 3 30 30000 355 2 (neutron)
|
||||
10 "3mt fusion" 100 100 75 130 7 170 45000 360 6 ()
|
||||
11 "5mt fusion" 120 120 100 150 8 190 50000 370 8 ()
|
||||
12 "120kt neutron" 75 75 40 120 5 50 36000 375 3 (neutron)
|
||||
type name l_b h_b o_b r_b bwork bla dam cost tech wei flags
|
||||
0 "10kt fission" 50 50 25 70 49 3 70 10000 280 4 ()
|
||||
1 "15kt fission" 50 50 25 80 51 3 90 15000 290 5 ()
|
||||
2 "50kt fission" 60 60 30 90 60 3 100 25000 300 6 ()
|
||||
3 "100kt fission" 75 75 40 120 77 4 125 30000 310 8 ()
|
||||
4 "5kt fusion" 15 15 15 30 18 2 80 12500 315 1 ()
|
||||
5 "75kt fusion" 40 40 35 50 41 3 90 20000 320 3 ()
|
||||
6 "250kt fusion" 50 50 45 60 51 4 110 25000 330 4 ()
|
||||
7 "500kt fusion" 60 60 50 80 62 5 120 35000 340 5 ()
|
||||
8 "1mt fusion" 75 75 50 110 77 6 150 40000 350 5 ()
|
||||
9 "60kt neutron" 60 60 30 100 62 3 30 30000 355 2 (neutron)
|
||||
10 "3mt fusion" 100 100 75 130 101 7 170 45000 360 6 ()
|
||||
11 "5mt fusion" 120 120 100 150 122 8 190 50000 370 8 ()
|
||||
12 "120kt neutron" 75 75 40 120 77 5 50 36000 375 3 (neutron)
|
||||
/config
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# plane.config: Plane characteristics
|
||||
#
|
||||
# Known contributors to this file:
|
||||
# Markus Armbruster, 2006-2011
|
||||
# Markus Armbruster, 2006-2016
|
||||
#
|
||||
# Derived from plane.c; known contributors:
|
||||
# Dave Pare, 1986
|
||||
|
@ -45,42 +45,42 @@
|
|||
# econfig key custom_tables.
|
||||
|
||||
config plane-chr
|
||||
type name l_b h_b cre tech cost ...
|
||||
0 "f1 Sopwith Camel" 8 2 1 50 400
|
||||
1 "f2 P-51 Mustang" 8 2 1 80 400
|
||||
2 "jf1 F-4 Phantom" 12 4 2 125 1000
|
||||
3 "jf2 AV-8B Harrier" 12 4 2 195 1400
|
||||
4 "sf F-117A Nighthawk" 15 5 2 325 3000
|
||||
5 "es P-38 Lightning" 9 3 1 90 700
|
||||
6 "jes F-14E jet escort" 14 8 2 160 1400
|
||||
7 "lb TBD-1 Devastator" 10 3 1 60 550
|
||||
8 "jl A-6 Intruder" 14 4 2 130 1000
|
||||
9 "mb medium bomber" 14 5 3 80 1000
|
||||
10 "jfb FB-111 Aardvark f/b" 20 10 5 140 1800
|
||||
11 "hb B-26B Marauder" 20 6 2 90 1100
|
||||
12 "jhb B-52 Strato-Fortress" 26 13 5 150 3200
|
||||
13 "sb B-2 stealth bomber" 15 5 2 325 4000
|
||||
14 "as anti-sub plane" 10 3 2 100 550
|
||||
15 "np naval plane" 20 10 4 135 1800
|
||||
16 "nc AH-1 Cobra" 8 2 2 160 800
|
||||
17 "ac AH-64 Apache" 8 2 2 200 800
|
||||
18 "tc transport chopper" 8 2 2 135 800
|
||||
19 "tr C-56 Lodestar" 14 5 3 85 1000
|
||||
20 "jt C-141 Starlifter" 18 5 3 160 1500
|
||||
21 "zep Zeppelin" 6 2 3 70 1000
|
||||
22 "re recon" 12 4 2 130 800
|
||||
23 "sp E2-C Hawkeye" 15 5 2 190 2000
|
||||
24 "lst landsat" 20 20 0 245 2000
|
||||
25 "ss KH-7 spysat" 20 20 0 305 4000
|
||||
26 "mi Harpoon" 8 2 0 160 300
|
||||
27 "sam Sea Sparrow" 3 1 0 180 200
|
||||
28 "ssm V2" 15 15 0 145 800
|
||||
29 "srbm Atlas" 20 20 0 200 1000
|
||||
30 "irbm Titan" 20 20 0 260 1500
|
||||
31 "icbm Minuteman" 20 20 0 310 3000
|
||||
32 "slbm Trident" 20 20 0 280 2000
|
||||
33 "asat anti-sat" 20 20 0 305 2000
|
||||
34 "abm Patriot" 16 8 0 270 1500
|
||||
type name l_b h_b cre bwork tech cost ...
|
||||
0 "f1 Sopwith Camel" 8 2 1 32 50 400
|
||||
1 "f2 P-51 Mustang" 8 2 1 32 80 400
|
||||
2 "jf1 F-4 Phantom" 12 4 2 40 125 1000
|
||||
3 "jf2 AV-8B Harrier" 12 4 2 40 195 1400
|
||||
4 "sf F-117A Nighthawk" 15 5 2 45 325 3000
|
||||
5 "es P-38 Lightning" 9 3 1 35 90 700
|
||||
6 "jes F-14E jet escort" 14 8 2 50 160 1400
|
||||
7 "lb TBD-1 Devastator" 10 3 1 36 60 550
|
||||
8 "jl A-6 Intruder" 14 4 2 42 130 1000
|
||||
9 "mb medium bomber" 14 5 3 44 80 1000
|
||||
10 "jfb FB-111 Aardvark f/b" 20 10 5 60 140 1800
|
||||
11 "hb B-26B Marauder" 20 6 2 52 90 1100
|
||||
12 "jhb B-52 Strato-Fortress" 26 13 5 72 150 3200
|
||||
13 "sb B-2 stealth bomber" 15 5 2 45 325 4000
|
||||
14 "as anti-sub plane" 10 3 2 36 100 550
|
||||
15 "np naval plane" 20 10 4 60 135 1800
|
||||
16 "nc AH-1 Cobra" 8 2 2 32 160 800
|
||||
17 "ac AH-64 Apache" 8 2 2 32 200 800
|
||||
18 "tc transport chopper" 8 2 2 32 135 800
|
||||
19 "tr C-56 Lodestar" 14 5 3 44 85 1000
|
||||
20 "jt C-141 Starlifter" 18 5 3 48 160 1500
|
||||
21 "zep Zeppelin" 6 2 3 30 70 1000
|
||||
22 "re recon" 12 4 2 40 130 800
|
||||
23 "sp E2-C Hawkeye" 15 5 2 45 190 2000
|
||||
24 "lst landsat" 20 20 0 80 245 2000
|
||||
25 "ss KH-7 spysat" 20 20 0 80 305 4000
|
||||
26 "mi Harpoon" 8 2 0 32 160 300
|
||||
27 "sam Sea Sparrow" 3 1 0 25 180 200
|
||||
28 "ssm V2" 15 15 0 65 145 800
|
||||
29 "srbm Atlas" 20 20 0 80 200 1000
|
||||
30 "irbm Titan" 20 20 0 80 260 1500
|
||||
31 "icbm Minuteman" 20 20 0 80 310 3000
|
||||
32 "slbm Trident" 20 20 0 80 280 2000
|
||||
33 "asat anti-sat" 20 20 0 80 305 2000
|
||||
34 "abm Patriot" 16 8 0 52 270 1500
|
||||
/config
|
||||
|
||||
config plane-chr
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# ship.config: Ship characteristics
|
||||
#
|
||||
# Known contributors to this file:
|
||||
# Markus Armbruster, 2006-2015
|
||||
# Markus Armbruster, 2006-2016
|
||||
#
|
||||
# Derived from ship.c; known contributors:
|
||||
# Dave Pare, 1986
|
||||
|
@ -45,45 +45,45 @@
|
|||
# econfig key custom_tables.
|
||||
|
||||
config ship-chr
|
||||
type name l_b h_b tech cost ...
|
||||
0 "fb fishing boat" 25 15 0 180
|
||||
1 "ft fishing trawler" 25 15 35 300
|
||||
2 "cs cargo ship" 60 40 20 500
|
||||
3 "os ore ship" 60 40 20 500
|
||||
4 "ss slave ship" 60 40 0 300
|
||||
type name l_b h_b bwork tech cost ...
|
||||
0 "fb fishing boat" 25 15 75 0 180
|
||||
1 "ft fishing trawler" 25 15 75 35 300
|
||||
2 "cs cargo ship" 60 40 160 20 500
|
||||
3 "os ore ship" 60 40 160 20 500
|
||||
4 "ss slave ship" 60 40 160 0 300
|
||||
# Uncomment to enable trade ships
|
||||
# 5 "ts trade ship" 200 100 30 1750
|
||||
6 "frg frigate" 30 30 0 600
|
||||
7 "oe oil exploration boat" 25 15 40 800
|
||||
8 "od oil derrick" 60 60 50 1500
|
||||
9 "pt patrol boat" 20 10 40 300
|
||||
10 "lc light cruiser" 30 40 45 800
|
||||
11 "hc heavy cruiser" 40 50 50 1200
|
||||
12 "tt troop transport" 50 50 10 800
|
||||
13 "bb battleship" 50 70 45 1800
|
||||
14 "bbc battlecruiser" 50 60 75 1500
|
||||
15 "tk tanker" 60 40 35 600
|
||||
16 "ms minesweeper" 25 15 40 400
|
||||
17 "dd destroyer" 30 30 70 600
|
||||
18 "sb submarine" 30 30 60 650
|
||||
19 "sbc cargo submarine" 40 40 150 1200
|
||||
20 "cal light carrier" 50 60 80 2700
|
||||
21 "car aircraft carrier" 60 70 160 4500
|
||||
22 "can nuc carrier" 70 80 305 8000
|
||||
23 "ls landing ship" 60 40 145 1000
|
||||
24 "af asw frigate" 40 30 220 800
|
||||
25 "na nuc attack sub" 30 40 260 1200
|
||||
26 "ad asw destroyer" 40 40 240 1500
|
||||
27 "nm nuc miss sub" 30 40 270 1500
|
||||
28 "msb missile sub" 30 30 230 1200
|
||||
29 "mb missile boat" 20 20 180 500
|
||||
30 "mf missile frigate" 40 30 280 1000
|
||||
31 "mc missile cruiser" 50 50 290 1500
|
||||
32 "aac aa cruiser" 50 60 130 1500
|
||||
33 "agc aegis cruiser" 50 60 265 4000
|
||||
34 "ncr nuc cruiser" 50 50 325 1800
|
||||
35 "nas nuc asw cruiser" 50 50 330 1800
|
||||
36 "nsp nuc supply ship" 60 40 360 1500
|
||||
# 5 "ts trade ship" 200 100 420 30 1750
|
||||
6 "frg frigate" 30 30 110 0 600
|
||||
7 "oe oil exploration boat" 25 15 75 40 800
|
||||
8 "od oil derrick" 60 60 200 50 1500
|
||||
9 "pt patrol boat" 20 10 60 40 300
|
||||
10 "lc light cruiser" 30 40 130 45 800
|
||||
11 "hc heavy cruiser" 40 50 160 50 1200
|
||||
12 "tt troop transport" 50 50 170 10 800
|
||||
13 "bb battleship" 50 70 210 45 1800
|
||||
14 "bbc battlecruiser" 50 60 190 75 1500
|
||||
15 "tk tanker" 60 40 160 35 600
|
||||
16 "ms minesweeper" 25 15 75 40 400
|
||||
17 "dd destroyer" 30 30 110 70 600
|
||||
18 "sb submarine" 30 30 110 60 650
|
||||
19 "sbc cargo submarine" 40 40 140 150 1200
|
||||
20 "cal light carrier" 50 60 190 80 2700
|
||||
21 "car aircraft carrier" 60 70 220 160 4500
|
||||
22 "can nuc carrier" 70 80 250 305 8000
|
||||
23 "ls landing ship" 60 40 160 145 1000
|
||||
24 "af asw frigate" 40 30 120 220 800
|
||||
25 "na nuc attack sub" 30 40 130 260 1200
|
||||
26 "ad asw destroyer" 40 40 140 240 1500
|
||||
27 "nm nuc miss sub" 30 40 130 270 1500
|
||||
28 "msb missile sub" 30 30 110 230 1200
|
||||
29 "mb missile boat" 20 20 80 180 500
|
||||
30 "mf missile frigate" 40 30 120 280 1000
|
||||
31 "mc missile cruiser" 50 50 170 290 1500
|
||||
32 "aac aa cruiser" 50 60 190 130 1500
|
||||
33 "agc aegis cruiser" 50 60 190 265 4000
|
||||
34 "ncr nuc cruiser" 50 50 170 325 1800
|
||||
35 "nas nuc asw cruiser" 50 50 170 330 1800
|
||||
36 "nsp nuc supply ship" 60 40 160 360 1500
|
||||
/config
|
||||
|
||||
config ship-chr
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* Jeff Bailey, 1990
|
||||
* Steve McClure, 1996
|
||||
* Ron Koenderink, 2005-2009
|
||||
* Markus Armbruster, 2006-2015
|
||||
* Markus Armbruster, 2006-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -192,16 +192,14 @@ show_nuke_build(int tlev)
|
|||
int n = make_nchr_index(chridx, tlev);
|
||||
int i;
|
||||
struct nchrstr *np;
|
||||
int avail;
|
||||
|
||||
pr("%13s lcm hcm oil rad avail tech res $\n", "");
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
np = &nchr[chridx[i].type];
|
||||
avail = NUK_BLD_WORK(np->n_lcm, np->n_hcm, np->n_oil, np->n_rad);
|
||||
pr("%-13.13s %3d %3d %4d %4d %5d %4d %3.0f $%6d\n",
|
||||
np->n_name, np->n_lcm, np->n_hcm, np->n_oil,
|
||||
np->n_rad, avail, np->n_tech,
|
||||
np->n_rad, np->n_bwork, np->n_tech,
|
||||
drnuke_const > MIN_DRNUKE_CONST ?
|
||||
ceil(np->n_tech * drnuke_const) : 0.0,
|
||||
np->n_cost);
|
||||
|
@ -243,7 +241,7 @@ show_ship_build(int tlev)
|
|||
mp = &mchr[chridx[i].type];
|
||||
pr("%-25.25s %3d %3d %5d %4d $%d\n",
|
||||
mp->m_name, mp->m_lcm, mp->m_hcm,
|
||||
SHP_BLD_WORK(mp->m_lcm, mp->m_hcm), mp->m_tech, mp->m_cost);
|
||||
mp->m_bwork, mp->m_tech, mp->m_cost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,7 +333,7 @@ show_plane_build(int tlev)
|
|||
pr("%-25.25s %3d %3d %4d %5d %4d $%d\n",
|
||||
pp->pl_name, pp->pl_lcm,
|
||||
pp->pl_hcm, pp->pl_crew,
|
||||
PLN_BLD_WORK(pp->pl_lcm, pp->pl_hcm), pp->pl_tech, pp->pl_cost);
|
||||
pp->pl_bwork, pp->pl_tech, pp->pl_cost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -354,7 +352,7 @@ show_land_build(int tlev)
|
|||
lp->l_name, lp->l_lcm,
|
||||
lp->l_hcm,
|
||||
lp->l_gun,
|
||||
LND_BLD_WORK(lp->l_lcm, lp->l_hcm), lp->l_tech, lp->l_cost);
|
||||
lp->l_bwork, lp->l_tech, lp->l_cost);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* Dave Pare, 1986
|
||||
* Thomas Ruschak, 1992
|
||||
* Steve McClure, 1996
|
||||
* Markus Armbruster, 2006-2011
|
||||
* Markus Armbruster, 2006-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -199,7 +199,6 @@ landrepair(struct lndstr *land, struct natstr *np, struct bp *bp, int etus)
|
|||
struct lchrstr *lp;
|
||||
int build;
|
||||
int avail;
|
||||
int w_p_eff;
|
||||
int mult;
|
||||
int mvec[I_MAX + 1];
|
||||
|
||||
|
@ -223,8 +222,7 @@ landrepair(struct lndstr *land, struct natstr *np, struct bp *bp, int etus)
|
|||
else
|
||||
avail = bp_get_avail(bp, sp) * 100;
|
||||
|
||||
w_p_eff = LND_BLD_WORK(lp->l_lcm, lp->l_hcm);
|
||||
delta = roundavg((double)avail / w_p_eff);
|
||||
delta = roundavg((double)avail / lp->l_bwork);
|
||||
if (delta <= 0)
|
||||
return;
|
||||
if (delta > (int)((float)etus * land_grow_scale))
|
||||
|
@ -240,7 +238,7 @@ landrepair(struct lndstr *land, struct natstr *np, struct bp *bp, int etus)
|
|||
if ((sp->sct_type != SCT_HEADQ) && (sp->sct_type != SCT_FORTR))
|
||||
build /= 3;
|
||||
|
||||
avail -= build * w_p_eff;
|
||||
avail -= build * lp->l_bwork;
|
||||
if (avail < 0)
|
||||
avail = 0;
|
||||
if (!player->simulation)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* Known contributors to this file:
|
||||
* Dave Pare, 1986
|
||||
* Steve McClure, 1998
|
||||
* Markus Armbruster, 2006-2011
|
||||
* Markus Armbruster, 2006-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -131,7 +131,6 @@ planerepair(struct plnstr *pp, struct natstr *np, struct bp *bp, int etus)
|
|||
int delta;
|
||||
int mult;
|
||||
int avail;
|
||||
int w_p_eff;
|
||||
int used;
|
||||
|
||||
carrier = NULL;
|
||||
|
@ -166,8 +165,7 @@ planerepair(struct plnstr *pp, struct natstr *np, struct bp *bp, int etus)
|
|||
if (carrier)
|
||||
avail += etus * carrier->shp_item[I_MILIT] / 2;
|
||||
|
||||
w_p_eff = PLN_BLD_WORK(pcp->pl_lcm, pcp->pl_hcm);
|
||||
delta = roundavg((double)avail / w_p_eff);
|
||||
delta = roundavg((double)avail / pcp->pl_bwork);
|
||||
if (delta <= 0)
|
||||
return;
|
||||
if (delta > (int)((float)etus * plane_grow_scale))
|
||||
|
@ -184,7 +182,7 @@ planerepair(struct plnstr *pp, struct natstr *np, struct bp *bp, int etus)
|
|||
if (carrier)
|
||||
build = delta;
|
||||
|
||||
used = build * w_p_eff;
|
||||
used = build * pcp->pl_bwork;
|
||||
/*
|
||||
* I didn't use roundavg here, because I want to
|
||||
* penalize the player with a large number of planes.
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* Dave Pare, 1986
|
||||
* Steve McClure, 1996
|
||||
* Ron Koenderink, 2004
|
||||
* Markus Armbruster, 2006-2011
|
||||
* Markus Armbruster, 2006-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -247,7 +247,6 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
|||
int build;
|
||||
int wf;
|
||||
int avail;
|
||||
int w_p_eff;
|
||||
int mult;
|
||||
int mvec[I_MAX + 1];
|
||||
|
||||
|
@ -274,8 +273,6 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
|||
avail = wf + bp_get_avail(bp, sp) * 100;
|
||||
}
|
||||
|
||||
w_p_eff = SHP_BLD_WORK(mp->m_lcm, mp->m_hcm);
|
||||
|
||||
if ((sp->sct_off) && (sp->sct_own == ship->shp_own))
|
||||
return;
|
||||
|
||||
|
@ -288,7 +285,7 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
|||
return;
|
||||
}
|
||||
|
||||
delta = roundavg((double)avail / w_p_eff);
|
||||
delta = roundavg((double)avail / mp->m_bwork);
|
||||
if (delta <= 0)
|
||||
return;
|
||||
if (delta > (int)((float)etus * ship_grow_scale))
|
||||
|
@ -304,7 +301,7 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
|||
if (sp->sct_type != SCT_HARBR)
|
||||
build = delta;
|
||||
|
||||
wf -= build * w_p_eff;
|
||||
wf -= build * mp->m_bwork;
|
||||
if (wf < 0) {
|
||||
/*
|
||||
* I didn't use roundavg here, because I want to penalize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue