Remove option SLOW_WAR
SLOW_WAR has issues: * The check whether the attacker old-owns the attacked sector is broken, because att_abort() uses sect.sct_oldown uninitialized. Spotted by the Clang Static Analyzer. * Its implementation in setrel() is somewhat scary. It's actually okay, because that part of setrel() only runs within decl(). Other callers don't reach it: update_main() because player->god != 0 there, and the rest because they never pass a rel < HOSTILE. * Documentation is a bit vague. SLOW_WAR hasn't been used in a public game in years. Fixing it is not worth it, so remove it instead.
This commit is contained in:
parent
a94ae5f8c1
commit
439f111f98
23 changed files with 11 additions and 274 deletions
|
@ -181,8 +181,6 @@ EMPCF_OPT("RES_POP", opt_RES_POP,
|
||||||
"Population is limited by research")
|
"Population is limited by research")
|
||||||
EMPCF_OPT("SAIL", opt_SAIL,
|
EMPCF_OPT("SAIL", opt_SAIL,
|
||||||
"Enable sail command")
|
"Enable sail command")
|
||||||
EMPCF_OPT("SLOW_WAR", opt_SLOW_WAR,
|
|
||||||
"Declaring war takes time")
|
|
||||||
EMPCF_OPT("SUPER_BARS", opt_SUPER_BARS,
|
EMPCF_OPT("SUPER_BARS", opt_SUPER_BARS,
|
||||||
"Make bars immune to damage")
|
"Make bars immune to damage")
|
||||||
EMPCF_OPT("TECH_POP", opt_TECH_POP,
|
EMPCF_OPT("TECH_POP", opt_TECH_POP,
|
||||||
|
@ -207,8 +205,6 @@ EMPCFBOTH("at_least_one_100", at_least_one_100, int, NSC_INT, KM_INTERNAL,
|
||||||
"Initialize new countries with at least one sector with 100 of all resource")
|
"Initialize new countries with at least one sector with 100 of all resource")
|
||||||
EMPCFBOTH("start_cash", start_cash, long, NSC_LONG, KM_INTERNAL,
|
EMPCFBOTH("start_cash", start_cash, long, NSC_LONG, KM_INTERNAL,
|
||||||
"Starting cash for new countries")
|
"Starting cash for new countries")
|
||||||
EMPCFBOTH("war_cost", War_Cost, int, NSC_INT, 0,
|
|
||||||
"Cost to declare war (if SLOW_WAR is on)")
|
|
||||||
|
|
||||||
EMPCF_COMMENT("\n\n### Technology/Research/Education/Happiness")
|
EMPCF_COMMENT("\n\n### Technology/Research/Education/Happiness")
|
||||||
EMPCFBOTH("easy_tech", easy_tech, float, NSC_FLOAT, 0,
|
EMPCFBOTH("easy_tech", easy_tech, float, NSC_FLOAT, 0,
|
||||||
|
|
|
@ -120,12 +120,10 @@ struct natstr {
|
||||||
|
|
||||||
/* nation relation codes */
|
/* nation relation codes */
|
||||||
#define AT_WAR 0
|
#define AT_WAR 0
|
||||||
#define SITZKRIEG 1
|
#define HOSTILE 1
|
||||||
#define MOBILIZATION 2
|
#define NEUTRAL 2
|
||||||
#define HOSTILE 3
|
#define FRIENDLY 3
|
||||||
#define NEUTRAL 4
|
#define ALLIED 4
|
||||||
#define FRIENDLY 5
|
|
||||||
#define ALLIED 6
|
|
||||||
|
|
||||||
/* nation reject codes */
|
/* nation reject codes */
|
||||||
#define REJ_TELE bit(0) /* dont allow telegrams to be sent */
|
#define REJ_TELE bit(0) /* dont allow telegrams to be sent */
|
||||||
|
|
|
@ -44,10 +44,6 @@ The "assault" command is the only command which will let you attack
|
||||||
your own sector (you can use this to get mil & assault units on
|
your own sector (you can use this to get mil & assault units on
|
||||||
shore). You should not "attack" unowned land (see info explore).
|
shore). You should not "attack" unowned land (see info explore).
|
||||||
.s1
|
.s1
|
||||||
If the SLOW_WAR option is enabled, you will not be able to attack
|
|
||||||
a sector owned by a country you are not AT_WAR with, unless you
|
|
||||||
are the old owner of the sector.
|
|
||||||
.s1
|
|
||||||
.L "(2) Ask the aggressor further details about the offensive force."
|
.L "(2) Ask the aggressor further details about the offensive force."
|
||||||
.s1
|
.s1
|
||||||
When you board, you are asked for a ship or sector to board from.
|
When you board, you are asked for a ship or sector to board from.
|
||||||
|
|
|
@ -11,7 +11,6 @@ The following options were introduced in the Chainsaw server:
|
||||||
EASY_BRIDGES: bridges can be built from any sector
|
EASY_BRIDGES: bridges can be built from any sector
|
||||||
SUPER_BARS: gold bars aren't destroyed by shelling or bombing
|
SUPER_BARS: gold bars aren't destroyed by shelling or bombing
|
||||||
ALL_BLEED: you get tech bleed from all countries, not just allies
|
ALL_BLEED: you get tech bleed from all countries, not just allies
|
||||||
SLOW_WAR: War declaring takes time. No land attacks unless at war.
|
|
||||||
NOMOBCOST: ships pay 0 mob to fire. Subs pay 1/2 a sect's movement cost
|
NOMOBCOST: ships pay 0 mob to fire. Subs pay 1/2 a sect's movement cost
|
||||||
TRADESHIPS: you can build/nav/scuttle trade ships to make money
|
TRADESHIPS: you can build/nav/scuttle trade ships to make money
|
||||||
RES_POP: Research affects max sector population.
|
RES_POP: Research affects max sector population.
|
||||||
|
|
|
@ -15,31 +15,6 @@ which case you will declare <POSITION> towards all nations.
|
||||||
For a complete list of the meanings of all the different types of
|
For a complete list of the meanings of all the different types of
|
||||||
relations, see "info relations".
|
relations, see "info relations".
|
||||||
.s1
|
.s1
|
||||||
GOING TO WAR
|
|
||||||
.s1
|
|
||||||
(Note: the following stuff is only in effect if the SLOW_WAR option is selected)
|
|
||||||
With the SLOW_WAR option in use, you cannot attack the land of someone you are
|
|
||||||
not at war with. When you declare war on
|
|
||||||
someone, your relation goes to \*Qmobilizing\*U. You still can't attack them.
|
|
||||||
After the next update, your relation goes to \*Qsitzkrieg\*U, and you still
|
|
||||||
can't attack them. After the NEXT update, you're at war with them, and anything
|
|
||||||
goes.
|
|
||||||
.s1
|
|
||||||
If someone is \*Qmobilizing\*U or in \*Qsitzkrieg\*U, or at war with you,
|
|
||||||
and you
|
|
||||||
declare war against them, your relation is set to be the same as theirs, so
|
|
||||||
there is no way to gain any advantage through this stuff. It just means that
|
|
||||||
you can't sneak-attack people.
|
|
||||||
.s1
|
|
||||||
The first person who declares war pays $1000. Return declarations are
|
|
||||||
free.
|
|
||||||
.s1
|
|
||||||
There is an exception to the SLOW_WAR restrictions. If you are listed as
|
|
||||||
the old owner of a sector, you are still allowed to attack it. This is to
|
|
||||||
prevent someone from declaring war with you, taking some sectors, then
|
|
||||||
declaring neutrality before you declare war. (Assuming you didn't notice
|
|
||||||
their declaration of war)
|
|
||||||
.s1
|
|
||||||
The newspaper is very interested in declarations of war or alliance --
|
The newspaper is very interested in declarations of war or alliance --
|
||||||
don't expect to keep such declarations secret.
|
don't expect to keep such declarations secret.
|
||||||
.s1
|
.s1
|
||||||
|
|
|
@ -7,9 +7,6 @@ changes. It is still used to shoot up land sectors or ships. However,
|
||||||
you may now use multiple ships, units, sectors to fire from. Return
|
you may now use multiple ships, units, sectors to fire from. Return
|
||||||
fire is spread amongst all the firing things.
|
fire is spread amongst all the firing things.
|
||||||
.s1
|
.s1
|
||||||
If the SLOW_WAR option is in use, you cannot fire on the
|
|
||||||
land of any nation you are not at war with. (see info relations)
|
|
||||||
.s1
|
|
||||||
The general form for shooting at land from a sector is:
|
The general form for shooting at land from a sector is:
|
||||||
.EX fire sect <ASECTS> <VSECT>
|
.EX fire sect <ASECTS> <VSECT>
|
||||||
Where <VSECT> is the victim sector,
|
Where <VSECT> is the victim sector,
|
||||||
|
|
|
@ -30,8 +30,7 @@ report.
|
||||||
.FI
|
.FI
|
||||||
.s1
|
.s1
|
||||||
Relations are: \*QAllied\*U, \*QFriendly\*U, \*QNeutral\*U,
|
Relations are: \*QAllied\*U, \*QFriendly\*U, \*QNeutral\*U,
|
||||||
\*QHostile\*U, \*QMobilizing\*U, \*QSitzkrieg\*U, and \*QAt
|
\*QHostile\*U, and \*QAt War\*U. Each has certain ramifications.
|
||||||
War\*U. Each has certain ramifications.
|
|
||||||
.s1
|
.s1
|
||||||
.L Allied
|
.L Allied
|
||||||
Your ally is someone you trust deeply, and are willing to make
|
Your ally is someone you trust deeply, and are willing to make
|
||||||
|
@ -85,19 +84,4 @@ attacks you, you become hostile towards them. If someone you are neutral
|
||||||
to over-flies or attacks you, you become hostile towards them. Neither of
|
to over-flies or attacks you, you become hostile towards them. Neither of
|
||||||
these progressions can lead to war, however, they both stop at hostility.
|
these progressions can lead to war, however, they both stop at hostility.
|
||||||
.s1
|
.s1
|
||||||
The following paragraphs apply only if the SLOW_WAR option is used.
|
|
||||||
.s1
|
|
||||||
.L Mobilizing
|
|
||||||
If you are Mobilizing, it means that you have declared war, and are getting
|
|
||||||
ready to attack. You cannot attack someone's land until you are actually
|
|
||||||
\*QAt War\*U. At the next update, you will automatically move to
|
|
||||||
\*QSitzkrieg\*U. Your interdiction of the enemy will be the same as
|
|
||||||
if you were hostile towards them.
|
|
||||||
.s1
|
|
||||||
.L Sitzkrieg
|
|
||||||
Sitzkrieg is the same as \*QMobilizing\*U. You still are unable to attack
|
|
||||||
their land. At the next update, you will automatically move to \*QAt War\*U.
|
|
||||||
.s1
|
|
||||||
When you are At War with someone, you may attack them willy-nilly.
|
|
||||||
.s1
|
|
||||||
.SA "Diplomacy"
|
.SA "Diplomacy"
|
||||||
|
|
|
@ -81,8 +81,7 @@ Options enabled in this game:
|
||||||
|
|
||||||
Options disabled in this game:
|
Options disabled in this game:
|
||||||
AUTO_POWER, GO_RENEW, GUINEA_PIGS, HIDDEN, LOANS, LOSE_CONTACT, MARKET,
|
AUTO_POWER, GO_RENEW, GUINEA_PIGS, HIDDEN, LOANS, LOSE_CONTACT, MARKET,
|
||||||
MOB_ACCESS, NO_FORT_FIRE, RES_POP, SLOW_WAR, SUPER_BARS, TECH_POP,
|
MOB_ACCESS, NO_FORT_FIRE, RES_POP, SUPER_BARS, TECH_POP, TRADESHIPS
|
||||||
TRADESHIPS
|
|
||||||
|
|
||||||
See "info Options" for a detailed list of options and descriptions.
|
See "info Options" for a detailed list of options and descriptions.
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,7 @@ assa(void)
|
||||||
putland(llp->unit.land.lnd_uid, &llp->unit.land);
|
putland(llp->unit.land.lnd_uid, &llp->unit.land);
|
||||||
} else {
|
} else {
|
||||||
pr("%s was spotted", prland(&llp->unit.land));
|
pr("%s was spotted", prland(&llp->unit.land));
|
||||||
if (rel == HOSTILE || rel == AT_WAR || rel == SITZKRIEG ||
|
if (rel <= HOSTILE) {
|
||||||
rel == MOBILIZATION) {
|
|
||||||
wu(0, def->own, "%s spy shot and killed in %s.\n",
|
wu(0, def->own, "%s spy shot and killed in %s.\n",
|
||||||
cname(player->cnum), xyas(def->x, def->y,
|
cname(player->cnum), xyas(def->x, def->y,
|
||||||
def->own));
|
def->own));
|
||||||
|
|
|
@ -95,8 +95,6 @@ bomb(void)
|
||||||
char mission;
|
char mission;
|
||||||
struct plist *plp;
|
struct plist *plp;
|
||||||
struct emp_qelem *qp, *next;
|
struct emp_qelem *qp, *next;
|
||||||
int rel;
|
|
||||||
struct natstr *natp;
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
|
if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
|
||||||
|
@ -160,20 +158,6 @@ bomb(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
if (target.sct_own) {
|
|
||||||
rel = getrel(natp, target.sct_own);
|
|
||||||
if ((rel != AT_WAR) && (player->cnum != target.sct_own)
|
|
||||||
&& (target.sct_own) &&
|
|
||||||
(target.sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
pln_put(&bomb_list);
|
|
||||||
pln_put(&esc_list);
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nreport(player->cnum, N_SCT_BOMB, target.sct_own, 1);
|
nreport(player->cnum, N_SCT_BOMB, target.sct_own, 1);
|
||||||
strat_bomb(&bomb_list, &target);
|
strat_bomb(&bomb_list, &target);
|
||||||
break;
|
break;
|
||||||
|
@ -197,8 +181,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
char *p;
|
char *p;
|
||||||
int nsubs;
|
int nsubs;
|
||||||
int nunits;
|
int nunits;
|
||||||
struct natstr *natp;
|
|
||||||
int rel;
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -229,18 +211,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
}
|
}
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case 'l':
|
case 'l':
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
if (target->sct_own) {
|
|
||||||
rel = getrel(natp, target->sct_own);
|
|
||||||
if ((rel != AT_WAR) && (player->cnum != target->sct_own)
|
|
||||||
&& (target->sct_own) &&
|
|
||||||
(target->sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nunits == 0) {
|
if (nunits == 0) {
|
||||||
pr("no units there\n");
|
pr("no units there\n");
|
||||||
goto retry;
|
goto retry;
|
||||||
|
@ -248,18 +218,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
land_bomb(list, target);
|
land_bomb(list, target);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
if (target->sct_own) {
|
|
||||||
rel = getrel(natp, target->sct_own);
|
|
||||||
if ((rel != AT_WAR) && (player->cnum != target->sct_own)
|
|
||||||
&& (target->sct_own) &&
|
|
||||||
(target->sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nplanes == 0) {
|
if (nplanes == 0) {
|
||||||
pr("no planes there\n");
|
pr("no planes there\n");
|
||||||
goto retry;
|
goto retry;
|
||||||
|
@ -281,19 +239,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
ship_bomb(list, target);
|
ship_bomb(list, target);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
if (target->sct_own) {
|
|
||||||
rel = getrel(natp, target->sct_own);
|
|
||||||
if ((rel != AT_WAR) && (player->cnum != target->sct_own)
|
|
||||||
&& (target->sct_own) &&
|
|
||||||
(target->sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < nbomb; i++) {
|
for (i = 0; i < nbomb; i++) {
|
||||||
if (!target->sct_item[bombcomm[i]])
|
if (!target->sct_item[bombcomm[i]])
|
||||||
continue;
|
continue;
|
||||||
|
@ -307,18 +252,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
comm_bomb(list, target);
|
comm_bomb(list, target);
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
if (target->sct_own) {
|
|
||||||
rel = getrel(natp, target->sct_own);
|
|
||||||
if ((rel != AT_WAR) && (player->cnum != target->sct_own)
|
|
||||||
&& (target->sct_own) &&
|
|
||||||
(target->sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
eff_bomb(list, target);
|
eff_bomb(list, target);
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
|
|
|
@ -64,20 +64,6 @@ decl(void)
|
||||||
case 'h':
|
case 'h':
|
||||||
rel = HOSTILE;
|
rel = HOSTILE;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
|
||||||
if (!opt_SLOW_WAR)
|
|
||||||
return RET_SYN;
|
|
||||||
if (!player->god)
|
|
||||||
return RET_SYN;
|
|
||||||
rel = MOBILIZATION;
|
|
||||||
break;
|
|
||||||
case 's':
|
|
||||||
if (!opt_SLOW_WAR)
|
|
||||||
return RET_SYN;
|
|
||||||
if (!player->god)
|
|
||||||
return RET_SYN;
|
|
||||||
rel = SITZKRIEG;
|
|
||||||
break;
|
|
||||||
case 'w':
|
case 'w':
|
||||||
rel = AT_WAR;
|
rel = AT_WAR;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -182,8 +182,6 @@ launch_missile(struct plnstr *pp)
|
||||||
struct mchrstr *mcp;
|
struct mchrstr *mcp;
|
||||||
struct shpstr target_ship;
|
struct shpstr target_ship;
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
int rel;
|
|
||||||
struct natstr *natp;
|
|
||||||
struct nukstr nuke;
|
struct nukstr nuke;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
|
@ -230,18 +228,6 @@ launch_missile(struct plnstr *pp)
|
||||||
if (msl_equip(pp, 's') < 0)
|
if (msl_equip(pp, 's') < 0)
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
getsect(sx, sy, §);
|
getsect(sx, sy, §);
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
rel = getrel(natp, sect.sct_own);
|
|
||||||
if ((rel != AT_WAR) && (sect.sct_own != player->cnum) &&
|
|
||||||
(sect.sct_own) && (sect.sct_oldown != player->cnum)) {
|
|
||||||
pr("You are not at war with the player->owner of the target sector!\n");
|
|
||||||
pr_beep();
|
|
||||||
pr("Kaboom!!!\n");
|
|
||||||
pr("Missile monitoring officer destroys RV before detonation.\n");
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (msl_launch(pp, EF_SECTOR, "sector", sx, sy, sect.sct_own,
|
if (msl_launch(pp, EF_SECTOR, "sector", sx, sy, sect.sct_own,
|
||||||
&sublaunch) < 0)
|
&sublaunch) < 0)
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|
|
@ -82,8 +82,6 @@ multifire(void)
|
||||||
struct shpstr vship;
|
struct shpstr vship;
|
||||||
struct sctstr vsect;
|
struct sctstr vsect;
|
||||||
enum targ_type target;
|
enum targ_type target;
|
||||||
int rel;
|
|
||||||
struct natstr *natp;
|
|
||||||
struct nstr_item nbst;
|
struct nstr_item nbst;
|
||||||
int type;
|
int type;
|
||||||
struct empobj *attgp;
|
struct empobj *attgp;
|
||||||
|
@ -416,17 +414,6 @@ multifire(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
if (target == targ_land) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
rel = getrel(natp, vict);
|
|
||||||
if ((rel != AT_WAR) && (player->cnum != vict) &&
|
|
||||||
(vict) && (vsect.sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nfiring++;
|
nfiring++;
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case targ_sub:
|
case targ_sub:
|
||||||
|
|
|
@ -101,8 +101,6 @@ vers(void)
|
||||||
if (rollover_avail_max)
|
if (rollover_avail_max)
|
||||||
pr("Up to %d avail can roll over an update.\n",
|
pr("Up to %d avail can roll over an update.\n",
|
||||||
rollover_avail_max);
|
rollover_avail_max);
|
||||||
if (opt_SLOW_WAR)
|
|
||||||
pr("Declaring war will cost you $%i\n\n", War_Cost);
|
|
||||||
pr("Happiness p.e. requires 1 happy stroller per %d civ.\n",
|
pr("Happiness p.e. requires 1 happy stroller per %d civ.\n",
|
||||||
(int)hap_cons / etu_per_update);
|
(int)hap_cons / etu_per_update);
|
||||||
pr("Education p.e. requires 1 class of graduates per %d civ.\n",
|
pr("Education p.e. requires 1 class of graduates per %d civ.\n",
|
||||||
|
|
|
@ -42,8 +42,7 @@
|
||||||
|
|
||||||
char *relates[] = {
|
char *relates[] = {
|
||||||
/* must follow nation relation defines in nat.h */
|
/* must follow nation relation defines in nat.h */
|
||||||
"At War", "Sitzkrieg", "Mobilizing", "Hostile", "Neutral", "Friendly",
|
"At War", "Hostile", "Neutral", "Friendly", "Allied"
|
||||||
"Allied"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -191,9 +191,6 @@ double buil_tower_bt = 100.0; /* tech level required to build a tower */
|
||||||
int buil_tower_bh = 400; /* hcm required to build a bridge tower */
|
int buil_tower_bh = 400; /* hcm required to build a bridge tower */
|
||||||
double buil_tower_bc = 3000.0; /* cash required to build a bridge tower */
|
double buil_tower_bc = 3000.0; /* cash required to build a bridge tower */
|
||||||
|
|
||||||
/* opt_SLOW_WAR */
|
|
||||||
int War_Cost = 1000; /* Cost to declare war */
|
|
||||||
|
|
||||||
float drnuke_const = 0.0; /* research must be at least drnuke_const*tech */
|
float drnuke_const = 0.0; /* research must be at least drnuke_const*tech */
|
||||||
/* in order to build a nuke. For example, if
|
/* in order to build a nuke. For example, if
|
||||||
* drnuke_const is .25, you need a 75 res to
|
* drnuke_const is .25, you need a 75 res to
|
||||||
|
|
|
@ -59,7 +59,6 @@ int opt_NO_PLAGUE = 1;
|
||||||
int opt_RAILWAYS = 1;
|
int opt_RAILWAYS = 1;
|
||||||
int opt_RES_POP = 0;
|
int opt_RES_POP = 0;
|
||||||
int opt_SAIL = 1;
|
int opt_SAIL = 1;
|
||||||
int opt_SLOW_WAR = 0;
|
|
||||||
int opt_SUPER_BARS = 0;
|
int opt_SUPER_BARS = 0;
|
||||||
int opt_TECH_POP = 0;
|
int opt_TECH_POP = 0;
|
||||||
int opt_TRADESHIPS = 0;
|
int opt_TRADESHIPS = 0;
|
||||||
|
|
|
@ -139,8 +139,6 @@ struct symbol nation_rejects[] = {
|
||||||
struct symbol nation_relations[] = {
|
struct symbol nation_relations[] = {
|
||||||
{-1, "unknown"},
|
{-1, "unknown"},
|
||||||
{AT_WAR, "at-war"},
|
{AT_WAR, "at-war"},
|
||||||
{SITZKRIEG, "sitzkrieg"},
|
|
||||||
{MOBILIZATION, "mobilization"},
|
|
||||||
{HOSTILE, "hostile"},
|
{HOSTILE, "hostile"},
|
||||||
{NEUTRAL, "neutral"},
|
{NEUTRAL, "neutral"},
|
||||||
{FRIENDLY, "friendly"},
|
{FRIENDLY, "friendly"},
|
||||||
|
|
|
@ -435,9 +435,6 @@ int
|
||||||
att_abort(int combat_mode, struct combat *off, struct combat *def)
|
att_abort(int combat_mode, struct combat *off, struct combat *def)
|
||||||
{
|
{
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
int rel;
|
|
||||||
char y_or_n[512];
|
|
||||||
struct natstr *natp;
|
|
||||||
|
|
||||||
if (player->aborted)
|
if (player->aborted)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -513,23 +510,7 @@ att_abort(int combat_mode, struct combat *off, struct combat *def)
|
||||||
setcont(player->cnum, def->own, FOUND_SPY);
|
setcont(player->cnum, def->own, FOUND_SPY);
|
||||||
setcont(def->own, player->cnum, FOUND_SPY);
|
setcont(def->own, player->cnum, FOUND_SPY);
|
||||||
}
|
}
|
||||||
if (opt_SLOW_WAR && def->own != player->cnum) {
|
|
||||||
natp = getnatp(player->cnum);
|
|
||||||
rel = getrel(natp, def->own);
|
|
||||||
|
|
||||||
if (rel == ALLIED) {
|
|
||||||
sprintf(y_or_n, "Sector is owned by %s, your ally, %s [yn]? ",
|
|
||||||
cname(def->own), att_mode[combat_mode]);
|
|
||||||
if (!confirm(y_or_n))
|
|
||||||
return abort_attack();
|
|
||||||
|
|
||||||
}
|
|
||||||
if ((rel != AT_WAR) && (def->own) &&
|
|
||||||
(sect.sct_oldown != player->cnum)) {
|
|
||||||
pr("You're not at war with them!\n");
|
|
||||||
return abort_attack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1011,8 +1011,7 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor,
|
||||||
"%s unit spotted in %s\n", cname(player->cnum),
|
"%s unit spotted in %s\n", cname(player->cnum),
|
||||||
xyas(sect.sct_x, sect.sct_y, sect.sct_own));
|
xyas(sect.sct_x, sect.sct_y, sect.sct_own));
|
||||||
setrel(sect.sct_own, llp->unit.land.lnd_own, HOSTILE);
|
setrel(sect.sct_own, llp->unit.land.lnd_own, HOSTILE);
|
||||||
} else if (rel == HOSTILE || rel == AT_WAR ||
|
} else if (rel <= HOSTILE) {
|
||||||
rel == SITZKRIEG || rel == MOBILIZATION) {
|
|
||||||
wu(0, sect.sct_own,
|
wu(0, sect.sct_own,
|
||||||
"%s spy shot in %s\n", cname(player->cnum),
|
"%s spy shot in %s\n", cname(player->cnum),
|
||||||
xyas(sect.sct_x, sect.sct_y, sect.sct_own));
|
xyas(sect.sct_x, sect.sct_y, sect.sct_own));
|
||||||
|
|
|
@ -298,7 +298,6 @@ build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
|
||||||
struct empobj *gp;
|
struct empobj *gp;
|
||||||
union empobj_storage item;
|
union empobj_storage item;
|
||||||
int relat;
|
int relat;
|
||||||
struct sctstr sect;
|
|
||||||
|
|
||||||
snxtitem_all(&ni, type);
|
snxtitem_all(&ni, type);
|
||||||
while (nxtitem(&ni, &item)) {
|
while (nxtitem(&ni, &item)) {
|
||||||
|
@ -329,25 +328,6 @@ build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
|
||||||
if (!in_oparea(gp, x, y))
|
if (!in_oparea(gp, x, y))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
if (mission != MI_AIR_DEFENSE) {
|
|
||||||
getsect(x, y, §);
|
|
||||||
if (getrel(getnatp(gp->own), sect.sct_own) > AT_WAR) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the owner of the unit isn't at war
|
|
||||||
* with the victim, and doesn't own the
|
|
||||||
* sect being acted upon, and isn't the
|
|
||||||
* old owner of that sect, bounce them.
|
|
||||||
*/
|
|
||||||
if (sect.sct_type != SCT_WATER &&
|
|
||||||
sect.sct_own != gp->own &&
|
|
||||||
sect.sct_oldown != gp->own)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glp = malloc(sizeof(struct genlist));
|
glp = malloc(sizeof(struct genlist));
|
||||||
memset(glp, 0, sizeof(struct genlist));
|
memset(glp, 0, sizeof(struct genlist));
|
||||||
glp->thing = malloc(sizeof(item));
|
glp->thing = malloc(sizeof(item));
|
||||||
|
|
|
@ -53,7 +53,6 @@ setrel(natid us, natid them, int rel)
|
||||||
int n_up = 0;
|
int n_up = 0;
|
||||||
int n_down = 0;
|
int n_down = 0;
|
||||||
char *addendum = NULL;
|
char *addendum = NULL;
|
||||||
int theirrel;
|
|
||||||
|
|
||||||
if (rel < AT_WAR)
|
if (rel < AT_WAR)
|
||||||
rel = AT_WAR;
|
rel = AT_WAR;
|
||||||
|
@ -84,34 +83,6 @@ setrel(natid us, natid them, int rel)
|
||||||
n_up = N_UP_HOSTILE;
|
n_up = N_UP_HOSTILE;
|
||||||
n_down = N_DOWN_HOSTILE;
|
n_down = N_DOWN_HOSTILE;
|
||||||
} else if (rel < HOSTILE) {
|
} else if (rel < HOSTILE) {
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
struct natstr *natp2;
|
|
||||||
double cost;
|
|
||||||
|
|
||||||
if (!player->god) {
|
|
||||||
natp2 = themnp;
|
|
||||||
theirrel = getrel(natp2, us);
|
|
||||||
if (theirrel <= MOBILIZATION) {
|
|
||||||
rel = theirrel;
|
|
||||||
cost = 0;
|
|
||||||
} else if (us == player->cnum && !update_running) {
|
|
||||||
if (mynp->nat_money < War_Cost) {
|
|
||||||
mpr(us, "You don't have the money!\n");
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
rel = MOBILIZATION;
|
|
||||||
cost = War_Cost;
|
|
||||||
} else { /* nreport is forcing us to decl war */
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
if (rel >= oldrel) {
|
|
||||||
if (us == player->cnum && !update_running)
|
|
||||||
mpr(us, "No change required for that!\n");
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
player->dolcost += cost;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
addendum = "Declaration made (give 'em hell).";
|
addendum = "Declaration made (give 'em hell).";
|
||||||
n_down = N_DECL_WAR;
|
n_down = N_DECL_WAR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,7 @@ update_main(void)
|
||||||
int n;
|
int n;
|
||||||
int i;
|
int i;
|
||||||
struct bp *bp;
|
struct bp *bp;
|
||||||
int cn, cn2, rel;
|
int cn;
|
||||||
struct natstr *cnp;
|
|
||||||
struct natstr *np;
|
struct natstr *np;
|
||||||
|
|
||||||
logerror("production update (%d etus)", etu);
|
logerror("production update (%d etus)", etu);
|
||||||
|
@ -130,26 +129,7 @@ update_main(void)
|
||||||
prod_nat(etu);
|
prod_nat(etu);
|
||||||
age_levels(etu);
|
age_levels(etu);
|
||||||
free(bp);
|
free(bp);
|
||||||
if (opt_SLOW_WAR) {
|
|
||||||
/* Update war declarations */
|
|
||||||
/* MOBILIZATION->SITZKRIEG->AT_WAR */
|
|
||||||
for (cn = 1; cn < MAXNOC; cn++) {
|
|
||||||
if (!(cnp = getnatp(cn)))
|
|
||||||
break;
|
|
||||||
for (cn2 = 1; cn2 < MAXNOC; cn2++) {
|
|
||||||
if (cn2 == cn)
|
|
||||||
continue;
|
|
||||||
rel = getrel(cnp, cn2);
|
|
||||||
if (rel == MOBILIZATION) {
|
|
||||||
rel = SITZKRIEG;
|
|
||||||
setrel(cn, cn2, rel);
|
|
||||||
} else if (rel == SITZKRIEG) {
|
|
||||||
rel = AT_WAR;
|
|
||||||
setrel(cn, cn2, rel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Only update mobility for non-MOB_ACCESS here, since it doesn't
|
/* Only update mobility for non-MOB_ACCESS here, since it doesn't
|
||||||
get done for MOB_ACCESS anyway during the update */
|
get done for MOB_ACCESS anyway during the update */
|
||||||
if (!opt_MOB_ACCESS) {
|
if (!opt_MOB_ACCESS) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue