From 376f6e8b4adfe74516942577a3b86de12501cb02 Mon Sep 17 00:00:00 2001 From: Ghommie Date: Tue, 23 Jul 2019 23:54:11 +0200 Subject: [PATCH] arousal states won't persist after death anymore. --- code/modules/surgery/organs/organ_internal.dm | 4 +++- .../code/modules/arousal/organs/_genitals.dm | 14 ++++++++++---- .../code/modules/arousal/organs/breasts.dm | 1 + .../code/modules/arousal/organs/penis.dm | 16 ++++++++-------- .../code/modules/arousal/organs/testicles.dm | 7 +++++-- .../code/modules/arousal/organs/vagina.dm | 1 + .../icons/obj/genitals/testicles_onmob.dmi | Bin 562 -> 561 bytes 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index b16967b6b0..a17b983689 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -16,7 +16,7 @@ /obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) if(!iscarbon(M) || owner == M) - return + return FALSE var/obj/item/organ/replaced = M.getorganslot(slot) if(replaced) @@ -33,6 +33,7 @@ for(var/X in actions) var/datum/action/A = X A.Grant(M) + return TRUE //Special is for instant replacement like autosurgeons /obj/item/organ/proc/Remove(mob/living/carbon/M, special = 0) @@ -46,6 +47,7 @@ for(var/X in actions) var/datum/action/A = X A.Remove(M) + return TRUE /obj/item/organ/proc/on_find(mob/living/finder) diff --git a/modular_citadel/code/modules/arousal/organs/_genitals.dm b/modular_citadel/code/modules/arousal/organs/_genitals.dm index c4c3eaa9f1..292cc5f4ee 100644 --- a/modular_citadel/code/modules/arousal/organs/_genitals.dm +++ b/modular_citadel/code/modules/arousal/organs/_genitals.dm @@ -113,6 +113,8 @@ return /obj/item/organ/genital/proc/update_appearance() + if(!owner || owner.stat == DEAD) + aroused_state = FALSE return /obj/item/organ/genital/on_life() @@ -142,12 +144,16 @@ return FALSE /obj/item/organ/genital/Insert(mob/living/carbon/M, special = 0) - ..() - update() + . = ..() + if(.) + update() + RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance) /obj/item/organ/genital/Remove(mob/living/carbon/M, special = 0) - ..() - update(TRUE) + . = ..() + if(.) + update(TRUE) + UnregisterSignal(M, COMSIG_MOB_DEATH) //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 f6d5673a53..3fec45006b 100644 --- a/modular_citadel/code/modules/arousal/organs/breasts.dm +++ b/modular_citadel/code/modules/arousal/organs/breasts.dm @@ -17,6 +17,7 @@ fluid_transfer_factor = 0.5 /obj/item/organ/genital/breasts/update_appearance() + . = ..() var/lowershape = lowertext(shape) switch(lowershape) if("pair") diff --git a/modular_citadel/code/modules/arousal/organs/penis.dm b/modular_citadel/code/modules/arousal/organs/penis.dm index 2593460a32..5ab9868895 100644 --- a/modular_citadel/code/modules/arousal/organs/penis.dm +++ b/modular_citadel/code/modules/arousal/organs/penis.dm @@ -16,27 +16,27 @@ var/girth = 0 var/girth_ratio = COCK_GIRTH_RATIO_DEF //0.73; check citadel_defines.dm var/knot_girth_ratio = KNOT_GIRTH_RATIO_DEF - var/list/dickflags = list() var/list/knotted_types = list("knotted", "barbed, knotted") /obj/item/organ/genital/penis/update_size() if(length == cached_length) return + var/new_size switch(length) if(-INFINITY to 5) - size = 1 + new_size = 1 if(5 to 9) - size = 2 + new_size = 2 if(15 to INFINITY) - size = 3//no new sprites for anything larger yet -/* if(9 to 15) - size = 3 - if(15 to INFINITY) - size = 3*/ + new_size = 3 //no new sprites for anything larger yet. girth = (length * girth_ratio) cached_length = length + if(linked_organ) + linked_organ.update_size(new_size - size) + size = new_size /obj/item/organ/genital/penis/update_appearance() + . = ..() var/string var/lowershape = lowertext(shape) desc = "You see [aroused_state ? "an erect" : "a flaccid"] [lowershape] [name]. You estimate it's about [round(length, 0.25)] inch[round(length, 0.25) != 1 ? "es" : ""] long and [round(girth, 0.25)] inch[round(girth, 0.25) != 1 ? "es" : ""] in girth." diff --git a/modular_citadel/code/modules/arousal/organs/testicles.dm b/modular_citadel/code/modules/arousal/organs/testicles.dm index c67d6a49a4..2e1b330095 100644 --- a/modular_citadel/code/modules/arousal/organs/testicles.dm +++ b/modular_citadel/code/modules/arousal/organs/testicles.dm @@ -36,7 +36,9 @@ to_chat(owner, msg) return TRUE -/obj/item/organ/genital/testicles/update_appearance() +/obj/item/organ/genital/testicles/update_size(new_size) + if(new_size) + size = CLAMP(size + new_size, BALLS_SIZE_MIN, BALLS_SIZE_MAX) switch(size) if(BALLS_SIZE_MIN) size_name = "average" @@ -47,8 +49,9 @@ else size_name = "nonexistant" +/obj/item/organ/genital/testicles/update_appearance() + . = ..() desc = "You see an [size_name] pair of testicles." - if(owner) var/string if(owner.dna.species.use_skintones && owner.dna.features["genitals_use_skintone"]) diff --git a/modular_citadel/code/modules/arousal/organs/vagina.dm b/modular_citadel/code/modules/arousal/organs/vagina.dm index af2beb5f79..1b4b088015 100644 --- a/modular_citadel/code/modules/arousal/organs/vagina.dm +++ b/modular_citadel/code/modules/arousal/organs/vagina.dm @@ -20,6 +20,7 @@ var/list/vag_types = list("tentacle", "dentata", "hairy", "spade", "furred") /obj/item/organ/genital/vagina/update_appearance() + . = ..() var/string //Keeping this code here, so making multiple sprites for the different kinds is easier. var/lowershape = lowertext(shape) var/details diff --git a/modular_citadel/icons/obj/genitals/testicles_onmob.dmi b/modular_citadel/icons/obj/genitals/testicles_onmob.dmi index 7d4d2610c5337d0877fd9d741c38998893444576..65eb24268f99929355d5d90054cf8d6a1c2b3a97 100644 GIT binary patch delta 193 zcmV;y06zb+1hE8=Qh%#@R9JLGWpiV4X>fFDZ*Bkpc$}ruK@P$o5CzaRoPxA#O#!zq zY#@q>T!A!pEF`ri4AJY`)&r=po4@$;lF8Jp)kkBQx)}O|h~Y7@J=<*?N?xH)ehyMl z;voz^eFCN~!8}$8Foo*~=rByf2#&kP9n`s^qz@67J(S#HcQuD)=3k1fJ{hb2?}}Vh v6reH}l?5o@VD^F6YW9iqVNnFjd|3Vf*GyZrzWy8X+Uw7#l4CKm2LUSq=#E*> delta 194 zcmV;z06qV)1hNE>Qh%&^R9JLGWpiV4X>fFDZ*Bkpc$}q@K@Ng25JlJRDH>R7D0S;X z(nf0{S7?ZgbP~jbY4rMn96%j*|1aLWWNscQ%-_{sLC+Hq)$