Skip to content

Fix some IPC and loadout prefs #5823

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

Merged
merged 4 commits into from
Mar 8, 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
3 changes: 2 additions & 1 deletion code/modules/client/preferences/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
return values

/datum/preference/choiced/species/apply_to_human(mob/living/carbon/human/target, value)
target.set_species(value, icon_update = FALSE, pref_load = TRUE)
if(target.dna?.species?.type != value) // don't set species if we're already that species!!!
target.set_species(value, icon_update = FALSE, pref_load = TRUE)

/datum/preference/choiced/species/compile_constant_data()
var/list/data = list()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/human/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,12 @@ GLOBAL_LIST_EMPTY(features_by_species)


if(mutant_bodyparts["ears"])
if(!source.dna.features["ears"] || source.dna.features["ears"] == "None" || source.head && (source.head.flags_inv & HIDEHAIR) || (source.wear_mask && (source.wear_mask.flags_inv & HIDEHAIR)) || !noggin || !IS_ORGANIC_LIMB(noggin))
if(!source.dna.features["ears"] || source.dna.features["ears"] == "None" || (source.head && (source.head.flags_inv & HIDEHAIR)) || (source.wear_mask && (source.wear_mask.flags_inv & HIDEHAIR)) || !noggin || !IS_ORGANIC_LIMB(noggin))
bodyparts_to_add -= "ears"

// MONKESTATION ADDITION START
if(mutant_bodyparts["ipc_screen"])
if(!source.dna.features["ipc_screen"] || source.dna.features["ipc_screen"] == "None" || source.head && (source.head.flags_inv & HIDEFACE) || (source.wear_mask && (source.head.flags_inv & HIDEFACE)) || !noggin)
if(mutant_bodyparts["ipc_screen"])
if(!source.dna.features["ipc_screen"] || source.dna.features["ipc_screen"] == "None" || (source.head && (source.head.flags_inv & HIDEFACE)) || (source.wear_mask && (source.head.flags_inv & HIDEFACE)) || !noggin)
bodyparts_to_add -= "ipc_screen"
// MONKESTATION ADDITION END

Expand Down
36 changes: 22 additions & 14 deletions monkestation/code/datums/quirks/neutral_quirks/anime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Anime"
desc = "You are an anime enjoyer! Show your enthusiasm with some fashionable attire."
value = 0
quirk_flags = QUIRK_CHANGES_APPEARANCE | QUIRK_HIDE_FROM_SCAN
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_CHANGES_APPEARANCE | QUIRK_HIDE_FROM_SCAN
mob_trait = TRAIT_ANIME
icon = FA_ICON_PAW

Expand All @@ -13,24 +13,32 @@
)

/datum/quirk/anime/add(client/client_source)
var/mob/living/carbon/human/quirk_holder = src.quirk_holder
RegisterSignal(quirk_holder, COMSIG_SPECIES_GAIN_PRE, PROC_REF(on_species_gain))

var/datum/species/species = quirk_holder.has_dna()?.species
if(species)
for(var/obj/item/organ/external/organ_path as anything in anime_list)
if (!should_external_organ_apply_to(organ_path, quirk_holder))
continue
//Load a persons preferences from DNA
var/obj/item/organ/external/new_organ = SSwardrobe.provide_type(organ_path)
new_organ.Insert(quirk_holder, special = TRUE, drop_if_replaced = FALSE)
species.external_organs |= organ_path
var/datum/species/species = quirk_holder?.dna?.species
if(QDELETED(species))
return
for(var/obj/item/organ/external/organ_path as anything in anime_list)
if (!should_external_organ_apply_to(organ_path, quirk_holder))
continue
//Load a persons preferences from DNA
var/obj/item/organ/external/new_organ = SSwardrobe.provide_type(organ_path)
new_organ.Insert(quirk_holder, special = TRUE, drop_if_replaced = FALSE)
species.external_organs |= organ_path

/datum/quirk/anime/remove()
var/mob/living/carbon/human/quirk_holder = src.quirk_holder
UnregisterSignal(quirk_holder, COMSIG_SPECIES_GAIN_PRE)
var/datum/species/species = quirk_holder.has_dna()?.species
if(species)
for(var/obj/item/organ/external/organ_path as anything in anime_list)
species.external_organs -= organ_path
var/datum/species/species = quirk_holder?.dna?.species
if(QDELETED(species))
return
for(var/obj/item/organ/external/organ_path as anything in anime_list)
species.external_organs -= organ_path
var/obj/item/organ/external/anime_organ = quirk_holder.get_organ_by_type(organ_path)
if(!QDELETED(anime_organ))
anime_organ.Remove(quirk_holder, special = TRUE)
SSwardrobe.stash_object(anime_organ)

/datum/quirk/anime/proc/on_species_gain(datum/source, datum/species/new_species, datum/species/old_species)
for(var/obj/item/organ/external/organ_path as anything in anime_list)
Expand Down
1 change: 1 addition & 0 deletions monkestation/code/modules/client/preferences/body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

/datum/preference/choiced/body_height/apply_to_human(mob/living/carbon/human/target, value)
target.dna.body_height = value
target.update_mob_height()
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@
return values

/datum/preference/choiced/ipc_chassis/apply_to_human(mob/living/carbon/human/target, value)
target.dna.features["ipc_chassis"] = value
target.regenerate_icons()
Copy link
Member Author

Choose a reason for hiding this comment

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

the worst part is that this didn't even WORK

var/list/features = target.dna.features
if(features["ipc_chassis"] == value)
return
features["ipc_chassis"] = value
var/datum/species/ipc/ipc = target.dna?.species
if(istype(ipc)) // this is awful. i'm sorry.
ipc.update_chassis(target)

/datum/preference/choiced/ipc_screen
savefile_key = "feature_ipc_screen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
continue
item.on_equip_item(preference_source, src, visuals_only)

regenerate_icons()
//regenerate_icons()
return TRUE

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,10 @@
addtimer(CALLBACK(src, PROC_REF(switch_to_screen), transformer, "Blank"), 5 SECONDS)


/datum/species/ipc/on_species_loss(mob/living/carbon/C)
/datum/species/ipc/on_species_loss(mob/living/carbon/target)
. = ..()
UnregisterSignal(C, COMSIG_ATOM_EMAG_ACT)
if(change_screen)
change_screen.Remove(C)
UnregisterSignal(C, COMSIG_LIVING_DEATH)
UnregisterSignal(target, list(COMSIG_ATOM_EMAG_ACT, COMSIG_LIVING_DEATH))
change_screen?.Remove(target)

/datum/species/ipc/proc/handle_speech(datum/source, list/speech_args)
speech_args[SPEECH_SPANS] |= SPAN_ROBOT //beep
Expand Down Expand Up @@ -215,21 +213,31 @@
H.visible_message(span_notice("[H]'s [change_screen ? "monitor lights up" : "eyes flicker to life"]!"), span_notice("All systems nominal. You're back online!"))
return

/datum/species/ipc/replace_body(mob/living/carbon/C, datum/species/new_species)
..()
/datum/species/ipc/replace_body(mob/living/carbon/target, datum/species/new_species)
. = ..()
update_chassis(target)

var/datum/sprite_accessory/ipc_chassis/chassis_of_choice = GLOB.ipc_chassis_list[C.dna.features["ipc_chassis"]]
/datum/species/ipc/proc/update_chassis(mob/living/carbon/target)
if(!iscarbon(target) || QDELING(target))
return
var/list/features = target.dna?.features
if(!features)
return
var/datum/sprite_accessory/ipc_chassis/chassis_of_choice = GLOB.ipc_chassis_list[features["ipc_chassis"]]

if(!chassis_of_choice)
chassis_of_choice = GLOB.ipc_chassis_list[pick(GLOB.ipc_chassis_list)]
C.dna.features["ipc_chassis"] = pick(GLOB.ipc_chassis_list)

for(var/obj/item/bodypart/BP as() in C.bodyparts) //Override bodypart data as necessary
BP.limb_id = chassis_of_choice.icon_state
BP.name = "\improper[chassis_of_choice.name] [parse_zone(BP.body_zone)]"
BP.update_limb()
var/random_chassis = pick(GLOB.ipc_chassis_list)
chassis_of_choice = GLOB.ipc_chassis_list[random_chassis]
features["ipc_chassis"] = random_chassis

for(var/obj/item/bodypart/bodypart as anything in target.bodyparts) //Override bodypart data as necessary
if(QDELETED(bodypart))
return
bodypart.limb_id = chassis_of_choice.icon_state
bodypart.name = "\improper[chassis_of_choice.name] [parse_zone(bodypart.body_zone)]"
bodypart.update_limb()
if(chassis_of_choice.palette_key == MUTANT_COLOR)
BP.should_draw_greyscale = TRUE
bodypart.should_draw_greyscale = TRUE

/datum/species/ipc/proc/on_emag_act(mob/living/carbon/human/owner, mob/user)
SIGNAL_HANDLER
Expand Down
Loading