]> granicus.if.org Git - nethack/commitdiff
coaligned unicorn in bones
authornethack.allison <nethack.allison>
Fri, 17 Dec 2004 00:56:35 +0000 (00:56 +0000)
committernethack.allison <nethack.allison>
Fri, 17 Dec 2004 00:56:35 +0000 (00:56 +0000)
<Someone> wrote:
>> If the previous character was non-neutral, the unicorn would have
>> started off as hostile.  When a bones file is loaded, I don't think
>> hostiles are made non-hostile, although the reverse is certainly true
>> (pets of the deceased are usually hostile).
>
>  In the general case, they are, or rather their hostility is
>  re-evaluated with respect to the new character; see the peace_minded()
>  call in getlev(). However, co-aligned unicorns always being created
>  peaceful is a special case in makemon(), _not_ part of peace_minded(),
>  so they'd just have the usual chance of being made peaceful or not
>  depending on alignment strength, as for any other co-aligned monster
>  not explicitly declared always peaceful or always hostile.

doc/fixes34.4
src/restore.c

index 504dab9d1a17267a1702d81caf401a9911569f63..fd999b7fb3b688ca0cb5f7840ff7daa83020d0f9 100644 (file)
@@ -74,6 +74,7 @@ give blindness feedback when moving into/through stinking cloud
 fix case on monster name when monster reflects floating eye's gaze
 monsters "shrieking in pain" from a potion didn't wake anything up
 Master of Thieves as Tourist Nemesis still had STRAT_CLOSE
+co-aligned unicorns in bones could be hostile
 
 
 Platform- and/or Interface-Specific Fixes
index 0ff54c4352ccd894c0f49ce9cbe6bbfc95a9df1b..0e913be26c40d47f868acb7eaae780a605322886 100644 (file)
@@ -823,9 +823,14 @@ boolean ghostly;
                mtmp2 = mtmp->nmon;
                if (ghostly) {
                        /* reset peaceful/malign relative to new character */
-                       if(!mtmp->isshk)
-                               /* shopkeepers will reset based on name */
+                       /* shopkeepers will reset based on name */
+                       if(!mtmp->isshk) {
+                           if (is_unicorn(mtmp->data) &&
+                              sgn(u.ualign.type) == sgn(mtmp->data->maligntyp))
+                               mtmp->mpeaceful = TRUE;
+                           else
                                mtmp->mpeaceful = peace_minded(mtmp->data);
+                       }
                        set_malign(mtmp);
                } else if (monstermoves > omoves)
                        mon_catchup_elapsed_time(mtmp, monstermoves - omoves);