From: nethack.rankin Date: Fri, 15 Dec 2006 04:54:22 +0000 (+0000) Subject: merge javelin and spear skills (trunk only) X-Git-Tag: MOVE2GIT~783 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54bbb38ee0e2e01f28a3a0139bbcb10b69da2338;p=nethack merge javelin and spear skills (trunk only) Part of "multi-shot throwing proposal" last January. Unfortunately some of the bits that I had implemented back then have vanished, so I'm doing it over from scratch. There were three main parts: 1) allow multi-shot volley throwing for all stackable weapons (affects knives, javelins, spears, and boomerangs; other weapons either don't stack or are already multi-shot); 2) make worm teeth and crysknives be stackable like ordinary knives; 3) merge spear and javelin skills, so that allocating skill points to their use becomes more attractive and they might get used more. This patch only does #3. Since the monk skill set shrinks by more than any of the other roles, I bumped max skill for escape spells (haste self, invisibility, jumping, levitation, and teleport away) from basic to skilled; that's the only skill adjustment included here. For the couple of roles had different max values for spear and javelin skill; this keeps the higher of the two. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 3aebb5224..ac81d7ac2 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -268,6 +268,7 @@ include time, user ID, and play mode in paniclog entries add oracle and rumor regarding priestly donations anti-magic traps have alternate effect on targets who have magic resistance the Amulet can be offered to Moloch +javelins and spears now share the same weapon skill Platform- and/or Interface-Specific New Features diff --git a/include/obj.h b/include/obj.h index 98e43c032..180771d3c 100644 --- a/include/obj.h +++ b/include/obj.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)obj.h 3.5 2006/04/15 */ +/* SCCS Id: @(#)obj.h 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -164,8 +164,7 @@ struct obj { (objects[otmp->otyp].oc_skill == P_POLEARMS || \ objects[otmp->otyp].oc_skill == P_LANCE)) #define is_spear(otmp) (otmp->oclass == WEAPON_CLASS && \ - objects[otmp->otyp].oc_skill >= P_SPEAR && \ - objects[otmp->otyp].oc_skill <= P_JAVELIN) + objects[otmp->otyp].oc_skill == P_SPEAR) #define is_launcher(otmp) (otmp->oclass == WEAPON_CLASS && \ objects[otmp->otyp].oc_skill >= P_BOW && \ objects[otmp->otyp].oc_skill <= P_CROSSBOW) @@ -173,9 +172,9 @@ struct obj { otmp->oclass == GEM_CLASS) && \ objects[otmp->otyp].oc_skill >= -P_CROSSBOW && \ objects[otmp->otyp].oc_skill <= -P_BOW) -#define ammo_and_launcher(otmp,ltmp) \ - (is_ammo(otmp) && (ltmp) && \ - objects[(otmp)->otyp].oc_skill == -objects[(ltmp)->otyp].oc_skill) +#define matching_launcher(a,l) ((l) && objects[(a)->otyp].oc_skill == \ + -objects[(l)->otyp].oc_skill) +#define ammo_and_launcher(a,l) (is_ammo(a) && matching_launcher(a,l)) #define is_missile(otmp) ((otmp->oclass == WEAPON_CLASS || \ otmp->oclass == TOOL_CLASS) && \ objects[otmp->otyp].oc_skill >= -P_BOOMERANG && \ diff --git a/include/patchlevel.h b/include/patchlevel.h index e7d580a1a..2a133f037 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)patchlevel.h 3.5 2006/07/08 */ +/* SCCS Id: @(#)patchlevel.h 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -13,7 +13,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 37 +#define EDITLEVEL 38 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2006" diff --git a/include/skills.h b/include/skills.h index b666625b8..0c0f0dc14 100644 --- a/include/skills.h +++ b/include/skills.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)skills.h 3.5 1999/10/27 */ +/* SCCS Id: @(#)skills.h 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -37,38 +37,37 @@ #define P_HAMMER 15 /* Heavy head on the end */ #define P_QUARTERSTAFF 16 /* Long-shafted bludgeon */ #define P_POLEARMS 17 -#define P_SPEAR 18 -#define P_JAVELIN 19 -#define P_TRIDENT 20 -#define P_LANCE 21 -#define P_BOW 22 -#define P_SLING 23 -#define P_CROSSBOW 24 -#define P_DART 25 -#define P_SHURIKEN 26 -#define P_BOOMERANG 27 -#define P_WHIP 28 -#define P_UNICORN_HORN 29 /* last weapon */ +#define P_SPEAR 18 /* includes javelin */ +#define P_TRIDENT 19 +#define P_LANCE 20 +#define P_BOW 21 +#define P_SLING 22 +#define P_CROSSBOW 23 +#define P_DART 24 +#define P_SHURIKEN 25 +#define P_BOOMERANG 26 +#define P_WHIP 27 +#define P_UNICORN_HORN 28 /* last weapon */ #define P_FIRST_WEAPON P_DAGGER #define P_LAST_WEAPON P_UNICORN_HORN /* Spell Skills added by Larry Stewart-Zerba */ -#define P_ATTACK_SPELL 30 -#define P_HEALING_SPELL 31 -#define P_DIVINATION_SPELL 32 -#define P_ENCHANTMENT_SPELL 33 -#define P_CLERIC_SPELL 34 -#define P_ESCAPE_SPELL 35 -#define P_MATTER_SPELL 36 +#define P_ATTACK_SPELL 29 +#define P_HEALING_SPELL 30 +#define P_DIVINATION_SPELL 31 +#define P_ENCHANTMENT_SPELL 32 +#define P_CLERIC_SPELL 33 +#define P_ESCAPE_SPELL 34 +#define P_MATTER_SPELL 35 #define P_FIRST_SPELL P_ATTACK_SPELL #define P_LAST_SPELL P_MATTER_SPELL /* Other types of combat */ -#define P_BARE_HANDED_COMBAT 37 +#define P_BARE_HANDED_COMBAT 36 /* actually weaponless; gloves are ok */ #define P_MARTIAL_ARTS P_BARE_HANDED_COMBAT /* Role distinguishes */ -#define P_TWO_WEAPON_COMBAT 38 /* Finally implemented */ +#define P_TWO_WEAPON_COMBAT 37 /* Finally implemented */ #ifdef STEED -#define P_RIDING 39 /* How well you control your steed */ +#define P_RIDING 38 /* How well you control your steed */ #define P_LAST_H_TO_H P_RIDING #else #define P_LAST_H_TO_H P_TWO_WEAPON_COMBAT diff --git a/src/mthrowu.c b/src/mthrowu.c index 0c366e0cd..d6f37cb73 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mthrowu.c 3.5 2006/03/29 */ +/* SCCS Id: @(#)mthrowu.c 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -747,7 +747,7 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */ hits = (oskill != -P_BOW && oskill != -P_CROSSBOW && oskill != -P_DART && oskill != -P_SHURIKEN && - oskill != P_SPEAR && oskill != P_JAVELIN && + oskill != P_SPEAR && oskill != P_KNIFE); /* but not dagger */ break; } diff --git a/src/objects.c b/src/objects.c index 6983154c2..d9504bbe2 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)objects.c 3.5 2006/02/22 */ +/* SCCS Id: @(#)objects.c 3.5 2006/12/14 */ /* Copyright (c) Mike Threepoint, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -101,7 +101,10 @@ WEAPON("shuriken", "throwing star", WEAPON("boomerang", (char *)0, 1, 1, 0, 15, 5, 20, 9, 9, 0, 0, -P_BOOMERANG, WOOD, HI_WOOD), -/* spears */ +/* spears [note: javelin used to have a separate skill from spears, + because the latter are primarily stabbing weapons rather than + throwing ones; but for playability, they've been merged together + under spear skill and spears can now be thrown like javelins] */ WEAPON("spear", (char *)0, 1, 1, 0, 50, 30, 3, 6, 8, 0, P, P_SPEAR, IRON, HI_METAL), WEAPON("elven spear", "runed spear", @@ -113,7 +116,7 @@ WEAPON("dwarvish spear", "stout spear", WEAPON("silver spear", (char *)0, 1, 1, 0, 2, 36, 40, 6, 8, 0, P, P_SPEAR, SILVER, HI_SILVER), WEAPON("javelin", "throwing spear", - 0, 1, 0, 10, 20, 3, 6, 6, 0, P, P_JAVELIN, IRON, HI_METAL), + 0, 1, 0, 10, 20, 3, 6, 6, 0, P, P_SPEAR, IRON, HI_METAL), WEAPON("trident", (char *)0, 1, 0, 0, 8, 25, 5, 6, 4, 0, P, P_TRIDENT, IRON, HI_METAL), diff --git a/src/u_init.c b/src/u_init.c index b3498f5c9..4c0724e1c 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)u_init.c 3.5 2005/11/05 */ +/* SCCS Id: @(#)u_init.c 3.5 2006/12/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -295,7 +295,7 @@ static const struct def_skill Skill_C[] = { { P_MORNING_STAR, P_BASIC }, { P_FLAIL, P_SKILLED }, { P_HAMMER, P_SKILLED }, { P_QUARTERSTAFF, P_EXPERT }, { P_POLEARMS, P_SKILLED }, { P_SPEAR, P_EXPERT }, - { P_JAVELIN, P_SKILLED }, { P_TRIDENT, P_SKILLED }, + { P_TRIDENT, P_SKILLED }, { P_BOW, P_SKILLED }, { P_SLING, P_EXPERT }, { P_ATTACK_SPELL, P_BASIC }, { P_MATTER_SPELL, P_SKILLED }, { P_BOOMERANG, P_EXPERT }, { P_UNICORN_HORN, P_BASIC }, @@ -309,7 +309,7 @@ static const struct def_skill Skill_H[] = { { P_SABER, P_BASIC }, { P_CLUB, P_SKILLED }, { P_MACE, P_BASIC }, { P_QUARTERSTAFF, P_EXPERT }, { P_POLEARMS, P_BASIC }, { P_SPEAR, P_BASIC }, - { P_JAVELIN, P_BASIC }, { P_TRIDENT, P_BASIC }, + { P_TRIDENT, P_BASIC }, { P_SLING, P_SKILLED }, { P_DART, P_EXPERT }, { P_SHURIKEN, P_SKILLED }, { P_UNICORN_HORN, P_EXPERT }, { P_HEALING_SPELL, P_EXPERT }, @@ -326,7 +326,7 @@ static const struct def_skill Skill_K[] = { { P_CLUB, P_BASIC }, { P_MACE, P_SKILLED }, { P_MORNING_STAR, P_SKILLED }, { P_FLAIL, P_BASIC }, { P_HAMMER, P_BASIC }, { P_POLEARMS, P_SKILLED }, - { P_SPEAR, P_SKILLED }, { P_JAVELIN, P_SKILLED }, + { P_SPEAR, P_SKILLED }, { P_TRIDENT, P_BASIC }, { P_LANCE, P_EXPERT }, { P_BOW, P_BASIC }, { P_CROSSBOW, P_SKILLED }, { P_ATTACK_SPELL, P_SKILLED }, { P_HEALING_SPELL, P_SKILLED }, @@ -341,11 +341,10 @@ static const struct def_skill Skill_K[] = { static const struct def_skill Skill_Mon[] = { { P_QUARTERSTAFF, P_BASIC }, { P_SPEAR, P_BASIC }, - { P_JAVELIN, P_BASIC }, { P_CROSSBOW, P_BASIC }, - { P_SHURIKEN, P_BASIC }, + { P_CROSSBOW, P_BASIC }, { P_SHURIKEN, P_BASIC }, { P_ATTACK_SPELL, P_BASIC }, { P_HEALING_SPELL, P_EXPERT }, { P_DIVINATION_SPELL, P_BASIC },{ P_ENCHANTMENT_SPELL, P_BASIC }, - { P_CLERIC_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_BASIC }, + { P_CLERIC_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_SKILLED }, { P_MATTER_SPELL, P_BASIC }, { P_MARTIAL_ARTS, P_GRAND_MASTER }, { P_NONE, 0 } @@ -356,7 +355,7 @@ static const struct def_skill Skill_P[] = { { P_MORNING_STAR, P_EXPERT }, { P_FLAIL, P_EXPERT }, { P_HAMMER, P_EXPERT }, { P_QUARTERSTAFF, P_EXPERT }, { P_POLEARMS, P_SKILLED }, { P_SPEAR, P_SKILLED }, - { P_JAVELIN, P_SKILLED }, { P_TRIDENT, P_SKILLED }, + { P_TRIDENT, P_SKILLED }, { P_LANCE, P_BASIC }, { P_BOW, P_BASIC }, { P_SLING, P_BASIC }, { P_CROSSBOW, P_BASIC }, { P_DART, P_BASIC }, { P_SHURIKEN, P_BASIC }, @@ -393,7 +392,7 @@ static const struct def_skill Skill_Ran[] = { { P_SHORT_SWORD, P_BASIC }, { P_MORNING_STAR, P_BASIC }, { P_FLAIL, P_SKILLED }, { P_HAMMER, P_BASIC }, { P_QUARTERSTAFF, P_BASIC }, { P_POLEARMS, P_SKILLED }, - { P_SPEAR, P_SKILLED }, { P_JAVELIN, P_EXPERT }, + { P_SPEAR, P_EXPERT }, { P_TRIDENT, P_BASIC }, { P_BOW, P_EXPERT }, { P_SLING, P_EXPERT }, { P_CROSSBOW, P_EXPERT }, { P_DART, P_EXPERT }, { P_SHURIKEN, P_SKILLED }, @@ -414,8 +413,8 @@ static const struct def_skill Skill_S[] = { { P_LONG_SWORD, P_EXPERT }, { P_TWO_HANDED_SWORD, P_EXPERT }, { P_SCIMITAR, P_BASIC }, { P_SABER, P_BASIC }, { P_FLAIL, P_SKILLED }, { P_QUARTERSTAFF, P_BASIC }, - { P_POLEARMS, P_SKILLED }, { P_SPEAR, P_BASIC }, - { P_JAVELIN, P_BASIC }, { P_LANCE, P_SKILLED }, + { P_POLEARMS, P_SKILLED }, { P_SPEAR, P_SKILLED }, + { P_LANCE, P_SKILLED }, { P_BOW, P_EXPERT }, { P_SHURIKEN, P_EXPERT }, { P_ATTACK_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, #ifdef STEED @@ -436,7 +435,7 @@ static const struct def_skill Skill_T[] = { { P_MACE, P_BASIC }, { P_MORNING_STAR, P_BASIC }, { P_FLAIL, P_BASIC }, { P_HAMMER, P_BASIC }, { P_QUARTERSTAFF, P_BASIC }, { P_POLEARMS, P_BASIC }, - { P_SPEAR, P_BASIC }, { P_JAVELIN, P_BASIC }, + { P_SPEAR, P_BASIC }, { P_TRIDENT, P_BASIC }, { P_LANCE, P_BASIC }, { P_BOW, P_BASIC }, { P_SLING, P_BASIC }, { P_CROSSBOW, P_BASIC }, { P_DART, P_EXPERT }, @@ -460,7 +459,7 @@ static const struct def_skill Skill_V[] = { { P_TWO_HANDED_SWORD, P_EXPERT }, { P_SCIMITAR, P_BASIC }, { P_SABER, P_BASIC }, { P_HAMMER, P_EXPERT }, { P_QUARTERSTAFF, P_BASIC }, { P_POLEARMS, P_SKILLED }, - { P_SPEAR, P_SKILLED }, { P_JAVELIN, P_BASIC }, + { P_SPEAR, P_SKILLED }, { P_TRIDENT, P_BASIC }, { P_LANCE, P_SKILLED }, { P_SLING, P_BASIC }, { P_ATTACK_SPELL, P_BASIC }, { P_ESCAPE_SPELL, P_BASIC }, @@ -477,7 +476,7 @@ static const struct def_skill Skill_W[] = { { P_AXE, P_SKILLED }, { P_SHORT_SWORD, P_BASIC }, { P_CLUB, P_SKILLED }, { P_MACE, P_BASIC }, { P_QUARTERSTAFF, P_EXPERT }, { P_POLEARMS, P_SKILLED }, - { P_SPEAR, P_BASIC }, { P_JAVELIN, P_BASIC }, + { P_SPEAR, P_BASIC }, { P_TRIDENT, P_BASIC }, { P_SLING, P_SKILLED }, { P_DART, P_EXPERT }, { P_SHURIKEN, P_BASIC }, { P_ATTACK_SPELL, P_EXPERT }, { P_HEALING_SPELL, P_SKILLED }, diff --git a/src/weapon.c b/src/weapon.c index 23b78086d..cc148852f 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)weapon.c 3.5 2006/07/08 */ +/* SCCS Id: @(#)weapon.c 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -34,7 +34,7 @@ STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { TWO_HANDED_SWORD, SCIMITAR, PN_SABER, CLUB, MACE, MORNING_STAR, FLAIL, PN_HAMMER, QUARTERSTAFF, PN_POLEARMS, SPEAR, - JAVELIN, TRIDENT, LANCE, BOW, + TRIDENT, LANCE, BOW, SLING, CROSSBOW, DART, SHURIKEN, BOOMERANG, PN_WHIP, UNICORN_HORN, PN_ATTACK_SPELL, PN_HEALING_SPELL,