From 4d48abf3a6a5a4d79bc862c0e52e74293da77d3e Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 21 Jul 2020 11:46:17 -0700
Subject: [PATCH] fixes
---
code/_onclick/hud/screen_objects.dm | 26 +++++--------------
code/_onclick/hud/screen_objects/storage.dm | 9 +++----
code/_onclick/observer.dm | 2 +-
code/game/objects/structures/displaycase.dm | 3 ++-
code/game/objects/structures/tables_racks.dm | 6 ++++-
code/modules/antagonists/blob/blob/theblob.dm | 2 +-
.../kitchen_machinery/deep_fryer.dm | 4 ++-
code/modules/mob/living/brain/MMI.dm | 4 ++-
code/modules/mob/living/carbon/carbon.dm | 2 +-
.../hostile/mining_mobs/curse_blob.dm | 2 +-
.../mob/living/simple_animal/slime/slime.dm | 2 +-
code/modules/mob/login.dm | 4 +--
code/modules/projectiles/gun.dm | 2 --
code/modules/projectiles/guns/ballistic.dm | 4 +--
.../reagents/reagent_containers/rags.dm | 3 +--
code/modules/vore/eating/living.dm | 1 -
tgstation.dme | 1 +
17 files changed, 31 insertions(+), 46 deletions(-)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index 9d810cdc07..366bec52b7 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -91,15 +91,9 @@
plane = HUD_PLANE
/obj/screen/inventory/Click(location, control, params)
- // At this point in client Click() code we have passed the 1/10 sec check and little else
- // We don't even know if it's a middle click
- if(world.time <= usr.next_move)
- return TRUE
-
- if(usr.incapacitated())
- return TRUE
- if(ismecha(usr.loc)) // stops inventory actions in a mech
- return TRUE
+ if(hud?.mymob && (hud.mymob != usr))
+ return
+ // just redirect clicks
if(hud?.mymob && slot_id)
var/obj/item/inv_item = hud.mymob.get_item_by_slot(slot_id)
@@ -180,17 +174,9 @@
/obj/screen/inventory/hand/Click(location, control, params)
- // At this point in client Click() code we have passed the 1/10 sec check and little else
- // We don't even know if it's a middle click
- var/mob/user = hud?.mymob
- if(usr != user)
- return TRUE
- if(world.time <= user.next_move)
- return TRUE
- if(user.incapacitated())
- return TRUE
- if (ismecha(user.loc)) // stops inventory actions in a mech
- return TRUE
+ if(hud?.mymob && (hud.mymob != usr))
+ return
+ // just redirect clicks
if(user.active_hand_index == held_index)
var/obj/item/I = user.get_active_held_item()
diff --git a/code/_onclick/hud/screen_objects/storage.dm b/code/_onclick/hud/screen_objects/storage.dm
index 7e8bfe12ab..ce7bc96c96 100644
--- a/code/_onclick/hud/screen_objects/storage.dm
+++ b/code/_onclick/hud/screen_objects/storage.dm
@@ -9,12 +9,9 @@
/obj/screen/storage/Click(location, control, params)
if(!insertion_click)
return ..()
- if(world.time <= usr.next_move)
- return TRUE
- if(usr.incapacitated())
- return TRUE
- if (ismecha(usr.loc)) // stops inventory actions in a mech
- return TRUE
+ if(hud?.mymob && (hud.mymob != usr))
+ return
+ // just redirect clicks
if(master)
var/obj/item/I = usr.get_active_held_item()
if(I)
diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm
index ed7384697c..8a1e745308 100644
--- a/code/_onclick/observer.dm
+++ b/code/_onclick/observer.dm
@@ -37,7 +37,7 @@
CtrlClickOn(A)
return
- if(world.time <= next_move)
+ if(!CheckActionCooldown())
return
// You are responsible for checking config.ghost_interaction when you override this function
// Not all of them require checking, see below
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 6159e69780..f0384ca96a 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -9,6 +9,8 @@
armor = list("melee" = 30, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
max_integrity = 200
integrity_failure = 0.25
+ attack_hand_speed = CLICK_CD_MELEE
+ attack_hand_is_action = TRUE
var/obj/item/showpiece = null
var/alert = TRUE
var/open = FALSE
@@ -158,7 +160,6 @@
return attack_hand(user)
/obj/structure/displaycase/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
- user.changeNext_move(CLICK_CD_MELEE)
if (showpiece && (broken || open))
to_chat(user, "You deactivate the hover field built into the case.")
log_combat(user, src, "deactivates the hover field of")
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index f545b183bf..0463289658 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -23,6 +23,8 @@
climbable = TRUE
obj_flags = CAN_BE_HIT|SHOVABLE_ONTO
pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.")
+ attack_hand_speed = CLICK_CD_MELEE
+ attack_hand_is_action = TRUE
var/frame = /obj/structure/table_frame
var/framestack = /obj/item/stack/rods
var/buildstack = /obj/item/stack/sheet/metal
@@ -191,8 +193,10 @@
return
/obj/structure/table/alt_attack_hand(mob/user)
+ if(!user.CheckActionCooldown(CLICK_CD_MELEE))
+ return
+ user.DelayNextAction()
if(user && Adjacent(user) && !user.incapacitated())
- user.changeNext_move(CLICK_CD_MELEE*0.5)
if(istype(user) && user.a_intent == INTENT_HARM)
user.visible_message("[user] slams [user.p_their()] palms down on [src].", "You slam your palms down on [src].")
playsound(src, 'sound/weapons/sonic_jackhammer.ogg', 50, 1)
diff --git a/code/modules/antagonists/blob/blob/theblob.dm b/code/modules/antagonists/blob/blob/theblob.dm
index 6a73dc579b..ed85726a4a 100644
--- a/code/modules/antagonists/blob/blob/theblob.dm
+++ b/code/modules/antagonists/blob/blob/theblob.dm
@@ -225,7 +225,7 @@
/obj/structure/blob/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/analyzer))
- user.changeNext_move(CLICK_CD_MELEE)
+ user.DelayNextAction(CLICK_CD_MELEE)
to_chat(user, "The analyzer beeps once, then reports:
")
SEND_SOUND(user, sound('sound/machines/ping.ogg'))
if(overmind)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
index 42005340bd..7039e483f4 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
@@ -150,6 +150,8 @@ God bless America.
fry_loop.stop()
return
else if(user.pulling && user.a_intent == "grab" && iscarbon(user.pulling) && reagents.total_volume)
+ if(!user.CheckActionCooldown(CLICK_CD_MELEE))
+ return
if(user.grab_state < GRAB_AGGRESSIVE)
to_chat(user, "You need a better grip to do that!")
return
@@ -159,5 +161,5 @@ God bless America.
C.apply_damage(min(30, reagents.total_volume), BURN, BODY_ZONE_HEAD)
reagents.remove_any((reagents.total_volume/2))
C.DefaultCombatKnockdown(60)
- user.changeNext_move(CLICK_CD_MELEE)
+ user.DelayNextAction()
return ..()
diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm
index d1258ce6e4..891243496a 100644
--- a/code/modules/mob/living/brain/MMI.dm
+++ b/code/modules/mob/living/brain/MMI.dm
@@ -39,7 +39,9 @@
laws.set_laws_config()
/obj/item/mmi/attackby(obj/item/O, mob/user, params)
- user.changeNext_move(CLICK_CD_MELEE)
+ if(!user.CheckActionCooldown(CLICK_CD_MELEE))
+ return
+ user.DelayNextAction()
if(istype(O, /obj/item/organ/brain)) //Time to stick a brain in it --NEO
var/obj/item/organ/brain/newbrain = O
if(brain)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 1d6ba1aec3..43595b9571 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -315,7 +315,7 @@
spin(32,2)
visible_message("[src] rolls on the floor, trying to put [p_them()]self out!", \
"You stop, drop, and roll!")
- MarkResistCooldown(30)
+ MarkResistTime(30)
sleep(30)
if(fire_stacks <= 0)
visible_message("[src] has successfully extinguished [p_them()]self!", \
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm
index c4f78b6e26..11cc0fe67e 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm
@@ -105,7 +105,7 @@ IGNORE_PROC_IF_NOT_TARGET(attack_slime)
/mob/living/simple_animal/hostile/asteroid/curseblob/attacked_by(obj/item/I, mob/living/L, attackchain_flags = NONE, damage_multiplier = 1)
if(L != set_target)
- L.changeNext_move(I.click_delay) //pre_attacked_by not called
+ I.ApplyAttackCooldown(L, src)
return
return ..()
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index baa8882980..1bdd988694 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -356,7 +356,7 @@
attacked += 10
if(prob(25))
user.do_attack_animation(src)
- user.changeNext_move(CLICK_CD_MELEE)
+ W.ApplyAttackCooldown(user, src)
to_chat(user, "[W] passes right through [src]!")
return
if(Discipline && prob(50)) // wow, buddy, why am I getting attacked??
diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm
index b7546becd8..31bfb5621f 100644
--- a/code/modules/mob/login.dm
+++ b/code/modules/mob/login.dm
@@ -13,9 +13,7 @@
hud_used.show_hud(hud_used.hud_version)
hud_used.update_ui_style(ui_style2icon(client.prefs.UI_style))
- next_move = 1
-
- ..()
+ . = ..()
reset_perspective(loc)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 21bc3da4ba..e8a52a778e 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -357,11 +357,9 @@
if(user.a_intent == INTENT_HARM) //Flogging
if(bayonet)
M.attackby(bayonet, user)
- attack_delay_done = TRUE
return
else
return ..()
- attack_delay_done = TRUE //we are firing the gun, not bashing people with its butt.
/obj/item/gun/attack_obj(obj/O, mob/user)
if(user.a_intent == INTENT_HARM)
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index e4ab2df038..fa8099a257 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -179,13 +179,11 @@
#undef BRAINS_BLOWN_THROW_SPEED
#undef BRAINS_BLOWN_THROW_RANGE
-
-
/obj/item/gun/ballistic/proc/sawoff(mob/user)
if(sawn_off)
to_chat(user, "\The [src] is already shortened!")
return
- user.changeNext_move(CLICK_CD_MELEE)
+ user.DelayNextAction(CLICK_CD_MELEE)
user.visible_message("[user] begins to shorten \the [src].", "You begin to shorten \the [src]...")
//if there's any live ammo inside the gun, makes it go off
diff --git a/code/modules/reagents/reagent_containers/rags.dm b/code/modules/reagents/reagent_containers/rags.dm
index 1debfa7d8d..8b935cc244 100644
--- a/code/modules/reagents/reagent_containers/rags.dm
+++ b/code/modules/reagents/reagent_containers/rags.dm
@@ -51,11 +51,10 @@
if(do_after(user, action_speed, target = A))
user.visible_message("[user] finishes wiping off [A]!", "You finish wiping off [A].")
SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM)
- return
/obj/item/reagent_containers/rag/alt_pre_attack(mob/living/M, mob/living/user, params)
if(istype(M) && user.a_intent == INTENT_HELP)
- user.changeNext_move(CLICK_CD_MELEE)
+ user.DelayNextAction(CLICK_CD_MELEE)
if(M.on_fire)
user.visible_message("\The [user] uses \the [src] to pat out [M == user ? "[user.p_their()]" : "\the [M]'s"] flames!")
if(hitsound)
diff --git a/code/modules/vore/eating/living.dm b/code/modules/vore/eating/living.dm
index 4df008f2c5..9395cef952 100644
--- a/code/modules/vore/eating/living.dm
+++ b/code/modules/vore/eating/living.dm
@@ -370,7 +370,6 @@
visible_message("[src] licks [tasted]!","You lick [tasted]. They taste rather like [tasted.get_taste_message()].","Slurp!")
-
/mob/living/proc/get_taste_message(allow_generic = TRUE, datum/species/mrace)
if(!vore_taste && !allow_generic)
return FALSE
diff --git a/tgstation.dme b/tgstation.dme
index 630ee96b42..10d1bf350f 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -221,6 +221,7 @@
#include "code\_onclick\overmind.dm"
#include "code\_onclick\right_click.dm"
#include "code\_onclick\right_item_attack.dm"
+#include "code\_onclick\right_other_mobs.dm"
#include "code\_onclick\telekinesis.dm"
#include "code\_onclick\hud\_defines.dm"
#include "code\_onclick\hud\action_button.dm"