Selectively randomisable characters (#46108)

* Selectively randomisable characters

* it's a list now

* this doesn't work

* it's totally fucking fucked mate big time

* it works

* so sick of this goddamn pull request and yes i know this is a retarded way to do this it didn't work the other way

* anturk forestalls the inevitable suicide

'associative lists are more performant'

* final changes anturk requested

'remove all the "in randomise" and it's ready'
This commit is contained in:
cacogen
2019-09-06 08:50:12 +02:00
committed by AnturK
parent 37c5663b5b
commit 1f010e7144
35 changed files with 378 additions and 309 deletions
+13 -13
View File
@@ -37,10 +37,10 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
var/ghost_orbit = GHOST_ORBIT_CIRCLE
//These variables store hair data if the ghost originates from a species with head and/or facial hair.
var/hair_style
var/hairstyle
var/hair_color
var/mutable_appearance/hair_overlay
var/facial_hair_style
var/facial_hairstyle
var/facial_hair_color
var/mutable_appearance/facial_hair_overlay
@@ -98,10 +98,10 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
if(ishuman(body))
var/mob/living/carbon/human/body_human = body
if(HAIR in body_human.dna.species.species_traits)
hair_style = body_human.hair_style
hairstyle = body_human.hairstyle
hair_color = brighten_color(body_human.hair_color)
if(FACEHAIR in body_human.dna.species.species_traits)
facial_hair_style = body_human.facial_hair_style
facial_hairstyle = body_human.facial_hairstyle
facial_hair_color = brighten_color(body_human.facial_hair_color)
update_icon()
@@ -206,16 +206,16 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
if(ghost_accs == GHOST_ACCS_FULL && icon_state in GLOB.ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them
var/datum/sprite_accessory/S
if(facial_hair_style)
S = GLOB.facial_hair_styles_list[facial_hair_style]
if(facial_hairstyle)
S = GLOB.facial_hairstyles_list[facial_hairstyle]
if(S)
facial_hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER)
if(facial_hair_color)
facial_hair_overlay.color = "#" + facial_hair_color
facial_hair_overlay.alpha = 200
add_overlay(facial_hair_overlay)
if(hair_style)
S = GLOB.hair_styles_list[hair_style]
if(hairstyle)
S = GLOB.hairstyles_list[hairstyle]
if(S)
hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER)
if(hair_color)
@@ -351,7 +351,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/response = alert(src, "Are you sure you want to prevent (almost) all means of resuscitation? This cannot be undone. ","Are you sure you want to stay dead?","DNR","Save Me")
if(response != "DNR")
return
return
can_reenter_corpse = FALSE
to_chat(src, "You can no longer be brought back into your body.")
@@ -738,16 +738,16 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if((!client) || (!client.prefs))
return
if(client.prefs.be_random_name)
if(client.prefs.randomise[RANDOM_NAME])
client.prefs.real_name = random_unique_name(gender)
if(client.prefs.be_random_body)
if(client.prefs.randomise[RANDOM_BODY])
client.prefs.random_character(gender)
if(HAIR in client.prefs.pref_species.species_traits)
hair_style = client.prefs.hair_style
hairstyle = client.prefs.hairstyle
hair_color = brighten_color(client.prefs.hair_color)
if(FACEHAIR in client.prefs.pref_species.species_traits)
facial_hair_style = client.prefs.facial_hair_style
facial_hairstyle = client.prefs.facial_hairstyle
facial_hair_color = brighten_color(client.prefs.facial_hair_color)
update_icon()