Skip to content

Commit

Permalink
Modularises
Browse files Browse the repository at this point in the history
  • Loading branch information
Crowbar764 committed Jul 11, 2024
1 parent 318e8fd commit 06af8da
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 43 deletions.
11 changes: 1 addition & 10 deletions code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
. = ..()
if(.)
return

switch(action)
if("make", "make_mass")
var/mob/user = usr
Expand All @@ -551,16 +552,6 @@
else
make_action(crafting_recipe, user)

if (istype(crafting_recipe, /datum/crafting_recipe/improv_explosive) || istype(crafting_recipe, /datum/crafting_recipe/molotov) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload2))
var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is making an IED or molotov cocktail.
if(client.next_ied_grief_warning < world.time)
var/turf/T = get_turf(user)
client.next_ied_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has crafted an IED or Molotov at [ADMIN_VERBOSEJMP(T)].")
client.crafted_ied = TRUE


busy = FALSE
if("toggle_recipes")
display_craftable_only = !display_craftable_only
Expand Down
8 changes: 0 additions & 8 deletions code/game/objects/items/devices/transfer_valve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,6 @@
/obj/item/transfer_valve/attack_hand(mob/user, list/modifiers)
. = ..()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime has touched a bomb valve.
if(client.next_valve_grief_warning < world.time)
var/turf/T = get_turf(src)
client.next_valve_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] touched \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.touched_transfer_valve = TRUE

if(.)
return
if(attached_device)
Expand Down
8 changes: 0 additions & 8 deletions code/modules/atmospherics/machinery/portable/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,6 @@
ui = new(user, src, "Canister", name)
ui.open()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister.
if(client.next_canister_grief_warning < world.time)
var/turf/T = get_turf(src)
client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.touched_canister = TRUE

/obj/machinery/portable_atmospherics/canister/ui_static_data(mob/user)
return list(
"defaultReleasePressure" = round(CAN_DEFAULT_RELEASE_PRESSURE),
Expand Down
9 changes: 0 additions & 9 deletions code/modules/reagents/chemistry/machinery/chem_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,6 @@
ui = new(user, src, "ChemDispenser", name)
ui.open()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine.
if(client.next_chem_grief_warning < world.time)
if(!istype(src, /obj/machinery/chem_dispenser/drinks) && !istype(src, /obj/machinery/chem_dispenser/mutagen) && !istype(src, /obj/machinery/chem_dispenser/mutagensaltpeter) && !istype(src, /obj/machinery/chem_dispenser/abductor)) // These types aren't used for grief
var/turf/T = get_turf(src)
client.next_chem_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] used \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.used_chem_dispenser = TRUE

var/is_hallucinating = FALSE
if(isliving(user))
var/mob/living/living_user = user
Expand Down
8 changes: 0 additions & 8 deletions code/modules/wiremod/core/integrated_circuit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,6 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
ui.open()
ui.set_autoupdate(FALSE)

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine.
if(client.next_circuit_grief_warning < world.time)
var/turf/T = get_turf(src)
client.next_circuit_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.touched_circuit = TRUE

#define WITHIN_RANGE(id, table) (id >= 1 && id <= length(table))

/obj/item/integrated_circuit/ui_act(action, list/params, datum/tgui/ui)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, datum/tgui/ui)
. = ..()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister.
if(client.next_canister_grief_warning < world.time)
var/turf/T = get_turf(src)
client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.touched_canister = TRUE

/obj/machinery/portable_atmospherics/canister/goblin
name = "G-081-N canister"
gas_type = /datum/gas/goblin
Expand Down
17 changes: 17 additions & 0 deletions modular_zzplurt/code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/component/personal_crafting/ui_act(action, params)
. = ..()
if(.)
return

switch(action)
if("make", "make_mass")
var/datum/crafting_recipe/crafting_recipe = locate(params["recipe"]) in (mode ? GLOB.cooking_recipes : GLOB.crafting_recipes)

if (istype(crafting_recipe, /datum/crafting_recipe/improv_explosive) || istype(crafting_recipe, /datum/crafting_recipe/molotov) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload2))
var/client/client = usr.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is making an IED or molotov cocktail.
if(client.next_ied_grief_warning < world.time)
var/turf/T = get_turf(usr)
client.next_ied_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(usr)] has crafted an IED or Molotov at [ADMIN_VERBOSEJMP(T)].")
client.crafted_ied = TRUE
11 changes: 11 additions & 0 deletions modular_zzplurt/code/game/objects/items/devices/transfer_valve.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/obj/item/transfer_valve/attack_hand(mob/user, list/modifiers)
. = ..()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime has touched a bomb valve.
if(client.next_valve_grief_warning < world.time)
var/turf/T = get_turf(src)
client.next_valve_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] touched \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.touched_transfer_valve = TRUE

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/obj/machinery/chem_dispenser/ui_interact(mob/user, datum/tgui/ui)
. = ..()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine.
if(client.next_chem_grief_warning < world.time)
if(!istype(src, /obj/machinery/chem_dispenser/drinks) && !istype(src, /obj/machinery/chem_dispenser/mutagen) && !istype(src, /obj/machinery/chem_dispenser/mutagensaltpeter) && !istype(src, /obj/machinery/chem_dispenser/abductor)) // These types aren't used for grief
var/turf/T = get_turf(src)
client.next_chem_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] used \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.used_chem_dispenser = TRUE
10 changes: 10 additions & 0 deletions modular_zzplurt/code/modules/wiremod/core/integrated_circuit.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/obj/item/integrated_circuit/ui_interact(mob/user, datum/tgui/ui)
. = ..()

var/client/client = user.client
if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine.
if(client.next_circuit_grief_warning < world.time)
var/turf/T = get_turf(src)
client.next_circuit_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again
message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].")
client.touched_circuit = TRUE
4 changes: 4 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -9104,10 +9104,14 @@
#include "modular_zzplurt\code\_globalvars\mobs.dm"
#include "modular_zzplurt\code\controllers\configuration\entries\discord.dm"
#include "modular_zzplurt\code\controllers\subsystem\discord.dm"
#include "modular_zzplurt\code\datums\components\crafting\crafting.dm"
#include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm"
#include "modular_zzplurt\code\modules\admin\playtimes.dm"
#include "modular_zzplurt\code\modules\client\verbs\looc.dm"
#include "modular_zzplurt\code\modules\client\verbs\ooc.dm"
#include "modular_zzplurt\code\modules\discord\tgs_commands.dm"
#include "modular_zzplurt\code\modules\discord\verbs.dm"
#include "modular_zzplurt\code\modules\mob\dead\new_player\new_player.dm"
#include "modular_zzplurt\code\modules\reagents\chemistry\machinery\chem_dispenser.dm"
#include "modular_zzplurt\code\modules\wiremod\core\integrated_circuit.dm"
// END_INCLUDE

0 comments on commit 06af8da

Please sign in to comment.