diff -pruN slashem-0.0.7E7F1-official-release/include/extern.h slashem-0.0.7E7F1-box/include/extern.h --- slashem-0.0.7E7F1-official-release/include/extern.h 2005-07-02 09:24:44.000000000 +0200 +++ slashem-0.0.7E7F1-box/include/extern.h 2005-11-24 17:49:27.000000000 +0100 @@ -949,6 +949,7 @@ E int FDECL(pick_lock, (struct obj **)); E int NDECL(doforce); E boolean FDECL(boxlock, (struct obj *,struct obj *)); E boolean FDECL(doorlock, (struct obj *,int,int)); +E void FDECL(chest_shatter_msg, (struct obj *)); E int NDECL(doopen); E int NDECL(doclose); E int FDECL(artifact_door, (int,int)); diff -pruN slashem-0.0.7E7F1-official-release/src/lock.c slashem-0.0.7E7F1-box/src/lock.c --- slashem-0.0.7E7F1-official-release/src/lock.c 2005-07-02 09:24:44.000000000 +0200 +++ slashem-0.0.7E7F1-box/src/lock.c 2005-11-24 17:57:24.000000000 +0100 @@ -21,7 +21,6 @@ STATIC_VAR NEARDATA struct xlock_s { STATIC_DCL const char *NDECL(lock_action); STATIC_DCL boolean FDECL(obstructed,(int,int)); -STATIC_DCL void FDECL(chest_shatter_msg, (struct obj *)); boolean picking_lock(x, y) @@ -1126,7 +1125,7 @@ int x, y; return res; } -STATIC_OVL void +void chest_shatter_msg(otmp) struct obj *otmp; { diff -pruN slashem-0.0.7E7F1-official-release/src/sit.c slashem-0.0.7E7F1-box/src/sit.c --- slashem-0.0.7E7F1-official-release/src/sit.c 2005-07-02 09:24:44.000000000 +0200 +++ slashem-0.0.7E7F1-box/src/sit.c 2005-11-24 18:01:48.000000000 +0100 @@ -39,7 +39,7 @@ int dosit() { static const char sit_message[] = "sit on the %s."; - register struct trap *trap; + register struct trap *trap = t_at(u.ux, u.uy); register int typ = levl[u.ux][u.uy].typ; @@ -60,16 +60,77 @@ dosit() goto in_water; } - if(OBJ_AT(u.ux, u.uy)) { + if (!u.utrap && trap && (trap->ttyp == SPIKED_PIT || trap->ttyp == PIT)) + { + You("sit at the edge of the %spit%s.", + (trap->ttyp == SPIKED_PIT) ? "spiked " : "", + (Hallucination) ? " and contemplate the meaning of life." : ""); + } else if(OBJ_AT(u.ux, u.uy)) { + register struct obj *obj; obj = level.objects[u.ux][u.uy]; You("sit on %s.", the(xname(obj))); if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH)) - pline("It's not very comfortable..."); - - } else if ((trap = t_at(u.ux, u.uy)) != 0 || - (u.utrap && (u.utraptype >= TT_LAVA))) { + pline("It's not very comfortable..."); + + /* + Heavy monsters (dragons, titanotheres, etc.) have an + 80% chance of breaking open a box by sitting on it. + */ + if(Is_box(obj) && youmonst.data->cwt >= 2600 && rn2(5)) { + struct monst *shkp; + boolean costly = (*u.ushops && costly_spot(u.ux, u.uy)); + long loss = 0L; + boolean otrp = obj->otrapped; + struct obj *otmp; + + + shkp = costly ? shop_keeper(*u.ushops) : 0; + + +#if 0 + /* + This is what should happen, but doesn't, because + we don't know what to call the player's "seat". + Also, it seems odd that poison needles should be + able to miss such a big target! + */ + if (otrp) (void) chest_trap(kickobj, LEG, FALSE); +#endif + + + pline("%s shatters under your weight!", The(xname(obj))); + + /* Put the contents on ground at the hero's feet. */ + while ((otmp = obj->cobj) != 0) { + obj_extract_self(otmp); + if(!rn2(3) || otmp->oclass == POTION_CLASS) { + chest_shatter_msg(otmp); + if (costly) + loss += stolen_value(otmp, u.ux, u.uy, + (boolean)shkp->mpeaceful, TRUE, TRUE); + if (otmp->quan == 1L) { + obfree(otmp, (struct obj *) 0); + continue; + } + useup(otmp); + } + place_object(otmp, u.ux, u.uy); + stackobj(otmp); + } + + + if (costly) + loss += stolen_value(obj, u.ux, u.uy, + (boolean)shkp->mpeaceful, TRUE, TRUE); + if(loss) + You("owe %ld %s for objects destroyed.", loss, currency(loss)); + delobj(obj); + } + + + } else if (trap || (u.utrap && (u.utraptype >= TT_LAVA))) { if (u.utrap) { exercise(A_WIS, FALSE); /* you're getting stuck longer */