class differentiation bit (trunk only)
Healers pick up on the fact that a wand of undead turning revived a creature.
This commit is contained in:
@@ -1057,6 +1057,7 @@ E int FDECL(weight, (struct obj *));
|
|||||||
E struct obj *FDECL(mkgold, (long,int,int));
|
E struct obj *FDECL(mkgold, (long,int,int));
|
||||||
E struct obj *FDECL(mkcorpstat,
|
E struct obj *FDECL(mkcorpstat,
|
||||||
(int,struct monst *,struct permonst *,int,int,BOOLEAN_P));
|
(int,struct monst *,struct permonst *,int,int,BOOLEAN_P));
|
||||||
|
E int FDECL(corpse_revive_type, (struct obj *));
|
||||||
E struct obj *FDECL(obj_attach_mid, (struct obj *, unsigned));
|
E struct obj *FDECL(obj_attach_mid, (struct obj *, unsigned));
|
||||||
E struct monst *FDECL(get_mtraits, (struct obj *, BOOLEAN_P));
|
E struct monst *FDECL(get_mtraits, (struct obj *, BOOLEAN_P));
|
||||||
E struct obj *FDECL(mk_tt_object, (int,int,int));
|
E struct obj *FDECL(mk_tt_object, (int,int,int));
|
||||||
|
|||||||
+24
@@ -926,6 +926,30 @@ boolean init;
|
|||||||
return(otmp);
|
return(otmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the type of monster that this corpse will
|
||||||
|
* revive as, even if it has a monster structure
|
||||||
|
* attached to it. In that case, you can't just
|
||||||
|
* use obj->corpsenm, because the stored monster
|
||||||
|
* type can, and often is, different.
|
||||||
|
* The return value is an index into mons[].
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
corpse_revive_type(obj)
|
||||||
|
struct obj *obj;
|
||||||
|
{
|
||||||
|
int revivetype;
|
||||||
|
struct monst *mtmp;
|
||||||
|
if (obj->oxlth && obj->oattached == OATTACHED_MONST &&
|
||||||
|
((mtmp = get_mtraits(obj, FALSE)) != (struct monst *)0)) {
|
||||||
|
/* mtmp is a temporary pointer to a monster's stored
|
||||||
|
attributes, not a real monster */
|
||||||
|
revivetype = mtmp->mnum;
|
||||||
|
} else
|
||||||
|
revivetype = obj->corpsenm;
|
||||||
|
return revivetype;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attach a monster id to an object, to provide
|
* Attach a monster id to an object, to provide
|
||||||
* a lasting association between the two.
|
* a lasting association between the two.
|
||||||
|
|||||||
@@ -1559,8 +1559,27 @@ struct obj *obj, *otmp;
|
|||||||
case SPE_TURN_UNDEAD:
|
case SPE_TURN_UNDEAD:
|
||||||
if (obj->otyp == EGG)
|
if (obj->otyp == EGG)
|
||||||
revive_egg(obj);
|
revive_egg(obj);
|
||||||
else
|
else {
|
||||||
|
int corpsenm = (obj->otyp == CORPSE) ?
|
||||||
|
corpse_revive_type(obj) : 0;
|
||||||
res = !!revive(obj);
|
res = !!revive(obj);
|
||||||
|
if (res && corpsenm && Role_if(PM_HEALER)) {
|
||||||
|
boolean u_noticed = FALSE;
|
||||||
|
if (Hallucination) {
|
||||||
|
You_hear("the sound of a defibrillator.");
|
||||||
|
u_noticed = TRUE;
|
||||||
|
} else if (!Blind) {
|
||||||
|
You("observe %s %s change dramatically.",
|
||||||
|
s_suffix(an(mons[corpsenm].mname)),
|
||||||
|
nonliving(&mons[corpsenm]) ?
|
||||||
|
"motility" : "health");
|
||||||
|
}
|
||||||
|
if (u_noticed) {
|
||||||
|
makeknown(otmp->otyp);
|
||||||
|
exercise(A_WIS, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case WAN_OPENING:
|
case WAN_OPENING:
|
||||||
case SPE_KNOCK:
|
case SPE_KNOCK:
|
||||||
|
|||||||
Reference in New Issue
Block a user