Get your clicks out of my movement code

This commit is contained in:
Aronai Sieyes
2020-04-30 15:40:41 -04:00
parent 03e2c9b5a5
commit 99fa98f437
15 changed files with 24 additions and 29 deletions
+3 -3
View File
@@ -7,12 +7,12 @@
return FALSE
/mob/living/simple_mob/IAttack(atom/A)
if(!canClick()) // Still on cooldown from a "click".
if(!checkClickCooldown()) // Still on cooldown from a "click".
return ATTACK_ON_COOLDOWN
return attack_target(A) // This will set click cooldown.
/mob/living/carbon/human/IAttack(atom/A)
if(!canClick()) // Still on cooldown from a "click".
if(!checkClickCooldown()) // Still on cooldown from a "click".
return FALSE
return ClickOn(A) // Except this is an actual fake "click".
@@ -20,7 +20,7 @@
return FALSE
/mob/living/simple_mob/IRangedAttack(atom/A)
if(!canClick()) // Still on cooldown from a "click".
if(!checkClickCooldown()) // Still on cooldown from a "click".
return ATTACK_ON_COOLDOWN
return shoot_target(A)
-1
View File
@@ -18,7 +18,6 @@
//OTHER//
/////////
var/datum/preferences/prefs = null
//var/move_delay = 1
var/moving = null
var/adminobs = null
var/area = null
@@ -1398,7 +1398,7 @@
set desc = "Pop a joint back into place. Extremely painful."
set src in view(1)
if(!isliving(usr) || !usr.canClick())
if(!isliving(usr) || !usr.checkClickCooldown())
return
usr.setClickCooldown(20)
+1 -1
View File
@@ -895,7 +895,7 @@ default behaviour is:
set name = "Resist"
set category = "IC"
if(!incapacitated(INCAPACITATION_KNOCKOUT) && canClick())
if(!incapacitated(INCAPACITATION_KNOCKOUT) && checkClickCooldown())
setClickCooldown(20)
resist_grab()
if(!weakened)
+1 -1
View File
@@ -912,7 +912,7 @@ mob/proc/yank_out_object()
set desc = "Remove an embedded item at the cost of bleeding and pain."
set src in view(1)
if(!isliving(usr) || !usr.canClick())
if(!isliving(usr) || !usr.checkClickCooldown())
return
usr.setClickCooldown(20)
+1 -2
View File
@@ -7,8 +7,7 @@
var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
var/move_delay = null // For movement speed delays.
var/next_move = null // For click delay, despite the misleading name.
var/next_move = null // world.time when mob is next allowed to self-move.
//Not in use yet
var/obj/effect/organstructure/organStructure = null
+1 -1
View File
@@ -239,7 +239,7 @@
return
if(state == GRAB_UPGRADING)
return
if(!assailant.canClick())
if(!assailant.checkClickCooldown())
return
if(world.time < (last_action + UPGRADE_COOLDOWN))
return
@@ -17,7 +17,7 @@
return
if(perm && (target_permissions & perm))
return
if(!owner.canClick())
if(!owner.checkClickCooldown())
return
owner.setClickCooldown(5) // Spam prevention, essentially.
if(owner.a_intent == I_HELP && owner.is_preference_enabled(/datum/client_preference/safefiring))