Skip to content

Commit eec6016

Browse files
committed
Expert skill in wielded weapons that can be thrown/returned will always return.
Weapons affected by this commit: aklys (to include the forged artifact Harbinger), Mjollnir, the Hammer of the Gods, and Xiuhcoatl. If the player has expert or greater skill associated with the weapon they are throwing, if it can return, it will always return so long as they are not impaired (confused, stunned, etc).
1 parent 51bf661 commit eec6016

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

doc/evilhack-changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -4009,4 +4009,6 @@ The following changes to date are:
40094009
- Fix: chopping boulder at tree spot
40104010
- Fix: error C4703: potentially uninitialized local pointer variable
40114011
'digtxt' used (windows build)
4012+
- Expert skill in wielded weapons that can be thrown/returned will
4013+
always return
40124014

src/dothrow.c

+9-2
Original file line numberDiff line numberDiff line change
@@ -1651,13 +1651,20 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
16511651
/* Mjollnir and Xiuhcoatl must be wielded to be thrown--caller verifies this;
16521652
aklys must be wielded as primary to return when thrown */
16531653
if (iflags.returning_missile) { /* Mjollnir, Xiuhcoatl or aklys */
1654-
if (rn2(100)) {
1654+
boolean aklys_skill = (obj->otyp == AKLYS && P_SKILL(P_CLUB) >= P_EXPERT);
1655+
boolean spear_skill = (is_spear(obj) && P_SKILL(P_SPEAR) >= P_EXPERT);
1656+
boolean hammer_skill = (is_hammer(obj) && P_SKILL(P_HAMMER) >= P_EXPERT);
1657+
1658+
if (rn2(100) || aklys_skill
1659+
|| spear_skill || hammer_skill) {
16551660
if (tethered_weapon)
16561661
tmp_at(DISP_END, BACKTRACK);
16571662
else
16581663
sho_obj_return_to_u(obj); /* display its flight */
16591664

1660-
if (!impaired && rn2(100)) {
1665+
if (!impaired
1666+
&& (rn2(100) || aklys_skill
1667+
|| spear_skill || hammer_skill)) {
16611668
if (range > 0)
16621669
pline("%s to your %s!", Tobjnam(obj, "return"),
16631670
body_part(HAND));

0 commit comments

Comments
 (0)