Remote Mech Revision (#8903)

The AI can now remotely control mechs in its network. It has one mapped in near its core.
    Messages received by your old body will now reach your VR body (does not affect Skrell Srom).
    Exosuit pilots can now interact with elevator panels without having to get out.
    Robotics and RnD can now create remote controlled mechs. The control centre is in the protolathe, while the exosuit upgrade is in the circuit imprinter.
    Mechs can no longer be dismantled if it has a pilot in it.
    Dismantling a mech now takes a while.
This commit is contained in:
Geeves
2020-05-30 15:20:16 +02:00
committed by GitHub
parent aa39c8ca42
commit 19b1ddb869
37 changed files with 878 additions and 2937 deletions

View File

@@ -0,0 +1,34 @@
/obj/item/remote_mecha
name = "standard exosuit remote upgrade"
desc = "A device that, when inserted into an exosuit, allows it to be remotely piloted."
icon = 'icons/obj/modular_components.dmi'
icon_state = "aislot"
origin_tech = list(TECH_BLUESPACE = 3, TECH_MATERIAL = 4, TECH_DATA = 4)
w_class = ITEMSIZE_SMALL
var/mech_remote_network = "remotemechs"
var/hardpoint_lock = FALSE // Whether mechs that receive this upgrade gets locked
var/dummy_path = /mob/living/simple_animal/spiderbot
/obj/item/remote_mecha/examine(mob/user)
. = ..()
to_chat(user, FONT_SMALL(SPAN_WARNING("This exosuit upgrade cannot be undone if applied!")))
if(Adjacent(user))
var/message = "Applying \the [src] <b>will [hardpoint_lock ? "" : "not"]</b> lock the hardpoints[hardpoint_lock ? ", preventing further modification" : ""]."
to_chat(user, FONT_SMALL(SPAN_NOTICE(message)))
/obj/item/remote_mecha/penal
name = "penal exosuit remote upgrade"
desc = "A device that, when inserted into an exosuit, allows it to be remotely piloted. Intended for prison networks."
mech_remote_network = "prisonmechs"
hardpoint_lock = TRUE
/obj/item/remote_mecha/penal/examine(mob/user)
. = ..()
if(Adjacent(user))
to_chat(user, FONT_SMALL(SPAN_NOTICE("Applying \the [src] will additionally add the mech to the security penal network, where they can remotely monitor and shut it down.")))
/obj/item/remote_mecha/ai
name = "AI exosuit remote upgrade"
desc = "A device that, when inserted into an exosuit, allows it to be remotely piloted by the artificial intelligence."
mech_remote_network = "aimechs"
dummy_path = /mob/living/simple_animal/spiderbot/ai

View File

@@ -346,7 +346,29 @@
else
if(user.a_intent != I_HURT)
if(thing.ismultitool())
if(istype(thing, /obj/item/remote_mecha))
if(length(pilots))
to_chat(user, SPAN_WARNING("You can't apply this upgrade while \the [src] has occupants!"))
return
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("You are unable to apply this upgrade while \the [src]'s maintenance protocols are not active."))
return
user.visible_message(SPAN_NOTICE("\The [user] begins installing \the [thing] into \the [src]..."), SPAN_NOTICE("You begin installing the [thing] into \the [src]..."))
if(do_after(user, 30, TRUE, src))
if(length(pilots))
to_chat(user, SPAN_WARNING("You can't apply this upgrade while \the [src] has occupants!"))
return
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("You are unable to apply this upgrade while \the [src]'s maintenance protocols are not active."))
return
var/obj/item/remote_mecha/RM = thing
user.visible_message(SPAN_NOTICE("\The [user] installs \the [thing] into \the [src]."), SPAN_NOTICE("You install the [thing] into \the [src]."))
remote_network = RM.mech_remote_network
does_hardpoint_lock = RM.hardpoint_lock
dummy_type = RM.dummy_path
become_remote()
qdel(thing)
else if(thing.ismultitool())
if(hardpoints_locked)
to_chat(user, "<span class='warning'>Hardpoint system access is disabled.</span>")
return
@@ -364,12 +386,23 @@
return
else if(thing.iswrench())
if(!maintenance_protocols)
to_chat(user, "<span class='warning'>The securing bolts are not visible while maintenance protocols are disabled.</span>")
if(length(pilots))
to_chat(user, SPAN_WARNING("You can't disassemble \the [src] while it has a pilot!"))
return
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("The securing bolts are not visible while maintenance protocols are disabled."))
return
user.visible_message(SPAN_NOTICE("\The [user] starts dismantling \the [src]..."), SPAN_NOTICE("You start disassembling \the [src]..."))
if(do_after(user, 30, TRUE, src))
if(length(pilots))
to_chat(user, SPAN_WARNING("You can't disassemble \the [src] while it has a pilot!"))
return
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("The securing bolts are not visible while maintenance protocols are disabled."))
return
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You disassemble \the [src]."))
dismantle()
return
to_chat(user, "<span class='notice'>You dismantle \the [src].</span>")
dismantle()
return
else if(thing.iswelder())
if(!getBruteLoss())
return

View File

@@ -1,13 +1,14 @@
// Big stompy robots.
/mob/living/heavy_vehicle
name = "exosuit"
density = 1
opacity = 1
anchored = 1
density = TRUE
opacity = TRUE
anchored = TRUE
status_flags = PASSEMOTES
a_intent = I_HURT
mob_size = MOB_LARGE
mob_push_flags = ALLMOBS
can_buckle = FALSE
var/decal
var/emp_damage = 0
@@ -24,7 +25,7 @@
// Access updating/container.
var/obj/item/card/id/access_card
var/list/saved_access = list()
var/sync_access = 1
var/sync_access = TRUE
// Mob currently piloting the mech.
var/list/pilots
@@ -32,7 +33,9 @@
// Remote control stuff
var/remote = FALSE // Spawns a robotic pilot to be remote controlled
var/mob/living/carbon/human/industrial_xion_remote_mech/dummy // The remote controlled dummy
var/does_hardpoint_lock = TRUE
var/mob/living/simple_animal/spiderbot/dummy // The remote controlled dummy
var/dummy_type = /mob/living/simple_animal/spiderbot
var/dummy_colour
// Visible external components. Not strictly accurately named for non-humanoid machines (submarines) but w/e
@@ -56,8 +59,8 @@
var/material/material
// Cockpit access vars.
var/hatch_closed = 0
var/hatch_locked = 0
var/hatch_closed = FALSE
var/hatch_locked = FALSE
var/force_locked = FALSE // Is it possible to unlock the hatch?
var/use_air = FALSE
@@ -241,16 +244,20 @@
remote = TRUE
name = name + " \"[pick("Jaeger", "Reaver", "Templar", "Juggernaut", "Basilisk")]-[rand(0, 999)]\""
if(remote_network)
SSvirtualreality.add_mech(src, remote_network)
else
if(!remote_network)
remote_network = "remotemechs"
SSvirtualreality.add_mech(src, remote_network)
SSvirtualreality.add_mech(src, remote_network)
if(hatch_closed)
hatch_closed = FALSE
dummy = new /mob/living/carbon/human/industrial_xion_remote_mech(get_turf(src))
dummy = new dummy_type(get_turf(src))
dummy.real_name = "Remote-Bot"
dummy.name = dummy.real_name
dummy.mmi = new /obj/item/device/mmi(dummy) // this is literally just because i luck the aesthetics - geeves
dummy.verbs -= /mob/living/proc/ventcrawl
dummy.verbs -= /mob/living/proc/hide
dummy.update_icon()
if(dummy_colour)
dummy.color = dummy_colour
enter(dummy, TRUE)
@@ -258,5 +265,7 @@
if(!hatch_closed)
hatch_closed = TRUE
hatch_locked = TRUE
hardpoints_locked = TRUE
force_locked = TRUE
if(does_hardpoint_lock)
hardpoints_locked = TRUE
force_locked = TRUE
update_icon()

View File

@@ -19,6 +19,7 @@
name = "remote mining mecha"
dummy_colour = "#ffc44f"
remote_network = "remotemechs"
does_hardpoint_lock = FALSE
/mob/living/heavy_vehicle/premade/miner/remote_prison
name = "penal mining mecha"

View File

@@ -152,8 +152,17 @@
name = "remote power loader"
dummy_colour = "#ffc44f"
remote_network = "remotemechs"
does_hardpoint_lock = FALSE
/mob/living/heavy_vehicle/premade/ripley/remote_prison
name = "penal power loader"
dummy_colour = "#302e2b"
remote_network = "prisonmechs"
remote_network = "prisonmechs"
/mob/living/heavy_vehicle/premade/ripley/remote_ai
name = "stationbound power loader"
e_color = COLOR_GREEN_GRAY
dummy_colour = COLOR_GREEN_GRAY
dummy_type = /mob/living/simple_animal/spiderbot/ai
remote_network = "aimechs"
does_hardpoint_lock = FALSE

View File

@@ -58,6 +58,12 @@
if(!gibbed && deathmessage != "no message") // This is gross, but reliable. Only brains use it.
src.visible_message("<b>\The [src.name]</b> [deathmessage]", range = messagerange)
// If we have a remotely controlled mob, we come back to our body to die properly
if(vr_mob)
vr_mob.body_return()
// Alternatively, if we are the remotely controlled mob, just kick our controller out
if(old_mob)
body_return()
stat = DEAD
update_canmove()

View File

@@ -1,7 +1,7 @@
// At minimum every mob has a hear_say proc.
/mob/proc/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "",var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
if(!istype(src, /mob/living/test) && !client)
if(!istype(src, /mob/living/test) && (!client && !vr_mob))
return
if(speaker && !istype(speaker, /mob/living/test) && (!speaker.client && istype(src,/mob/abstract/observer) && client.prefs.toggles & CHAT_GHOSTEARS && !(speaker in view(src))))
@@ -21,7 +21,7 @@
italics = 1
sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
if(sleeping || stat == 1)
if((sleeping && !vr_mob) || stat == 1)
hear_sleep(message)
return
@@ -82,17 +82,20 @@
/mob/proc/on_hear_say(var/message)
to_chat(src, message)
if(vr_mob)
to_chat(vr_mob, message)
/mob/living/silicon/on_hear_say(var/message)
var/time = say_timestamp()
to_chat(src, "[time] [message]")
if(vr_mob)
to_chat(vr_mob, "[time] [message]")
/mob/proc/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="")
if(!client)
if(!client && !vr_mob)
return
if(sleeping || stat==1) //If unconscious or sleeping
if((sleeping && !vr_mob) || stat==1) //If unconscious or sleeping
hear_sleep(message)
return
@@ -209,6 +212,8 @@
/mob/proc/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
to_chat(src, "[part_a][speaker_name][part_b][formatted]")
if(vr_mob)
to_chat(vr_mob, "[part_a][speaker_name][part_b][formatted]")
/mob/abstract/observer/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
to_chat(src, "[track][part_a][speaker_name][part_b][formatted]")
@@ -216,10 +221,14 @@
/mob/living/silicon/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
var/time = say_timestamp()
to_chat(src, "[time][part_a][speaker_name][part_b][formatted]")
if(vr_mob)
to_chat(vr_mob, "[time][part_a][speaker_name][part_b][formatted]")
/mob/living/silicon/ai/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
var/time = say_timestamp()
to_chat(src, "[time][part_a][track][part_b][formatted]")
if(vr_mob)
to_chat(vr_mob, "[time][part_a][track][part_b][formatted]")
/mob/proc/hear_signlang(var/message, var/verb = "gestures", var/datum/language/language, var/mob/speaker = null)
if(!client || !speaker)

View File

@@ -108,7 +108,7 @@
if(H && show_ssd && !client && !teleop)
if(H.bg)
to_chat(H, span("danger", "You sense some disturbance to your physical body!"))
else
else if(!vr_mob)
visible_message(span("notice", "[M] [action] [src], but they do not respond... Maybe they have S.S.D?"))
else if(client && willfully_sleeping)
visible_message(span("notice", "[M] [action] [src] waking [t_him] up!"))
@@ -271,7 +271,7 @@
if(H && show_ssd && !client && !teleop)
if(H.bg)
to_chat(H, span("warning", "You sense some disturbance to your physical body, like someone is trying to wake you up."))
else
else if(!vr_mob)
M.visible_message(span("notice", "[M] shakes [src] trying to wake [t_him] up!"), \
span("notice", "You shake [src], but they do not respond... Maybe they have S.S.D?"))
else if(lying)

View File

@@ -26,7 +26,7 @@
willfully_sleeping = FALSE
else
to_chat(H, span("danger", "You sense great disturbance to your physical body!"))
else
else if(!vr_mob)
visible_message(span("danger","[src] is hit by [AM], but they do not respond... Maybe they have S.S.D?"))
else if(client && willfully_sleeping)
visible_message(span("danger", "[src] is hit by [AM] waking [t_him] up!"))
@@ -54,7 +54,7 @@
willfully_sleeping = FALSE
else
to_chat(H, span("danger", "You sense great disturbance to your physical body!"))
else
else if(!vr_mob)
visible_message("<span class='danger'>[P] hit [src], but they do not respond... Maybe they have S.S.D?</span>")
else if(client && willfully_sleeping)
visible_message("<span class='danger'>[P] hit [src] waking [t_him] up!</span>")
@@ -80,7 +80,7 @@
willfully_sleeping = FALSE
else
to_chat(H, span("danger", "You sense great disturbance to your physical body!"))
else
else if(!vr_mob)
user.visible_message("<span class='danger'>[user] attacks [src] with [I] waking [t_him] up!</span>", \
"<span class='danger'>You attack [src] with [I], but they do not respond... Maybe they have S.S.D?</span>")
else if(client && willfully_sleeping)

View File

@@ -114,11 +114,6 @@
return
/mob/living/carbon/human/proc/vr_disconnect()
// Come out of VR right before you die, how depressing - geeves
// Also come out of VR if your VR body dies
if(vr_mob || old_mob)
body_return()
if(remote_network)
SSvirtualreality.remove_robot(src, remote_network)
remote_network = null

View File

@@ -324,7 +324,7 @@
if(H && show_ssd && !H.client && !H.teleop)
if(H.bg)
to_chat(H, span("danger", "You sense some disturbance to your physical body!"))
else
else if(!vr_mob)
message = "<span class='danger'>slaps [M] across the face, but they do not respond... Maybe they have S.S.D?</span>"
else if(H.client && H.willfully_sleeping)
message = "<span class='danger'>slaps [M] across the face, waking them up. Ouch!</span>"

View File

@@ -262,9 +262,9 @@
if(species.show_ssd && (!species.has_organ[BP_BRAIN] || has_brain()) && stat != DEAD)
if(!key)
if(!vr_mob && !key)
msg += "<span class='deadsay'>[T.He] [T.is] [species.show_ssd]. It doesn't look like [T.he] [T.is] waking up anytime soon.</span>\n"
else if(!client && !bg)
else if(!vr_mob && !client && !bg)
msg += "<span class='deadsay'>[T.He] [T.is] [species.show_ssd].</span>\n"
if(have_client && ((inactivity / 600) > 10)) // inactivity/10/60 > 10 MINUTES
msg += "<span class='deadsay'>\[Inactive for [round(inactivity / 600)] minutes.\]\n</span>"

View File

@@ -721,7 +721,7 @@
return 0
//SSD check, if a logged player is awake put them back to sleep!
if(species.show_ssd && !client && !teleop)
if(species.show_ssd && (!client && !vr_mob) && !teleop)
Sleeping(2)
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
blinded = 1

View File

@@ -20,6 +20,7 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/core,
/mob/living/silicon/ai/proc/pick_icon,
/mob/living/silicon/ai/proc/sensor_mode,
/mob/living/silicon/ai/proc/remote_control_mech,
/mob/living/silicon/ai/proc/show_laws_verb,
/mob/living/silicon/ai/proc/toggle_acceleration,
/mob/living/silicon/ai/proc/toggle_camera_light,
@@ -310,6 +311,7 @@ var/list/ai_verbs_default = list(
if(id_card)
id_card.registered_name = pickedName
id_card.assignment = "AI"
id_card.access = get_all_station_access()
id_card.update_name()
if(client)
@@ -772,6 +774,12 @@ var/list/ai_verbs_default = list(
set desc = "Augment visual feed with internal sensor overlays"
toggle_sensor_mode()
/mob/living/silicon/ai/proc/remote_control_mech()
set name = "Remote Control Mech"
set category = "AI Commands"
set desc = "Remotely control any active mechs on your AI mech network."
SSvirtualreality.mech_selection(src, "aimechs")
/mob/living/silicon/ai/proc/toggle_hologram_movement()
set name = "Toggle Hologram Movement"
set category = "AI Commands"

View File

@@ -16,4 +16,5 @@
card.update_icon()
. = ..(gibbed,"gives one shrill beep before falling lifeless.")
density = 1
density = TRUE
ghostize(FALSE)

View File

@@ -12,6 +12,7 @@
var/obj/item/cell/cell = null
var/obj/machinery/camera/camera = null
var/obj/item/device/mmi/mmi = null
var/obj/item/card/id/internal_id = null
var/list/req_access = list(access_robotics) //Access needed to pop out the brain.
var/positronic
@@ -44,8 +45,9 @@
/mob/living/simple_animal/spiderbot/Initialize()
. = ..()
add_language("Ceti Basic")
default_language = all_languages["Ceti Basic"]
add_language(LANGUAGE_TCB)
default_language = all_languages[LANGUAGE_TCB]
internal_id = new /obj/item/card/id(src)
verbs |= /mob/living/proc/ventcrawl
verbs |= /mob/living/proc/hide
@@ -302,3 +304,7 @@
/mob/living/simple_animal/spiderbot/get_bullet_impact_effect_type(var/def_zone)
return BULLET_IMPACT_METAL
/mob/living/simple_animal/spiderbot/ai/Initialize()
. = ..()
internal_id.access = get_all_station_access()

View File

@@ -7,6 +7,7 @@
var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
var/can_buckle = TRUE
var/obj/screen/flash = null
var/obj/screen/blind = null

View File

@@ -62,6 +62,16 @@
/atom/proc/contents_nano_distance(var/src_object, var/mob/living/user)
return user.shared_living_nano_distance(src_object)
/mob/living/heavy_vehicle/contents_nano_distance(src_object, mob/living/user)
if(src_object in contents)
return STATUS_INTERACTIVE
if(hatch_closed && body.pilot_coverage == 100 && !istype(user, /mob/living/simple_animal/spiderbot)) // spiderbots get a pass cuz they need a bone, call it RFID bullshit
to_chat(user, SPAN_WARNING("You can't interact with things outside \the [src] if its hatch is closed!"))
return STATUS_CLOSE
if(!src.Adjacent(src_object))
return STATUS_CLOSE
return STATUS_INTERACTIVE
/mob/living/proc/shared_living_nano_distance(var/atom/movable/src_object)
if (!(src_object in view(4, src))) // If the src object is not in visable, disable updates
return STATUS_CLOSE
@@ -79,7 +89,10 @@
. = shared_nano_interaction(src_object)
if(. != STATUS_CLOSE)
if(loc)
. = min(., loc.contents_nano_distance(src_object, src))
if(istype(loc, /mob/living/heavy_vehicle))
return loc.contents_nano_distance(src_object, src)
else
. = min(., loc.contents_nano_distance(src_object, src))
if(. == STATUS_INTERACTIVE)
return STATUS_UPDATE
@@ -87,6 +100,9 @@
. = shared_nano_interaction(src_object)
if(. != STATUS_CLOSE)
if(loc)
. = min(., loc.contents_nano_distance(src_object, src))
if(istype(loc, /mob/living/heavy_vehicle))
. = loc.contents_nano_distance(src_object, src)
else
. = min(., loc.contents_nano_distance(src_object, src))
else
. = min(., shared_living_nano_distance(src_object))
. = min(., shared_living_nano_distance(src_object))

View File

@@ -0,0 +1,22 @@
/datum/design/circuit/exosuit_upgrade
design_order = 2.6
/datum/design/circuit/exosuit_upgrade/AssembleDesignName()
name = "Exosuit Hardware Upgrade ([name])"
/datum/design/circuit/exosuit/AssembleDesignDesc()
desc = "Complex circuitry which unlock certain exosuit faculties."
/datum/design/circuit/exosuit_upgrade/remote
name = "Standard Remote Control"
req_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4, TECH_MATERIAL = 4)
build_path = /obj/item/remote_mecha
/datum/design/circuit/exosuit_upgrade/remote/penal
name = "Penal Remote Control"
build_path = /obj/item/remote_mecha/penal
/datum/design/circuit/exosuit_upgrade/remote/ai
name = "AI Remote Control"
req_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 4, TECH_MATERIAL = 4)
build_path = /obj/item/remote_mecha/ai

View File

@@ -0,0 +1,17 @@
/datum/design/item/deployable_kit
design_order = 11
/datum/design/item/deployable_kit/AssembleDesignName()
name = "Deployable Kit Design ([name])"
/datum/design/item/deployable_kit/mech_chair
name = "Remote Mech Centre"
desc = "A deployable kit of a remote mech chair, capable of listening in to standard remote mech networks."
req_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4, TECH_MATERIAL = 4)
materials = list(DEFAULT_WALL_MATERIAL = 3000, MATERIAL_SILVER = 750, MATERIAL_URANIUM = 250)
build_path = /obj/item/deployable_kit/remote_mech
/datum/design/item/deployable_kit/mech_chair/brig
name = "Remote Penal Mech Centre"
desc = "A deployable kit of a remote mech chair, capable of listening in to penal remote mech networks."
build_path = /obj/item/deployable_kit/remote_mech/brig

View File

@@ -100,6 +100,8 @@
/obj/structure/lift/panel/interact(var/mob/user)
if(!..())
return
if(istype(user, /mob/living/heavy_vehicle)) // terrible, i know, but it shat out runtimes otherwise
user = usr
var/dat = list()
dat += "<html><body><hr><b>Lift panel</b><hr>"