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

Function Shield_on

src/do_wear.c:704–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702}
703
704staticfn int
705Shield_on(void)
706{
707 /* no shield currently requires special handling when put on, but we
708 keep this uncommented in case somebody adds a new one which does
709 [the magical shields are handled by setting u.uprops[*].extrinsic
710 in setworn() called by armor_or_accessory_on() before Shield_on()] */
711 switch (uarms->otyp) {
712 case SMALL_SHIELD:
713 case SHIELD_OF_DRAIN_RESISTANCE:
714 case SHIELD_OF_SHOCK_RESISTANCE:
715 case ELVEN_SHIELD:
716 case URUK_HAI_SHIELD:
717 case ORCISH_SHIELD:
718 case DWARVISH_ROUNDSHIELD:
719 case LARGE_SHIELD:
720 case SHIELD_OF_REFLECTION:
721 break;
722 default:
723 impossible(unknown_type, c_shield, uarms->otyp);
724 }
725 if (!uarms->known) {
726 uarms->known = 1; /* shield's +/- evident because of status line AC */
727 update_inventory();
728 }
729 return 0;
730}
731
732int
733Shield_off(void)

Callers 1

set_wearFunction · 0.85

Calls 2

update_inventoryFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected