Gives changeNextMove() a better name, default define

This commit is contained in:
mwerezak
2015-06-28 23:07:58 -04:00
parent 087a978d56
commit 32b95445e3
27 changed files with 46 additions and 43 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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