diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 96cd23f6d..c6c450b13 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -70,6 +70,8 @@ a slow-moving monster hidden under a rotting corpse was not immediately mimic that ends up on the rogue level should not mimic a closed door polymorphed or shapechanged monster sometimes got erroneous hit points mimic should not mimic a boulder while on a pit or hole location +Sting could trigger premature display of orcs during savegame restore +Sting now glows light blue again Platform- and/or Interface-Specific Fixes diff --git a/include/decl.h b/include/decl.h index dac11660e..c6e4dc0bb 100644 --- a/include/decl.h +++ b/include/decl.h @@ -36,6 +36,7 @@ E NEARDATA int occtime; #define WARNCOUNT 6 /* number of different warning levels */ E uchar warnsyms[WARNCOUNT]; +E NEARDATA int warn_obj_cnt; /* count of monsters meeting criteria */ E int x_maze_max, y_maze_max; E int otg_temp; @@ -214,6 +215,7 @@ E NEARDATA boolean stoned; E NEARDATA boolean unweapon; E NEARDATA boolean mrg_to_wielded; E NEARDATA struct obj *current_wand; +E NEARDATA boolean defer_see_monsters; E NEARDATA boolean in_steed_dismounting; diff --git a/include/extern.h b/include/extern.h index 72b2b564e..a684735df 100644 --- a/include/extern.h +++ b/include/extern.h @@ -82,6 +82,7 @@ E long FDECL(spec_m2, (struct obj *)); E boolean FDECL(artifact_has_invprop, (struct obj *,UCHAR_P)); E long FDECL(arti_cost, (struct obj *)); E struct obj *FDECL(what_gives, (long *)); +E void FDECL(Sting_effects, (int)); /* ### attrib.c ### */ diff --git a/src/allmain.c b/src/allmain.c index 80591b557..02fdfa7f0 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -53,6 +53,10 @@ moveloop() #endif (void) encumber_msg(); /* in case they auto-picked up something */ + if (defer_see_monsters) { + defer_see_monsters = FALSE; + see_monsters(); + } u.uz0.dlevel = u.uz.dlevel; youmonst.movement = NORMAL_SPEED; /* give the hero some movement points */ diff --git a/src/artifact.c b/src/artifact.c index 02e008bed..afbe6c6e4 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1540,5 +1540,18 @@ long *abil; } return (struct obj *)0; } + +void +Sting_effects(orc_count) +int orc_count; +{ + if (uwep && uwep->oartifact == ART_STING) { + if (orc_count > 0 && warn_obj_cnt == 0) + pline("%s %s %s!", bare_artifactname(uwep), + otense(uwep,"glow"), hcolor(NH_LIGHT_BLUE)); + else if (orc_count == 0 && warn_obj_cnt > 0) + pline("%s stops glowing.", bare_artifactname(uwep)); + } +} /*artifact.c*/ diff --git a/src/decl.c b/src/decl.c index 8f25615c3..1ca1d5c7c 100644 --- a/src/decl.c +++ b/src/decl.c @@ -43,6 +43,7 @@ struct dgn_topology dungeon_topology = {DUMMY}; #include "quest.h" struct q_score quest_status = DUMMY; +NEARDATA int warn_obj_cnt = 0; NEARDATA int smeq[MAXNROFROOMS+1] = DUMMY; NEARDATA int doorindex = 0; NEARDATA char *save_cm = 0; @@ -116,6 +117,7 @@ NEARDATA dest_area updest = { 0, 0, 0, 0, 0, 0, 0, 0 }; NEARDATA dest_area dndest = { 0, 0, 0, 0, 0, 0, 0, 0 }; NEARDATA coord inv_pos = { 0, 0 }; +NEARDATA boolean defer_see_monsters = FALSE; NEARDATA boolean in_mklev = FALSE; NEARDATA boolean stoned = FALSE; /* done to monsters hit by 'c' */ NEARDATA boolean unweapon = FALSE; diff --git a/src/display.c b/src/display.c index 3990cc6d9..f5e0a1499 100644 --- a/src/display.c +++ b/src/display.c @@ -1067,12 +1067,28 @@ void see_monsters() { register struct monst *mon; + int new_warn_obj_cnt = 0; + + if (defer_see_monsters) return; for (mon = fmon; mon; mon = mon->nmon) { if (DEADMONSTER(mon)) continue; newsym(mon->mx,mon->my); if (mon->wormno) see_wsegs(mon); + if (MATCH_WARN_OF_MON(mon)) { + if (context.warntype.obj && + (context.warntype.obj & mon->data->mflags2)) new_warn_obj_cnt++; + } } + /* + * Make Sting glow blue or stop glowing if required. + */ + if (new_warn_obj_cnt != warn_obj_cnt && + uwep && uwep->oartifact == ART_STING) { + Sting_effects(new_warn_obj_cnt); + warn_obj_cnt = new_warn_obj_cnt; + } + #ifdef STEED /* when mounted, hero's location gets caught by monster loop */ if (!u.usteed) diff --git a/src/restore.c b/src/restore.c index f3fcc9e81..0ff54c435 100644 --- a/src/restore.c +++ b/src/restore.c @@ -423,6 +423,13 @@ unsigned int *stuckid, *steedid; /* STEED */ migrating_mons = restmonchn(fd, FALSE); mread(fd, (genericptr_t) mvitals, sizeof(mvitals)); + /* + * There are some things after this that can have unintended display + * side-effects too early in the game. + * Disable see_monsters() here, re-enable it at the top of moveloop() + */ + defer_see_monsters = TRUE; + /* this comes after inventory has been loaded */ for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->owornmask)