mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Implement robust cargo logging
This commit is contained in:
@@ -38,13 +38,10 @@ var/datum/subsystem/shuttle/SSshuttle
|
||||
var/list/orderhistory = list()
|
||||
|
||||
var/datum/round_event/shuttle_loan/shuttle_loan
|
||||
var/sold_atoms = ""
|
||||
|
||||
|
||||
/datum/subsystem/shuttle/New()
|
||||
NEW_SS_GLOBAL(SSshuttle)
|
||||
|
||||
|
||||
/datum/subsystem/shuttle/Initialize(timeofday, zlevel)
|
||||
if (zlevel)
|
||||
return ..()
|
||||
|
||||
@@ -91,9 +91,9 @@
|
||||
if(SSshuttle.supply.getDockedId() == "supply_home")
|
||||
SSshuttle.moveShuttle("supply", "supply_away", TRUE)
|
||||
say("The supply shuttle has departed.")
|
||||
investigate_log("[key_name(usr)] has sent the supply shuttle away. Points: [SSshuttle.points]. Contents: [SSshuttle.sold_atoms].", "cargo")
|
||||
investigate_log("[key_name(usr)] sent the supply shuttle away.", "cargo")
|
||||
else
|
||||
investigate_log("[key_name(usr)] has called the supply shuttle. Points: [SSshuttle.points].", "cargo") // TODO: more robust logging here
|
||||
investigate_log("[key_name(usr)] called the supply shuttle.", "cargo")
|
||||
say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.")
|
||||
SSshuttle.moveShuttle("supply", "supply_home", TRUE)
|
||||
. = TRUE
|
||||
@@ -111,6 +111,7 @@
|
||||
|
||||
var/name = "*None Provided*"
|
||||
var/rank = "*None Provided*"
|
||||
var/ckey = usr.ckey
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
name = H.get_authentification_name()
|
||||
@@ -126,7 +127,7 @@
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/supply_order/SO = new(id, name, rank, reason)
|
||||
var/datum/supply_order/SO = new(id, name, rank, ckey, reason)
|
||||
SO.generateRequisition(T)
|
||||
if(requestonly)
|
||||
SSshuttle.requestlist += SO
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
var/id
|
||||
var/orderer
|
||||
var/orderer_rank
|
||||
var/orderer_ckey
|
||||
var/reason
|
||||
var/datum/supply_pack/pack
|
||||
|
||||
/datum/supply_order/New(pack, orderer, orderer_rank, reason)
|
||||
/datum/supply_order/New(pack, orderer, orderer_rank, orderer_ckey, reason)
|
||||
id = SSshuttle.ordernum++
|
||||
src.pack = SSshuttle.supply_packs[pack]
|
||||
src.orderer = orderer
|
||||
src.orderer_rank = orderer_rank
|
||||
src.orderer_ckey = orderer_ckey
|
||||
src.reason = reason
|
||||
|
||||
/datum/supply_order/proc/generateRequisition(turf/T)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var/list/contains = null
|
||||
var/crate_name = "crate"
|
||||
var/crate_type = /obj/structure/closet/crate
|
||||
var/dangerous = FALSE // Should we message admins?
|
||||
|
||||
/datum/supply_pack/proc/generate(turf/T)
|
||||
var/obj/structure/closet/crate/C = new crate_type(T)
|
||||
@@ -122,6 +123,7 @@
|
||||
contains = list(/obj/item/weapon/storage/box/syndicate)
|
||||
crate_name = "crate"
|
||||
crate_type = /obj/structure/closet/crate
|
||||
dangerous = TRUE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////// Security ////////////////////////////////////////
|
||||
@@ -200,7 +202,6 @@
|
||||
/obj/item/clothing/head/det_hat)
|
||||
crate_name = "forensics crate"
|
||||
|
||||
|
||||
/datum/supply_pack/security/armory
|
||||
access = access_armory
|
||||
crate_type = /obj/structure/closet/crate/secure/weapon
|
||||
@@ -292,6 +293,7 @@
|
||||
/obj/item/weapon/grenade/chem_grenade/incendiary)
|
||||
crate_name = "incendiary weapons crate"
|
||||
crate_type = /obj/structure/closet/crate/secure/plasma
|
||||
dangerous = TRUE
|
||||
|
||||
/datum/supply_pack/security/armory/wt550
|
||||
name = "WT-550 Auto Rifle Crate"
|
||||
@@ -481,6 +483,7 @@
|
||||
/obj/machinery/power/emitter)
|
||||
crate_name = "emitter crate"
|
||||
crate_type = /obj/structure/closet/crate/secure
|
||||
dangerous = TRUE
|
||||
|
||||
/datum/supply_pack/engineering/engine/field_gen
|
||||
name = "Field Generator Crate"
|
||||
@@ -522,6 +525,7 @@
|
||||
contains = list(/obj/machinery/power/supermatter_shard)
|
||||
crate_name = "supermatter shard crate"
|
||||
crate_type = /obj/structure/closet/crate/secure
|
||||
dangerous = TRUE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////// Medical /////////////////////////////////////////
|
||||
@@ -619,6 +623,7 @@
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/mutagen)
|
||||
crate_name = "virus crate"
|
||||
crate_type = /obj/structure/closet/crate/secure/plasma
|
||||
dangerous = TRUE
|
||||
|
||||
/datum/supply_pack/medical/bloodpacks
|
||||
name = "Blood Pack Variety Crate"
|
||||
@@ -721,6 +726,7 @@
|
||||
/obj/item/device/transfer_valve)
|
||||
crate_name = "tank transfer valves crate crate"
|
||||
crate_type = /obj/structure/closet/crate/secure
|
||||
dangerous = TRUE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////// Organic /////////////////////////////////////////
|
||||
|
||||
@@ -65,40 +65,52 @@
|
||||
continue
|
||||
empty_turfs += T
|
||||
|
||||
var/value = 0
|
||||
var/purchases = 0
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
if(!empty_turfs.len)
|
||||
continue
|
||||
break
|
||||
if(SO.pack.cost > SSshuttle.points)
|
||||
continue
|
||||
|
||||
SSshuttle.points -= SO.pack.cost
|
||||
value += SO.pack.cost
|
||||
SSshuttle.shoppinglist -= SO
|
||||
SSshuttle.orderhistory += SO
|
||||
|
||||
SO.generate(pick_n_take(empty_turfs))
|
||||
investigate_log("Order #[SO.id] ([SO.pack.name], placed by [key_name(SO.orderer_ckey)]) has shipped.", "cargo")
|
||||
if(SO.pack.dangerous)
|
||||
message_admins("\An [SO.pack.name] ordered by [key_name_admin(SO.orderer_ckey)]) has shipped.")
|
||||
purchases++
|
||||
|
||||
investigate_log("[purchases] orders in this shipment, worth [value] points. [SSshuttle.points] points left.", "cargo")
|
||||
|
||||
/obj/docking_port/mobile/supply/proc/sell()
|
||||
var/presale_points = SSshuttle.points
|
||||
|
||||
var/pointsEarned = 0
|
||||
var/crates = 0
|
||||
var/plasma = 0
|
||||
var/intel = 0
|
||||
|
||||
var/msg = ""
|
||||
var/pointsEarned = 0
|
||||
var/sold_atoms = ""
|
||||
|
||||
for(var/atom/movable/AM in areaInstance)
|
||||
if(AM.anchored)
|
||||
continue
|
||||
SSshuttle.sold_atoms += " [AM.name]"
|
||||
sold_atoms += " [AM.name]"
|
||||
|
||||
if(istype(AM, /obj/structure/closet/crate))
|
||||
crates++
|
||||
SSshuttle.sold_atoms += ":"
|
||||
sold_atoms += ":"
|
||||
if(!AM.contents.len)
|
||||
SSshuttle.sold_atoms += " (empty)"
|
||||
sold_atoms += " (empty)."
|
||||
else
|
||||
var/manifest_found = FALSE
|
||||
for(var/atom/movable/thing in AM)
|
||||
SSshuttle.sold_atoms += " [thing.name]"
|
||||
sold_atoms += " [thing.name],"
|
||||
if(!manifest_found && istype(thing, /obj/item/weapon/paper/manifest))
|
||||
var/obj/item/weapon/paper/manifest/manifest = thing
|
||||
if(manifest.stamped && manifest.stamped.len)
|
||||
@@ -195,7 +207,7 @@
|
||||
SSshuttle.points += S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later
|
||||
qdel(thing)
|
||||
qdel(AM)
|
||||
SSshuttle.sold_atoms += "."
|
||||
sold_atoms += "."
|
||||
|
||||
if(plasma > 0)
|
||||
pointsEarned = round(plasma * SSshuttle.points_per_plasma)
|
||||
@@ -213,3 +225,4 @@
|
||||
SSshuttle.points += pointsEarned
|
||||
|
||||
SSshuttle.centcom_message = msg
|
||||
investigate_log("Shuttle contents sold for [SSshuttle.points - presale_points] points. Contents: [sold_atoms || "none."] Message: [SSshuttle.centcom_message || "none."]", "cargo")
|
||||
Reference in New Issue
Block a user