diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 27946b402..f39c0886d 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -79,6 +79,8 @@ curse candelabrum in bones, like other similar artifacts detecting a trap in a chest while confused should not exercise wisdom any golem statue hit with stone-to-flesh spell animates as flesh golem correct invalid startup gender selection +can no longer untrap floor containers during unskilled riding +can no longer easily set land mines and bear traps during unskilled riding Platform- and/or Interface-Specific Fixes diff --git a/src/apply.c b/src/apply.c index a1f5debab..36d6bbf58 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1817,12 +1817,14 @@ static struct trapinfo { struct obj *tobj; xchar tx, ty; int time_needed; + boolean force_bungle; } trapinfo; void reset_trapset() { trapinfo.tobj = 0; + trapinfo.force_bungle = 0; } /* touchstones - by Ken Arnold */ @@ -2021,7 +2023,38 @@ struct obj *otmp; trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4; /*[fumbling and/or confusion and/or cursed object check(s) should be incorporated here instead of in set_trap]*/ +#ifdef STEED + if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) { + char buf[BUFSZ]; + boolean chance; + if (Fumbling || otmp->cursed) chance = (rnl(10) > 3); + else chance = (rnl(10) > 5); + You("aren't very skilled at reaching from %s.", + mon_nam(u.usteed)); + Sprintf(buf, "Continue your attempt to set %s?", + the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation)); + if(yn(buf) == 'y') { + if (chance) { + switch(ttyp) { + case LANDMINE: /* set it off */ + trapinfo.time_needed = 0; + trapinfo.force_bungle = TRUE; + break; + case BEAR_TRAP: /* drop it without arming it */ + reset_trapset(); + You("drop %s!", + the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation)); + dropx(otmp); + return; + } + } + } else { + reset_trapset(); + return; + } + } +#endif You("begin setting %s %s.", shk_your(buf, otmp), defsyms[trap_to_defsym(what_trap(ttyp))].explanation); @@ -2055,9 +2088,11 @@ set_trap() if (*in_rooms(u.ux,u.uy,SHOPBASE)) { add_damage(u.ux, u.uy, 0L); /* schedule removal */ } - You("finish arming %s.", - the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation)); - if ((otmp->cursed || Fumbling) && (rnl(10) > 5)) dotrap(ttmp, 0); + if (!trapinfo.force_bungle) + You("finish arming %s.", + the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation)); + if (((otmp->cursed || Fumbling) && (rnl(10) > 5)) || trapinfo.force_bungle) + dotrap(ttmp, 0); } else { /* this shouldn't happen */ Your("trap setting attempt fails."); diff --git a/src/trap.c b/src/trap.c index 4694befc9..7cc2cd78f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3392,7 +3392,13 @@ boolean force; case 'q': return(0); case 'n': continue; } - +#ifdef STEED + if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) { + You("aren't skilled enough to reach from %s.", + mon_nam(u.usteed)); + return(0); + } +#endif if((otmp->otrapped && (force || (!confused && rn2(MAXULEV + 1 - u.ulevel) < 10))) || (!force && confused && !rn2(3))) {