mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Ports export reports (#5051)
* Ports export reports * Absolute pathing, small touchups
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
<BR>\n<A href='?src=\ref[src];order=categories'>Request items</A><BR><BR>
|
<BR>\n<A href='?src=\ref[src];order=categories'>Request items</A><BR><BR>
|
||||||
<A href='?src=\ref[src];vieworders=1'>View approved orders</A><BR><BR>
|
<A href='?src=\ref[src];vieworders=1'>View approved orders</A><BR><BR>
|
||||||
<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR><BR>
|
<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR><BR>
|
||||||
|
\n<A href='?src=\ref[src];viewexport=1'>View export report</A><BR><BR>
|
||||||
<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||||
|
|
||||||
user << browse(dat, "window=computer;size=575x450")
|
user << browse(dat, "window=computer;size=575x450")
|
||||||
@@ -198,6 +199,7 @@
|
|||||||
\n<A href='?src=\ref[src];order=categories'>Order items</A><BR>\n<BR>
|
\n<A href='?src=\ref[src];order=categories'>Order items</A><BR>\n<BR>
|
||||||
\n<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR>\n<BR>
|
\n<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR>\n<BR>
|
||||||
\n<A href='?src=\ref[src];vieworders=1'>View orders</A><BR>\n<BR>
|
\n<A href='?src=\ref[src];vieworders=1'>View orders</A><BR>\n<BR>
|
||||||
|
\n<A href='?src=\ref[src];viewexport=1'>View export report</A><BR>\n<BR>
|
||||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||||
|
|
||||||
|
|
||||||
@@ -367,6 +369,18 @@
|
|||||||
temp += "<BR><A href='?src=\ref[src];clearreq=1'>Clear list</A>"
|
temp += "<BR><A href='?src=\ref[src];clearreq=1'>Clear list</A>"
|
||||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||||
|
|
||||||
|
else if (href_list["viewexport"])
|
||||||
|
temp = "Previous shuttle export report: <BR><BR>"
|
||||||
|
var/cratecount = 0
|
||||||
|
var/totalvalue = 0
|
||||||
|
for(var/S in supply_controller.exported_crates)
|
||||||
|
var/datum/exported_crate/EC = S
|
||||||
|
cratecount += 1
|
||||||
|
totalvalue += EC.value
|
||||||
|
temp += "[EC.name] exported for [EC.value] supply points<BR>"
|
||||||
|
temp += "<BR>Shipment of [cratecount] crates exported for [totalvalue] supply points.<BR>"
|
||||||
|
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||||
|
|
||||||
else if (href_list["rreq"])
|
else if (href_list["rreq"])
|
||||||
var/ordernum = text2num(href_list["rreq"])
|
var/ordernum = text2num(href_list["rreq"])
|
||||||
temp = "Invalid Request.<BR>"
|
temp = "Invalid Request.<BR>"
|
||||||
|
|||||||
@@ -105,16 +105,15 @@ var/list/mechtoys = list(
|
|||||||
name = "airtight plastic flaps"
|
name = "airtight plastic flaps"
|
||||||
desc = "Heavy duty, airtight, plastic flaps."
|
desc = "Heavy duty, airtight, plastic flaps."
|
||||||
|
|
||||||
New() //set the turf below the flaps to block air
|
/obj/structure/plasticflaps/mining/New() //set the turf below the flaps to block air
|
||||||
var/turf/T = get_turf(loc)
|
var/turf/T = get_turf(loc)
|
||||||
if(T)
|
if(T)
|
||||||
T.blocks_air = 1
|
T.blocks_air = 1
|
||||||
..()
|
..()
|
||||||
|
|
||||||
Destroy() //lazy hack to set the turf to allow air to pass if it's a simulated floor
|
/obj/structure/plasticflaps/mining/Destroy() //lazy hack to set the turf to allow air to pass if it's a simulated floor
|
||||||
var/turf/T = get_turf(loc)
|
var/turf/T = get_turf(loc)
|
||||||
if(T)
|
if(T && istype(T, /turf/simulated/floor))
|
||||||
if(istype(T, /turf/simulated/floor))
|
|
||||||
T.blocks_air = 0
|
T.blocks_air = 0
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -134,6 +133,10 @@ var/list/mechtoys = list(
|
|||||||
var/orderedby = null
|
var/orderedby = null
|
||||||
var/comment = null
|
var/comment = null
|
||||||
|
|
||||||
|
/datum/exported_crate
|
||||||
|
var/name
|
||||||
|
var/value
|
||||||
|
|
||||||
/datum/controller/supply
|
/datum/controller/supply
|
||||||
//supply points
|
//supply points
|
||||||
var/points = 50
|
var/points = 50
|
||||||
@@ -147,25 +150,26 @@ var/list/mechtoys = list(
|
|||||||
var/list/shoppinglist = list()
|
var/list/shoppinglist = list()
|
||||||
var/list/requestlist = list()
|
var/list/requestlist = list()
|
||||||
var/list/supply_packs = list()
|
var/list/supply_packs = list()
|
||||||
|
var/list/exported_crates = list()
|
||||||
//shuttle movement
|
//shuttle movement
|
||||||
var/movetime = 1200
|
var/movetime = 1200
|
||||||
var/datum/shuttle/ferry/supply/shuttle
|
var/datum/shuttle/ferry/supply/shuttle
|
||||||
|
|
||||||
New()
|
/datum/controller/supply/New()
|
||||||
ordernum = rand(1,9000)
|
ordernum = rand(1,9000)
|
||||||
|
|
||||||
for(var/typepath in (typesof(/datum/supply_packs) - /datum/supply_packs))
|
for(var/typepath in (typesof(/datum/supply_packs) - /datum/supply_packs))
|
||||||
var/datum/supply_packs/P = new typepath()
|
var/datum/supply_packs/P = new typepath()
|
||||||
supply_packs[P.name] = P
|
supply_packs[P.name] = P
|
||||||
|
|
||||||
// Supply shuttle ticker - handles supply point regeneration
|
// Supply shuttle ticker - handles supply point regeneration
|
||||||
// This is called by the process scheduler every thirty seconds
|
// This is called by the process scheduler every thirty seconds
|
||||||
proc/process()
|
/datum/controller/supply/proc/process()
|
||||||
points += points_per_process
|
points += points_per_process
|
||||||
|
|
||||||
//To stop things being sent to CentCom which should not be sent to centcomm. Recursively checks for these types.
|
//To stop things being sent to CentCom which should not be sent to centcomm. Recursively checks for these types.
|
||||||
proc/forbidden_atoms_check(atom/A)
|
/datum/controller/supply/proc/forbidden_atoms_check(atom/A)
|
||||||
if(istype(A,/mob/living))
|
if(isliving(A))
|
||||||
return 1
|
return 1
|
||||||
if(istype(A,/obj/item/weapon/disk/nuclear))
|
if(istype(A,/obj/item/weapon/disk/nuclear))
|
||||||
return 1
|
return 1
|
||||||
@@ -179,8 +183,8 @@ var/list/mechtoys = list(
|
|||||||
if(.(B))
|
if(.(B))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
//Sellin
|
//Sellin
|
||||||
proc/sell()
|
/datum/controller/supply/proc/sell()
|
||||||
var/area/area_shuttle = shuttle.get_location_area()
|
var/area/area_shuttle = shuttle.get_location_area()
|
||||||
if(!area_shuttle) return
|
if(!area_shuttle) return
|
||||||
|
|
||||||
@@ -190,11 +194,18 @@ var/list/mechtoys = list(
|
|||||||
var/plat_count = 0
|
var/plat_count = 0
|
||||||
var/money_count = 0
|
var/money_count = 0
|
||||||
|
|
||||||
|
exported_crates = list()
|
||||||
|
|
||||||
for(var/atom/movable/MA in area_shuttle)
|
for(var/atom/movable/MA in area_shuttle)
|
||||||
if(MA.anchored) continue
|
if(MA.anchored) continue
|
||||||
|
|
||||||
// Must be in a crate!
|
// Must be in a crate!
|
||||||
if(istype(MA,/obj/structure/closet/crate))
|
if(istype(MA,/obj/structure/closet/crate))
|
||||||
|
var/oldpoints = points
|
||||||
|
var/oldphoron = phoron_count
|
||||||
|
var/oldplatinum = plat_count
|
||||||
|
var/oldmoney = money_count
|
||||||
|
|
||||||
var/obj/structure/closet/crate/CR = MA
|
var/obj/structure/closet/crate/CR = MA
|
||||||
callHook("sell_crate", list(CR, area_shuttle))
|
callHook("sell_crate", list(CR, area_shuttle))
|
||||||
|
|
||||||
@@ -222,30 +233,37 @@ var/list/mechtoys = list(
|
|||||||
if(istype(A, /obj/item/weapon/spacecash))
|
if(istype(A, /obj/item/weapon/spacecash))
|
||||||
var/obj/item/weapon/spacecash/cashmoney = A
|
var/obj/item/weapon/spacecash/cashmoney = A
|
||||||
money_count += cashmoney.worth
|
money_count += cashmoney.worth
|
||||||
|
|
||||||
|
var/datum/exported_crate/EC = new /datum/exported_crate()
|
||||||
|
EC.name = CR.name
|
||||||
|
EC.value = points - oldpoints
|
||||||
|
EC.value += (phoron_count - oldphoron) * points_per_phoron
|
||||||
|
EC.value += (plat_count - oldplatinum) * points_per_platinum
|
||||||
|
EC.value += (money_count - oldmoney) * points_per_money
|
||||||
|
exported_crates += EC
|
||||||
|
|
||||||
qdel(MA)
|
qdel(MA)
|
||||||
|
|
||||||
if(phoron_count)
|
|
||||||
points += phoron_count * points_per_phoron
|
points += phoron_count * points_per_phoron
|
||||||
|
|
||||||
if(plat_count)
|
|
||||||
points += plat_count * points_per_platinum
|
points += plat_count * points_per_platinum
|
||||||
|
|
||||||
if(money_count)
|
|
||||||
points += money_count * points_per_money
|
points += money_count * points_per_money
|
||||||
|
|
||||||
//Buyin
|
//Buyin
|
||||||
proc/buy()
|
/datum/controller/supply/proc/buy()
|
||||||
if(!shoppinglist.len) return
|
if(!shoppinglist.len)
|
||||||
|
return
|
||||||
|
|
||||||
var/orderedamount = shoppinglist.len
|
var/orderedamount = shoppinglist.len
|
||||||
|
|
||||||
var/area/area_shuttle = shuttle.get_location_area()
|
var/area/area_shuttle = shuttle.get_location_area()
|
||||||
if(!area_shuttle) return
|
if(!area_shuttle)
|
||||||
|
return
|
||||||
|
|
||||||
var/list/clear_turfs = list()
|
var/list/clear_turfs = list()
|
||||||
|
|
||||||
for(var/turf/T in area_shuttle)
|
for(var/turf/T in area_shuttle)
|
||||||
if(T.density) continue
|
if(T.density)
|
||||||
|
continue
|
||||||
var/contcount
|
var/contcount
|
||||||
for(var/atom/A in T.contents)
|
for(var/atom/A in T.contents)
|
||||||
if(!A.simulated)
|
if(!A.simulated)
|
||||||
@@ -269,7 +287,6 @@ var/list/mechtoys = list(
|
|||||||
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
|
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
|
||||||
|
|
||||||
//supply manifest generation begin
|
//supply manifest generation begin
|
||||||
|
|
||||||
var/obj/item/weapon/paper/manifest/slip
|
var/obj/item/weapon/paper/manifest/slip
|
||||||
if(!SP.contraband)
|
if(!SP.contraband)
|
||||||
slip = new /obj/item/weapon/paper/manifest(A)
|
slip = new /obj/item/weapon/paper/manifest(A)
|
||||||
@@ -288,7 +305,7 @@ var/list/mechtoys = list(
|
|||||||
var/list/L = SP.access // access var is a plain var, we need a list
|
var/list/L = SP.access // access var is a plain var, we need a list
|
||||||
A.req_access = L.Copy()
|
A.req_access = L.Copy()
|
||||||
else
|
else
|
||||||
world << "<span class='danger'>Supply pack with invalid access restriction [SP.access] encountered!</span>"
|
log_debug("<span class='danger'>Supply pack with invalid access restriction [SP.access] encountered!</span>")
|
||||||
|
|
||||||
var/list/contains
|
var/list/contains
|
||||||
if(istype(SP,/datum/supply_packs/randomised))
|
if(istype(SP,/datum/supply_packs/randomised))
|
||||||
|
|||||||
Reference in New Issue
Block a user