From 280e7d7d8113796894f6cdf305ee51b9fc29f052 Mon Sep 17 00:00:00 2001 From: Ghommie Date: Sat, 15 Jun 2019 04:36:40 +0200 Subject: [PATCH 1/2] stops borgs from sprinting into negative cell charge. --- .../code/modules/mob/living/silicon/robot/robot_movement.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm b/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm index 598690590c..80598f134f 100644 --- a/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -4,8 +4,8 @@ /mob/living/silicon/robot/Move(NewLoc, direct) . = ..() if(. && sprinting && !(movement_type & FLYING) && canmove && !resting) - if(istype(cell)) - cell.charge -= 25 + if(!(cell?.use(25))) + togglesprint() /mob/living/silicon/robot/movement_delay() . = ..() @@ -18,6 +18,8 @@ if(sprinting) playsound_local(src, 'modular_citadel/sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE) else + if(!(cell?.charge)) + return FALSE playsound_local(src, 'modular_citadel/sound/misc/sprintdeactivate.ogg', 50, FALSE, pressure_affected = FALSE) if(hud_used && hud_used.static_inventory) for(var/obj/screen/sprintbutton/selector in hud_used.static_inventory) From 05066f241b74d33c6e4bbcd439ca8527d0c5d4c6 Mon Sep 17 00:00:00 2001 From: Ghommie Date: Sat, 15 Jun 2019 20:33:38 +0200 Subject: [PATCH 2/2] Improving keborgs' movement, not removing. --- .../mob/living/silicon/robot/robot_movement.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm b/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm index 80598f134f..c7a2447be6 100644 --- a/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -5,21 +5,23 @@ . = ..() if(. && sprinting && !(movement_type & FLYING) && canmove && !resting) if(!(cell?.use(25))) - togglesprint() + togglesprint(TRUE) /mob/living/silicon/robot/movement_delay() . = ..() if(!resting && !sprinting) . += 1 -/mob/living/silicon/robot/proc/togglesprint() //Basically a copypaste of the proc from /mob/living/carbon/human - sprinting = !sprinting +/mob/living/silicon/robot/proc/togglesprint(shutdown = FALSE) //Basically a copypaste of the proc from /mob/living/carbon/human + if(!shutdown && (!cell || cell.charge < 25)) + return FALSE + sprinting = shutdown ? FALSE : !sprinting if(!resting && canmove) if(sprinting) playsound_local(src, 'modular_citadel/sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE) else - if(!(cell?.charge)) - return FALSE + if(shutdown) + playsound_local(src, 'sound/effects/light_flicker.ogg', 50, FALSE, pressure_affected = FALSE) playsound_local(src, 'modular_citadel/sound/misc/sprintdeactivate.ogg', 50, FALSE, pressure_affected = FALSE) if(hud_used && hud_used.static_inventory) for(var/obj/screen/sprintbutton/selector in hud_used.static_inventory)