Remove option TRADESHIPS, customize table ship-chr instead
Trade ships are now enabled when a ship type with capability trade exists. No such type exists by default; to enable trade ships, deities have to customize table ship-chr. Before, trade ship types were ignored when option TRADESHIPS was disabled. Except for xdump ship-chr, which happily dumped unusable trade ship types.
This commit is contained in:
parent
c4254764bf
commit
352bc320d2
19 changed files with 32 additions and 41 deletions
|
@ -190,8 +190,6 @@ 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,
|
||||||
"Technology costs more as population rises")
|
"Technology costs more as population rises")
|
||||||
EMPCF_OPT("TRADESHIPS", opt_TRADESHIPS,
|
|
||||||
"Enable Tradeships")
|
|
||||||
EMPCF_OPT("TREATIES", opt_TREATIES,
|
EMPCF_OPT("TREATIES", opt_TREATIES,
|
||||||
"Allow treaties")
|
"Allow treaties")
|
||||||
|
|
||||||
|
|
|
@ -238,9 +238,9 @@ RAILWAYS and rollover_avail. Options SHOWPLANE, SHIPNAMES, NEWPOWER,
|
||||||
NEW_STARVE, NEW_WORK, ORBIT and PLANENAMES are no longer configurable.
|
NEW_STARVE, NEW_WORK, ORBIT and PLANENAMES are no longer configurable.
|
||||||
Options NUKEFAILDETONATE, SLOW_WAR, SNEAK_ATTACK, FUEL, GRAB_THINGS
|
Options NUKEFAILDETONATE, SLOW_WAR, SNEAK_ATTACK, FUEL, GRAB_THINGS
|
||||||
and SHIP_DECAY are gone. Options PINPOINTMISSILE, DEMANDUPDATE,
|
and SHIP_DECAY are gone. Options PINPOINTMISSILE, DEMANDUPDATE,
|
||||||
UPDATESCHED, DRNUKE, NONUKES, NEUTRON, BIG_CITY, DEFENSE_INFRA,
|
UPDATESCHED, DRNUKE, TRADESHIPS, NONUKES, NEUTRON, BIG_CITY,
|
||||||
NO_LCMS, NO_HCMS and NO_OIL got replaced by more flexible
|
DEFENSE_INFRA, NO_LCMS, NO_HCMS and NO_OIL
|
||||||
configuration.
|
got replaced by more flexible configuration.
|
||||||
|
|
||||||
The xdump command lets client writers access more game more easily.
|
The xdump command lets client writers access more game more easily.
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ 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
|
||||||
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
|
|
||||||
RES_POP: Research affects max sector population.
|
RES_POP: Research affects max sector population.
|
||||||
NOFOOD: No food is required.
|
NOFOOD: No food is required.
|
||||||
BLITZ: Players get infinite BTU's.
|
BLITZ: Players get infinite BTU's.
|
||||||
|
|
|
@ -256,7 +256,7 @@ The vessel can be used as a semi-landing craft. (see info assault)
|
||||||
.L sub-torp
|
.L sub-torp
|
||||||
The vessel can torpedo submarines
|
The vessel can torpedo submarines
|
||||||
.L trade
|
.L trade
|
||||||
The vessel is a trade ship. (only if TRADESHIPS are enabled)
|
The vessel is a trade ship.
|
||||||
.L supply
|
.L supply
|
||||||
The vessel can supply other units.
|
The vessel can supply other units.
|
||||||
Unless the vessel is a submarine, it can load non-light land units.
|
Unless the vessel is a submarine, it can load non-light land units.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.NA Trade-ships "How to use trade ships"
|
.NA Trade-ships "How to use trade ships"
|
||||||
.LV Basic
|
.LV Basic
|
||||||
Trade ships are special ships, with a different function than most Empire
|
Trade ships are special ships, with a different function than most Empire
|
||||||
ships. They are in the game only if the TRADESHIPS option is enabled.
|
ships. They are in the game only if the deity enabled them.
|
||||||
.s1
|
.s1
|
||||||
Trade ships simulate internal or external trade. In the real world, countries
|
Trade ships simulate internal or external trade. In the real world, countries
|
||||||
make goods that they can make cheaply, ship them somewhere they're expensive,
|
make goods that they can make cheaply, ship them somewhere they're expensive,
|
||||||
|
|
|
@ -35,6 +35,4 @@ shp# ship type orig x,y x,y dist $$
|
||||||
1 ship
|
1 ship
|
||||||
.FI
|
.FI
|
||||||
.s1
|
.s1
|
||||||
Note that this command is only enabled if the TRADESHIPS option is in use.
|
|
||||||
.s1
|
|
||||||
.SA "Trade-ships, sonar, torpedo, upgrade, Ships"
|
.SA "Trade-ships, sonar, torpedo, upgrade, Ships"
|
||||||
|
|
|
@ -13,7 +13,7 @@ be transferred to land (if a unit, or if the ship is in a harbor), or will die
|
||||||
.s1
|
.s1
|
||||||
Units on ships may not be scuttled.
|
Units on ships may not be scuttled.
|
||||||
.s1
|
.s1
|
||||||
Scuttling trade-ships (if the TRADESHIPS option is enabled) has other effects.
|
Scuttling trade-ships has other effects.
|
||||||
See info Trade-ships.
|
See info Trade-ships.
|
||||||
.s1
|
.s1
|
||||||
.SA "scrap, Trade-ships, build, ship, plane, land, Ships, Planes, LandUnits"
|
.SA "scrap, Trade-ships, build, ship, plane, land, Ships, Planes, LandUnits"
|
||||||
|
|
|
@ -81,7 +81,7 @@ Options enabled in this game:
|
||||||
Options disabled in this game:
|
Options disabled in this game:
|
||||||
AUTO_POWER, BRIDGETOWERS, GO_RENEW, GUINEA_PIGS, HIDDEN, LOANS,
|
AUTO_POWER, BRIDGETOWERS, GO_RENEW, GUINEA_PIGS, HIDDEN, LOANS,
|
||||||
LOSE_CONTACT, MARKET, MOB_ACCESS, NO_FORT_FIRE, RES_POP, SUPER_BARS,
|
LOSE_CONTACT, MARKET, MOB_ACCESS, NO_FORT_FIRE, RES_POP, SUPER_BARS,
|
||||||
TECH_POP, TRADESHIPS
|
TECH_POP
|
||||||
|
|
||||||
See "info Options" for a detailed list of options and descriptions.
|
See "info Options" for a detailed list of options and descriptions.
|
||||||
|
|
||||||
|
|
|
@ -129,11 +129,8 @@ buil(void)
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
type = ef_elt_byname(EF_SHIP_CHR, p);
|
type = ef_elt_byname(EF_SHIP_CHR, p);
|
||||||
if (type >= 0) {
|
if (type >= 0)
|
||||||
rqtech = mchr[type].m_tech;
|
rqtech = mchr[type].m_tech;
|
||||||
if ((mchr[type].m_flags & M_TRADE) && !opt_TRADESHIPS)
|
|
||||||
type = -1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
type = ef_elt_byname(EF_LAND_CHR, p);
|
type = ef_elt_byname(EF_LAND_CHR, p);
|
||||||
|
|
|
@ -131,12 +131,7 @@ orde(void)
|
||||||
if (!*p || !strcmp(p, "-")) {
|
if (!*p || !strcmp(p, "-")) {
|
||||||
pr("A one-way order has been accepted.\n");
|
pr("A one-way order has been accepted.\n");
|
||||||
} else if (!strncmp(p, "s", 1)) {
|
} else if (!strncmp(p, "s", 1)) {
|
||||||
if (opt_TRADESHIPS) {
|
if (!(mchr[(int)ship.shp_type].m_flags & M_TRADE)) {
|
||||||
if (!(mchr[(int)ship.shp_type].m_flags & M_TRADE)) {
|
|
||||||
pr("You can't auto-scuttle that ship!\n");
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
pr("You can't auto-scuttle that ship!\n");
|
pr("You can't auto-scuttle that ship!\n");
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,10 +47,6 @@ payo(void)
|
||||||
int dist;
|
int dist;
|
||||||
float cash = 0.0;
|
float cash = 0.0;
|
||||||
|
|
||||||
if (!opt_TRADESHIPS) {
|
|
||||||
pr("Tradeships are not enabled.\n");
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
if (!snxtitem(&ni, EF_SHIP, player->argp[1], NULL))
|
if (!snxtitem(&ni, EF_SHIP, player->argp[1], NULL))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
|
|
|
@ -143,8 +143,7 @@ scra(void)
|
||||||
prship(&item.ship));
|
prship(&item.ship));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (opt_TRADESHIPS
|
if (mchr[item.ship.shp_type].m_flags & M_TRADE) {
|
||||||
&& (mchr[item.ship.shp_type].m_flags & M_TRADE)) {
|
|
||||||
pr("WARNING: You only collect money from trade ships if you \"scuttle\" them!\n");
|
pr("WARNING: You only collect money from trade ships if you \"scuttle\" them!\n");
|
||||||
sprintf(prompt,
|
sprintf(prompt,
|
||||||
"Are you really sure that you want to scrap %s (n)? ",
|
"Are you really sure that you want to scrap %s (n)? ",
|
||||||
|
|
|
@ -125,7 +125,7 @@ scut(void)
|
||||||
|
|
||||||
if (type == EF_SHIP) {
|
if (type == EF_SHIP) {
|
||||||
mp = &mchr[(int)item.ship.shp_type];
|
mp = &mchr[(int)item.ship.shp_type];
|
||||||
if (opt_TRADESHIPS && (mp->m_flags & M_TRADE)) {
|
if (mp->m_flags & M_TRADE) {
|
||||||
if (!scuttle_tradeship(&item.ship, 1))
|
if (!scuttle_tradeship(&item.ship, 1))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
* Ken Stevens
|
* Ken Stevens
|
||||||
* Steve McClure
|
* Steve McClure
|
||||||
* Ron Koenderink, 2005-2006
|
* Ron Koenderink, 2005-2006
|
||||||
* Markus Armbruster, 2005-2010
|
* Markus Armbruster, 2005-2011
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -44,6 +44,7 @@
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
static int have_trade_ships(void);
|
||||||
static void show_custom(void);
|
static void show_custom(void);
|
||||||
static void show_opts(int val);
|
static void show_opts(int val);
|
||||||
static char *prwrap(char *, char *, int *);
|
static char *prwrap(char *, char *, int *);
|
||||||
|
@ -156,7 +157,7 @@ vers(void)
|
||||||
-(etu_per_update / sect_mob_neg_factor));
|
-(etu_per_update / sect_mob_neg_factor));
|
||||||
pr("\n");
|
pr("\n");
|
||||||
pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX);
|
pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX);
|
||||||
if (opt_TRADESHIPS) {
|
if (have_trade_ships()) {
|
||||||
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
||||||
trade_1_dist, trade_1 * 100.0);
|
trade_1_dist, trade_1 * 100.0);
|
||||||
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
||||||
|
@ -231,6 +232,18 @@ vers(void)
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
have_trade_ships(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = ef_nelem(EF_SHIP_CHR) - 1; i >= 0; i--) {
|
||||||
|
if (mchr[i].m_flags & M_TRADE)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_custom(void)
|
show_custom(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -195,7 +195,7 @@ float drnuke_const = 0.0; /* research must be at least drnuke_const*tech */
|
||||||
* drnuke_const is .25, you need a 75 res to
|
* drnuke_const is .25, you need a 75 res to
|
||||||
* build a nuke that takes 300 tech
|
* build a nuke that takes 300 tech
|
||||||
*/
|
*/
|
||||||
/* opt_TRADESHIPS */
|
/* trade ships */
|
||||||
int trade_1_dist = 8; /* less than this gets no money */
|
int trade_1_dist = 8; /* less than this gets no money */
|
||||||
int trade_2_dist = 14; /* less than this gets trade_1 money */
|
int trade_2_dist = 14; /* less than this gets trade_1 money */
|
||||||
int trade_3_dist = 25; /* less than this gets trade_2 money */
|
int trade_3_dist = 25; /* less than this gets trade_2 money */
|
||||||
|
@ -204,7 +204,6 @@ float trade_2 = 0.035; /* return on trade_2 distance */
|
||||||
float trade_3 = 0.050; /* return on trade_3 distance */
|
float trade_3 = 0.050; /* return on trade_3 distance */
|
||||||
float trade_ally_bonus = 0.20; /* 20% bonus for trading with allies */
|
float trade_ally_bonus = 0.20; /* 20% bonus for trading with allies */
|
||||||
float trade_ally_cut = 0.10; /* 10% bonus for ally you trade with */
|
float trade_ally_cut = 0.10; /* 10% bonus for ally you trade with */
|
||||||
/* end opt_TRADESHIPS */
|
|
||||||
|
|
||||||
int torpedo_damage = 40; /* damage is X + 1dX + 1dX, so 40+1d40+1d40 */
|
int torpedo_damage = 40; /* damage is X + 1dX + 1dX, so 40+1d40+1d40 */
|
||||||
|
|
||||||
|
|
|
@ -60,5 +60,4 @@ int opt_RES_POP = 0;
|
||||||
int opt_SAIL = 1;
|
int opt_SAIL = 1;
|
||||||
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_TREATIES = 1;
|
int opt_TREATIES = 1;
|
||||||
|
|
|
@ -54,7 +54,8 @@ type name l_b h_b tech cost ...
|
||||||
2 "cs cargo ship" 60 40 20 500
|
2 "cs cargo ship" 60 40 20 500
|
||||||
3 "os ore ship" 60 40 20 500
|
3 "os ore ship" 60 40 20 500
|
||||||
4 "ss slave ship" 60 40 0 300
|
4 "ss slave ship" 60 40 0 300
|
||||||
5 "ts trade ship" 200 100 30 1750
|
# Uncomment to enable trade ships
|
||||||
|
# 5 "ts trade ship" 200 100 30 1750
|
||||||
6 "frg frigate" 30 30 0 600
|
6 "frg frigate" 30 30 0 600
|
||||||
7 "oe oil exploration boat" 25 15 40 800
|
7 "oe oil exploration boat" 25 15 40 800
|
||||||
8 "od oil derrick" 60 60 50 1500
|
8 "od oil derrick" 60 60 50 1500
|
||||||
|
@ -95,7 +96,7 @@ type name arm spe vis vrn frn gli nla npl nch nxl ...
|
||||||
2 "cs cargo ship" 20 25 35 3 0 0 2 0 0 1
|
2 "cs cargo ship" 20 25 35 3 0 0 2 0 0 1
|
||||||
3 "os ore ship" 20 25 35 3 0 0 0 0 0 1
|
3 "os ore ship" 20 25 35 3 0 0 0 0 0 1
|
||||||
4 "ss slave ship" 20 10 35 3 0 0 0 0 0 1
|
4 "ss slave ship" 20 10 35 3 0 0 0 0 0 1
|
||||||
5 "ts trade ship" 20 25 35 3 0 0 0 0 0 1
|
# 5 "ts trade ship" 20 25 35 3 0 0 0 0 0 1
|
||||||
6 "frg frigate" 50 25 25 3 1 1 2 0 0 1
|
6 "frg frigate" 50 25 25 3 1 1 2 0 0 1
|
||||||
7 "oe oil exploration boat" 10 25 15 2 0 0 0 0 0 0
|
7 "oe oil exploration boat" 10 25 15 2 0 0 0 0 0 0
|
||||||
8 "od oil derrick" 30 15 65 3 0 0 0 0 0 2
|
8 "od oil derrick" 30 15 65 3 0 0 0 0 0 2
|
||||||
|
@ -136,7 +137,7 @@ type name civ mil she gun pet iro dus bar foo oil lcm hcm
|
||||||
2 "cs cargo ship" 600 50 300 50 0 0 0 0 900 0 1400 900 250 0 (supply)
|
2 "cs cargo ship" 600 50 300 50 0 0 0 0 900 0 1400 900 250 0 (supply)
|
||||||
3 "os ore ship" 30 5 0 0 0 990 990 0 200 0 0 0 45 990 ()
|
3 "os ore ship" 30 5 0 0 0 990 990 0 200 0 0 0 45 990 ()
|
||||||
4 "ss slave ship" 20 80 0 0 0 0 0 0 200 0 0 0 1200 0 ()
|
4 "ss slave ship" 20 80 0 0 0 0 0 0 200 0 0 0 1200 0 ()
|
||||||
5 "ts trade ship" 50 50 0 0 0 0 0 0 100 0 0 0 0 0 (trade)
|
# 5 "ts trade ship" 50 50 0 0 0 0 0 0 100 0 0 0 0 0 (trade)
|
||||||
6 "frg frigate" 0 60 10 2 0 0 0 0 60 0 0 0 0 0 (semi-land)
|
6 "frg frigate" 0 60 10 2 0 0 0 0 60 0 0 0 0 0 (semi-land)
|
||||||
7 "oe oil exploration boat" 10 5 0 0 0 0 0 0 100 1 0 0 0 0 (oil canal)
|
7 "oe oil exploration boat" 10 5 0 0 0 0 0 0 100 1 0 0 0 0 (oil canal)
|
||||||
8 "od oil derrick" 990 80 0 0 0 0 0 0 990 990 0 0 990 0 (oil)
|
8 "od oil derrick" 990 80 0 0 0 0 0 0 990 990 0 0 990 0 (oil)
|
||||||
|
|
|
@ -83,8 +83,6 @@ make_mchr_index(struct chr_index chridx[], int tlev)
|
||||||
continue;
|
continue;
|
||||||
if (mchr[i].m_tech > tlev)
|
if (mchr[i].m_tech > tlev)
|
||||||
continue;
|
continue;
|
||||||
if ((mchr[i].m_flags & M_TRADE) && !opt_TRADESHIPS)
|
|
||||||
continue;
|
|
||||||
chridx[n].type = i;
|
chridx[n].type = i;
|
||||||
chridx[n].tech = mchr[i].m_tech;
|
chridx[n].tech = mchr[i].m_tech;
|
||||||
n++;
|
n++;
|
||||||
|
|
|
@ -53,8 +53,7 @@ scuttle_it(struct shpstr *sp)
|
||||||
sp->shp_x, sp->shp_y, sp->shp_uid);
|
sp->shp_x, sp->shp_y, sp->shp_uid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (CANT_HAPPEN(!opt_TRADESHIPS
|
if (CANT_HAPPEN(!(mchr[sp->shp_type].m_flags & M_TRADE)))
|
||||||
|| !(mchr[sp->shp_type].m_flags & M_TRADE)))
|
|
||||||
return;
|
return;
|
||||||
if (!scuttle_tradeship(sp, 0)) {
|
if (!scuttle_tradeship(sp, 0)) {
|
||||||
wu(0, sp->shp_own,
|
wu(0, sp->shp_own,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue