From 33d4414a7fd889d31f485696b14b6847708b8bdb Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 26 Dec 2024 11:20:49 -0500
Subject: [PATCH] why did i do this to myself
---
code/__DEFINES/_cooldowns.dm | 5 +-
code/game/click/click.dm | 92 ++++---------------
code/game/click/items.dm | 4 +-
code/game/click/mobs.dm | 4 +-
code/game/click/observer.dm | 2 +-
code/game/click/other_mobs.dm | 2 +-
code/game/click/rig.dm | 2 +-
code/game/gamemodes/cult/construct_spells.dm | 2 +-
.../technomancer/assistance/golem.dm | 10 +-
.../game/gamemodes/technomancer/spell_objs.dm | 2 +-
.../gamemodes/technomancer/spells/control.dm | 2 +-
.../technomancer/spells/warp_strike.dm | 2 +-
code/game/machinery/camera/camera.dm | 4 +-
code/game/machinery/deployable.dm | 2 +-
code/game/machinery/doorbell_vr.dm | 2 +-
code/game/objects/items.dm | 2 +-
.../objects/items/devices/body_snatcher_vr.dm | 2 +-
code/game/objects/items/devices/flash.dm | 4 +-
code/game/objects/items/devices/flashlight.dm | 2 +-
.../game/objects/items/devices/scanners_vr.dm | 2 +-
code/game/objects/items/janitorial/soap.dm | 2 +-
.../types/transforming/energy/ionic_rapier.dm | 2 +-
code/game/objects/items/stacks/nanopaste.dm | 2 +-
code/game/objects/items/stacks/sandbag.dm | 2 +-
code/game/objects/items/toys.dm | 2 +-
.../objects/items/weapons/dna_injector.dm | 2 +-
code/game/objects/items/weapons/handcuffs.dm | 4 +-
.../items/weapons/implants/implanter.dm | 2 +-
code/game/objects/items/weapons/mop.dm | 6 +-
code/game/objects/items/weapons/trays.dm | 2 +-
code/game/objects/items/weapons/weaponry.dm | 2 +-
code/game/objects/structures/charge_pylon.dm | 2 +-
.../structures/crates_lockers/__closet.dm | 2 +-
.../crates_lockers/closets/fireaxe.dm | 2 +-
code/game/objects/structures/fireaxe.dm | 10 --
code/game/objects/structures/fitness.dm | 2 +-
.../objects/structures/props/puzzledoor.dm | 2 +-
code/game/objects/structures/simple_doors.dm | 2 +-
.../structures/stool_bed_chair_nest/stools.dm | 2 +-
code/game/objects/structures/watercloset.dm | 4 +-
code/game/objects/structures/window.dm | 2 +-
.../game/turfs/simulated/wall/wall_attacks.dm | 4 +-
code/game/turfs/turf.dm | 2 +-
code/game/verbs/character_directory.dm | 10 +-
code/modules/blob2/blobs/base_blob.dm | 2 +-
.../clothing/under/accessories/badges.dm | 4 +-
code/modules/food/food/snacks.dm | 4 +-
.../modules/food/machinery/appliance/fryer.dm | 2 +-
code/modules/food/machinery/appliance/oven.dm | 4 +-
.../spreading/spreading_response.dm | 2 +-
code/modules/hydroponics/trays/tray.dm | 2 +-
code/modules/library/book.dm | 2 +-
code/modules/materials/material_sheets.dm | 4 +-
code/modules/mob/grab.dm | 2 +-
code/modules/mob/living/carbon/human/human.dm | 2 +-
.../mob/living/carbon/human/human_resist.dm | 2 +-
.../living/carbon/human/traits/weaver_objs.dm | 2 +-
code/modules/mob/living/carbon/resist.dm | 2 +-
code/modules/mob/living/resist.dm | 2 +-
.../silicon/robot/dogborg/dog_modules_vr.dm | 10 +-
.../modules/mob/living/silicon/robot/robot.dm | 4 +-
code/modules/mob/living/simple_mob/combat.dm | 6 +-
.../modules/mob/living/simple_mob/on_click.dm | 4 +-
.../subtypes/animal/passive/mouse.dm | 2 +-
.../simple_mob/subtypes/mechanical/golem.dm | 8 +-
.../subtypes/mechanical/mecha/mecha.dm | 2 +-
.../living/simple_mob/subtypes/slime/slime.dm | 2 +-
code/modules/mob/mob.dm | 2 +-
code/modules/mob/pulling.dm | 2 +-
.../mob/verbs/horizontal_invert_self.dm | 4 +-
code/modules/organs/external/external.dm | 2 +-
code/modules/paperwork/pen.dm | 2 +-
code/modules/power/apc.dm | 2 +-
code/modules/power/lighting/lighting.dm | 2 +-
code/modules/projectiles/gun.dm | 5 +-
.../targeting/targeting_triggers.dm | 2 +-
code/modules/reagents/reagent_containers.dm | 4 +-
.../reagents/reagent_containers/hard_candy.dm | 4 +-
.../reagents/reagent_containers/hypospray.dm | 2 +-
.../reagents/reagent_containers/patch.dm | 2 +-
.../reagents/reagent_containers/pill.dm | 2 +-
.../reagents/reagent_containers/spray.dm | 2 +-
.../reagents/reagent_containers/syringes.dm | 2 +-
code/modules/resleeving/implant.dm | 2 +-
code/modules/resleeving/mirror.dm | 4 +-
code/modules/shieldgen/energy_field.dm | 4 +-
code/modules/shieldgen/energy_shield.dm | 2 +-
code/modules/vehicles/sealed/mecha/mecha.dm | 6 +-
code/modules/vehicles_legacy/vehicle.dm | 4 +-
code/modules/vore/eating/belly_obj_vr.dm | 2 +-
code/modules/vore/eating/living_vr.dm | 4 +-
code/modules/vore/fluffstuff/custom_items.dm | 2 +-
.../vore/weight/fitness_machines_vr.dm | 2 +-
93 files changed, 157 insertions(+), 215 deletions(-)
diff --git a/code/__DEFINES/_cooldowns.dm b/code/__DEFINES/_cooldowns.dm
index a066d0e543eb..c9e2f861da6c 100644
--- a/code/__DEFINES/_cooldowns.dm
+++ b/code/__DEFINES/_cooldowns.dm
@@ -92,4 +92,7 @@
#define CD_INTERNET_SOUND "internet_sound"
//* /mob
-#define CD_INDEX_MOB_VERB_INVERT_SELF "mob-verb-invert-self"
+#define TIMER_CD_INDEX_MOB_VERB_INVERT_SELF "mob-verb-invert_self"
+
+//* /client
+#define TIMER_CD_INDEX_CLIENT_CHARACTER_DIRECTORY "client-verb-character_directory"
diff --git a/code/game/click/click.dm b/code/game/click/click.dm
index 4b312b4aa001..f564c4a57c12 100644
--- a/code/game/click/click.dm
+++ b/code/game/click/click.dm
@@ -1,3 +1,8 @@
+/**
+ * Backend clickcode.
+ *
+ * * Things in this file are **not** part of the clickchain, instead being the machinery that initiates the clickchain.
+ */
/*
Before anything else, defer these calls to a per-mobtype handler. This allows us to
@@ -98,7 +103,7 @@
return M.click_action(A, src, params)
if(restrained())
- setClickCooldown(10)
+ setClickCooldownLegacy(10)
RestrainedClickOn(A)
return 1
@@ -147,7 +152,9 @@
trigger_aiming(TARGET_CAN_CLICK)
return
-/mob/proc/setClickCooldown(var/timeout)
+// todo: this is legacy because majority of calls to it are unaudited and unnecessary; new system
+// handles melee cooldown at clickcode level.
+/mob/proc/setClickCooldownLegacy(var/timeout)
next_move = max(world.time + timeout, next_move)
/mob/proc/canClick()
@@ -206,59 +213,28 @@
/mob/proc/RestrainedClickOn(var/atom/A)
return
-/*
- Middle click
- Only used for swapping hands
-*/
/mob/proc/MiddleClickOn(var/atom/A)
swap_hand()
- return
-
-// In case of use break glass
-/*
-/atom/proc/MiddleClick(var/mob/M as mob)
- return
-*/
-/*
- Shift middle click
- Used for pointing.
-*/
/mob/proc/ShiftMiddleClickOn(atom/A)
pointed(A)
- return
-/*
- Shift click
- For most mobs, examine.
- This is overridden in ai.dm
-*/
/mob/proc/ShiftClickOn(var/atom/A)
A.ShiftClick(src)
- return
/atom/proc/ShiftClick(var/mob/user)
if(user.client && user.allow_examine(src))
user.examinate(src)
-/*
- Ctrl click
- For most objects, pull
-*/
/mob/proc/CtrlClickOn(var/atom/A)
A.CtrlClick(src)
- return
+
/atom/proc/CtrlClick(var/mob/user)
- return
/atom/movable/CtrlClick(var/mob/user)
if(Adjacent(user))
user.start_pulling(src)
-/*
- Alt click
- Unused except for AI
-*/
/mob/proc/AltClickOn(atom/A)
if(!A.AltClick(src))
altclick_listed_turf(A)
@@ -286,10 +262,6 @@
/mob/proc/TurfAdjacent(var/turf/T)
return T.AdjacentQuick(src)
-/*
- Control+Shift click
- Unused except for AI
-*/
/mob/proc/CtrlShiftClickOn(var/atom/A)
A.CtrlShiftClick(src)
return
@@ -297,17 +269,11 @@
/atom/proc/CtrlShiftClick(var/mob/user)
return
-/*
- Misc helpers
-
- Laser Eyes: as the name implies, handles this since nothing else does currently
- face_atom: turns the mob towards what you clicked on
-*/
/mob/proc/LaserEyes(atom/A, params)
return
/mob/living/LaserEyes(atom/A, params)
- setClickCooldown(4)
+ setClickCooldownLegacy(4)
var/turf/T = get_turf(src)
var/obj/projectile/beam/LE = new (T)
@@ -326,7 +292,6 @@
else
to_chat(src, "You're out of energy! You need food!")
-
/// Simple helper to face what you clicked on, in case it should be needed in more than one place.
/mob/proc/face_atom(var/atom/atom_to_face)
if(buckled || stat != CONSCIOUS || !atom_to_face || !x || !y || !atom_to_face.x || !atom_to_face.y)
@@ -358,33 +323,14 @@
else
setDir(WEST)
-/atom/movable/screen/click_catcher
- name = ""
- icon = 'icons/mob/screen_gen.dmi'
- icon_state = "click_catcher"
- plane = CLICKCATCHER_PLANE
- mouse_opacity = MOUSE_OPACITY_OPAQUE
- screen_loc = "CENTER-7,CENTER-7"
-
-/atom/movable/screen/click_catcher/proc/MakeGreed()
- . = list()
- for(var/i = 0, i<15, i++)
- for(var/j = 0, j<15, j++)
- var/atom/movable/screen/click_catcher/CC = new()
- CC.screen_loc = "NORTH-[i],EAST-[j]"
- . += CC
-
-/atom/movable/screen/click_catcher/Click(location, control, params)
- var/list/modifiers = params2list(params)
- if(modifiers["middle"] && istype(usr, /mob/living/carbon))
- var/mob/living/carbon/C = usr
- C.swap_hand()
- else
- var/turf/T = screen_loc2turf(screen_loc, get_turf(usr))
- if(T)
- T.Click(location, control, params)
- . = 1
-
/// MouseWheelOn
/mob/proc/MouseWheelOn(atom/A, delta_x, delta_y, params)
SEND_SIGNAL(src, COMSIG_MOUSE_SCROLL_ON, A, delta_x, delta_y, params)
+
+//* Click Cooldown *//
+
+/**
+ * Prevents a mob from acting again until time has passed.
+ */
+/mob/proc/apply_click_cooldown(time)
+ next_move = max(world.time + time, next_move)
diff --git a/code/game/click/items.dm b/code/game/click/items.dm
index 0d2ba3ac97fd..c5ff539025c5 100644
--- a/code/game/click/items.dm
+++ b/code/game/click/items.dm
@@ -203,7 +203,7 @@
L.lastattacker = user
// click cooldown
// todo: clickcd rework
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
// animation
user.animate_swing_at_target(L)
// resolve accuracy
@@ -350,7 +350,7 @@
clickchain.melee_damage_multiplier *= mult
// click cooldown
// todo: clickcd rework
- clickchain.performer.setClickCooldown(clickchain.performer.get_attack_speed_legacy(src))
+ clickchain.performer.setClickCooldownLegacy(clickchain.performer.get_attack_speed_legacy(src))
// animation
clickchain.performer.animate_swing_at_target(target)
// perform the hit
diff --git a/code/game/click/mobs.dm b/code/game/click/mobs.dm
index f621fa9dcf25..583dc3b37f72 100644
--- a/code/game/click/mobs.dm
+++ b/code/game/click/mobs.dm
@@ -12,7 +12,7 @@
/mob/proc/melee_interaction_chain(atom/target, clickchain_flags, list/params)
// todo: refactor cooldown handling
if(ismob(target))
- setClickCooldown(get_attack_speed_legacy())
+ setClickCooldownLegacy(get_attack_speed_legacy())
UnarmedAttack(target, clickchain_flags & CLICKCHAIN_HAS_PROXIMITY)
/**
@@ -81,7 +81,7 @@
clickchain.performer.break_cloak()
// todo: clickcd rework
- clickchain.performer.setClickCooldown(clickchain.performer.get_attack_speed_legacy())
+ clickchain.performer.setClickCooldownLegacy(clickchain.performer.get_attack_speed_legacy())
// todo: animation might need to depend on if it hits
animate_swing_at_target(target)
diff --git a/code/game/click/observer.dm b/code/game/click/observer.dm
index dbd40e23aeed..bcc6bd43cf87 100644
--- a/code/game/click/observer.dm
+++ b/code/game/click/observer.dm
@@ -37,7 +37,7 @@
ShiftMiddleClickOn(A)
return
if(!canClick()) return
- setClickCooldown(4)
+ setClickCooldownLegacy(4)
// You are responsible for checking config_legacy.ghost_interaction when you override this function
// Not all of them require checking, see below
A.attack_ghost(src)
diff --git a/code/game/click/other_mobs.dm b/code/game/click/other_mobs.dm
index 7cac9d2ed22b..a576ca600878 100644
--- a/code/game/click/other_mobs.dm
+++ b/code/game/click/other_mobs.dm
@@ -140,7 +140,7 @@
if(!..())
return FALSE
- setClickCooldown(get_attack_speed_legacy())
+ setClickCooldownLegacy(get_attack_speed_legacy())
A.attack_generic(src,rand(5,6),"bitten")
/*
diff --git a/code/game/click/rig.dm b/code/game/click/rig.dm
index 22815eb73718..a82bcd8d6b5d 100644
--- a/code/game/click/rig.dm
+++ b/code/game/click/rig.dm
@@ -74,7 +74,7 @@
return 0
hardsuit.selected_module.engage(A, alert_ai)
if(ismob(A)) // No instant mob attacking - though modules have their own cooldowns
- setClickCooldown(get_attack_speed_legacy())
+ setClickCooldownLegacy(get_attack_speed_legacy())
return 1
return 0
diff --git a/code/game/gamemodes/cult/construct_spells.dm b/code/game/gamemodes/cult/construct_spells.dm
index aeeff476bc82..f5513891e959 100644
--- a/code/game/gamemodes/cult/construct_spells.dm
+++ b/code/game/gamemodes/cult/construct_spells.dm
@@ -495,7 +495,7 @@
on_ranged_cast(target, user)
if(cooldown)
var/effective_cooldown = round(cooldown, 5)
- user.setClickCooldown(effective_cooldown)
+ user.setClickCooldownLegacy(effective_cooldown)
flick("cooldown_[effective_cooldown]",src)
/obj/item/spell/construct/projectile //This makes me angry, but we need the template, and we can't use it because special check overrides on the base.
diff --git a/code/game/gamemodes/technomancer/assistance/golem.dm b/code/game/gamemodes/technomancer/assistance/golem.dm
index e9a6e932ce63..6b7668aa7e38 100644
--- a/code/game/gamemodes/technomancer/assistance/golem.dm
+++ b/code/game/gamemodes/technomancer/assistance/golem.dm
@@ -132,19 +132,19 @@
add_overlay(I)
/mob/living/simple_animal/technomancer_golem/proc/spellcast_pre_animation()
- setClickCooldown(5)
+ setClickCooldownLegacy(5)
manual_flick(spell_pre_attack_states, spell_image, reset_to = "golem_spell_attack_3")
/mob/living/simple_animal/technomancer_golem/proc/spellcast_post_animation()
- setClickCooldown(8)
+ setClickCooldownLegacy(8)
manual_flick(spell_post_attack_states, spell_image, reset_to = "golem_spell")
/mob/living/simple_animal/technomancer_golem/proc/sword_pre_animation()
- setClickCooldown(6)
+ setClickCooldownLegacy(6)
manual_flick(sword_pre_attack_states, sword_image)
/mob/living/simple_animal/technomancer_golem/proc/sword_post_animation()
- setClickCooldown(3)
+ setClickCooldownLegacy(3)
manual_flick(sword_post_attack_states, sword_image, reset_to = "golem_sword")
/mob/living/simple_animal/technomancer_golem/DoPunch(var/atom/A)
@@ -196,7 +196,7 @@
else if(active_spell.cast_methods & CAST_RANGED)
active_spell.on_ranged_cast(A, src)
spellcast_post_animation()
- src.setClickCooldown(effective_cooldown)
+ src.setClickCooldownLegacy(effective_cooldown)
else
..()
diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm
index 2e1b00e7822c..fc0e9264d650 100644
--- a/code/game/gamemodes/technomancer/spell_objs.dm
+++ b/code/game/gamemodes/technomancer/spell_objs.dm
@@ -248,7 +248,7 @@
on_ranged_cast(target, user)
if(cooldown)
var/effective_cooldown = round(cooldown * core.cooldown_modifier, 5)
- user.setClickCooldown(effective_cooldown)
+ user.setClickCooldownLegacy(effective_cooldown)
flick("cooldown_[effective_cooldown]",src)
// Proc: place_spell_in_hand()
diff --git a/code/game/gamemodes/technomancer/spells/control.dm b/code/game/gamemodes/technomancer/spells/control.dm
index 175e71b2768f..3537851b6dce 100644
--- a/code/game/gamemodes/technomancer/spells/control.dm
+++ b/code/game/gamemodes/technomancer/spells/control.dm
@@ -130,7 +130,7 @@
log_and_message_admins("has commanded their army of [controlled_mobs.len] to attack [L].")
to_chat(user, "You command your [controlled_mobs.len > 1 ? "entities" : "[controlled_mobs[1]]"] to attack \the [L].")
//This is to stop someone from controlling beepsky and getting him to stun someone 5 times a second.
- user.setClickCooldown(8)
+ user.setClickCooldownLegacy(8)
adjust_instability(controlled_mobs.len)
else if(isturf(hit_atom))
diff --git a/code/game/gamemodes/technomancer/spells/warp_strike.dm b/code/game/gamemodes/technomancer/spells/warp_strike.dm
index 804f1378b5f1..ec9ddc8e9868 100644
--- a/code/game/gamemodes/technomancer/spells/warp_strike.dm
+++ b/code/game/gamemodes/technomancer/spells/warp_strike.dm
@@ -26,7 +26,7 @@
if(!within_range(T))
return
//First, we handle who to teleport to.
- user.setClickCooldown(5)
+ user.setClickCooldownLegacy(5)
var/mob/living/chosen_target = targeting_assist(T,5) //The person who's about to get attacked.
if(!chosen_target)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index fe35778ef830..82f4ebfb86c1 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -118,7 +118,7 @@ CREATE_WALL_MOUNTING_TYPES(/obj/machinery/camera)
if(L.species.can_shred(L))
set_status(0)
L.do_attack_animation(src)
- L.setClickCooldown(L.get_attack_speed_legacy())
+ L.setClickCooldownLegacy(L.get_attack_speed_legacy())
visible_message("\The [L] slashes at [src]!")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
add_hiddenprint(L)
@@ -129,7 +129,7 @@ CREATE_WALL_MOUNTING_TYPES(/obj/machinery/camera)
var/mob/living/simple_mob/S = user
set_status(0)
S.do_attack_animation(src)
- S.setClickCooldown(user.get_attack_speed_legacy())
+ S.setClickCooldownLegacy(user.get_attack_speed_legacy())
visible_message("\The [user] [pick(S.attacktext)] \the [src]!")
playsound(src.loc, S.attack_sound, 100, 1)
add_hiddenprint(user)
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 7d705590927a..d42fa39d010e 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -29,7 +29,7 @@
/obj/machinery/deployable/barrier/attackby(obj/item/I, mob/living/user, list/params, clickchain_flags, damage_multiplier)
if(user.a_intent == INTENT_HARM)
return ..()
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
if(istype(I, /obj/item/card/id/))
if(allowed(user))
if (emagged < 2)
diff --git a/code/game/machinery/doorbell_vr.dm b/code/game/machinery/doorbell_vr.dm
index c2bd4e3c45ed..3c72a797ca8f 100644
--- a/code/game/machinery/doorbell_vr.dm
+++ b/code/game/machinery/doorbell_vr.dm
@@ -112,7 +112,7 @@
icon_state = "doorbell-standby"
/obj/machinery/button/doorbell/attack_hand(mob/user, datum/event_args/actor/clickchain/e_args)
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
if(..())
return
use_power(5)
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index c7f520aaa079..b4c02579662e 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -488,7 +488,7 @@
add_attack_logs(user,M,"Attack eyes with [name]")
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
user.do_attack_animation(M)
src.add_fingerprint(user)
diff --git a/code/game/objects/items/devices/body_snatcher_vr.dm b/code/game/objects/items/devices/body_snatcher_vr.dm
index 73844bc2a9f3..b09c6ebd798a 100644
--- a/code/game/objects/items/devices/body_snatcher_vr.dm
+++ b/code/game/objects/items/devices/body_snatcher_vr.dm
@@ -18,7 +18,7 @@
/obj/item/bodysnatcher/proc/attempt_swap(mob/living/M, mob/living/user)
if(!isliving(M) || !isliving(user))
return
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
if(ishuman(M) || issilicon(M)) //Allows body swapping with humans, synths, and pAI's/borgs since they all have a mind.
if(user == M)
to_chat(user," A message pops up on the LED display, informing you that you that the mind transfer to yourself was successful... Wait, did that even do anything?")
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 1756fd2c731c..6ee471782654 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -162,7 +162,7 @@
add_attack_logs(user,M,"Flashed (attempt) with [src]")
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
user.do_attack_animation(M)
if(!clown_check(user))
@@ -247,7 +247,7 @@
if(!user || !clown_check(user))
return
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(broken)
user.show_message("The [src.name] is broken", 2)
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index 83b9cc8785fb..e102ee811017 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -184,7 +184,7 @@
else
to_chat(user, SPAN_NOTICE("\The [L]'s pupils narrow."))
- user.setClickCooldown(user.get_attack_speed_legacy(src)) //can be used offensively
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src)) //can be used offensively
L.flash_eyes()
return CLICKCHAIN_DO_NOT_PROPAGATE
return ..()
diff --git a/code/game/objects/items/devices/scanners_vr.dm b/code/game/objects/items/devices/scanners_vr.dm
index 30e29279ffac..d27925587f57 100644
--- a/code/game/objects/items/devices/scanners_vr.dm
+++ b/code/game/objects/items/devices/scanners_vr.dm
@@ -116,7 +116,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
to_chat(user,output)
/obj/item/sleevemate/Topic(href, href_list)
- usr.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ usr.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
//Sanity checking/href-hacking checking
if(usr.get_active_held_item() != src)
diff --git a/code/game/objects/items/janitorial/soap.dm b/code/game/objects/items/janitorial/soap.dm
index 3f71ef89c694..35e2114b3236 100644
--- a/code/game/objects/items/janitorial/soap.dm
+++ b/code/game/objects/items/janitorial/soap.dm
@@ -50,7 +50,7 @@
if(target && user && ishuman(target) && ishuman(user) && !user.incapacitated() && user.zone_sel &&user.zone_sel.selecting == "mouth" )
user.visible_message("\The [user] washes \the [target]'s mouth out with soap!")
playsound(src.loc, 'sound/items/soapmouth.ogg', 50, 1)
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //prevent spam
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN) //prevent spam
return CLICKCHAIN_DO_NOT_PROPAGATE
return ..()
diff --git a/code/game/objects/items/melee/types/transforming/energy/ionic_rapier.dm b/code/game/objects/items/melee/types/transforming/energy/ionic_rapier.dm
index fab8543d67e6..b2706b81ba3e 100644
--- a/code/game/objects/items/melee/types/transforming/energy/ionic_rapier.dm
+++ b/code/game/objects/items/melee/types/transforming/energy/ionic_rapier.dm
@@ -26,7 +26,7 @@
var/obj/O = target
O.emp_act(3) // A weaker severity is used because this has infinite uses.
playsound(get_turf(O), 'sound/effects/EMPulse.ogg', 100, 1)
- user.setClickCooldown(user.get_attack_speed_legacy(src)) // A lot of objects don't set click delay.
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src)) // A lot of objects don't set click delay.
return ..()
/obj/item/melee/transforming/energy/sword/ionic_rapier/melee_mob_hit(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent)
diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm
index 9c1ed3974abf..316266b59fe3 100644
--- a/code/game/objects/items/stacks/nanopaste.dm
+++ b/code/game/objects/items/stacks/nanopaste.dm
@@ -40,7 +40,7 @@
if(!S.get_damage())
to_chat(user, "Nothing to fix here.")
else if(can_use(1))
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(S.open >= 2)
if(do_after(user,5 * tool_speed))
S.heal_damage(restoration_internal, restoration_internal, robo_repair = 1)
diff --git a/code/game/objects/items/stacks/sandbag.dm b/code/game/objects/items/stacks/sandbag.dm
index 740f4adce4a3..63a1036315f1 100644
--- a/code/game/objects/items/stacks/sandbag.dm
+++ b/code/game/objects/items/stacks/sandbag.dm
@@ -136,7 +136,7 @@
. = ..()
/obj/structure/sandbag/attackby(obj/item/W as obj, mob/user as mob)
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
if(istype(W, /obj/item/stack/sandbags))
var/obj/item/stack/sandbags/S = W
if(integrity < integrity_max)
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 069da682a19a..ae327bb849fe 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -915,7 +915,7 @@
var/phrase = "I don't want to exist anymore!"
/obj/structure/plushie/attack_hand(mob/user, datum/event_args/actor/clickchain/e_args)
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
if(user.a_intent == INTENT_HELP)
user.visible_message("\The [user] hugs [src]!","You hug [src]!")
else if (user.a_intent == INTENT_HARM)
diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm
index 14dfd71099db..ae4947e2cd1f 100644
--- a/code/game/objects/items/weapons/dna_injector.dm
+++ b/code/game/objects/items/weapons/dna_injector.dm
@@ -115,7 +115,7 @@
if(!do_after(user,50))
return
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(target)
target.visible_message("\The [target] has been injected with \the [src] by \the [user].")
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 4516b0c75575..2e2e5cfece9f 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -87,7 +87,7 @@
add_attack_logs(user,H,"Handcuffed (attempt)")
feedback_add_details("handcuffs","H")
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
user.do_attack_animation(H)
user.visible_message("\The [user] has put [cuff_type] on \the [H]!")
@@ -283,7 +283,7 @@ var/last_chew = 0
add_attack_logs(user,H,"Legcuffed (attempt)")
feedback_add_details("legcuffs","H")
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
user.do_attack_animation(H)
user.visible_message("\The [user] has put [cuff_type] on \the [H]!")
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index 4dd711d93aa2..addc2826e398 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -49,7 +49,7 @@
if (imp)
target.visible_message("[user] is attempting to implant [target].")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(target)
var/turf/T1 = get_turf(target)
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index c1bac109bf6a..506fe582bc7b 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -51,7 +51,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
user.do_attack_animation(T)
if (mopmode == MOPMODE_TILE)
//user.visible_message(SPAN_WARNING("[user] begins to clean \the [T]."))
- user.setClickCooldown(3)
+ user.setClickCooldownLegacy(3)
if(do_after(user, mopspeed, T))
if(T)
T.clean(src, user)
@@ -65,7 +65,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
// TO DO : MAKE SWEEPING WORK
/obj/item/mop/proc/sweep(var/mob/user, var/turf/target)
- user.setClickCooldown(sweep_time)
+ user.setClickCooldownLegacy(sweep_time)
var/direction = get_dir(get_turf(src),target)
var/list/turfs
if (direction in GLOB.cardinal)
@@ -113,7 +113,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
else if (user)
//You hit a wall!
- user.setClickCooldown(2)
+ user.setClickCooldownLegacy(2)
user.afflict_stun(20 * 2)
shake_camera(user, 1, 1)
playsound(T,"thud", 20, 1, -3)
diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm
index 921ffe215fcd..ac59931bbb49 100644
--- a/code/game/objects/items/weapons/trays.dm
+++ b/code/game/objects/items/weapons/trays.dm
@@ -21,7 +21,7 @@
return
var/mob/living/L = user
var/mob/living/victim = target
- L.setClickCooldown(L.get_attack_speed_legacy(src))
+ L.setClickCooldownLegacy(L.get_attack_speed_legacy(src))
// Drop all the things. All of them.
cut_overlays()
for(var/obj/item/I in carrying)
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 32b7b870cd18..a5278fc12492 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -81,7 +81,7 @@
. = ..()
if(!.)
return
- M.setClickCooldown(M.get_attack_speed_legacy())
+ M.setClickCooldownLegacy(M.get_attack_speed_legacy())
visible_message("[M] begins to tear at \the [src]!")
if(!do_after(M, escape_time, src, mobility_flags = MOBILITY_CAN_RESIST))
return FALSE
diff --git a/code/game/objects/structures/charge_pylon.dm b/code/game/objects/structures/charge_pylon.dm
index d195e7e6db05..84607be3dd80 100644
--- a/code/game/objects/structures/charge_pylon.dm
+++ b/code/game/objects/structures/charge_pylon.dm
@@ -26,7 +26,7 @@
next_use = world.time + 10
var/mob/living/carbon/human/H = user
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
user.visible_message("There is a loud crack and the smell of ozone as \the [user] touches \the [src].")
playsound(loc, 'sound/effects/snap.ogg', 50, 1)
diff --git a/code/game/objects/structures/crates_lockers/__closet.dm b/code/game/objects/structures/crates_lockers/__closet.dm
index 7cad5fa08288..bfef5a87c725 100644
--- a/code/game/objects/structures/crates_lockers/__closet.dm
+++ b/code/game/objects/structures/crates_lockers/__closet.dm
@@ -497,7 +497,7 @@
open()
return
- escapee.setClickCooldown(100)
+ escapee.setClickCooldownLegacy(100)
//okay, so the closet is either sealed or locked... resist!!!
to_chat(escapee, "You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)")
diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
index b58927665393..63db032979d7 100644
--- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
+++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
@@ -22,7 +22,7 @@
// This could stand to be put further in, made better, etc. but fuck you. Fuck whoever
// wrote this code. Fuck everything about this object. I hope you step on a Lego.
- user.setClickCooldown(10)
+ user.setClickCooldownLegacy(10)
// Seriously why the fuck is this even a closet aghasjdhasd I hate you
var/hasaxe = 0 //gonna come in handy later~ // FUCK YOUR TILDES.
diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm
index 994b2e183976..bbf9c2f35154 100644
--- a/code/game/objects/structures/fireaxe.dm
+++ b/code/game/objects/structures/fireaxe.dm
@@ -18,16 +18,6 @@
fireaxe = new /obj/item/material/twohanded/fireaxe()
/obj/structure/fireaxecabinet/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
- //..() //That's very useful, Erro
-
- // This could stand to be put further in, made better, etc. but fuck you. Fuck whoever
- // wrote this code. Fuck everything about this object. I hope you step on a Lego.
- user.setClickCooldown(10)
- // Seriously why the fuck is this even a closet aghasjdhasd I hate you
-
- //var/hasaxe = 0 //gonna come in handy later~ // FUCK YOUR TILDES.
- //if(fireaxe)
- // hasaxe = 1
if (isrobot(user) || locked)
if(istype(O, /obj/item/multitool))
diff --git a/code/game/objects/structures/fitness.dm b/code/game/objects/structures/fitness.dm
index bc758efd0200..664fdee89f43 100644
--- a/code/game/objects/structures/fitness.dm
+++ b/code/game/objects/structures/fitness.dm
@@ -18,7 +18,7 @@
to_chat(user, "You need more energy to use the punching bag. Go eat something.")
else
if(user.a_intent == INTENT_HARM)
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
flick("[icon_state]_hit", src)
playsound(src.loc, 'sound/effects/woodhit.ogg', 25, 1, -1)
user.do_attack_animation(src)
diff --git a/code/game/objects/structures/props/puzzledoor.dm b/code/game/objects/structures/props/puzzledoor.dm
index fec56f260832..e36436b31be6 100644
--- a/code/game/objects/structures/props/puzzledoor.dm
+++ b/code/game/objects/structures/props/puzzledoor.dm
@@ -76,7 +76,7 @@
else if(src.density && (user.a_intent == INTENT_HARM))
var/obj/item/W = C
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
if(W.damage_type == DAMAGE_TYPE_BRUTE || W.damage_type == DAMAGE_TYPE_BURN)
user.do_attack_animation(src)
user.visible_message("\The [user] hits \the [src] with \the [W] with no visible effect.")
diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm
index 09824f2a6936..acd3088d8361 100644
--- a/code/game/objects/structures/simple_doors.dm
+++ b/code/game/objects/structures/simple_doors.dm
@@ -131,7 +131,7 @@
if(user.a_intent == INTENT_HARM)
return ..()
if(istype(W,/obj/item/pickaxe))
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
var/datum/prototype/material/material = get_primary_material()
var/obj/item/pickaxe/digTool = W
visible_message("[user] starts digging [src]!")
diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
index 67b9b20dfecf..3689d9ab3c63 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
@@ -105,7 +105,7 @@ var/global/list/stool_cache = list() //haha stool
var/mob/living/L = user
if (prob(5) && istype(L) && istype(target, /mob/living))
L.visible_message("[L] breaks [src] over [target]'s back!")
- L.setClickCooldown(L.get_attack_speed_legacy())
+ L.setClickCooldownLegacy(L.get_attack_speed_legacy())
L.do_attack_animation(target)
L.drop_item_to_ground(src, INV_OP_FORCE)
dismantle()
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index c43229f3730a..4be30f93c165 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -19,7 +19,7 @@
/obj/structure/toilet/attack_hand(mob/user, datum/event_args/actor/clickchain/e_args)
if(swirlie)
- usr.setClickCooldown(user.get_attack_speed_legacy())
+ usr.setClickCooldownLegacy(user.get_attack_speed_legacy())
usr.visible_message("[user] slams the toilet seat onto [swirlie.name]'s head!", "You slam the toilet seat onto [swirlie.name]'s head!", "You hear reverberating porcelain.")
swirlie.adjustBruteLoss(5)
return
@@ -57,7 +57,7 @@
if(istype(I, /obj/item/grab))
. = CLICKCHAIN_DO_NOT_PROPAGATE
- user.setClickCooldown(user.get_attack_speed_legacy(I))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(I))
var/obj/item/grab/G = I
if(isliving(G.affecting))
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index dc2d53ce5e4e..4861a1c7f03c 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -211,7 +211,7 @@
if(user.a_intent == INTENT_HARM)
return ..()
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
playsound(loc, 'sound/effects/glassknock.ogg', 80, TRUE)
user.visible_message(
diff --git a/code/game/turfs/simulated/wall/wall_attacks.dm b/code/game/turfs/simulated/wall/wall_attacks.dm
index fc5af3c9e87f..1ef49a466c56 100644
--- a/code/game/turfs/simulated/wall/wall_attacks.dm
+++ b/code/game/turfs/simulated/wall/wall_attacks.dm
@@ -79,7 +79,7 @@
if(.)
return
add_fingerprint(user)
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
var/rotting = (locate(/obj/effect/overlay/wallrot) in src)
if(iscarbon(user))
var/mob/living/carbon/M = user
@@ -95,7 +95,7 @@
try_touch(user, rotting)
/turf/simulated/wall/attackby(obj/item/I, mob/user, list/params, clickchain_flags, damage_multiplier)
- user.setClickCooldown(user.get_attack_speed_legacy(I))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(I))
if(I)
if(is_hot(I))
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 6b85cd9106ee..5585e9662d58 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -322,7 +322,7 @@
var/mob/living/victim = pick(viable_targets)
success = W.resolve_attackby(victim, user)
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
user.do_attack_animation(src, no_attack_icons = TRUE)
if(!success) // Nothing got hit.
diff --git a/code/game/verbs/character_directory.dm b/code/game/verbs/character_directory.dm
index 3bda5b602a29..748f3849007a 100644
--- a/code/game/verbs/character_directory.dm
+++ b/code/game/verbs/character_directory.dm
@@ -1,15 +1,17 @@
GLOBAL_DATUM(character_directory, /datum/character_directory)
+// todo: DECLARE_CLIENT_VERB, DECLARE_MOB_VERB, why don't we just have all verbs with
+// feedback hooks and cooldown hooks at this point lmao
/client/verb/show_character_directory()
set name = "Character Directory"
set category = VERB_CATEGORY_OOC
set desc = "Shows a listing of all active characters, along with their associated OOC notes, flavor text, and more."
- // This is primarily to stop malicious users from trying to lag the server by spamming this verb
- if(world.time < usr.next_move)
- to_chat(usr, "Don't spam character directory refresh.")
+ // todo: generic verb throttling system
+ if(TIMER_COOLDOWN_CHECK(src, TIMER_CD_INDEX_CLIENT_CHARACTER_DIRECTORY))
+ to_chat(src, "Don't spam character directory refresh.")
return
- usr.setClickCooldown(10)
+ TIMER_COOLDOWN_START(src, TIMER_CD_INDEX_CLIENT_CHARACTER_DIRECTORY, 2 SECONDS)
if(!GLOB.character_directory)
GLOB.character_directory = new
diff --git a/code/modules/blob2/blobs/base_blob.dm b/code/modules/blob2/blobs/base_blob.dm
index 505d6c155dab..bf70b6def669 100644
--- a/code/modules/blob2/blobs/base_blob.dm
+++ b/code/modules/blob2/blobs/base_blob.dm
@@ -222,7 +222,7 @@ var/list/blobs = list()
return B
/obj/structure/blob/attackby(var/obj/item/W, var/mob/user)
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
playsound(loc, 'sound/effects/attackblob.ogg', 50, 1)
visible_message("\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = W.damage_force
diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm
index acb4b4120171..59cdd4ffff2c 100644
--- a/code/modules/clothing/under/accessories/badges.dm
+++ b/code/modules/clothing/under/accessories/badges.dm
@@ -47,7 +47,7 @@
/obj/item/clothing/accessory/badge/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent)
user.visible_message("[user] invades [target]'s personal space, thrusting [src] into their face insistently.","You invade [target]'s personal space, thrusting [src] into their face insistently.")
user.do_attack_animation(target)
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN) //to prevent spam
// Sheriff Badge (toy)
/obj/item/clothing/accessory/badge/sheriff
@@ -66,7 +66,7 @@
/obj/item/clothing/accessory/badge/sheriff/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent)
user.visible_message("[user] invades [target]'s personal space, shoving the sheriff badge into their face!.","You invade [target]'s personal space, thrusting the sheriff badge into their face insistently.")
user.do_attack_animation(target)
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN) //to prevent spam
//.Holobadges.
/obj/item/clothing/accessory/badge/holo
diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm
index 417100110b56..5af7c07a1ef4 100644
--- a/code/modules/food/food/snacks.dm
+++ b/code/modules/food/food/snacks.dm
@@ -103,7 +103,7 @@
to_chat(user, "\The [blocked] is in the way!")
return
- user.setClickCooldown(user.get_attack_speed_legacy(src)) //puts a limit on how fast people can eat/drink things
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src)) //puts a limit on how fast people can eat/drink things
if (fullness <= 100)
to_chat(M, "You hungrily chew out a piece of [src] and gobble it!")
if (fullness > 100 && fullness <= 300)
@@ -141,7 +141,7 @@
return
user.visible_message(SPAN_DANGER("[user] attempts to feed [M] [src]."))
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(!do_mob(user, M, 3 SECONDS))
return
//Do we really care about this
diff --git a/code/modules/food/machinery/appliance/fryer.dm b/code/modules/food/machinery/appliance/fryer.dm
index 03ee80157ae5..057a2ad032f1 100644
--- a/code/modules/food/machinery/appliance/fryer.dm
+++ b/code/modules/food/machinery/appliance/fryer.dm
@@ -151,7 +151,7 @@
//If you can lure someone close to the fryer and grab them then you deserve success.
//And a delay on this kind of niche action just ensures it never happens
//Cooldown ensures it can't be spammed to instakill someone
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*3)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN*3)
if(!victim || !victim.Adjacent(user))
to_chat(user, "Your victim slipped free!")
diff --git a/code/modules/food/machinery/appliance/oven.dm b/code/modules/food/machinery/appliance/oven.dm
index a3c6c42084ca..0993b5568e72 100644
--- a/code/modules/food/machinery/appliance/oven.dm
+++ b/code/modules/food/machinery/appliance/oven.dm
@@ -96,11 +96,11 @@
/obj/machinery/appliance/cooker/oven/AltClick(var/mob/user)
try_toggle_door(user)
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
/obj/machinery/appliance/cooker/oven/CtrlClick(var/mob/user)
choose_output()
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
/obj/machinery/appliance/cooker/oven/verb/toggle_door()
set src in oview(1)
diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm
index e577016aadf3..5fefe074ef15 100644
--- a/code/modules/hydroponics/spreading/spreading_response.dm
+++ b/code/modules/hydroponics/spreading/spreading_response.dm
@@ -93,7 +93,7 @@
"You hear shredding and ripping.")
unbuckle()
else
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
var/text = pick("rip","tear","pull", "bite", "tug")
user.visible_message(\
"\The [user] [text]s at \the [src].",\
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index f4c24e5af834..49664f947891 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -562,7 +562,7 @@
return
else if(O.damage_force && seed)
- user.setClickCooldown(user.get_attack_speed_legacy(O))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(O))
user.visible_message("\The [seed.display_name] has been attacked by [user] with \the [O]!")
if(!dead)
health -= O.damage_force
diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm
index 99fe01544338..b7905f09ad01 100644
--- a/code/modules/library/book.dm
+++ b/code/modules/library/book.dm
@@ -133,7 +133,7 @@
user.visible_message("You open up the book and show it to [target]. ", \
" [user] opens up a book and shows it to [target]. ")
target << browse("Penned by [author].
" + "[dat]", "window=book")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN) //to prevent spam
/*
* Book Bundle (Multi-page book)
diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm
index 8fea3c15a165..42a1df0930bf 100644
--- a/code/modules/materials/material_sheets.dm
+++ b/code/modules/materials/material_sheets.dm
@@ -413,7 +413,7 @@
return ..()
if(CHECK_MULTIPLE_BITFIELDS(I.damage_mode, DAMAGE_MODE_EDGE | DAMAGE_MODE_SHARP))
var/time = (3 SECONDS / max(I.damage_force / 10, 1)) * I.tool_speed
- user.setClickCooldown(time)
+ user.setClickCooldownLegacy(time)
if(do_after(user, time, src) && use(1))
to_chat(user, "You cut up a log into planks.")
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
@@ -444,7 +444,7 @@
return ..()
if(CHECK_MULTIPLE_BITFIELDS(I.damage_mode, DAMAGE_MODE_EDGE | DAMAGE_MODE_SHARP))
var/time = (3 SECONDS / max(I.damage_force / 10, 1)) * I.tool_speed
- user.setClickCooldown(time)
+ user.setClickCooldownLegacy(time)
if(do_after(user, time, src) && use(1))
to_chat(user, "You cut up a log into planks.")
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
diff --git a/code/modules/mob/grab.dm b/code/modules/mob/grab.dm
index 0ceb80369444..d28323e129ed 100644
--- a/code/modules/mob/grab.dm
+++ b/code/modules/mob/grab.dm
@@ -381,7 +381,7 @@
state = GRAB_KILL
assailant.visible_message("[assailant] has tightened [TU.his] grip on [affecting]'s neck!")
add_attack_logs(assailant,affecting,"Strangled")
- affecting.setClickCooldown(10)
+ affecting.setClickCooldownLegacy(10)
affecting.AdjustLosebreath(1)
affecting.setDir(WEST)
adjust_position()
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index d471f5eaf9a2..3139206e5538 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -1427,7 +1427,7 @@
if(!isliving(usr) || !usr.canClick())
return
- usr.setClickCooldown(20)
+ usr.setClickCooldownLegacy(20)
if(usr.stat > 0)
to_chat(usr, "You are unconcious and cannot do that!")
diff --git a/code/modules/mob/living/carbon/human/human_resist.dm b/code/modules/mob/living/carbon/human/human_resist.dm
index c5e3fdb1542f..75ccb36dfe5c 100644
--- a/code/modules/mob/living/carbon/human/human_resist.dm
+++ b/code/modules/mob/living/carbon/human/human_resist.dm
@@ -8,7 +8,7 @@
#define RESIST_ATTACK_BITE 2
/mob/living/carbon/human/proc/escape_straight_jacket()
- setClickCooldown(100)
+ setClickCooldownLegacy(100)
if(can_break_straight_jacket())
break_straight_jacket()
diff --git a/code/modules/mob/living/carbon/human/traits/weaver_objs.dm b/code/modules/mob/living/carbon/human/traits/weaver_objs.dm
index 481460d7658d..534ccd8b2af8 100644
--- a/code/modules/mob/living/carbon/human/traits/weaver_objs.dm
+++ b/code/modules/mob/living/carbon/human/traits/weaver_objs.dm
@@ -16,7 +16,7 @@ var/global/list/weavable_items = list()
return
/obj/effect/weaversilk/attackby(var/obj/item/W, var/mob/user)
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
if(W.damage_force)
visible_message("\The [src] has been [W.get_attack_verb(src, user)] with \the [W][(user ? " by [user]." : ".")]")
diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm
index 44664c21941f..3b5e38bf8360 100644
--- a/code/modules/mob/living/carbon/resist.dm
+++ b/code/modules/mob/living/carbon/resist.dm
@@ -25,7 +25,7 @@
I = legcuffed
if(I)
- setClickCooldown(100)
+ setClickCooldownLegacy(100)
INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living/carbon, cuff_resist), I, cuff_break = can_break_cuffs())
return TRUE
diff --git a/code/modules/mob/living/resist.dm b/code/modules/mob/living/resist.dm
index 80177bf2a5ac..1280e550b6dd 100644
--- a/code/modules/mob/living/resist.dm
+++ b/code/modules/mob/living/resist.dm
@@ -7,7 +7,7 @@
// this means execute both and get as boolean
// this is done so resist doesn't always invoke clickcd
if(resist_grab() | process_resist())
- setClickCooldown(20)
+ setClickCooldownLegacy(20)
// todo: refactor
// todo: resist doing normal clickcd is kinda weird
diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm
index 07f1d3ef29eb..d19765c378ac 100644
--- a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm
+++ b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm
@@ -72,7 +72,7 @@
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
user.visible_message("[user] sniffs the air.", "You sniff the air...")
to_chat(user, "Smells like:")
@@ -93,7 +93,7 @@
if(!istype(target) && !ismob(target))
return
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
if(ismob(target))
@@ -208,7 +208,7 @@
if(!(clickchain_flags & CLICKCHAIN_HAS_PROXIMITY))
return
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
if(user.client && (target in user.client.screen))
to_chat(user, "You need to take [target] off before cleaning it!")
if(istype(target, /obj/structure/sink) || istype(target, /obj/structure/toilet)) //Dog vibes.
@@ -463,7 +463,7 @@
for(var/obj/item/implant/mirror/MI in I.contents)
if(imp == null)
H.visible_message("[user] is attempting remove [H]'s mirror!")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(H)
var/turf/T1 = get_turf(H)
if (T1 && ((H == user) || do_after(user, 20)))
@@ -475,7 +475,7 @@
else if (target_zone == BP_TORSO && imp != null)
if (imp)
H.visible_message("[user] is attempting to implant [H] with a mirror.")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(H)
var/turf/T1 = get_turf(H)
if (T1 && ((H == user) || do_after(user, 20)))
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 37cf1b6eba90..d7714df7bcaa 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -599,7 +599,7 @@
return
var/obj/item/weldingtool/WT = W
if (WT.remove_fuel(0))
- user.setClickCooldown(user.get_attack_speed_legacy(WT))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(WT))
adjustBruteLoss(-30)
update_health()
add_fingerprint(user)
@@ -615,7 +615,7 @@
return
var/obj/item/stack/cable_coil/coil = W
if (coil.use(1))
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
adjustFireLoss(-30)
update_health()
for(var/mob/O in viewers(user, null))
diff --git a/code/modules/mob/living/simple_mob/combat.dm b/code/modules/mob/living/simple_mob/combat.dm
index a3c17616ed03..d306ca3670b6 100644
--- a/code/modules/mob/living/simple_mob/combat.dm
+++ b/code/modules/mob/living/simple_mob/combat.dm
@@ -16,7 +16,7 @@
handle_attack_delay(target, melee_attack_delay) // This will sleep this proc for a bit, which is why waitfor is false.
// Cooldown testing is done at click code (for players) and interface code (for AI).
- setClickCooldown(get_attack_speed_legacy())
+ setClickCooldownLegacy(get_attack_speed_legacy())
var/result = do_attack(target, their_T)
@@ -101,7 +101,7 @@
//The actual top-level ranged attack proc
/mob/living/simple_mob/proc/shoot_target(atom/A)
set waitfor = FALSE
- setClickCooldown(get_attack_speed_legacy())
+ setClickCooldownLegacy(get_attack_speed_legacy())
face_atom(A)
@@ -249,7 +249,7 @@
if(!isnull(M.attack_speed_percent))
true_attack_delay *= M.attack_speed_percent
- setClickCooldown(true_attack_delay) // Insurance against a really long attack being longer than default click delay.
+ setClickCooldownLegacy(true_attack_delay) // Insurance against a really long attack being longer than default click delay.
sleep(true_attack_delay)
diff --git a/code/modules/mob/living/simple_mob/on_click.dm b/code/modules/mob/living/simple_mob/on_click.dm
index 5cc9a755cd3e..16575a089071 100644
--- a/code/modules/mob/living/simple_mob/on_click.dm
+++ b/code/modules/mob/living/simple_mob/on_click.dm
@@ -5,7 +5,7 @@
if(!(. = ..()))
return
-// setClickCooldown(get_attack_speed_legacy())
+// setClickCooldownLegacy(get_attack_speed_legacy())
if(has_hands() && istype(A,/obj) && a_intent != INTENT_HARM)
var/obj/O = A
@@ -39,7 +39,7 @@
attack_target(A)
/mob/living/simple_mob/RangedAttack(var/atom/A)
-// setClickCooldown(get_attack_speed_legacy())
+// setClickCooldownLegacy(get_attack_speed_legacy())
if(can_special_attack(A) && special_attack_target(A))
return
diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm
index 5c95d271c8c6..0bf369b873ca 100644
--- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm
@@ -160,5 +160,5 @@
return
for(var/mob/living/simple_mob/M in src.contents)
if((INTENT_HELP) && user.canClick()) //a little snowflakey, but makes it use the same cooldown as interacting with non-inventory objects
- user.setClickCooldown(user.get_attack_speed_legacy()) //if there's a cleaner way in baycode, I'll change this
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy()) //if there's a cleaner way in baycode, I'll change this
user.visible_message("[user] [M.response_help] \the [M].")
diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/golem.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/golem.dm
index d13630487081..646d73843d72 100644
--- a/code/modules/mob/living/simple_mob/subtypes/mechanical/golem.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/golem.dm
@@ -131,7 +131,7 @@
flick("golem_pre_melee", src) // To force the animation to restart.
icon_living = "golem_pre_melee" // The animation will hold after this point until melee_post_animation() gets called.
icon_state = "golem_pre_melee"
- setClickCooldown(2)
+ setClickCooldownLegacy(2)
/mob/living/simple_mob/mechanical/technomancer_golem/melee_post_animation(atom/A)
if(casting) // Some spells delete themselves when used, so we use a different variable set earlier instead.
@@ -141,19 +141,19 @@
flick("golem_post_melee", src)
icon_living = "golem"
icon_state = "golem"
- setClickCooldown(6)
+ setClickCooldownLegacy(6)
/mob/living/simple_mob/mechanical/technomancer_golem/ranged_pre_animation(atom/A)
flick("golem_pre_ranged", src)
icon_living = "golem_pre_ranged"
icon_state = "golem_pre_ranged"
- setClickCooldown(5)
+ setClickCooldownLegacy(5)
/mob/living/simple_mob/mechanical/technomancer_golem/ranged_post_animation(atom/A)
flick("golem_post_ranged", src)
icon_living = "golem"
icon_state = "golem"
- setClickCooldown(5)
+ setClickCooldownLegacy(5)
/mob/living/simple_mob/mechanical/technomancer_golem/special_pre_animation(atom/A)
casting = TRUE
diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm
index 21171de7cdb9..3323dbae878c 100644
--- a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm
@@ -130,7 +130,7 @@
if(prob(deflect_chance))
visible_message(SPAN_WARNING( "\The [user]'s [I] bounces off \the [src]'s armor!"))
deflect_sprite()
- user.setClickCooldown(user.get_attack_speed_legacy(I))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(I))
return
..()
diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm b/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm
index 9578d373925c..5777900c4a44 100644
--- a/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm
@@ -183,7 +183,7 @@
// Otherwise they're probably fighting the slime.
if(prob(25) && can_miss)
visible_message(SPAN_WARNING( "\The [user]'s [I] passes right through \the [src]!"))
- user.setClickCooldown(user.get_attack_speed_legacy(I))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(I))
return
..()
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 2dfb74a08761..879a8b2d7aa4 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -805,7 +805,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
if(!isliving(usr) || !usr.canClick())
return
- usr.setClickCooldown(20)
+ usr.setClickCooldownLegacy(20)
if(usr.stat == 1)
to_chat(usr, "You are unconcious and cannot do that!")
diff --git a/code/modules/mob/pulling.dm b/code/modules/mob/pulling.dm
index fa5844bbe1ee..f9fee80bb062 100644
--- a/code/modules/mob/pulling.dm
+++ b/code/modules/mob/pulling.dm
@@ -60,7 +60,7 @@
return
stop_pulling()
- setClickCooldown(DEFAULT_PULL_COODDOWN)
+ setClickCooldownLegacy(DEFAULT_PULL_COODDOWN)
if(AM.pulledby)
if(!suppress_message)
diff --git a/code/modules/mob/verbs/horizontal_invert_self.dm b/code/modules/mob/verbs/horizontal_invert_self.dm
index 09adab8dbc59..b287d3c1b778 100644
--- a/code/modules/mob/verbs/horizontal_invert_self.dm
+++ b/code/modules/mob/verbs/horizontal_invert_self.dm
@@ -8,11 +8,11 @@
// todo: remote control? mobs that don't allow it?
- if(TIMER_COOLDOWN_CHECK(src, CD_INDEX_MOB_VERB_INVERT_SELF))
+ if(TIMER_COOLDOWN_CHECK(src, TIMER_CD_INDEX_MOB_VERB_INVERT_SELF))
// todo: don't usr lol
to_chat(usr, SPAN_WARNING("You can't do that yet!"))
return
- TIMER_COOLDOWN_START(src, CD_INDEX_MOB_VERB_INVERT_SELF, 0.5 SECONDS)
+ TIMER_COOLDOWN_START(src, TIMER_CD_INDEX_MOB_VERB_INVERT_SELF, 0.5 SECONDS)
log_game("[key_name(usr)] invoked horizontal_invert_self on [key_name(src)].")
diff --git a/code/modules/organs/external/external.dm b/code/modules/organs/external/external.dm
index 2165d1fe922d..4ad59ffba2f5 100644
--- a/code/modules/organs/external/external.dm
+++ b/code/modules/organs/external/external.dm
@@ -551,7 +551,7 @@
to_chat(user, SPAN_WARNING("You can't reach your [src] while holding [tool] in the same hand!"))
return FALSE
- user.setClickCooldown(user.get_attack_speed_legacy(tool))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(tool))
if(!do_mob(user, owner, 10))
to_chat(user, SPAN_WARNING("You must stand still to do that."))
return FALSE
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index ad049c496441..8f77e9990d5f 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -44,7 +44,7 @@
return
if(user.next_move > world.time)
return
- user.setClickCooldown(1 SECOND)
+ user.setClickCooldownLegacy(1 SECOND)
to_chat(user, "Click.")
playsound(src, 'sound/items/penclick.ogg', 50, 1)
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 845862c8cf3c..b9ee10e3cba3 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -797,7 +797,7 @@ CREATE_WALL_MOUNTING_TYPES_SHIFTED(/obj/machinery/power/apc, 22)
var/mob/living/carbon/human/H = user
if(H.species.can_shred(H))
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
user.visible_message("[user.name] slashes at the [src.name]!", "You slash at the [src.name]!")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
diff --git a/code/modules/power/lighting/lighting.dm b/code/modules/power/lighting/lighting.dm
index 550ac65651d2..74e672ec5c02 100644
--- a/code/modules/power/lighting/lighting.dm
+++ b/code/modules/power/lighting/lighting.dm
@@ -876,7 +876,7 @@ var/global/list/light_type_cache = list()
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(H.species.can_shred(H))
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
for(var/mob/M in viewers(src))
M.show_message("[user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2)
broken()
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index ca9462ac564a..20462f15a832 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -470,6 +470,7 @@
add_fingerprint(user)
user.break_cloak()
+ user.setClickCooldownLegacy()
if(!special_check(user))
return
@@ -495,7 +496,7 @@
var/shoot_time = (burst - 1)* burst_delay
//These should apparently be disabled to allow for the automatic system to function without causing near-permanant paralysis. Re-enabling them while we sort that out.
- user.setClickCooldown(shoot_time) //no clicking on things while shooting
+ user.setClickCooldownLegacy(shoot_time) //no clicking on things while shooting
next_fire_time = world.time + shoot_time
@@ -545,7 +546,7 @@
add_attack_logs(user,target_for_log,"Fired gun [src.name] ([reflex ? "REFLEX" : "MANUAL"])")
//update timing
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
next_fire_time = world.time + fire_delay
diff --git a/code/modules/projectiles/targeting/targeting_triggers.dm b/code/modules/projectiles/targeting/targeting_triggers.dm
index b4c6c1c9a41d..321fdf041fa8 100644
--- a/code/modules/projectiles/targeting/targeting_triggers.dm
+++ b/code/modules/projectiles/targeting/targeting_triggers.dm
@@ -19,7 +19,7 @@
return
if(!owner.canClick())
return
- owner.setClickCooldown(5) // Spam prevention, essentially.
+ owner.setClickCooldownLegacy(5) // Spam prevention, essentially.
owner.visible_message("\The [owner] pulls the trigger reflexively!")
var/obj/item/gun/G = aiming_with
if(istype(G))
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index eb6f418c27d7..90d8cb503a99 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -118,7 +118,7 @@
to_chat(user, "\The [blocked] is in the way!")
return
- user.setClickCooldown(user.get_attack_speed_legacy(src)) //puts a limit on how fast people can eat/drink things
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src)) //puts a limit on how fast people can eat/drink things
self_feed_message(user)
reagents.trans_to_mob(user, issmall(user) ? CEILING(amount_per_transfer_from_this/2, 1) : amount_per_transfer_from_this, CHEM_INGEST)
feed_sound(user)
@@ -136,7 +136,7 @@
other_feed_message_start(user, target)
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(!do_mob(user, target))
return
diff --git a/code/modules/reagents/reagent_containers/hard_candy.dm b/code/modules/reagents/reagent_containers/hard_candy.dm
index be67f6e42680..d89d101568ac 100644
--- a/code/modules/reagents/reagent_containers/hard_candy.dm
+++ b/code/modules/reagents/reagent_containers/hard_candy.dm
@@ -66,7 +66,7 @@
to_chat(user, "\The [blocked] is in the way!")
return
- user.setClickCooldown(user.get_attack_speed_legacy(src)) //puts a limit on how fast people can eat/drink things
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src)) //puts a limit on how fast people can eat/drink things
if (fullness <= 100)
to_chat(target, "You hungrily chew out a piece of [src] and gobble it!")
if (fullness > 100 && fullness <= 300)
@@ -104,7 +104,7 @@
return
user.visible_message(SPAN_DANGER("[user] attempts to feed [target] [src]."))
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(!do_mob(user, target, 3 SECONDS))
return
//Do we really care about this
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 70066556c1fc..15c6b6cea53d 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -65,7 +65,7 @@
if(!istype(H) || !istype(user))
return FALSE
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
to_chat(user, SPAN_NOTICE("You inject \the [H] with \the [src]."))
H.custom_pain(SPAN_WARNING("You feel a tiny prick!"), 1, TRUE)
diff --git a/code/modules/reagents/reagent_containers/patch.dm b/code/modules/reagents/reagent_containers/patch.dm
index 83a780cfe31d..7a5bcfac0f35 100644
--- a/code/modules/reagents/reagent_containers/patch.dm
+++ b/code/modules/reagents/reagent_containers/patch.dm
@@ -99,7 +99,7 @@
user.visible_message(SPAN_WARNING("[user] attempts to place \the [src] onto [H]`s [affecting]."))
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(!do_mob(user, target))
return
diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm
index 0215e64b276a..d6dfc160f59f 100644
--- a/code/modules/reagents/reagent_containers/pill.dm
+++ b/code/modules/reagents/reagent_containers/pill.dm
@@ -72,7 +72,7 @@
user.visible_message("[user] attempts to force [target] to swallow \the [src].")
- user.setClickCooldown(user.get_attack_speed_legacy(src))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(src))
if(!do_mob(user, target))
return CLICKCHAIN_DO_NOT_PROPAGATE
if(!user.attempt_void_item_for_installation(src))
diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm
index 914e7182d4a0..e8b180d84387 100644
--- a/code/modules/reagents/reagent_containers/spray.dm
+++ b/code/modules/reagents/reagent_containers/spray.dm
@@ -39,7 +39,7 @@
Spray_at(target, user, (clickchain_flags & CLICKCHAIN_HAS_PROXIMITY))
- user.setClickCooldown(4)
+ user.setClickCooldownLegacy(4)
if(reagents.has_reagent("sacid"))
message_admins("[key_name_admin(user)] fired sulphuric acid from \a [src].")
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index fc1117b70ece..f3c4007263b4 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -200,7 +200,7 @@
user.visible_message("[user] begins hunting for an injection port on [target]'s suit!","You begin hunting for an injection port on [target]'s suit!")
//The warmup
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
if(!do_after(user,warmup_time,target))
return
diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm
index a2f898ee7816..5ca27dc98d65 100644
--- a/code/modules/resleeving/implant.dm
+++ b/code/modules/resleeving/implant.dm
@@ -101,7 +101,7 @@
if (user && imps.len)
target.visible_message("[user] is injecting a backup implant into [target].")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(target)
var/turf/T1 = get_turf(target)
diff --git a/code/modules/resleeving/mirror.dm b/code/modules/resleeving/mirror.dm
index 05cdcd7fb53b..bae809a6497d 100644
--- a/code/modules/resleeving/mirror.dm
+++ b/code/modules/resleeving/mirror.dm
@@ -137,7 +137,7 @@
if(user.zone_sel.selecting == BP_TORSO && imp == null)
if(imp == null && H.mirror)
H.visible_message("[user] is attempting remove [H]'s mirror!")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(H)
var/turf/T1 = get_turf(H)
if (T1 && ((H == user) || do_after(user, 20)))
@@ -160,7 +160,7 @@
return
if(!H.mirror)
H.visible_message("[user] is attempting to implant [H] with a mirror.")
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(H)
var/turf/T1 = get_turf(H)
if (T1 && ((H == user) || do_after(user, 20)))
diff --git a/code/modules/shieldgen/energy_field.dm b/code/modules/shieldgen/energy_field.dm
index fc32bce874ef..b64edac85b4c 100644
--- a/code/modules/shieldgen/energy_field.dm
+++ b/code/modules/shieldgen/energy_field.dm
@@ -49,14 +49,14 @@
if(W.damage_force)
adjust_strength(-W.damage_force / 20)
user.do_attack_animation(src)
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
..()
/obj/effect/energy_field/attack_generic(mob/user, damage)
if(damage)
adjust_strength(-damage / 20)
user.do_attack_animation(src)
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
/obj/effect/energy_field/inflict_atom_damage(damage, damage_type, damage_tier, damage_flag, damage_mode, hit_zone, attack_type, datum/weapon)
adjust_strength(damage / 20)
diff --git a/code/modules/shieldgen/energy_shield.dm b/code/modules/shieldgen/energy_shield.dm
index 1b6748953484..74818509f9a3 100644
--- a/code/modules/shieldgen/energy_shield.dm
+++ b/code/modules/shieldgen/energy_shield.dm
@@ -249,7 +249,7 @@
// Attacks with hand tools. Blocked by Hyperkinetic flag.
/obj/effect/shield/attackby(var/obj/item/I as obj, var/mob/user as mob)
- user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ user.setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
if(gen.check_flag(MODEFLAG_HYPERKINETIC))
diff --git a/code/modules/vehicles/sealed/mecha/mecha.dm b/code/modules/vehicles/sealed/mecha/mecha.dm
index adab0f30e42c..2769566aeb32 100644
--- a/code/modules/vehicles/sealed/mecha/mecha.dm
+++ b/code/modules/vehicles/sealed/mecha/mecha.dm
@@ -1014,7 +1014,7 @@
show_radial_occupant(user)
return
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
src.log_message("Attack by hand/paw. Attacker - [user].",1)
var/obj/item/mecha_parts/component/armor/ArmC = internal_components[MECH_ARMOR]
@@ -1274,7 +1274,7 @@
return
/obj/vehicle/sealed/mecha/proc/dynattackby(obj/item/W as obj, mob/user as mob)
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
src.log_message("Attacked by [W]. Attacker - [user]")
var/pass_damage_reduc_mod //Modifer for failing to bring AP.
@@ -2402,7 +2402,7 @@
temp_deflect_chance = round(ArmC.get_efficiency() * ArmC.deflect_chance + (defence_mode ? 25 : 0))
temp_damage_minimum = round(ArmC.get_efficiency() * ArmC.damage_minimum)
- user.setClickCooldown(user.get_attack_speed_legacy())
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy())
if(!damage)
return 0
diff --git a/code/modules/vehicles_legacy/vehicle.dm b/code/modules/vehicles_legacy/vehicle.dm
index 7b89623c2493..00c186d542ec 100644
--- a/code/modules/vehicles_legacy/vehicle.dm
+++ b/code/modules/vehicles_legacy/vehicle.dm
@@ -101,7 +101,7 @@
if(health < maxhealth)
if(open)
health = min(maxhealth, health+10)
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
playsound(src, T.tool_sound, 50, 1)
user.visible_message("[user] repairs [src]!"," You repair [src]!")
else
@@ -112,7 +112,7 @@
to_chat(user, "Unable to repair while [src] is off.")
else if(hasvar(W,"damage_force") && hasvar(W,"damage_type"))
- user.setClickCooldown(user.get_attack_speed_legacy(W))
+ user.setClickCooldownLegacy(user.get_attack_speed_legacy(W))
switch(W.damage_type)
if("fire")
health -= W.damage_force * fire_dam_coeff
diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm
index 467f8a00aa21..de61511871cb 100644
--- a/code/modules/vore/eating/belly_obj_vr.dm
+++ b/code/modules/vore/eating/belly_obj_vr.dm
@@ -523,7 +523,7 @@
if (!(R in contents))
return // User is not in this belly
- R.setClickCooldown(50)
+ R.setClickCooldownLegacy(50)
if(owner.stat) //If owner is stat (dead, KO) we can actually escape
to_chat(R,"You attempt to climb out of \the [lowertext(name)]. (This will take around [escapetime/10] seconds.)")
diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm
index d7a14a5e4bfd..34ff681f3f9b 100644
--- a/code/modules/vore/eating/living_vr.dm
+++ b/code/modules/vore/eating/living_vr.dm
@@ -320,7 +320,7 @@
if(!canClick() || incapacitated(INCAPACITATION_ALL))
return
- setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
visible_message("[src] licks [tasted]!","You lick [tasted]. They taste rather like [tasted.get_taste_message()].","Slurp!")
@@ -358,7 +358,7 @@
if(!canClick() || incapacitated(INCAPACITATION_ALL))
return
- setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
+ setClickCooldownLegacy(DEFAULT_ATTACK_COOLDOWN)
visible_message("[src] smells [smelled]!","You smell [smelled]. They smell like [smelled.get_smell_message()].","Sniff!")
/mob/living/proc/get_smell_message(allow_generic = 1)
diff --git a/code/modules/vore/fluffstuff/custom_items.dm b/code/modules/vore/fluffstuff/custom_items.dm
index 43a397dd526f..3d80a99f4d11 100644
--- a/code/modules/vore/fluffstuff/custom_items.dm
+++ b/code/modules/vore/fluffstuff/custom_items.dm
@@ -963,7 +963,7 @@
if(isliving(user))
user.visible_message("[user] invades [target]'s personal space, thrusting [src] into their face with an insistent huff.","You invade [target]'s personal space, thrusting [src] into their face with an insistent huff.")
user.do_attack_animation(target)
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
+ user.setClickCooldownLegacy(DEFAULT_QUICK_COOLDOWN) //to prevent spam
/obj/item/clothing/accessory/badge/holo/detective/ruda/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
diff --git a/code/modules/vore/weight/fitness_machines_vr.dm b/code/modules/vore/weight/fitness_machines_vr.dm
index c3234bf1e221..4e1e005af43b 100644
--- a/code/modules/vore/weight/fitness_machines_vr.dm
+++ b/code/modules/vore/weight/fitness_machines_vr.dm
@@ -21,7 +21,7 @@
if(L.nutrition < 70)
to_chat(L, "You need more energy to workout with the [src]!")
else //If they have enough nutrition and body weight, they can exercise.
- L.setClickCooldown(cooldown)
+ L.setClickCooldownLegacy(cooldown)
L.nutrition -= 10 * weightloss_power
flick("[icon_state]2",src)
var/message = pick(messages)