From ae1768c63675e8e0907adb578e7c22a2a8c6ac1b Mon Sep 17 00:00:00 2001 From: Geeves Date: Tue, 14 Jul 2020 20:56:55 +0200 Subject: [PATCH] Misc Mech Fixes (#9344) Spiderbots now appear on the radio with the name of the one controlling them. Mechs can now operate windoors. Remote mechs can now use mounted health analyzers. Mech rechargers will now charge the mech on top of them if there is a power change and the power is back. Fixes #9050 --- code/controllers/subsystems/virtual_reality.dm | 1 + code/game/machinery/doors/windowdoor.dm | 5 +++++ code/game/machinery/mech_recharger.dm | 8 +++++++- code/modules/heavy_vehicle/equipment/medical.dm | 3 +-- .../mob/living/simple_animal/friendly/spiderbot.dm | 12 +++++++----- html/changelogs/geeves-mech_misc_fixes.yml | 9 +++++++++ 6 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 html/changelogs/geeves-mech_misc_fixes.yml diff --git a/code/controllers/subsystems/virtual_reality.dm b/code/controllers/subsystems/virtual_reality.dm index b2cb3c11634..ae905acbc0c 100644 --- a/code/controllers/subsystems/virtual_reality.dm +++ b/code/controllers/subsystems/virtual_reality.dm @@ -115,6 +115,7 @@ /mob/living/simple_animal/spiderbot/get_vr_name(mob/user) real_name = "Remote-Bot ([user.real_name])" name = real_name + voice_name = user.real_name // name that'll display on radios /mob/proc/ckey_transfer(var/mob/target, var/null_vr_mob = TRUE) target.ckey = src.ckey diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 0c0297655ce..f9ced423dc1 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -58,6 +58,11 @@ return ..() /obj/machinery/door/window/CollidedWith(atom/movable/AM as mob|obj) + if(istype(AM, /mob/living/heavy_vehicle)) + var/mob/living/heavy_vehicle/HV = AM + for(var/user in HV.pilots) + AM = user + break if (istype(AM, /mob/living/bot)) var/mob/living/bot/bot = AM if(istype(bot)) diff --git a/code/game/machinery/mech_recharger.dm b/code/game/machinery/mech_recharger.dm index 29943736c96..377497acde6 100644 --- a/code/game/machinery/mech_recharger.dm +++ b/code/game/machinery/mech_recharger.dm @@ -1,4 +1,3 @@ - /obj/machinery/mech_recharger name = "exosuit dock" desc = "A exosuit recharger, built into the floor." @@ -83,6 +82,13 @@ if(cell && remaining_energy > 0) cell.give(remaining_energy * CELLRATE) +/obj/machinery/mech_recharger/power_change() + ..() + if(!(stat & NOPOWER) && !(stat & BROKEN) && !charging) + var/mob/living/heavy_vehicle/HV = locate() in get_turf(src) + if(HV) + start_charging(HV) + // An ugly proc, but apparently mechs don't have maxhealth var of any kind. /obj/machinery/mech_recharger/proc/fully_repaired() return charging && (charging.health == charging.maxHealth) diff --git a/code/modules/heavy_vehicle/equipment/medical.dm b/code/modules/heavy_vehicle/equipment/medical.dm index 179fb0685d2..b38acfa8158 100644 --- a/code/modules/heavy_vehicle/equipment/medical.dm +++ b/code/modules/heavy_vehicle/equipment/medical.dm @@ -271,5 +271,4 @@ /obj/item/device/healthanalyzer/mech/attack(mob/living/M, var/mob/living/heavy_vehicle/user) for(var/mob/pilot in user.pilots) - health_scan_mob(M, pilot, FALSE) - return + health_scan_mob(M, pilot, TRUE, TRUE) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index e1a5fe5ee31..ff8540a04f3 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -53,6 +53,7 @@ verbs |= /mob/living/proc/ventcrawl verbs |= /mob/living/proc/hide verbs |= /mob/living/simple_animal/spiderbot/proc/control_integrated_radio + voice_name = name /mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob) @@ -148,11 +149,11 @@ spawn(300) src.explode() /mob/living/simple_animal/spiderbot/proc/transfer_personality(var/obj/item/device/mmi/M as obj) - - src.mind = M.brainmob.mind - src.mind.key = M.brainmob.key - src.ckey = M.brainmob.ckey - src.name = "spider-bot ([M.brainmob.name])" + src.mind = M.brainmob.mind + src.mind.key = M.brainmob.key + src.ckey = M.brainmob.ckey + src.name = "spider-bot ([M.brainmob.name])" + src.voice_name = src.name /mob/living/simple_animal/spiderbot/proc/explode() //When emagged. src.visible_message("\The [src] makes an odd warbling noise, fizzles, and explodes!") @@ -181,6 +182,7 @@ mmi = null real_name = initial(real_name) name = real_name + voice_name = name update_icon() remove_language("Robot Talk") positronic = null diff --git a/html/changelogs/geeves-mech_misc_fixes.yml b/html/changelogs/geeves-mech_misc_fixes.yml new file mode 100644 index 00000000000..7b6fe8d643a --- /dev/null +++ b/html/changelogs/geeves-mech_misc_fixes.yml @@ -0,0 +1,9 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Spiderbots now appear on the radio with the name of the one controlling them." + - bugfix: "Mechs can now operate windoors." + - bugfix: "Remote mechs can now use mounted health analyzers." + - bugfix: "Mech rechargers will now charge the mech on top of them if there is a power change and the power is back." \ No newline at end of file