Skip to content

Commit

Permalink
more stuff, reordering folders, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
evandarksky committed Oct 19, 2024
1 parent 5a7577b commit f05f3e8
Show file tree
Hide file tree
Showing 106 changed files with 4,218 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/__DEFINES/~~~splurt_defines/signals.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// just before a datum's Destroy() is called: (force), at this point none of the other components chose to interrupt qdel and Destroy will be called
#define COMSIG_PARENT_QDELETING "parent_qdeleting"
3 changes: 3 additions & 0 deletions code/__HELPERS/logging/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,6 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
return "([AREACOORD(T)])"
else if(A.loc)
return "(UNKNOWN (?, ?, ?))"

/proc/log_subsystem(subsystem, text)
WRITE_LOG(GLOB.subsystem_log, "[subsystem]: [text]")
4 changes: 4 additions & 0 deletions code/_onclick/click_ctrl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
* Unused except for AI
*/
/mob/proc/CtrlShiftClickOn(atom/A)
. = SEND_SIGNAL(src, COMSIG_MOB_CTRLSHIFTCLICKON, A)
if(. & COMSIG_MOB_CANCEL_CLICKON)
return
A.CtrlShiftClick(src)
base_click_ctrl_shift(A)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction)
/// The name to be displayed in the interaction menu for this interaction
var/name = "broken interaction"
/// The description of the interacton.
var/description = "broken"
///var/description = "broken"
/// If it can be done at a distance.
var/distance_allowed = FALSE
/// A list of possible messages displayed loaded by the JSON.
Expand Down
62 changes: 62 additions & 0 deletions modular_zzplurt/code/controllers/subsystem/interactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* # 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,
* if citadel ever manages to get this far, push it ever lower.
*/
#define INIT_ORDER_INTERACTIONS -150
#define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }

SUBSYSTEM_DEF(interactions)
name = "Interactions"
flags = SS_NO_FIRE
init_order = INIT_ORDER_INTERACTIONS
var/list/interactions
VAR_PROTECTED/list/blacklisted_mobs = list(
/mob/dead,
/mob/dview,
/mob/camera, // Although it would be funny to fuck the sentient disease or AI hologram
/mob/living/simple_animal/ //Please don't commit bestiality
)
VAR_PROTECTED/initialized_blacklist



/datum/controller/subsystem/interactions/Initialize(timeofday)
prepare_interactions()
prepare_blacklisted_mobs()
. = ..()
var/extra_info = "<font style='transform: translate(0%, -25%);'>↳</font> Loaded [LAZYLEN(interactions)] interactions!"
to_chat(world, span_boldannounce(extra_info))
log_subsystem(src, extra_info)

/datum/controller/subsystem/interactions/stat_entry(msg)
msg += "|🖐:[LAZYLEN(interactions)]|"
msg += "🚫👨:[LAZYLEN(blacklisted_mobs)]"
return ..()

/// Makes the interactions, they're also a global list because having it as a list and just hanging around there is stupid
/datum/controller/subsystem/interactions/proc/prepare_interactions()
QDEL_NULL_LIST(interactions)
interactions = list()
for(var/datum/interaction/interaction as anything in subtypesof(/datum/interaction))
// Basetype, do not create
if(!initial(interaction.description))
continue
interaction = new interaction()
interactions["[interaction.type]"] = interaction

/// Blacklisting!
/datum/controller/subsystem/interactions/proc/prepare_blacklisted_mobs()
blacklisted_mobs = typecacheof(blacklisted_mobs)
initialized_blacklist = TRUE

/*
* Lewd interactions have a blacklist for certain mobs. When we evalute the user and target, both of
* their requirements must be satisfied, and the mob must not be of a blacklisted type.
*/
/datum/controller/subsystem/interactions/proc/is_blacklisted(mob/living/creature)
if(!creature || !initialized_blacklist)
return TRUE
if(is_type_in_typecache(creature, blacklisted_mobs))
return TRUE
Loading

0 comments on commit f05f3e8

Please sign in to comment.