track the handedness of the hero
Don't make either LEFT_HANDED or RIGHT_HANDED be an advantage or a disadvantage. use suggested macros
This commit is contained in:
@@ -2159,7 +2159,9 @@ accessory_or_armor_on(struct obj *obj)
|
||||
}
|
||||
if (uwep) {
|
||||
res = !uwep->bknown; /* check this before calling welded() */
|
||||
if ((mask == RIGHT_RING || bimanual(uwep)) && welded(uwep)) {
|
||||
if (((mask == RIGHT_RING && URIGHTY)
|
||||
|| (mask == LEFT_RING && ULEFTY)
|
||||
|| bimanual(uwep)) && welded(uwep)) {
|
||||
const char *hand = body_part(HAND);
|
||||
|
||||
/* welded will set bknown */
|
||||
@@ -2387,9 +2389,18 @@ glibr(void)
|
||||
boolean leftfall, rightfall, wastwoweap = FALSE;
|
||||
const char *otherwep = 0, *thiswep, *which, *hand;
|
||||
|
||||
leftfall = (uleft && !uleft->cursed
|
||||
&& (!uwep || !(welded(uwep) && ULEFTY)
|
||||
|| !bimanual(uwep)));
|
||||
rightfall = (uright && !uright->cursed
|
||||
&& (!uwep || !(welded(uwep) && URIGHTY)
|
||||
|| !bimanual(uwep)));
|
||||
/*
|
||||
leftfall = (uleft && !uleft->cursed
|
||||
&& (!uwep || !welded(uwep) || !bimanual(uwep)));
|
||||
rightfall = (uright && !uright->cursed && (!welded(uwep)));
|
||||
*/
|
||||
|
||||
if (!uarmg && (leftfall || rightfall) && !nolimbs(gy.youmonst.data)) {
|
||||
/* changed so cursed rings don't fall off, GAN 10/30/86 */
|
||||
Your("%s off your %s.",
|
||||
@@ -2422,7 +2433,7 @@ glibr(void)
|
||||
if (otmp->quan > 1L)
|
||||
otherwep = makeplural(otherwep);
|
||||
hand = body_part(HAND);
|
||||
which = "left ";
|
||||
which = URIGHTY ? "left " : "right "; /* text for the off hand */
|
||||
Your("%s %s%s from your %s%s.", otherwep, xfl ? "also " : "",
|
||||
otense(otmp, "slip"), which, hand);
|
||||
xfl++;
|
||||
@@ -2453,10 +2464,12 @@ glibr(void)
|
||||
}
|
||||
hand = body_part(HAND);
|
||||
which = "";
|
||||
if (bimanual(otmp))
|
||||
if (bimanual(otmp)) {
|
||||
hand = makeplural(hand);
|
||||
else if (wastwoweap)
|
||||
which = "right "; /* preceding msg was about left */
|
||||
} else if (wastwoweap) {
|
||||
/* preceding msg was about non-dominant hand */
|
||||
which = URIGHTY ? "right " : "left ";
|
||||
}
|
||||
pline("%s %s%s %s%s from your %s%s.",
|
||||
!strncmp(thiswep, "corpse", 6) ? "The" : "Your",
|
||||
otherwep ? "other " : "", thiswep, xfl ? "also " : "",
|
||||
@@ -2511,7 +2524,7 @@ stuck_ring(struct obj *ring, int otyp)
|
||||
if (nolimbs(gy.youmonst.data) && uamul
|
||||
&& uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
|
||||
return uamul;
|
||||
if (welded(uwep) && (ring == uright || bimanual(uwep)))
|
||||
if (welded(uwep) && ((ring == RING_ON_PRIMARY) || bimanual(uwep)))
|
||||
return uwep;
|
||||
if (uarmg && uarmg->cursed)
|
||||
return uarmg;
|
||||
@@ -2556,7 +2569,7 @@ select_off(register struct obj *otmp)
|
||||
}
|
||||
glibdummy = cg.zeroobj;
|
||||
why = 0; /* the item which prevents ring removal */
|
||||
if (welded(uwep) && (otmp == uright || bimanual(uwep))) {
|
||||
if (welded(uwep) && ((otmp == RING_ON_PRIMARY) || bimanual(uwep))) {
|
||||
Sprintf(buf, "free a weapon %s", body_part(HAND));
|
||||
why = uwep;
|
||||
} else if (uarmg && (uarmg->cursed || Glib)) {
|
||||
|
||||
13
src/objnam.c
13
src/objnam.c
@@ -1406,7 +1406,15 @@ doname_base(
|
||||
tethered ? "tethered " : "", /* aklys */
|
||||
/* avoid "tethered wielded in right hand" for twoweapon */
|
||||
(twoweap_primary && !tethered) ? "wielded" : "weapon",
|
||||
twoweap_primary ? "right " : "", hand_s);
|
||||
URIGHTY ? "right " : "left ",
|
||||
/*
|
||||
(twoweap_primary && URIGHTY)
|
||||
? "right "
|
||||
: (twoweap_primary && ULEFTY)
|
||||
? "left "
|
||||
: "",
|
||||
*/
|
||||
hand_s);
|
||||
if (!Blind) {
|
||||
if (gw.warn_obj_cnt && obj == uwep
|
||||
&& (EWarn_of_mon & W_WEP) != 0L)
|
||||
@@ -1423,7 +1431,8 @@ doname_base(
|
||||
}
|
||||
if (obj->owornmask & W_SWAPWEP) {
|
||||
if (u.twoweap)
|
||||
Sprintf(eos(bp), " (wielded in left %s)", body_part(HAND));
|
||||
Sprintf(eos(bp), " (wielded in %s %s)",
|
||||
URIGHTY ? "left" : "right", body_part(HAND));
|
||||
else
|
||||
/* TODO: rephrase this when obj isn't a weapon or weptool */
|
||||
Sprintf(eos(bp), " (alternate weapon%s; not wielded)",
|
||||
|
||||
@@ -602,7 +602,7 @@ knows_class(char sym)
|
||||
void
|
||||
u_init(void)
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
struct u_roleplay tmpuroleplay = u.uroleplay; /* set by rcfile options */
|
||||
|
||||
flags.female = flags.initgend;
|
||||
@@ -903,6 +903,9 @@ u_init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
/* roughly based on distribution in human population */
|
||||
u.uhandedness = rn2(10) ? RIGHT_HANDED : LEFT_HANDED;
|
||||
|
||||
if (discover)
|
||||
ini_inv(Wishing);
|
||||
|
||||
|
||||
12
src/uhitm.c
12
src/uhitm.c
@@ -5384,12 +5384,12 @@ hmonas(struct monst *mon)
|
||||
verb = (mattk->aatyp == AT_TUCH) ? "touch" : "claws";
|
||||
/* decide if silver-hater will be hit by silver ring(s);
|
||||
for 'multi_claw' where attacks alternate right/left,
|
||||
assume 'even' claw or touch attacks use right hand
|
||||
or paw, 'odd' ones use left for ring interaction;
|
||||
even vs odd is based on actual attacks rather
|
||||
than on index into mon->dat->mattk[] so that {bite,
|
||||
claw,claw} instead of {claw,claw,bite} doesn't
|
||||
make poly'd hero mysteriously become left-handed */
|
||||
assume 'even' claw or touch attacks use dominant hand
|
||||
or paw, 'odd' ones use non-dominant hand for ring
|
||||
interaction; even vs odd is based on actual attacks
|
||||
rather than on index into mon->dat->mattk[] so that
|
||||
{bite,claw,claw} instead of {claw,claw,bite} doesn't
|
||||
make poly'd hero mysteriously switch handedness */
|
||||
odd_claw = !odd_claw;
|
||||
specialdmg = special_dmgval(&gy.youmonst, mon,
|
||||
W_ARMG
|
||||
|
||||
@@ -194,8 +194,10 @@ ready_weapon(struct obj *wep)
|
||||
tmp = thestr;
|
||||
else
|
||||
tmp = "";
|
||||
pline("%s%s %s to your %s!", tmp, aobjnam(wep, "weld"),
|
||||
pline("%s%s %s to your %s%s!", tmp, aobjnam(wep, "weld"),
|
||||
(wep->quan == 1L) ? "itself" : "themselves", /* a3 */
|
||||
bimanual(wep) ? "" :
|
||||
(URIGHTY ? "dominant right " : "dominant left "),
|
||||
bimanual(wep) ? (const char *) makeplural(body_part(HAND))
|
||||
: body_part(HAND));
|
||||
set_bknown(wep, 1);
|
||||
|
||||
Reference in New Issue
Block a user