mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 17:45:02 +01:00
Cargo Update: Cargo Supplypod Beacons! (#37345)
(THE CODEX ASTARTES CALLS THIS MANEUVER: STEEL RAIN) [New sprite!] * file the boy asdh beacon overlays first pass complete bring out the drinks boys fixes! fixes! whups fix name speed makes coffin a crate to prevent runtimes sprite fuckup:the musical whups more fixes why tf was screengen modified??? TO THE FILE devices changes things p[omf pomf uhg alright fuk it issue fix pt 1 in which i make merge conflicts my bitch by fixing devices.dmi and tgui.js oh shit forgot about the items repath hm nah merge conflict a then all ya gotta do is whip * shiv review me code reeeeeeeeeeeeeeee * rebase conflict * anturk * asdf * wooooeeeeeeh makin bacon * dont forget about lil old me * id like to give a shoutout, to my man spacemaniac. on the soul plane. rip in peice, my bugs. rip in peice * spacy man what is ur spacy plan * 1st * 2nd * organization also a thing * so i figured out why defines didnt work sometimes across files. this fixes the last issue rn * forgot to cop the commit * fuck how am i so stupid * adds comments and agrees with spacemaniac * asdfghjk
This commit is contained in:
committed by
Tad Hardesty
parent
729ad5578f
commit
32c8d0abc5
@@ -387,7 +387,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
|
||||
return H.reagents.has_reagent("holy water")
|
||||
return 0
|
||||
if(BANISH_COFFIN)
|
||||
return (body && istype(body.loc, /obj/structure/closet/coffin))
|
||||
return (body && istype(body.loc, /obj/structure/closet/crate/coffin))
|
||||
if(BANISH_FORMALDYHIDE)
|
||||
if(iscarbon(body))
|
||||
var/mob/living/carbon/H = body
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
export_types = list(/obj/structure/closet/crate/wooden)
|
||||
exclude_types = list()
|
||||
|
||||
|
||||
/datum/export/large/crate/coffin
|
||||
cost = 250//50 wooden crates cost 2000 points, and you can make 10 coffins in seconds with those planks. Each coffin selling for 250 means you can make a net gain of 500 points for wasting your time making coffins.
|
||||
unit_name = "coffin"
|
||||
export_types = list(/obj/structure/closet/crate/coffin)
|
||||
|
||||
/datum/export/large/reagent_dispenser
|
||||
cost = 100 // +0-400 depending on amount of reagents left
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
#define MAX_EMAG_ROCKETS 8
|
||||
#define BEACON_COST 5000
|
||||
#define SP_LINKED 1
|
||||
#define SP_READY 2
|
||||
#define SP_LAUNCH 3
|
||||
#define SP_UNLINK 4
|
||||
#define SP_UNREADY 5
|
||||
|
||||
/obj/machinery/computer/cargo/express
|
||||
name = "express supply console"
|
||||
desc = "This console allows the user to purchase a package \
|
||||
with 1/40th of the delivery time: made possible by NanoTrasen's new \"Drop Pod Railgun\".\
|
||||
with 1/40th of the delivery time: made possible by NanoTrasen's new \"1500mm Orbital Railgun\".\
|
||||
All sales are near instantaneous - please choose carefully"
|
||||
icon_screen = "supply_express"
|
||||
circuit = /obj/item/circuitboard/computer/cargo/express
|
||||
blockade_warning = "Bluespace instability detected. Delivery impossible."
|
||||
req_access = list(ACCESS_QM)
|
||||
var/message
|
||||
var/locked = TRUE
|
||||
var/printed_beacons = 0 //number of beacons printed. Used to determine beacon names.
|
||||
var/list/meme_pack_data
|
||||
var/podID = 0//0 is your standard supply droppod (requires dissassembly after landing), 1 is the bluespace drop pod (teleports out after landing)
|
||||
var/obj/item/supplypod_beacon/beacon //the linked supplypod beacon
|
||||
var/area/landingzone = /area/quartermaster/storage //where we droppin boys
|
||||
var/podID = POD_STANDARD //0 is your standard supply supplypod (requires dissassembly after landing), 1 is the bluespace supply pod (teleports out after landing)
|
||||
var/cooldown = 0 //cooldown to prevent printing supplypod beacon spam
|
||||
var/locked = TRUE //is the console locked? unlock with ID
|
||||
var/usingBeacon = FALSE //is the console in beacon mode? exists to let beacon know when a pod may come in
|
||||
|
||||
/obj/machinery/computer/cargo/express/Initialize()
|
||||
. = ..()
|
||||
packin_up()
|
||||
|
||||
/obj/machinery/computer/cargo/express/Destroy()
|
||||
if(beacon)
|
||||
beacon.unlink_console()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params)
|
||||
if((istype(W, /obj/item/card/id) || istype(W, /obj/item/pda)) && allowed(user))
|
||||
@@ -25,17 +40,24 @@
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the interface.</span>")
|
||||
return
|
||||
else if(istype(W, /obj/item/disk/cargo/bluespace_pod))
|
||||
podID = 1//doesnt effect circuit board, so that reversal is possible
|
||||
podID = POD_BLUESPACE//doesnt effect circuit board, making reversal possible
|
||||
to_chat(user, "<span class='notice'>You insert the disk into [src], allowing for advanced supply delivery vehicles.</span>")
|
||||
qdel(W)
|
||||
return TRUE
|
||||
else if(istype(W, /obj/item/supplypod_beacon))
|
||||
var/obj/item/supplypod_beacon/sb = W
|
||||
if (sb.express_console != src)
|
||||
sb.link_console(src, user)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] is already linked to [sb].</span>")
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/cargo/express/emag_act(mob/living/user)
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
"<span class='notice'>You change the routing protocols, allowing the Drop Pod to land anywhere on the station.</span>")
|
||||
"<span class='notice'>You change the routing protocols, allowing the Supply Pod to land anywhere on the station.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
// This also sets this on the circuit board
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
@@ -68,29 +90,58 @@
|
||||
ui = new(user, src, ui_key, "cargo_express", name, 1000, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_data(mob/user)
|
||||
var/canBeacon = beacon && (isturf(beacon.loc) || ismob(beacon.loc))//is the beacon in a valid location?
|
||||
var/list/data = list()
|
||||
data["locked"] = locked
|
||||
data["locked"] = locked//swipe an ID to unlock
|
||||
data["siliconUser"] = user.has_unlimited_silicon_privilege
|
||||
data["beaconzone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui
|
||||
data["usingBeacon"] = usingBeacon //is the mode set to deliver to the beacon or the cargobay?
|
||||
data["canBeacon"] = !usingBeacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location?
|
||||
data["canBuyBeacon"] = cooldown <= 0 && SSshuttle.points >= BEACON_COST
|
||||
data["beaconError"] = usingBeacon && !canBeacon ? "(BEACON ERROR)" : ""//changes button text to include an error alert if necessary
|
||||
data["hasBeacon"] = beacon != null//is there a linked beacon?
|
||||
data["beaconName"] = beacon ? beacon.name : "No Beacon Found"
|
||||
data["printMsg"] = cooldown > 0 ? "Print Beacon for [BEACON_COST] credits ([cooldown])" : "Print Beacon for [BEACON_COST] credits"//buttontext for printing beacons
|
||||
data["points"] = SSshuttle.points
|
||||
data["supplies"] = list()
|
||||
message = "Sales are near-instantaneous - please choose carefully."
|
||||
if(SSshuttle.supplyBlocked)
|
||||
message = blockade_warning
|
||||
if(usingBeacon && !beacon)
|
||||
message = "BEACON ERROR: BEACON MISSING"//beacon was destroyed
|
||||
else if (usingBeacon && !canBeacon)
|
||||
message = "BEACON ERROR: MUST BE EXPOSED"//beacon's loc/user's loc must be a turf
|
||||
if(obj_flags & EMAGGED)
|
||||
message = "(&!#@ERROR: ROUTING_#PROTOCOL MALF(*CT#ON. $UG%ESTE@ ACT#0N: !^/PULS3-%E)ET CIR*)ITB%ARD."
|
||||
|
||||
data["message"] = message
|
||||
if(!meme_pack_data)
|
||||
packin_up()
|
||||
stack_trace("You didn't give the cargo tech good advice, and he ripped the manifest. As a result, there was no pack data for [src]")
|
||||
data["supplies"] = meme_pack_data
|
||||
|
||||
if (cooldown > 0)//cooldown used for printing beacons
|
||||
cooldown--
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_act(action, params, datum/tgui/ui)
|
||||
switch(action)
|
||||
if("LZCargo")
|
||||
usingBeacon = FALSE
|
||||
if (beacon)
|
||||
beacon.update_status(SP_UNREADY) //ready light on beacon will turn off
|
||||
if("LZBeacon")
|
||||
usingBeacon = TRUE
|
||||
if (beacon)
|
||||
beacon.update_status(SP_READY) //turns on the beacon's ready light
|
||||
if("printBeacon")
|
||||
if (SSshuttle.points >= BEACON_COST)
|
||||
cooldown = 10//a ~ten second cooldown for printing beacons to prevent spam
|
||||
var/obj/item/supplypod_beacon/C = new /obj/item/supplypod_beacon(drop_location())
|
||||
C.link_console(src, usr)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc)
|
||||
printed_beacons++//printed_beacons starts at 0, so the first one out will be called beacon # 1
|
||||
beacon.name = "Supply Pod Beacon #[printed_beacons]"
|
||||
SSshuttle.points -= BEACON_COST
|
||||
|
||||
if("add")//Generate Supply Order first
|
||||
var/id = text2path(params["id"])
|
||||
var/datum/supply_pack/pack = SSshuttle.supply_packs[id]
|
||||
@@ -108,35 +159,43 @@
|
||||
rank = "Silicon"
|
||||
var/reason = ""
|
||||
var/list/empty_turfs
|
||||
var/area/landingzone
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
||||
if(!(obj_flags & EMAGGED))
|
||||
if(SO.pack.cost <= SSshuttle.points)
|
||||
landingzone = locate(/area/quartermaster/storage) in GLOB.sortedAreas
|
||||
for(var/turf/open/floor/T in landingzone.contents)
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
var/LZ = empty_turfs[rand(empty_turfs.len-1)]
|
||||
var/LZ
|
||||
if (istype(beacon) && usingBeacon)//prioritize beacons over landing in cargobay
|
||||
LZ = get_turf(beacon)
|
||||
beacon.update_status(SP_LAUNCH)
|
||||
else if (!usingBeacon)//find a suitable supplypod landing zone in cargobay
|
||||
landingzone = locate(/area/quartermaster/storage) in GLOB.sortedAreas
|
||||
if (!landingzone)
|
||||
WARNING("[src] couldnt find a Quartermaster/Storage (aka cargobay) area on the station, and as such it has set the supplypod landingzone to the area it resides in.")
|
||||
landingzone = get_area(src)
|
||||
for(var/turf/open/floor/T in landingzone.contents)//uses default landing zone
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
LZ = pick(empty_turfs)
|
||||
if (SO.pack.cost <= SSshuttle.points && LZ)//we need to call the cost check again because of the CHECK_TICK call
|
||||
SSshuttle.points -= SO.pack.cost
|
||||
new /obj/effect/DPtarget(LZ, SO, podID)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
else
|
||||
if(SO.pack.cost * (0.72*MAX_EMAG_ROCKETS) <= SSshuttle.points) // bulk discount :^)
|
||||
landingzone = locate(pick(GLOB.the_station_areas)) in GLOB.sortedAreas
|
||||
landingzone = locate(pick(GLOB.the_station_areas)) in GLOB.sortedAreas //override default landing zone
|
||||
for(var/turf/open/floor/T in landingzone.contents)
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
SSshuttle.points -= SO.pack.cost * (1.2*MAX_EMAG_ROCKETS)
|
||||
SSshuttle.points -= SO.pack.cost * (0.72*MAX_EMAG_ROCKETS)
|
||||
SO.generateRequisition(get_turf(src))
|
||||
for(var/i in 1 to MAX_EMAG_ROCKETS)
|
||||
var/LZ = empty_turfs[rand(empty_turfs.len-1)]
|
||||
var/LZ = pick(empty_turfs)
|
||||
LAZYREMOVE(empty_turfs, LZ)
|
||||
new /obj/effect/DPtarget(LZ, SO, podID)
|
||||
. = TRUE
|
||||
|
||||
@@ -2092,6 +2092,17 @@
|
||||
contains = list(/obj/item/storage/box/fountainpens)
|
||||
crate_type = /obj/structure/closet/crate/wooden
|
||||
|
||||
/datum/supply_pack/misc/funeral
|
||||
name = "Funeral Supply crate"
|
||||
desc = "At the end of the day, someone's gonna want someone dead. Give them a proper send-off with these funeral supplies! Contains a coffin with burial garmets and flowers."
|
||||
cost = 600
|
||||
contains = list(/obj/item/clothing/under/burial,
|
||||
/obj/item/reagent_containers/food/snacks/grown/harebell,
|
||||
/obj/item/reagent_containers/food/snacks/grown/poppy/geranium
|
||||
)
|
||||
crate_name = "coffin"
|
||||
crate_type = /obj/structure/closet/crate/coffin
|
||||
|
||||
/datum/supply_pack/misc/religious_supplies
|
||||
name = "Religious Supplies Crate"
|
||||
desc = "Keep your local chaplain happy and well-supplied, lest they call down judgement upon your cargo bay. Contains two bottles of holywater, bibles, chaplain robes, and burial garmets."
|
||||
@@ -2101,9 +2112,8 @@
|
||||
/obj/item/storage/book/bible/booze,
|
||||
/obj/item/storage/book/bible/booze,
|
||||
/obj/item/clothing/suit/hooded/chaplain_hoodie,
|
||||
/obj/item/clothing/suit/hooded/chaplain_hoodie,
|
||||
/obj/item/clothing/under/burial,
|
||||
/obj/item/clothing/under/burial)
|
||||
/obj/item/clothing/suit/hooded/chaplain_hoodie
|
||||
)
|
||||
crate_name = "religious supplies crate"
|
||||
|
||||
/datum/supply_pack/misc/toner
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
/obj/item/supplypod_beacon
|
||||
name = "Supply Pod Beacon"
|
||||
desc = "A device that can be linked to an Express Supply Console for precision supply pod deliveries. Alt-click to remove link."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "supplypod_beacon"
|
||||
item_state = "radio"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
var/obj/machinery/computer/cargo/express/express_console
|
||||
var/linked = FALSE
|
||||
var/ready = FALSE
|
||||
var/launched = FALSE
|
||||
|
||||
/obj/item/supplypod_beacon/proc/update_status(var/consoleStatus)
|
||||
switch(consoleStatus)
|
||||
if (SP_LINKED)
|
||||
linked = TRUE
|
||||
playsound(src,'sound/machines/twobeep.ogg',50,0)
|
||||
if (SP_READY)
|
||||
ready = TRUE
|
||||
if (SP_LAUNCH)
|
||||
launched = TRUE
|
||||
playsound(src,'sound/machines/triple_beep.ogg',50,0)
|
||||
playsound(src,'sound/machines/warning-buzzer.ogg',50,0)
|
||||
addtimer(CALLBACK(src, .proc/endLaunch), 33)//wait 3.3 seconds (time it takes for supplypod to land), then update icon
|
||||
if (SP_UNLINK)
|
||||
linked = FALSE
|
||||
playsound(src,'sound/machines/synth_no.ogg',50,0)
|
||||
if (SP_UNREADY)
|
||||
ready = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/item/supplypod_beacon/update_icon()
|
||||
cut_overlays()
|
||||
if (launched)
|
||||
add_overlay("sp_green")
|
||||
else if (ready)
|
||||
add_overlay("sp_yellow")
|
||||
else if (linked)
|
||||
add_overlay("sp_orange")
|
||||
|
||||
/obj/item/supplypod_beacon/proc/endLaunch()
|
||||
launched = FALSE
|
||||
update_status()
|
||||
|
||||
/obj/item/supplypod_beacon/examine(user)
|
||||
..()
|
||||
if(!express_console)
|
||||
to_chat(user, "<span class='notice'>[src] is not currently linked to a Express Supply console.</span>")
|
||||
|
||||
/obj/item/supplypod_beacon/Destroy()
|
||||
if(express_console)
|
||||
express_console.beacon = null
|
||||
return ..()
|
||||
|
||||
/obj/item/supplypod_beacon/proc/unlink_console()
|
||||
if(express_console)
|
||||
express_console.beacon = null
|
||||
express_console = null
|
||||
update_status(SP_UNLINK)
|
||||
update_status(SP_UNREADY)
|
||||
|
||||
/obj/item/supplypod_beacon/proc/link_console(obj/machinery/computer/cargo/express/C, mob/living/user)
|
||||
if (C.beacon)//if new console has a beacon, then...
|
||||
C.beacon.unlink_console()//unlink the old beacon from new console
|
||||
if (express_console)//if this beacon has an express console
|
||||
express_console.beacon = null//remove the connection the expressconsole has from beacons
|
||||
express_console = C//set the linked console var to the console
|
||||
express_console.beacon = src//out with the old in with the news
|
||||
update_status(SP_LINKED)
|
||||
if (express_console.usingBeacon)
|
||||
update_status(SP_READY)
|
||||
to_chat(user, "<span class='notice'>[src] linked to [C].</span>")
|
||||
|
||||
/obj/item/supplypod_beacon/AltClick(mob/user)
|
||||
if (!user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
if (express_console)
|
||||
unlink_console()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There is no linked console!</span>")
|
||||
|
||||
/obj/item/supplypod_beacon/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/pen)) //give a tag that is visible from the linked express console
|
||||
var/new_beacon_name = stripped_input(user, "What would you like the tag to be?")
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(new_beacon_name)
|
||||
name += " ([tag])"
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/datum/species/vampire/spec_life(mob/living/carbon/human/C)
|
||||
. = ..()
|
||||
if(istype(C.loc, /obj/structure/closet/coffin))
|
||||
if(istype(C.loc, /obj/structure/closet/crate/coffin))
|
||||
C.heal_overall_damage(4,4)
|
||||
C.adjustToxLoss(-4)
|
||||
C.adjustOxyLoss(-4)
|
||||
|
||||
Reference in New Issue
Block a user