testing...

This commit is contained in:
Ghommie
2019-10-03 08:57:35 +02:00
parent 8a36c007cd
commit 7c77f2d2e3
6 changed files with 25 additions and 20 deletions
@@ -16,7 +16,7 @@
var/aroused_state = FALSE //Boolean used in icon_state strings
var/aroused_amount = 50 //This is a num from 0 to 100 for arousal percentage for when to use arousal state icons.
var/obj/item/organ/genital/linked_organ
var/linked_organ_slot //only one of the two organs needs this to be set up. update_link() will handle linking the rest.
var/linked_organ_slot //used for linking an apparatus' organ to its other half on update_link().
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(mapload, mob/living/carbon/human/H)
@@ -114,7 +114,6 @@
/obj/item/organ/genital/proc/update_appearance()
if(!owner || owner.stat == DEAD)
aroused_state = FALSE
return
/obj/item/organ/genital/on_life()
if(!reagents || !owner)
@@ -138,9 +137,13 @@
/obj/item/organ/genital/proc/update_link(removing = FALSE)
if(!removing && owner)
if(linked_organ)
return
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)
@@ -148,11 +151,15 @@
linked_organ = null
return FALSE
//post organ duo making arrangements.
/obj/item/organ/genital/proc/upon_link()
return
/obj/item/organ/genital/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE)
. = ..()
if(.)
update()
RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update)
RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance)
/obj/item/organ/genital/Remove(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE)
. = ..()
@@ -313,6 +320,7 @@
genital_overlay.color = "#[H.dna.features["vag_color"]]"
if(layer == GENITALS_FRONT_LAYER && CHECK_BITFIELD(G.genital_flags, GENITAL_THROUGH_CLOTHES))
genital_overlay.layer = -GENITALS_EXPOSED_LAYER
LAZYADD(fully_exposed, genital_overlay) // to be added to a layer with higher priority than clothes, hence the name of the bitflag.
else
standing += genital_overlay
@@ -68,7 +68,7 @@
/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)
if(new_value == cached_size)
return
prev_size = cached_size
cached_size = new_value
@@ -97,7 +97,7 @@
var/status_effect = owner.has_status_effect(STATUS_EFFECT_BREASTS_ENLARGEMENT)
if(enlargement && !status_effect)
owner.apply_status_effect(STATUS_EFFECT_BREASTS_ENLARGEMENT)
else if(status_effect)
else if(!enlargement && status_effect)
owner.remove_status_effect(STATUS_EFFECT_BREASTS_ENLARGEMENT)
if(rounded_cached < 16 && owner)//Because byond doesn't count from 0, I have to do this.
@@ -7,6 +7,7 @@
slot = ORGAN_SLOT_PENIS
masturbation_verb = "stroke"
genital_flags = CAN_MASTURBATE_WITH|CAN_CLIMAX_WITH
linked_organ_slot = ORGAN_SLOT_TESTICLES
fluid_transfer_factor = 0.5
size = 2 //arbitrary value derived from length and girth for sprites.
layer_index = PENIS_LAYER_INDEX
@@ -17,13 +18,13 @@
/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)
if(new_value == length)
return
prev_length = length
length = CLAMP(length + modifier, min, max)
update()
/obj/item/organ/genital/penis/update_size()
/obj/item/organ/genital/penis/update_size(modified = FALSE)
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>")
@@ -51,10 +52,11 @@
var/status_effect = owner.has_status_effect(STATUS_EFFECT_PENIS_ENLARGEMENT)
if(enlargement && !status_effect)
owner.apply_status_effect(STATUS_EFFECT_PENIS_ENLARGEMENT)
else if(status_effect)
else if(!enlargement && status_effect)
owner.remove_status_effect(STATUS_EFFECT_PENIS_ENLARGEMENT)
if(linked_organ)
linked_organ.update_size(new_size - size)
linked_organ.size = CLAMP(size + new_size, BALLS_SIZE_MIN, BALLS_SIZE_MAX)
linked_organ.update()
size = new_size
if(owner)
@@ -14,7 +14,6 @@
fluid_id = "semen"
masturbation_verb = "massage"
layer_index = TESTICLES_LAYER_INDEX
var/size_linked = FALSE
/obj/item/organ/genital/testicles/generate_fluid()
if(!linked_organ && !update_link())
@@ -23,16 +22,12 @@
if(. && reagents.holder_full())
to_chat(owner, "Your balls finally feel full, again.")
/obj/item/organ/genital/testicles/update_link(removing = FALSE)
. = ..()
if(. && !size_linked)
size = linked_organ.size
update()
size_linked = TRUE
/obj/item/organ/genital/testicles/upon_link()
size = linked_organ.size
update_size()
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)
/obj/item/organ/genital/testicles/update_size(modified = FALSE)
switch(size)
if(BALLS_SIZE_MIN)
size_name = "average"