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

Function Armor_gone

src/do_wear.c:938–960  ·  view source on GitHub ↗

The gone functions differ from the off functions in that if you die from * taking it off and have life saving, you still die. [Obsolete reference * to lack of fire resistance being fatal in hell (nethack 3.0) and life * saving putting a removed item back on to prevent that from immediately * repeating.] */

Source from the content-addressed store, hash-verified

936 * repeating.]
937 */
938int
939Armor_gone(void)
940{
941 struct obj *otmp = uarm;
942 boolean was_arti_light = otmp && otmp->lamplit && artifact_light(otmp);
943
944 svc.context.takeoff.mask &= ~W_ARM;
945 setnotworn(uarm);
946 svc.context.takeoff.cancelled_don = FALSE;
947
948 /* losing yellow dragon scales/mail might be fatal; arti_light
949 comes from gold dragon scales/mail so they don't overlap, but
950 conceptually the non-fatal change should be done before the
951 potentially fatal change in case the latter results in bones */
952 if (was_arti_light && !artifact_light(otmp)) {
953 end_burn(otmp, FALSE);
954 if (!Blind)
955 pline("%s shining.", Tobjnam(otmp, "stop"));
956 }
957 dragon_armor_handling(otmp, FALSE, FALSE);
958
959 return 0;
960}
961
962staticfn void
963Amulet_on(struct obj *amul)

Callers 1

break_armorFunction · 0.85

Calls 6

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

Tested by

no test coverage detected