The Express Console emag effect is now a proper emag effect (#34373)
* The Express Console emag effect is now a proper emag effect cyka blyat * Update expressconsole.dm * Update expressconsole.dm * Update expressconsole.dm * Update expressconsole.dm * Update expressconsole.dm * Update expressconsole.dm * Update expressconsole.dm * Update expressconsole.dm
This commit is contained in:
committed by
CitadelStationBot
parent
969a8ac9ef
commit
dcd61e0ba4
@@ -1,3 +1,5 @@
|
|||||||
|
#define MAX_EMAG_ROCKETS 8
|
||||||
|
|
||||||
/obj/machinery/computer/cargo/express
|
/obj/machinery/computer/cargo/express
|
||||||
name = "express supply console"
|
name = "express supply console"
|
||||||
desc = "This console allows the user to purchase a package for double the price,\
|
desc = "This console allows the user to purchase a package for double the price,\
|
||||||
@@ -9,7 +11,12 @@
|
|||||||
req_access = list(ACCESS_QM)
|
req_access = list(ACCESS_QM)
|
||||||
var/message
|
var/message
|
||||||
var/locked = TRUE
|
var/locked = TRUE
|
||||||
|
var/list/meme_pack_data
|
||||||
|
|
||||||
|
/obj/machinery/computer/cargo/express/Initialize()
|
||||||
|
. = ..()
|
||||||
|
packin_up()
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params)
|
/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params)
|
||||||
..()
|
..()
|
||||||
@@ -26,6 +33,26 @@
|
|||||||
// This also sets this on the circuit board
|
// This also sets this on the circuit board
|
||||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||||
board.emagged = TRUE
|
board.emagged = TRUE
|
||||||
|
packin_up()
|
||||||
|
|
||||||
|
/obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry
|
||||||
|
meme_pack_data = list() // sorry for what?
|
||||||
|
for(var/pack in SSshuttle.supply_packs) // our quartermaster taught us not to be ashamed of our supply packs
|
||||||
|
var/datum/supply_pack/P = SSshuttle.supply_packs[pack] // specially since they're such a good price and all
|
||||||
|
if(!meme_pack_data[P.group]) // yeah, I see that, your quartermaster gave you good advice
|
||||||
|
meme_pack_data[P.group] = list( // it gets cheaper when I return it
|
||||||
|
"name" = P.group, // mmhm
|
||||||
|
"packs" = list() // sometimes, I return it so much, I rip the manifest
|
||||||
|
) // see, my quartermaster taught me a few things too
|
||||||
|
if((P.hidden) || (P.special)) // like, how not to rip the manifest
|
||||||
|
continue// by using someone else's crate
|
||||||
|
if(!emagged && P.contraband) // will you show me?
|
||||||
|
continue // i'd be right happy to
|
||||||
|
meme_pack_data[P.group]["packs"] += list(list(
|
||||||
|
"name" = P.name,
|
||||||
|
"cost" = P.cost * 2, //displays twice the normal cost
|
||||||
|
"id" = pack
|
||||||
|
))
|
||||||
|
|
||||||
/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||||
@@ -48,35 +75,10 @@
|
|||||||
message = "(&!#@ERROR: ROUTING_#PROTOCOL MALF(*CT#ON. $UG%ESTE@ ACT#0N: !^/PULS3-%E)ET CIR*)ITB%ARD."
|
message = "(&!#@ERROR: ROUTING_#PROTOCOL MALF(*CT#ON. $UG%ESTE@ ACT#0N: !^/PULS3-%E)ET CIR*)ITB%ARD."
|
||||||
|
|
||||||
data["message"] = message
|
data["message"] = message
|
||||||
|
if(!meme_pack_data)
|
||||||
if (emagged)
|
packin_up()
|
||||||
for(var/pack in SSshuttle.supply_packs)
|
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]")
|
||||||
var/datum/supply_pack/P = SSshuttle.supply_packs[pack]
|
data["supplies"] = meme_pack_data
|
||||||
if (P.name == "Toy Crate")//Can only order toys if emagged. You gotta spend 10K points to crash a droppod somewhere on the station
|
|
||||||
data["supplies"][P.group] = list(
|
|
||||||
"name" = P.group,
|
|
||||||
"packs" = list()
|
|
||||||
)
|
|
||||||
data["supplies"][P.group]["packs"] += list(list(
|
|
||||||
"name" = P.name,
|
|
||||||
"cost" = P.cost * 2, //displays twice the normal cost
|
|
||||||
"id" = pack
|
|
||||||
))
|
|
||||||
else
|
|
||||||
for(var/pack in SSshuttle.supply_packs)
|
|
||||||
var/datum/supply_pack/P = SSshuttle.supply_packs[pack]
|
|
||||||
if(!data["supplies"][P.group])
|
|
||||||
data["supplies"][P.group] = list(
|
|
||||||
"name" = P.group,
|
|
||||||
"packs" = list()
|
|
||||||
)
|
|
||||||
if((P.hidden) || (P.contraband) || (P.special))//no fun allowed
|
|
||||||
continue
|
|
||||||
data["supplies"][P.group]["packs"] += list(list(
|
|
||||||
"name" = P.name,
|
|
||||||
"cost" = P.cost * 2, //displays twice the normal cost
|
|
||||||
"id" = pack
|
|
||||||
))
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@@ -98,28 +100,38 @@
|
|||||||
name = usr.real_name
|
name = usr.real_name
|
||||||
rank = "Silicon"
|
rank = "Silicon"
|
||||||
var/reason = ""
|
var/reason = ""
|
||||||
|
var/list/empty_turfs
|
||||||
|
var/area/landingzone
|
||||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
||||||
if(SO.pack.cost* 2 <= SSshuttle.points) //If you can afford it, then begin the delivery
|
if(!emagged)
|
||||||
SO.generateRequisition(get_turf(src))
|
if(SO.pack.cost * 2 <= SSshuttle.points)
|
||||||
SSshuttle.points -= SO.pack.cost * 2//twice the normal cost
|
|
||||||
|
|
||||||
var/list/empty_turfs = list()
|
|
||||||
var/area/landingzone
|
|
||||||
|
|
||||||
if (!emagged)
|
|
||||||
landingzone = locate(/area/quartermaster/storage) in GLOB.sortedAreas
|
landingzone = locate(/area/quartermaster/storage) in GLOB.sortedAreas
|
||||||
else
|
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)]
|
||||||
|
SSshuttle.points -= SO.pack.cost * 2
|
||||||
|
new /obj/effect/BDPtarget(LZ, SO)
|
||||||
|
. = TRUE
|
||||||
|
update_icon()
|
||||||
|
else
|
||||||
|
if(SO.pack.cost * (1.2*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
|
||||||
|
for(var/turf/open/floor/T in landingzone.contents)
|
||||||
for(var/turf/open/floor/T in landingzone.contents) //get all the turfs in cargo bay
|
if(is_blocked_turf(T))
|
||||||
if(is_blocked_turf(T))//wont land on a blocked turf
|
continue
|
||||||
continue
|
LAZYADD(empty_turfs, T)
|
||||||
empty_turfs.Add(T)
|
CHECK_TICK
|
||||||
|
if(empty_turfs && empty_turfs.len)
|
||||||
if (empty_turfs.len != 0 )
|
SSshuttle.points -= SO.pack.cost * (1.2*MAX_EMAG_ROCKETS)
|
||||||
var/LZ = empty_turfs[rand(empty_turfs.len-1)]//pick a random turf
|
SO.generateRequisition(get_turf(src))
|
||||||
new /obj/effect/BDPtarget(LZ, SO)//where the magic happens. this temp visual makes the actual droppod after a pause
|
for(var/i in 1 to MAX_EMAG_ROCKETS)
|
||||||
. = TRUE
|
var/LZ = empty_turfs[rand(empty_turfs.len-1)]
|
||||||
update_icon()
|
LAZYREMOVE(empty_turfs, LZ)
|
||||||
|
new /obj/effect/BDPtarget(LZ, SO)
|
||||||
|
. = TRUE
|
||||||
|
update_icon()
|
||||||
|
CHECK_TICK
|
||||||
|
|||||||
Reference in New Issue
Block a user