Files
Paradise/code/modules/supply/supply_pack.dm
Qwertytoforty d668a29a60 Ports (most(ok like half)) station traits from tg. Ready for review into TM (#22334)
* no longer super sick time to port station traits in a 4 hour rush as you have lost control of your life

* some changes /fixes

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* more changes

* oh right, the murders (uplink price tweaks)

* Update code/controllers/subsystem/SSjobs.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* compiles

* doesnt work but works better

* tgui dogs still sleep but I want to sleep

* it should finally compile now. Probably.

* Update tgui.bundle.js

* Sorry IAN, transfer components is shoddy as hell

* removes minor uneeded /tgui

* also extra line whoops

* final stuff

* reverting changes I made earlier is hard ok

* Weight change, uplink reference

* oh right, the hey fucko

* Update code/_globalvars/traits.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update tgui.bundle.js

* pushes

* pulls it

* Apply suggestions from code review

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* more changes, ion rifle blocked on cyb revolution

* dipshit remove the debug / tgui pritier and such

* tgui

* updates tgui again as nanomap was merged

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* comment / tgui

* every day I worry all day

* Full TGUI rebuild + prettier

* ah fuck

* leave a customer feedback at the link below!

* tgui momenr

* tgui moment

* FUCK I am dumb

* vertical TGUI

* She T's on my GUI till I

* Update tgui.bundle.js

* Apply suggestions from code review

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>

* Update code/modules/supply/supply_pack.dm

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>

* IPC can now use robotic hearts / pulse demon hearts and charge

* fixes revert not working for hangover / arrivals

* tgui moment

* hhgreg

* fixes that one bug

* Every day I worry all day

* deconflicted for real this t ime

* Update code/datums/station_traits/postive_traits.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* ch-ch-ch-changes

* Update SSjobs.dm

* Update code/modules/supply/supply_pack.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* deconflicted but won't pass CI

* fixes double dipping on traits

* my le consoles, they le no work?

* Great Great Asset, Asset, Great Great Asset, Asset...

* sorry slime mains

* fixes borgs being punished heavier

* actually fixes it, I was dense

* hopefully fixes borg drunk further

* makes it compile?

* actually makes it compile god whyyyy

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>
2024-01-08 19:07:09 +00:00

65 lines
1.7 KiB
Plaintext

/datum/supply_packs
var/name
var/list/contains = list()
var/manifest = ""
var/amount
var/cost //default amount to cover crate cost?
var/containertype = /obj/structure/closet/crate
var/containername
var/access
var/hidden = FALSE
var/contraband = FALSE
var/group = SUPPLY_MISC
///Determines which departments do not need QM approval to order this supply pack
var/list/department_restrictions = list()
var/list/announce_beacons = list() // Particular beacons that we'll notify the relevant department when we reach
var/special = FALSE //Event/Station Goals/Admin enabled packs
var/special_enabled = FALSE
/// List of names for being done in TGUI
var/list/ui_manifest = list()
/datum/supply_packs/New()
. = ..()
manifest += "<ul>"
for(var/path in contains)
if(!path)
continue
var/atom/movable/AM = path
manifest += "<li>[initial(AM.name)]</li>"
//Add the name to the UI manifest
ui_manifest += "[initial(AM.name)]"
manifest += "</ul>"
/datum/supply_packs/proc/create_package(turf/spawn_location)
var/obj/structure/closet/crate/crate = new containertype(spawn_location)
crate.name = containername
if(access)
crate.req_access = list(text2num(access))
//we now create the actual contents
for(var/typepath in generate_items())
if(!typepath)
continue
var/atom/A = new typepath(crate)
if(isstack(A) && amount)
var/obj/item/stack/mats = A
mats.amount = amount
return crate
/datum/supply_packs/proc/generate_items()
return contains
/datum/supply_packs/misc/randomised/generate_items()
. = list()
if(length(contains))
for(var/j in 1 to num_contained)
. += pick(contains)
/datum/supply_packs/proc/get_cost()
return cost * SSeconomy.pack_price_modifier