Add more explicit helpless reasons

Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"
This commit is contained in:
Pasi Kallinen
2015-03-29 22:08:46 +03:00
parent 2c9ad065c1
commit 411ee58593
25 changed files with 54 additions and 2 deletions

View File

@@ -737,8 +737,10 @@ struct obj *obj;
pline("Yow! The %s stares back!", mirror);
else
pline("Yikes! You've frozen yourself!");
if (!Hallucination || !rn2(4))
if (!Hallucination || !rn2(4)) {
nomul(-rnd(MAXULEV + 6 - u.ulevel));
multi_reason = "gazing into a mirror";
}
nomovemsg = 0; /* default, "you can move again" */
}
} else if (youmonst.data->mlet == S_VAMPIRE)
@@ -916,6 +918,7 @@ struct obj **optr;
break;
case 2: /* no explanation; it just happens... */
nomovemsg = "";
multi_reason = NULL;
nomul(-rnd(2));
break;
}
@@ -1509,6 +1512,7 @@ int magic; /* 0=Physical, otherwise skill level */
teleds(cc.x, cc.y, TRUE);
sokoban_guilt();
nomul(-1);
multi_reason = "jumping around";
nomovemsg = "";
morehungry(rnd(25));
return 1;

View File

@@ -983,6 +983,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
resisted = TRUE;
} else {
nomul(-3);
multi_reason = "being scared stiff";
nomovemsg = "";
if (magr && magr == u.ustuck && sticks(youmonst.data)) {
u.ustuck = (struct monst *)0;

View File

@@ -21,6 +21,7 @@ char *catmore = 0; /* default pager */
NEARDATA int bases[MAXOCLASSES] = DUMMY;
NEARDATA int multi = 0;
const char *multi_reason = NULL;
NEARDATA int nroom = 0;
NEARDATA int nsubroom = 0;
NEARDATA int occtime = 0;

View File

@@ -890,6 +890,7 @@ struct obj *obj;
}
You("peer into %s...", the(xname(obj)));
nomul(-rnd(10));
multi_reason = "gazing into a crystal ball";
nomovemsg = "";
if (obj->spe <= 0)
pline_The("vision is unclear.");

View File

@@ -1023,6 +1023,7 @@ struct obj *obj;
/* you ought to be able to let go; tough luck */
/* (maybe `move_into_trap()' would be better) */
nomul(-d(2,2));
multi_reason = "stuck in a spider web";
nomovemsg = "You pull free.";
} else if (lev->typ == IRONBARS) {
pline("Clang!");

View File

@@ -1407,6 +1407,7 @@ register struct obj *otmp;
if(cursed(otmp)) return(0);
if(delay) {
nomul(delay);
multi_reason = "disrobing";
if (is_helmet(otmp)) {
/* ick... */
nomovemsg = !strcmp(helm_simple_name(otmp), "hat") ?
@@ -1664,6 +1665,7 @@ dowear()
delay = -objects[otmp->otyp].oc_delay;
if(delay){
nomul(delay);
multi_reason = "dressing up";
if(is_boots(otmp)) afternmv = Boots_on;
if(is_helmet(otmp)) afternmv = Helmet_on;
if(is_gloves(otmp)) afternmv = Gloves_on;

View File

@@ -693,6 +693,7 @@ hurtle(dx, dy, range, verbose)
if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */
nomul(-range);
multi_reason = "moving through the air";
nomovemsg = ""; /* it just happens */
if (verbose)
You("%s in the opposite direction.", range > 1 ? "hurtle" : "float");

View File

@@ -962,6 +962,7 @@ register int pm;
/* A pile of gold can't ride. */
if (u.usteed) dismount_steed(DISMOUNT_FELL);
nomul(-tmp);
multi_reason = "pretending to be a pile of gold";
Sprintf(buf, Hallucination ?
"You suddenly dread being peeled and mimic %s again!" :
"You now prefer mimicking %s again.",
@@ -1479,6 +1480,7 @@ struct obj *obj;
pline_The("world spins and %s %s.", what, where);
incr_itimeout(&HDeaf, duration);
nomul(-duration);
multi_reason = "unconscious from rotten food";
nomovemsg = "You are conscious again.";
afternmv = Hear_again;
return(1);
@@ -2677,6 +2679,7 @@ boolean incr;
if (!Levitation) selftouch("Falling, you");
incr_itimeout(&HDeaf, duration);
nomul(-duration);
multi_reason = "fainted from lack of food";
nomovemsg = "You regain consciousness.";
afternmv = unfaint;
newhs = FAINTED;
@@ -2853,6 +2856,7 @@ vomit() /* A good idea from David Neves */
else
make_sick(0L, (char *)0, TRUE, SICK_VOMITABLE);
nomul(-2);
multi_reason = "vomiting";
nomovemsg = You_can_move_again;
}

View File

@@ -465,7 +465,12 @@ int how;
Sprintf(eos(buf), " called %s", MNAME(mtmp));
}
if (multi) Strcat(buf, ", while helpless");
if (multi) {
if (multi_reason)
Sprintf(eos(buf), ", while %s", multi_reason);
else
Strcat(buf, ", while helpless");
}
Strcpy(killer.name, buf);
if (mptr->mlet == S_WRAITH)
u.ugrave_arise = PM_WRAITH;

View File

@@ -1568,6 +1568,7 @@ domove()
/* must come after we finished picking up, in spoteffects() */
if (cause_delay) {
nomul(-2);
multi_reason = "dragging an iron ball";
nomovemsg = "";
}
@@ -2434,6 +2435,7 @@ nomul(nval)
u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */
u.usleep = 0;
multi = nval;
if (nval == 0) multi_reason = NULL;
context.travel = context.travel1 = context.mv = context.run = 0;
}
@@ -2448,6 +2450,7 @@ const char *msg_override;
if (*nomovemsg) pline1(nomovemsg);
nomovemsg = 0;
u.usleep = 0;
multi_reason = NULL;
if (afternmv) (*afternmv)();
afternmv = 0;
}

View File

@@ -634,12 +634,14 @@ int spellnum;
if (multi >= 0)
You("stiffen briefly.");
nomul(-1);
multi_reason = "paralyzed by a monster";
} else {
if (multi >= 0)
You("are frozen in place!");
dmg = 4 + (int)mtmp->m_lev;
if (Half_spell_damage) dmg = (dmg + 1) / 2;
nomul(-dmg);
multi_reason = "paralyzed by a monster";
}
nomovemsg = 0;
dmg = 0;

View File

@@ -1053,6 +1053,7 @@ dopois:
else You("are frozen by %s!", mon_nam(mtmp));
nomovemsg = You_can_move_again;
nomul(-rnd(10));
multi_reason = "paralyzed by a monster";
exercise(A_DEX, FALSE);
}
}

View File

@@ -2121,6 +2121,7 @@ int held;
/* even if the trap fails, you've used up this turn */
if (multi >= 0) { /* in case we didn't become paralyzed */
nomul(-1);
multi_reason = "opening a container";
nomovemsg = "";
}
return 1;
@@ -2630,6 +2631,7 @@ struct obj *box; /* or bag */
/* even if the trap fails, you've used up this turn */
if (multi >= 0) { /* in case we didn't become paralyzed */
nomul(-1);
multi_reason = "tipping a container";
nomovemsg = "";
}
} else if (box->otyp == BAG_OF_TRICKS || box->otyp == HORN_OF_PLENTY) {

View File

@@ -1285,6 +1285,7 @@ dogaze()
-d((int)mtmp->m_lev+1,
(int)mtmp->data->mattk[0].damd)
: -200);
multi_reason = "frozen by a monster's gaze";
nomovemsg = 0;
return 1;
} else

View File

@@ -375,6 +375,7 @@ ghost_from_bottle()
if(flags.verbose)
You("are frightened to death, and unable to move.");
nomul(-3);
multi_reason = "being frightened to death";
nomovemsg = "You regain your composure.";
}
@@ -678,6 +679,7 @@ peffects(otmp)
Your("%s are frozen to the %s!",
makeplural(body_part(FOOT)), surface(u.ux, u.uy));
nomul(-(rn1(10, 25 - 12*bcsign(otmp))));
multi_reason = "frozen by a potion";
nomovemsg = You_can_move_again;
exercise(A_DEX, FALSE);
}
@@ -1467,6 +1469,7 @@ register struct obj *obj;
if (!Free_action) {
pline("%s seems to be holding you.", Something);
nomul(-rnd(5));
multi_reason = "frozen by a potion";
nomovemsg = You_can_move_again;
exercise(A_DEX, FALSE);
} else You("stiffen momentarily.");
@@ -1476,6 +1479,7 @@ register struct obj *obj;
if (!Free_action && !Sleep_resistance) {
You_feel("rather tired.");
nomul(-rnd(5));
multi_reason = "sleeping off a magical draught";
nomovemsg = You_can_move_again;
exercise(A_DEX, FALSE);
} else You("yawn.");

View File

@@ -1269,6 +1269,7 @@ dosacrifice()
dmon->mpeaceful = TRUE;
You("are terrified, and unable to move.");
nomul(-3);
multi_reason = "being terrified of a demon";
nomovemsg = 0;
} else pline_The("%s.", demonless_msg);
}
@@ -1655,6 +1656,7 @@ dopray()
}
}
nomul(-3);
multi_reason = "praying";
nomovemsg = "You finish your prayer.";
afternmv = prayer_done;
@@ -1817,6 +1819,7 @@ doturn()
}
}
nomul(-5);
multi_reason = "trying to turn the monsters";
nomovemsg = You_can_move_again;
return(1);
}

View File

@@ -475,6 +475,7 @@ int roomno;
if (flags.verbose)
You("are frightened to death, and unable to move.");
nomul(-3);
multi_reason = "being terrified of a demon";
nomovemsg = "You regain your composure.";
}
}

View File

@@ -710,6 +710,7 @@ register struct monst *mtmp;
pline("%s rattles noisily.", Monnam(mtmp));
You("freeze for a moment.");
nomul(-2);
multi_reason = "scared by rattling";
nomovemsg = 0;
break;
case MS_LAUGH:

View File

@@ -329,6 +329,7 @@ learn(VOID_ARGS)
context.spbook.book = 0; /* no longer studying */
context.spbook.o_id = 0;
nomul(context.spbook.delay); /* remaining delay is uninterrupted */
multi_reason = "reading a book";
nomovemsg = 0;
context.spbook.delay = 0;
return(0);
@@ -506,6 +507,7 @@ register struct obj *spellbook;
boolean gone = cursed_book(spellbook);
nomul(context.spbook.delay); /* study time */
multi_reason = "reading a book";
nomovemsg = 0;
context.spbook.delay = 0;
if(gone || !rn2(3)) {
@@ -522,6 +524,7 @@ register struct obj *spellbook;
spellbook->in_use = FALSE;
}
nomul(context.spbook.delay);
multi_reason = "reading a book";
nomovemsg = 0;
context.spbook.delay = 0;
return(1);

View File

@@ -361,6 +361,7 @@ gotobj:
named++;
/* the following is to set multi for later on */
nomul(-armordelay);
multi_reason = "taking off clothes";
nomovemsg = 0;
remove_worn_item(otmp, TRUE);
otmp->cursed = curssv;

View File

@@ -51,6 +51,7 @@ stoned_dialogue()
case 3: /* limbs turned to stone */
stop_occupation();
nomul(-3); /* can't move anymore */
multi_reason = "getting stoned";
nomovemsg = You_can_move_again; /* not unconscious */
break;
default:
@@ -377,6 +378,7 @@ nh_timeout()
if (u.umoved && !Levitation) {
slip_or_trip();
nomul(-2);
multi_reason = "fumbling";
nomovemsg = "";
/* The more you are carrying the more likely you
* are to make noise when you fumble. Adjustments
@@ -409,6 +411,7 @@ boolean wakeup_msg;
{
stop_occupation();
nomul(how_long);
multi_reason = "sleeping";
/* generally don't notice sounds while sleeping */
if (wakeup_msg && multi == how_long) {
/* caller can follow with a direct call to Hear_again() if
@@ -1271,6 +1274,7 @@ do_storms()
if(!u.uinvulnerable) {
stop_occupation();
nomul(-3);
multi_reason = "hiding from thunderstorm";
nomovemsg = 0;
}
} else

View File

@@ -4447,6 +4447,7 @@ boolean disarm;
if (!Free_action) {
pline("Suddenly you are frozen in place!");
nomul(-d(5, 6));
multi_reason = "frozen by a trap";
exercise(A_DEX, FALSE);
nomovemsg = You_can_move_again;
} else You("momentarily stiffen.");

View File

@@ -1871,6 +1871,7 @@ register struct attack *mattk;
You("digest %s.", mon_nam(mdef));
if (Slow_digestion) tmp *= 2;
nomul(-tmp);
multi_reason = "digesting something";
nomovemsg = msgbuf;
} else pline1(msgbuf);
if (pd == &mons[PM_GREEN_SLIME]) {
@@ -2353,6 +2354,7 @@ boolean wep_was_destroyed;
You("are frozen by %s gaze!",
s_suffix(mon_nam(mon)));
nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127);
multi_reason = "frozen by a monster's gaze";
nomovemsg = 0;
}
} else {
@@ -2366,6 +2368,7 @@ boolean wep_was_destroyed;
You("are frozen by %s!", mon_nam(mon));
nomovemsg = You_can_move_again;
nomul(-tmp);
multi_reason = "frozen by a monster";
exercise(A_DEX, FALSE);
}
break;