From 28df05bbb03dc2a19ec7a6601019d5b5185dfc80 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 7 Feb 2020 00:19:17 +0100 Subject: [PATCH 1/5] step 1 --- .../code/modules/arousal/genitals.dm | 97 +++++++++---------- 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index ca01ef46cb..0820a564ad 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -262,53 +262,21 @@ update_genitals() /mob/living/carbon/human/proc/update_genitals() - if(!QDELETED(src)) - dna.species.handle_genitals(src) - -//Checks to see if organs are new on the mob, and changes their colours so that they don't get crazy colours. -/mob/living/carbon/human/proc/emergent_genital_call() - if(!client.prefs.arousable) - return FALSE - - var/organCheck = locate(/obj/item/organ/genital) in internal_organs - var/breastCheck = getorganslot(ORGAN_SLOT_BREASTS) - var/willyCheck = getorganslot(ORGAN_SLOT_PENIS) - - if(organCheck == FALSE) - if(ishuman(src) && dna.species.id == "human") - dna.features["genitals_use_skintone"] = TRUE - dna.species.use_skintones = TRUE - if(MUTCOLORS) - if(src.dna.species.fixed_mut_color) - dna.features["cock_color"] = "[dna.species.fixed_mut_color]" - dna.features["breasts_color"] = "[dna.species.fixed_mut_color]" - return - //So people who haven't set stuff up don't get rainbow surprises. - dna.features["cock_color"] = "[dna.features["mcolor"]]" - dna.features["breasts_color"] = "[dna.features["mcolor"]]" - else //If there's a new organ, make it the same colour. - if(breastCheck == FALSE) - dna.features["breasts_color"] = dna.features["cock_color"] - else if (willyCheck == FALSE) - dna.features["cock_color"] = dna.features["breasts_color"] - return TRUE - -/datum/species/proc/handle_genitals(mob/living/carbon/human/H)//more like handle sadness - if(!H)//no args - CRASH("H = null") - if(!LAZYLEN(H.internal_organs) || ((NOGENITALS in species_traits) && !H.genital_override) || HAS_TRAIT(H, TRAIT_HUSK)) + if(QDELETED(src)) return var/list/relevant_layers = list(GENITALS_BEHIND_LAYER, GENITALS_FRONT_LAYER) - for(var/L in relevant_layers) //Less hardcode - H.remove_overlay(L) - H.remove_overlay(GENITALS_EXPOSED_LAYER) + remove_overlay(L) + remove_overlay(GENITALS_EXPOSED_LAYER) + if(!LAZYLEN(internal_organs) || ((NOGENITALS in dna.species.species_traits) && !genital_override) || HAS_TRAIT(src, TRAIT_HUSK)) + return + //start scanning for genitals var/list/gen_index[GENITAL_LAYER_INDEX_LENGTH] var/list/genitals_to_add var/list/fully_exposed - for(var/obj/item/organ/genital/G in H.internal_organs) + for(var/obj/item/organ/genital/G in internal_organs) if(G.is_exposed()) //Checks appropriate clothing slot and if it's through_clothes LAZYADD(gen_index[G.layer_index], G) for(var/L in gen_index) @@ -345,19 +313,19 @@ if(S.center) genital_overlay = center_image(genital_overlay, S.dimension_x, S.dimension_y) - if(use_skintones && H.dna.features["genitals_use_skintone"]) - genital_overlay.color = "#[skintone2hex(H.skin_tone)]" + if(use_skintones && dna.features["genitals_use_skintone"]) + genital_overlay.color = "#[skintone2hex(skin_tone)]" else switch(S.color_src) if("cock_color") - genital_overlay.color = "#[H.dna.features["cock_color"]]" + genital_overlay.color = "#[dna.features["cock_color"]]" if("balls_color") - genital_overlay.color = "#[H.dna.features["balls_color"]]" + genital_overlay.color = "#[dna.features["balls_color"]]" if("breasts_color") - genital_overlay.color = "#[H.dna.features["breasts_color"]]" + genital_overlay.color = "#[dna.features["breasts_color"]]" if("vag_color") - genital_overlay.color = "#[H.dna.features["vag_color"]]" - + genital_overlay.color = "#[dna.features["vag_color"]]" + genital_overlay.icon_state = "[G.slot]_[S.icon_state]_[size]-s_[aroused_state]_[layertext]" if(layer == GENITALS_FRONT_LAYER && CHECK_BITFIELD(G.genital_flags, GENITAL_THROUGH_CLOTHES)) @@ -367,11 +335,40 @@ standing += genital_overlay if(LAZYLEN(standing)) - H.overlays_standing[layer] = standing + overlays_standing[layer] = standing if(LAZYLEN(fully_exposed)) - H.overlays_standing[GENITALS_EXPOSED_LAYER] = fully_exposed - H.apply_overlay(GENITALS_EXPOSED_LAYER) + overlays_standing[GENITALS_EXPOSED_LAYER] = fully_exposed + apply_overlay(GENITALS_EXPOSED_LAYER) for(var/L in relevant_layers) - H.apply_overlay(L) + apply_overlay(L) + + +//Checks to see if organs are new on the mob, and changes their colours so that they don't get crazy colours. +/mob/living/carbon/human/proc/emergent_genital_call() + if(!client.prefs.arousable) + return FALSE + + var/organCheck = locate(/obj/item/organ/genital) in internal_organs + var/breastCheck = getorganslot(ORGAN_SLOT_BREASTS) + var/willyCheck = getorganslot(ORGAN_SLOT_PENIS) + + if(organCheck == FALSE) + if(ishuman(src) && dna.species.id == "human") + dna.features["genitals_use_skintone"] = TRUE + dna.species.use_skintones = TRUE + if(MUTCOLORS) + if(src.dna.species.fixed_mut_color) + dna.features["cock_color"] = "[dna.species.fixed_mut_color]" + dna.features["breasts_color"] = "[dna.species.fixed_mut_color]" + return + //So people who haven't set stuff up don't get rainbow surprises. + dna.features["cock_color"] = "[dna.features["mcolor"]]" + dna.features["breasts_color"] = "[dna.features["mcolor"]]" + else //If there's a new organ, make it the same colour. + if(breastCheck == FALSE) + dna.features["breasts_color"] = dna.features["cock_color"] + else if (willyCheck == FALSE) + dna.features["cock_color"] = dna.features["breasts_color"] + return TRUE From 39d6980bab35c231c7cd4f144f5988cb0dad6dd0 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 7 Feb 2020 01:03:59 +0100 Subject: [PATCH 2/5] genitals code is so bad. --- .../code/modules/arousal/arousal.dm | 6 ---- .../code/modules/arousal/genitals.dm | 32 ++++++++----------- .../code/modules/arousal/organs/breasts.dm | 1 - .../code/modules/arousal/organs/penis.dm | 2 +- 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/modular_citadel/code/modules/arousal/arousal.dm b/modular_citadel/code/modules/arousal/arousal.dm index 3a586d061d..c23bef9a7d 100644 --- a/modular_citadel/code/modules/arousal/arousal.dm +++ b/modular_citadel/code/modules/arousal/arousal.dm @@ -10,12 +10,6 @@ var/hidden_undershirt = FALSE var/hidden_socks = FALSE -//Species vars -/datum/species - var/list/cum_fluids = list("semen") - var/list/milk_fluids = list("milk") - var/list/femcum_fluids = list("femcum") - //Mob procs /mob/living/carbon/human/proc/underwear_toggle() set name = "Toggle undergarments" diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index 0820a564ad..7231b536ea 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -32,23 +32,18 @@ else update() -/obj/item/organ/genital/Destroy() - if(linked_organ) - update_link(TRUE)//this should remove any other links it has - return ..() - /obj/item/organ/genital/proc/set_aroused_state(new_state) if(!((HAS_TRAIT(owner,TRAIT_PERMABONER) && !new_state) || HAS_TRAIT(owner,TRAIT_NEVERBONER) && new_state)) aroused_state = new_state return aroused_state -/obj/item/organ/genital/proc/update(removing = FALSE) +/obj/item/organ/genital/proc/update() if(QDELETED(src)) return update_size() update_appearance() - if(linked_organ_slot || (linked_organ && removing)) - update_link(removing) + if(linked_organ_slot || (linked_organ && !owner)) + update_link() //exposure and through-clothing code /mob/living/carbon @@ -174,19 +169,18 @@ return TRUE return FALSE -/obj/item/organ/genital/proc/update_link(removing = FALSE) - if(!removing && owner) +/obj/item/organ/genital/proc/update_link() + if(owner) if(linked_organ) - return + return FALSE linked_organ = owner.getorganslot(linked_organ_slot) if(linked_organ) linked_organ.linked_organ = src linked_organ.upon_link() upon_link() return TRUE - else - if(linked_organ) - linked_organ.linked_organ = null + if(linked_organ) + linked_organ.linked_organ = null linked_organ = null return FALSE @@ -200,10 +194,12 @@ update() RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance) -/obj/item/organ/genital/Remove(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - update(TRUE) - if(!QDELETED(owner)) - UnregisterSignal(owner, COMSIG_MOB_DEATH) +/obj/item/organ/genital/Remove(special = FALSE) + var/mob/living/carbon/human/H = . = ..() + update() + if(!QDELETED(H)) + UnregisterSignal(H, COMSIG_MOB_DEATH) + H.update_genitals() //proc to give a player their genitals and stuff when they log in /mob/living/carbon/human/proc/give_genitals(clean = FALSE)//clean will remove all pre-existing genitals. proc will then give them any genitals that are enabled in their DNA diff --git a/modular_citadel/code/modules/arousal/organs/breasts.dm b/modular_citadel/code/modules/arousal/organs/breasts.dm index 1537d5cebe..fa1a48b17d 100644 --- a/modular_citadel/code/modules/arousal/organs/breasts.dm +++ b/modular_citadel/code/modules/arousal/organs/breasts.dm @@ -63,7 +63,6 @@ var/mob/living/carbon/human/H = owner icon_state = sanitize_text(string) H.update_genitals() - icon_state = sanitize_text(string) //Allows breasts to grow and change size, with sprite changes too. //maximum wah diff --git a/modular_citadel/code/modules/arousal/organs/penis.dm b/modular_citadel/code/modules/arousal/organs/penis.dm index c6d3c764ac..a8d1a67b19 100644 --- a/modular_citadel/code/modules/arousal/organs/penis.dm +++ b/modular_citadel/code/modules/arousal/organs/penis.dm @@ -14,7 +14,7 @@ size = 2 //arbitrary value derived from length and girth for sprites. layer_index = PENIS_LAYER_INDEX var/length = 6 //inches - var/prev_length = 6 //really should be renamed to prev_length + var/prev_length = 6 var/girth = 4.38 var/girth_ratio = COCK_GIRTH_RATIO_DEF //0.73; check citadel_defines.dm From 00042292cf3ac17fdfdec9f35f864eb7301b1d6c Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 7 Feb 2020 01:14:19 +0100 Subject: [PATCH 3/5] Byond is pretty special. --- modular_citadel/code/modules/arousal/genitals.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index 7231b536ea..001a4932d8 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -195,7 +195,8 @@ RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance) /obj/item/organ/genital/Remove(special = FALSE) - var/mob/living/carbon/human/H = . = ..() + . = ..() + var/mob/living/carbon/human/H = . update() if(!QDELETED(H)) UnregisterSignal(H, COMSIG_MOB_DEATH) From 7f431af99d07df228c5c82955341b79e7223d109 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 7 Feb 2020 01:33:47 +0100 Subject: [PATCH 4/5] Ok --- .../code/modules/arousal/genitals.dm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index 001a4932d8..087b45cbb5 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -235,12 +235,6 @@ /obj/item/organ/genital/proc/get_features(mob/living/carbon/human/H) return -/datum/species/proc/genitals_layertext(layer) - switch(layer) - if(GENITALS_BEHIND_LAYER) - return "BEHIND" - if(GENITALS_FRONT_LAYER) - return "FRONT" //procs to handle sprite overlays being applied to humans @@ -261,7 +255,12 @@ /mob/living/carbon/human/proc/update_genitals() if(QDELETED(src)) return - var/list/relevant_layers = list(GENITALS_BEHIND_LAYER, GENITALS_FRONT_LAYER) + var/static/list/relevant_layers + if(!relevant_layers) + relevant_layers = list() + relevant_layers[GENITALS_BEHIND_LAYER] = "BEHIND" + relevant_layers[GENITALS_FRONT_LAYER] = "FRONT" + var/static/list/layer_strings = list for(var/L in relevant_layers) //Less hardcode remove_overlay(L) remove_overlay(GENITALS_EXPOSED_LAYER) @@ -285,7 +284,7 @@ //start applying overlays for(var/layer in relevant_layers) var/list/standing = list() - var/layertext = genitals_layertext(layer) + var/layertext = relevant_layers[layer] for(var/A in genitals_to_add) var/obj/item/organ/genital/G = A var/datum/sprite_accessory/S @@ -310,7 +309,7 @@ if(S.center) genital_overlay = center_image(genital_overlay, S.dimension_x, S.dimension_y) - if(use_skintones && dna.features["genitals_use_skintone"]) + if(dna.species.use_skintones && dna.features["genitals_use_skintone"]) genital_overlay.color = "#[skintone2hex(skin_tone)]" else switch(S.color_src) From 2370de52f9d80201821819753a70efcceeaa7a68 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Fri, 7 Feb 2020 02:46:15 +0100 Subject: [PATCH 5/5] Update genitals.dm --- modular_citadel/code/modules/arousal/genitals.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index 087b45cbb5..d457bcd128 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -260,7 +260,6 @@ relevant_layers = list() relevant_layers[GENITALS_BEHIND_LAYER] = "BEHIND" relevant_layers[GENITALS_FRONT_LAYER] = "FRONT" - var/static/list/layer_strings = list for(var/L in relevant_layers) //Less hardcode remove_overlay(L) remove_overlay(GENITALS_EXPOSED_LAYER)