Hairgrownium and Super Hairgrownium now work on All Species, refactored so if it produces random hair styles for a non-human, it won't do so repeatedly until the reagent is depleted. Also means that species that need breath masks to live won't be killed by infinite fake moustaches.

This commit is contained in:
KasparoVy
2016-04-30 22:05:57 -04:00
parent 73dbbed70e
commit 7205d3a0e3
2 changed files with 16 additions and 8 deletions
+15 -7
View File
@@ -198,7 +198,7 @@ datum/reagent/hair_dye
datum/reagent/hair_dye/reaction_mob(var/mob/living/M, var/volume)
if(M && ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/head_organ = H.organs_by_name["head"]
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
head_organ.r_facial = rand(0,255)
head_organ.g_facial = rand(0,255)
head_organ.b_facial = rand(0,255)
@@ -230,8 +230,8 @@ datum/reagent/hairgrownium/reaction_mob(var/mob/living/M, var/volume)
if(M && ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
head_organ.h_style = random_hair_style(H.gender, head_organ.species)
head_organ.f_style = random_facial_hair_style(H.gender, head_organ.species)
head_organ.h_style = random_hair_style(H.gender, head_organ.species.name)
head_organ.f_style = random_facial_hair_style(H.gender, head_organ.species.name)
H.update_hair()
H.update_fhair()
..()
@@ -254,13 +254,21 @@ datum/reagent/super_hairgrownium
result_amount = 3
mix_message = "The liquid becomes amazingly furry and smells peculiar."
datum/reagent/super_hairgrownium/on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
datum/reagent/super_hairgrownium/reaction_mob(var/mob/living/M, var/volume)
if(M && ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
head_organ.h_style = "Very Long Hair"
head_organ.f_style = "Very Long Beard"
var/datum/sprite_accessory/tmp_hair_style = hair_styles_list["Very Long Hair"]
var/datum/sprite_accessory/tmp_facial_hair_style = facial_hair_styles_list["Very Long Beard"]
if(head_organ.species.name in tmp_hair_style.species_allowed) //If 'Very Long Hair' is a style the person's species can have, give it to them.
head_organ.h_style = "Very Long Hair"
else //Otherwise, give them a random hair style.
head_organ.h_style = random_hair_style(H.gender, head_organ.species.name)
if(head_organ.species.name in tmp_facial_hair_style.species_allowed) //If 'Very Long Beard' is a style the person's species can have, give it to them.
head_organ.f_style = "Very Long Beard"
else //Otherwise, give them a random facial hair style.
head_organ.f_style = random_facial_hair_style(H.gender, head_organ.species.name)
H.update_hair()
H.update_fhair()
if(!H.wear_mask || H.wear_mask && !istype(H.wear_mask, /obj/item/clothing/mask/fakemoustache))