diff -Naurb ../nethack-3.4.2/include/artilist.h ./include/artilist.h --- ../nethack-3.4.2/include/artilist.h Fri Aug 29 21:07:15 2003 +++ ./include/artilist.h Sat Oct 18 17:02:12 2003 @@ -148,6 +148,12 @@ (SPFX_RESTR|SPFX_DFLAG2), 0, M2_UNDEAD, PHYS(5,0), DFNS(AD_BLND), NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 1500L ), + +A("Electric Eel", LONG_THORNED_CHAINWHIP, + (SPFX_RESTR|SPFX_ATTK), 0, 0, + ELEC(3,10), ELEC(0,0), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 3000L ), + + /* * The artifacts for the quest dungeon, all self-willed. */ diff -Naurb ../nethack-3.4.2/src/apply.c ./src/apply.c --- ../nethack-3.4.2/src/apply.c Fri Aug 29 21:07:26 2003 +++ ./src/apply.c Sat Oct 18 17:02:13 2003 @@ -2112,7 +2112,7 @@ struct monst *mtmp; struct obj *otmp; int rx, ry, proficient, res = 0; - const char *msg_slipsfree = "The bullwhip slips free."; + const char *msg_slipsfree = "The whip slips free."; const char *msg_snap = "Snap!"; if (obj != uwep) { @@ -2132,14 +2132,16 @@ if (ACURR(A_DEX) < 6) proficient--; else if (ACURR(A_DEX) >= 14) proficient += (ACURR(A_DEX) - 14); if (Fumbling) --proficient; + /* it's hard snatching things with chains. */ + if (obj->otyp == CHAINWHIP) --proficient; if (proficient > 3) proficient = 3; if (proficient < 0) proficient = 0; if (u.uswallow && attack(u.ustuck)) { - There("is not enough room to flick your bullwhip."); + There("is not enough room to flick your whip."); } else if (Underwater) { - There("is too much resistance to flick your bullwhip."); + There("is too much resistance to flick your whip."); } else if (u.dz < 0) { You("flick a bug off of the %s.",ceiling(u.ux,u.uy)); @@ -2167,7 +2169,8 @@ return 1; } if (otmp && proficient) { - You("wrap your bullwhip around %s on the %s.", + You("wrap your %s around %s on the %s.", + obj_descr[obj->otyp].oc_name, an(singular(otmp, xname)), surface(u.ux, u.uy)); if (rnl(6) || pickup_object(otmp, 1L, TRUE) < 1) pline(msg_slipsfree); @@ -2176,14 +2179,14 @@ } dam = rnd(2) + dbon() + obj->spe; if (dam <= 0) dam = 1; - You("hit your %s with your bullwhip.", body_part(FOOT)); - Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis()); + You("hit your %s with your %s.", body_part(FOOT), obj_descr[obj->otyp].oc_name); + Sprintf(buf, "killed %sself with %s %s", uhim(), uhis(), obj_descr[obj->otyp].oc_name); losehp(dam, buf, NO_KILLER_PREFIX); flags.botl = 1; return 1; } else if ((Fumbling || Glib) && !rn2(5)) { - pline_The("bullwhip slips out of your %s.", body_part(HAND)); + pline_The("%s slips out of your %s.", obj_descr[obj->otyp].oc_name, body_part(HAND)); dropx(obj); } else if (u.utrap && u.utraptype == TT_PIT) { @@ -2224,7 +2227,7 @@ coord cc; cc.x = rx; cc.y = ry; - You("wrap your bullwhip around %s.", wrapped_what); + You("wrap your %s around %s.", obj_descr[obj->otyp].oc_name, wrapped_what); if (proficient && rn2(proficient + 2)) { if (!mtmp || enexto(&cc, rx, ry, youmonst.data)) { You("yank yourself out of the pit!"); @@ -2257,7 +2260,8 @@ } else mon_hand = 0; /* lint suppression */ - You("wrap your bullwhip around %s %s.", + You("wrap your %s around %s %s.", + obj_descr[obj->otyp].oc_name, s_suffix(mon_nam(mtmp)), onambuf); if (gotit && otmp->cursed) { pline("%s welded to %s %s%c", @@ -2335,7 +2339,8 @@ if (mtmp->m_ap_type && !Protection_from_shape_changers && !sensemon(mtmp)) stumble_onto_mimic(mtmp); - else You("flick your bullwhip towards %s.", mon_nam(mtmp)); + else You("flick your %s towards %s.", obj_descr[obj->otyp].oc_name, + mon_nam(mtmp)); if (proficient) { if (attack(mtmp)) return 1; else pline(msg_snap); @@ -2344,7 +2349,7 @@ } else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) { /* it must be air -- water checked above */ - You("snap your whip through thin air."); + You("snap your %s through thin air.", obj_descr[obj->otyp].oc_name); } else { pline(msg_snap); @@ -2464,6 +2469,93 @@ } STATIC_OVL int +use_longwhip (obj) +struct obj *obj; +{ + int res = 0, typ, min_range = 1, max_range = 4, tohit; + coord cc; + struct monst *mtmp; + struct obj *otmp; + + /* Are you allowed to use the whip? */ + if (u.uswallow) { + pline(not_enough_room); + return (0); + } + if (obj != uwep) { + if (!wield_tool(obj, "cast")) return(0); + else res = 1; + } + /* assert(obj == uwep); */ + + /* Prompt for a location */ + pline(where_to_hit); + cc.x = u.ux; + cc.y = u.uy; + if (getpos(&cc, TRUE, "the spot to hit") < 0) + return 0; /* user pressed ESC */ + + /* Calculate range */ + typ = uwep_skill_type(); + if (typ == P_NONE || P_SKILL(typ) <= P_BASIC) max_range = 4; + else if (P_SKILL(typ) == P_SKILLED) max_range = 5; + else max_range = 8; + if (distu(cc.x, cc.y) > max_range) { + pline("Too far!"); + return (res); + } else if (distu(cc.x, cc.y) <= min_range) { + pline("Too close!"); + return (res); + } else if (!cansee(cc.x, cc.y)) { + You(cant_see_spot); + return (res); + } + + if (mtmp = m_at(cc.x, cc.y)) { + /* monster */ + if (!Levitation && is_flyer(mtmp->data)) { + if (unsolid(mtmp->data)) { + You("try to pull in %s, but the whip passes through %s!", + mon_nam(mtmp), mhim(mtmp)); + return (1); + } else if (((mtmp->data->msize == MZ_GIGANTIC && ACURR(A_STR) == 25) + || (mtmp->data->msize >= MZ_LARGE && ACURR(A_STR) > STR18(50)) + || (mtmp->data->msize == MZ_MEDIUM && ACURR(A_STR) > 17) + || (mtmp->data->msize < MZ_MEDIUM)) + && P_SKILL(P_WHIP) > P_BASIC) { + You("pull in %s!", mon_nam(mtmp)); + mtmp->mundetected = 0; + mhurtle(mtmp, u.ux - mtmp->mx, u.uy - mtmp->my, 1); + /* mhurtle(mtmp, u.ux - mtmp->mx, u.uy - mtmp->my, 1); */ + /* distu(mtmp->mx, mtmp->my)); */ + return (1); + } else { + You("try to pull in %s, but %s's too big!", + mon_nam(mtmp), mhe(mtmp)); + return (1); + } + } else { + (void) thitmonst(mtmp, obj); + return (1); + } + } else if (otmp = level.objects[cc.x][cc.y]) { + /* object */ + if (P_SKILL(P_WHIP) < P_SKILLED) + pline("The whip slips free."); + else { + You("snag an object from the %s!", surface(cc.x, cc.y)); + (void) pickup_object(otmp, 1L, FALSE); + /* If pickup fails, leave it alone */ + newsym(cc.x, cc.y); + } + return (1); + } + + pline("Snap!"); + return (1); +} + +STATIC_OVL int use_grapple (obj) struct obj *obj; { @@ -2809,7 +2901,12 @@ res = use_cream_pie(obj); break; case BULLWHIP: + case CHAINWHIP: res = use_whip(obj); + break; + case LONG_BULLWHIP: + case LONG_THORNED_CHAINWHIP: + res = use_longwhip(obj); break; case GRAPPLING_HOOK: res = use_grapple(obj); diff -Naurb ../nethack-3.4.2/src/artifact.c ./src/artifact.c --- ../nethack-3.4.2/src/artifact.c Fri Aug 29 21:07:26 2003 +++ ./src/artifact.c Sat Oct 18 17:02:13 2003 @@ -990,7 +990,8 @@ } if (attacks(AD_ELEC, otmp)) { if (realizes_damage) - pline_The("massive hammer hits%s %s%c", + pline_The("%s hits%s %s%c", + otmp->otyp == WAR_HAMMER ? "massive hammer" : "whip", !spec_dbon_applies ? "" : "! Lightning strikes", hittee, !spec_dbon_applies ? '.' : '!'); if (!rn2(5)) (void) destroy_mitem(mdef, RING_CLASS, AD_ELEC); diff -Naurb ../nethack-3.4.2/src/makemon.c ./src/makemon.c --- ../nethack-3.4.2/src/makemon.c Fri Aug 29 21:07:32 2003 +++ ./src/makemon.c Sat Oct 18 17:02:13 2003 @@ -398,7 +398,7 @@ case S_DEMON: switch (mm) { case PM_BALROG: - (void)mongets(mtmp, BULLWHIP); + (void)mongets(mtmp, LONG_THORNED_CHAINWHIP); (void)mongets(mtmp, BROADSWORD); break; case PM_ORCUS: diff -Naurb ../nethack-3.4.2/src/objects.c ./src/objects.c --- ../nethack-3.4.2/src/objects.c Fri Aug 29 21:07:36 2003 +++ ./src/objects.c Sat Oct 18 17:02:13 2003 @@ -95,7 +95,7 @@ 1, 55, 1, 2, 4, 6, 0, IRON, -P_CROSSBOW, HI_METAL), WEAPON("dart", (char *)0, - 1, 1, 0, 60, 1, 2, 3, 2, 0, P, -P_DART, IRON, HI_METAL), + 1, 1, 0, 58, 1, 2, 3, 2, 0, P, -P_DART, IRON, HI_METAL), WEAPON("shuriken", "throwing star", 0, 1, 0, 35, 1, 5, 8, 6, 2, P, -P_SHURIKEN, IRON, HI_METAL), WEAPON("boomerang", (char *)0, @@ -103,7 +103,7 @@ /* spears */ WEAPON("spear", (char *)0, - 1, 1, 0, 50, 30, 3, 6, 8, 0, P, P_SPEAR, IRON, HI_METAL), + 1, 1, 0, 49, 30, 3, 6, 8, 0, P, P_SPEAR, IRON, HI_METAL), WEAPON("elven spear", "runed spear", 0, 1, 0, 10, 30, 3, 7, 8, 0, P, P_SPEAR, WOOD, HI_WOOD), WEAPON("orcish spear", "crude spear", @@ -169,7 +169,7 @@ WEAPON("long sword", (char *)0, 1, 0, 0, 50, 40, 15, 8, 12, 0, S, P_LONG_SWORD, IRON, HI_METAL), WEAPON("two-handed sword", (char *)0, - 1, 0, 1, 22,150, 50, 12, 6, 0, S, P_TWO_HANDED_SWORD, IRON, HI_METAL), + 1, 0, 1, 21,150, 50, 12, 6, 0, S, P_TWO_HANDED_SWORD, IRON, HI_METAL), /* +2d6 large */ WEAPON("katana", "samurai sword", 0, 0, 0, 4, 40, 80, 10, 12, 1, S, P_LONG_SWORD, IRON, HI_METAL), @@ -248,11 +248,21 @@ WEAPON("aklys", "thonged club", 0, 0, 0, 8, 15, 4, 6, 3, 0, B, P_CLUB, IRON, HI_METAL), WEAPON("flail", (char *)0, - 1, 0, 0, 40, 15, 4, 6, 4, 0, B, P_FLAIL, IRON, HI_METAL), + 1, 0, 0, 39, 15, 4, 6, 4, 0, B, P_FLAIL, IRON, HI_METAL), /* +1 small, +1d4 large */ /* misc */ WEAPON("bullwhip", (char *)0, 1, 0, 0, 2, 20, 4, 2, 1, 0, 0, P_WHIP, LEATHER, CLR_BROWN), +WEAPON("long bullwhip", (char *)0, + 1, 0, 0, 1, 20, 4, 2, 2, 0, 0, P_WHIP, LEATHER, CLR_BROWN), +WEAPON("chainwhip", (char *)0, + 1, 0, 0, 0,120, 10, 4, 2,-1, 0, P_WHIP, IRON, HI_METAL), +WEAPON("thorned chainwhip", (char *)0, + 1, 0, 0, 4, 60, 20, 7, 5,-1, S, P_WHIP, MITHRIL, HI_METAL), +WEAPON("long thorned chainwhip", (char *)0, + 1, 0, 0, 0, 60, 20, 7, 7, 0, S, P_WHIP, MITHRIL, HI_METAL), + + /* bows */ BOW("bow", (char *)0, 1, 24, 30, 60, 0, WOOD, P_BOW, HI_WOOD), diff -Naurb ../nethack-3.4.2/src/wield.c ./src/wield.c --- ../nethack-3.4.2/src/wield.c Fri Aug 29 21:07:43 2003 +++ ./src/wield.c Sat Oct 18 17:02:13 2003 @@ -264,7 +264,7 @@ return (doswapweapon()); else if (wep == uquiver) setuqwep((struct obj *) 0); - else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL + else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_CHAIN #ifdef STEED | W_SADDLE #endif @@ -273,13 +273,20 @@ return (0); } + /* it's a chain? */ + if (wep && wep->otyp == IRON_CHAIN) { + pline("You figure out your iron chain can be used as a chainwhip!"); + wep->oclass = WEAPON_CLASS; + wep->otyp = CHAINWHIP; + result = ready_weapon(wep); + } else { /* Set your new primary weapon */ oldwep = uwep; result = ready_weapon(wep); if (flags.pushweapon && oldwep && uwep != oldwep) setuswapwep(oldwep); untwoweapon(); - + } return (result); }