Merge pull request #5619 from CHOMPStation2/upstream-merge-14384

[MIRROR] Adds ability to customize discomfort
This commit is contained in:
Nadyr
2023-02-02 20:45:58 -05:00
committed by GitHub
5 changed files with 92 additions and 4 deletions

View File

@@ -118,6 +118,8 @@ var/global/list/datum/dna/gene/dna_genes[0]
var/custom_ask var/custom_ask
var/custom_whisper var/custom_whisper
var/custom_exclaim var/custom_exclaim
var/list/custom_heat = list()
var/list/custom_cold = list()
// VOREStation // VOREStation
// New stuff // New stuff
@@ -144,6 +146,8 @@ var/global/list/datum/dna/gene/dna_genes[0]
new_dna.custom_ask=custom_ask //VOREStaton Edit new_dna.custom_ask=custom_ask //VOREStaton Edit
new_dna.custom_whisper=custom_whisper //VOREStaton Edit new_dna.custom_whisper=custom_whisper //VOREStaton Edit
new_dna.custom_exclaim=custom_exclaim //VOREStaton Edit new_dna.custom_exclaim=custom_exclaim //VOREStaton Edit
new_dna.custom_heat=custom_heat //VOREStation Edit
new_dna.custom_cold=custom_cold //VOREStation Edit
var/list/body_markings_genetic = (body_markings - body_marking_nopersist_list) var/list/body_markings_genetic = (body_markings - body_marking_nopersist_list)
new_dna.body_markings=body_markings_genetic.Copy() new_dna.body_markings=body_markings_genetic.Copy()
for(var/b=1;b<=DNA_SE_LENGTH;b++) for(var/b=1;b<=DNA_SE_LENGTH;b++)
@@ -216,6 +220,8 @@ var/global/list/datum/dna/gene/dna_genes[0]
src.custom_ask = character.custom_ask src.custom_ask = character.custom_ask
src.custom_whisper = character.custom_whisper src.custom_whisper = character.custom_whisper
src.custom_exclaim = character.custom_exclaim src.custom_exclaim = character.custom_exclaim
src.custom_heat = character.custom_heat
src.custom_cold = character.custom_cold
// +1 to account for the none-of-the-above possibility // +1 to account for the none-of-the-above possibility
SetUIValueRange(DNA_UI_EAR_STYLE, ear_style + 1, ear_styles_list.len + 1, 1) SetUIValueRange(DNA_UI_EAR_STYLE, ear_style + 1, ear_styles_list.len + 1, 1)

View File

@@ -244,6 +244,8 @@
H.custom_whisper = dna.custom_whisper H.custom_whisper = dna.custom_whisper
H.custom_exclaim = dna.custom_exclaim H.custom_exclaim = dna.custom_exclaim
H.species.blood_color = dna.blood_color H.species.blood_color = dna.blood_color
H.custom_heat = dna.custom_heat
H.custom_cold = dna.custom_cold
var/datum/species/S = H.species var/datum/species/S = H.species
S.produceCopy(dna.species_traits, H, dna.base_species) S.produceCopy(dna.species_traits, H, dna.base_species)
// VOREStation Edit End // VOREStation Edit End

View File

@@ -15,6 +15,9 @@
var/custom_ask = null var/custom_ask = null
var/custom_exclaim = null var/custom_exclaim = null
var/list/custom_heat = list()
var/list/custom_cold = list()
var/list/pos_traits = list() // What traits they've selected for their custom species var/list/pos_traits = list() // What traits they've selected for their custom species
var/list/neu_traits = list() var/list/neu_traits = list()
var/list/neg_traits = list() var/list/neg_traits = list()
@@ -61,6 +64,9 @@
S["custom_ask"] >> pref.custom_ask S["custom_ask"] >> pref.custom_ask
S["custom_exclaim"] >> pref.custom_exclaim S["custom_exclaim"] >> pref.custom_exclaim
S["custom_heat"] >> pref.custom_heat
S["custom_cold"] >> pref.custom_cold
/datum/category_item/player_setup_item/vore/traits/save_character(var/savefile/S) /datum/category_item/player_setup_item/vore/traits/save_character(var/savefile/S)
S["custom_species"] << pref.custom_species S["custom_species"] << pref.custom_species
S["custom_base"] << pref.custom_base S["custom_base"] << pref.custom_base
@@ -78,6 +84,9 @@
S["custom_ask"] << pref.custom_ask S["custom_ask"] << pref.custom_ask
S["custom_exclaim"] << pref.custom_exclaim S["custom_exclaim"] << pref.custom_exclaim
S["custom_heat"] << pref.custom_heat
S["custom_cold"] << pref.custom_cold
/datum/category_item/player_setup_item/vore/traits/sanitize_character() /datum/category_item/player_setup_item/vore/traits/sanitize_character()
if(!pref.pos_traits) pref.pos_traits = list() if(!pref.pos_traits) pref.pos_traits = list()
if(!pref.neu_traits) pref.neu_traits = list() if(!pref.neu_traits) pref.neu_traits = list()
@@ -154,6 +163,9 @@
character.custom_ask = lowertext(trim(pref.custom_ask)) character.custom_ask = lowertext(trim(pref.custom_ask))
character.custom_whisper = lowertext(trim(pref.custom_whisper)) character.custom_whisper = lowertext(trim(pref.custom_whisper))
character.custom_exclaim = lowertext(trim(pref.custom_exclaim)) character.custom_exclaim = lowertext(trim(pref.custom_exclaim))
character.custom_heat = pref.custom_heat
character.custom_cold = pref.custom_cold
if(character.isSynthetic()) //Checking if we have a synth on our hands, boys. if(character.isSynthetic()) //Checking if we have a synth on our hands, boys.
pref.dirty_synth = 1 pref.dirty_synth = 1
@@ -179,6 +191,8 @@
var/english_traits = english_list(new_S.traits, and_text = ";", comma_text = ";") var/english_traits = english_list(new_S.traits, and_text = ";", comma_text = ";")
log_game("TRAITS [pref.client_ckey]/([character]) with: [english_traits]") //Terrible 'fake' key_name()... but they aren't in the same entity yet log_game("TRAITS [pref.client_ckey]/([character]) with: [english_traits]") //Terrible 'fake' key_name()... but they aren't in the same entity yet
/datum/category_item/player_setup_item/vore/traits/content(var/mob/user) /datum/category_item/player_setup_item/vore/traits/content(var/mob/user)
. += "<b>Custom Species Name:</b> " . += "<b>Custom Species Name:</b> "
. += "<a href='?src=\ref[src];custom_species=1'>[pref.custom_species ? pref.custom_species : "-Input Name-"]</a><br>" . += "<a href='?src=\ref[src];custom_species=1'>[pref.custom_species ? pref.custom_species : "-Input Name-"]</a><br>"
@@ -245,6 +259,14 @@
. += "<a href='?src=\ref[src];custom_exclaim=1'>Set Exclaim Verb</a>" . += "<a href='?src=\ref[src];custom_exclaim=1'>Set Exclaim Verb</a>"
. += "(<a href='?src=\ref[src];reset_exclaim=1'>Reset</A>)" . += "(<a href='?src=\ref[src];reset_exclaim=1'>Reset</A>)"
. += "<br>" . += "<br>"
. += "<b>Custom heat Discomfort: </b>"
. += "<a href='?src=\ref[src];custom_heat=1'>Set Heat Messages</a>"
. += "(<a href='?src=\ref[src];reset_heat=1'>Reset</A>)"
. += "<br>"
. += "<b>Custom Cold Discomfort: </b>"
. += "<a href='?src=\ref[src];custom_cold=1'>Set Cold Messages</a>"
. += "(<a href='?src=\ref[src];reset_cold=1'>Reset</A>)"
. += "<br>"
/datum/category_item/player_setup_item/vore/traits/OnTopic(var/href,var/list/href_list, var/mob/user) /datum/category_item/player_setup_item/vore/traits/OnTopic(var/href,var/list/href_list, var/mob/user)
if(!CanUseTopic(user)) if(!CanUseTopic(user))
@@ -327,6 +349,41 @@
pref.custom_exclaim = exclaim_choice pref.custom_exclaim = exclaim_choice
return TOPIC_REFRESH return TOPIC_REFRESH
else if(href_list["custom_heat"])
tgui_alert(user, "You are setting custom heat messages. These will overwrite your species' defaults. To return to defaults, click reset.")
var/old_message = pref.custom_heat.Join("\n\n")
var/new_message = sanitize(tgui_input_text(usr,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Heat Discomfort messages",old_message, multiline= TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
raw_list.Cut(11)
for(var/i = 1, i <= raw_list.len, i++)
if(length(raw_list[i]) < 3 || length(raw_list[i]) > 160)
raw_list.Cut(i,i)
else
raw_list[i] = readd_quotes(raw_list[i])
ASSERT(raw_list.len <= 10)
pref.custom_heat = raw_list
return TOPIC_REFRESH
else if(href_list["custom_cold"])
tgui_alert(user, "You are setting custom cold messages. These will overwrite your species' defaults. To return to defaults, click reset.")
var/old_message = pref.custom_heat.Join("\n\n")
var/new_message = sanitize(tgui_input_text(usr,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Cold Discomfort messages",old_message, multiline= TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
raw_list.Cut(11)
for(var/i = 1, i <= raw_list.len, i++)
if(length(raw_list[i]) < 3 || length(raw_list[i]) > 160)
raw_list.Cut(i,i)
else
raw_list[i] = readd_quotes(raw_list[i])
ASSERT(raw_list.len <= 10)
pref.custom_cold = raw_list
return TOPIC_REFRESH
else if(href_list["reset_say"]) else if(href_list["reset_say"])
var/say_choice = tgui_alert(usr, "Reset your Custom Say Verb?","Reset Verb",list("Yes","No")) var/say_choice = tgui_alert(usr, "Reset your Custom Say Verb?","Reset Verb",list("Yes","No"))
if(say_choice == "Yes") if(say_choice == "Yes")
@@ -351,6 +408,18 @@
pref.custom_exclaim = null pref.custom_exclaim = null
return TOPIC_REFRESH return TOPIC_REFRESH
else if(href_list["reset_cold"])
var/cold_choice = tgui_alert(usr, "Reset your Custom Cold Discomfort messages?", "Reset Discomfort",list("Yes","No"))
if(cold_choice == "Yes")
pref.custom_cold = list()
return TOPIC_REFRESH
else if(href_list["reset_heat"])
var/heat_choice = tgui_alert(usr, "Reset your Custom Heat Discomfort messages?", "Reset Discomfort",list("Yes","No"))
if(heat_choice == "Yes")
pref.custom_heat = list()
return TOPIC_REFRESH
else if(href_list["add_trait"]) else if(href_list["add_trait"])
var/mode = text2num(href_list["add_trait"]) var/mode = text2num(href_list["add_trait"])
var/list/picklist var/list/picklist

View File

@@ -90,9 +90,17 @@
*/ */
var/discomfort_message var/discomfort_message
var/list/custom_cold = H.custom_cold
var/list/custom_heat = H.custom_heat
if(msg_type == ENVIRONMENT_COMFORT_MARKER_COLD && length(cold_discomfort_strings) /*&& !covered*/) if(msg_type == ENVIRONMENT_COMFORT_MARKER_COLD && length(cold_discomfort_strings) /*&& !covered*/)
if(custom_cold.len > 0)
discomfort_message = pick(custom_cold)
else
discomfort_message = pick(cold_discomfort_strings) discomfort_message = pick(cold_discomfort_strings)
else if(msg_type == ENVIRONMENT_COMFORT_MARKER_HOT && length(heat_discomfort_strings) /*&& covered*/) else if(msg_type == ENVIRONMENT_COMFORT_MARKER_HOT && length(heat_discomfort_strings) /*&& covered*/)
if(custom_heat.len > 0)
discomfort_message = pick(custom_heat)
else
discomfort_message = pick(heat_discomfort_strings) discomfort_message = pick(heat_discomfort_strings)
if(discomfort_message && prob(5)) if(discomfort_message && prob(5))

View File

@@ -11,6 +11,9 @@
var/custom_ask = null var/custom_ask = null
var/custom_exclaim = null var/custom_exclaim = null
var/custom_whisper = null var/custom_whisper = null
//custom temperature discomfort vars
var/list/custom_heat = list()
var/list/custom_cold = list()
//YW Add Start //YW Add Start
/mob /mob