Make sector maintenance cost configurable
Replace the fixed $1 per ETU maintenance for capital/city sectors that are at least 60% efficient by a configurable maintenance cost, payable regardless of efficiency. The only change in the default configuration is that inefficient capitals now pay maintenance. Charging sector maintenance regardless of efficiency is consistent with unit maintenance. New struct dchrstr member d_maint and sector-chr selector maint. Make show_sect_build() show it. Change produce_sect() to record maintenance in new slot p_sect[SCT_MAINT] instead of abusing p_sect[SCT_CAPIT]. Replace the "Capital maintenance" line in budget by "Sector maintenance".
This commit is contained in:
parent
1f60baf818
commit
44c36fa7d5
10 changed files with 77 additions and 72 deletions
|
@ -38,7 +38,8 @@
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
||||||
#define SCT_EFFIC (SCT_TYPE_MAX + 1)
|
#define SCT_EFFIC (SCT_TYPE_MAX + 1)
|
||||||
#define SCT_BUDG_MAX SCT_EFFIC
|
#define SCT_MAINT (SCT_TYPE_MAX + 2)
|
||||||
|
#define SCT_BUDG_MAX SCT_MAINT
|
||||||
|
|
||||||
struct bp *bp_alloc(void);
|
struct bp *bp_alloc(void);
|
||||||
void bp_set_from_sect(struct bp *, struct sctstr *);
|
void bp_set_from_sect(struct bp *, struct sctstr *);
|
||||||
|
|
|
@ -116,6 +116,7 @@ struct dchrstr {
|
||||||
int d_build; /* cost multiplier for eff */
|
int d_build; /* cost multiplier for eff */
|
||||||
int d_lcms; /* lcm's needed per point of eff */
|
int d_lcms; /* lcm's needed per point of eff */
|
||||||
int d_hcms; /* hcm's needed per point of eff */
|
int d_hcms; /* hcm's needed per point of eff */
|
||||||
|
int d_maint; /* maintenance cost per ETU */
|
||||||
int d_maxpop; /* maximum population */
|
int d_maxpop; /* maximum population */
|
||||||
char *d_name; /* full name of sector type */
|
char *d_name; /* full name of sector type */
|
||||||
};
|
};
|
||||||
|
|
|
@ -237,11 +237,12 @@ The \*Qshow\*U command can be used to show special things about sector
|
||||||
types. To check out build costs, you do:
|
types. To check out build costs, you do:
|
||||||
.EX show sect build
|
.EX show sect build
|
||||||
.NF
|
.NF
|
||||||
desig build 100% eff
|
desig build 100% eff maint
|
||||||
sector type $ lcm hcm $
|
sector type $ lcm hcm $ $
|
||||||
- wilderness 0 0 0 0
|
- wilderness 0 0 0 0 0
|
||||||
f fortress 0 0 100 500
|
c capital 0 0 0 100 60
|
||||||
any other 0 0 0 100
|
f fortress 0 0 100 500 0
|
||||||
|
any other 0 0 0 100 0
|
||||||
|
|
||||||
Infrastructure building - adding 1 point of efficiency costs:
|
Infrastructure building - adding 1 point of efficiency costs:
|
||||||
type lcms hcms mobility $$$$
|
type lcms hcms mobility $$$$
|
||||||
|
@ -259,6 +260,8 @@ The lcm required to build the sector.
|
||||||
The hcm required to build the sector.
|
The hcm required to build the sector.
|
||||||
.L "build $"
|
.L "build $"
|
||||||
What it costs to build the sector.
|
What it costs to build the sector.
|
||||||
|
.L "maint $"
|
||||||
|
Cost of maintenance per update.
|
||||||
.in
|
.in
|
||||||
.s1
|
.s1
|
||||||
The show command also shows infrastructure build costs.
|
The show command also shows infrastructure build costs.
|
||||||
|
|
|
@ -24,17 +24,16 @@ This document gives a rough order of events during the update.
|
||||||
d) land unit maintenance
|
d) land unit maintenance
|
||||||
pay maintenance, then feed and plague people on board
|
pay maintenance, then feed and plague people on board
|
||||||
e) produce for all sectors
|
e) produce for all sectors
|
||||||
a) if the sector is a cap, it costs $1 per etu since
|
a) people in non-sanctuary sectors eat
|
||||||
the last update
|
|
||||||
b) people in non-sanctuary sectors eat
|
|
||||||
If not enough is available, the excess people will
|
If not enough is available, the excess people will
|
||||||
starve off. No more than 50% of the people
|
starve off. No more than 50% of the people
|
||||||
in a sector can die; the uw's die first, then
|
in a sector can die; the uw's die first, then
|
||||||
the civs, then the mil.
|
the civs, then the mil.
|
||||||
c) if there was starvation, the work percentage is set
|
b) if there was starvation, the work percentage is set
|
||||||
to 0, otherwise the work rate rises by
|
to 0, otherwise the work rate rises by
|
||||||
8+(1-15), max of 100
|
8+(1-15), max of 100
|
||||||
d) population grows and is truncated
|
c) population grows and is truncated
|
||||||
|
d) pay sector maintenance
|
||||||
e) sectors that are stopped are skipped (see info stop)
|
e) sectors that are stopped are skipped (see info stop)
|
||||||
f) first increase eff
|
f) first increase eff
|
||||||
g) then make things
|
g) then make things
|
||||||
|
|
|
@ -22,8 +22,8 @@ Ship maintenance 25 ships 6327
|
||||||
Plane building 9 planes 2508
|
Plane building 9 planes 2508
|
||||||
Plane maintenance 219 planes 8874
|
Plane maintenance 219 planes 8874
|
||||||
Sector building 2398
|
Sector building 2398
|
||||||
|
Sector maintenance 5 sectors 300
|
||||||
Military payroll 7648 mil, 338 res 38247
|
Military payroll 7648 mil, 338 res 38247
|
||||||
City maintenance 5 cities 300
|
|
||||||
Total expenses....................................................147490
|
Total expenses....................................................147490
|
||||||
Income from taxes 320709 civs, 100235 uws +92513
|
Income from taxes 320709 civs, 100235 uws +92513
|
||||||
Income from bars 7986 bars +95832
|
Income from bars 7986 bars +95832
|
||||||
|
|
|
@ -84,7 +84,7 @@ budg(void)
|
||||||
expenses = 0;
|
expenses = 0;
|
||||||
pr("Sector Type\t\t\tProduction\t\t\t Cost\n");
|
pr("Sector Type\t\t\tProduction\t\t\t Cost\n");
|
||||||
for (i = 0; i <= SCT_TYPE_MAX; i++) {
|
for (i = 0; i <= SCT_TYPE_MAX; i++) {
|
||||||
if (!p_sect[i][1] || i == SCT_CAPIT)
|
if (!p_sect[i][1])
|
||||||
continue;
|
continue;
|
||||||
pr("%-17s\t\t", dchr[i].d_name);
|
pr("%-17s\t\t", dchr[i].d_name);
|
||||||
if (i == SCT_ENLIST)
|
if (i == SCT_ENLIST)
|
||||||
|
@ -137,22 +137,19 @@ budg(void)
|
||||||
p_sect[SCT_EFFIC][0], p_sect[SCT_EFFIC][1]);
|
p_sect[SCT_EFFIC][0], p_sect[SCT_EFFIC][1]);
|
||||||
expenses += p_sect[SCT_EFFIC][1];
|
expenses += p_sect[SCT_EFFIC][1];
|
||||||
}
|
}
|
||||||
|
if (p_sect[SCT_MAINT][0]) {
|
||||||
|
sprintf(buf, "%ld sector%s",
|
||||||
|
p_sect[SCT_MAINT][0], splur(p_sect[SCT_MAINT][0]));
|
||||||
|
pr("Sector maintenance\t\t%-16s\t\t%8ld\n",
|
||||||
|
buf, p_sect[SCT_MAINT][1]);
|
||||||
|
expenses += p_sect[SCT_MAINT][1];
|
||||||
|
}
|
||||||
if (mil) {
|
if (mil) {
|
||||||
n = (mil - np->nat_reserve * money_res * etu) / (etu * money_mil);
|
n = (mil - np->nat_reserve * money_res * etu) / (etu * money_mil);
|
||||||
sprintf(in, "%d mil, %d res", n, (int)np->nat_reserve);
|
sprintf(in, "%d mil, %d res", n, (int)np->nat_reserve);
|
||||||
pr("Military payroll\t\t%-32s%8d\n", in, -mil);
|
pr("Military payroll\t\t%-32s%8d\n", in, -mil);
|
||||||
expenses -= mil;
|
expenses -= mil;
|
||||||
}
|
}
|
||||||
if (p_sect[SCT_CAPIT][0]) {
|
|
||||||
pr("%c%s maintenance\t\t",
|
|
||||||
toupper(dchr[SCT_CAPIT].d_name[0]),
|
|
||||||
dchr[SCT_CAPIT].d_name + 1);
|
|
||||||
n = p_sect[SCT_CAPIT][0];
|
|
||||||
sprintf(in, "%d %s", n, dchr[SCT_CAPIT].d_name);
|
|
||||||
plurize(in, sizeof(in), n);
|
|
||||||
pr("%-32s%8ld\n", in, p_sect[SCT_CAPIT][1]);
|
|
||||||
expenses += p_sect[SCT_CAPIT][1];
|
|
||||||
}
|
|
||||||
pr("Total expenses%s\n", dotsprintf(buf, "%58d", expenses));
|
pr("Total expenses%s\n", dotsprintf(buf, "%58d", expenses));
|
||||||
if (taxes) {
|
if (taxes) {
|
||||||
sprintf(in, "%d civ%s, %d uw%s",
|
sprintf(in, "%d civ%s, %d uw%s",
|
||||||
|
|
|
@ -203,6 +203,7 @@ struct castr dchr_ca[] = {
|
||||||
{"build", fldoff(d_build), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"build", fldoff(d_build), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
{"lcms", fldoff(d_lcms), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"lcms", fldoff(d_lcms), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
{"hcms", fldoff(d_hcms), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"hcms", fldoff(d_hcms), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
|
{"maint", fldoff(d_maint), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
{"maxpop", fldoff(d_maxpop), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"maxpop", fldoff(d_maxpop), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
{NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0}
|
{NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0}
|
||||||
#undef CURSTR
|
#undef CURSTR
|
||||||
|
|
|
@ -61,41 +61,41 @@
|
||||||
# econfig key custom_tables.
|
# econfig key custom_tables.
|
||||||
|
|
||||||
config sect-chr
|
config sect-chr
|
||||||
uid mnem terra prd peff mob0 mob1 nav pkg ostr dstr val cost bui lcm hcm maxp name
|
uid mnem terra prd peff mob0 mob1 nav pkg ostr dstr val cost bui lcm hcm maint maxp name
|
||||||
0 "." 0 -1 0 -1 -1 sea norm 0.0 0.0 0 -1 0 0 0 0 "sea"
|
0 "." 0 -1 0 -1 -1 sea norm 0.0 0.0 0 -1 0 0 0 0 0 "sea"
|
||||||
1 "^" 1 dust 75 2.4 1.2 land norm 1.0 4.0 5 -1 1 0 0 100 "mountain"
|
1 "^" 1 dust 75 2.4 1.2 land norm 1.0 4.0 5 -1 1 0 0 0 100 "mountain"
|
||||||
2 "s" 4 -1 0 -1 -1 land norm 0.0 99.0 127 -1 0 0 0 1000 "sanctuary"
|
2 "s" 4 -1 0 -1 -1 land norm 0.0 99.0 127 -1 0 0 0 0 1000 "sanctuary"
|
||||||
3 "\134" 3 -1 0 -1 -1 land norm 0.0 99.0 0 -1 0 0 0 0 "wasteland"
|
3 "\134" 3 -1 0 -1 -1 land norm 0.0 99.0 0 -1 0 0 0 0 0 "wasteland"
|
||||||
4 "-" 4 -1 0 0.4 0.4 land norm 1.0 2.0 1 0 0 0 0 1000 "wilderness"
|
4 "-" 4 -1 0 0.4 0.4 land norm 1.0 2.0 1 0 0 0 0 0 1000 "wilderness"
|
||||||
# Uncomment one of the following two. The second one is for big cities.
|
# Uncomment one of the following two. The second one is for big cities.
|
||||||
5 "c" 4 -1 0 0.4 0.2 land norm 1.0 2.0 30 0 1 0 0 1000 "capital"
|
5 "c" 4 -1 0 0.4 0.2 land norm 1.0 2.0 30 0 1 0 0 1 1000 "capital"
|
||||||
# 5 "c" 4 -1 0 0.4 0.2 cana urba 1.0 2.0 30 0 10 1 2 1000 "city"
|
# 5 "c" 4 -1 0 0.4 0.2 cana urba 1.0 2.0 30 0 10 1 2 1 1000 "city"
|
||||||
6 "u" 4 rad 100 0.4 0.2 land norm 1.0 2.0 15 0 1 0 0 1000 "uranium mine"
|
6 "u" 4 rad 100 0.4 0.2 land norm 1.0 2.0 15 0 1 0 0 0 1000 "uranium mine"
|
||||||
7 "p" 4 hap 100 0.4 0.2 land norm 1.0 1.5 5 0 1 0 0 1000 "park"
|
7 "p" 4 hap 100 0.4 0.2 land norm 1.0 1.5 5 0 1 0 0 0 1000 "park"
|
||||||
8 "d" 4 gun 100 0.4 0.2 land norm 1.0 1.5 7 0 1 0 0 1000 "defense plant"
|
8 "d" 4 gun 100 0.4 0.2 land norm 1.0 1.5 7 0 1 0 0 0 1000 "defense plant"
|
||||||
9 "i" 4 sh 100 0.4 0.2 land norm 1.0 1.5 6 0 1 0 0 1000 "shell industry"
|
9 "i" 4 sh 100 0.4 0.2 land norm 1.0 1.5 6 0 1 0 0 0 1000 "shell industry"
|
||||||
10 "m" 4 iron 100 0.4 0.2 land norm 1.0 2.0 5 0 1 0 0 1000 "mine"
|
10 "m" 4 iron 100 0.4 0.2 land norm 1.0 2.0 5 0 1 0 0 0 1000 "mine"
|
||||||
11 "g" 4 dust 100 0.4 0.2 land norm 1.0 2.0 8 0 1 0 0 1000 "gold mine"
|
11 "g" 4 dust 100 0.4 0.2 land norm 1.0 2.0 8 0 1 0 0 0 1000 "gold mine"
|
||||||
12 "h" 4 -1 0 0.4 0.2 harb ware 1.0 1.5 12 0 1 0 0 1000 "harbor"
|
12 "h" 4 -1 0 0.4 0.2 harb ware 1.0 1.5 12 0 1 0 0 0 1000 "harbor"
|
||||||
13 "w" 4 -1 0 0.4 0.2 land ware 1.0 1.5 7 0 1 0 0 1000 "warehouse"
|
13 "w" 4 -1 0 0.4 0.2 land ware 1.0 1.5 7 0 1 0 0 0 1000 "warehouse"
|
||||||
14 "*" 4 -1 0 0.4 0.2 land norm 1.0 1.25 12 0 1 0 0 1000 "airfield"
|
14 "*" 4 -1 0 0.4 0.2 land norm 1.0 1.25 12 0 1 0 0 0 1000 "airfield"
|
||||||
15 "a" 4 food 900 0.4 0.2 land norm 1.0 1.5 2 0 1 0 0 1000 "agribusiness"
|
15 "a" 4 food 900 0.4 0.2 land norm 1.0 1.5 2 0 1 0 0 0 1000 "agribusiness"
|
||||||
16 "o" 4 oil 100 0.4 0.2 land norm 1.0 1.5 5 0 1 0 0 1000 "oil field"
|
16 "o" 4 oil 100 0.4 0.2 land norm 1.0 1.5 5 0 1 0 0 0 1000 "oil field"
|
||||||
17 "j" 4 lcm 100 0.4 0.2 land norm 1.0 1.5 3 0 1 0 0 1000 "light manufacturing"
|
17 "j" 4 lcm 100 0.4 0.2 land norm 1.0 1.5 3 0 1 0 0 0 1000 "light manufacturing"
|
||||||
18 "k" 4 hcm 100 0.4 0.2 land norm 1.0 1.5 4 0 1 0 0 1000 "heavy manufacturing"
|
18 "k" 4 hcm 100 0.4 0.2 land norm 1.0 1.5 4 0 1 0 0 0 1000 "heavy manufacturing"
|
||||||
19 "f" 4 -1 0 0.4 0.2 land norm 2.0 4.0 10 0 5 0 1 1000 "fortress"
|
19 "f" 4 -1 0 0.4 0.2 land norm 2.0 4.0 10 0 5 0 1 0 1000 "fortress"
|
||||||
20 "t" 4 tech 100 0.4 0.2 land norm 1.0 1.5 10 0 1 0 0 1000 "technical center"
|
20 "t" 4 tech 100 0.4 0.2 land norm 1.0 1.5 10 0 1 0 0 0 1000 "technical center"
|
||||||
21 "r" 4 med 100 0.4 0.2 land norm 1.0 1.5 9 0 1 0 0 1000 "research lab"
|
21 "r" 4 med 100 0.4 0.2 land norm 1.0 1.5 9 0 1 0 0 0 1000 "research lab"
|
||||||
22 "n" 4 -1 0 0.4 0.2 land norm 1.0 2.0 10 0 1 0 0 1000 "nuclear plant"
|
22 "n" 4 -1 0 0.4 0.2 land norm 1.0 2.0 10 0 1 0 0 0 1000 "nuclear plant"
|
||||||
23 "l" 4 edu 100 0.4 0.2 land norm 1.0 1.5 4 0 1 0 0 1000 "library/school"
|
23 "l" 4 edu 100 0.4 0.2 land norm 1.0 1.5 4 0 1 0 0 0 1000 "library/school"
|
||||||
24 "+" 4 -1 0 0.4 0.0 land norm 1.0 1.0 3 0 1 0 0 1000 "highway"
|
24 "+" 4 -1 0 0.4 0.0 land norm 1.0 1.0 3 0 1 0 0 0 1000 "highway"
|
||||||
25 ")" 4 -1 0 0.4 0.2 land norm 1.0 1.5 4 0 1 0 0 1000 "radar installation"
|
25 ")" 4 -1 0 0.4 0.2 land norm 1.0 1.5 4 0 1 0 0 0 1000 "radar installation"
|
||||||
26 "!" 4 -1 0 0.4 0.2 land norm 1.0 1.5 12 0 1 0 0 1000 "headquarters"
|
26 "!" 4 -1 0 0.4 0.2 land norm 1.0 1.5 12 0 1 0 0 0 1000 "headquarters"
|
||||||
27 "#" 4 -1 0 0.4 0.0 land norm 1.0 1.0 3 0 1 0 0 1000 "bridge head"
|
27 "#" 4 -1 0 0.4 0.0 land norm 1.0 1.0 3 0 1 0 0 0 1000 "bridge head"
|
||||||
28 "=" 0 -1 0 0.4 0.0 brid norm 1.0 1.0 5 -1 1 0 0 100 "bridge span"
|
28 "=" 0 -1 0 0.4 0.0 brid norm 1.0 1.0 5 -1 1 0 0 0 100 "bridge span"
|
||||||
29 "b" 4 bars 100 0.4 0.2 land bank 1.0 2.25 10 0 1 0 0 1000 "bank"
|
29 "b" 4 bars 100 0.4 0.2 land bank 1.0 2.25 10 0 1 0 0 0 1000 "bank"
|
||||||
30 "%" 4 pet 1000 0.4 0.2 land norm 1.0 1.5 2 0 1 0 0 1000 "refinery"
|
30 "%" 4 pet 1000 0.4 0.2 land norm 1.0 1.5 2 0 1 0 0 0 1000 "refinery"
|
||||||
31 "e" 4 -1 0 0.4 0.2 land norm 1.0 2.0 7 0 1 0 0 1000 "enlistment center"
|
31 "e" 4 -1 0 0.4 0.2 land norm 1.0 2.0 7 0 1 0 0 0 1000 "enlistment center"
|
||||||
32 "~" 32 -1 0 0.4 0.2 land norm 1.0 1.5 1 -1 1 0 0 100 "plains"
|
32 "~" 32 -1 0 0.4 0.2 land norm 1.0 1.5 1 -1 1 0 0 0 100 "plains"
|
||||||
33 "@" 0 -1 0 0.4 0.0 land norm 1.0 1.5 4 -1 1 0 0 100 "bridge tower"
|
33 "@" 0 -1 0 0.4 0.0 land norm 1.0 1.5 4 -1 1 0 0 0 100 "bridge tower"
|
||||||
/config
|
/config
|
||||||
|
|
|
@ -460,27 +460,29 @@ show_sect_build(int foo)
|
||||||
{
|
{
|
||||||
int i, first;
|
int i, first;
|
||||||
|
|
||||||
pr(" desig build 100%% eff\n"
|
pr(" desig build 100%% eff maint\n"
|
||||||
"sector type $ lcm hcm $\n");
|
"sector type $ lcm hcm $ $\n");
|
||||||
for (i = 0; dchr[i].d_name; i++) {
|
for (i = 0; dchr[i].d_name; i++) {
|
||||||
if (dchr[i].d_mnem == 0)
|
if (dchr[i].d_mnem == 0)
|
||||||
continue;
|
continue;
|
||||||
if (dchr[i].d_mob0 < 0)
|
if (dchr[i].d_mob0 < 0)
|
||||||
continue;
|
continue;
|
||||||
if (dchr[i].d_cost <= 0 && dchr[i].d_build == 1
|
if (dchr[i].d_cost <= 0 && dchr[i].d_build == 1
|
||||||
&& dchr[i].d_lcms == 0 && dchr[i].d_hcms == 0)
|
&& dchr[i].d_lcms == 0 && dchr[i].d_hcms == 0
|
||||||
|
&& dchr[i].d_maint == 0)
|
||||||
continue; /* the usual, skip */
|
continue; /* the usual, skip */
|
||||||
pr("%c %-21.21s", dchr[i].d_mnem, dchr[i].d_name);
|
pr("%c %-21.21s", dchr[i].d_mnem, dchr[i].d_name);
|
||||||
if (dchr[i].d_cost < 0)
|
if (dchr[i].d_cost < 0)
|
||||||
pr(" can't");
|
pr(" can't");
|
||||||
else
|
else
|
||||||
pr(" %5d", dchr[i].d_cost);
|
pr(" %5d", dchr[i].d_cost);
|
||||||
pr(" %5d %5d %5d\n",
|
pr(" %5d%5d %5d %5d\n",
|
||||||
100 * dchr[i].d_lcms,
|
100 * dchr[i].d_lcms,
|
||||||
100 * dchr[i].d_hcms,
|
100 * dchr[i].d_hcms,
|
||||||
100 * dchr[i].d_build);
|
100 * dchr[i].d_build,
|
||||||
|
dchr[i].d_maint * etu_per_update);
|
||||||
}
|
}
|
||||||
pr("any other 0 0 0 100\n");
|
pr("any other 0 0 0 100 0\n");
|
||||||
|
|
||||||
first = 1;
|
first = 1;
|
||||||
for (i = 0; intrchr[i].in_name; i++) {
|
for (i = 0; intrchr[i].in_name; i++) {
|
||||||
|
|
|
@ -278,13 +278,6 @@ produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2])
|
||||||
|
|
||||||
np = getnatp(natnum);
|
np = getnatp(natnum);
|
||||||
|
|
||||||
if (sp->sct_type == SCT_CAPIT && sp->sct_effic >= 60) {
|
|
||||||
p_sect[SCT_CAPIT][0]++;
|
|
||||||
p_sect[SCT_CAPIT][1] += etu;
|
|
||||||
if (!player->simulation)
|
|
||||||
np->nat_money -= etu;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player->simulation) {
|
if (player->simulation) {
|
||||||
/* work on a copy, which will be discarded */
|
/* work on a copy, which will be discarded */
|
||||||
memcpy(buf, sp->sct_item, sizeof(buf));
|
memcpy(buf, sp->sct_item, sizeof(buf));
|
||||||
|
@ -321,6 +314,14 @@ produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2])
|
||||||
|
|
||||||
desig = sp->sct_type;
|
desig = sp->sct_type;
|
||||||
|
|
||||||
|
if (dchr[desig].d_maint) {
|
||||||
|
cost = etu * dchr[desig].d_maint;
|
||||||
|
p_sect[SCT_MAINT][0]++;
|
||||||
|
p_sect[SCT_MAINT][1] += cost;
|
||||||
|
if (!player->simulation)
|
||||||
|
np->nat_money -= cost;
|
||||||
|
}
|
||||||
|
|
||||||
if ((sp->sct_effic < 100 || sp->sct_type != sp->sct_newtype) &&
|
if ((sp->sct_effic < 100 || sp->sct_type != sp->sct_newtype) &&
|
||||||
np->nat_money >= 0) {
|
np->nat_money >= 0) {
|
||||||
neweff = upd_buildeff(np, sp, &work, vec, etu, &desig, sctwork,
|
neweff = upd_buildeff(np, sp, &work, vec, etu, &desig, sctwork,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue