From c6b0774b861477800e994cb8ca9b16f69d5ee140 Mon Sep 17 00:00:00 2001 From: Mickyan <38563876+Mickyan@users.noreply.github.com> Date: Fri, 20 Mar 2020 08:15:10 +0100 Subject: [PATCH] [READY]Adds the Smooth-Headed (super bald) quirk (#49932) * super baldness * cleanup * fix * stuff * woops * and done * docs, changed proc names Co-authored-by: Unknown --- code/__DEFINES/dcs/signals.dm | 2 + code/__DEFINES/traits.dm | 1 + .../mood_events/generic_negative_events.dm | 4 ++ .../mood_events/generic_positive_events.dm | 4 ++ code/datums/traits/neutral.dm | 52 +++++++++++++++++++ code/game/objects/items/cosmetics.dm | 3 ++ code/game/objects/structures/mirror.dm | 2 + code/modules/mob/living/carbon/inventory.dm | 2 + .../chemistry/reagents/other_reagents.dm | 7 +-- 9 files changed, 74 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index b4f95f407b8..40e4ebca05c 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -239,6 +239,8 @@ #define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity)) #define COMSIG_CARBON_GAIN_ORGAN "carbon_gain_organ" //from /item/organ/proc/Insert() (/obj/item/organ/) #define COMSIG_CARBON_LOSE_ORGAN "carbon_lose_organ" //from /item/organ/proc/Remove() (/obj/item/organ/) +#define COMSIG_CARBON_EQUIP_HAT "carbon_equip_hat" //from /mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop, silent) +#define COMSIG_CARBON_UNEQUIP_HAT "carbon_unequip_hat" //from /mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop, silent) // /mob/living/simple_animal/hostile signals #define COMSIG_HOSTILE_ATTACKINGTARGET "hostile_attackingtarget" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index daa1fb27f78..76df451ed9e 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -210,6 +210,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_FRIENDLY "friendly" #define TRAIT_GRABWEAKNESS "grab_weakness" #define TRAIT_SNOB "snob" +#define TRAIT_BALD "bald" // common trait sources #define TRAIT_GENERIC "generic" diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index e23a5169e9a..3980534472e 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -241,3 +241,7 @@ /datum/mood_event/nanite_sadness/add_effects(message) description = "+++++++[message]+++++++\n" + +/datum/mood_event/bald + description ="I need something to cover my head...\n" + mood_change = -3 diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index 0540529518c..280e7004a36 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -189,3 +189,7 @@ /datum/mood_event/area/add_effects(_mood_change, _description) mood_change = _mood_change description = _description + +/datum/mood_event/confident_mane + description = "I'm feeling confident with a head full of hair.\n" + mood_change = 2 diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index c69d13d1792..64b6cec0e07 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -168,3 +168,55 @@ SEND_SIGNAL(H.back, COMSIG_TRY_STORAGE_SHOW, H) to_chat(quirk_holder, "There is a pinpointer [where], which can help you find your way around. Click in-hand to activate.") + +/datum/quirk/bald + name = "Smooth-Headed" + desc = "You have no hair and are quite insecure about it! Keep your wig on, or at least your head covered up." + value = 0 + mob_trait = TRAIT_BALD + gain_text = "Your head is as smooth as can be, it's terrible." + lose_text = "Your head itches, could it be... growing hair?!" + medical_record_text = "Patient starkly refused to take off headwear during examination." + ///The user's starting hairstyle + var/old_hair + +/datum/quirk/bald/add() + var/mob/living/carbon/human/H = quirk_holder + old_hair = H.hairstyle + H.hairstyle = "Bald" + H.update_hair() + RegisterSignal(H, COMSIG_CARBON_EQUIP_HAT, .proc/equip_hat) + RegisterSignal(H, COMSIG_CARBON_UNEQUIP_HAT, .proc/unequip_hat) + +/datum/quirk/bald/remove() + var/mob/living/carbon/human/H = quirk_holder + H.hairstyle = old_hair + H.update_hair() + UnregisterSignal(H, list(COMSIG_CARBON_EQUIP_HAT, COMSIG_CARBON_UNEQUIP_HAT)) + SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "bad_hair_day") + +/datum/quirk/bald/on_spawn() + var/mob/living/carbon/human/H = quirk_holder + var/obj/item/clothing/head/wig/natural/W = new(get_turf(H)) + if (old_hair == "Bald") + W.hairstyle = pick(GLOB.hairstyles_list - "Bald") + else + W.hairstyle = old_hair + W.update_icon() + var/list/slots = list ( + "head" = ITEM_SLOT_HEAD, + "backpack" = ITEM_SLOT_BACKPACK, + "hands" = ITEM_SLOT_HANDS, + ) + H.equip_in_one_of_slots(W, slots , qdel_on_fail = TRUE) + +///Checks if the headgear equipped is a wig and sets the mood event accordingly +/datum/quirk/bald/proc/equip_hat(mob/user, obj/item/hat) + if(istype(hat, /obj/item/clothing/head/wig)) + SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "bad_hair_day", /datum/mood_event/confident_mane) //Our head is covered, but also by a wig so we're happy. + else + SEND_SIGNAL(quirk_holder, COMSIG_CLEAR_MOOD_EVENT, "bad_hair_day") //Our head is covered + +///Applies a bad moodlet for having an uncovered head +/datum/quirk/bald/proc/unequip_hat(mob/user, obj/item/clothing, force, newloc, no_move, invdrop, silent) + SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "bad_hair_day", /datum/mood_event/bald) diff --git a/code/game/objects/items/cosmetics.dm b/code/game/objects/items/cosmetics.dm index 98a08fedfe7..52d043d441c 100644 --- a/code/game/objects/items/cosmetics.dm +++ b/code/game/objects/items/cosmetics.dm @@ -188,6 +188,9 @@ if(!get_location_accessible(H, location)) to_chat(user, "The headgear is in the way!") return + if(HAS_TRAIT(H, TRAIT_BALD)) + to_chat(H, "[H] is just way too bald. Like, really really bald.") + return user.visible_message("[user] tries to change [H]'s hairstyle using [src].", "You try to change [H]'s hairstyle using [src].") if(new_style && do_after(user, 60, target = H)) user.visible_message("[user] successfully changes [H]'s hairstyle using [src].", "You successfully change [H]'s hairstyle using [src].") diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 22f3d56c62e..cda38c08e7b 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -41,6 +41,8 @@ var/new_style = input(user, "Select a hairstyle", "Grooming") as null|anything in GLOB.hairstyles_list if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return //no tele-grooming + if(HAS_TRAIT(H, TRAIT_BALD)) + to_chat(H, "If only growing back hair were that easy for you...") if(new_style) H.hairstyle = new_style diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index a27d048a751..00e75095817 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -58,6 +58,7 @@ wear_mask_update(I, toggle_off = 0) if(ITEM_SLOT_HEAD) head = I + SEND_SIGNAL(src, COMSIG_CARBON_EQUIP_HAT, I) head_update(I) if(ITEM_SLOT_NECK) wear_neck = I @@ -92,6 +93,7 @@ if(I == head) head = null + SEND_SIGNAL(src, COMSIG_CARBON_UNEQUIP_HAT, I, force, newloc, no_move, invdrop, silent) if(!QDELETED(src)) head_update(I) else if(I == back) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index e23346a4892..c86e623f356 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -437,7 +437,8 @@ if(ishuman(M)) var/mob/living/carbon/human/N = M - N.hairstyle = "Spiky" + if(!HAS_TRAIT(N, TRAIT_BALD)) + N.hairstyle = "Spiky" N.facial_hairstyle = "Shaved" N.facial_hair_color = "000" N.hair_color = "000" @@ -1650,7 +1651,7 @@ /datum/reagent/barbers_aid/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(method == TOUCH || method == VAPOR) - if(M && ishuman(M)) + if(M && ishuman(M) && !HAS_TRAIT(M, TRAIT_BALD)) var/mob/living/carbon/human/H = M var/datum/sprite_accessory/hair/picked_hair = pick(GLOB.hairstyles_list) var/datum/sprite_accessory/facial_hair/picked_beard = pick(GLOB.facial_hairstyles_list) @@ -1668,7 +1669,7 @@ /datum/reagent/concentrated_barbers_aid/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(method == TOUCH || method == VAPOR) - if(M && ishuman(M)) + if(M && ishuman(M) && !HAS_TRAIT(M, TRAIT_BALD)) var/mob/living/carbon/human/H = M to_chat(H, "Your hair starts growing at an incredible speed!") H.hairstyle = "Very Long Hair"