Refactors wizard casting clothes into a clothing bitflag (#66604)

* refactors wizard casting clothes into a clothing bitflag

* autodocs the `CASTING_CLOTHES` bitflag
This commit is contained in:
Y0SH1M4S73R
2022-05-01 23:01:02 -05:00
committed by GitHub
parent ea08de9081
commit 345b35156f
5 changed files with 10 additions and 12 deletions
+3 -9
View File
@@ -197,17 +197,11 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
var/mob/living/carbon/human/H = user
var/static/list/casting_clothes = typecacheof(list(/obj/item/clothing/suit/wizrobe, /obj/item/clothing/head/wizard))
if(clothes_req) //clothes check
var/passes_req = FALSE
if(istype(H.back, /obj/item/mod/control))
var/obj/item/mod/control/mod = H.back
if(istype(mod.theme, /datum/mod_theme/enchanted))
passes_req = TRUE
if(!passes_req && !is_type_in_typecache(H.wear_suit, casting_clothes))
if(clothes_req)
if(!(H.wear_suit?.clothing_flags & CASTING_CLOTHES))
to_chat(H, span_warning("You don't feel strong enough without your robe!"))
return FALSE
if(!passes_req && !is_type_in_typecache(H.head, casting_clothes))
if(!(H.head?.clothing_flags & CASTING_CLOTHES))
to_chat(H, span_warning("You don't feel strong enough without your hat!"))
return FALSE
else