Skip to content

Commit

Permalink
E.G.O. telepads (Extraction officer update) (vlggms#2412)
Browse files Browse the repository at this point in the history
EGO telepads

update
  • Loading branch information
Coxswain-Navigator authored Oct 1, 2024
1 parent 12ba874 commit 70e2976
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 4 deletions.
45 changes: 41 additions & 4 deletions ModularTegustation/tegu_items/extraction/egodelivery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,32 @@
icon_state = "coffin_empty"
var/selected_level = ZAYIN_LEVEL
var/obj/stored_item = null
var/obj/structure/extraction_belt/linked_structure

/obj/item/extraction/delivery/examine(mob/user)
. = ..()
if(linked_structure)
. += span_nicegreen("This tool is linked to an extraction arrival belt.")
else
. += span_red("This tool needs to be linked to an extraction arrival belt in order to perform E.G.O. returns.")

/obj/item/extraction/delivery/tool_action(mob/user)
if(!stored_item)
ui_interact(user)
return
user.playsound_local(user, 'sound/machines/terminal_prompt.ogg', 50, FALSE)
switch(tgui_alert(user,"Where will you send this [stored_item.name]?","E.G.O. Delivery Prompt",list("Here","An Agent","Cancel")))
switch(tgui_alert(user,"Where will you send this [stored_item.name]?","E.G.O. Delivery Prompt",list("Here","An Agent","Arrival", "Cancel")))
if("Here")
user.playsound_local(user, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
user.playsound_local(user, 'sound/weapons/emitter2.ogg', 25, FALSE)
new stored_item(get_turf(src))
var/datum/effect_system/spark_spread/sparks = new
sparks.set_up(5, 1, get_turf(src))
sparks.attach(stored_item)
sparks.start()
stored_item = null
if(linked_structure)
var/obj/structure/return_pad/THEPAD = new(get_turf(src))
THEPAD.linked_structure = linked_structure
if("An Agent")
user.playsound_local(user, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
var/M = input(user,"To whom would you like to send the E.G.O.?","Select Someone") as null|anything in AllLivingAgents()
Expand All @@ -29,15 +40,30 @@
to_chat(user, span_warning("Nobody was specified."))
return
new stored_item(get_turf(M))
user.playsound_local(user, 'sound/machines/twobeep.ogg', 50, FALSE)
playsound(get_turf(M), 'sound/machines/twobeep.ogg', 50, FALSE)
user.playsound_local(user, 'sound/weapons/emitter2.ogg', 25, FALSE)
playsound(get_turf(M), 'sound/weapons/emitter2.ogg', 25, FALSE)
to_chat(user, span_notice("[stored_item.name] has been shipped to [M]!"))
to_chat(M, span_notice("[stored_item.name] has been shipped to your location by the Extraction Officer!"))
var/datum/effect_system/spark_spread/sparks = new
sparks.set_up(5, 1, get_turf(M))
sparks.attach(stored_item)
sparks.start()
stored_item = null
if(linked_structure)
var/obj/structure/return_pad/THEPAD = new(get_turf(M))
THEPAD.linked_structure = linked_structure
if("Arrival")
if(!linked_structure)
user.playsound_local(user, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE)
to_chat(user, span_warning("ERROR - E.G.O. ARRIVAL BELT UNLINKED"))
return
user.playsound_local(user, 'sound/weapons/emitter2.ogg', 25, FALSE)
new stored_item(get_turf(linked_structure))
to_chat(user, span_notice("[stored_item.name] has been shipped to the extraction belt!"))
var/datum/effect_system/spark_spread/sparks = new
sparks.attach(stored_item)
sparks.start()
stored_item = null
if("Cancel")
user.playsound_local(user, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE)
update_icon()
Expand Down Expand Up @@ -117,3 +143,14 @@
icon_state = "coffin_empty"
return
icon_state = "coffin"

// Telepad-related code
/obj/item/extraction/delivery/pre_attack(atom/A, mob/living/user, params)
. = ..()
if(!tool_checks(user))
return FALSE //You can't do any special interactions
if(istype(A, /obj/structure/extraction_belt))
linked_structure = A
to_chat(usr, span_nicegreen("Device link successful."))
return FALSE
return TRUE
43 changes: 43 additions & 0 deletions ModularTegustation/tegu_items/extraction/egotelepad.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/obj/structure/return_pad
name = "E.G.O. return pad"
desc = "A device developed in a partnership with W-Corp for safe and insant transportation of E.G.O. to the extraction department."
icon = 'icons/obj/telescience.dmi'
icon_state = "qpad-idle"
var/obj/structure/extraction_belt/linked_structure
var/available_teleports = 3
var/ready = FALSE

/obj/structure/return_pad/Initialize()
. = ..()
QDEL_IN(src, 45 SECONDS)
addtimer(CALLBACK(src, PROC_REF(Warmup)), 1 SECONDS)

/obj/structure/return_pad/Destroy()
linked_structure = null
return ..()

/obj/structure/return_pad/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clothing/suit/armor/ego_gear) || istype(I, /obj/item/gun/ego_gun/pistol) || istype(I, /obj/item/ego_weapon) || istype(I, /obj/item/gun/ego_gun))
TryTeleport(I)
return
return ..()

/obj/structure/return_pad/proc/Warmup() // This proc basically exists so that people don't accidently toss items in it the instant it spawns
ready = TRUE

/obj/structure/return_pad/proc/TryTeleport(obj/item/I)
if(!linked_structure)
visible_message(span_warning("ERROR - NO LINKED STRUCTURE!"))
qdel(src)
return
if(!ready)
visible_message(span_warning("ERROR - Warming up. Please wait one second."))
return
flick("qpad-beam", src)
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, TRUE)
playsound(get_turf(linked_structure), 'sound/weapons/emitter2.ogg', 25, TRUE)
do_teleport(I, get_turf(linked_structure),null,TRUE,null,null,null,null,TRUE, channel = TELEPORT_CHANNEL_FREE) // Don't want anything interrupting it
available_teleports -= 1
if(!available_teleports)
visible_message(span_warning("[src] fizzles out and disappears!"))
qdel(src)
1 change: 1 addition & 0 deletions lobotomy-corp13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4123,6 +4123,7 @@
#include "ModularTegustation\tegu_items\extraction\_extraction.dm"
#include "ModularTegustation\tegu_items\extraction\egodelivery.dm"
#include "ModularTegustation\tegu_items\extraction\egosurgery.dm"
#include "ModularTegustation\tegu_items\extraction\egotelepad.dm"
#include "ModularTegustation\tegu_items\extraction\key.dm"
#include "ModularTegustation\tegu_items\extraction\lock.dm"
#include "ModularTegustation\tegu_items\extraction\toolextractor.dm"
Expand Down

0 comments on commit 70e2976

Please sign in to comment.