Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refractored ERP interactions #61

Draft
wants to merge 43 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ea95cd9
makes the interactions subsystem
MosleyTheMalO Dec 21, 2024
366a3a5
Interaction checks (needs unholy and extreme checks)
MosleyTheMalO Dec 21, 2024
480b297
Interactions climax edits
MosleyTheMalO Dec 23, 2024
0b5e3f8
Add extreme, harmful, and unholy ERP preferences and interactions
MosleyTheMalO Dec 24, 2024
160f229
forgor
MosleyTheMalO Dec 24, 2024
c2c1122
fixes unsafe interactions again
MosleyTheMalO Dec 24, 2024
34628b5
refractor genital expansion reagents and adds prefs
MosleyTheMalO Dec 25, 2024
fb7700f
no
MosleyTheMalO Dec 25, 2024
e660f45
ugh
MosleyTheMalO Dec 25, 2024
23f6c0b
Fixes some stuff + fluids system + proper vagina climax handling
MosleyTheMalO Dec 26, 2024
c7b283e
implements sexual potency and lust tolerance
MosleyTheMalO Dec 26, 2024
d9adcad
fuck interactions - needs sounds
MosleyTheMalO Dec 26, 2024
77ea364
bruh
MosleyTheMalO Dec 26, 2024
e7a4e07
tgstation.dme
MosleyTheMalO Dec 26, 2024
b9c3780
Interaction sounds (modular_sand)
MosleyTheMalO Dec 26, 2024
f1f315d
guh
MosleyTheMalO Dec 26, 2024
b5dbeeb
frotting interactions
MosleyTheMalO Dec 26, 2024
41bb937
Extra logic necessary for some interactions
MosleyTheMalO Dec 27, 2024
0152d88
forgor
MosleyTheMalO Dec 27, 2024
217bb15
that was unnecessary
MosleyTheMalO Dec 27, 2024
32353fd
feet interactions
MosleyTheMalO Dec 27, 2024
5ba9e81
handjob
MosleyTheMalO Dec 27, 2024
9530f18
breasts
MosleyTheMalO Dec 27, 2024
f03ff25
guess this could work
MosleyTheMalO Dec 27, 2024
43e8a5f
some extra checks on climax
MosleyTheMalO Dec 27, 2024
c4f790e
fixes
MosleyTheMalO Dec 27, 2024
32704a3
nipsuck
MosleyTheMalO Dec 27, 2024
c48a6f1
oral and facefuck interactions
MosleyTheMalO Dec 27, 2024
e95b53c
Makes the interactions folder less of a mess
MosleyTheMalO Dec 27, 2024
37df3d2
yeah this isn't gonna work as intended
MosleyTheMalO Dec 27, 2024
26b8762
fingering and kisses
MosleyTheMalO Dec 27, 2024
8a47f4b
lick (mmm feet)
MosleyTheMalO Dec 27, 2024
6095278
Mount and thighs
MosleyTheMalO Dec 27, 2024
1d0a4b8
testicles
MosleyTheMalO Dec 27, 2024
d21d295
Update mount.dm
MosleyTheMalO Dec 27, 2024
8a8a234
fixes
MosleyTheMalO Dec 27, 2024
bf90017
slap
MosleyTheMalO Dec 27, 2024
b5da120
extreme interactions, self interactions, and other improvements
MosleyTheMalO Dec 27, 2024
eb85b0b
fix
MosleyTheMalO Dec 27, 2024
b6e161b
Finishing touches (modular_sand interactions)
MosleyTheMalO Dec 27, 2024
347fd2c
honestly it's easier to keep these than adding them manually again
MosleyTheMalO Dec 27, 2024
4896831
honk!
MosleyTheMalO Dec 27, 2024
b413d41
better implementation
MosleyTheMalO Dec 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions code/__DEFINES/~~~splurt_defines/interactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/// Extra interaction checks.

// A person needs to have mouth available to do this interaction
#define INTERACTION_REQUIRE_SELF_MOUTH "self_mouth"
#define INTERACTION_REQUIRE_TARGET_MOUTH "target_mouth"

// A person needs to have their top clothes removed to do this interaction
#define INTERACTION_REQUIRE_SELF_TOPLESS "self_topless"
#define INTERACTION_REQUIRE_TARGET_TOPLESS "target_topless"

// A person needs to have their bottom clothes removed to do this interaction
#define INTERACTION_REQUIRE_SELF_BOTTOMLESS "self_bottomless"
#define INTERACTION_REQUIRE_TARGET_BOTTOMLESS "target_bottomless"

// A person needs to have their feet exposed to do this interaction
#define INTERACTION_REQUIRE_SELF_FEET "self_feet"
#define INTERACTION_REQUIRE_TARGET_FEET "target_feet"

/// Climax definitions

//Climaxing genitals
#define CLIMAX_VAGINA "vagina"
#define CLIMAX_PENIS "penis"
#define CLIMAX_BOTH "both"

//Climaxing positions
#define CLIMAX_POSITION_USER "climax_user"
#define CLIMAX_POSITION_TARGET "climax_target"

//Climaxing targets (use these if you're not using organ slots)
#define CLIMAX_TARGET_MOUTH "mouth"
#define CLIMAX_TARGET_SHEATH "sheath"

// Extreme types
#define INTERACTION_EXTREME (1<<0)
#define INTERACTION_HARMFUL (1<<1) // If you use this on an interaction, add INTERACTION_EXTREME to it as well
#define INTERACTION_UNHOLY (1<<2)

// Interaction categories
#define INTERACTION_CAT_LEWD "lewd"
#define INTERACTION_CAT_EXTREME "extreme"
#define INTERACTION_CAT_HARMFUL "harmful"
#define INTERACTION_CAT_UNHOLY "unholy"

// Additional details sent to the interaction menu
#define INTERACTION_FILLS_CONTAINERS list( \
"info" = "You can fill a container if you have it in your active hand or are pulling it", \
"icon" = "flask", \
"color" = "transparent" \
)

// Interaction flags (used for logic but normally not sent to the interaction menu)
#define INTERACTION_OVERRIDE_FLUID_TRANSFER (1<<0)
6 changes: 6 additions & 0 deletions code/__DEFINES/~~~splurt_defines/subsystems.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* # INIT_ORDER_INTERACTIONS
* Used by the Interactions subsystems, used to set it's own position in the queue.
* This puts this last on priority, very far from other subsystems,
*/
#define INIT_ORDER_INTERACTIONS -150
2 changes: 1 addition & 1 deletion code/controllers/configuration/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
load_whitelist()

// SKYRAT EDIT ADDITION START
populate_interaction_instances()
//populate_interaction_instances() //SPLURT EDIT REMOVAL - Interactions
remove_erp_things()
// SKYRAT EDIT ADDITION END

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,20 @@
var/e_prefs_v = preferences.read_preference(/datum/preference/choiced/erp_status_v)
var/e_prefs_nc = preferences.read_preference(/datum/preference/choiced/erp_status_nc)
var/e_prefs_mechanical = preferences.read_preference(/datum/preference/choiced/erp_status_mechanics)
// SPLURT EDIT ADDITION - Interaction preferences
var/e_prefs_extm = preferences.read_preference(/datum/preference/choiced/erp_status_extm)
var/e_prefs_extmharm = preferences.read_preference(/datum/preference/choiced/erp_status_extmharm)
var/e_prefs_unholy = preferences.read_preference(/datum/preference/choiced/erp_status_unholy)
// SPLURT EDIT END
ooc_notes += "ERP: [e_prefs]\n"
ooc_notes += "Hypnosis: [e_prefs_hypno]\n"
ooc_notes += "Vore: [e_prefs_v]\n"
ooc_notes += "Non-Con: [e_prefs_nc]\n"
// SPLURT EDIT ADDITION - Interaction preferences
ooc_notes += "Extreme ERP verbs: [e_prefs_extm]\n"
ooc_notes += "Harmful ERP verbs: [e_prefs_extmharm]\n"
ooc_notes += "Unholy ERP verbs: [e_prefs_unholy]\n"
// SPLURT EDIT END
ooc_notes += "ERP Mechanics: [e_prefs_mechanical]\n"
ooc_notes += "\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,31 @@

/datum/component/interactable/proc/build_interactions_list()
interactions = list()
for(var/iterating_interaction_id in GLOB.interaction_instances)
var/datum/interaction/interaction = GLOB.interaction_instances[iterating_interaction_id]
//SPLURT EDIT - Interactions subsystem
if(!SSinteractions)
return // Can't continue, no subsystem
for(var/iterating_interaction_id in SSinteractions.interactions)
var/datum/interaction/interaction = SSinteractions.interactions[iterating_interaction_id]
//SPLURT EDIT END
if(interaction.lewd)
if(!self.client?.prefs?.read_preference(/datum/preference/toggle/erp))
continue
// SPLURT EDIT ADDITION - Interaction preferences
if(interaction.unsafe_types & INTERACTION_EXTREME)
if(self.client?.prefs?.read_preference(/datum/preference/choiced/erp_status_extm) == "No")
continue
if(interaction.unsafe_types & INTERACTION_HARMFUL)
if(self.client?.prefs?.read_preference(/datum/preference/choiced/erp_status_extmharm) == "No")
continue
if(interaction.unsafe_types & INTERACTION_UNHOLY)
if(self.client?.prefs?.read_preference(/datum/preference/choiced/erp_status_unholy) == "No")
continue
// SPLURT EDIT END
/*
SPLURT EDIT REMOVAL - Interactions
if(interaction.sexuality != "" && interaction.sexuality != self.client?.prefs?.read_preference(/datum/preference/choiced/erp_sexuality))
continue
*/
interactions.Add(interaction)

/datum/component/interactable/RegisterWithParent()
Expand Down Expand Up @@ -143,11 +161,11 @@

if(params["interaction"])
var/interaction_id = params["interaction"]
if(GLOB.interaction_instances[interaction_id])
if(SSinteractions.interactions[interaction_id])
var/mob/living/carbon/human/user = locate(params["userref"])
if(!can_interact(GLOB.interaction_instances[interaction_id], user))
if(!can_interact(SSinteractions.interactions[interaction_id], user))
return FALSE
GLOB.interaction_instances[interaction_id].act(user, locate(params["selfref"]))
SSinteractions.interactions[interaction_id].act(user, locate(params["selfref"]))
var/datum/component/interactable/interaction_component = user.GetComponent(/datum/component/interactable)
interaction_component.interact_last = world.time
interact_next = interaction_component.interact_last + INTERACTION_COOLDOWN
Expand Down
46 changes: 32 additions & 14 deletions modular_skyrat/modules/interaction_menu/code/interaction_datum.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

/* SPLURT EDIT REMOVAL - Interactions subsystem
GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
*/

/datum/interaction
/// The name to be displayed in the interaction menu for this interaction
Expand Down Expand Up @@ -48,9 +50,12 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
var/list/interaction_requires = list()
/// What color should the interaction button be?
var/color = "blue"
/* SPLURT EDIT REMOVAL - Interactions
/// What sexuality preference do we display for.
var/sexuality = ""
*/

/* SPLURT EDIT REMOVAL - Interactions - Refractored in modular
/datum/interaction/proc/allow_act(mob/living/carbon/human/user, mob/living/carbon/human/target)
if(target == user && usage == INTERACTION_OTHER)
return FALSE
Expand Down Expand Up @@ -82,6 +87,7 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
else
CRASH("Unimplemented interaction requirement '[requirement]'")
return TRUE
*/ //SPLURT EDIT END

/datum/interaction/proc/act(mob/living/carbon/human/user, mob/living/carbon/human/target)
if(!allow_act(user, target))
Expand Down Expand Up @@ -115,16 +121,24 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
message_admins("Deprecated sound handling for '[name]'. Correct format is a list with one entry. This message will only show once.")
sound_possible = list(sound_possible)
sound_cache = pick(sound_possible)
//SPLURT EDIT - Interactions - For some reason the original code didn't send any sound
/*
for(var/mob/mob in view(sound_range, user))
SEND_SOUND(sound_cache, mob)

*/
conditional_pref_sound(user, sound_cache, 80, TRUE, falloff_distance = sound_range, pref_to_check = /datum/preference/toggle/erp/sounds)
//SPLURT EDIT END
if(lewd)
user.adjust_pleasure(user_pleasure)
user.adjust_pleasure(user_pleasure * (target.dna.features["sexual_potency"] || 1), target, src, CLIMAX_POSITION_USER) //SPLURT EDIT - Interactions
user.adjust_arousal(user_arousal)
user.adjust_pain(user_pain)
target.adjust_pleasure(target_pleasure)
target.adjust_arousal(target_arousal)
target.adjust_pain(target_pain)
user.adjust_pain(user_pain, target, src, CLIMAX_POSITION_USER) //SPLURT EDIT - Interactions
if(usage == INTERACTION_OTHER) //SPLURT EDIT - Interactions
target.adjust_pleasure(target_pleasure * (user.dna.features["sexual_potency"] || 1), user, src, CLIMAX_POSITION_TARGET) //SPLURT EDIT - Interactions
target.adjust_arousal(target_arousal)
target.adjust_pain(target_pain, user, src, CLIMAX_POSITION_TARGET) //SPLURT EDIT - Interactions

post_interaction(user, target) //SPLURT EDIT - Interactions
return TRUE

/datum/interaction/proc/load_from_json(path)
var/fpath = path
Expand Down Expand Up @@ -157,7 +171,7 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
target_pleasure = sanitize_integer(json["target_pleasure"], 0, 100, 0)
target_pain = sanitize_integer(json["target_pain"], 0, 100, 0)
lewd = sanitize_integer(json["lewd"], 0, 1, 0)
sexuality = sanitize_text(json["sexuality"])
// sexuality = sanitize_text(json["sexuality"]) //SPLURT EDIT REMOVAL - Interactions
return TRUE

/datum/interaction/proc/json_save(path)
Expand Down Expand Up @@ -187,7 +201,7 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
"target_pleasure" = target_pleasure,
"target_pain" = target_pain,
"lewd" = lewd,
"sexuality" = sexuality,
// "sexuality" = sexuality, //SPLURT EDIT REMOVAL - Interactions
)
var/file = file(fpath)
WRITE_FILE(file, json_encode(json))
Expand All @@ -201,7 +215,11 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
/proc/populate_interaction_instances()
for(var/spath in subtypesof(/datum/interaction))
var/datum/interaction/interaction = new spath()
GLOB.interaction_instances[interaction.name] = interaction
//SPLURT EDIT - Interactions
if(interaction.name == /datum/interaction::name || interaction.description == /datum/interaction::description)
continue
//SPLURT EDIT END
SSinteractions.interactions[interaction.name] = interaction //SPLURT EDIT - Interactions subsystem - Original: GLOB.interaction_instances[interaction.name] = interaction
populate_interaction_jsons(INTERACTION_JSON_FOLDER)

/proc/populate_interaction_jsons(directory)
Expand All @@ -214,7 +232,7 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
continue
var/datum/interaction/interaction = new()
if(interaction.load_from_json(directory + file))
GLOB.interaction_instances[interaction.name] = interaction
SSinteractions.interactions[interaction.name] = interaction //SPLURT EDIT - Interactions subsystem - Original: GLOB.interaction_instances[interaction.name] = interaction
else message_admins("Error loading interaction from file: '[directory + file]'. Inform coders.")

/proc/populate_interaction_jsons_master(path)
Expand All @@ -225,7 +243,7 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
var/list/json = json_load(file)

for(var/iname in json)
if(GLOB.interaction_instances[iname])
if(SSinteractions.interactions[iname]) //SPLURT EDIT - Interactions subsystem - Original: if(GLOB.interaction_instances[iname])
message_admins("Interaction Master '[path]' contained a duplicate interaction! '[iname]'")
continue

Expand Down Expand Up @@ -257,9 +275,9 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
interaction.target_pleasure = sanitize_integer(ijson["target_pleasure"], 0, 100, 0)
interaction.target_pain = sanitize_integer(ijson["target_pain"], 0, 100, 0)
interaction.lewd = sanitize_integer(ijson["lewd"], 0, 1, 0)
interaction.sexuality = sanitize_text(ijson["sexuality"])
// interaction.sexuality = sanitize_text(ijson["sexuality"]) //SPLURT EDIT REMOVAL - Interactions

GLOB.interaction_instances[iname] = interaction
SSinteractions.interactions[iname] = interaction //SPLURT EDIT - Interactions subsystem - Original: GLOB.interaction_instances[iname] = interaction

ADMIN_VERB(reload_interactions, R_DEBUG, "Reload Interactions", "Force reload interactions.", ADMIN_CATEGORY_DEBUG)
populate_interaction_instances()
SSinteractions.prepare_interactions() //SPLURT EDIT - Interactions subsystem - Original: populate_interaction_instances()
Loading
Loading