//Hoods for winter coats and chaplain hoodie etc /obj/item/clothing/suit/hooded actions_types = list(/datum/action/item_action/toggle_hood) var/obj/item/clothing/head/hooded/hood var/hoodtype = /obj/item/clothing/head/hooded/winterhood //so the chaplain hoodie or other hoodies can override this /obj/item/clothing/suit/hooded/New() MakeHood() ..() /obj/item/clothing/suit/hooded/Destroy() . = ..() qdel(hood) hood = null /obj/item/clothing/suit/hooded/proc/MakeHood() if(!hood) var/obj/item/clothing/head/hooded/W = new hoodtype(src) W.suit = src hood = W /obj/item/clothing/suit/hooded/ui_action_click() ToggleHood() /obj/item/clothing/suit/hooded/item_action_slot_check(slot, mob/user) if(slot == SLOT_WEAR_SUIT || slot == SLOT_NECK) return 1 /obj/item/clothing/suit/hooded/equipped(mob/user, slot) if(slot != SLOT_WEAR_SUIT && slot != SLOT_NECK) RemoveHood() ..() /obj/item/clothing/suit/hooded/proc/RemoveHood() src.icon_state = "[initial(icon_state)]" suittoggled = FALSE if(ishuman(hood.loc)) var/mob/living/carbon/H = hood.loc H.transferItemToLoc(hood, src, TRUE) H.update_inv_wear_suit() else hood.forceMove(src) for(var/X in actions) var/datum/action/A = X A.UpdateButtonIcon() /obj/item/clothing/suit/hooded/dropped() ..() RemoveHood() /obj/item/clothing/suit/hooded/proc/ToggleHood() if(!suittoggled) if(ishuman(src.loc)) var/mob/living/carbon/human/H = src.loc if(H.wear_suit != src) to_chat(H, "You must be wearing [src] to put up the hood!") return if(H.head) to_chat(H, "You're already wearing something on your head!") return else if(H.equip_to_slot_if_possible(hood,SLOT_HEAD,0,0,1)) suittoggled = TRUE src.icon_state = "[initial(icon_state)]_t" H.update_inv_wear_suit() for(var/X in actions) var/datum/action/A = X A.UpdateButtonIcon() else RemoveHood() /obj/item/clothing/head/hooded var/obj/item/clothing/suit/hooded/suit /obj/item/clothing/head/hooded/Destroy() suit = null return ..() /obj/item/clothing/head/hooded/dropped() ..() if(suit) suit.RemoveHood() /obj/item/clothing/head/hooded/equipped(mob/user, slot) ..() if(slot != SLOT_HEAD) if(suit) suit.RemoveHood() else qdel(src) //Toggle exosuits for different aesthetic styles (hoodies, suit jacket buttons, etc) /obj/item/clothing/suit/toggle/AltClick(mob/user) . = ..() if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return suit_toggle(user) return TRUE /obj/item/clothing/suit/toggle/ui_action_click() suit_toggle() /obj/item/clothing/suit/toggle/proc/suit_toggle() set src in usr if(!can_use(usr)) return 0 to_chat(usr, "You toggle [src]'s [togglename].") if(src.suittoggled) src.icon_state = "[initial(icon_state)]" src.suittoggled = FALSE else if(!src.suittoggled) src.icon_state = "[initial(icon_state)]_t" src.suittoggled = TRUE usr.update_inv_wear_suit() for(var/X in actions) var/datum/action/A = X A.UpdateButtonIcon() /obj/item/clothing/suit/toggle/examine(mob/user) . = ..() . += "Alt-click on [src] to toggle the [togglename]." //Hardsuit toggle code /obj/item/clothing/suit/space/hardsuit/Initialize() MakeHelmet() . = ..() /obj/item/clothing/suit/space/hardsuit/Destroy() if(helmet) helmet.suit = null qdel(helmet) qdel(jetpack) return ..() /obj/item/clothing/head/helmet/space/hardsuit/Destroy() if(suit) suit.helmet = null return ..() /obj/item/clothing/suit/space/hardsuit/proc/MakeHelmet() if(!helmettype) return if(!helmet) var/obj/item/clothing/head/helmet/space/hardsuit/W = new helmettype(src) W.suit = src helmet = W /obj/item/clothing/suit/space/hardsuit/ui_action_click() ..() ToggleHelmet() /obj/item/clothing/suit/space/hardsuit/equipped(mob/user, slot) if(!helmettype) return if(slot != SLOT_WEAR_SUIT) RemoveHelmet() ..() /obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet() if(!helmet) return suittoggled = FALSE if(ishuman(helmet.loc)) var/mob/living/carbon/H = helmet.loc if(helmet.on) helmet.attack_self(H) H.transferItemToLoc(helmet, src, TRUE) H.update_inv_wear_suit() to_chat(H, "The helmet on the hardsuit disengages.") playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) else helmet.forceMove(src) /obj/item/clothing/suit/space/hardsuit/dropped() ..() RemoveHelmet() /obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet() var/mob/living/carbon/human/H = src.loc var/datum/species/pref_species = H.dna.species if(!helmettype) return if(!helmet) return if(!suittoggled) if(ishuman(src.loc)) if(H.wear_suit != src) to_chat(H, "You must be wearing [src] to engage the helmet!") return if(H.head) to_chat(H, "You're already wearing something on your head!") return else if(H.equip_to_slot_if_possible(helmet,SLOT_HEAD,0,0,1)) if(helmet.mutantrace_variation) if("mam_snouts" in pref_species.default_features) if(H.dna.features["mam_snouts"] != "None") helmet.muzzle_var = ALT_STYLE else if("snout" in pref_species.default_features) if(H.dna.features["snout"] != "None") helmet.muzzle_var = ALT_STYLE else helmet.muzzle_var = NORMAL_STYLE H.update_inv_head() to_chat(H, "You engage the helmet on the hardsuit.") suittoggled = TRUE H.update_inv_wear_suit() playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) else RemoveHelmet()