From 93ccb241e156fb974eacbb4493e5770890253dcb Mon Sep 17 00:00:00 2001 From: Serhey Date: Tue, 20 Aug 2024 16:29:30 +0300 Subject: [PATCH] Updating UPP crates, some paper stuff --- code/datums/supply_packs/_supply_packs.dm | 1 - code/datums/supply_packs/upp_crates.dm | 1 - code/datums/supply_packs/upp_mortar.dm | 44 +++++++++ code/game/supplyshuttle_upp.dm | 112 +++++++++++++++++++--- colonialmarines.dme | 1 + 5 files changed, 145 insertions(+), 14 deletions(-) create mode 100644 code/datums/supply_packs/upp_mortar.dm diff --git a/code/datums/supply_packs/_supply_packs.dm b/code/datums/supply_packs/_supply_packs.dm index 3e800fb2a5de..5bcd6937f623 100644 --- a/code/datums/supply_packs/_supply_packs.dm +++ b/code/datums/supply_packs/_supply_packs.dm @@ -17,7 +17,6 @@ var/containername = null var/access = null var/contraband = 0 /// Tell if the crate is a contraband value 1 or not 0. - var/isUPPCrate = 0 var/group = null var/buyable = 1 ///Can this pack be bought? These packs don't show up at all - they have to be spawned externally (fe: DEFCON ASRS) var/randomised_num_contained = 0 //Randomly picks X of items out of the contains list instead of using all. diff --git a/code/datums/supply_packs/upp_crates.dm b/code/datums/supply_packs/upp_crates.dm index 8c10f08ae6d0..0aae5f1ae8a4 100644 --- a/code/datums/supply_packs/upp_crates.dm +++ b/code/datums/supply_packs/upp_crates.dm @@ -4,4 +4,3 @@ containertype = null containername = "large crate" group = "UPP" - isUPPCrate = TRUE diff --git a/code/datums/supply_packs/upp_mortar.dm b/code/datums/supply_packs/upp_mortar.dm new file mode 100644 index 000000000000..6dfcf5a98488 --- /dev/null +++ b/code/datums/supply_packs/upp_mortar.dm @@ -0,0 +1,44 @@ +/datum/supply_packs/upp/ammo_mortar_he + name = "M402 mortar shells crate (x6 HE)" + cost = 20 + contains = list( + /obj/item/mortar_shell/he, + /obj/item/mortar_shell/he, + /obj/item/mortar_shell/he, + /obj/item/mortar_shell/he, + /obj/item/mortar_shell/he, + /obj/item/mortar_shell/he, + ) + containertype = /obj/structure/closet/crate/secure/mortar_ammo + containername = "\improper M402 mortar HE shells crate" + group = "UPP Mortar" + +/datum/supply_packs/upp/ammo_mortar_incend + name = "M402 mortar shells crate (x6 Incend)" + cost = 20 + contains = list( + /obj/item/mortar_shell/incendiary, + /obj/item/mortar_shell/incendiary, + /obj/item/mortar_shell/incendiary, + /obj/item/mortar_shell/incendiary, + /obj/item/mortar_shell/incendiary, + /obj/item/mortar_shell/incendiary, + ) + containertype = /obj/structure/closet/crate/secure/mortar_ammo + containername = "\improper M402 mortar incendiary shells crate" + group = "UPP Mortar" + +/datum/supply_packs/upp/ammo_mortar_flare + name = "M402 mortar shells crate (x6 Flare/Camera)" + cost = 20 + contains = list( + /obj/item/mortar_shell/flare, + /obj/item/mortar_shell/flare, + /obj/item/mortar_shell/flare, + /obj/item/mortar_shell/flare, + /obj/item/mortar_shell/flare, + /obj/item/mortar_shell/flare, + ) + containertype = /obj/structure/closet/crate/secure/mortar_ammo + containername = "\improper M402 mortar flare shells crate" + group = "UPP Mortar" diff --git a/code/game/supplyshuttle_upp.dm b/code/game/supplyshuttle_upp.dm index 4ba55733f99d..192a3d96c987 100644 --- a/code/game/supplyshuttle_upp.dm +++ b/code/game/supplyshuttle_upp.dm @@ -69,8 +69,11 @@ GLOBAL_DATUM_INIT(supply_controller_upp, /datum/controller/supply/upp, new()) "UPP Food", "UPP Gear", "UPP Explosives", - "UPP Clothing" + "UPP Clothing", + "UPP Mortar" ) + //No black market under communism + contraband_supply_groups = list() //No random crates for UPP /datum/controller/supply/upp/process(delta_time) @@ -134,16 +137,15 @@ GLOBAL_DATUM_INIT(supply_controller_upp, /datum/controller/supply/upp, new()) content_names += item.name // Manifest generation - if(package.isUPPCrate) - var /obj/item/paper/manifest/upp/slip - slip = new /obj/item/paper/manifest/upp(container) - slip.ordername = package.name - slip.ordernum = order.ordernum - slip.orderedby = order.orderedby - slip.approvedby = order.approvedby - slip.packages = content_names - slip.generate_contents() - slip.update_icon() + var /obj/item/paper/manifest/upp/slip + slip = new /obj/item/paper/manifest/upp(container) + slip.ordername = package.name + slip.ordernum = order.ordernum + slip.orderedby = order.orderedby + slip.approvedby = order.approvedby + slip.packages = content_names + slip.generate_contents() + slip.update_icon() shoppinglist.Cut() /obj/structure/machinery/computer/supplycomp/upp/attack_hand(mob/user as mob) @@ -190,7 +192,7 @@ GLOBAL_DATUM_INIT(supply_controller_upp, /datum/controller/supply/upp, new()) else if (shuttle.can_cancel()) dat += "Cancel" else - dat += "*General Supply Storage is works on order*" + dat += "*General Supply Storage is working on order*" dat += "
\n
" @@ -203,3 +205,89 @@ GLOBAL_DATUM_INIT(supply_controller_upp, /datum/controller/supply/upp, new()) show_browser(user, dat, "General Supply Storage ", "computer", "size=575x450") return + +/obj/structure/machinery/computer/ordercomp/upp/Topic(href, href_list) + if(..()) + return + + if( isturf(loc) && (in_range(src, usr) || isSilicon(usr)) ) + usr.set_interaction(src) + + if(href_list["order"]) + if(href_list["order"] == "categories") + //all_supply_groups + //Request what? + last_viewed_group = "categories" + temp = "Supply budget: $[linked_supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
" + temp += "Main Menu


" + temp += "Select a category

" + for(var/supply_group_name in linked_supply_controller.all_supply_groups) + temp += "[supply_group_name]
" + else + last_viewed_group = href_list["order"] + temp = "Supply budget: $[linked_supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
" + temp += "Back to all categories


" + temp += "Request from: [last_viewed_group]

" + for(var/supply_type in GLOB.supply_packs_datums) + var/datum/supply_packs/supply_pack = GLOB.supply_packs_datums[supply_type] + if(supply_pack.contraband || supply_pack.group != last_viewed_group || !supply_pack.buyable) + continue //Have to send the type instead of a reference to + temp += "[supply_pack.name] Cost: $[floor(supply_pack.cost) * SUPPLY_TO_MONEY_MUPLTIPLIER]
" //the obj because it would get caught by the garbage + + else if (href_list["doorder"]) + if(world.time < reqtime) + for(var/mob/V in hearers(src)) + V.show_message("[src]'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"", SHOW_MESSAGE_VISIBLE) + return + + //Find the correct supply_pack datum + var/supply_pack_type = GLOB.supply_packs_types[href_list["doorder"]] + if(!supply_pack_type) + return + var/datum/supply_packs/supply_pack = GLOB.supply_packs_datums[supply_pack_type] + + if(supply_pack.contraband || !supply_pack.buyable) + return + + var/timeout = world.time + 600 + var/reason = strip_html(input(usr,"Reason:","Why do you require this item?","") as null|text) + if(world.time > timeout) return + if(!reason) return + + var/idname = "*None Provided*" + var/idrank = "*None Provided*" + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + idname = H.get_authentification_name() + idrank = H.get_assignment() + else if(isSilicon(usr)) + idname = usr.real_name + + linked_supply_controller.ordernum++ + var/obj/item/paper/reqform = new /obj/item/paper(loc) + reqform.name = "Requisition Form - [supply_pack.name]" + reqform.info += "

General Supply Storage Form


" + reqform.info += "INDEX: #[linked_supply_controller.ordernum]
" + reqform.info += "REQUESTED BY: [idname]
" + reqform.info += "RANK: [idrank]
" + reqform.info += "REASON: [reason]
" + reqform.info += "SUPPLY CRATE TYPE: [supply_pack.name]
" + reqform.info += "ACCESS RESTRICTION: [get_access_desc(supply_pack.access)]
" + reqform.info += "CONTENTS:
" + reqform.info += supply_pack.manifest + reqform.info += "
" + reqform.info += "GLORY TO THE UPP
\ + STAMP BELOW TO APPROVE THIS REQUISITION:
" + + reqform.update_icon() //Fix for appearing blank when printed. + reqtime = (world.time + 5) % 1e5 + + //make our supply_order datum + var/datum/supply_order/supply_order = new /datum/supply_order() + supply_order.ordernum = linked_supply_controller.ordernum + supply_order.object = supply_pack + supply_order.orderedby = idname + linked_supply_controller.requestlist += supply_order + + temp = "Thanks for your request. The cargo team will process it as soon as possible.
" + temp += "
Back Main Menu" diff --git a/colonialmarines.dme b/colonialmarines.dme index 198a8d906b19..04f3c902c26e 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -695,6 +695,7 @@ #include "code\datums\supply_packs\upp_food.dm" #include "code\datums\supply_packs\upp_gear.dm" #include "code\datums\supply_packs\upp_medical.dm" +#include "code\datums\supply_packs\upp_mortar.dm" #include "code\datums\supply_packs\upp_weapons.dm" #include "code\datums\supply_packs\vehicle_ammo.dm" #include "code\datums\supply_packs\vehicle_equipment.dm"