Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

[PORT] Interaction panel #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
init, addes sand sounds, basic interaction panel
  • Loading branch information
Phoenix4O4 committed Dec 16, 2024
commit 60c8c3d15df9957b465f0be68ea52d34b2eec228
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()
remove_erp_things()
// SKYRAT EDIT ADDITION END

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@
var/e_prefs_hypno = preferences.read_preference(/datum/preference/choiced/erp_status_hypno)
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_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_mechanical = preferences.read_preference(/datum/preference/choiced/erp_status_mechanics)
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"
ooc_notes += "Extreme ERP verbs: [e_prefs_extm]\n"
ooc_notes += "Harmful ERP verbs: [e_prefs_extmharm]\n"
ooc_notes += "ERP Mechanics: [e_prefs_mechanical]\n"
ooc_notes += "\n"

Expand Down
2 changes: 2 additions & 0 deletions modular_skyrat/modules/interaction_menu/code/click.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*
/mob/living/carbon/human/click_ctrl_shift(mob/user) //We have to remove the can_interact check from humans.
SEND_SIGNAL(src, COMSIG_CLICK_CTRL_SHIFT, user)
return
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

/*
/datum/component/interactable
/// A hard reference to the parent
var/mob/living/carbon/human/self = null
Expand Down Expand Up @@ -248,3 +249,5 @@
return item.lewd_slot_flags & LEWD_SLOT_NIPPLES
else
return FALSE

*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/*
GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)

/datum/interaction
Expand Down Expand Up @@ -263,3 +263,4 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)

ADMIN_VERB(reload_interactions, R_DEBUG, "Reload Interactions", "Force reload interactions.", ADMIN_CATEGORY_DEBUG)
populate_interaction_instances()
*/
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/mob/living/carbon/human
/// Used to prevent nightmare scenarios.
var/refractory_period
//var/refractory_period

/mob/living/carbon/human/proc/climax(manual = TRUE)
if (CONFIG_GET(flag/disable_erp_preferences))
Expand Down
12 changes: 12 additions & 0 deletions modular_zubbers/code/modules/client/verbs/character_directory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ GLOBAL_DATUM(character_directory, /datum/character_directory)
var/vore = "Ask"
var/hypno = "Ask"
var/noncon = "Ask"
// BLUEMOON EDIT START: INTERACTION PANEL
var/extreme = "Ask"
var/extremeharm = "Ask"
// BLUEMOON EDIT END: INTERACTION PANEL
var/character_ad = ""
var/exploitable = ""
var/ref = REF(mob)
Expand Down Expand Up @@ -233,6 +237,10 @@ GLOBAL_DATUM(character_directory, /datum/character_directory)
vore = READ_PREFS(mob, choiced/erp_status_v)
hypno = READ_PREFS(mob, choiced/erp_status_hypno)
noncon = READ_PREFS(mob, choiced/erp_status_nc)
// BLUEMOON EDIT START: INTERACTION PANEL
extreme = READ_PREFS(mob, choiced/erp_status_extm)
extremeharm = READ_PREFS(mob, choiced/erp_status_extmharm)
// BLUEMOON EDIT END: INTERACTION PANEL
character_ad = READ_PREFS(mob, text/character_ad)
ooc_notes = READ_PREFS(mob, text/ooc_notes)
//If the user is an antagonist or Observer, we want them to be able to see exploitables in the Directory.
Expand All @@ -254,6 +262,10 @@ GLOBAL_DATUM(character_directory, /datum/character_directory)
"vore" = vore,
"hypno" = hypno,
"noncon" = noncon,
// BLUEMOON EDIT START: INTERACTION PANEL
"extreme" = extreme,
"extremeharm" = extremeharm,
// BLUEMOON EDIT END: INTERACTION PANEL
"exploitable" = exploitable,
"character_ad" = character_ad,
"flavor_text" = flavor_text,
Expand Down
186 changes: 186 additions & 0 deletions modular_zzbluemoon/code/modules/interactions/_interactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
/**********************************
*******Interactions code by HONKERTRON feat TestUnit********
**Contains a lot ammount of ERP and MEHANOYEBLYA**
**CREDIT TO ATMTA STATION FOR MOST OF THIS CODE, I ONLY MADE IT WORK IN /vg/ - Matt
** Rewritten 30/08/16 by Zuhayr, sry if I removed anything important.
**I removed ERP and replaced it with handholding. Nothing of worth was lost. - Vic
**Fuck you, Vic. ERP is back. - TT
**>using var/ on everything, also TRUE
***********************************/


// Rectum? Damn near killed 'em.
var/list/interactions

/proc/make_interactions(interaction)
if(!interactions)
interactions = list()
for(var/itype in subtypesof(/datum/interaction))
var/datum/interaction/I = new itype()
interactions[I.command] = I

/mob/living/carbon/human/proc/list_interaction_attributes()
var/dat = ""
if(has_hands())
dat += "...have hands."
if(has_mouth())
if(dat != "")
dat += "<br>"
dat += "...have a mouth, which is [mouth_is_free() ? "uncovered" : "covered"]."
return dat

/mob/living/proc/get_refraction_dif() //Got snapped in upstream, may delete later when I figure something out
var/dif = (refractory_period - world.time)
if(dif < 0)
return 0
else
return dif

/datum/interaction
var/command = "interact"
var/description = "Interact with them."
var/simple_message
var/simple_style = "notice"
var/write_log_user
var/write_log_target

var/interaction_sound

var/max_distance = 1
var/require_ooc_consent = FALSE
var/require_user_mouth
var/require_user_hands
var/require_target_mouth
var/require_target_hands
var/needs_physical_contact

var/user_is_target = FALSE //Boolean. Pretty self explanatory.

/datum/interaction/proc/evaluate_user(mob/living/carbon/human/user, silent = TRUE)
if(user.get_refraction_dif())
if(!silent) //bye spam
to_chat(user, "<span class='warning'>You're still exhausted from the last time. You need to wait [DisplayTimeText(user.get_refraction_dif(), TRUE)] until you can do that!</span>")
return FALSE

if(require_user_mouth)
if(!user.has_mouth())
if(!silent)
to_chat(user, "<span class = 'warning'>You don't have a mouth.</span>")
return FALSE

if(!user.mouth_is_free())
if(!silent)
to_chat(user, "<span class = 'warning'>Your mouth is covered.</span>")
return FALSE

if(require_user_hands && !user.has_hands())
if(!silent)
to_chat(user, "<span class = 'warning'>You don't have hands.</span>")
return FALSE

if(user.last_interaction_time < world.time)
return TRUE
return FALSE

/datum/interaction/proc/evaluate_target(mob/living/carbon/human/user, mob/living/carbon/human/target, silent = TRUE)
if(!user_is_target)
if(user == target)
if(!silent)
to_chat(user, "<span class = 'warning'>You can't do that to yourself.</span>")
return FALSE

if(require_target_mouth)
if(!target.has_mouth())
if(!silent)
to_chat(user, "<span class = 'warning'>They don't have a mouth.</span>")
return FALSE

if(!target.mouth_is_free())
if(!silent)
to_chat(user, "<span class = 'warning'>Their mouth is covered.</span>")
return FALSE

if(require_target_hands && !target.has_hands())
if(!silent)
to_chat(user, "<span class = 'warning'>They don't have hands.</span>")
return FALSE

return TRUE

/datum/interaction/proc/get_action_link_for(mob/living/carbon/human/user, mob/living/carbon/human/target)
return "<a HREF='byond://?src=[REF(src)];action=1;action_user=[REF(user)];action_target=[REF(target)]'>[description]</a><br>"

/datum/interaction/Topic(href, href_list)
if(..())
return TRUE
if(href_list["action"])
do_action(locate(href_list["action_user"]), locate(href_list["action_target"]))
return TRUE
return FALSE

/datum/interaction/proc/do_action(mob/living/carbon/human/user, mob/living/carbon/human/target)
if(!user_is_target)
if(user == target) //tactical href fix
to_chat(user, "<span class='warning'>You cannot target yourself.</span>")
return
if(get_dist(user, target) > max_distance)
//user << "<span class='warning'>They are too far away.</span>"
user.visible_message("<span class='warning'>They are too far away.</span>")
return
if(needs_physical_contact && !(user.Adjacent(target) && target.Adjacent(user)))
//user << "<span class='warning'>You cannot get to them.</span>"
user.visible_message("<span class='warning'>You cannot get to them.</span>")
return
if(!evaluate_user(user, silent = FALSE))
return
if(!evaluate_target(user, target, silent = FALSE))
return

if(write_log_user)
user.log_message("[write_log_user] [target]", INDIVIDUAL_ATTACK_LOG)
if(write_log_target)
target.log_message("[write_log_target] [user]", INDIVIDUAL_ATTACK_LOG)

display_interaction(user, target)
post_interaction(user, target)

//if(write_log_user)
//add_logs(target, user, "fucked")
//user.attack_log += text("\[[time_stamp()]\] <font color='red'>[write_log_user] [target.name] ([target.ckey])</font>")
//if(write_log_target)
//add_logs(target, user, "fucked2")
//target.attack_log += text("\[[time_stamp()]\] <font color='orange'>[write_log_target] [user.name] ([user.ckey])</font>")

/datum/interaction/proc/display_interaction(mob/living/carbon/human/user, mob/living/carbon/human/target)
if(simple_message)
var/use_message = replacetext(simple_message, "USER", "\the [user]")
use_message = replacetext(use_message, "TARGET", "\the [target]")
user.visible_message("<span class='[simple_style]'>[capitalize(use_message)]</span>")

/datum/interaction/proc/post_interaction(mob/living/carbon/human/user, mob/living/carbon/human/target)
user.last_interaction_time = world.time + 6
if(interaction_sound)
playsound(get_turf(user), interaction_sound, 50, 1, -1)
return
/*
/atom/movable/attack_hand(mob/living/carbon/human/user)
. = ..()
if(can_buckle && buckled_mob)
if(user_unbuckle_mob(user))
return TRUE
/atom/movable/MouseDrop_T(mob/living/carbon/human/M, mob/living/carbon/human/user)
. = ..()
if(can_buckle && istype(M) && !buckled_mob)
if(user_buckle_mob(M, user))
return TRUE
/atom/movable/attack_hand(mob/living/carbon/human/user)
. = ..()
if(can_buckle && buckled_mob)
if(user_unbuckle_mob(user))
return TRUE
/atom/movable/MouseDrop_T(mob/living/carbon/human/M, mob/living/carbon/human/user)
. = ..()
if(can_buckle && istype(M) && !buckled_mob)
if(user_buckle_mob(M, user))
return TRUE
*/
59 changes: 59 additions & 0 deletions modular_zzbluemoon/code/modules/interactions/erp_preferences.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/datum/preference/choiced/erp_status_extm
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "erp_status_pref_nc"

/datum/preference/choiced/erp_status_extm/init_possible_values()
return list("Yes - Switch", "Yes - Dom", "Yes - Sub", "Yes", "Ask (L)OOC", "Check OOC Notes", "No")

/datum/preference/choiced/erp_status_extm/create_default_value()
return "No"

/datum/preference/choiced/erp_status_extm/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE

if(CONFIG_GET(flag/disable_erp_preferences))
return FALSE

return preferences.read_preference(/datum/preference/toggle/master_erp_preferences)

/datum/preference/choiced/erp_status_extm/deserialize(input, datum/preferences/preferences)
if(CONFIG_GET(flag/disable_erp_preferences))
return "No"
if(!preferences.read_preference(/datum/preference/toggle/master_erp_preferences))
return "No"
. = ..()

/datum/preference/choiced/erp_status_extm/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
return FALSE

/datum/preference/choiced/erp_status_extmharm
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "erp_status_pref_nc"

/datum/preference/choiced/erp_status_extmharm/init_possible_values()
return list("Yes - Switch", "Yes - Dom", "Yes - Sub", "Yes", "Ask (L)OOC", "Check OOC Notes", "No")

/datum/preference/choiced/erp_status_extmharm/create_default_value()
return "No"

/datum/preference/choiced/erp_status_extmharm/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE

if(CONFIG_GET(flag/disable_erp_preferences))
return FALSE

return preferences.read_preference(/datum/preference/toggle/master_erp_preferences)

/datum/preference/choiced/erp_status_extmharm/deserialize(input, datum/preferences/preferences)
if(CONFIG_GET(flag/disable_erp_preferences))
return "No"
if(!preferences.read_preference(/datum/preference/toggle/master_erp_preferences))
return "No"
. = ..()

/datum/preference/choiced/erp_status_extmharm/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
return FALSE
Loading
Loading