Removes click cooldowns almost everywhere.

Still have: doors, windoors, cameras, windows, grilles, blobs, resisting, alien stuff, mechas, spray bottles.
Setting changeNextMove is now responsibility of the item being attacked.
Adds a config option to eliminate click cooldowns completely. Intended to be used by devs.
This commit is contained in:
Kelenius
2015-05-09 17:27:19 +03:00
parent 538ce2f3ea
commit 3fa79f8d51
33 changed files with 110 additions and 144 deletions

View File

@@ -15,7 +15,6 @@
return return
if(control_disabled || stat) return if(control_disabled || stat) return
next_move = world.time + 9
if(ismob(A)) if(ismob(A))
ai_actual_track(A) ai_actual_track(A)
@@ -52,9 +51,8 @@
CtrlClickOn(A) CtrlClickOn(A)
return return
if(world.time <= next_move) if(!canClick())
return return
next_move = world.time + 9
if(aiCamera.in_camera_mode) if(aiCamera.in_camera_mode)
aiCamera.camera_mode_off() aiCamera.camera_mode_off()

View File

@@ -4,7 +4,7 @@
*/ */
// 1 decisecond click delay (above and beyond mob/next_move) // 1 decisecond click delay (above and beyond mob/next_move)
/mob/var/next_click = 0 /mob/var/next_click = 0
/* /*
Before anything else, defer these calls to a per-mobtype handler. This allows us to Before anything else, defer these calls to a per-mobtype handler. This allows us to
@@ -15,12 +15,14 @@
Note that this proc can be overridden, and is in the case of screen objects. Note that this proc can be overridden, and is in the case of screen objects.
*/ */
/atom/Click(location,control,params)
/atom/Click(var/location, var/control, var/params) // This is their reaction to being clicked on (standard proc)
if(src) if(src)
usr.ClickOn(src, params) usr.ClickOn(src, params)
/atom/DblClick(location,control,params)
/atom/DblClick(var/location, var/control, var/params)
if(src) if(src)
usr.DblClickOn(src,params) usr.DblClickOn(src, params)
/* /*
Standard mob ClickOn() Standard mob ClickOn()
@@ -35,8 +37,8 @@
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent * item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed * mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/ */
/mob/proc/ClickOn( var/atom/A, var/params ) /mob/proc/ClickOn(var/atom/A, var/params)
if(world.time <= next_click) if(world.time <= next_click) // Hard check, before anything else, to avoid crashing
return return
next_click = world.time + 1 next_click = world.time + 1
@@ -66,16 +68,17 @@
face_atom(A) // change direction to face what you clicked on face_atom(A) // change direction to face what you clicked on
if(next_move > world.time) // in the year 2000... if(!canClick()) // in the year 2000...
return return
if(istype(loc,/obj/mecha)) if(istype(loc, /obj/mecha))
if(!locate(/turf) in list(A,A.loc)) // Prevents inventory from being drilled if(!locate(/turf) in list(A, A.loc)) // Prevents inventory from being drilled
return return
var/obj/mecha/M = loc var/obj/mecha/M = loc
return M.click_action(A,src) return M.click_action(A, src)
if(restrained()) if(restrained())
changeNextMove(10)
RestrainedClickOn(A) RestrainedClickOn(A)
return return
@@ -83,79 +86,65 @@
throw_item(A) throw_item(A)
return return
if(!istype(A,/obj/item/weapon/gun) && !isturf(A) && !istype(A,/obj/screen)) if(!istype(A, /obj/item/weapon/gun) && !isturf(A) && !istype(A, /obj/screen))
last_target_click = world.time last_target_click = world.time
var/obj/item/W = get_active_hand() var/obj/item/W = get_active_hand()
if(W == A) if(W == A) // Handle attack_self
next_move = world.time + 6
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src) W.attack_self(src)
if(hand) if(hand)
update_inv_l_hand(0) update_inv_l_hand(0)
else else
update_inv_r_hand(0) update_inv_r_hand(0)
return return
// operate two STORAGE levels deep here (item in backpack in src; NOT item in box in backpack in src) // A is your location but is not a turf; or is on you (backpack); or is on something on you (box in backpack); but not next to you and not in a box in a backpack on you
var/sdepth = A.storage_depth(src) if(!isturf(A) && A == loc || (A in contents) || (A.loc in contents))
if(A == loc || (A in loc) || (sdepth != -1 && sdepth <= 1))
// faster access to objects already on you
if(A in contents)
next_move = world.time + 6 // on your person
else
next_move = world.time + 8 // in a box/bag or in your square
// No adjacency needed
if(W) if(W)
if(W.flags&USEDELAY) var/resolved = A.attackby(W, src)
next_move += 5
var/resolved = A.attackby(W,src)
if(!resolved && A && W) if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1 indicates adjacency W.afterattack(A, src, 1, params) // 1 indicates adjacency
else else
if(ismob(A)) // No instant mob attacking
changeNextMove(8)
UnarmedAttack(A, 1) UnarmedAttack(A, 1)
return return
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
return return
// Allows you to click on a box's contents, if that box is on the ground, but no deeper than that // A is a turf or is on a turf, or in something on a turf (pen in a box); but not something in something on a turf (pen in a box in a backpack)
sdepth = A.storage_depth_turf() if(isturf(A) || isturf(A.loc) || isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc) || (sdepth != -1 && sdepth <= 1))
next_move = world.time + 10
if(A.Adjacent(src)) // see adjacent.dm if(A.Adjacent(src)) // see adjacent.dm
if(W) if(W)
if(W.flags&USEDELAY) var/resolved = A.attackby(W, src) // Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
next_move += 5
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = A.attackby(W,src)
if(!resolved && A && W) if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1: clicking something Adjacent W.afterattack(A, src, 1, params) // 1: clicking something Adjacent
else else
if(ismob(A)) // No instant mob attacking
changeNextMove(8)
UnarmedAttack(A, 1) UnarmedAttack(A, 1)
return return
else // non-adjacent click else // non-adjacent click
if(W) if(W)
W.afterattack(A,src,0,params) // 0: not Adjacent W.afterattack(A, src, 0, params) // 0: not Adjacent
else else
RangedAttack(A, params) RangedAttack(A, params)
return return
/mob/proc/changeNext_move(num) /mob/proc/changeNextMove(var/num)
next_move = world.time + num next_move = world.time + num
// Default behavior: ignore double clicks, consider them normal clicks instead /mob/proc/canClick()
if(config.no_click_cooldown || next_move <= world.time)
return 1
return 0
// Default behavior: ignore double clicks, the second click that makes the doubleclick call already calls for a normal click
/mob/proc/DblClickOn(var/atom/A, var/params) /mob/proc/DblClickOn(var/atom/A, var/params)
ClickOn(A,params) return
/* /*
Translates into attack_hand, etc. Translates into attack_hand, etc.
@@ -198,17 +187,6 @@
if((LASER in mutations) && a_intent == I_HURT) if((LASER in mutations) && a_intent == I_HURT)
LaserEyes(A) // moved into a proc below LaserEyes(A) // moved into a proc below
else if(TK in mutations) else if(TK in mutations)
switch(get_dist(src,A))
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
if(5 to 7)
next_move += 5
if(8 to tk_maxrange)
next_move += 10
else
return
A.attack_tk(src) A.attack_tk(src)
/* /*
Restrained ClickOn Restrained ClickOn
@@ -234,8 +212,7 @@
if(back) if(back)
var/obj/item/weapon/rig/rig = back var/obj/item/weapon/rig/rig = back
if(istype(rig) && rig.selected_module) if(istype(rig) && rig.selected_module)
if(world.time <= next_move) return if(!canClick()) return
next_move = world.time + 8
rig.selected_module.engage(A) rig.selected_module.engage(A)
return return
@@ -316,7 +293,7 @@
return return
/mob/living/LaserEyes(atom/A) /mob/living/LaserEyes(atom/A)
next_move = world.time + 6 changeNextMove(4)
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
var/turf/U = get_turf(A) var/turf/U = get_turf(A)

View File

@@ -35,7 +35,7 @@
if(stat || lockcharge || weakened || stunned || paralysis) if(stat || lockcharge || weakened || stunned || paralysis)
return return
if(next_move >= world.time) if(!canClick())
return return
face_atom(A) // change direction to face what you clicked on face_atom(A) // change direction to face what you clicked on
@@ -68,9 +68,6 @@
return return
if(W == A) if(W == A)
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src) W.attack_self(src)
return return
@@ -78,9 +75,6 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents) // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
if(A == loc || (A in loc) || (A in contents)) if(A == loc || (A in loc) || (A in contents))
// No adjacency checks // No adjacency checks
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src) var/resolved = A.attackby(W,src)
if(!resolved && A && W) if(!resolved && A && W)
@@ -93,16 +87,12 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc)) // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc)) if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm if(A.Adjacent(src)) // see adjacent.dm
next_move = world.time + 10
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W, src) var/resolved = A.attackby(W, src)
if(!resolved && A && W) if(!resolved && A && W)
W.afterattack(A, src, 1, params) W.afterattack(A, src, 1, params)
return return
else else
next_move = world.time + 10
W.afterattack(A, src, 0, params) W.afterattack(A, src, 0, params)
return return
return return

View File

@@ -48,9 +48,8 @@
/obj/screen/item_action/Click() /obj/screen/item_action/Click()
if(!usr || !owner) if(!usr || !owner)
return 1 return 1
if(usr.next_move >= world.time) if(!usr.canClick())
return return
usr.next_move = world.time + 6
if(usr.stat || usr.restrained() || usr.stunned || usr.lying) if(usr.stat || usr.restrained() || usr.stunned || usr.lying)
return 1 return 1
@@ -85,7 +84,7 @@
name = "storage" name = "storage"
/obj/screen/storage/Click() /obj/screen/storage/Click()
if(world.time <= usr.next_move) if(!usr.canClick())
return 1 return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1 return 1
@@ -95,7 +94,6 @@
var/obj/item/I = usr.get_active_hand() var/obj/item/I = usr.get_active_hand()
if(I) if(I)
usr.ClickOn(master) usr.ClickOn(master)
usr.next_move = world.time+2
return 1 return 1
/obj/screen/gun /obj/screen/gun
@@ -481,7 +479,7 @@
/obj/screen/inventory/Click() /obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else // 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 // We don't even know if it's a middle click
if(world.time <= usr.next_move) if(!usr.canClick())
return 1 return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1 return 1
@@ -492,12 +490,10 @@
if(iscarbon(usr)) if(iscarbon(usr))
var/mob/living/carbon/C = usr var/mob/living/carbon/C = usr
C.activate_hand("r") C.activate_hand("r")
usr.next_move = world.time+2
if("l_hand") if("l_hand")
if(iscarbon(usr)) if(iscarbon(usr))
var/mob/living/carbon/C = usr var/mob/living/carbon/C = usr
C.activate_hand("l") C.activate_hand("l")
usr.next_move = world.time+2
if("swap") if("swap")
usr:swap_hand() usr:swap_hand()
if("hand") if("hand")
@@ -506,5 +502,4 @@
if(usr.attack_ui(slot_id)) if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0) usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0) usr.update_inv_r_hand(0)
usr.next_move = world.time+6
return 1 return 1

View File

@@ -6,11 +6,13 @@
// No comment // No comment
/atom/proc/attackby(obj/item/W, mob/user) /atom/proc/attackby(obj/item/W, mob/user)
return return
/atom/movable/attackby(obj/item/W, mob/user) /atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags&NOBLUDGEON)) if(!(W.flags&NOBLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>") visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
/mob/living/attackby(obj/item/I, mob/user) /mob/living/attackby(obj/item/I, mob/user)
user.changeNextMove(8)
if(istype(I) && ismob(user)) if(istype(I) && ismob(user))
I.attack(src, user) I.attack(src, user)

View File

@@ -32,8 +32,8 @@
if(client.buildmode) if(client.buildmode)
build_click(src, client.buildmode, params, A) build_click(src, client.buildmode, params, A)
return return
if(world.time <= next_move) return if(!canClick()) return
next_move = world.time + 8 changeNextMove(4)
// You are responsible for checking config.ghost_interaction when you override this function // You are responsible for checking config.ghost_interaction when you override this function
// Not all of them require checking, see below // Not all of them require checking, see below
A.attack_ghost(src) A.attack_ghost(src)

View File

@@ -38,15 +38,6 @@
return return
else if(TK in mutations) else if(TK in mutations)
switch(get_dist(src,A))
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
if(5 to 7)
next_move += 5
if(8 to 15)
next_move += 10
if(16 to 128)
return
A.attack_tk(src) A.attack_tk(src)
/mob/living/RestrainedClickOn(var/atom/A) /mob/living/RestrainedClickOn(var/atom/A)

View File

@@ -108,20 +108,12 @@ var/const/tk_maxrange = 15
return return
var/d = get_dist(user, target) var/d = get_dist(user, target)
if(focus) d = max(d,get_dist(user,focus)) // whichever is further if(focus)
switch(d) d = max(d,get_dist(user,focus)) // whichever is further
if(0)
; if(d > tk_maxrange)
if(1 to 5) // not adjacent may mean blocked by window user << "<span class='notice'>Your mind won't reach that far.</span>"
if(!proximity) return
user.next_move += 2
if(5 to 7)
user.next_move += 5
if(8 to tk_maxrange)
user.next_move += 10
else
user << "\blue Your mind won't reach that far."
return
if(!focus) if(!focus)
focus_object(target, user) focus_object(target, user)

View File

@@ -126,6 +126,7 @@ var/list/gamemode_cache = list()
var/welder_vision = 1 var/welder_vision = 1
var/generate_asteroid = 0 var/generate_asteroid = 0
var/no_click_cooldown = 0
//Used for modifying movement speed for mobs. //Used for modifying movement speed for mobs.
//Unversal modifiers //Unversal modifiers
@@ -316,6 +317,9 @@ var/list/gamemode_cache = list()
if ("generate_asteroid") if ("generate_asteroid")
config.generate_asteroid = 1 config.generate_asteroid = 1
if ("no_click_cooldown")
config.no_click_cooldown = 1
if("allow_admin_ooccolor") if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1 config.allow_admin_ooccolor = 1

View File

@@ -157,6 +157,7 @@
attackby(var/obj/item/weapon/W, var/mob/user) attackby(var/obj/item/weapon/W, var/mob/user)
user.changeNextMove(8)
playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1) playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1)
src.visible_message("<span class='danger'>The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]</span>") src.visible_message("<span class='danger'>The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]</span>")
var/damage = 0 var/damage = 0

View File

@@ -187,6 +187,7 @@
src.bugged = 1 src.bugged = 1
else if(W.damtype == BRUTE || W.damtype == BURN) //bashing cameras else if(W.damtype == BRUTE || W.damtype == BURN) //bashing cameras
user.changeNextMove(8)
if (W.force >= src.toughness) if (W.force >= src.toughness)
visible_message("<span class='warning'><b>[src] has been [pick(W.attack_verb)] with [W] by [user]!</b></span>") visible_message("<span class='warning'><b>[src] has been [pick(W.attack_verb)] with [W] by [user]!</b></span>")
if (istype(W, /obj/item)) //is it even possible to get into attackby() with non-items? if (istype(W, /obj/item)) //is it even possible to get into attackby() with non-items?

View File

@@ -80,6 +80,7 @@ for reference:
return return
return return
else else
user.changeNextMove(8)
switch(W.damtype) switch(W.damtype)
if("fire") if("fire")
src.health -= W.force * 1 src.health -= W.force * 1

View File

@@ -263,6 +263,7 @@
//psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them. //psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them.
if(src.density && istype(I, /obj/item/weapon) && user.a_intent == I_HURT && !istype(I, /obj/item/weapon/card)) if(src.density && istype(I, /obj/item/weapon) && user.a_intent == I_HURT && !istype(I, /obj/item/weapon/card))
var/obj/item/weapon/W = I var/obj/item/weapon/W = I
user.changeNextMove(8)
if(W.damtype == BRUTE || W.damtype == BURN) if(W.damtype == BRUTE || W.damtype == BURN)
if(W.force < min_force) if(W.force < min_force)
user.visible_message("\red <B>\The [user] hits \the [src] with \the [W] with no visible effect.</B>" ) user.visible_message("\red <B>\The [user] hits \the [src] with \the [W] with no visible effect.</B>" )

View File

@@ -225,6 +225,7 @@
//If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway) //If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card)) if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card))
user.changeNextMove(8)
var/aforce = I.force var/aforce = I.force
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
visible_message("\red <B>[src] was hit by [I].</B>") visible_message("\red <B>[src] was hit by [I].</B>")

View File

@@ -331,7 +331,7 @@
else else
//if the turret was attacked with the intention of harming it: //if the turret was attacked with the intention of harming it:
user.changeNext_move(NEXT_MOVE_DELAY) user.changeNextMove(8)
take_damage(I.force * 0.5) take_damage(I.force * 0.5)
if(I.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off if(I.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off
if(!attacked && !emagged) if(!attacked && !emagged)

View File

@@ -511,6 +511,7 @@
return return
/obj/mecha/attack_hand(mob/user as mob) /obj/mecha/attack_hand(mob/user as mob)
user.changeNextMove(8)
src.log_message("Attack by hand/paw. Attacker - [user].",1) src.log_message("Attack by hand/paw. Attacker - [user].",1)
if(istype(user,/mob/living/carbon/human)) if(istype(user,/mob/living/carbon/human))
@@ -674,6 +675,7 @@
return return
/obj/mecha/proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) /obj/mecha/proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob)
user.changeNextMove(8)
src.log_message("Attacked by [W]. Attacker - [user]") src.log_message("Attacked by [W]. Attacker - [user]")
if(prob(src.deflect_chance)) if(prob(src.deflect_chance))
user << "\red \The [W] bounces off [src.name]." user << "\red \The [W] bounces off [src.name]."
@@ -1788,6 +1790,7 @@
/obj/mecha/attack_generic(var/mob/user, var/damage, var/attack_message) /obj/mecha/attack_generic(var/mob/user, var/damage, var/attack_message)
user.changeNextMove(8)
if(!damage) if(!damage)
return 0 return 0

View File

@@ -103,6 +103,7 @@
return return
/obj/effect/alien/resin/attack_hand() /obj/effect/alien/resin/attack_hand()
usr.changeNextMove(8)
if (HULK in usr.mutations) if (HULK in usr.mutations)
usr << "\blue You easily destroy the [name]." usr << "\blue You easily destroy the [name]."
for(var/mob/O in oviewers(src)) for(var/mob/O in oviewers(src))
@@ -129,6 +130,7 @@
/obj/effect/alien/resin/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/effect/alien/resin/attackby(obj/item/weapon/W as obj, mob/user as mob)
user.changeNextMove(8)
var/aforce = W.force var/aforce = W.force
health = max(0, health - aforce) health = max(0, health - aforce)
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
@@ -236,6 +238,7 @@ Alien plants should do something if theres a lot of poison
return return
/obj/effect/alien/weeds/attackby(var/obj/item/weapon/W, var/mob/user) /obj/effect/alien/weeds/attackby(var/obj/item/weapon/W, var/mob/user)
user.changeNextMove(8)
if(W.attack_verb.len) if(W.attack_verb.len)
visible_message("\red <B>\The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]") visible_message("\red <B>\The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
else else

View File

@@ -159,7 +159,6 @@
else else
if(isliving(src.loc)) if(isliving(src.loc))
return return
user.next_move = max(user.next_move+2,world.time + 2)
user.put_in_active_hand(src) user.put_in_active_hand(src)
if(src.loc == user) if(src.loc == user)
src.pickup(user) src.pickup(user)

View File

@@ -325,9 +325,12 @@
if(!req_breakout()) if(!req_breakout())
return return
if(!escapee.canClick())
return
escapee.changeNextMove(100)
//okay, so the closet is either welded or locked... resist!!! //okay, so the closet is either welded or locked... resist!!!
escapee.next_move = world.time + 100
escapee.last_special = world.time + 100
escapee << "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>" escapee << "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>"
visible_message("<span class='danger'>The [src] begins to shake violently!</span>") visible_message("<span class='danger'>The [src] begins to shake violently!</span>")

View File

@@ -33,6 +33,7 @@
/obj/structure/grille/attack_hand(mob/user as mob) /obj/structure/grille/attack_hand(mob/user as mob)
user.changeNextMove(8)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
var/damage_dealt = 1 var/damage_dealt = 1
@@ -154,8 +155,10 @@
//window placing end //window placing end
else if(istype(W, /obj/item/weapon/shard)) else if(istype(W, /obj/item/weapon/shard))
user.changeNextMove(8)
health -= W.force * 0.1 health -= W.force * 0.1
else if(!shock(user, 70)) else if(!shock(user, 70))
user.changeNextMove(8)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
switch(W.damtype) switch(W.damtype)
if("fire") if("fire")

View File

@@ -175,6 +175,7 @@
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1) playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
/obj/structure/window/attack_hand(mob/user as mob) /obj/structure/window/attack_hand(mob/user as mob)
user.changeNextMove(8)
if(HULK in user.mutations) if(HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!")) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>") user.visible_message("<span class='danger'>[user] smashes through [src]!</span>")
@@ -200,6 +201,7 @@
return return
/obj/structure/window/attack_generic(var/mob/user, var/damage) /obj/structure/window/attack_generic(var/mob/user, var/damage)
user.changeNextMove(8)
if(!damage) if(!damage)
return return
if(damage >= 10) if(damage >= 10)
@@ -268,6 +270,7 @@
new glasstype(loc) new glasstype(loc)
qdel(src) qdel(src)
else else
user.changeNextMove(8)
if(W.damtype == BRUTE || W.damtype == BURN) if(W.damtype == BRUTE || W.damtype == BURN)
hit(W.force) hit(W.force)
if(health <= 7) if(health <= 7)

View File

@@ -272,6 +272,7 @@
//Interactions //Interactions
/turf/simulated/wall/attack_hand(mob/user as mob) /turf/simulated/wall/attack_hand(mob/user as mob)
user.changeNextMove(8)
if (HULK in user.mutations) if (HULK in user.mutations)
if (prob(hulk_destroy_prob) || rotting) if (prob(hulk_destroy_prob) || rotting)
usr << text("\blue You smash through the wall.") usr << text("\blue You smash through the wall.")
@@ -298,6 +299,7 @@
return 0 return 0
/turf/simulated/wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker) /turf/simulated/wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker)
user.changeNextMove(8)
if(!damage || !wallbreaker) if(!damage || !wallbreaker)
user << "You push the wall but nothing happens." user << "You push the wall but nothing happens."
return return

View File

@@ -1311,9 +1311,10 @@
set desc = "Pop a joint back into place. Extremely painful." set desc = "Pop a joint back into place. Extremely painful."
set src in view(1) set src in view(1)
if(!isliving(usr) || usr.next_move > world.time) if(!isliving(usr) || !usr.canClick())
return return
usr.next_move = world.time + 20
usr.changeNextMove(20)
if(usr.stat > 0) if(usr.stat > 0)
usr << "You are unconcious and cannot do that!" usr << "You are unconcious and cannot do that!"

View File

@@ -27,10 +27,10 @@
..() ..()
/mob/living/carbon/proc/escape_handcuffs() /mob/living/carbon/proc/escape_handcuffs()
if(!(last_special <= world.time)) return if(!canClick())
return
next_move = world.time + 100 changeNextMove(100)
last_special = world.time + 100
if(can_break_cuffs()) //Don't want to do a lot of logic gating here. if(can_break_cuffs()) //Don't want to do a lot of logic gating here.
break_handcuffs() break_handcuffs()
@@ -61,10 +61,10 @@
drop_from_inventory(handcuffed) drop_from_inventory(handcuffed)
/mob/living/carbon/proc/escape_legcuffs() /mob/living/carbon/proc/escape_legcuffs()
if(!(last_special <= world.time)) return if(!canClick())
return
next_move = world.time + 100 changeNextMove(100)
last_special = world.time + 100
if(can_break_cuffs()) //Don't want to do a lot of logic gating here. if(can_break_cuffs()) //Don't want to do a lot of logic gating here.
break_legcuffs() break_legcuffs()
@@ -149,14 +149,15 @@
return ..() return ..()
/mob/living/carbon/escape_buckle() /mob/living/carbon/escape_buckle()
if(!canClick())
return
changeNextMove(100)
if(!buckled) return if(!buckled) return
if(!(last_special <= world.time)) return
if(!restrained()) if(!restrained())
..() ..()
else else
next_move = world.time + 100
last_special = world.time + 100
visible_message( visible_message(
"<span class='danger'>[usr] attempts to unbuckle themself!</span>", "<span class='danger'>[usr] attempts to unbuckle themself!</span>",
"<span class='warning'>You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)</span>" "<span class='warning'>You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)</span>"

View File

@@ -572,7 +572,7 @@ default behaviour is:
set category = "IC" set category = "IC"
if(can_resist()) if(can_resist())
next_move = world.time + 20 changeNextMove(20)
process_resist() process_resist()
/mob/living/proc/can_resist() /mob/living/proc/can_resist()
@@ -580,7 +580,7 @@ default behaviour is:
//so just check weakened instead. //so just check weakened instead.
if(stat || weakened) if(stat || weakened)
return 0 return 0
if(next_move > world.time) if(!canClick())
return 0 return 0
return 1 return 1

View File

@@ -35,7 +35,7 @@
return return
/mob/living/captive_brain/can_resist() /mob/living/captive_brain/can_resist()
return !(stat || next_move > world.time) return !(stat || !canClick())
/mob/living/captive_brain/process_resist() /mob/living/captive_brain/process_resist()
//Resisting control by an alien mind. //Resisting control by an alien mind.

View File

@@ -266,7 +266,6 @@
/mob/living/simple_animal/attackby(var/obj/item/O, var/mob/user) /mob/living/simple_animal/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/stack/medical)) if(istype(O, /obj/item/stack/medical))
user.changeNext_move(4)
if(stat != DEAD) if(stat != DEAD)
var/obj/item/stack/medical/MED = O var/obj/item/stack/medical/MED = O
if(health < maxHealth) if(health < maxHealth)
@@ -284,7 +283,6 @@
if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch)) if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch))
harvest(user) harvest(user)
else else
user.changeNext_move(8)
if(O.force > resistance) if(O.force > resistance)
var/damage = O.force var/damage = O.force
if (O.damtype == HALLOSS) if (O.damtype == HALLOSS)

View File

@@ -241,8 +241,6 @@
if (W) if (W)
W.attack_self(src) W.attack_self(src)
update_inv_r_hand() update_inv_r_hand()
if(next_move < world.time)
next_move = world.time + 2
return return
/* /*
@@ -945,9 +943,9 @@ mob/proc/yank_out_object()
set desc = "Remove an embedded item at the cost of bleeding and pain." set desc = "Remove an embedded item at the cost of bleeding and pain."
set src in view(1) set src in view(1)
if(!isliving(usr) || usr.next_move > world.time) if(!isliving(usr) || !usr.canClick())
return return
usr.next_move = world.time + 20 usr.changeNextMove(20)
if(usr.stat == 1) if(usr.stat == 1)
usr << "You are unconcious and cannot do that!" usr << "You are unconcious and cannot do that!"

View File

@@ -120,7 +120,7 @@
return return
if(state == GRAB_UPGRADING) if(state == GRAB_UPGRADING)
return return
if(assailant.next_move > world.time) if(!assailant.canClick())
return return
if(world.time < (last_upgrade + UPGRADE_COOLDOWN)) if(world.time < (last_upgrade + UPGRADE_COOLDOWN))
return return
@@ -170,7 +170,7 @@
assailant.attack_log += "\[[time_stamp()]\] <font color='red'>Strangled (kill intent) [affecting.name] ([affecting.ckey])</font>" assailant.attack_log += "\[[time_stamp()]\] <font color='red'>Strangled (kill intent) [affecting.name] ([affecting.ckey])</font>"
msg_admin_attack("[key_name(assailant)] strangled (kill intent) [key_name(affecting)]") msg_admin_attack("[key_name(assailant)] strangled (kill intent) [key_name(affecting)]")
assailant.next_move = world.time + 10 affecting.changeNextMove(10)
affecting.losebreath += 1 affecting.losebreath += 1
else else
assailant.visible_message("<span class='warning'>[assailant] was unable to tighten \his grip on [affecting]'s neck!</span>") assailant.visible_message("<span class='warning'>[assailant] was unable to tighten \his grip on [affecting]'s neck!</span>")

View File

@@ -169,7 +169,7 @@
var/_move_delay = firemode.move_delay var/_move_delay = firemode.move_delay
var/shoot_time = (_burst - 1)*_burst_delay var/shoot_time = (_burst - 1)*_burst_delay
user.next_move = world.time + shoot_time //no clicking on things while shooting user.changeNextMove(shoot_time)
if(user.client) user.client.move_delay = world.time + shoot_time //no moving while shooting either if(user.client) user.client.move_delay = world.time + shoot_time //no moving while shooting either
next_fire_time = world.time + shoot_time next_fire_time = world.time + shoot_time
@@ -202,7 +202,7 @@
update_held_icon() update_held_icon()
//update timing //update timing
user.next_move = world.time + 4 user.changeNextMove(4)
if(user.client) user.client.move_delay = world.time + _move_delay if(user.client) user.client.move_delay = world.time + _move_delay
next_fire_time = world.time + _fire_delay next_fire_time = world.time + _fire_delay

View File

@@ -7,7 +7,7 @@
throw_speed = 2 throw_speed = 2
throw_range = 10 throw_range = 10
force = 5.0 force = 5.0
flags = CONDUCT | USEDELAY flags = CONDUCT
slot_flags = 0 slot_flags = 0
origin_tech = "combat=8;materials=5" origin_tech = "combat=8;materials=5"
fire_sound = 'sound/effects/bang.ogg' fire_sound = 'sound/effects/bang.ogg'

View File

@@ -50,6 +50,8 @@
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6) playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
user.changeNextMove(4)
if(reagents.has_reagent("sacid")) if(reagents.has_reagent("sacid"))
message_admins("[key_name_admin(user)] fired sulphuric acid from \a [src].") message_admins("[key_name_admin(user)] fired sulphuric acid from \a [src].")
log_game("[key_name(user)] fired sulphuric acid from \a [src].") log_game("[key_name(user)] fired sulphuric acid from \a [src].")

View File

@@ -190,12 +190,10 @@
// To successfully stop you taking all pressure damage you must have both a suit and head item with this flag. // To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
#define NOBLUDGEON 2 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler. #define NOBLUDGEON 2 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
#define AIRTIGHT 4 // Functions with internals. #define AIRTIGHT 4 // Functions with internals.
#define USEDELAY 8 // 1 second extra delay on use. (Can be used once every 2s)
#define NOSHIELD 16 // Weapon not affected by shield. #define NOSHIELD 16 // Weapon not affected by shield.
#define CONDUCT 32 // Conducts electricity. (metal etc.) #define CONDUCT 32 // Conducts electricity. (metal etc.)
#define ON_BORDER 64 // Item has priority to check when entering or leaving. #define ON_BORDER 64 // Item has priority to check when entering or leaving.
#define NOBLOODY 512 // Used for items if they don't want to get a blood overlay. #define NOBLOODY 512 // Used for items if they don't want to get a blood overlay.
#define NODELAY 8192 // 1 second attack-by delay skipped (Can be used once every 0.2s). Most objects have a 1s attack-by delay, which doesn't require a flag.
//Use these flags to indicate if an item obscures the specified slots from view, whereas body_parts_covered seems to be used to indicate what body parts the item protects. //Use these flags to indicate if an item obscures the specified slots from view, whereas body_parts_covered seems to be used to indicate what body parts the item protects.
#define GLASSESCOVERSEYES 256 #define GLASSESCOVERSEYES 256
@@ -865,8 +863,6 @@ var/list/be_special_flags = list(
#define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL) #define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL)
#define NEXT_MOVE_DELAY 8
#define DROPLIMB_EDGE 0 #define DROPLIMB_EDGE 0
#define DROPLIMB_BLUNT 1 #define DROPLIMB_BLUNT 1
#define DROPLIMB_BURN 2 #define DROPLIMB_BURN 2