Improves the "disable ERP" config (#16411)

* i'm stealing the erp

* h

* Apply suggestions from code review

Co-authored-by: Tastyfish <crazychris32@gmail.com>

Co-authored-by: Tastyfish <crazychris32@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
Zonespace
2022-10-02 07:20:24 -07:00
committed by GitHub
parent 846229cde2
commit 1481db3dab
14 changed files with 127 additions and 2 deletions

View File

@@ -89,7 +89,10 @@
LoadPolicy()
LoadChatFilter()
populate_interaction_instances() //SKYRAT EDIT ADDITION
// SKYRAT EDIT ADDITION START
populate_interaction_instances()
remove_erp_things()
// SKYRAT EDIT ADDITION END
loaded = TRUE

View File

@@ -59,6 +59,11 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
if(initial(quirk_type.abstract_parent_type) == type)
continue
// SKYRAT EDIT ADDITION START
if(initial(quirk_type.erp_quirk) && CONFIG_GET(flag/disable_erp_preferences))
continue
// SKYRAT EDIT ADDITION END
quirks[initial(quirk_type.name)] = quirk_type
quirk_points[initial(quirk_type.name)] = initial(quirk_type.value)

View File

@@ -17,6 +17,19 @@ PROCESSING_SUBSYSTEM_DEF(reagents)
GLOB.fake_reagent_blacklist = list(/datum/reagent/medicine/c2, /datum/reagent/medicine, /datum/reagent/reaction_agent)
//Build GLOB lists - see holder.dm
build_chemical_reactions_lists()
// SKYRAT EDIT ADDITION START
if(CONFIG_GET(flag/disable_erp_preferences))
for(var/reaction_path in GLOB.chemical_reactions_list)
var/datum/chemical_reaction/reaction_datum = GLOB.chemical_reactions_list[reaction_path]
if(!reaction_datum.erp_reaction)
continue
GLOB.chemical_reactions_list -= reaction_path
for(var/reaction in reaction_datum.required_reagents)
var/list/reaction_list = GLOB.chemical_reactions_list_reactant_index[reaction]
if(reaction_list)
reaction_list -= reaction_datum
// SKYRAT EDIT ADDITION END
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/reagents/fire(resumed = FALSE)

View File

@@ -165,7 +165,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
tainted_character_profiles = FALSE
//SKYRAT EDIT BEGIN
data["preview_options"] = list(PREVIEW_PREF_JOB, PREVIEW_PREF_LOADOUT, PREVIEW_PREF_UNDERWEAR, PREVIEW_PREF_NAKED, PREVIEW_PREF_NAKED_AROUSED)
data["preview_selection"] = preview_pref
data["quirks_balance"] = GetQuirkBalance()
@@ -184,6 +183,13 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/datum/preferences/ui_static_data(mob/user)
var/list/data = list()
// SKYRAT EDIT ADDITION START
if(CONFIG_GET(flag/disable_erp_preferences))
data["preview_options"] = list(PREVIEW_PREF_JOB, PREVIEW_PREF_LOADOUT, PREVIEW_PREF_UNDERWEAR, PREVIEW_PREF_NAKED)
else
data["preview_options"] = list(PREVIEW_PREF_JOB, PREVIEW_PREF_LOADOUT, PREVIEW_PREF_UNDERWEAR, PREVIEW_PREF_NAKED, PREVIEW_PREF_NAKED_AROUSED)
// SKYRAT EDIT ADDITION END
data["character_profiles"] = create_character_profiles()
data["character_preview_view"] = character_preview_view.assigned_map

View File

@@ -888,6 +888,11 @@
if(initial(quirk_type.abstract_parent_type) == type)
continue
// SKYRAT EDIT ADDITION START
if(initial(quirk_type.erp_quirk) && CONFIG_GET(flag/disable_erp_preferences))
continue
// SKYRAT EDIT ADDITION END
var/qname = initial(quirk_type.name)
options[has_quirk(quirk_type) ? "[qname] (Remove)" : "[qname] (Add)"] = quirk_type

View File

@@ -13,6 +13,8 @@
target.dna.mutant_bodyparts[relevant_mutant_bodypart]["name"] = value
/datum/preference/choiced/genital/is_accessible(datum/preferences/preferences)
if(CONFIG_GET(flag/disable_erp_preferences))
return FALSE
var/passed_initial_check = ..(preferences)
var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts)
var/erp_allowed = preferences.read_preference(/datum/preference/toggle/master_erp_preferences)
@@ -178,6 +180,8 @@
target.dna.features["penis_taur"] = value
/datum/preference/toggle/penis_taur_mode/is_accessible(datum/preferences/preferences)
if(CONFIG_GET(flag/disable_erp_preferences))
return FALSE
var/passed_initial_check = ..(preferences)
var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts)
var/part_enabled = is_factual_sprite_accessory(relevant_mutant_bodypart, preferences.read_preference(/datum/preference/choiced/genital/penis))

View File

@@ -99,3 +99,56 @@
GLOB.augment_categories_to_slots[L.category] = list()
GLOB.augment_categories_to_slots[L.category] += L.slot
GLOB.augment_slot_to_items[L.slot] += L.path
/// If the "Remove ERP Interaction" config is disabled, remove ERP things from various lists
/proc/remove_erp_things()
if(!CONFIG_GET(flag/disable_erp_preferences))
return
// Chemical reactions aren't handled here because they're loaded in the reagents SS
// See Initialize() on SSReagents
// Loadouts
for(var/loadout_path in GLOB.all_loadout_datums)
var/datum/loadout_item/loadout_datum = GLOB.all_loadout_datums[loadout_path]
if(!loadout_datum.erp_item)
continue
GLOB.all_loadout_datums -= loadout_path
// Ensure this FULLY works later
// Underwear
for(var/sprite_name in GLOB.underwear_list)
var/datum/sprite_accessory/sprite_datum = GLOB.underwear_list[sprite_name]
if(!sprite_datum?.erp_accessory)
continue
GLOB.underwear_list -= sprite_name
for(var/sprite_name in GLOB.underwear_f)
var/datum/sprite_accessory/sprite_datum = GLOB.underwear_f[sprite_name]
if(!sprite_datum?.erp_accessory)
continue
GLOB.underwear_f -= sprite_name
for(var/sprite_name in GLOB.underwear_m)
var/datum/sprite_accessory/sprite_datum = GLOB.underwear_m[sprite_name]
if(!sprite_datum?.erp_accessory)
continue
GLOB.underwear_m -= sprite_name
// Undershirts
for(var/sprite_name in GLOB.undershirt_list)
var/datum/sprite_accessory/sprite_datum = GLOB.undershirt_list[sprite_name]
if(!sprite_datum?.erp_accessory)
continue
GLOB.undershirt_list -= sprite_name
for(var/sprite_name in GLOB.undershirt_f)
var/datum/sprite_accessory/sprite_datum = GLOB.undershirt_f[sprite_name]
if(!sprite_datum?.erp_accessory)
continue
GLOB.undershirt_f -= sprite_name
for(var/sprite_name in GLOB.undershirt_m)
var/datum/sprite_accessory/sprite_datum = GLOB.undershirt_m[sprite_name]
if(!sprite_datum?.erp_accessory)
continue
GLOB.undershirt_m -= sprite_name

View File

@@ -56,6 +56,8 @@ GLOBAL_LIST_EMPTY(cached_mutant_icon_files)
var/genetic = FALSE
var/uses_emissives = FALSE
var/color_layer_names
/// If this sprite accessory will be inaccessable if ERP config is disabled
var/erp_accessory = FALSE
/datum/sprite_accessory/New()
if(!default_color)
@@ -333,6 +335,7 @@ GLOBAL_LIST_EMPTY(cached_mutant_icon_files)
name = "Socks - Latex"
icon_state = "socks_latex"
use_static = TRUE
erp_accessory = TRUE
/datum/sprite_accessory/underwear
icon = 'modular_skyrat/master_files/icons/mob/clothing/underwear.dmi'
@@ -465,16 +468,19 @@ GLOBAL_LIST_EMPTY(cached_mutant_icon_files)
name = "Chastity Belt"
icon_state = "chastbelt"
use_static = TRUE
erp_accessory = TRUE
/datum/sprite_accessory/underwear/chastcage
name = "Chastity Cage"
icon_state = "chastcage"
use_static = null
erp_accessory = TRUE
/datum/sprite_accessory/underwear/latex
name = "Panties - Latex"
icon_state = "panties_latex"
use_static = TRUE
erp_accessory = TRUE
/datum/sprite_accessory/underwear/lizared
name = "LIZARED Underwear"
@@ -633,6 +639,7 @@ GLOBAL_LIST_EMPTY(cached_mutant_icon_files)
icon_state = "bra_latex"
gender = FEMALE
use_static = TRUE
erp_accessory = TRUE
/datum/sprite_accessory/undershirt/striped_bra
name = "Bra - Striped"
@@ -702,30 +709,35 @@ GLOBAL_LIST_EMPTY(cached_mutant_icon_files)
icon_state = "chastbra"
gender = FEMALE
use_static = TRUE
erp_accessory = TRUE
/datum/sprite_accessory/undershirt/pasties
name = "Pasties"
icon_state = "pasties"
gender = FEMALE
use_static = null
erp_accessory = TRUE
/datum/sprite_accessory/undershirt/pasties_alt
name = "Pasties - Alt"
icon_state = "pasties_alt"
gender = FEMALE
use_static = null
erp_accessory = TRUE
/datum/sprite_accessory/undershirt/shibari
name = "Shibari"
icon_state = "shibari"
gender = FEMALE
use_static = null
erp_accessory = TRUE
/datum/sprite_accessory/undershirt/shibari_sleeves
name = "Shibari Sleeves"
icon_state = "shibari_sleeves"
gender = FEMALE
use_static = null
erp_accessory = TRUE
/datum/sprite_accessory/undershirt/bulletclub //4 life
name = "Shirt - Black Skull"

View File

@@ -54,6 +54,8 @@ GLOBAL_LIST_EMPTY(all_loadout_datums)
var/donator_only
/// Whether the item requires a specific season in order to be available
var/required_season = null
/// If the item won't appear when the ERP config is disabled
var/erp_item = FALSE
/*
* Place our [var/item_path] into [outfit].

View File

@@ -377,6 +377,7 @@ GLOBAL_LIST_INIT(loadout_helmets, generate_loadout_items(/datum/loadout_item/hea
/datum/loadout_item/head/domina_cap
name = "Dominant Cap"
item_path = /obj/item/clothing/head/domina_cap
erp_item = TRUE
/datum/loadout_item/head/fashionable_cap
name = "Fashionable Baseball Cap"

View File

@@ -153,6 +153,7 @@ GLOBAL_LIST_INIT(loadout_necks, generate_loadout_items(/datum/loadout_item/neck)
/datum/loadout_item/neck/kinkycollar
name = "Kinky Collar"
item_path = /obj/item/clothing/neck/kink_collar
erp_item = TRUE
/*
* PONCHOS

View File

@@ -176,6 +176,7 @@ GLOBAL_LIST_INIT(loadout_shoes, generate_loadout_items(/datum/loadout_item/shoes
/datum/loadout_item/shoes/dominaheels
name = "Dominant Heels"
item_path = /obj/item/clothing/shoes/latex_heels/domina_heels
erp_item = TRUE
/datum/loadout_item/shoes/griffin
name = "Griffon Boots"

View File

@@ -612,44 +612,55 @@
* CHEMICAL REACTIONS
*/
/datum/chemical_reaction
/// Will this reaction be disabled by the ERP config being turned off?
var/erp_reaction = FALSE
/datum/chemical_reaction/crocin
results = list(/datum/reagent/drug/aphrodisiac/crocin = 6)
required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/oxygen = 2, /datum/reagent/water = 1)
required_temp = 400
mix_message = "The mixture boils off a pink vapor..."
erp_reaction = TRUE
/datum/chemical_reaction/hexacrocin
results = list(/datum/reagent/drug/aphrodisiac/crocin/hexacrocin = 1)
required_reagents = list(/datum/reagent/drug/aphrodisiac/crocin = 6, /datum/reagent/phenol = 1)
required_temp = 600
mix_message = "The mixture rapidly condenses and darkens in color..."
erp_reaction = TRUE
/datum/chemical_reaction/camphor
results = list(/datum/reagent/drug/aphrodisiac/camphor = 6)
required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/oxygen = 2, /datum/reagent/sulfur = 1)
required_temp = 400
mix_message = "The mixture boils off a yellow, smelly vapor..."
erp_reaction = TRUE
/datum/chemical_reaction/pentacamphor
results = list(/datum/reagent/drug/aphrodisiac/camphor/pentacamphor = 1)
required_reagents = list(/datum/reagent/drug/aphrodisiac/camphor = 5, /datum/reagent/acetone = 1)
required_temp = 500
mix_message = "The mixture thickens and heats up slighty..."
erp_reaction = TRUE
/datum/chemical_reaction/cum
results = list(/datum/reagent/consumable/cum = 5)
required_reagents = list(/datum/reagent/blood = 2, /datum/reagent/consumable/milk = 2, /datum/reagent/consumable/salt = 1)
mix_message = "The mixture turns into a gooey, musky white liquid..."
erp_reaction = TRUE
/datum/chemical_reaction/breast_enlarger
results = list(/datum/reagent/drug/aphrodisiac/breast_enlarger = 8)
required_reagents = list(/datum/reagent/medicine/salglu_solution = 1, /datum/reagent/consumable/milk = 1, /datum/reagent/medicine/c2/synthflesh = 2, /datum/reagent/silicon = 3, /datum/reagent/drug/aphrodisiac/crocin = 3)
mix_message = "the reaction gives off a mist of milk."
erp_reaction = TRUE
/datum/chemical_reaction/penis_enlarger
results = list(/datum/reagent/drug/aphrodisiac/penis_enlarger = 8)
required_reagents = list(/datum/reagent/blood = 5, /datum/reagent/medicine/c2/synthflesh = 2, /datum/reagent/carbon = 2, /datum/reagent/drug/aphrodisiac/crocin = 2, /datum/reagent/medicine/salglu_solution = 1)
mix_message = "the reaction gives off a mist of milk."
erp_reaction = TRUE
/*
* PREMADE CONTAINERS

View File

@@ -174,6 +174,10 @@
* MASOCHISM
*/
/datum/quirk
/// Is this a quirk disabled by disabling the ERP config?
var/erp_quirk = FALSE
/datum/quirk/masochism
name = "Masochism"
desc = "Pain brings you indescribable pleasure."
@@ -183,6 +187,7 @@
lose_text = span_notice("Ouch! Pain is... Painful again! Ou-ou-ouch!")
medical_record_text = "Subject has masochism."
icon = "heart-broken"
erp_quirk = TRUE
/datum/quirk/masochism/post_add()
. = ..()
@@ -230,6 +235,7 @@
lose_text = span_notice("Others' pain doesn't satisfy you anymore.")
medical_record_text = "Subject has sadism."
icon = "hammer"
erp_quirk = TRUE
/datum/quirk/sadism/post_add()
. = ..()
@@ -279,6 +285,7 @@
gain_text = span_danger("You really want to be restrained for some reason.")
lose_text = span_notice("Being restrained doesn't arouse you anymore.")
icon = "link"
erp_quirk = TRUE
/datum/quirk/ropebunny/post_add()
. = ..()
@@ -299,6 +306,7 @@
gain_text = span_danger("Suddenly you understand rope weaving much better than before.")
lose_text = span_notice("Rope knots looks complicated again.")
icon = "chain-broken"
erp_quirk = TRUE
/datum/quirk/rigger/post_add()
. = ..()