//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 ///Alternative mode for hiding the hood, instead of storing the hood in the suit it qdels it, useful for when you deal with hooded suit with storage. var/alternative_mode = FALSE var/no_t //do not update sprites when pulling up hood so we can avoid oddities with certain mechanics /obj/item/clothing/suit/hooded/Initialize(mapload) . = ..() hood = MakeHelmet() /obj/item/clothing/suit/hooded/Destroy() . = ..() qdel(hood) hood = null /obj/item/clothing/suit/proc/MakeHelmet(obj/item/clothing/head/H) SEND_SIGNAL(src, COMSIG_SUIT_MADE_HELMET, H) return H /obj/item/clothing/suit/hooded/MakeHelmet(obj/item/clothing/head/hooded/H) if(!hood) H = new hoodtype(src) H.suit = src return ..() /obj/item/clothing/suit/hooded/ui_action_click() ToggleHood() /obj/item/clothing/suit/hooded/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_OCLOTHING || slot == ITEM_SLOT_NECK) return TRUE /obj/item/clothing/suit/hooded/equipped(mob/user, slot) if(slot != ITEM_SLOT_OCLOTHING && slot != ITEM_SLOT_NECK) RemoveHood() ..() /obj/item/clothing/suit/hooded/proc/RemoveHood() suittoggled = FALSE if(ishuman(hood.loc)) var/mob/living/carbon/H = hood.loc H.transferItemToLoc(hood, src, TRUE) H.update_inv_wear_suit() else if(alternative_mode) QDEL_NULL(hood) hood.forceMove(src) update_icon() /obj/item/clothing/suit/hooded/update_icon_state() if(no_t) return icon_state = "[initial(icon_state)]" if(ishuman(hood?.loc)) var/mob/living/carbon/human/H = hood.loc if(H.head == hood) icon_state += "_t" /obj/item/clothing/suit/hooded/dropped(mob/user) ..() RemoveHood() /obj/item/clothing/suit/hooded/proc/ToggleHood() if(!hood) to_chat(loc, "[src] seems to be missing its hood..") return if(atom_colours) hood.atom_colours = atom_colours.Copy() hood.update_atom_colour() 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,ITEM_SLOT_HEAD,0,0,1)) suittoggled = TRUE update_icon() H.update_inv_wear_suit() else RemoveHood() /obj/item/clothing/head/hooded var/obj/item/clothing/suit/hooded/suit dynamic_hair_suffix = "" /obj/item/clothing/head/hooded/Destroy() suit = null return ..() /obj/item/clothing/head/hooded/dropped(mob/user) ..() if(suit) suit.RemoveHood() /obj/item/clothing/head/hooded/equipped(mob/user, slot) ..() if(slot != ITEM_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/proc/on_toggle(mob/user) // override this, not suit_toggle, which does checks to_chat(usr, "You toggle [src]'s [togglename].") /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 FALSE on_toggle(usr) 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.UpdateButtons() /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(mapload) . = ..() helmet = 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/MakeHelmet(obj/item/clothing/head/helmet/space/hardsuit/H) if(!helmettype) return if(!helmet) H = new helmettype(src) H.suit = src return ..() /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 != ITEM_SLOT_OCLOTHING) RemoveHelmet() ..() /obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet(message = TRUE) 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() if(message) to_chat(H, "The helmet on the hardsuit disengages.") playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) else helmet.forceMove(src) return TRUE /obj/item/clothing/suit/space/hardsuit/dropped(mob/user) ..() RemoveHelmet() /obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet(message = TRUE) var/mob/living/carbon/human/H = loc if(!helmettype) return if(!helmet) to_chat(H, "[src] seems to be missing its helmet..") return if(atom_colours) helmet.atom_colours = atom_colours.Copy() helmet.update_atom_colour() if(!suittoggled) if(ishuman(src.loc)) if(H.wear_suit != src) if(message) to_chat(H, "You must be wearing [src] to engage the helmet!") return if(H.head) if(message) to_chat(H, "You're already wearing something on your head!") return else if(H.equip_to_slot_if_possible(helmet,ITEM_SLOT_HEAD,0,0,1)) if(message) 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) return TRUE else return RemoveHelmet(message)