Skip to content

Commit

Permalink
Updating UPP crates, some paper stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
SerheyKr committed Aug 20, 2024
1 parent 8e1a08e commit 93ccb24
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 14 deletions.
1 change: 0 additions & 1 deletion code/datums/supply_packs/_supply_packs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion code/datums/supply_packs/upp_crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
containertype = null
containername = "large crate"
group = "UPP"
isUPPCrate = TRUE
44 changes: 44 additions & 0 deletions code/datums/supply_packs/upp_mortar.dm
Original file line number Diff line number Diff line change
@@ -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"
112 changes: 100 additions & 12 deletions code/game/supplyshuttle_upp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -190,7 +192,7 @@ GLOBAL_DATUM_INIT(supply_controller_upp, /datum/controller/supply/upp, new())
else if (shuttle.can_cancel())
dat += "<A href='?src=\ref[src];cancel_send=1'>Cancel</A>"
else
dat += "*General Supply Storage is works on order*"
dat += "*General Supply Storage is working on order*"
dat += "<BR>\n<BR>"


Expand All @@ -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 = "<b>Supply budget: $[linked_supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]</b><BR>"
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><HR><BR><BR>"
temp += "<b>Select a category</b><BR><BR>"
for(var/supply_group_name in linked_supply_controller.all_supply_groups)
temp += "<A href='?src=\ref[src];order=[supply_group_name]'>[supply_group_name]</A><BR>"
else
last_viewed_group = href_list["order"]
temp = "<b>Supply budget: $[linked_supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]</b><BR>"
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><HR><BR><BR>"
temp += "<b>Request from: [last_viewed_group]</b><BR><BR>"
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 += "<A href='?src=\ref[src];doorder=[supply_pack.name]'>[supply_pack.name]</A> Cost: $[floor(supply_pack.cost) * SUPPLY_TO_MONEY_MUPLTIPLIER]<BR>" //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("<b>[src]</b>'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 += "<h3>General Supply Storage Form</h3><hr>"
reqform.info += "INDEX: #[linked_supply_controller.ordernum]<br>"
reqform.info += "REQUESTED BY: [idname]<br>"
reqform.info += "RANK: [idrank]<br>"
reqform.info += "REASON: [reason]<br>"
reqform.info += "SUPPLY CRATE TYPE: [supply_pack.name]<br>"
reqform.info += "ACCESS RESTRICTION: [get_access_desc(supply_pack.access)]<br>"
reqform.info += "CONTENTS:<br>"
reqform.info += supply_pack.manifest
reqform.info += "<hr>"
reqform.info += "GLORY TO THE UPP<br> \
STAMP BELOW TO APPROVE THIS REQUISITION:<br>"

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.<BR>"
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 93ccb24

Please sign in to comment.