diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm
index f8e404713d..7b3b637e26 100644
--- a/modular_citadel/code/modules/arousal/genitals.dm
+++ b/modular_citadel/code/modules/arousal/genitals.dm
@@ -19,13 +19,17 @@
var/linked_organ_slot //only one of the two organs needs this to be set up. update_link() will handle linking the rest.
var/layer_index = GENITAL_LAYER_INDEX //Order should be very important. FIRST vagina, THEN testicles, THEN penis, as this affects the order they are rendered in.
-/obj/item/organ/genital/Initialize()
+/obj/item/organ/genital/Initialize(mapload, mob/living/carbon/human/H)
. = ..()
if(fluid_id)
create_reagents(fluid_max_volume)
if(CHECK_BITFIELD(genital_flags, GENITAL_FUID_PRODUCTION))
reagents.add_reagent(fluid_id, fluid_max_volume)
- update()
+ if(H)
+ get_features(H)
+ Insert(H)
+ else
+ update()
/obj/item/organ/genital/Destroy()
if(linked_organ)
@@ -180,9 +184,7 @@
/mob/living/carbon/human/proc/give_genital(obj/item/organ/genital/G)
if(!dna || (NOGENITALS in dna.species.species_traits) || getorganslot(initial(G.slot)))
return FALSE
- G = new G
- G.get_features(src)
- G.Insert(src)
+ G = new G(null, src)
return G
/obj/item/organ/genital/proc/get_features(mob/living/carbon/human/H)
diff --git a/modular_citadel/code/modules/arousal/organs/breasts.dm b/modular_citadel/code/modules/arousal/organs/breasts.dm
index c862e21bc5..08b99eabfa 100644
--- a/modular_citadel/code/modules/arousal/organs/breasts.dm
+++ b/modular_citadel/code/modules/arousal/organs/breasts.dm
@@ -12,10 +12,17 @@
masturbation_verb = "massage"
orgasm_verb = "leaking"
fluid_transfer_factor = 0.5
- var/breast_values = list ("a" = 1, "b" = 2, "c" = 3, "d" = 4, "e" = 5, "f" = 6, "g" = 7, "h" = 8, "i" = 9, "j" = 10, "k" = 11, "l" = 12, "m" = 13, "n" = 14, "o" = 15, "huge" = 16, "flat" = 0)
+ var/list/static/breast_values = list("a" = 1, "b" = 2, "c" = 3, "d" = 4, "e" = 5, "f" = 6, "g" = 7, "h" = 8, "i" = 9, "j" = 10, "k" = 11, "l" = 12, "m" = 13, "n" = 14, "o" = 15, "huge" = 16, "flat" = 0)
var/cached_size //for enlargement SHOULD BE A NUMBER
var/prev_size //For flavour texts SHOULD BE A LETTER
+/obj/item/organ/genital/breasts/Initialize(mapload, mob/living/carbon/human/H)
+ if(!H)
+ cached_size = size
+ size = breast_values[size]
+ prev_size = size
+ return ..()
+
/obj/item/organ/genital/breasts/update_appearance()
. = ..()
var/lowershape = lowertext(shape)
@@ -28,14 +35,13 @@
desc = "You see three sets of breasts, running from their chest to their belly."
else
desc = "You see some breasts, they seem to be quite exotic."
- if(cached_size > 16)
+ if(size == "huge")
desc = "You see [pick("some serious honkers", "a real set of badonkers", "some dobonhonkeros", "massive dohoonkabhankoloos", "two big old tonhongerekoogers", "a couple of giant bonkhonagahoogs", "a pair of humongous hungolomghnonoloughongous")]. Their volume is way beyond cupsize now, measuring in about [round(cached_size)]cm in diameter."
- else if (!isnum(size))
+ else
if (size == "flat")
desc += " They're very small and flatchested, however."
else
desc += " You estimate that they're [uppertext(size)]-cups."
- //string = "breasts_[lowertext(shape)]_[size]-s"
if(CHECK_BITFIELD(genital_flags, GENITAL_FUID_PRODUCTION) && aroused_state)
desc += " They're leaking [fluid_id]."
@@ -62,38 +68,40 @@
//this is far too lewd wah
/obj/item/organ/genital/breasts/update_size()//wah
- if(cached_size == size)
- return
if(cached_size < 0)//I don't actually know what round() does to negative numbers, so to be safe!!fixed
if(owner)
- to_chat(owner, "You feel your breasts shrinking away from your body as your chest flattens out.")
+ to_chat(owner, "You feel your breasts shrinking away from your body as your chest flattens out.")
QDEL_IN(src, 1)
+ return
var/enlargement = FALSE
- switch(cached_size)
- if(0 to 0.99) //If flatchested
+ switch(round(cached_size))
+ if(0) //flatchested
size = "flat"
- if(16 to INFINITY) //if Rediculous
+ if(1 to 8) //modest
+ size = breast_values[round(cached_size)]
+ if(9 to 15) //massive
+ size = breast_values[round(cached_size)]
+ enlargement = TRUE
+ if(16 to INFINITY) //rediculous
size = "huge"
enlargement = TRUE
- if(owner && !enlargement)
- if(!owner.has_status_effect(/datum/status_effect/chem/breast_enlarger))
+ if(owner)
+ var/status_effect = owner.has_status_effect(/datum/status_effect/chem/breast_enlarger)
+ if(enlargement && !status_effect)
owner.apply_status_effect(/datum/status_effect/chem/breast_enlarger)
- size = breast_values[round(cached_size)]
+ else if(status_effect)
+ owner.remove_status_effect(/datum/status_effect/chem/breast_enlarger)
if(round(cached_size) < 16)//Because byond doesn't count from 0, I have to do this.
- if(isnum(prev_size))
- prev_size = breast_values[prev_size]
if(owner)
var/mob/living/carbon/human/H = owner
if (breast_values[size] > breast_values[prev_size])
- to_chat(H, "Your breasts [pick("swell up to", "flourish into", "expand into", "burst forth into", "grow eagerly into", "amplify into")] a [uppertext(size)]-cup.")
+ to_chat(H, "Your breasts [pick("swell up to", "flourish into", "expand into", "burst forth into", "grow eagerly into", "amplify into")] a [uppertext(size)]-cup.")
H.dna.species.handle_genitals(src)
else if (breast_values[size] > 0.5)
- to_chat(H, "Your breasts [pick("shrink down to", "decrease into", "diminish into", "deflate into", "shrivel regretfully into", "contracts into")] a [uppertext(size)]-cup.")
+ to_chat(H, "Your breasts [pick("shrink down to", "decrease into", "diminish into", "deflate into", "shrivel regretfully into", "contracts into")] a [uppertext(size)]-cup.")
H.dna.species.handle_genitals(src)
prev_size = size
- else
- size = "huge"
/obj/item/organ/genital/breasts/get_features(mob/living/carbon/human/H)
var/datum/dna/D = H.dna
@@ -107,12 +115,12 @@
if(!isnum(size))
if(size == "flat")
cached_size = 0
- prev_size = 0
- else if (cached_size == "huge")
- prev_size = "huge"
+ else if (size == "huge")
+ cached_size = 16
else
cached_size = breast_values[size]
- prev_size = size
+ prev_size = size
else
cached_size = size
+ size = breast_values[size]
prev_size = size
diff --git a/modular_citadel/code/modules/arousal/organs/penis.dm b/modular_citadel/code/modules/arousal/organs/penis.dm
index ff5f216f2f..c79a522405 100644
--- a/modular_citadel/code/modules/arousal/organs/penis.dm
+++ b/modular_citadel/code/modules/arousal/organs/penis.dm
@@ -19,8 +19,6 @@
var/list/knotted_types = list("knotted", "barbed, knotted")
/obj/item/organ/genital/penis/update_size()
- if(cached_length == length)
- return
if(cached_length < 0)//I don't actually know what round() does to negative numbers, so to be safe!!
if(owner)
to_chat(owner, "You feel your tallywacker shrinking away from your body as your groin flattens out!")
@@ -31,13 +29,13 @@
var/new_size
var/enlargement = FALSE
switch(round(cached_length))
- if(0 to 6.99) //If modest size
+ if(0 to 6) //If modest size
new_size = 1
- if(7 to 10.99) //If large
+ if(7 to 10) //If large
size = 2
- if(11 to 19.99) //If massive
+ if(11 to 19) //If massive
size = 3
- if(20 to 34.99) //If massive and due for large effects
+ if(20 to 34) //If massive and due for large effects
size = 3
enlargement = TRUE
if(35 to INFINITY) //If comical
diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm
index a4c4e352ac..87e1567eda 100644
--- a/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm
@@ -52,10 +52,6 @@
if(!B)
H.emergent_genital_call()
return
- if(!B.size == "huge")
- var/sizeConv = list("a" = 1, "b" = 2, "c" = 3, "d" = 4, "e" = 5)
- B.prev_size = B.size
- B.cached_size = sizeConv[B.size]
/datum/reagent/fermi/breast_enlarger/on_mob_life(mob/living/carbon/M) //Increases breast size
if(!ishuman(M))//Just in case
@@ -87,7 +83,7 @@
nB.color = skintone2hex(H.skin_tone)
nB.size = "flat"
nB.cached_size = 0
- nB.prev_size = 0
+ nB.prev_size = "flat"
to_chat(M, "Your chest feels warm, tingling with newfound sensitivity.")
M.reagents.remove_reagent(id, 5)
B = nB
@@ -123,15 +119,13 @@
P.cached_length = P.cached_length - 0.05
P.update()
if(T)
- T.Remove(M)
+ qdel(T)
if(!V)
- var/obj/item/organ/genital/vagina/nV = new
- nV.Insert(M)
- V = nV
+ V = new
+ V.Insert(M)
if(!W)
- var/obj/item/organ/genital/womb/nW = new
- nW.Insert(M)
- W = nW
+ W = new
+ W.Insert(M)
return ..()
/datum/reagent/fermi/BEsmaller
@@ -232,8 +226,6 @@
if(!P)
H.emergent_genital_call()
return
- P.prev_length = P.length
- P.cached_length = P.length
/datum/reagent/fermi/penis_enlarger/on_mob_life(mob/living/carbon/M) //Increases penis size, 5u = +1 inch.
if(!ishuman(M))
@@ -273,7 +265,9 @@
P.update()
return ..()
-/datum/reagent/fermi/penis_enlarger/overdose_process(mob/living/carbon/M) //Turns you into a male if female and ODing, doesn't touch nonbinary and object genders.
+/datum/reagent/fermi/penis_enlarger/overdose_process(mob/living/carbon/human/M) //Turns you into a male if female and ODing, doesn't touch nonbinary and object genders.
+ if(!istype(M))
+ return ..()
//Acute hepatic pharmacokinesis.
if(HAS_TRAIT(M, TRAIT_PHARMA))
var/obj/item/organ/liver/L = M.getorganslot(ORGAN_SLOT_LIVER)
@@ -292,14 +286,13 @@
if(B)
B.cached_size = B.cached_size - 0.05
B.update()
- if(V)
- V.Remove(M)
+ if(M.getorganslot(ORGAN_SLOT_VAGINA))
+ qdel(V)
if(W)
- W.Remove(M)
+ qdel(W)
if(!T)
- var/obj/item/organ/genital/testicles/nT = new
- nT.Insert(M)
- T = nT
+ T = new
+ T.Insert(M)
return ..()
/datum/reagent/fermi/PEsmaller // Due to cozmo's request...!