From 440b8b1b4e69ae95d48bf39607c8dc88b563ac99 Mon Sep 17 00:00:00 2001 From: Remie Richards Date: Fri, 23 Oct 2015 16:52:50 +0100 Subject: [PATCH] Adds some variables to allow per-mob "reaction times" that modify the delay between clicks/actions/interactions. 1 is a flat decisecond +/- the other is a Multiplier, eg 0.5 or 2 --- code/_onclick/click.dm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index ceed0282a97..929bf722474 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -4,8 +4,23 @@ */ // 1 decisecond click delay (above and beyond mob/next_move) +//This is mainly modified by click code, to modify click delays elsewhere, use next_move and changeNext_move() /mob/var/next_click = 0 +// THESE DO NOT EFFECT THE BASE 1 DECISECOND DELAY OF NEXT_CLICK +/mob/var/next_move_adjust = 0 //Amount to adjust action/click delays by, + or - +/mob/var/next_move_modifier = 1 //Value to multiply action/click delays by + + +//Delays the mob's next click/action by num deciseconds +// eg: 10-3 = 7 deciseconds of delay +// eg: 10*0.5 = 5 deciseconds of delay +// DOES NOT EFFECT THE BASE 1 DECISECOND DELAY OF NEXT_CLICK + +/mob/proc/changeNext_move(num) + next_move = world.time + ((num+next_move_adjust)*next_move_modifier) + + /* Before anything else, defer these calls to a per-mobtype handler. This allows us to remove istype() spaghetti code, but requires the addition of other handler procs to simplify it. @@ -125,9 +140,6 @@ else RangedAttack(A, params) -/mob/proc/changeNext_move(num) - next_move = world.time + num - // Default behavior: ignore double clicks (the second click that makes the doubleclick call already calls for a normal click) /mob/proc/DblClickOn(atom/A, params) return