Sanitizing the fermis code biohazard.

This commit is contained in:
Ghommie
2019-10-03 04:31:11 +02:00
parent 02df68a1cf
commit 6dbac16c74
9 changed files with 251 additions and 308 deletions
@@ -5,22 +5,21 @@
icon = 'modular_citadel/icons/obj/genitals/breasts.dmi'
zone = BODY_ZONE_CHEST
slot = ORGAN_SLOT_BREASTS
size = BREASTS_SIZE_DEF
size = "c" //refer to the breast_values static list below for the cups associated number values
fluid_id = "milk"
shape = "pair"
genital_flags = CAN_MASTURBATE_WITH|CAN_CLIMAX_WITH|GENITAL_FUID_PRODUCTION
masturbation_verb = "massage"
orgasm_verb = "leaking"
fluid_transfer_factor = 0.5
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
var/static/list/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 //these two vars pertain size modifications and so should be expressed in NUMBERS.
var/prev_size //former cached_size value, to allow update_size() to early return should be there no significant changes.
/obj/item/organ/genital/breasts/Initialize(mapload, mob/living/carbon/human/H)
if(!H)
cached_size = size
size = breast_values[size]
prev_size = size
cached_size = breast_values[size]
prev_size = cached_size
return ..()
/obj/item/organ/genital/breasts/update_appearance()
@@ -67,41 +66,47 @@
//Rediculous sizes makes you more cumbersome.
//this is far too lewd wah
/obj/item/organ/genital/breasts/modify_size(modifier, min = -INFINITY, max = INFINITY)
var/new_value = CLAMP(cached_size + modifier, min, max)
if(new_value == prev_size)
return
prev_size = cached_size
cached_size = new_value
update()
/obj/item/organ/genital/breasts/update_size()//wah
var/rounded_cached = round(cached_size)
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, "<span class='warning'>You feel your breasts shrinking away from your body as your chest flattens out.</span>")
QDEL_IN(src, 1)
return
var/enlargement = FALSE
switch(round(cached_size))
switch(rounded_cached)
if(0) //flatchested
size = "flat"
if(1 to 8) //modest
size = breast_values[round(cached_size)]
size = breast_values[rounded_cached]
if(9 to 15) //massive
size = breast_values[round(cached_size)]
size = breast_values[rounded_cached]
enlargement = TRUE
if(16 to INFINITY) //rediculous
size = "huge"
enlargement = TRUE
if(owner)
var/status_effect = owner.has_status_effect(/datum/status_effect/chem/breast_enlarger)
var/status_effect = owner.has_status_effect(STATUS_EFFECT_BREASTS_ENLARGEMENT)
if(enlargement && !status_effect)
owner.apply_status_effect(/datum/status_effect/chem/breast_enlarger)
owner.apply_status_effect(STATUS_EFFECT_BREASTS_ENLARGEMENT)
else if(status_effect)
owner.remove_status_effect(/datum/status_effect/chem/breast_enlarger)
owner.remove_status_effect(STATUS_EFFECT_BREASTS_ENLARGEMENT)
if(round(cached_size) < 16)//Because byond doesn't count from 0, I have to do this.
if(owner)
var/mob/living/carbon/human/H = owner
if (breast_values[size] > breast_values[prev_size])
to_chat(H, "<span class='warning'>Your breasts [pick("swell up to", "flourish into", "expand into", "burst forth into", "grow eagerly into", "amplify into")] a [uppertext(size)]-cup.</span>")
H.dna.species.handle_genitals(src)
else if (breast_values[size] > 0.5)
to_chat(H, "<span class='warning'>Your breasts [pick("shrink down to", "decrease into", "diminish into", "deflate into", "shrivel regretfully into", "contracts into")] a [uppertext(size)]-cup.</span>")
H.dna.species.handle_genitals(src)
prev_size = size
if(rounded_cached < 16 && owner)//Because byond doesn't count from 0, I have to do this.
var/mob/living/carbon/human/H = owner
var/r_prev_size = round(prev_size)
if (rounded_cached > r_prev_size)
to_chat(H, "<span class='warning'>Your breasts [pick("swell up to", "flourish into", "expand into", "burst forth into", "grow eagerly into", "amplify into")] a [uppertext(size)]-cup.</span>")
else if (rounded_cached < r_prev_size)
to_chat(H, "<span class='warning'>Your breasts [pick("shrink down to", "decrease into", "diminish into", "deflate into", "shrivel regretfully into", "contracts into")] a [uppertext(size)]-cup.</span>")
/obj/item/organ/genital/breasts/get_features(mob/living/carbon/human/H)
var/datum/dna/D = H.dna
@@ -112,15 +117,11 @@
size = D.features["breasts_size"]
shape = D.features["breasts_shape"]
fluid_id = D.features["breasts_fluid"]
if(!D.features["breasts_producing"])
DISABLE_BITFIELD(genital_flags, GENITAL_FUID_PRODUCTION)
if(!isnum(size))
if(size == "flat")
cached_size = 0
else if (size == "huge")
cached_size = 16
else
cached_size = breast_values[size]
prev_size = size
cached_size = breast_values[size]
else
cached_size = size
size = breast_values[size]
prev_size = size
prev_size = cached_size
@@ -12,42 +12,47 @@
layer_index = PENIS_LAYER_INDEX
var/length = 6 //inches
var/prev_length = 6 //really should be renamed to prev_length
var/cached_length //used to detect a change in length
var/girth = 4.38
var/girth_ratio = COCK_GIRTH_RATIO_DEF //0.73; check citadel_defines.dm
var/knot_girth_ratio = KNOT_GIRTH_RATIO_DEF
var/list/knotted_types = list("knotted", "barbed, knotted")
/obj/item/organ/genital/penis/modify_size(modifier, min = -INFINITY, max = INFINITY)
var/new_value = CLAMP(length + modifier, min, max)
if(new_value == prev_length)
return
prev_length = length
length = CLAMP(length + modifier, min, max)
update()
/obj/item/organ/genital/penis/update_size()
if(cached_length < 0)//I don't actually know what round() does to negative numbers, so to be safe!!
if(length < 0)//I don't actually know what round() does to negative numbers, so to be safe!!
if(owner)
to_chat(owner, "<span class='warning'>You feel your tallywacker shrinking away from your body as your groin flattens out!</b></span>")
QDEL_IN(src, 1)
if(linked_organ)
QDEL_IN(linked_organ, 1)
return
var/rounded_length = round(length)
var/new_size
var/enlargement = FALSE
switch(round(cached_length))
switch(rounded_length)
if(0 to 6) //If modest size
new_size = 1
if(7 to 10) //If large
size = 2
new_size = 2
if(11 to 19) //If massive
size = 3
new_size = 3
if(20 to 34) //If massive and due for large effects
size = 3
new_size = 3
enlargement = TRUE
if(35 to INFINITY) //If comical
size = 4 //no new sprites for anything larger yet
new_size = 4 //no new sprites for anything larger yet
enlargement = TRUE
length = cached_length
if(owner)
var/status_effect = owner.has_status_effect(/datum/status_effect/chem/penis_enlarger)
var/status_effect = owner.has_status_effect(STATUS_EFFECT_PENIS_ENLARGEMENT)
if(enlargement && !status_effect)
owner.apply_status_effect(/datum/status_effect/chem/penis_enlarger)
owner.apply_status_effect(STATUS_EFFECT_PENIS_ENLARGEMENT)
else if(status_effect)
owner.remove_status_effect(/datum/status_effect/chem/penis_enlarger)
owner.remove_status_effect(STATUS_EFFECT_PENIS_ENLARGEMENT)
if(linked_organ)
linked_organ.update_size(new_size - size)
size = new_size
@@ -57,7 +62,6 @@
to_chat(owner, "<span class='warning'>Your [pick(GLOB.gentlemans_organ_names)] [pick("swells up to", "flourishes into", "expands into", "bursts forth into", "grows eagerly into", "amplifys into")] a [uppertext(round(length))] inch penis.</b></span>")
else if ((round(length) < round(prev_length)) && (length > 0.5))
to_chat(owner, "<span class='warning'>Your [pick(GLOB.gentlemans_organ_names)] [pick("shrinks down to", "decreases into", "diminishes into", "deflates into", "shrivels regretfully into", "contracts into")] a [uppertext(round(length))] inch penis.</b></span>")
prev_length = length
icon_state = sanitize_text("penis_[shape]_[size]")
girth = (length * girth_ratio)//Is it just me or is this ludicous, why not make it exponentially decay?
@@ -92,4 +96,3 @@
girth_ratio = D.features["cock_girth_ratio"]
shape = D.features["cock_shape"]
prev_length = length
cached_length = length