From 3072386d8da1a4d264757f2a1827d737cc82b28d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 21 Jan 2013 20:58:28 +0100 Subject: [PATCH] Send bulletins only from POGO In the beginning, all bulletins came from POGO. Chainsaw changed edit and give to send them from the deity using the command. Its new command setresource sent from POGO regardless. Its new command setsector did both. Go back to sending them only from POGO. Some of the affected bulletins don't mention the acting deity. Reword them so they do. Signed-off-by: Markus Armbruster --- src/lib/commands/edit.c | 52 ++++++++++++++++----------------- src/lib/commands/give.c | 4 +-- src/lib/commands/setsect.c | 14 +++++---- tests/actofgod/journal.log | 60 +++++++++++++++++++------------------- 4 files changed, 66 insertions(+), 64 deletions(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index b34cea25..85a87610 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -245,7 +245,7 @@ noise(struct sctstr *sptr, char *name, int old, int new) pr("%s of %s changed from %d to %d\n", name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new); if (sptr->sct_own) - wu(player->cnum, sptr->sct_own, + wu(0, sptr->sct_own, "%s in %s was changed from %d to %d by an act of %s\n", name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own), old, new, cname(player->cnum)); @@ -438,16 +438,18 @@ edit_sect(struct sctstr *sect, char *key, int arg, char *p) xyas(sect->sct_x, sect->sct_y, player->cnum), prnatid(sect->sct_own), prnatid(arg)); if (sect->sct_own) { - wu(player->cnum, sect->sct_own, - "Sector %s lost to deity intervention\n", - xyas(sect->sct_x, sect->sct_y, sect->sct_own)); + wu(0, sect->sct_own, + "Sector %s taken from you by an act of %s!\n", + xyas(sect->sct_x, sect->sct_y, sect->sct_own), + cname(player->cnum)); } benefit(sect->sct_own, 0); sect->sct_own = arg; if (arg) { - wu(player->cnum, arg, - "Sector %s gained from deity intervention\n", - xyas(sect->sct_x, sect->sct_y, arg)); + wu(0, arg, + "Sector %s given to you by an act of %s!\n", + xyas(sect->sct_x, sect->sct_y, arg), + cname(player->cnum)); } benefit(arg, 1); break; @@ -645,9 +647,9 @@ edit_nat(struct natstr *np, char *key, int arg, char *p) benefit(nat, np->nat_reserve < arg); pr("Military reserves changed from %d to %d\n", np->nat_reserve, arg); - wu(player->cnum, nat, - "Military reserves changed from %d to %d by divine intervention.\n", - np->nat_reserve, arg); + wu(0, nat, + "Military reserves changed from %d to %d by an act of %s\n", + np->nat_reserve, arg, cname(player->cnum)); np->nat_reserve = arg; break; case 'c': @@ -679,9 +681,8 @@ edit_nat(struct natstr *np, char *key, int arg, char *p) break; case 'M': pr("Money changed from %d to %d\n", np->nat_money, arg); - wu(player->cnum, nat, - "Money changed from %d to %d by divine intervention.\n", - np->nat_money, arg); + wu(0, nat, "Money changed from %d to %d by an act of %s\n", + np->nat_money, arg, cname(player->cnum)); np->nat_money = arg; break; case 'T': @@ -746,11 +747,11 @@ edit_ship(struct shpstr *ship, char *key, int arg, char *p) if (arg < 0 || arg >= MAXNOC) return RET_SYN; if (ship->shp_own) - wu(player->cnum, ship->shp_own, - "%s taken from you by deity intervention!\n", prship(ship)); + wu(0, ship->shp_own, "%s taken from you by an act of %s!\n", + prship(ship), cname(player->cnum)); if (arg) - wu(player->cnum, (natid)arg, - "%s given to you by deity intervention!\n", prship(ship)); + wu(0, arg, "%s given to you by an act of %s!\n", + prship(ship), cname(player->cnum)); ship->shp_own = arg; break; case 'L': @@ -827,11 +828,11 @@ edit_land(struct lndstr *land, char *key, int arg, char *p) if (arg < 0 || arg >= MAXNOC) return RET_SYN; if (land->lnd_own) - wu(player->cnum, land->lnd_own, - "%s taken from you by deity intervention!\n", prland(land)); + wu(0, land->lnd_own, "%s taken from you by an act of %s!\n", + prland(land), cname(player->cnum)); if (arg) - wu(player->cnum, (natid)arg, - "%s given to you by deity intervention!\n", prland(land)); + wu(0, arg, "%s given to you by an act of %s!\n", + prland(land), cname(player->cnum)); land->lnd_own = arg; break; case 'L': @@ -925,12 +926,11 @@ edit_plane(struct plnstr *plane, char *key, int arg, char *p) if (arg < 0 || arg >= MAXNOC) return RET_SYN; if (plane->pln_own) - wu(player->cnum, plane->pln_own, - "%s taken from you by deity intervention!\n", - prplane(plane)); + wu(0, plane->pln_own, "%s taken from you by an act of %s!\n", + prplane(plane), cname(player->cnum)); if (arg) - wu(player->cnum, arg, - "%s given to you by deity intervention!\n", prplane(plane)); + wu(0, arg, "%s given to you by an act of %s!\n", + prplane(plane), cname(player->cnum)); plane->pln_own = arg; break; case 'e': diff --git a/src/lib/commands/give.c b/src/lib/commands/give.c index 7883ca0e..f68affab 100644 --- a/src/lib/commands/give.c +++ b/src/lib/commands/give.c @@ -78,13 +78,13 @@ give(void) if (m > n) { if (opt_GODNEWS) nreport(player->cnum, N_GIFT, sect.sct_own, 1); - wu(player->cnum, sect.sct_own, "%s gave you %d %s in %s\n", + wu(0, sect.sct_own, "%s gave you %d %s in %s\n", cname(player->cnum), m - n, ip->i_name, xyas(sect.sct_x, sect.sct_y, sect.sct_own)); } else { if (opt_GODNEWS) nreport(sect.sct_own, N_TAKE, player->cnum, 1); - wu(player->cnum, sect.sct_own, "%s stole %d %s from %s\n", + wu(0, sect.sct_own, "%s stole %d %s from %s\n", cname(player->cnum), n - m, ip->i_name, xyas(sect.sct_x, sect.sct_y, sect.sct_own)); } diff --git a/src/lib/commands/setsect.c b/src/lib/commands/setsect.c index db76d532..0a7dedc7 100644 --- a/src/lib/commands/setsect.c +++ b/src/lib/commands/setsect.c @@ -104,14 +104,16 @@ setsector(void) xyas(sect.sct_x, sect.sct_y, player->cnum), prnatid(sect.sct_own), prnatid(amt)); if (sect.sct_own) { - wu(player->cnum, sect.sct_own, - "Sector %s lost to deity intervention\n", - xyas(sect.sct_x, sect.sct_y, sect.sct_own)); + wu(0, sect.sct_own, + "Sector %s taken from you by an act of %s!\n", + xyas(sect.sct_x, sect.sct_y, sect.sct_own), + cname(player->cnum)); } if (amt) - wu(player->cnum, amt, - "Sector %s gained from deity intervention\n", - xyas(sect.sct_x, sect.sct_y, amt)); + wu(0, amt, + "Sector %s given to you by an act of %s!\n", + xyas(sect.sct_x, sect.sct_y, amt), + cname(player->cnum)); sect.sct_own = (natid)amt; break; case 'l': diff --git a/tests/actofgod/journal.log b/tests/actofgod/journal.log index a0103d12..f52ebade 100644 --- a/tests/actofgod/journal.log +++ b/tests/actofgod/journal.log @@ -1473,12 +1473,12 @@ Play#0 command read Play#0 output Play#0 1 Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970 - Play#0 output Play#0 1 Sector 1,7 lost to deity intervention - Play#0 output Play#0 1 Sector 3,7 lost to deity intervention - Play#0 output Play#0 1 Sector 5,7 lost to deity intervention - Play#0 output Play#0 1 Sector 7,7 lost to deity intervention - Play#0 output Play#0 1 Sector 9,7 lost to deity intervention - Play#0 output Play#0 1 Sector 11,7 lost to deity intervention + Play#0 output Play#0 1 Sector 1,7 taken from you by an act of POGO! + Play#0 output Play#0 1 Sector 3,7 taken from you by an act of POGO! + Play#0 output Play#0 1 Sector 5,7 taken from you by an act of POGO! + Play#0 output Play#0 1 Sector 7,7 taken from you by an act of POGO! + Play#0 output Play#0 1 Sector 9,7 taken from you by an act of POGO! + Play#0 output Play#0 1 Sector 11,7 taken from you by an act of POGO! Play#0 output Play#0 1 Efficiency in 1,1 was changed from 0 to 0 by an act of POGO Play#0 output Play#0 1 Efficiency in 3,1 was changed from 0 to 0 by an act of POGO Play#0 output Play#0 1 Efficiency in 5,1 was changed from 0 to 100 by an act of POGO @@ -1592,35 +1592,35 @@ Play#0 output Play#0 1 POGO gave you 1 civilians in 8,6 Play#0 output Play#0 1 POGO gave you 9997 civilians in 6,6 Play#0 output Play#0 1 POGO stole 1 civilians from 8,6 - Play#0 output Play#0 1 Military reserves changed from 0 to 0 by divine intervention. - Play#0 output Play#0 1 Money changed from 0 to -2147483648 by divine intervention. + Play#0 output Play#0 1 Military reserves changed from 0 to 0 by an act of POGO + Play#0 output Play#0 1 Money changed from 0 to -2147483648 by an act of POGO Play#0 output Play#0 6 0 640 Play#0 input read 2 Play#0 command read Play#0 output Play#0 1 Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970 - Play#0 output Play#0 1 Sector 5,7 gained from deity intervention - Play#0 output Play#0 1 Sector 11,7 gained from deity intervention - Play#0 output Play#0 1 cs cargo ship (#2) given to you by deity intervention! - Play#0 output Play#0 1 f1 Sopwith Camel #2 given to you by deity intervention! - Play#0 output Play#0 1 sup supply #2 given to you by deity intervention! - Play#0 output Play#0 1 Military reserves changed from 0 to 0 by divine intervention. + Play#0 output Play#0 1 Sector 5,7 given to you by an act of POGO! + Play#0 output Play#0 1 Sector 11,7 given to you by an act of POGO! + Play#0 output Play#0 1 cs cargo ship (#2) given to you by an act of POGO! + Play#0 output Play#0 1 f1 Sopwith Camel #2 given to you by an act of POGO! + Play#0 output Play#0 1 sup supply #2 given to you by an act of POGO! + Play#0 output Play#0 1 Military reserves changed from 0 to 0 by an act of POGO Play#0 output Play#0 6 0 640 Play#0 input read 3 Play#0 command read Play#0 output Play#0 1 Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970 - Play#0 output Play#0 1 cs cargo ship (#0) taken from you by deity intervention! - Play#0 output Play#0 1 cs cargo ship (#1) taken from you by deity intervention! - Play#0 output Play#0 1 cs cargo ship (#2) taken from you by deity intervention! - Play#0 output Play#0 1 f1 Sopwith Camel #0 taken from you by deity intervention! - Play#0 output Play#0 1 f1 Sopwith Camel #1 taken from you by deity intervention! - Play#0 output Play#0 1 f1 Sopwith Camel #2 taken from you by deity intervention! - Play#0 output Play#0 1 sup supply #0 taken from you by deity intervention! - Play#0 output Play#0 1 sup supply #1 taken from you by deity intervention! - Play#0 output Play#0 1 sup supply #2 taken from you by deity intervention! - Play#0 output Play#0 1 Military reserves changed from 0 to 2147483647 by divine intervention. - Play#0 output Play#0 1 Money changed from 0 to 2147483647 by divine intervention. + Play#0 output Play#0 1 cs cargo ship (#0) taken from you by an act of POGO! + Play#0 output Play#0 1 cs cargo ship (#1) taken from you by an act of POGO! + Play#0 output Play#0 1 cs cargo ship (#2) taken from you by an act of POGO! + Play#0 output Play#0 1 f1 Sopwith Camel #0 taken from you by an act of POGO! + Play#0 output Play#0 1 f1 Sopwith Camel #1 taken from you by an act of POGO! + Play#0 output Play#0 1 f1 Sopwith Camel #2 taken from you by an act of POGO! + Play#0 output Play#0 1 sup supply #0 taken from you by an act of POGO! + Play#0 output Play#0 1 sup supply #1 taken from you by an act of POGO! + Play#0 output Play#0 1 sup supply #2 taken from you by an act of POGO! + Play#0 output Play#0 1 Military reserves changed from 0 to 2147483647 by an act of POGO + Play#0 output Play#0 1 Money changed from 0 to 2147483647 by an act of POGO Play#0 output Play#0 6 0 640 Play#0 input read 4 Play#0 command read @@ -1634,11 +1634,11 @@ Play#0 command read Play#0 output Play#0 1 Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970 - Play#0 output Play#0 1 Sector 3,7 gained from deity intervention - Play#0 output Play#0 1 Sector 9,7 gained from deity intervention - Play#0 output Play#0 1 cs cargo ship (#1) given to you by deity intervention! - Play#0 output Play#0 1 f1 Sopwith Camel #1 given to you by deity intervention! - Play#0 output Play#0 1 sup supply #1 given to you by deity intervention! + Play#0 output Play#0 1 Sector 3,7 given to you by an act of POGO! + Play#0 output Play#0 1 Sector 9,7 given to you by an act of POGO! + Play#0 output Play#0 1 cs cargo ship (#1) given to you by an act of POGO! + Play#0 output Play#0 1 f1 Sopwith Camel #1 given to you by an act of POGO! + Play#0 output Play#0 1 sup supply #1 given to you by an act of POGO! Play#0 output Play#0 6 0 640 Play#0 input ctld Play#0 output Play#0 1 Bye-bye