MCPcopy Create free account
hub / github.com/NetHack/NetHack / Armor_off

Function Armor_off

src/do_wear.c:908–930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908int
909Armor_off(void)
910{
911 struct obj *otmp = uarm;
912 boolean was_arti_light = otmp && otmp->lamplit && artifact_light(otmp);
913
914 svc.context.takeoff.mask &= ~W_ARM;
915 setworn((struct obj *) 0, W_ARM);
916 svc.context.takeoff.cancelled_don = FALSE;
917
918 /* taking off yellow dragon scales/mail might be fatal; arti_light
919 comes from gold dragon scales/mail so they don't overlap, but
920 conceptually the non-fatal change should be done before the
921 potentially fatal change in case the latter results in bones */
922 if (was_arti_light && !artifact_light(otmp)) {
923 end_burn(otmp, FALSE);
924 if (!Blind)
925 pline("%s shining.", Tobjnam(otmp, "stop"));
926 }
927 dragon_armor_handling(otmp, FALSE, TRUE);
928
929 return 0;
930}
931
932/* The gone functions differ from the off functions in that if you die from
933 * taking it off and have life saving, you still die. [Obsolete reference

Callers 4

remove_worn_itemFunction · 0.85
armoroffFunction · 0.85
do_takeoffFunction · 0.85
wornarm_destroyedFunction · 0.85

Calls 6

artifact_lightFunction · 0.85
setwornFunction · 0.85
end_burnFunction · 0.85
TobjnamFunction · 0.85
dragon_armor_handlingFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected