]> granicus.if.org Git - nethack/commitdiff
Fix B03001
authornethack.allison <nethack.allison>
Sun, 25 May 2003 22:47:12 +0000 (22:47 +0000)
committernethack.allison <nethack.allison>
Sun, 25 May 2003 22:47:12 +0000 (22:47 +0000)
"You can't loot or pick up containers on the floor if you're not
skilled enough to reach them from your saddle, but you can check
for and disarm traps on them; this seems a little odd. (Likewise,
being able to set land mines and beartraps while riding.)"

doc/fixes34.2
src/apply.c
src/trap.c

index 27946b4021be3130b81d52d7c18b3963f7aac3e6..f39c0886dfe16199ac0ce9826783e69b6362dc51 100644 (file)
@@ -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
index a1f5debabf84dd62055eff7793d91bc34182cd10..36d6bbf58672cd9f497d920a38437aaf44e9d684 100644 (file)
@@ -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.");
index 4694befc9c3ef0e40ac037bff8738800b4b48096..7cc2cd78f5247711d728be4a15680c86975e91d6 100644 (file)
@@ -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))) {