Macros for checking is object artifact

This commit is contained in:
Pasi Kallinen
2022-08-12 19:37:34 +03:00
parent fc3729d249
commit 9be2e581b7
19 changed files with 53 additions and 54 deletions

View File

@@ -794,8 +794,8 @@ gcrownu(void)
/* 3.3.[01] had this in the A_NEUTRAL case,
preventing chaotic wizards from receiving a spellbook */
if (Role_if(PM_WIZARD)
&& (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
&& uwep->oartifact != ART_STORMBRINGER))
&& !u_wield_art(ART_VORPAL_BLADE)
&& !u_wield_art(ART_STORMBRINGER)
&& !carrying(SPE_FINGER_OF_DEATH)) {
class_gift = SPE_FINGER_OF_DEATH;
} else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
@@ -816,7 +816,7 @@ gcrownu(void)
break;
case A_NEUTRAL:
u.uevent.uhand_of_elbereth = 2;
in_hand = (uwep && uwep->oartifact == ART_VORPAL_BLADE);
in_hand = u_wield_art(ART_VORPAL_BLADE);
already_exists = exist_artifact(LONG_SWORD,
artiname(ART_VORPAL_BLADE));
verbalize("Thou shalt be my Envoy of Balance!");
@@ -825,7 +825,7 @@ gcrownu(void)
break;
case A_CHAOTIC:
u.uevent.uhand_of_elbereth = 3;
in_hand = (uwep && uwep->oartifact == ART_STORMBRINGER);
in_hand = u_wield_art(ART_STORMBRINGER);
already_exists = exist_artifact(RUNESWORD, artiname(ART_STORMBRINGER));
what = (((already_exists && !in_hand) || class_gift != STRANGE_OBJECT)
? "take lives"
@@ -874,7 +874,7 @@ gcrownu(void)
Your("sword shines brightly for a moment.");
obj = oname(obj, artiname(ART_EXCALIBUR),
ONAME_GIFT | ONAME_KNOW_ARTI);
if (obj && obj->oartifact == ART_EXCALIBUR) {
if (is_art(obj, ART_EXCALIBUR)) {
u.ugifts++;
livelog_printf(LL_DIVINEGIFT | LL_ARTIFACT,
"had %s wielded %s transformed into %s",
@@ -883,7 +883,7 @@ gcrownu(void)
}
/* acquire Excalibur's skill regardless of weapon or gift */
unrestrict_weapon_skill(P_LONG_SWORD);
if (obj && obj->oartifact == ART_EXCALIBUR)
if (is_art(obj, ART_EXCALIBUR))
discover_artifact(ART_EXCALIBUR);
break;
case A_NEUTRAL:
@@ -906,7 +906,7 @@ gcrownu(void)
}
/* acquire Vorpal Blade's skill regardless of weapon or gift */
unrestrict_weapon_skill(P_LONG_SWORD);
if (obj && obj->oartifact == ART_VORPAL_BLADE)
if (is_art(obj, ART_VORPAL_BLADE))
discover_artifact(ART_VORPAL_BLADE);
break;
case A_CHAOTIC: {
@@ -932,7 +932,7 @@ gcrownu(void)
}
/* acquire Stormbringer's skill regardless of weapon or gift */
unrestrict_weapon_skill(P_BROAD_SWORD);
if (obj && obj->oartifact == ART_STORMBRINGER)
if (is_art(obj, ART_STORMBRINGER))
discover_artifact(ART_STORMBRINGER);
break;
}