Merge pull request #8367 from Poojawa/genital-improvements

[READY] Genital fixes and skintone sync [Adds erections[]
This commit is contained in:
kevinz000
2019-05-19 22:47:01 -07:00
committed by GitHub
22 changed files with 79 additions and 47 deletions
+14 -11
View File
@@ -1,13 +1,13 @@
//Mob vars
/mob/living
var/arousalloss = 0 //How aroused the mob is.
var/min_arousal = 0 //The lowest this mobs arousal will get. default = 0
var/max_arousal = 100 //The highest this mobs arousal will get. default = 100
var/arousal_rate = 1 //The base rate that arousal will increase in this mob.
var/arousal_loss_rate = 1 //How easily arousal can be relieved for this mob.
var/canbearoused = FALSE //Mob-level disabler for arousal. Starts off and can be enabled as features are added for different mob types.
var/mb_cd_length = 100 //5 second cooldown for masturbating because fuck spam.
var/mb_cd_timer = 0 //The timer itself
var/arousalloss = 0 //How aroused the mob is.
var/min_arousal = AROUSAL_MINIMUM_DEFAULT //The lowest this mobs arousal will get. default = 0
var/max_arousal = AROUSAL_MAXIMUM_DEFAULT //The highest this mobs arousal will get. default = 100
var/arousal_rate = AROUSAL_START_VALUE //The base rate that arousal will increase in this mob.
var/arousal_loss_rate = AROUSAL_START_VALUE //How easily arousal can be relieved for this mob.
var/canbearoused = FALSE //Mob-level disabler for arousal. Starts off and can be enabled as features are added for different mob types.
var/mb_cd_length = 5 SECONDS //5 second cooldown for masturbating because fuck spam.
var/mb_cd_timer = 0 //The timer itself
/mob/living/carbon/human
canbearoused = TRUE
@@ -22,8 +22,8 @@
//Species vars
/datum/species
var/arousal_gain_rate = 1 //Rate at which this species becomes aroused
var/arousal_lose_rate = 1 //Multiplier for how easily arousal can be relieved
var/arousal_gain_rate = AROUSAL_START_VALUE //Rate at which this species becomes aroused
var/arousal_lose_rate = AROUSAL_START_VALUE //Multiplier for how easily arousal can be relieved
var/list/cum_fluids = list("semen")
var/list/milk_fluids = list("milk")
var/list/femcum_fluids = list("femcum")
@@ -77,7 +77,8 @@
updatearousal()
/mob/living/proc/getPercentAroused()
return ((100 / max_arousal) * arousalloss)
var/percentage = ((100 / max_arousal) * arousalloss)
return percentage
/mob/living/proc/isPercentAroused(percentage)//returns true if the mob's arousal (measured in a percent of 100) is greater than the arg percentage.
if(!isnum(percentage) || percentage > 100 || percentage < 0)
@@ -104,6 +105,8 @@
S = GLOB.breasts_shapes_list[G.shape]
if(S?.alt_aroused)
G.aroused_state = isPercentAroused(G.aroused_amount)
if(getArousalLoss() >= ((max_arousal / 100) * 33))
G.aroused_state = TRUE
else
G.aroused_state = FALSE
G.update_appearance()
@@ -36,8 +36,6 @@
reagents.add_reagent(fluid_id, (fluid_mult * fluid_rate))
/obj/item/organ/genital/breasts/update_appearance()
var/string = "breasts_[lowertext(shape)]_[size]"
icon_state = sanitize_text(string)
var/lowershape = lowertext(shape)
switch(lowershape)
if("pair")
@@ -50,10 +48,19 @@
desc += " You wouldn't measure them in cup sizes."
if(producing && aroused_state)
desc += " They're leaking [fluid_id]."
var/string
if(owner)
if(owner.dna.species.use_skintones && owner.dna.features["genitals_use_skintone"])
if(ishuman(owner)) // Check before recasting type, although someone fucked up if you're not human AND have use_skintones somehow...
var/mob/living/carbon/human/H = owner // only human mobs have skin_tone, which we need.
color = "#[skintone2hex(H.skin_tone)]"
string = "breasts_[lowertext(shape)]_[size]-s"
else
color = "#[owner.dna.features["breasts_color"]]"
string = "breasts_[lowertext(shape)]_[size]"
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.update_genitals()
icon_state = sanitize_text(string)
@@ -92,7 +92,7 @@
var/list/genital_list = list()
for(var/obj/item/organ/O in internal_organs)
if(istype(O, /obj/item/organ/genital))
if(isgenital(O))
var/obj/item/organ/genital/G = O
if(!G.internal)
genital_list += G
@@ -110,10 +110,13 @@
/obj/item/organ/genital/proc/update_size()
return
/obj/item/organ/genital/proc/update_appearance()
return
/obj/item/organ/genital/proc/update_link()
return
/obj/item/organ/genital/proc/remove_ref()
if(linked_organ)
@@ -211,7 +214,10 @@
/mob/living/carbon/human/proc/give_ovipositor()
return
/mob/living/carbon/human/proc/give_eggsack()
return
/mob/living/carbon/human/proc/give_vagina()
if(!dna)
return FALSE
@@ -280,7 +286,8 @@
var/list/genitals_to_add = list()
var/list/relevant_layers = list(GENITALS_BEHIND_LAYER, GENITALS_ADJ_LAYER, GENITALS_FRONT_LAYER)
var/list/standing = list()
var/size = null
var/size
var/aroused_state
for(var/L in relevant_layers) //Less hardcode
H.remove_overlay(L)
@@ -288,7 +295,7 @@
//start scanning for genitals
//var/list/worn_stuff = H.get_equipped_items()//cache this list so it's not built again
for(var/obj/item/organ/O in H.internal_organs)
if(istype(O, /obj/item/organ/genital))
if(isgenital(O))
var/obj/item/organ/genital/G = O
if(G.is_exposed()) //Checks appropriate clothing slot and if it's through_clothes
genitals_to_add += H.getorganslot(G.slot)
@@ -300,6 +307,7 @@
for(var/obj/item/organ/genital/G in genitals_to_add)
var/datum/sprite_accessory/S
size = G.size
aroused_state = G.aroused_state
switch(G.type)
if(/obj/item/organ/genital/penis)
S = GLOB.cock_shapes_list[G.shape]
@@ -311,13 +319,14 @@
if(!S || S.icon_state == "none")
continue
var/mutable_appearance/genital_overlay = mutable_appearance(S.icon, layer = -layer)
genital_overlay.icon_state = "[G.slot]_[S.icon_state]_[size]_[G.aroused_state]_[layertext]"
genital_overlay.icon_state = "[G.slot]_[S.icon_state]_[size]_[aroused_state]_[layertext]"
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)]"
genital_overlay.icon_state = "[G.slot]_[S.icon_state]_[size]-s_[aroused_state]_[layertext]"
else
switch(S.color_src)
if("cock_color")
@@ -326,21 +335,7 @@
genital_overlay.color = "#[H.dna.features["breasts_color"]]"
if("vag_color")
genital_overlay.color = "#[H.dna.features["vag_color"]]"
if(MUTCOLORS)
if(fixed_mut_color)
genital_overlay.color = "#[fixed_mut_color]"
else
genital_overlay.color = "#[H.dna.features["mcolor"]]"
if(MUTCOLORS2)
if(fixed_mut_color2)
genital_overlay.color = "#[fixed_mut_color2]"
else
genital_overlay.color = "#[H.dna.features["mcolor2"]]"
if(MUTCOLORS3)
if(fixed_mut_color3)
genital_overlay.color = "#[fixed_mut_color3]"
else
genital_overlay.color = "#[H.dna.features["mcolor3"]]"
standing += genital_overlay
if(LAZYLEN(standing))
H.overlays_standing[layer] = standing.Copy()
@@ -87,6 +87,13 @@
icon_state = "hairy"
name = "Hairy"
/datum/sprite_accessory/vagina/spade
icon_state = "spade"
name = "Spade"
/datum/sprite_accessory/vagina/furred
icon_state = "furred"
name = "Furred"
//BREASTS BE HERE
/datum/sprite_accessory/breasts
@@ -27,7 +27,7 @@
size = 1
if(5 to 9)
size = 2
if(9 to INFINITY)
if(15 to INFINITY)
size = 3//no new sprites for anything larger yet
/* if(9 to 15)
size = 3
@@ -37,8 +37,7 @@
cached_length = length
/obj/item/organ/genital/penis/update_appearance()
var/string = "penis_[GLOB.cock_shapes_icons[shape]]_[size]"
icon_state = sanitize_text(string)
var/string
var/lowershape = lowertext(shape)
desc = "You see [aroused_state ? "an erect" : "a flaccid"] [lowershape] penis. 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."
@@ -47,8 +46,15 @@
if(ishuman(owner)) // Check before recasting type, although someone fucked up if you're not human AND have use_skintones somehow...
var/mob/living/carbon/human/H = owner // only human mobs have skin_tone, which we need.
color = "#[skintone2hex(H.skin_tone)]"
string = "penis_[GLOB.cock_shapes_icons[shape]]_[size]-s"
else
color = "#[owner.dna.features["cock_color"]]"
string = "penis_[GLOB.cock_shapes_icons[shape]]_[size]"
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.update_genitals()
icon_state = sanitize_text(string)
/obj/item/organ/genital/penis/update_link()
if(owner)
@@ -17,12 +17,11 @@
var/clits = 1
var/clit_diam = 0.25
var/clit_len = 0.25
var/list/vag_types = list("tentacle", "dentata", "hairy")
var/list/vag_types = list("tentacle", "dentata", "hairy", "spade", "furred")
/obj/item/organ/genital/vagina/update_appearance()
var/string = "vagina" //Keeping this code here, so making multiple sprites for the different kinds is easier.
icon_state = sanitize_text(string)
var/string //Keeping this code here, so making multiple sprites for the different kinds is easier.
var/lowershape = lowertext(shape)
var/details
@@ -37,6 +36,10 @@
details = "It is taut with smooth skin, though without much hair and "
if("gaping")
details = "It is gaping slightly open, though without much hair and "
if("spade")
details = "It is a plush canine spade, it "
if("furred")
details = "It has neatly groomed fur around the outer folds, it "
else
details = "It has an exotic shape and "
if(aroused_state)
@@ -51,9 +54,15 @@
if(ishuman(owner)) // Check before recasting type, although someone fucked up if you're not human AND have use_skintones somehow...
var/mob/living/carbon/human/H = owner // only human mobs have skin_tone, which we need.
color = "#[skintone2hex(H.skin_tone)]"
string = "vagina-s"
else
color = "#[owner.dna.features["vag_color"]]"
string = "vagina"
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.update_genitals()
icon_state = sanitize_text(string)
/obj/item/organ/genital/vagina/update_link()
if(owner)