From b1ccccb322b0080f0def51a255bfd89c9a025f2f Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sat, 18 Jul 2020 18:51:16 -0700 Subject: [PATCH] more --- code/_onclick/ai.dm | 4 ---- code/_onclick/click.dm | 6 ------ code/_onclick/cyborg.dm | 6 +----- code/game/machinery/wishgranter.dm | 6 ++++-- code/game/objects/items/courtroom.dm | 4 ++-- code/modules/client/client_defines.dm | 3 +++ code/modules/client/client_procs.dm | 3 +++ code/modules/mob/clickdelay.dm | 3 --- 8 files changed, 13 insertions(+), 22 deletions(-) diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 02cbd6bea5..948c0129ae 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -19,10 +19,6 @@ A.move_camera_by_click() /mob/living/silicon/ai/ClickOn(var/atom/A, params) - if(world.time <= next_click) - return - next_click = world.time + 1 - if(!can_interact_with(A)) return diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index a9bc57d520..ec5cc09717 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -34,10 +34,6 @@ * mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed */ /mob/proc/ClickOn( atom/A, params ) - if(world.time <= next_click) - return - next_click = world.time + world.tick_lag - if(check_click_intercept(params,A)) return @@ -272,7 +268,6 @@ var/datum/antagonist/changeling/C = mind.has_antag_datum(/datum/antagonist/changeling) if(C && C.chosen_sting) C.chosen_sting.try_to_sting(src,A) - next_click = world.time + 5 return swap_hand() @@ -345,7 +340,6 @@ var/datum/antagonist/changeling/C = mind.has_antag_datum(/datum/antagonist/changeling) if(C && C.chosen_sting) C.chosen_sting.try_to_sting(src,A) - next_click = world.time + 5 return ..() diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 9fcccedf1a..d825c10a95 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -7,10 +7,6 @@ */ /mob/living/silicon/robot/ClickOn(var/atom/A, var/params) - if(world.time <= next_click) - return - next_click = world.time + 1 - if(check_click_intercept(params,A)) return @@ -37,7 +33,7 @@ CtrlClickOn(A) return - if(next_move >= world.time) + if(!CheckActionCooldown()) return face_atom(A) // change direction to face what you clicked on diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index dcd86c9f24..a8446fd14a 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -31,7 +31,8 @@ user.dna.add_mutation(XRAY) user.dna.add_mutation(SPACEMUT) user.dna.add_mutation(TK) - user.next_move_modifier *= 0.5 //half the delay between attacks! + user.last_action_mult *= 0.5 + user.next_action_mult *= 0.5 to_chat(user, "Things around you feel slower!") charges-- insisting = FALSE @@ -101,7 +102,8 @@ to_chat(user, "[killreward] materializes into your hands!") else to_chat(user, "[killreward] materializes onto the floor.") - user.next_move_modifier *= 0.8 //20% less delay between attacks! + user.last_action_mult *= 0.8 //20% less delay between attacks! + user.next_action_mult *= 0.8 to_chat(user, "Things around you feel slightly slower!") var/mob/living/simple_animal/hostile/venus_human_trap/killwish = new /mob/living/simple_animal/hostile/venus_human_trap(loc) killwish.maxHealth = 1500 diff --git a/code/game/objects/items/courtroom.dm b/code/game/objects/items/courtroom.dm index c0e81ed3d5..13b83c9425 100644 --- a/code/game/objects/items/courtroom.dm +++ b/code/game/objects/items/courtroom.dm @@ -32,6 +32,6 @@ if(istype(I, /obj/item/gavelhammer)) playsound(loc, 'sound/items/gavel.ogg', 100, 1) user.visible_message("[user] strikes [src] with [I].") - user.changeNext_move(CLICK_CD_MELEE) + return TRUE else - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 7f1ba86ff5..ae48fddfb4 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -30,6 +30,9 @@ var/move_delay = 0 var/area = null + /// Last time we Click()ed. No clicking twice in one tick! + var/last_click = 0 + /////////////// //SOUND STUFF// /////////////// diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 8ae002dd2f..b1ded0cd1b 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -772,6 +772,9 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) ip_intel = res.intel /client/Click(atom/object, atom/location, control, params, ignore_spam = FALSE) + if(last_click > world.time - world.tick_lag) + return + last_click = world.time var/ab = FALSE var/list/L = params2list(params) if (object && object == middragatom && L["left"]) diff --git a/code/modules/mob/clickdelay.dm b/code/modules/mob/clickdelay.dm index cfbfdeeb3a..b83f8c8405 100644 --- a/code/modules/mob/clickdelay.dm +++ b/code/modules/mob/clickdelay.dm @@ -8,9 +8,6 @@ /mob // CLICKDELAY AND RELATED - /// Last time we clicked. No clicking twice in one tick, please! This should be directly set and checked. - var/last_click = 0 - /// Generic clickdelay variable. Marks down the last world.time we did something that should cause or impact generic clickdelay. This should be directly set or set using [DelayNextAction()]. This should only be checked using [CheckActionCooldown()]. var/last_action = 0 /// Generic clickdelay variable. Next world.time we should be able to do something that respects generic clickdelay. This should be set using [DelayNextAction()] This should only be checked using [CheckActionCooldown()].