proper smooth movement

This commit is contained in:
silicons
2021-01-08 10:51:48 -08:00
parent 5934d9b591
commit bd3761d39e
9 changed files with 46 additions and 13 deletions
+2
View File
@@ -147,6 +147,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
/client/proc/handle_statpanel_click(list/href_list)
var/atom/target = locate(href_list["statpanel_item_target"])
if(!target)
return
Click(target, target.loc, null, "[href_list["statpanel_item_shiftclick"]?"shift=1;":null][href_list["statpanel_item_ctrlclick"]?"ctrl=1;":null]&alt=[href_list["statpanel_item_altclick"]?"alt=1;":null]", FALSE, "statpanel")
/client/proc/is_content_unlocked()
+2
View File
@@ -73,6 +73,7 @@
return FALSE
//We are now going to move
var/add_delay = mob.movement_delay()
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay * ( (NSCOMPONENT(direct) && EWCOMPONENT(direct)) ? 2 : 1 ) )) // set it now in case of pulled objects
if(old_move_delay + (add_delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
move_delay = old_move_delay
else
@@ -95,6 +96,7 @@
if((direction & (direction - 1)) && mob.loc == n) //moved diagonally successfully
add_delay *= 2
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay))
move_delay += add_delay
if(.) // If mob is null here, we deserve the runtime
if(mob.throwing)
+16 -1
View File
@@ -18,6 +18,8 @@
item_flags = NEEDS_PERMIT
attack_verb = list("struck", "hit", "bashed")
attack_speed = CLICK_CD_RANGE
var/ranged_attack_speed = CLICK_CD_RANGE
var/melee_attack_speed = CLICK_CD_MELEE
var/fire_sound = "gunshot"
var/suppressed = null //whether or not a message is displayed when fired
@@ -173,12 +175,25 @@
for(var/obj/O in contents)
O.emp_act(severity)
/obj/item/gun/attack(mob/living/M, mob/user)
. = ..()
if(!(. & DISCARD_LAST_ACTION))
user.DelayNextAction(melee_attack_speed)
/obj/item/gun/attack_obj(obj/O, mob/user)
. = ..()
if(!(. & DISCARD_LAST_ACTION))
user.DelayNextAction(melee_attack_speed)
/obj/item/gun/afterattack(atom/target, mob/living/user, flag, params)
. = ..()
if(!CheckAttackCooldown(user, target))
if(!CheckAttackCooldown(user, target, TRUE))
return
process_afterattack(target, user, flag, params)
/obj/item/gun/CheckAttackCooldown(mob/user, atom/target, shooting = FALSE)
return user.CheckActionCooldown(shooting? ranged_attack_speed : attack_speed, clickdelay_from_next_action, clickdelay_mod_bypass, clickdelay_ignores_next_action)
/obj/item/gun/proc/process_afterattack(atom/target, mob/living/user, flag, params)
if(!target)
return
@@ -76,6 +76,7 @@
while(active)
var/obj/structure/disposalpipe/curr = loc
last = curr
set_glide_size(DELAY_TO_GLIDE_SIZE(ticks * world.tick_lag))
curr = curr.transfer(src)
if(!curr && active)
last.expel(src, loc, dir)