edit &c: Report sector non-change differently
Print "unchanged" instead of "changed from X to X". Affects edit, setresource, setsector. Suppress bulletin and news. Affects only edit sector key 'L'. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
6ff503c288
commit
004c4d0f23
5 changed files with 101 additions and 90 deletions
|
@ -416,9 +416,9 @@ edit_sect_i(struct sctstr *sect, char *key, int arg)
|
|||
case 'o':
|
||||
if (arg < 0 || arg >= MAXNOC)
|
||||
return RET_SYN;
|
||||
pr("Owner of %s changed from %s to %s\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
prnatid(sect->sct_own), prnatid(arg));
|
||||
divine_sct_change_quiet(sect, "Owner", arg != sect->sct_own,
|
||||
"from %s to %s",
|
||||
prnatid(sect->sct_own), prnatid(arg));
|
||||
if (arg == sect->sct_own)
|
||||
break;
|
||||
report_god_takes("Sector ",
|
||||
|
@ -479,40 +479,40 @@ edit_sect_i(struct sctstr *sect, char *key, int arg)
|
|||
break;
|
||||
case 'l':
|
||||
new = LIMIT_TO(arg, 0, 127);
|
||||
pr("Loyalty of %s changed from %d to %d\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
sect->sct_loyal, new);
|
||||
divine_sct_change_quiet(sect, "Loyalty", new != sect->sct_loyal,
|
||||
"from %d to %d", sect->sct_loyal, new);
|
||||
sect->sct_loyal = (unsigned char)new;
|
||||
break;
|
||||
case 'x':
|
||||
new = LIMIT_TO(arg, 0, CHE_MAX);
|
||||
pr("Guerillas of %s changed from %d to %d\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
sect->sct_che, new);
|
||||
divine_sct_change_quiet(sect, "Guerillas", new != sect->sct_che,
|
||||
"from %d to %d", sect->sct_che, new);
|
||||
sect->sct_che = new;
|
||||
break;
|
||||
case 'X':
|
||||
if (arg < 0 || arg >= MAXNOC)
|
||||
return RET_SYN;
|
||||
pr("Che target of %s changed from %s to %s\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
prnatid(sect->sct_che_target), prnatid(arg));
|
||||
divine_sct_change_quiet(sect, "Che target",
|
||||
arg != sect->sct_che_target,
|
||||
"from %s to %s",
|
||||
prnatid(sect->sct_che_target),
|
||||
prnatid(arg));
|
||||
sect->sct_che_target = arg;
|
||||
if (arg == 0)
|
||||
sect->sct_che = 0;
|
||||
break;
|
||||
case 'p':
|
||||
new = LIMIT_TO(arg, 0, PLG_EXPOSED);
|
||||
pr("Plague stage of %s changed from %d to %d\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
sect->sct_pstage, new);
|
||||
divine_sct_change_quiet(sect, "Plague stage",
|
||||
new != sect->sct_pstage,
|
||||
"from %d to %d", sect->sct_pstage, new);
|
||||
sect->sct_pstage = new;
|
||||
break;
|
||||
case 't':
|
||||
new = LIMIT_TO(arg, 0, 32767);
|
||||
pr("Plague time of %s changed from %d to %d\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
sect->sct_ptime, new);
|
||||
divine_sct_change_quiet(sect, "Plague time",
|
||||
new != sect->sct_ptime,
|
||||
"from %d to %d", sect->sct_ptime, new);
|
||||
sect->sct_ptime = new;
|
||||
break;
|
||||
case 'F':
|
||||
|
@ -530,9 +530,8 @@ edit_sect_i(struct sctstr *sect, char *key, int arg)
|
|||
if (sect->sct_own == sect->sct_oldown)
|
||||
noise(sect, "Mines", sect->sct_mines, new);
|
||||
else
|
||||
pr("Mines of %s changed from %d to %d\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
sect->sct_mines, new);
|
||||
divine_sct_change_quiet(sect, "Mines", new != sect->sct_mines,
|
||||
"from %d to %d", sect->sct_mines, new);
|
||||
sect->sct_mines = new;
|
||||
break;
|
||||
case 'R':
|
||||
|
@ -568,6 +567,10 @@ edit_sect(struct sctstr *sect, char *key, char *p)
|
|||
case 'L':
|
||||
if (!sarg_xy(p, &newx, &newy))
|
||||
return RET_SYN;
|
||||
if (newx == sect->sct_x && newy == sect->sct_y) {
|
||||
pr("Sector %s unchanged\n", xyas(newx, newy, player->cnum));
|
||||
break;
|
||||
}
|
||||
getsect(newx, newy, &newsect);
|
||||
pr("Sector %s duplicated to %s\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
|
@ -583,10 +586,11 @@ edit_sect(struct sctstr *sect, char *key, char *p)
|
|||
case 'D':
|
||||
if (!sarg_xy(p, &newx, &newy))
|
||||
return RET_SYN;
|
||||
pr("Distribution sector of %s changed from %s to %s\n",
|
||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||
xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum),
|
||||
xyas(newx, newy, player->cnum));
|
||||
divine_sct_change_quiet(sect, "Distribution sector",
|
||||
newx != sect->sct_dist_x || newy != sect->sct_dist_y,
|
||||
"from %s to %s",
|
||||
xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum),
|
||||
xyas(newx, newy, player->cnum));
|
||||
if (newx == sect->sct_dist_x && newy == sect->sct_dist_y)
|
||||
break;
|
||||
if (sect->sct_own && sect->sct_own != player->cnum)
|
||||
|
|
|
@ -74,6 +74,7 @@ report_god_gives(char *prefix, char *what, natid to)
|
|||
* report news (sometimes).
|
||||
* NAME names what is being changed in the sector.
|
||||
* If CHANGE is zero, the meddling is a no-op (bulletin suppressed).
|
||||
* If CHANGE is negative, it's secret (bulletin suppressed).
|
||||
* If a bulletin is sent, report N_AIDS news for positive GOODNESS,
|
||||
* N_HURTS news for negative GOODNESS
|
||||
* The bulletin's text is like "NAME of sector X,Y changed <how> by an
|
||||
|
@ -91,9 +92,15 @@ divine_sct_change(struct sctstr *sp, char *name,
|
|||
vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (!change) {
|
||||
pr("%s of %s unchanged\n",
|
||||
name, xyas(sp->sct_x, sp->sct_y, player->cnum));
|
||||
return;
|
||||
}
|
||||
|
||||
pr("%s of %s changed %s\n",
|
||||
name, xyas(sp->sct_x, sp->sct_y, player->cnum), buf);
|
||||
if (change && sp->sct_own && sp->sct_own != player->cnum) {
|
||||
if (change > 0 && sp->sct_own && sp->sct_own != player->cnum) {
|
||||
wu(0, sp->sct_own, "%s of %s changed %s by an act of %s\n",
|
||||
name, xyas(sp->sct_x, sp->sct_y, sp->sct_own),
|
||||
buf, cname(player->cnum));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue