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
This commit is contained in:
Geeves
2020-07-14 20:56:55 +02:00
committed by GitHub
parent 29205c5c84
commit ae1768c636
6 changed files with 30 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -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("<span class='danger'>\The [src] makes an odd warbling noise, fizzles, and explodes!</span>")
@@ -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