mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Gives changeNextMove() a better name, default define
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
return M.click_action(A, src)
|
||||
|
||||
if(restrained())
|
||||
changeNextMove(10)
|
||||
setClickCooldown(10)
|
||||
RestrainedClickOn(A)
|
||||
return
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
W.afterattack(A, src, 1, params) // 1 indicates adjacency
|
||||
else
|
||||
if(ismob(A)) // No instant mob attacking
|
||||
changeNextMove(8)
|
||||
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
UnarmedAttack(A, 1)
|
||||
return
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
W.afterattack(A, src, 1, params) // 1: clicking something Adjacent
|
||||
else
|
||||
if(ismob(A)) // No instant mob attacking
|
||||
changeNextMove(8)
|
||||
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
UnarmedAttack(A, 1)
|
||||
return
|
||||
else // non-adjacent click
|
||||
@@ -137,8 +137,8 @@
|
||||
|
||||
return
|
||||
|
||||
/mob/proc/changeNextMove(var/num)
|
||||
next_move = world.time + num
|
||||
/mob/proc/setClickCooldown(var/timeout)
|
||||
next_move = max(world.time + timeout, next_move)
|
||||
|
||||
/mob/proc/canClick()
|
||||
if(config.no_click_cooldown || next_move <= world.time)
|
||||
@@ -285,7 +285,7 @@
|
||||
return
|
||||
|
||||
/mob/living/LaserEyes(atom/A)
|
||||
changeNextMove(4)
|
||||
setClickCooldown(4)
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/U = get_turf(A)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
|
||||
|
||||
/mob/living/attackby(obj/item/I, mob/user)
|
||||
user.changeNextMove(8)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(istype(I) && ismob(user))
|
||||
I.attack(src, user)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
build_click(src, client.buildmode, params, A)
|
||||
return
|
||||
if(!canClick()) return
|
||||
changeNextMove(4)
|
||||
setClickCooldown(4)
|
||||
// You are responsible for checking config.ghost_interaction when you override this function
|
||||
// Not all of them require checking, see below
|
||||
A.attack_ghost(src)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
if(istype(rig) && rig.selected_module)
|
||||
rig.selected_module.engage(A)
|
||||
if(ismob(A)) // No instant mob attacking - though modules have their own cooldowns
|
||||
changeNextMove(8)
|
||||
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user