Clean up rules on where you can scrap stuff
You can now scrap ships in own or friendly, efficient harbors, planes in own or allied, efficient airfields, and land units in any own or allied sector. When something can't be scrapped because of these rules, print a suitable message. Before, you could scrap ships regardless of relations to sector owner (info claimed friendly was required), land units regardless of relations, but not while on ships, and planes even in friendly airfields (info claimed allied was required). When scrapping in a deity sector, scrap claimed it gave the cargo to POGO, which is somewhat bogus, as POGO can't own such stuff.
This commit is contained in:
parent
06dd3d80ac
commit
221324cc10
2 changed files with 25 additions and 24 deletions
13
info/scrap.t
13
info/scrap.t
|
@ -1,23 +1,18 @@
|
||||||
.TH Command SCRAP
|
.TH Command SCRAP
|
||||||
.NA scrap "Scrap a ship, plane, or unit"
|
.NA scrap "Scrap a ship, plane, or land unit"
|
||||||
.LV Basic
|
.LV Basic
|
||||||
.SY "scrap <s|l|p> <SHIPS | UNITS | PLANES>"
|
.SY "scrap <s|l|p> <SHIPS | UNITS | PLANES>"
|
||||||
This command allows you to scrap planes/units/ships when you no longer
|
This command allows you to scrap planes/units/ships when you no longer
|
||||||
need them.
|
need them.
|
||||||
.s1
|
.s1
|
||||||
Ships may only be scrapped friendly 60% harbours.
|
Ships may only be scrapped in own or friendly 60% harbours.
|
||||||
Planes may only be scrapped in 60% airfields.
|
Planes may only be scrapped in own or allied 60% airfields.
|
||||||
Units may be scrapped in any sector.
|
Land units may only be scrapped in own or allied sectors.
|
||||||
.s1
|
.s1
|
||||||
When scrapping a unit, plane or ship, you receive materials equal to 2/3
|
When scrapping a unit, plane or ship, you receive materials equal to 2/3
|
||||||
the amount used to build it. The materials are put in the sector where
|
the amount used to build it. The materials are put in the sector where
|
||||||
the scrapping occurs.
|
the scrapping occurs.
|
||||||
.s1
|
.s1
|
||||||
When scrapping a unit, you also get the military that the unit represents
|
|
||||||
as mil in the sector. (Example: a unit that takes 100 mil to build is
|
|
||||||
at 50%, and is scrapped. 50 mil will be added to the sector) Units on
|
|
||||||
ships cannot be scrapped.
|
|
||||||
.s1
|
|
||||||
If you scrap a ship or unit that has planes on board, the planes will
|
If you scrap a ship or unit that has planes on board, the planes will
|
||||||
be transferred to the sector.
|
be transferred to the sector.
|
||||||
.s1
|
.s1
|
||||||
|
|
|
@ -134,28 +134,34 @@ scra(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getsect(item.gen.x, item.gen.y, §);
|
||||||
if (type == EF_SHIP) {
|
if (type == EF_SHIP) {
|
||||||
getsect(item.ship.shp_x, item.ship.shp_y, §);
|
if (!player->owner
|
||||||
if (sect.sct_type != SCT_HARBR)
|
&& getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
|
||||||
continue;
|
pr("%s is not in a friendly harbor!\n",
|
||||||
if (sect.sct_effic < 60 || sect.sct_own != player->cnum)
|
prship(&item.ship));
|
||||||
continue;
|
continue;
|
||||||
} else if (type == EF_LAND) {
|
}
|
||||||
if (item.land.lnd_ship >= 0) {
|
if (sect.sct_type != SCT_HARBR || sect.sct_effic < 60) {
|
||||||
pr("%s is on a ship, and cannot be scrapped!\n",
|
pr("%s is not in a 60%% efficient harbor!\n",
|
||||||
prland(&item.land));
|
prship(&item.ship));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getsect(item.land.lnd_x, item.land.lnd_y, §);
|
|
||||||
} else {
|
} else {
|
||||||
getsect(item.plane.pln_x, item.plane.pln_y, §);
|
if (!player->owner
|
||||||
if (sect.sct_type != SCT_AIRPT)
|
&& getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
|
||||||
|
pr("%s is not in an allied sector!\n",
|
||||||
|
obj_nameof(&item.gen));
|
||||||
continue;
|
continue;
|
||||||
if (sect.sct_effic < 60 ||
|
}
|
||||||
(sect.sct_own != player->cnum &&
|
if (type == EF_PLANE
|
||||||
getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY))
|
&& (sect.sct_type != SCT_AIRPT || sect.sct_effic < 60)) {
|
||||||
|
pr("%s is not in a 60%% efficient airfield!\n",
|
||||||
|
prplane(&item.plane));
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == EF_SHIP) {
|
if (type == EF_SHIP) {
|
||||||
eff = item.ship.shp_effic / 100.0;
|
eff = item.ship.shp_effic / 100.0;
|
||||||
mp = &mchr[(int)item.ship.shp_type];
|
mp = &mchr[(int)item.ship.shp_type];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue