Files
Bubberstation/code/game/objects/items/botpad_remote.dm
YusufEmirKoroglu bd12e19692 Adds bot launch pad (#70267)
* Adds botpad and remote

* Update botlaunchpad.dm

* Update code/modules/research/designs/misc_designs.dm

Fikou's suggested change

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>

* converted chat messages to balloon alerts

* simplified ballon alerts and added 2 new ones

* adds a clicking sound effect to controller

* Typo

* removed a duplicate ballon alert

* last tweaks to balloon alerts

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>

* Update code/game/objects/items/botpad_remote.dm

Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>

* Update code/game/objects/items/botpad_remote.dm

Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>

* Update code/game/objects/items/botpad_remote.dm

Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>

* requested changes

* parent calling

* test

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>

* Update code/game/objects/items/botpad_remote.dm

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>

* Update botpad_remote.dm

* Update botlaunchpad.dm

* Update botlaunchpad.dm

* Update botlaunchpad.dm

* Update botpad_remote.dm

* Update machine_designs.dm

* changed the research category

* Update code/game/machinery/botlaunchpad.dm

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>
Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
2022-10-04 17:20:54 +00:00

58 lines
2.1 KiB
Plaintext

/obj/item/botpad_remote
name = "Bot pad controller"
desc = "Use this device to control the connected bot pad. Left-click for launch, right-click for recall."
icon = 'icons/obj/device.dmi'
icon_state = "botpad_controller"
w_class = WEIGHT_CLASS_SMALL
// ID of the remote, used for linking up
var/id = "botlauncher"
var/obj/machinery/botpad/connected_botpad
/obj/item/botpad_remote/Destroy()
if(connected_botpad)
connected_botpad.connected_remote = null
connected_botpad = null
return ..()
/obj/item/botpad_remote/attack_self(mob/living/user)
playsound(src, get_sfx(SFX_TERMINAL_TYPE), 25, FALSE)
try_launch(user)
return
/obj/item/botpad_remote/attack_self_secondary(mob/living/user)
playsound(src, get_sfx(SFX_TERMINAL_TYPE), 25, FALSE)
if(connected_botpad)
connected_botpad.recall(user)
return
user?.balloon_alert(user, "Controller has no connected pad!")
return
/obj/item/botpad_remote/multitool_act(mob/living/user, obj/item/tool)
if(!multitool_check_buffer(user, tool))
return
var/obj/item/multitool/multitool = tool
if(istype(multitool.buffer, /obj/machinery/botpad))
var/obj/machinery/botpad/buffered_remote = multitool.buffer
if(buffered_remote == connected_botpad)
to_chat(user, span_warning("Controller cannot connect to its own botpad!"))
else if(!connected_botpad && istype(buffered_remote, /obj/machinery/botpad))
connected_botpad = buffered_remote
connected_botpad.connected_remote = src
connected_botpad.id = id
multitool.buffer = null
to_chat(user, span_notice("You connect the controller to the pad with data from the [multitool.name]'s buffer."))
else
to_chat(user, span_warning("Unable to upload!"))
/obj/item/botpad_remote/proc/try_launch(mob/living/user)
if(!connected_botpad)
user?.balloon_alert(user, "Controller has no connected pad!")
return
if(connected_botpad.panel_open)
user?.balloon_alert(user, "Connected pad has its panel open! It won't work!")
return
if(!(locate(/mob/living/simple_animal/bot) in get_turf(connected_botpad)))
user?.balloon_alert(user, "No bots detected on the pad!")
return
connected_botpad.launch(user)