fix #H2591 - sitting while swallowed (trunk only)

From a bug report, sitting while
swallowed gave "you are sitting on air," and the intended message "there are
no seats in here" was never reached.  Move the latter so that it works, and
add a new one when you try to sit while a grabber is holding on to you.

     Also add theft vs donning fixes entry which was left out two days ago.
This commit is contained in:
nethack.rankin
2012-02-06 04:17:25 +00:00
parent a2f15cfd61
commit 6ac27851a6
2 changed files with 19 additions and 24 deletions
+5
View File
@@ -404,6 +404,11 @@ items conferring life drain resistance were affected by drain life spell
'a'pply command could be used to recogniize undiscovered potions of oil 'a'pply command could be used to recogniize undiscovered potions of oil
fix replacing an existing bones file in wizard mode [load?y, unlink?n, die?y, fix replacing an existing bones file in wizard mode [load?y, unlink?n, die?y,
save?y, replace?y] for configurations using external file compression save?y, replace?y] for configurations using external file compression
theft of worn armor with wear/unwear delay would interfere with completion of
wearing or unwearing some other armor which also imposed a delay
(disrupted wear attempt for +N helm of brilliance would result in loss
of N points of Int and Wis; gauntlets of dexterity had similar problem)
#sit while swallowed would give the wrong message
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+14 -24
View File
@@ -42,23 +42,32 @@ dosit()
register struct trap *trap = t_at(u.ux,u.uy); register struct trap *trap = t_at(u.ux,u.uy);
register int typ = levl[u.ux][u.uy].typ; register int typ = levl[u.ux][u.uy].typ;
#ifdef STEED #ifdef STEED
if (u.usteed) { if (u.usteed) {
You("are already sitting on %s.", mon_nam(u.usteed)); You("are already sitting on %s.", mon_nam(u.usteed));
return (0); return (0);
} }
#endif #endif
if (u.uundetected && is_hider(youmonst.data) && u.umonnum != PM_TRAPPER) if (u.uundetected && is_hider(youmonst.data) && u.umonnum != PM_TRAPPER)
u.uundetected = 0; /* no longer on the ceiling */ u.uundetected = 0; /* no longer on the ceiling */
if (!can_reach_floor(FALSE)) { if (!can_reach_floor(FALSE)) {
if (Levitation) if (u.uswallow)
There("are no seats in here!");
else if (Levitation)
You("tumble in place."); You("tumble in place.");
else else
You("are sitting on air."); You("are sitting on air.");
return 0; return 0;
} else if (u.ustuck && !sticks(youmonst.data)) {
/* holding monster is next to hero rather than beneath, but
hero is in no condition to actually sit at has/her own spot */
if (humanoid(u.ustuck->data))
pline("%s won't offer %s lap.",
Monnam(u.ustuck), mhis(u.ustuck));
else
pline("%s has no lap.", Monnam(u.ustuck));
return 0;
} else if (is_pool(u.ux, u.uy) && !Underwater) { /* water walking */ } else if (is_pool(u.ux, u.uy) && !Underwater) { /* water walking */
goto in_water; goto in_water;
} }
@@ -72,7 +81,6 @@ dosit()
You("sit on %s.", the(xname(obj))); You("sit on %s.", the(xname(obj)));
if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH)) if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
pline("It's not very comfortable..."); pline("It's not very comfortable...");
} else if (trap != 0 || (u.utrap && (u.utraptype >= TT_LAVA))) { } else if (trap != 0 || (u.utrap && (u.utraptype >= TT_LAVA))) {
if (u.utrap) { if (u.utrap) {
exercise(A_WIS, FALSE); /* you're getting stuck longer */ exercise(A_WIS, FALSE); /* you're getting stuck longer */
@@ -121,29 +129,19 @@ dosit()
(void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst);
#ifdef SINKS #ifdef SINKS
} else if(IS_SINK(typ)) { } else if(IS_SINK(typ)) {
You(sit_message, defsyms[S_sink].explanation); You(sit_message, defsyms[S_sink].explanation);
Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside");
#endif #endif
} else if(IS_ALTAR(typ)) { } else if(IS_ALTAR(typ)) {
You(sit_message, defsyms[S_altar].explanation); You(sit_message, defsyms[S_altar].explanation);
altar_wrath(u.ux, u.uy); altar_wrath(u.ux, u.uy);
} else if(IS_GRAVE(typ)) { } else if(IS_GRAVE(typ)) {
You(sit_message, defsyms[S_grave].explanation); You(sit_message, defsyms[S_grave].explanation);
} else if(typ == STAIRS) { } else if(typ == STAIRS) {
You(sit_message, "stairs"); You(sit_message, "stairs");
} else if(typ == LADDER) { } else if(typ == LADDER) {
You(sit_message, "ladder"); You(sit_message, "ladder");
} else if (is_lava(u.ux, u.uy)) { } else if (is_lava(u.ux, u.uy)) {
/* must be WWalking */ /* must be WWalking */
You(sit_message, "lava"); You(sit_message, "lava");
burn_away_slime(); burn_away_slime();
@@ -154,18 +152,12 @@ dosit()
pline_The("lava burns you!"); pline_The("lava burns you!");
losehp(d((Fire_resistance ? 2 : 10), 10), /* lava damage */ losehp(d((Fire_resistance ? 2 : 10), 10), /* lava damage */
"sitting on lava", KILLED_BY); "sitting on lava", KILLED_BY);
} else if (is_ice(u.ux, u.uy)) { } else if (is_ice(u.ux, u.uy)) {
You(sit_message, defsyms[S_ice].explanation); You(sit_message, defsyms[S_ice].explanation);
if (!Cold_resistance) pline_The("ice feels cold."); if (!Cold_resistance) pline_The("ice feels cold.");
} else if (typ == DRAWBRIDGE_DOWN) { } else if (typ == DRAWBRIDGE_DOWN) {
You(sit_message, "drawbridge"); You(sit_message, "drawbridge");
} else if(IS_THRONE(typ)) { } else if(IS_THRONE(typ)) {
You(sit_message, defsyms[S_throne].explanation); You(sit_message, defsyms[S_throne].explanation);
if (rnd(6) > 4) { if (rnd(6) > 4) {
switch (rnd(13)) { switch (rnd(13)) {
@@ -286,7 +278,6 @@ dosit()
pline_The("throne vanishes in a puff of logic."); pline_The("throne vanishes in a puff of logic.");
newsym(u.ux,u.uy); newsym(u.ux,u.uy);
} }
} else if (lays_eggs(youmonst.data)) { } else if (lays_eggs(youmonst.data)) {
struct obj *uegg; struct obj *uegg;
@@ -311,10 +302,9 @@ dosit()
dropy(uegg); dropy(uegg);
stackobj(uegg); stackobj(uegg);
morehungry((int)objects[EGG].oc_nutrition); morehungry((int)objects[EGG].oc_nutrition);
} else if (u.uswallow) } else {
There("are no seats in here!");
else
pline("Having fun sitting on the %s?", surface(u.ux,u.uy)); pline("Having fun sitting on the %s?", surface(u.ux,u.uy));
}
return(1); return(1);
} }