From da859c5eb88e17d04ec2bb37e2c12842e9f4c4a9 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 27 Oct 2021 15:36:32 -0700 Subject: [PATCH] fix github issue #623 - soldiers and mattocks Reported by eakaye. Selection of equipment when creating a soldier or watchperson can pick a polearm, but random selection among those had a chance to choose dwarvish mattock which doesn't use polearms skill and isn't appropriate for a human soldier or watchperson. Not mentioned, but lance was in the same boat. Change the selection to only pick something which uses polearms skill, then make that moot by moving lance and dwarvish mattock out of the midst of the polearms so that they're no longer candidates for special case rejection. A couple of other things which might have had a similar issue were already ok. Giving a polearm when creating a troll selects between a few choices rather than among all the polearms. And wishing for "polearm" only considers items which use polearms skill. While changing objects.h to reorder the two non-polearms, I removed a bunch of tabs that were present in the scroll definitions. EDITLEVEL is incremented due to objects[] reordering, so existing save and bones files will be invalidated. Fixes #623 --- doc/fixes37.0 | 1 + include/objects.h | 52 ++++++++++++++++++++++++-------------------- include/patchlevel.h | 2 +- src/makemon.c | 7 +++++- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 252053d7c..b9d54c501 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -670,6 +670,7 @@ if an artifact gets created as a random treasure drop and then deleted because when creating random contents for a container, explicitly exclude artifacts (already implicitly excluded because randomly generated artifacts are all weapons and containers don't start with any weapons in them) +don't give lance or mattock as starting equipment when creating soldiers Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/include/objects.h b/include/objects.h index fc149daf1..a97313f3d 100644 --- a/include/objects.h +++ b/include/objects.h @@ -263,10 +263,6 @@ WEAPON("spetum", "forked polearm", WEAPON("glaive", "single-edged polearm", 0, 0, 1, 8, 75, 6, 6, 10, 0, S, P_POLEARMS, IRON, HI_METAL, GLAIVE), -WEAPON("lance", NoDes, - 1, 0, 0, 4, 180, 10, 6, 8, 0, P, P_LANCE, IRON, HI_METAL, - LANCE), - /* +2d10 when jousting with lance as primary weapon */ /* axe-type */ WEAPON("halberd", "angled poleaxe", 0, 0, 1, 8, 150, 10, 10, 6, 0, P|S, P_POLEARMS, IRON, HI_METAL, @@ -280,9 +276,6 @@ WEAPON("voulge", "pole cleaver", 0, 0, 1, 4, 125, 5, 4, 4, 0, S, P_POLEARMS, IRON, HI_METAL, VOULGE), /* +d4 both */ -WEAPON("dwarvish mattock", "broad pick", - 0, 0, 1, 13, 120, 50, 12, 8, -1, B, P_PICK_AXE, IRON, HI_METAL, - DWARVISH_MATTOCK), /* curved/hooked */ WEAPON("fauchard", "pole sickle", 0, 0, 1, 6, 60, 5, 6, 8, 0, P|S, P_POLEARMS, IRON, HI_METAL, @@ -304,6 +297,17 @@ WEAPON("bec de corbin", "beaked polearm", 0, 0, 1, 4, 100, 8, 8, 6, 0, B|P, P_POLEARMS, IRON, HI_METAL, BEC_DE_CORBIN), +/* formerly grouped with the polearms but don't use polearms skill; + lance isn't even two-handed */ +WEAPON("dwarvish mattock", "broad pick", + 0, 0, 1, 13, 120, 50, 12, 8, -1, B, P_PICK_AXE, IRON, HI_METAL, + DWARVISH_MATTOCK), +WEAPON("lance", NoDes, + 1, 0, 0, 4, 180, 10, 6, 8, 0, P, P_LANCE, IRON, HI_METAL, + LANCE), + /* +2d10 when jousting with lance as primary weapon, + +2d2 when jousting with it as secondary when dual wielding */ + /* bludgeons */ WEAPON("mace", NoDes, 1, 0, 0, 40, 30, 5, 6, 6, 0, B, P_MACE, IRON, HI_METAL, @@ -1103,39 +1107,39 @@ SCROLL("confuse monster", "NR 9", 1, 53, 100, SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 1, 35, 100, SCR_SCARE_MONSTER), SCROLL("remove curse", "PRATYAVAYAH", 1, 65, 80, - SCR_REMOVE_CURSE), + SCR_REMOVE_CURSE), SCROLL("enchant weapon", "DAIYEN FOOELS", 1, 80, 60, - SCR_ENCHANT_WEAPON), + SCR_ENCHANT_WEAPON), SCROLL("create monster", "LEP GEX VEN ZEA", 1, 45, 200, - SCR_CREATE_MONSTER), + SCR_CREATE_MONSTER), SCROLL("taming", "PRIRUTSENIE", 1, 15, 200, - SCR_TAMING), + SCR_TAMING), SCROLL("genocide", "ELBIB YLOH", 1, 15, 300, - SCR_GENOCIDE), + SCR_GENOCIDE), SCROLL("light", "VERR YED HORRE", 1, 90, 50, - SCR_LIGHT), + SCR_LIGHT), SCROLL("teleportation", "VENZAR BORGAVVE", 1, 55, 100, - SCR_TELEPORTATION), + SCR_TELEPORTATION), SCROLL("gold detection", "THARR", 1, 33, 100, - SCR_GOLD_DETECTION), + SCR_GOLD_DETECTION), SCROLL("food detection", "YUM YUM", 1, 25, 100, - SCR_FOOD_DETECTION), + SCR_FOOD_DETECTION), SCROLL("identify", "KERNOD WEL", 1, 180, 20, - SCR_IDENTIFY), + SCR_IDENTIFY), SCROLL("magic mapping", "ELAM EBOW", 1, 45, 100, - SCR_MAGIC_MAPPING), + SCR_MAGIC_MAPPING), SCROLL("amnesia", "DUAM XNAHT", 1, 35, 200, - SCR_AMNESIA), + SCR_AMNESIA), SCROLL("fire", "ANDOVA BEGARIN", 1, 30, 100, - SCR_FIRE), + SCR_FIRE), SCROLL("earth", "KIRJE", 1, 18, 200, - SCR_EARTH), + SCR_EARTH), SCROLL("punishment", "VE FORBRYDERNE", 1, 15, 300, - SCR_PUNISHMENT), + SCR_PUNISHMENT), SCROLL("charging", "HACKEM MUCHE", 1, 15, 300, - SCR_CHARGING), + SCR_CHARGING), SCROLL("stinking cloud", "VELOX NEB", 1, 15, 300, - SCR_STINKING_CLOUD), + SCR_STINKING_CLOUD), /* Extra descriptions, shuffled into use at start of new game. * Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding * these and on how many of them there are. If a real scroll gets added diff --git a/include/patchlevel.h b/include/patchlevel.h index 9feb09036..752a607f2 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 43 +#define EDITLEVEL 44 /* * Development status possibilities. diff --git a/src/makemon.c b/src/makemon.c index 28576d41e..e2968c65d 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -181,7 +181,12 @@ m_initweap(register struct monst *mtmp) case PM_WATCHMAN: case PM_SOLDIER: if (!rn2(3)) { - w1 = rn1(BEC_DE_CORBIN - PARTISAN + 1, PARTISAN); + /* lance and dwarvish mattock used to be in midst of + the polearms but use different skills from polearms + and aren't appropriates choices for human soliders */ + do { + w1 = rn1(BEC_DE_CORBIN - PARTISAN + 1, PARTISAN); + } while (objects[w1].oc_skill != P_POLEARMS); w2 = rn2(2) ? DAGGER : KNIFE; } else w1 = rn2(2) ? SPEAR : SHORT_SWORD;