diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index cd1ee56848..7a614da07b 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -85,7 +85,7 @@ if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, "You don't want to harm other living beings!") return - + if(!UseStaminaBufferStandard(user, STAM_COST_ATTACK_MOB_MULT, null, TRUE)) return DISCARD_LAST_ACTION diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm index 03f3820a9b..fd87d5b0ad 100644 --- a/code/datums/components/riding.dm +++ b/code/datums/components/riding.dm @@ -53,7 +53,12 @@ directional_vehicle_layers["[dir]"] = layer /datum/component/riding/proc/vehicle_moved(datum/source) - var/atom/movable/AM = parent + SIGNAL_HANDLER + + var/atom/movable/movable_parent = parent + if (isnull(dir)) + dir = movable_parent.dir + movable_parent.set_glide_size(DELAY_TO_GLIDE_SIZE(vehicle_move_delay)) for(var/i in AM.buckled_mobs) ride_check(i) handle_vehicle_offsets() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 88a5c3f20f..036aa6ed79 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -578,6 +578,7 @@ /obj/mecha/proc/mechstep(direction) var/current_dir = dir + set_glide_size(DELAY_TO_GLIDE_SIZE(step_in)) var/result = step(src,direction) if(strafe) setDir(current_dir) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index bdb748925c..69543e4284 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -84,16 +84,22 @@ M.IgniteMob() /atom/movable/proc/unbuckle_mob(mob/living/buckled_mob, force=FALSE) - if(istype(buckled_mob) && buckled_mob.buckled == src && (buckled_mob.can_unbuckle() || force)) - . = buckled_mob - buckled_mob.buckled = null - buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_mobility() - buckled_mob.clear_alert("buckled") - buckled_mobs -= buckled_mob - SEND_SIGNAL(src, COMSIG_MOVABLE_UNBUCKLE, buckled_mob, force) + if(!isliving(buckled_mob)) + CRASH("Non-living [buckled_mob] thing called unbuckle_mob() for source.") + if(buckled_mob.buckled != src) + CRASH("[buckled_mob] called unbuckle_mob() for source while having buckled as [buckled_mob.buckled].") + if(!force && !buckled_mob.can_unbuckle()) + return + . = buckled_mob + buckled_mob.buckled = null + buckled_mob.anchored = initial(buckled_mob.anchored) + buckled_mob.update_mobility() + buckled_mob.clear_alert("buckled") + buckled_mob.set_glide_size(DELAY_TO_GLIDE_SIZE(buckled_mob.total_multiplicative_slowdown())) + buckled_mobs -= buckled_mob + SEND_SIGNAL(src, COMSIG_MOVABLE_UNBUCKLE, buckled_mob, force) - post_unbuckle_mob(.) + post_unbuckle_mob(.) /atom/movable/proc/unbuckle_all_mobs(force=FALSE) if(!has_buckled_mobs()) diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index cf68341b2c..21709edf73 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -126,12 +126,13 @@ if(current_tube == null) setDir(next_dir) - Move(get_step(loc, dir), dir) // Allow collisions when leaving the tubes. + Move(get_step(loc, dir), dir, DELAY_TO_GLIDE_SIZE(exit_delay)) // Allow collisions when leaving the tubes. break last_delay = current_tube.enter_delay(src, next_dir) sleep(last_delay) setDir(next_dir) + set_glide_size(DELAY_TO_GLIDE_SIZE(last_delay + exit_delay)) forceMove(next_loc) // When moving from one tube to another, skip collision and such. density = current_tube.density diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index ea99a549ea..5f567f1360 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -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() diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index e977c397c9..3d51a3b7f4 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -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) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 22f6ed4572..e3a2da68da 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -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 diff --git a/code/modules/recycling/disposal/holder.dm b/code/modules/recycling/disposal/holder.dm index 2e36a9deaa..dc5b7a8efb 100644 --- a/code/modules/recycling/disposal/holder.dm +++ b/code/modules/recycling/disposal/holder.dm @@ -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)