some artifact.c formatting

I managed to separate these bits from the touch/retouch fix.
I almost threw then away, but one's a spelling fix in a comment.
This commit is contained in:
PatR
2017-07-12 18:02:52 -07:00
parent c0bb25b388
commit fe4583fc88
+10 -11
View File
@@ -653,16 +653,17 @@ struct monst *mon;
return 1; return 1;
yours = (mon == &youmonst); yours = (mon == &youmonst);
/* all quest artifacts are self-willed; it this ever changes, `badclass' /* all quest artifacts are self-willed; if this ever changes, `badclass'
will have to be extended to explicitly include quest artifacts */ will have to be extended to explicitly include quest artifacts */
self_willed = ((oart->spfx & SPFX_INTEL) != 0); self_willed = ((oart->spfx & SPFX_INTEL) != 0);
if (yours) { if (yours) {
badclass = self_willed badclass = self_willed
&& ((oart->role != NON_PM && !Role_if(oart->role)) && ((oart->role != NON_PM && !Role_if(oart->role))
|| (oart->race != NON_PM && !Race_if(oart->race))); || (oart->race != NON_PM && !Race_if(oart->race)));
badalign = badalign = ((oart->spfx & SPFX_RESTR) != 0
(oart->spfx & SPFX_RESTR) && oart->alignment != A_NONE && oart->alignment != A_NONE
&& (oart->alignment != u.ualign.type || u.ualign.record < 0); && (oart->alignment != u.ualign.type
|| u.ualign.record < 0));
} else if (!is_covetous(mon->data) && !is_mplayer(mon->data)) { } else if (!is_covetous(mon->data) && !is_mplayer(mon->data)) {
badclass = self_willed && oart->role != NON_PM badclass = self_willed && oart->role != NON_PM
&& oart != &artilist[ART_EXCALIBUR]; && oart != &artilist[ART_EXCALIBUR];
@@ -1493,8 +1494,8 @@ struct obj *obj;
obj->age = 0; obj->age = 0;
return 0; return 0;
} }
b_effect = b_effect = (obj->blessed
obj->blessed && (Role_switch == oart->role || !oart->role); && (Role_switch == oart->role || !oart->role));
recharge(otmp, b_effect ? 1 : obj->cursed ? -1 : 0); recharge(otmp, b_effect ? 1 : obj->cursed ? -1 : 0);
update_inventory(); update_inventory();
break; break;
@@ -1583,9 +1584,8 @@ struct obj *obj;
} else } else
otmp->quan += rnd(5); otmp->quan += rnd(5);
otmp->owt = weight(otmp); otmp->owt = weight(otmp);
otmp = otmp = hold_another_object(otmp, "Suddenly %s out.",
hold_another_object(otmp, "Suddenly %s out.", aobjnam(otmp, "fall"), (char *) 0);
aobjnam(otmp, "fall"), (const char *) 0);
break; break;
} }
} }
@@ -1883,8 +1883,7 @@ boolean loseit; /* whether to drop it if hero can longer touch it */
if (touch_artifact(obj, &youmonst)) { if (touch_artifact(obj, &youmonst)) {
char buf[BUFSZ]; char buf[BUFSZ];
int dmg = 0, tmp; int dmg = 0, tmp;
boolean ag = boolean ag = (objects[obj->otyp].oc_material == SILVER && Hate_silver),
(objects[obj->otyp].oc_material == SILVER && Hate_silver),
bane = bane_applies(get_artifact(obj), &youmonst); bane = bane_applies(get_artifact(obj), &youmonst);
/* nothing else to do if hero can successfully handle this object */ /* nothing else to do if hero can successfully handle this object */