From fdefc0de31c5023d09a5f82ca58213680c52175a Mon Sep 17 00:00:00 2001 From: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:39:57 -0500 Subject: [PATCH] Changes to Donator Kits and custom_items.txt (#7306) # About the pull request Changes the config/custom_items.txt to fill the donator kit of each donator kit having its own typepath # Explain why it's good for the game Being able to grab the donator kit instead of spawning with it makes inventories not be full of gear right out of spawning Also just better code in general # Changelog :cl: add: Adds the personal gear vendor, where people can get their donator items or a random loadout item add: Custom Items can be gotten from Requisitions instead of spawning with them config: Changes to config/custom_items.txt /:cl: --- code/controllers/subsystem/ticker.dm | 7 +- code/modules/cm_marines/Donator_Kits.dm | 589 ------------------ code/modules/cm_marines/custom_items.dm | 165 +++++ code/modules/customitems/item_spawning.dm | 34 - code/modules/mob/new_player/new_player.dm | 3 +- colonialmarines.dme | 3 +- maps/map_files/USS_Almayer/USS_Almayer.dmm | 4 + .../Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm | 3 + 8 files changed, 180 insertions(+), 628 deletions(-) delete mode 100644 code/modules/cm_marines/Donator_Kits.dm create mode 100644 code/modules/cm_marines/custom_items.dm delete mode 100644 code/modules/customitems/item_spawning.dm diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index c3648df6ba29..3141b9fd2369 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -425,7 +425,8 @@ SUBSYSTEM_DEF(ticker) var/mob/M = J.spawn_in_player(player) if(istype(M)) J.equip_job(M) - EquipCustomItems(M) + if(player.ckey in GLOB.donator_items) + to_chat(player, SPAN_BOLDNOTICE("You have gear available in the personal gear vendor near Requisitions.")) if(M.client) var/client/C = M.client @@ -455,7 +456,9 @@ SUBSYSTEM_DEF(ticker) captainless = FALSE if(player.job) GLOB.RoleAuthority.equip_role(player, GLOB.RoleAuthority.roles_by_name[player.job], late_join = FALSE) - EquipCustomItems(player) + if(player.ckey in GLOB.donator_items) + to_chat(player, SPAN_BOLDNOTICE("You have gear available in the personal gear vendor near Requisitions.")) + if(player.client) var/client/C = player.client if(C.player_data && C.player_data.playtime_loaded && length(C.player_data.playtimes) == 0) diff --git a/code/modules/cm_marines/Donator_Kits.dm b/code/modules/cm_marines/Donator_Kits.dm deleted file mode 100644 index b0c9ec51e946..000000000000 --- a/code/modules/cm_marines/Donator_Kits.dm +++ /dev/null @@ -1,589 +0,0 @@ -/obj/item/storage/box/donator_kit - name = "donated box" - desc = "A cardboard box stamped with a dollar sign and filled with trinkets. Appears to have been donated by a wealthy sponsor." - icon = 'icons/obj/items/storage/kits.dmi' - icon_state = "donator_kit" - item_state = "giftbag" - var/list/donor_gear = list() - var/donor_key = "GENERIC" //Key the kit is assigned to. If GENERIC, not tied to particular donor. - var/kit_variant - max_w_class = SIZE_TINY - -/obj/item/storage/box/donator_kit/New() - if(kit_variant) - name = "[name] ([kit_variant])" - ..() - -/obj/item/storage/box/donator_kit/fill_preset_inventory() - for(var/donor_item in donor_gear) - new donor_item(src) - -/obj/item/storage/box/donator_kit/open(mob/user) - if((donor_key != "GENERIC") && (donor_key != user.ckey)) - to_chat(user, SPAN_BOLDWARNING("You cannot open a donator kit you do not own!")) - return FALSE - ..() - -/obj/item/storage/box/donator_kit/verb/destroy_kit() - set name = "Destroy Kit" - set category = "Object" - set src in oview(1) - - var/mob/user = usr - - if((donor_key != "GENERIC") && (donor_key != user.ckey)) - to_chat(user, SPAN_BOLDWARNING("You cannot destroy a donator kit you do not own!")) - return FALSE - - log_admin("[key_name(user)] deleted a donator kit.") - qdel(src) - -/obj/item/storage/box/donator_kit/generic_omega //Generic set given to various donors - kit_variant = "Team Omega (G)" - donor_gear = list( - /obj/item/clothing/under/marine/fluff/standard_jumpsuit, - /obj/item/clothing/suit/storage/marine/fluff/standard_armor, - /obj/item/clothing/head/helmet/marine/fluff/standard_helmet, - ) - -//Unless specified in comments as otherwise, subtype of box/donator_kit/ is CKEY of the donator (example: /obj/item/storage/box/donator_kit/sasoperative) -/obj/item/storage/box/donator_kit/adjective - donor_key = "adjective" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/adjective) - -/obj/item/storage/box/donator_kit/alexwarhammer - donor_key = "alexwarhammer" - donor_gear = list(/obj/item/clothing/glasses/fluff/alexwarhammer) - -/obj/item/storage/box/donator_kit/allan1234 - donor_key = "allan1234" - donor_gear = list(/obj/item/clothing/under/marine/fluff/allan1234) - -/obj/item/storage/box/donator_kit/arachnidnexus - donor_key = "arachnidnexus" - donor_gear = list(/obj/item/clothing/under/marine/fluff/arach) - -/obj/item/storage/box/donator_kit/bibblesless - donor_key = "bibblesless" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/bibblesless) - -/obj/item/storage/box/donator_kit/biolock - donor_key = "biolock" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/biolock, - /obj/item/clothing/suit/storage/marine/light/fluff/biolock, - ) - -/obj/item/storage/box/donator_kit/bunny232 - donor_key = "bunny232" - donor_gear = list(/obj/item/clothing/glasses/fluff/eyepatch) - -/obj/item/storage/box/donator_kit/bwoincognito - donor_key = "bwoincognito" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/bwoincognito, - /obj/item/clothing/suit/storage/marine/fluff/bwoincognito, - /obj/item/clothing/under/marine/fluff/bwoincognito, - ) - -/obj/item/storage/box/donator_kit/chris1464 - donor_key = "chris1464" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/chris1464, - /obj/item/clothing/suit/storage/marine/fluff/chris1464, - /obj/item/clothing/under/marine/fluff/chris1464, - ) - -/obj/item/storage/box/donator_kit/commandercookies - donor_key = "commandercookies" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/commandercookies, - /obj/item/clothing/suit/storage/marine/fluff/commandercookies, - ) - -/obj/item/storage/box/donator_kit/commissar //used by both ckeys 'hycinth' and 'technokat' - donor_key = "hycinth" - kit_variant = "Commissar" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/commissar, - /obj/item/clothing/suit/storage/marine/fluff/commissar, - /obj/item/clothing/under/marine/fluff/commissar, - /obj/item/storage/belt/marine/fluff/commissar, - ) - -/obj/item/storage/box/donator_kit/commissar/technokat - donor_key = "technokat" - -/obj/item/storage/box/donator_kit/crazyh206 - donor_key = "crazyh206" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/crazyh206) - -/obj/item/storage/box/donator_kit/devilzhand - donor_key = "devilzhand" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/devilzhand, - /obj/item/clothing/suit/storage/marine/fluff/devilzhand, - ) - -/obj/item/storage/box/donator_kit/dingledangle - donor_key = "dingledangle" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/dingledangle) - -/obj/item/storage/box/donator_kit/dinobubba7 - donor_key = "dinobubba7" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/dino, - /obj/item/clothing/suit/storage/marine/fluff/dino, - ) - -/obj/item/storage/box/donator_kit/docdemo - donor_key = "docdemo" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/goldtrimberet) - -/obj/item/storage/box/donator_kit/dudewithatude - donor_key = "dudewithatude" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/dudewithatude) - -/obj/item/storage/box/donator_kit/eastgermanstasi - donor_key = "eastgermanstasi" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/eastgerman) - -/obj/item/storage/box/donator_kit/edgelord - donor_key = "edgelord" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/edgelord) - -/obj/item/storage/box/donator_kit/eonoc - donor_key = "eonoc" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/eonoc) - -/obj/item/storage/box/donator_kit/fairedan - donor_key = "fairedan" - donor_gear = list( - /obj/item/clothing/suit/storage/marine/fluff/fairedan, - /obj/item/clothing/under/marine/fluff/fairedan, - ) - -/obj/item/storage/box/donator_kit/feodrich - donor_key = "feodrich" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/feodrich, - /obj/item/clothing/shoes/marine/fluff/feodrich, - /obj/item/clothing/suit/storage/marine/fluff/feodrich, - /obj/item/clothing/under/marine/fluff/feodrich, - ) - -/obj/item/storage/box/donator_kit/fernkiller - donor_key = "fernkiller" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/fernkiller) - -/obj/item/storage/box/donator_kit/feweh - donor_key = "feweh" - donor_gear = list( - /obj/item/clothing/mask/fluff/feweh, - /obj/item/clothing/suit/storage/marine/fluff/feweh, - /obj/item/clothing/under/marine/fluff/feweh, - ) - -/obj/item/storage/box/donator_kit/fickmacher_selena //ckey fickmacher has two sets - donor_key = "fickmacher" - kit_variant = "Selena" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/fickmacher, - /obj/item/clothing/suit/storage/marine/fluff/fickmacher, - /obj/item/clothing/under/marine/fluff/fickmacher, - ) - -/obj/item/storage/box/donator_kit/fickmacher_hart - donor_key = "fickmacher" - kit_variant = "Hart" - donor_gear = list( - /obj/item/clothing/mask/fluff/fickmacher2, - /obj/item/clothing/suit/storage/marine/fluff/fickmacher2, - /obj/item/clothing/under/marine/fluff/fickmacher2, - ) - -/obj/item/storage/box/donator_kit/fridrich - donor_key = "fridrich" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/fridrich) - -/obj/item/storage/box/donator_kit/ghostdex - donor_key = "ghostdex" - donor_gear = list( - /obj/item/clothing/mask/cigarette/fluff/ghostdex, - /obj/item/tool/lighter/zippo/fluff/ghostdex, - ) - -/obj/item/storage/box/donator_kit/graciegrace0 - donor_key = "graciegrace0" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/medicae_helmet, - /obj/item/clothing/suit/storage/marine/fluff/medicae_armor, - /obj/item/clothing/under/marine/fluff/medicae_jumpsuit, - ) - -/obj/item/storage/box/donator_kit/gromoi - donor_key = "gromoi" - donor_gear = list( - /obj/item/clothing/suit/storage/marine/fluff/gromi, - /obj/item/clothing/under/marine/fluff/gromi, - ) - -/obj/item/storage/box/donator_kit/haveatya - donor_key = "haveatya" - donor_gear = list( - /obj/item/clothing/glasses/fluff/haveatya, - /obj/item/clothing/head/helmet/marine/fluff/haveatya, - /obj/item/clothing/under/marine/fluff/turtleneck, //generic item - ) - -/obj/item/storage/box/donator_kit/jackmcintyre - donor_key = "jackmcintyre" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/jackmcintyre, - /obj/item/clothing/suit/storage/marine/fluff/jackmcintyre, - /obj/item/clothing/under/marine/fluff/jackmcintyre, - /obj/item/clothing/under/marine/fluff/jackmcintyre_alt, - ) - -/obj/item/storage/box/donator_kit/jdobbin49 - donor_key = "jdobbin49" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/jdobbin49) - -/obj/item/storage/box/donator_kit/jedijasun - donor_key = "jedijasun" - donor_gear = list(/obj/item/clothing/gloves/marine/fluff/jedijas) - -/obj/item/storage/box/donator_kit/johnkilla56 - donor_key = "johnkilla56" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/john56, - /obj/item/clothing/mask/fluff/john56, - /obj/item/clothing/suit/storage/marine/fluff/john56, - /obj/item/clothing/under/marine/fluff/john56, - ) - -/obj/item/storage/box/donator_kit/juninho77 - donor_key = "juninho77" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/juniho, - /obj/item/clothing/suit/storage/marine/fluff/juninho, - /obj/item/clothing/under/marine/fluff/juninho, - ) - -/obj/item/storage/box/donator_kit/kilinger - donor_key = "kilinger" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/goldshieldberet) - -/obj/item/storage/box/donator_kit/kyrac - donor_key = "kyrac" - donor_gear = list( - /obj/item/clothing/under/marine/fluff/turtleneck, - /obj/item/clothing/glasses/fluff/eyepatch, - ) - -/obj/item/storage/box/donator_kit/laser243 - donor_key = "laser243" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/laser243, - /obj/item/clothing/suit/storage/marine/fluff/laser243, - ) - -/obj/item/storage/box/donator_kit/leondark16 - donor_key = "leondark16" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/leondark) - -/obj/item/storage/box/donator_kit/lestatanderson - donor_key = "lestatanderson" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/cia) - -/obj/item/storage/box/donator_kit/limodish - donor_key = "limodish" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/limo, - /obj/item/clothing/mask/fluff/limo, - /obj/item/clothing/suit/storage/marine/fluff/limo, - /obj/item/clothing/under/marine/fluff/turtleneck, //generic item - ) - -/obj/item/storage/box/donator_kit/lostmixup - donor_key = "lostmixup" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/lostmixup, - /obj/item/clothing/mask/fluff/lostmixup, - /obj/item/clothing/suit/storage/marine/fluff/lostmixup, - ) - -/obj/item/storage/box/donator_kit/markvalentine - donor_key = "markvalentine" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/valentine, - /obj/item/clothing/suit/storage/marine/fluff/valentine, - /obj/item/clothing/under/marine/fluff/valentine, - ) - -/obj/item/storage/box/donator_kit/mitii - donor_key = "mitii" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/mitii, - /obj/item/clothing/suit/storage/marine/fluff/mitii, - /obj/item/storage/backpack/marine/fluff/mitii, - ) - -/obj/item/storage/box/donator_kit/mrbark45 - donor_key = "mrbark45" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/bark) - -/obj/item/storage/box/donator_kit/nickiskool - donor_key = "nickiskool" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/nickiskool, - /obj/item/clothing/suit/storage/marine/fluff/nickiskool, - /obj/item/clothing/under/marine/fluff/nickiskool, - ) - -/obj/item/storage/box/donator_kit/ningajai - donor_key = "ningajai" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/ningajai) - -/obj/item/storage/box/donator_kit/obeystylez - donor_key = "obeystylez" - donor_gear = list( - /obj/item/clothing/gloves/black/obey, - /obj/item/clothing/mask/fluff/balaclava, //generic item - /obj/item/clothing/suit/storage/marine/fluff/obey, - /obj/item/clothing/under/marine/fluff/turtleneck, //generic item - ) - -/obj/item/storage/box/donator_kit/officialjake - donor_key = "officialjake" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/officialjake) - -/obj/item/storage/box/donator_kit/oneonethreeeight - donor_key = "oneonethreeeight" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/oneonethreeeight, - /obj/item/clothing/suit/storage/marine/fluff/oneonethreeeight, - /obj/item/clothing/under/marine/fluff/oneonethreeeight, - ) - -/obj/item/storage/box/donator_kit/paradox1i7 - donor_key = "paradox1i7" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/paradox, - /obj/item/clothing/suit/storage/marine/fluff/paradox, - /obj/item/clothing/under/marine/fluff/paradox, - ) - -/obj/item/storage/box/donator_kit/poops_buttly - donor_key = "poops_buttly" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/kaila, - /obj/item/clothing/suit/storage/marine/fluff/kaila, - ) - -/obj/item/storage/box/donator_kit/radicalscorpion - donor_key = "radicalscorpion" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/radical, - /obj/item/clothing/mask/fluff/balaclava, //generic item - /obj/item/clothing/suit/storage/marine/fluff/radical, - /obj/item/clothing/under/marine/fluff/radical, - ) - -/obj/item/storage/box/donator_kit/robin63 - donor_key = "robin63" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/robin) - -/obj/item/storage/box/donator_kit/rogue1131 - donor_key = "rogue1131" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/titus, - /obj/item/clothing/suit/storage/marine/fluff/titus, - ) - -/obj/item/storage/box/donator_kit/sadokist - donor_key = "sadokist" - donor_gear = list( - /obj/item/clothing/glasses/fluff/sadokist, - /obj/item/clothing/head/helmet/marine/fluff/sadokist, - /obj/item/clothing/suit/storage/marine/fluff/sadokist, - /obj/item/storage/backpack/marine/fluff/sadokist, - ) - -/obj/item/storage/box/donator_kit/sailordave - donor_key = "sailordave" - donor_gear = list(/obj/item/clothing/under/marine/fluff/sailordave) - -/obj/item/storage/box/donator_kit/sasoperative_elite //sasoperative has several sets - donor_key = "sasoperative" - kit_variant = "Elite" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/sas_elite, - /obj/item/clothing/mask/fluff/sas_elite, - /obj/item/clothing/suit/storage/marine/fluff/sas_elite, - /obj/item/clothing/under/marine/fluff/sas_elite, - ) - -/obj/item/storage/box/donator_kit/sasoperative_juggernaut - donor_key = "sasoperative" - kit_variant = "Juggernaut" - donor_gear = list( - /obj/item/storage/backpack/marine/satchel/fluff/sas_juggernaut, - /obj/item/clothing/head/helmet/marine/fluff/sas_juggernaut, - /obj/item/clothing/suit/storage/marine/fluff/sas_juggernaut, - ) - -/obj/item/storage/box/donator_kit/sasoperative_legion - donor_key = "sasoperative" - kit_variant = "Legion" - donor_gear = list( - /obj/item/clothing/suit/storage/marine/light/fluff/sas_legion, - /obj/item/clothing/head/helmet/marine/fluff/sas_legion, - /obj/item/storage/backpack/marine/satchel/fluff/sas_legion, - ) - -/obj/item/storage/box/donator_kit/seloc_aferah - donor_key = "seloc_aferah" - donor_gear = list(/obj/item/clothing/head/helmet/marine/fluff/deejay) - -/obj/item/storage/box/donator_kit/starscream123 - donor_key = "starscream123" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/starscream, - /obj/item/clothing/mask/fluff/starscream, - /obj/item/clothing/suit/storage/marine/fluff/starscream, - /obj/item/clothing/under/marine/fluff/starscream, - ) - -/obj/item/storage/box/donator_kit/steelpoint - donor_key = "steelpoint" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/steelpoint, - /obj/item/clothing/shoes/marine/fluff/steelpoint, - /obj/item/clothing/suit/storage/marine/fluff/steelpoint, - /obj/item/clothing/under/marine/fluff/steelpoint, - ) - -/obj/item/storage/box/donator_kit/stobarico - donor_key = "stobarico" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/stobarico) - -/obj/item/storage/box/donator_kit/theflagbearer - donor_key = "theflagbearer" - donor_gear = list(/obj/item/clothing/under/marine/fluff/leeeverett) - -/obj/item/storage/box/donator_kit/theultimatechimera - donor_key = "theultimatechimera" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/chimera, - /obj/item/clothing/suit/storage/marine/fluff/chimera, - ) - -/obj/item/storage/box/donator_kit/tophatpenguin_wooki //ckey tophatpenguin has two sets - donor_key = "tophatpenguin" - kit_variant = "Wooki" - donor_gear = list( - /obj/item/clothing/suit/storage/marine/fluff/penguin, - /obj/item/clothing/under/marine/fluff/wooki, - /obj/item/clothing/head/helmet/marine/fluff/penguin, - ) - -/obj/item/storage/box/donator_kit/tophatpenguin_santa - donor_key = "tophatpenguin" - kit_variant = "Santa" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/santahat, - /obj/item/clothing/suit/storage/marine/fluff/santa, - ) - -/obj/item/storage/box/donator_kit/totalanarchy - donor_key = "totalanarchy" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/totalanarchy, - /obj/item/clothing/mask/fluff/totalanarchy, - /obj/item/clothing/suit/storage/marine/fluff/totalanarchy, - /obj/item/clothing/under/marine/fluff/totalanarchy, - ) - -/obj/item/storage/box/donator_kit/tranquill - donor_key = "tranquill" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/tranquill) - -/obj/item/storage/box/donator_kit/trblackdragon - donor_key = "trblackdragon" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/trblackdragon, - /obj/item/clothing/suit/storage/marine/fluff/trblackdragon, - ) - -/obj/item/storage/box/donator_kit/tristan63 - donor_key = "tristan63" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/tristan, - /obj/item/clothing/suit/storage/marine/fluff/tristan, - /obj/item/clothing/under/marine/fluff/tristan, - ) - -/obj/item/storage/box/donator_kit/tyran68 - donor_key = "tyran68" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/tyran) - -/obj/item/storage/box/donator_kit/shotgunbill - donor_key = "shotgunbill" - donor_gear = list(/obj/item/clothing/head/collectable/petehat) - -/obj/item/storage/box/donator_kit/vintagepalmer - donor_key = "vintagepalmer" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/vintage, - /obj/item/clothing/shoes/marine/fluff/vintage, - /obj/item/clothing/suit/storage/marine/fluff/vintage, - /obj/item/clothing/under/marine/fluff/vintage, - ) - -/obj/item/storage/box/donator_kit/whiteblood17 - donor_key = "whiteblood17" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/whiteblood17, - /obj/item/clothing/under/marine/fluff/whiteblood17, - ) - -/obj/item/storage/box/donator_kit/wrightthewrong - donor_key = "wrightthewrong" - donor_gear = list( - /obj/item/clothing/glasses/fluff/wright, - /obj/item/clothing/suit/storage/marine/fluff/wright, - /obj/item/clothing/under/marine/fluff/turtleneck, //generic item - ) - -/obj/item/storage/box/donator_kit/zegara - donor_key = "zegara" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/zegara) - -/obj/item/storage/box/donator_kit/zynax - donor_key = "zynax" - donor_gear = list( - /obj/item/clothing/mask/fluff/balaclava, //generic item - /obj/item/clothing/suit/storage/marine/fluff/Zynax, - /obj/item/clothing/under/marine/fluff/turtleneck, //generic item - /obj/item/clothing/under/marine/fluff/Zynax, - ) - -/obj/item/storage/box/donator_kit/mileswolfe - donor_key = "mileswolfe" - donor_gear = list(/obj/item/clothing/under/marine/fluff/mileswolfe) - -/obj/item/storage/box/donator_kit/killaninja12 - donor_key = "killaninja12" - donor_gear = list( - /obj/item/clothing/head/helmet/marine/fluff/killaninja12, - /obj/item/clothing/suit/storage/marine/fluff/killaninja12, - ) - -/obj/item/storage/box/donator_kit/noize - donor_key = "noize" - donor_gear = list(/obj/item/clothing/suit/storage/marine/fluff/forwardslashn) - -/obj/item/storage/box/donator_kit/deanthelis - donor_key = "deanthelis" - donor_gear = list(/obj/item/clothing/head/beret/marine/techofficer) diff --git a/code/modules/cm_marines/custom_items.dm b/code/modules/cm_marines/custom_items.dm new file mode 100644 index 000000000000..bb1830dc5b03 --- /dev/null +++ b/code/modules/cm_marines/custom_items.dm @@ -0,0 +1,165 @@ +GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") +GLOBAL_LIST_EMPTY(donator_items) + +/obj/structure/machinery/personal_gear_vendor + name = "personal gear vendor" + desc = "A console that allows the user to retrieve their personal possessions from the ASRS." + icon = 'icons/obj/structures/machinery/computer.dmi' + icon_state = "cellconsole" + density = TRUE + unacidable = TRUE + unslashable = TRUE + ///a random item that can be claimed if there is no valid kit + var/static/list/random_personal_possessions = list() + ///list of ckeys of ckeys who redeemed kits + var/static/list/ckeys_redeemed_kits = list() + +/obj/structure/machinery/personal_gear_vendor/Initialize(mapload, ...) + . = ..() + if(!length(GLOB.donator_items)) + generate_donor_kits() + + if(!length(random_personal_possessions)) + generate_random_possessions() + +/obj/structure/machinery/personal_gear_vendor/proc/generate_donor_kits(regenerate_kits = FALSE) + if(regenerate_kits) + GLOB.donator_items = list() + + for(var/current_line in GLOB.custom_items) + if(!length(current_line)) //empty line + continue + if(copytext(current_line, 1, 2) == "#") //comment line + continue + + var/donor_key + var/list/kit_gear = list() + var/kit_name = "Default" + + var/split_line = splittext(current_line, ":") + + donor_key = trim(split_line[1]) + if(length(split_line) > 2) //if someone has multiple kits, name them + kit_name = trim(split_line[2]) + + for(var/current_item in splittext(split_line[length(split_line)], ",")) + var/current_path = text2path(trim(current_item)) + if(!current_path) + stack_trace("Missing typepath in Donator Gear. [donor_key] has an invalid typepath for [current_item].") + continue + kit_gear += current_path + + if(!length(kit_gear)) //shouldnt let them get empty kits + stack_trace("Missing gear in Donator Gear. [donor_key] has an empty Donator Kit.") + continue + + if(kit_name in GLOB.donator_items[donor_key]) //multiple kits with same name + stack_trace("Duplicate kit in Donator Gear. [donor_key] has multiple [kit_name] Donator Kits.") + continue + + GLOB.donator_items[donor_key] += list("[kit_name]" = kit_gear) + +/obj/structure/machinery/personal_gear_vendor/proc/generate_random_possessions(regenerate_kits = FALSE) + if(regenerate_kits) + random_personal_possessions = list() + + for(var/datum/gear/current_gear as anything in subtypesof(/datum/gear)) + if(!initial(current_gear.display_name)) + continue + random_personal_possessions += initial(current_gear.path) + +/obj/structure/machinery/personal_gear_vendor/attack_hand(mob/living/user) + if(..()) + return TRUE + + if(!ishuman(user)) + return FALSE + + if(user.ckey in ckeys_redeemed_kits) + to_chat(user, SPAN_NOTICE("You have already retrieved your kit.")) + return TRUE + + var/list/possible_kits = list() + if(user.ckey in GLOB.donator_items) + possible_kits += GLOB.donator_items[user.ckey] + + if(length(possible_kits) == 0) //if no donor kit they can get something else + var/random_item = pick(random_personal_possessions) + random_item = new random_item(get_turf(src)) + user.put_in_any_hand_if_possible(random_item) + to_chat(user, SPAN_NOTICE("You take [random_item] from [src].")) + ckeys_redeemed_kits += user.ckey + return TRUE + + if(length(possible_kits) == 1) + user.put_in_any_hand_if_possible(new /obj/item/storage/box/donator_kit(get_turf(src), user.ckey, possible_kits[possible_kits[1]])) + to_chat(user, SPAN_NOTICE("You retrieve your kit from [src].")) + ckeys_redeemed_kits += user.ckey + return TRUE + + if(length(possible_kits) >= 2) + var/kit_choice = tgui_input_list(user, "Pick a kit to take:", "Donation Kit Selection", possible_kits) + if(!kit_choice) + to_chat(user, SPAN_NOTICE("You choose not to take any kits.")) + return TRUE + if(!user.Adjacent(src)) + to_chat(user, SPAN_NOTICE("You are too far from [src].")) + return TRUE + user.put_in_any_hand_if_possible(new /obj/item/storage/box/donator_kit(get_turf(src), user.ckey, possible_kits[kit_choice])) + to_chat(user, SPAN_NOTICE("You retrieve your kit from [src].")) + ckeys_redeemed_kits += user.ckey + return TRUE + +/obj/structure/machinery/personal_gear_vendor/attackby(obj/item/attacking_item, mob/user) + if(!istype(attacking_item, /obj/item/storage/box/donator_kit)) + return ..() + + var/obj/item/storage/box/donator_kit/kit = attacking_item + if(!kit.allowed(user)) + to_chat(user, SPAN_WARNING("[src] denies [kit].")) + return TRUE + to_chat(user, SPAN_NOTICE("You return [kit] to [src].")) + user.drop_held_item(kit) + kit.forceMove(src) + qdel(kit) + return TRUE + +/obj/item/storage/box/donator_kit + name = "personal gear kit" + desc = "A cardboard box stamped with a dollar sign and filled with trinkets. It contains someones personal possessions.." + icon = 'icons/obj/items/storage/kits.dmi' + icon_state = "donator_kit" + item_state = "giftbag" + max_w_class = SIZE_TINY + var/linked_ckey + +/obj/item/storage/box/donator_kit/get_examine_text(mob/user) + . = ..() + if(linked_ckey && user.ckey == linked_ckey) + . += SPAN_INFO("This kit can only be opened by you.") + . += SPAN_INFO("This kit can be deleted by returning it to the personal gear vendor.") + +/obj/item/storage/box/donator_kit/Initialize(mapload, owner_ckey, list/selected_kit) + . = ..() + if(owner_ckey) + linked_ckey = owner_ckey + + for(var/current_item in selected_kit) + new current_item(src) + +/obj/item/storage/box/donator_kit/open(mob/user) + if(!allowed(user)) + to_chat(user, SPAN_NOTICE("You do not have access to [src].")) + return + return ..() + +/obj/item/storage/box/donator_kit/empty(mob/user, turf/drop_to) + if(!allowed(user)) + to_chat(user, SPAN_NOTICE("You do not have access to [src].")) + return + return ..() + +/obj/item/storage/box/donator_kit/allowed(mob/user) + if(linked_ckey && user.ckey != linked_ckey) + return FALSE + return TRUE diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm deleted file mode 100644 index e9733d0635ed..000000000000 --- a/code/modules/customitems/item_spawning.dm +++ /dev/null @@ -1,34 +0,0 @@ -//switch this out to use a database at some point -//list of ckey/ real_name and item paths -//gives item to specific people when they join if it can -//for multiple items just add mutliple entries, unless i change it to be a listlistlist -//yes, it has to be an item, you can't pick up nonitems - -GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") - -/proc/EquipCustomItems(mob/living/carbon/human/M) - for(var/line in GLOB.custom_items) - // split & clean up - var/list/Entry = splittext(line, ":") - for(var/i = 1 to length(Entry)) - Entry[i] = trim(Entry[i]) - - if(length(Entry) < 2) - continue; - - if(Entry[1] == M.ckey) - var/list/Paths = splittext(Entry[2], ",") - for(var/P in Paths) - var/ok = FALSE // TRUE if the item was placed successfully - P = trim(P) - var/path = text2path(P) - if(!path) continue - - var/obj/item/Item = new path() - for(var/obj/item/storage/S in M.contents) // Try to place it in any item that can store stuff, on the mob. - if (S.handle_item_insertion(Item, TRUE)) - ok = TRUE - break - - if (ok == FALSE) // Finally, since everything else failed, place it on the ground - Item.forceMove(get_turf(M.loc)) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 66dee6ef9fa2..e80538353210 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -291,7 +291,8 @@ var/mob/living/carbon/human/character = create_character(TRUE) //creates the human and transfers vars and mind GLOB.RoleAuthority.equip_role(character, player_rank, late_join = TRUE) - EquipCustomItems(character) + if(character.ckey in GLOB.donator_items) + to_chat(character, SPAN_BOLDNOTICE("You have gear available in the personal gear vendor near Requisitions.")) if((GLOB.security_level > SEC_LEVEL_BLUE || SShijack.hijack_status) && player_rank.gets_emergency_kit) to_chat(character, SPAN_HIGHDANGER("As you stagger out of hypersleep, the sleep bay blares: '[SShijack.evac_status ? "VESSEL UNDERGOING EVACUATION PROCEDURES, SELF DEFENSE KIT PROVIDED" : "VESSEL IN HEIGHTENED ALERT STATUS, SELF DEFENSE KIT PROVIDED"]'.")) diff --git a/colonialmarines.dme b/colonialmarines.dme index 7e1ed4d91f5c..423b66356dd5 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1651,8 +1651,8 @@ #include "code\modules\cm_marines\altitude_control_console.dm" #include "code\modules\cm_marines\anti_air.dm" #include "code\modules\cm_marines\codebook.dm" +#include "code\modules\cm_marines\custom_items.dm" #include "code\modules\cm_marines\Donator_Items.dm" -#include "code\modules\cm_marines\Donator_Kits.dm" #include "code\modules\cm_marines\dropship_ammo.dm" #include "code\modules\cm_marines\dropship_equipment.dm" #include "code\modules\cm_marines\m2c.dm" @@ -1725,7 +1725,6 @@ #include "code\modules\cm_tech\techs\marine\tier3\cryorine.dm" #include "code\modules\cm_tech\techs\marine\tier4\nuke.dm" #include "code\modules\cm_tech\trees\marine.dm" -#include "code\modules\customitems\item_spawning.dm" #include "code\modules\decorators\admin_runtime_decorator.dm" #include "code\modules\decorators\cassette_decorator.dm" #include "code\modules\decorators\christmas.dm" diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index dce44a720577..e85786719749 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -45261,6 +45261,10 @@ /obj/structure/machinery/light{ dir = 8 }, +/obj/structure/machinery/personal_gear_vendor{ + dir = 8; + pixel_x = -4 + }, /turf/open/floor/almayer/plate, /area/almayer/squads/req) "oMi" = ( diff --git a/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm b/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm index 2129895439fb..0727066a1b51 100644 --- a/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm +++ b/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm @@ -4394,6 +4394,9 @@ /area/whiskey_outpost/outside/south) "tj" = ( /obj/structure/machinery/light/small, +/obj/structure/machinery/personal_gear_vendor{ + pixel_x = 6 + }, /turf/open/floor/asteroidfloor/north, /area/whiskey_outpost) "tk" = (