Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPC resprite #13754

Merged
merged 2 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion code/modules/client/character_menu/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,22 @@

if("h_style")
var/list/valid_hairstyles = get_valid_styles_from_cache(hairs_cache)
if(!length(valid_hairstyles))
return
var/new_h_style = input(user, "Choose your character's hair style:", "Character Hair Style", h_style) as null|anything in valid_hairstyles
if(new_h_style)
h_style = new_h_style

if("h_style_left")
var/list/valid_hairstyles = get_valid_styles_from_cache(hairs_cache)
if(!length(valid_hairstyles))
return
h_style = valid_hairstyles[h_style][LEFT]

if("h_style_right")
var/list/valid_hairstyles = get_valid_styles_from_cache(hairs_cache)
if(!length(valid_hairstyles))
return
h_style = valid_hairstyles[h_style][RIGHT]

if("grad_color")
Expand Down Expand Up @@ -385,16 +391,22 @@

if("f_style")
var/list/valid_facialhairstyles = get_valid_styles_from_cache(facial_hairs_cache)
if(!length(valid_facialhairstyles))
return
var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character facial-hair style", f_style) as null|anything in valid_facialhairstyles
if(new_f_style)
f_style = new_f_style

if("f_style_left")
var/list/valid_facialhairstyles = get_valid_styles_from_cache(facial_hairs_cache)
if(!length(valid_facialhairstyles))
return
f_style = valid_facialhairstyles[f_style][LEFT]

if("f_style_right")
var/list/valid_facialhairstyles = get_valid_styles_from_cache(facial_hairs_cache)
if(!length(valid_facialhairstyles))
return
f_style = valid_facialhairstyles[f_style][RIGHT]

if("underwear")
Expand Down Expand Up @@ -595,7 +607,7 @@
organ_data[organ] = "mechanical"
// Choosing a head for an IPC
if("ipc_head")
var/list/ipc_heads = list("Default", "Alien", "Double", "Pillar", "Human")
var/list/ipc_heads = list("Default", "Cobalt", "Cathod", "Thorax", "Axon")
ipc_head = input("Please select a head type", "Character Generation", null) in ipc_heads
h_style = random_hair_style(gender, species, ipc_head)

Expand Down
16 changes: 8 additions & 8 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,17 @@ var/global/list/datum/preferences/preferences_datums = list()
if("Default")
var/obj/item/organ/external/head/robot/ipc/H = new(null)
H.insert_organ(character)
if("Alien")
var/obj/item/organ/external/head/robot/ipc/alien/H = new(null)
if("Cobalt")
var/obj/item/organ/external/head/robot/ipc/cobalt/H = new(null)
H.insert_organ(character)
if("Double")
var/obj/item/organ/external/head/robot/ipc/double/H = new(null)
if("Cathod")
var/obj/item/organ/external/head/robot/ipc/cathod/H = new(null)
H.insert_organ(character)
if("Pillar")
var/obj/item/organ/external/head/robot/ipc/pillar/H = new(null)
if("Thorax")
var/obj/item/organ/external/head/robot/ipc/thorax/H = new(null)
H.insert_organ(character)
if("Human")
var/obj/item/organ/external/head/robot/ipc/human/H = new(null)
if("Axon")
var/obj/item/organ/external/head/robot/ipc/axon/H = new(null)
H.insert_organ(character)
var/obj/item/organ/internal/eyes/ipc/IO = new(null)
IO.insert_organ(character)
Expand Down
14 changes: 13 additions & 1 deletion code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//This is the current version, anything below this will attempt to update (if it's not obsolete)

#define SAVEFILE_VERSION_MAX 52
#define SAVEFILE_VERSION_MAX 53

//For repetitive updates, should be the same or below SAVEFILE_VERSION_MAX
//set this to (current SAVEFILE_VERSION_MAX)+1 when you need to update:
Expand Down Expand Up @@ -466,6 +466,18 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if (pre_52_hairstyles_to_modern_ones[h_style])
h_style = pre_52_hairstyles_to_modern_ones[h_style]

if(current_version < 53)
ipc_head = initial(ipc_head)
// fuck named hairstyles, we should just move it to indexes
var/static/list/ipc_hairstyles_reset = list(
"alien IPC screen",
"double IPC screen",
"pillar IPC screen",
"human IPC screen"
)
if(h_style in ipc_hairstyles_reset)
h_style = "Default"

//
/datum/preferences/proc/repetitive_updates_character(current_version, savefile/S)

Expand Down
32 changes: 16 additions & 16 deletions code/modules/mob/dead/new_player/sprite_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1051,29 +1051,29 @@
species_allowed = list(IPC)
ipc_head_compatible = "Default"

/datum/sprite_accessory/hair/ipc_screen_alien
name = "alien IPC screen"
icon_state = "ipc_alien"
/datum/sprite_accessory/hair/ipc_screen_cobalt
name = "cobalt IPC screen"
icon_state = "ipc_cobalt"
species_allowed = list(IPC)
ipc_head_compatible = "Alien"
ipc_head_compatible = "Cobalt"

/datum/sprite_accessory/hair/ipc_screen_double
name = "double IPC screen"
icon_state = "ipc_double"
/datum/sprite_accessory/hair/ipc_screen_cathod
name = "cathod IPC screen"
icon_state = "ipc_cathod"
species_allowed = list(IPC)
ipc_head_compatible = "Double"
ipc_head_compatible = "Cathod"

/datum/sprite_accessory/hair/ipc_screen_pillar
name = "pillar IPC screen"
icon_state = "ipc_pillar"
/datum/sprite_accessory/hair/ipc_screen_thorax
name = "thorax IPC screen"
icon_state = "ipc_thorax"
species_allowed = list(IPC)
ipc_head_compatible = "Pillar"
ipc_head_compatible = "Thorax"

/datum/sprite_accessory/hair/ipc_screen_human
name = "human IPC screen"
icon_state = "ipc_human"
/datum/sprite_accessory/hair/ipc_screen_axon
name = "axon IPC screen"
icon_state = "ipc_axon"
species_allowed = list(IPC)
ipc_head_compatible = "Human"
ipc_head_compatible = "Axon"

/datum/sprite_accessory/hair/ipc_tamagotchi
name = "tamagotchi IPC screen"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

var/icobase = 'icons/mob/human_races/r_human.dmi' // Normal icon set.
var/deform = 'icons/mob/human_races/r_def_human.dmi' // Mutated icon set.
var/alpha_color_mask = FALSE

var/damage_mask = TRUE
var/eyes_icon = 'icons/mob/human_face.dmi'
var/eyes = "eyes" // Icon for eyes.
Expand Down Expand Up @@ -1076,6 +1078,8 @@
name = IPC
icobase = 'icons/mob/human_races/r_machine.dmi'
deform = 'icons/mob/human_races/r_machine.dmi'
alpha_color_mask = TRUE

language = LANGUAGE_TRINARY
unarmed_type = /datum/unarmed_attack/punch
race_verbs = list(
Expand Down
16 changes: 8 additions & 8 deletions code/modules/organs/external/ipc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
icon_state = "[body_zone]_[ipc_head]"
color = original_color

/obj/item/organ/external/head/robot/ipc/alien
ipc_head = "Alien"
/obj/item/organ/external/head/robot/ipc/cobalt
ipc_head = "Cobalt"

/obj/item/organ/external/head/robot/ipc/double
ipc_head = "Double"
/obj/item/organ/external/head/robot/ipc/cathod
ipc_head = "Cathod"

/obj/item/organ/external/head/robot/ipc/pillar
ipc_head = "Pillar"
/obj/item/organ/external/head/robot/ipc/thorax
ipc_head = "Thorax"

/obj/item/organ/external/head/robot/ipc/human
ipc_head = "Human"
/obj/item/organ/external/head/robot/ipc/axon
ipc_head = "Axon"

/obj/item/organ/external/groin/robot/ipc
name = "ipc groin"
Expand Down
45 changes: 27 additions & 18 deletions code/modules/organs/organ_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -569,42 +569,51 @@ Note that amputating the affected organ does in fact remove the infection from t
return

update_sprite()
var/mutable_appearance/MA = mutable_appearance(icon, icon_state, -icon_layer)
MA.color = color
var/mutable_appearance/base_appearance = mutable_appearance(icon, icon_state, -icon_layer)
. = list(base_appearance)

return MA
if(species && species.alpha_color_mask)
var/mutable_appearance/color_appearance = mutable_appearance(icon, "alpha_[icon_state]", -icon_layer)
color_appearance.color = color
. += color_appearance
Comment on lines +575 to +578
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

заметка на будущее - если у каких-то рас будет маска только на одну часть тела, то мы можем alpha_color_mask из бинарного значения превратить в список частей тела, для которых требуется маска.

else
base_appearance.color = color

/obj/item/organ/external/head/get_icon(icon_layer)
if (!owner)
return

update_sprite()
var/mutable_appearance/MA = mutable_appearance(icon, icon_state, -icon_layer)
MA.color = color
. = list(MA)
var/mutable_appearance/base_appearance = mutable_appearance(icon, icon_state, -icon_layer)
. = list(base_appearance)

if(species && species.alpha_color_mask)
var/mutable_appearance/color_appearance = mutable_appearance(icon, "alpha_[icon_state]", -icon_layer)
color_appearance.color = color
. += color_appearance
else
base_appearance.color = color

//Eyes
if(species && species.eyes)
var/eyes_layer = -icon_layer
var/mutable_appearance/img_eyes_s = mutable_appearance(species.eyes_icon, species.eyes, eyes_layer)
var/mutable_appearance/eyes_appearance = mutable_appearance(species.eyes_icon, species.eyes, -icon_layer)
if(species.eyes_glowing)
img_eyes_s.plane = LIGHTING_LAMPS_PLANE
img_eyes_s.layer = ABOVE_LIGHTING_LAYER
eyes_appearance.plane = LIGHTING_LAMPS_PLANE
eyes_appearance.layer = ABOVE_LIGHTING_LAYER

if(HULK in owner.mutations)
img_eyes_s.color = "#ff0000"
eyes_appearance.color = "#ff0000"
else if(species.name == SHADOWLING || iszombie(owner))
img_eyes_s.color = null
eyes_appearance.color = null
else
img_eyes_s.color = rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)
eyes_appearance.color = rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)

. += img_eyes_s
. += eyes_appearance

//Mouth (lipstick!)
if(owner.lip_style && owner.species.flags[HAS_LIPS]) // skeletons are allowed to wear lipstick no matter what you think, agouri.
var/mutable_appearance/lips = mutable_appearance('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s", -icon_layer)
lips.color = owner.lip_color
. += lips
var/mutable_appearance/lips_appearance = mutable_appearance('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s", -icon_layer)
lips_appearance.color = owner.lip_color
. += lips_appearance

// Runs once when attached
/obj/item/organ/external/proc/check_rejection()
Expand Down
Binary file modified icons/mob/human_face.dmi
Binary file not shown.
Binary file modified icons/mob/human_races/r_machine.dmi
Binary file not shown.
Loading