diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 977b4a2a2aa..5bf804105a0 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -14,6 +14,7 @@ var/precision = TRUE // how close to the portal you will teleport. FALSE = on the portal, TRUE = adjacent var/can_multitool_to_remove = FALSE var/ignore_tele_proof_area_setting = FALSE + var/one_use = FALSE // Does this portal go away after one teleport? /obj/effect/portal/New(loc, turf/target, creator = null, lifespan = 300) ..() @@ -110,7 +111,8 @@ if(!do_teleport(M, target, precision, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to a turf adjacent to target. invalid_teleport() return FALSE - + if(one_use) + qdel(src) return TRUE /obj/effect/portal/proc/invalid_teleport() diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 675e67aa1a6..87f402939dc 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -50,6 +50,10 @@ /obj/item/radio/beacon/bacon/proc/digest_delay() QDEL_IN(src, 600) +/obj/item/radio/beacon/emagged + syndicate = TRUE + emagged = TRUE + // SINGULO BEACON SPAWNER /obj/item/radio/beacon/syndicate name = "suspicious beacon" diff --git a/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm b/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm index aefe73f6258..913225a6f1e 100644 --- a/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm +++ b/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm @@ -28,6 +28,7 @@ /datum/rep_purchase/item/pinpointer, /datum/rep_purchase/item/baton, /datum/rep_purchase/item/fulton, + /datum/rep_purchase/item/flare, /datum/rep_purchase/blackout, /datum/rep_purchase/item/zippo, /datum/rep_purchase/item/balloon, diff --git a/code/modules/antagonists/traitor/contractor/datums/rep_purchases/flare.dm b/code/modules/antagonists/traitor/contractor/datums/rep_purchases/flare.dm new file mode 100644 index 00000000000..005a6f60c34 --- /dev/null +++ b/code/modules/antagonists/traitor/contractor/datums/rep_purchases/flare.dm @@ -0,0 +1,9 @@ +/** + * # Rep Purchase - Emergency escape flare + */ +/datum/rep_purchase/item/flare + name = "Emergency extraction kit" + description = "A kit that comes with an emergency escape flare, which will allow you to teleport to any beacon after a short activation delay. Also comes with a Syndicate teleporter beacon that only these flares and emagged teleporters can target." + cost = 2 + stock = 3 + item_type = /obj/item/storage/box/syndie_kit/escape_flare diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm index 98c5669fd72..dc2d9273a95 100644 --- a/code/modules/mining/equipment/wormhole_jaunter.dm +++ b/code/modules/mining/equipment/wormhole_jaunter.dm @@ -89,3 +89,87 @@ if(ishuman(L)) shake_camera(L, 20, 1) addtimer(CALLBACK(L, /mob/living/carbon.proc/vomit), 20) + +/obj/item/wormhole_jaunter/contractor + name = "emergency extraction flare" + icon = 'icons/obj/lighting.dmi' + desc = "A single-use extraction flare that will let you create a portal to any beacon on the station. You must choose the destination beforehand, else it will target a random beacon. The portal is generated 5 seconds after activation, and has 1 use." + icon_state = "flare-contractor" + item_state = "flare" + var/destination + +/obj/item/wormhole_jaunter/contractor/verb/set_destination() + set category = "Object" + set name = "Change Portal Destination" + set src in usr + + var/list/L = list() + var/list/areaindex = list() + + for(var/obj/item/radio/beacon/R in GLOB.beacons) + var/turf/T = get_turf(R) + if(!T) + continue + if(!is_teleport_allowed(T.z)) + continue + var/tmpname = T.loc.name + if(areaindex[tmpname]) + tmpname = "[tmpname] ([++areaindex[tmpname]])" + else + areaindex[tmpname] = 1 + L[tmpname] = R + + var/desc = input("Please select a location to target.", "Flare Target Interface") in L + destination = L[desc] + return + +/obj/item/wormhole_jaunter/contractor/attack_self(mob/user) // message is later down + activate(user, TRUE) + +/obj/item/wormhole_jaunter/contractor/activate(mob/user) + if(!turf_check(user)) + return + if(!destination) + var/list/L = get_destinations(user) + if(!length(L)) + to_chat(user, "[src] found no beacons in the sector to target.") + return + destination = pick(L) + var/obj/effect/temp_visual/getaway_flare/F = new(get_turf(src)) + user.visible_message("[user] pulls out a black and gold flare and lights it.",\ + "You light an emergency extraction flare, initiating the extraction process.") + user.drop_item() + forceMove(F) + addtimer(CALLBACK(src, .proc/create_portal, destination), 5 SECONDS) + +/obj/item/wormhole_jaunter/contractor/proc/create_portal(turf/destination) + new /obj/effect/decal/cleanable/ash(get_turf(src)) + new /obj/effect/portal/redspace/getaway(get_turf(src), get_turf(destination), src, 100) + qdel(src) + +/obj/item/wormhole_jaunter/contractor/emag_act(mob/user) + to_chat(user, "Emagging [src] has no effect.") + +/obj/item/wormhole_jaunter/contractor/chasm_react(mob/user) + return //This is not an instant getaway portal like the jaunter + +/obj/item/storage/box/syndie_kit/escape_flare + name = "emergency extraction kit" + +/obj/item/storage/box/syndie_kit/escape_flare/populate_contents() + new /obj/item/wormhole_jaunter/contractor(src) + new /obj/item/radio/beacon/emagged(src) + +/obj/effect/portal/redspace/getaway + one_use = TRUE + +/obj/effect/temp_visual/getaway_flare // Because the original contractor flare is not a temp visual, for some reason. + name = "contractor extraction flare" + icon = 'icons/obj/lighting.dmi' + icon_state = "flare-contractor-on" + duration = 5.1 SECONDS // Needs to be slightly longer then the callback to make the portal + +/obj/effect/temp_visual/getaway_flare/Initialize() + . = ..() + playsound(loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, TRUE) + set_light(8, l_color = "#FFD165") diff --git a/icons/obj/lighting.dmi b/icons/obj/lighting.dmi index 60ffb6462f9..4886978ff48 100644 Binary files a/icons/obj/lighting.dmi and b/icons/obj/lighting.dmi differ diff --git a/paradise.dme b/paradise.dme index 379fb3f1fb9..a6b2a53c467 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1225,6 +1225,7 @@ #include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\balloon.dm" #include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\baton.dm" #include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\blackout.dm" +#include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\flare.dm" #include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\fulton.dm" #include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\pinpointer.dm" #include "code\modules\antagonists\traitor\contractor\datums\rep_purchases\reroll.dm"