skintoning (#1147)

This commit is contained in:
Azarak
2020-10-04 01:00:29 +01:00
committed by GitHub
parent 9e5e111140
commit ef5ba84edc
11 changed files with 59 additions and 29 deletions
+1 -1
View File
@@ -66,7 +66,7 @@
#define SHEATH_NORMAL "Sheath"
#define SHEATH_SLIT "Slit"
#define MANDATORY_FEATURE_LIST list("mcolor" = "FFB","mcolor2" = "FFB","mcolor3" = "FFB","ethcolor" = "FCC","skin_color" = "FED","flavor_text" = "","breasts_size" = 1,"breasts_lactation" = FALSE,"penis_size" = 13,"penis_girth" = 9,"penis_taur_mode" = TRUE,"penis_sheath" = SHEATH_NONE ,"balls_size" = 1, "body_size" = BODY_SIZE_NORMAL, "custom_species" = null)
#define MANDATORY_FEATURE_LIST list("mcolor" = "FFB","mcolor2" = "FFB","mcolor3" = "FFB","ethcolor" = "FCC","skin_color" = "FED","flavor_text" = "","breasts_size" = 1,"breasts_lactation" = FALSE,"penis_size" = 13,"penis_girth" = 9,"penis_taur_mode" = TRUE,"penis_sheath" = SHEATH_NONE ,"balls_size" = 1, "body_size" = BODY_SIZE_NORMAL, "custom_species" = null, "uses_skintones" = FALSE)
#define UNDERWEAR_HIDE_SOCKS (1<<0)
#define UNDERWEAR_HIDE_SHIRT (1<<1)
@@ -26,16 +26,6 @@ GLOBAL_LIST_INIT(balls_size_translation, list("0" = "Small",
"3" = "Enormous"
))
/*GLOBAL_LIST_INIT(bitflag_to_marking_zones, list(HEAD = "Head",
CHEST = "Chest",
LEG_LEFT = "Left Leg",
LEG_RIGHT = "Right Leg",
ARM_LEFT = "Left Arm",
ARM_RIGHT = "Right Arm",
HAND_LEFT = "Left Hand",
HAND_RIGHT = "Right Hand"
))*/
GLOBAL_LIST_INIT(marking_zone_to_bitflag, list(BODY_ZONE_HEAD = HEAD,
BODY_ZONE_CHEST = CHEST,
BODY_ZONE_L_LEG = LEG_LEFT,
@@ -51,7 +41,7 @@ GLOBAL_LIST_INIT(marking_zone_to_bitflag, list(BODY_ZONE_HEAD = HEAD,
GLOBAL_LIST_INIT(marking_zones, list(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_L_LEG,BODY_ZONE_R_LEG,BODY_ZONE_L_ARM,BODY_ZONE_R_ARM,BODY_ZONE_PRECISE_L_HAND,BODY_ZONE_PRECISE_R_HAND))
///Those are the values available from prefs
GLOBAL_LIST_INIT(preference_breast_sizes, list("Flatchested","A","B","C","D","E","F","G","H"))
GLOBAL_LIST_INIT(preference_breast_sizes, list("Flatchested","A","B","C","D","E","F","G","H","I","J"))
GLOBAL_LIST_INIT(preference_balls_sizes, list("Small","Average","Big","Enormous"))
@@ -22,7 +22,7 @@
var/change_multiplier = features["body_size"] / current_body_size
//We update the translation to make sure our character doesn't go out of the southern bounds of the tile
var/translate = ((change_multiplier-1) * 32)/2
holder.transform = holder.transform.Scale(change_multiplier, change_multiplier)
holder.transform = holder.transform.Scale(change_multiplier)
holder.transform = holder.transform.Translate(0, translate)
current_body_size = features["body_size"]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

After

Width:  |  Height:  |  Size: 887 B

@@ -538,9 +538,8 @@
if(pref_species.can_have_genitals)
dat += "<h2>Arousal Preview</h2>"
dat += "<a href='?_src_=prefs;preference=change_arousal_preview;task=input'>Change arousal preview</a>"
dat += APPEARANCE_CATEGORY_COLUMN
dat += "<a href='?_src_=prefs;preference=change_arousal_preview;task=input'>Change arousal preview</a>"
dat += "<h3>Penis</h3>"
var/penis_name = mutant_bodyparts["penis"][MUTANT_INDEX_NAME]
dat += print_bodypart_change_line("penis")
@@ -565,6 +564,7 @@
dat += "</td>"
dat += APPEARANCE_CATEGORY_COLUMN
dat += "<b>Uses skintones: </b> <a href='?_src_=prefs;preference=uses_skintones;task=input'>[(features["uses_skintones"]) ? "Yes" : "No"]</a>"
dat += "<h3>Vagina</h3>"
dat += print_bodypart_change_line("vagina")
dat += "<h3>Womb</h3>"
@@ -572,6 +572,7 @@
dat += "</td>"
dat += APPEARANCE_CATEGORY_COLUMN
dat += "<BR>"
dat += "<h3>Breasts</h3>"
var/breasts_name = mutant_bodyparts["breasts"][MUTANT_INDEX_NAME]
dat += print_bodypart_change_line("breasts")
@@ -1735,7 +1736,7 @@
validate_color_keys_for_part(key)
if(!allow_advanced_colors)
var/datum/sprite_accessory/SA = GLOB.sprite_accessories[key][new_name]
mutant_bodyparts[key][MUTANT_INDEX_COLOR_LIST] = SA.get_default_color(features)
mutant_bodyparts[key][MUTANT_INDEX_COLOR_LIST] = SA.get_default_color(features, pref_species)
if("change_color")
var/key = href_list["key"]
if(!mutant_bodyparts[key])
@@ -1752,7 +1753,7 @@
if(!mutant_bodyparts[key])
return
var/datum/sprite_accessory/SA = GLOB.sprite_accessories[key][mutant_bodyparts[key][MUTANT_INDEX_NAME]]
mutant_bodyparts[key][MUTANT_INDEX_COLOR_LIST] = SA.get_default_color(features)
mutant_bodyparts[key][MUTANT_INDEX_COLOR_LIST] = SA.get_default_color(features, pref_species)
if("reset_all_colors")
var/action = alert(user, "Are you sure you want to reset all colors?", "", "Yes", "No")
if(action == "Yes")
@@ -1881,6 +1882,10 @@
if(!isnull(msg))
exploitable_info = strip_html_simple(msg, MAX_FLAVOR_LEN, TRUE)
if("uses_skintones")
needs_update = TRUE
features["uses_skintones"] = !features["uses_skintones"]
if("erp_pref")
switch(erp_pref)
if("Yes")
@@ -100,6 +100,8 @@
features[key] = new_features[key]
mutant_bodyparts = pref_species.get_random_mutant_bodyparts(features)
body_markings = pref_species.get_random_body_markings(features)
if(pref_species.use_skintones)
features["uses_skintones"] = TRUE
//We reset the quirk-based stuff
augments = list()
all_quirks = list()
@@ -1,6 +1,7 @@
/datum/sprite_accessory/genital
special_render_case = TRUE
var/associated_organ_slot
var/uses_skintones
/datum/sprite_accessory/genital/is_hidden(mob/living/carbon/human/H, obj/item/bodypart/HD)
var/obj/item/organ/genital/badonkers = H.getorganslot(associated_organ_slot)
@@ -36,6 +37,7 @@
special_x_dimension = TRUE
//default_color = DEFAULT_SKIN_OR_PRIMARY //This is the price we're paying for sheaths
relevent_layers = list(BODY_BEHIND_LAYER, BODY_FRONT_LAYER)
var/can_have_sheath = TRUE
/datum/sprite_accessory/genital/penis/is_hidden(mob/living/carbon/human/H, obj/item/bodypart/HD)
if(H.underwear != "Nude" && !(H.underwear_visibility & UNDERWEAR_HIDE_UNDIES))
@@ -67,7 +69,10 @@
/datum/sprite_accessory/genital/penis/human
icon_state = "human"
name = "Human"
color_src = USE_ONE_COLOR
default_color = DEFAULT_SKIN_OR_PRIMARY
uses_skintones = TRUE
can_have_sheath = FALSE
/datum/sprite_accessory/genital/penis/knotted
icon_state = "knotted"
@@ -105,6 +110,7 @@
always_color_customizable = TRUE
special_icon_case = TRUE
special_x_dimension = TRUE
default_color = DEFAULT_SKIN_OR_PRIMARY
relevent_layers = list(BODY_ADJ_LAYER, BODY_BEHIND_LAYER)
var/has_size = TRUE
@@ -138,6 +144,7 @@
/datum/sprite_accessory/genital/testicles/pair
name = "Pair"
icon_state = "pair"
uses_skintones = TRUE
/datum/sprite_accessory/genital/testicles/internal
name = "Internal"
@@ -230,6 +237,7 @@
always_color_customizable = TRUE
default_color = DEFAULT_SKIN_OR_PRIMARY
relevent_layers = list(BODY_BEHIND_LAYER, BODY_FRONT_LAYER)
uses_skintones = TRUE
/datum/sprite_accessory/genital/breasts/is_hidden(mob/living/carbon/human/H, obj/item/bodypart/HD)
if(H.undershirt != "Nude" && !(H.underwear_visibility & UNDERWEAR_HIDE_SHIRT))
@@ -13,6 +13,8 @@
var/visibility_preference = GENITAL_HIDDEN_BY_CLOTHES
///Whether the organ is aroused, matters for sprites, use AROUSAL_CANT, AROUSAL_NONE, AROUSAL_PARTIAL or AROUSAL_FULL
var/aroused = AROUSAL_NONE
///Whether the organ is supposed to use a skintoned variant of the sprite
var/uses_skintones
//This translates the float size into a sprite string
/obj/item/organ/genital/proc/get_sprite_size_string()
@@ -42,9 +44,11 @@
/obj/item/organ/genital/build_from_dna(datum/dna/DNA, associated_key)
..()
var/datum/sprite_accessory/SA = GLOB.sprite_accessories[associated_key][DNA.mutant_bodyparts[associated_key][MUTANT_INDEX_NAME]]
var/datum/sprite_accessory/genital/SA = GLOB.sprite_accessories[associated_key][DNA.mutant_bodyparts[associated_key][MUTANT_INDEX_NAME]]
genital_name = SA.name
genital_type = SA.icon_state
if(DNA.features["uses_skintones"])
uses_skintones = SA.uses_skintones
update_sprite_suffix()
/obj/item/organ/genital/penis
@@ -95,7 +99,10 @@
size_affix = "3"
else
size_affix = "4"
icon_state = "penis_[genital_type]_[size_affix]"
var/passed_string = "penis_[genital_type]_[size_affix]"
if(uses_skintones)
passed_string += "_s"
icon_state = passed_string
/obj/item/organ/genital/penis/get_sprite_size_string()
if(aroused != AROUSAL_FULL && sheath != SHEATH_NONE) //Sheath time!
@@ -120,12 +127,17 @@
size_affix = "3"
else
size_affix = "4"
return "[genital_type]_[size_affix]_[is_erect]"
var/passed_string = "[genital_type]_[size_affix]_[is_erect]"
if(uses_skintones)
passed_string += "_s"
return passed_string
/obj/item/organ/genital/penis/build_from_dna(datum/dna/DNA, associated_key)
..()
girth = DNA.features["penis_girth"]
sheath = DNA.features["penis_sheath"]
var/datum/sprite_accessory/genital/penis/PS = GLOB.sprite_accessories[associated_key][DNA.mutant_bodyparts[associated_key][MUTANT_INDEX_NAME]]
if(PS.can_have_sheath)
sheath = DNA.features["penis_sheath"]
set_size(DNA.features["penis_size"])
/obj/item/organ/genital/testicles
@@ -139,6 +151,13 @@
slot = ORGAN_SLOT_TESTICLES
aroused = AROUSAL_CANT
/obj/item/organ/genital/testicles/update_genital_icon_state()
var/measured_size = clamp(genital_size, 1, 3)
var/passed_string = "testicles_[genital_type]_[measured_size]"
if(uses_skintones)
passed_string += "_s"
icon_state = passed_string
/obj/item/organ/genital/testicles/get_description_string(datum/sprite_accessory/genital/gas)
return "You see a pair of testicles, they look [lowertext(balls_size_to_description(genital_size))]."
@@ -148,11 +167,11 @@
/obj/item/organ/genital/testicles/get_sprite_size_string()
var/measured_size = FLOOR(genital_size,1)
if(measured_size < 0)
measured_size = 0
else if (measured_size > 3)
measured_size = 3
return "[genital_type]_[measured_size]"
measured_size = clamp(measured_size, 0, 3)
var/passed_string = "[genital_type]_[measured_size]"
if(uses_skintones)
passed_string += "_s"
return passed_string
/obj/item/organ/genital/vagina
name = "vagina"
@@ -212,7 +231,7 @@
if("Flatchested")
size_description = " They are small and flat, however."
if("beyond measurement")
size_description = " Their size is enormous, far beyond measurement."
size_description = " Their size is enormous, you estimate they're around [genital_size] inches in diameter."
else
size_description = " You estimate they are [translation]-cups."
returned_string += size_description
@@ -230,7 +249,10 @@
current_size = 0
else if (current_size > max_size)
current_size = max_size
icon_state = "breasts_pair_[current_size]"
var/passed_string = "breasts_pair_[current_size]"
if(uses_skintones)
passed_string += "_s"
icon_state = passed_string
/obj/item/organ/genital/breasts/get_sprite_size_string()
var/max_size = 5
@@ -241,7 +263,10 @@
current_size = 0
else if (current_size > max_size)
current_size = max_size
return "[genital_type]_[current_size]"
var/passed_string = "[genital_type]_[current_size]"
if(uses_skintones)
passed_string += "_s"
return passed_string
/obj/item/organ/genital/breasts/build_from_dna(datum/dna/DNA, associated_key)
..()