setsector setresource: Print effect for unowned sectors, too
The "changed from" message has always been suppressed for unowned sectors. Makes no sense. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
c900ef8f1e
commit
985ac03fbe
5 changed files with 34 additions and 29 deletions
|
@ -70,27 +70,22 @@ setres(void)
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
switch (char0) {
|
switch (char0) {
|
||||||
case 'i':
|
case 'i':
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Iron ore content", sect.sct_min, amt);
|
resnoise(§, "Iron ore content", sect.sct_min, amt);
|
||||||
sect.sct_min = (unsigned char)amt;
|
sect.sct_min = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Gold content", sect.sct_gmin, amt);
|
resnoise(§, "Gold content", sect.sct_gmin, amt);
|
||||||
sect.sct_gmin = (unsigned char)amt;
|
sect.sct_gmin = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Oil content", sect.sct_oil, amt);
|
resnoise(§, "Oil content", sect.sct_oil, amt);
|
||||||
sect.sct_oil = (unsigned char)amt;
|
sect.sct_oil = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Fertility content", sect.sct_fertil, amt);
|
resnoise(§, "Fertility content", sect.sct_fertil, amt);
|
||||||
sect.sct_fertil = (unsigned char)amt;
|
sect.sct_fertil = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Uranium content", sect.sct_uran, amt);
|
resnoise(§, "Uranium content", sect.sct_uran, amt);
|
||||||
sect.sct_uran = (unsigned char)amt;
|
sect.sct_uran = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -75,7 +75,6 @@ setsector(void)
|
||||||
current = sect.sct_min;
|
current = sect.sct_min;
|
||||||
current += amt;
|
current += amt;
|
||||||
current = LIMIT_TO(current, 0, 100);
|
current = LIMIT_TO(current, 0, 100);
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Iron ore content", sect.sct_min, current);
|
resnoise(§, "Iron ore content", sect.sct_min, current);
|
||||||
sect.sct_min = (unsigned char)current;
|
sect.sct_min = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
|
@ -83,7 +82,6 @@ setsector(void)
|
||||||
current = sect.sct_gmin;
|
current = sect.sct_gmin;
|
||||||
current += amt;
|
current += amt;
|
||||||
current = LIMIT_TO(current, 0, 100);
|
current = LIMIT_TO(current, 0, 100);
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Gold content", sect.sct_gmin, current);
|
resnoise(§, "Gold content", sect.sct_gmin, current);
|
||||||
sect.sct_gmin = (unsigned char)current;
|
sect.sct_gmin = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
|
@ -93,7 +91,6 @@ setsector(void)
|
||||||
current = sect.sct_oil;
|
current = sect.sct_oil;
|
||||||
current += amt;
|
current += amt;
|
||||||
current = LIMIT_TO(current, 0, 100);
|
current = LIMIT_TO(current, 0, 100);
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Oil content", sect.sct_oil, current);
|
resnoise(§, "Oil content", sect.sct_oil, current);
|
||||||
sect.sct_oil = (unsigned char)current;
|
sect.sct_oil = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
|
@ -145,14 +142,12 @@ setsector(void)
|
||||||
current = sect.sct_mines;
|
current = sect.sct_mines;
|
||||||
current += amt;
|
current += amt;
|
||||||
current = LIMIT_TO(current, 0, MINES_MAX);
|
current = LIMIT_TO(current, 0, MINES_MAX);
|
||||||
if (sect.sct_own != 0) {
|
|
||||||
if (sect.sct_own == sect.sct_oldown)
|
if (sect.sct_own == sect.sct_oldown)
|
||||||
resnoise(§, "Mines", sect.sct_mines, current);
|
resnoise(§, "Mines", sect.sct_mines, current);
|
||||||
else
|
else
|
||||||
pr("Mines of %s changed from %d to %d\n",
|
pr("Mines of %s changed from %d to %d\n",
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum),
|
xyas(sect.sct_x, sect.sct_y, player->cnum),
|
||||||
sect.sct_mines, current);
|
sect.sct_mines, current);
|
||||||
}
|
|
||||||
sect.sct_mines = current;
|
sect.sct_mines = current;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
|
@ -188,7 +183,6 @@ setsector(void)
|
||||||
current = sect.sct_fertil;
|
current = sect.sct_fertil;
|
||||||
current += amt;
|
current += amt;
|
||||||
current = LIMIT_TO(current, 0, 100);
|
current = LIMIT_TO(current, 0, 100);
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Fertility content", sect.sct_fertil, current);
|
resnoise(§, "Fertility content", sect.sct_fertil, current);
|
||||||
sect.sct_fertil = (unsigned char)current;
|
sect.sct_fertil = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
|
@ -196,7 +190,6 @@ setsector(void)
|
||||||
current = sect.sct_uran;
|
current = sect.sct_uran;
|
||||||
current += amt;
|
current += amt;
|
||||||
current = LIMIT_TO(current, 0, 100);
|
current = LIMIT_TO(current, 0, 100);
|
||||||
if (sect.sct_own != 0)
|
|
||||||
resnoise(§, "Uranium content", sect.sct_uran, current);
|
resnoise(§, "Uranium content", sect.sct_uran, current);
|
||||||
sect.sct_uran = (unsigned char)current;
|
sect.sct_uran = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -191,7 +191,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
|
||||||
0 -7 -1 4 0 0 0 0 0 0 0 0 0 -7 -1 0 0 0 1 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
0 -1 -1 0 0 0 0 0 0 0 0 0 0 -1 -1 0 0 0 1 0 50 50 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
/config
|
/config
|
||||||
config ship
|
config ship
|
||||||
uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet xstart xend ystart yend cargostart(0) cargostart(1) cargostart(2) cargostart(3) cargostart(4) cargostart(5) cargoend(0) cargoend(1) cargoend(2) cargoend(3) cargoend(4) cargoend(5) amtstart(0) amtstart(1) amtstart(2) amtstart(3) amtstart(4) amtstart(5) amtend(0) amtend(1) amtend(2) amtend(3) amtend(4) amtend(5) autonav civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access mquota path follow name xbuilt ybuilt builder rflags rpath
|
uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet xstart xend ystart yend cargostart(0) cargostart(1) cargostart(2) cargostart(3) cargostart(4) cargostart(5) cargoend(0) cargoend(1) cargoend(2) cargoend(3) cargoend(4) cargoend(5) amtstart(0) amtstart(1) amtstart(2) amtstart(3) amtstart(4) amtstart(5) amtend(0) amtend(1) amtend(2) amtend(3) amtend(4) amtend(5) autonav civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access mquota path follow name xbuilt ybuilt builder rflags rpath
|
||||||
|
|
|
@ -190,6 +190,11 @@ sect_int(
|
||||||
['d', 0, 100],
|
['d', 0, 100],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# special case: unowned sector
|
||||||
|
edit('sect', '-1,-1', 'i', 50);
|
||||||
|
setres('-1,-1', 'g', 50);
|
||||||
|
setsect('-1,-1', 'f', 50);
|
||||||
|
|
||||||
# special case: mines in occupied sector
|
# special case: mines in occupied sector
|
||||||
setsect('1:3,-3', 'ol', 1);
|
setsect('1:3,-3', 'ol', 1);
|
||||||
setsect('1,-3', 'mi', 1);
|
setsect('1,-3', 'mi', 1);
|
||||||
|
|
|
@ -680,6 +680,18 @@
|
||||||
Play#0 command edit
|
Play#0 command edit
|
||||||
Play#0 output Play#0 1 Defense percentage of 7,1 changed from 0 to 100
|
Play#0 output Play#0 1 Defense percentage of 7,1 changed from 0 to 100
|
||||||
Play#0 output Play#0 6 0 640
|
Play#0 output Play#0 6 0 640
|
||||||
|
Play#0 input edit l -1,-1 i 50
|
||||||
|
Play#0 command edit
|
||||||
|
Play#0 output Play#0 1 Iron ore content of -1,-1 changed from 0 to 50
|
||||||
|
Play#0 output Play#0 6 0 640
|
||||||
|
Play#0 input setres g -1,-1 50
|
||||||
|
Play#0 command setresource
|
||||||
|
Play#0 output Play#0 1 Gold content of -1,-1 changed from 0 to 50
|
||||||
|
Play#0 output Play#0 6 0 640
|
||||||
|
Play#0 input setsect f -1,-1 50
|
||||||
|
Play#0 command setsector
|
||||||
|
Play#0 output Play#0 1 Fertility content of -1,-1 changed from 0 to 50
|
||||||
|
Play#0 output Play#0 6 0 640
|
||||||
Play#0 input setsect ol 1:3,-3 1
|
Play#0 input setsect ol 1:3,-3 1
|
||||||
Play#0 command setsector
|
Play#0 command setsector
|
||||||
Play#0 output Play#0 1 Old owner of 1,-3 changed from 3 (#3) to 1 (#1).
|
Play#0 output Play#0 1 Old owner of 1,-3 changed from 3 (#3) to 1 (#1).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue