From c6e165b2c9be2ca783dd3eab49260b2f47680c59 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:32:31 -0500 Subject: [PATCH 01/17] Shoes Yes shoes --- modular_doppler/Loadouts/categories/shoes.dm | 87 ++++++++++++++++++++ tgstation.dme | 1 + 2 files changed, 88 insertions(+) create mode 100644 modular_doppler/Loadouts/categories/shoes.dm diff --git a/modular_doppler/Loadouts/categories/shoes.dm b/modular_doppler/Loadouts/categories/shoes.dm new file mode 100644 index 0000000000000..a5f2d6a14fd8f --- /dev/null +++ b/modular_doppler/Loadouts/categories/shoes.dm @@ -0,0 +1,87 @@ +/datum/loadout_category/feet + category_name = "Feet" + category_ui_icon = FA_ICON_SHOE_PRINTS + type_to_generate = /datum/loadout_item/shoes + tab_order = /datum/loadout_category/glasses::tab_order + 1 + +/* +* LOADOUT ITEM DATUMS FOR THE SHOE SLOT +*/ +/datum/loadout_item/shoes + abstract_type = /datum/loadout_item/shoes + + +/datum/loadout_item/shoes/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.shoes) + LAZYADD(outfit.backpack_contents, outfit.shoes) + outfit.shoes = item_path + +/datum/loadout_item/shoes/jackboots + name = "Jackboots" + item_path = /obj/item/clothing/shoes/jackboots + +/datum/loadout_item/shoes/sneakers/white + name = "White Sneakers" + item_path = /obj/item/clothing/shoes/sneakers/white + +/datum/loadout_item/shoes/sneakers/rainbow + name = "Rainbow Sneakers" + item_path = /obj/item/clothing/shoes/sneakers/rainbow + +/datum/loadout_item/shoes/workboots + name = "Work Boots" + item_path = /obj/item/clothing/shoes/workboots + +/datum/loadout_item/shoes/workboots/mining + name = "Mining Boots" + item_path = /obj/item/clothing/shoes/workboots/mining + +/datum/loadout_item/shoes/laceup + name = "Lace-Up Shoes" + item_path = /obj/item/clothing/shoes/laceup + +/datum/loadout_item/shoes/sandal + name = "Sandals" + item_path = /obj/item/clothing/shoes/sandal + +/datum/loadout_item/shoes/magboots + name = "Magboots" + item_path = /obj/item/clothing/shoes/magboots + +/datum/loadout_item/shoes/winterboots + name = "Winter Boots" + item_path = /obj/item/clothing/shoes/winterboots + +/datum/loadout_item/shoes/clown_shoes + name = "Clown Shoes" + item_path = /obj/item/clothing/shoes/clown_shoes + +/datum/loadout_item/shoes/jester_shoes + name = "Jester Shoes" + item_path = /obj/item/clothing/shoes/jester_shoes + +/datum/loadout_item/shoes/ducky_shoes + name = "Ducky Shoes" + item_path = /obj/item/clothing/shoes/ducky_shoes + +/datum/loadout_item/shoes/wheelys + name = "Wheelys" + item_path = /obj/item/clothing/shoes/wheelys + +/datum/loadout_item/shoes/cowboy + name = "Cowboy Boots" + item_path = /obj/item/clothing/shoes/cowboy + +/datum/loadout_item/shoes/cowboy/lizard + name = "Lizard Cowboy Boots" + item_path = /obj/item/clothing/shoes/cowboy/lizard + +/datum/loadout_item/shoes/russian + name = "Russian Boots" + item_path = /obj/item/clothing/shoes/russian + +/datum/loadout_item/shoes/pirate + name = "Pirate Boots" + item_path = /obj/item/clothing/shoes/pirate + + diff --git a/tgstation.dme b/tgstation.dme index 68246d851194b..6b2d2820ca7d2 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6365,6 +6365,7 @@ #include "modular_doppler\icspawn\observer_spawn.dm" #include "modular_doppler\icspawn\spell.dm" #include "modular_doppler\languages\language_datums.dm" +#include "modular_doppler\Loadouts\categories\shoes.dm" #include "modular_doppler\modular_cosmetics\code\jacket_pockets.dm" #include "modular_doppler\modular_cosmetics\code\neck\collar.dm" #include "modular_doppler\modular_cosmetics\code\suits\jacket.dm" From fcc1dbf30a776d0a2702ec814dbba89472f457c2 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:52:24 -0500 Subject: [PATCH 02/17] So many Categories --- modular_doppler/Loadouts/categories/belts.dm | 102 ++++++++++++++++++ modular_doppler/Loadouts/categories/ears.dm | 25 +++++ .../Loadouts/categories/glasses.dm | 7 ++ modular_doppler/Loadouts/categories/gloves.dm | 69 ++++++++++++ modular_doppler/Loadouts/categories/heads.dm | 55 ++++++++++ tgstation.dme | 5 + 6 files changed, 263 insertions(+) create mode 100644 modular_doppler/Loadouts/categories/belts.dm create mode 100644 modular_doppler/Loadouts/categories/ears.dm create mode 100644 modular_doppler/Loadouts/categories/glasses.dm create mode 100644 modular_doppler/Loadouts/categories/gloves.dm create mode 100644 modular_doppler/Loadouts/categories/heads.dm diff --git a/modular_doppler/Loadouts/categories/belts.dm b/modular_doppler/Loadouts/categories/belts.dm new file mode 100644 index 0000000000000..6fd27013976d7 --- /dev/null +++ b/modular_doppler/Loadouts/categories/belts.dm @@ -0,0 +1,102 @@ +/datum/loadout_category/belt + category_name = "Belt" + category_ui_icon = FA_ICON_SCREWDRIVER_WRENCH + type_to_generate = /datum/loadout_item/belts + tab_order = /datum/loadout_category/accessories::tab_order + 1 + + +/* +* LOADOUT ITEM DATUMS FOR THE BELT SLOT +*/ +/datum/loadout_item/belts + abstract_type = /datum/loadout_item/belts + +/datum/loadout_item/belts/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.belt) + LAZYADD(outfit.backpack_contents, outfit.belt) + outfit.belt = item_path + + +/datum/loadout_item/belts/fanny_pack_black + name = "Black Fannypack" + item_path = /obj/item/storage/belt/fannypack/black + +/datum/loadout_item/belts/fanny_pack_blue + name = "Blue Fannypack" + item_path = /obj/item/storage/belt/fannypack/blue + +/datum/loadout_item/belts/fanny_pack_brown + name = "Brown Fannypack" + item_path = /obj/item/storage/belt/fannypack + +/datum/loadout_item/belts/fanny_pack_cyan + name = "Cyan Fannypack" + item_path = /obj/item/storage/belt/fannypack/cyan + +/datum/loadout_item/belts/fanny_pack_green + name = "Green Fannypack" + item_path = /obj/item/storage/belt/fannypack/green + +/datum/loadout_item/belts/fanny_pack_orange + name = "Orange Fannypack" + item_path = /obj/item/storage/belt/fannypack/orange + +/datum/loadout_item/belts/fanny_pack_pink + name = "Pink Fannypack" + item_path = /obj/item/storage/belt/fannypack/pink + +/datum/loadout_item/belts/fanny_pack_purple + name = "Purple Fannypack" + item_path = /obj/item/storage/belt/fannypack/purple + +/datum/loadout_item/belts/fanny_pack_red + name = "Red Fannypack" + item_path = /obj/item/storage/belt/fannypack/red + +/datum/loadout_item/belts/fanny_pack_yellow + name = "Yellow Fannypack" + item_path = /obj/item/storage/belt/fannypack/yellow + +/datum/loadout_item/belts/fanny_pack_white + name = "White Fannypack" + item_path = /obj/item/storage/belt/fannypack/white + +/datum/loadout_item/belts/lantern + name = "Lantern" + item_path = /obj/item/flashlight/lantern + +/datum/loadout_item/belts/candle_box + name = "Candle Box" + item_path = /obj/item/storage/fancy/candle_box + +/datum/loadout_item/belts/champion + name = "Champion's Belt" + item_path = /obj/item/storage/belt/champion + +// HOLSTERS + +/datum/loadout_item/belts/holster_shoulders + name = "Shoulder Holster" + item_path = /obj/item/storage/belt/holster + +// USEFUL BELTS + +/datum/loadout_item/belts/medical + name = "Medical Belt" + item_path = /obj/item/storage/belt/medical + +/datum/loadout_item/belts/security + name = "Security Belt" + item_path = /obj/item/storage/belt/security + +/datum/loadout_item/belts/utility + name = "Utility Belt" + item_path = /obj/item/storage/belt/utility + +/datum/loadout_item/belts/utility/chief + name = "Chief Engineer's Utility Belt" + item_path = /obj/item/storage/belt/utility/chief + +/datum/loadout_item/belts/mining + name = "Explorer's Webbing" + item_path = /obj/item/storage/belt/mining diff --git a/modular_doppler/Loadouts/categories/ears.dm b/modular_doppler/Loadouts/categories/ears.dm new file mode 100644 index 0000000000000..f86fe518b2da9 --- /dev/null +++ b/modular_doppler/Loadouts/categories/ears.dm @@ -0,0 +1,25 @@ +/datum/loadout_category/ears + category_name = "Ears" + category_ui_icon = FA_ICON_EAR_LISTEN + type_to_generate = /datum/loadout_item/ears + tab_order = /datum/loadout_category/belt::tab_order + 1 + + +/* +* LOADOUT ITEM DATUMS FOR THE EAR SLOT +*/ +/datum/loadout_item/ears + abstract_type = /datum/loadout_item/ears + +/datum/loadout_item/ears/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.ears) + LAZYADD(outfit.backpack_contents, outfit.ears) + outfit.ears = item_path + +/datum/loadout_item/ears/headphones + name = "Headphones" + item_path = /obj/item/instrument/piano_synth/headphones + +/datum/loadout_item/ears/earmuffs + name = "Earmuffs" + item_path = /obj/item/clothing/ears/earmuffs diff --git a/modular_doppler/Loadouts/categories/glasses.dm b/modular_doppler/Loadouts/categories/glasses.dm new file mode 100644 index 0000000000000..c483d0df6c483 --- /dev/null +++ b/modular_doppler/Loadouts/categories/glasses.dm @@ -0,0 +1,7 @@ +/datum/loadout_item/glasses/monocle + name = "Monocle" + item_path = /obj/item/clothing/glasses/monocle + +/datum/loadout_item/glasses/welding + name = "Welding Goggles" + item_path = /obj/item/clothing/glasses/welding diff --git a/modular_doppler/Loadouts/categories/gloves.dm b/modular_doppler/Loadouts/categories/gloves.dm new file mode 100644 index 0000000000000..0451180b348d5 --- /dev/null +++ b/modular_doppler/Loadouts/categories/gloves.dm @@ -0,0 +1,69 @@ +/* +* LOADOUT ITEM DATUMS FOR THE HAND SLOT +*/ + +/datum/loadout_category/hands + category_name = "Hands" + category_ui_icon = FA_ICON_HAND + type_to_generate = /datum/loadout_item/gloves + tab_order = /datum/loadout_category/ears::tab_order + 1 + +/datum/loadout_item/gloves + abstract_type = /datum/loadout_item/gloves + +/datum/loadout_item/gloves/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.gloves) + LAZYADD(outfit.backpack_contents, outfit.gloves) + outfit.gloves = item_path + +/datum/loadout_item/gloves/fingerless + name = "Fingerless Gloves" + item_path = /obj/item/clothing/gloves/fingerless + +/datum/loadout_item/gloves/black + name = "Black Gloves" + item_path = /obj/item/clothing/gloves/color/black + +/datum/loadout_item/gloves/blue + name = "Blue Gloves" + item_path = /obj/item/clothing/gloves/color/blue + +/datum/loadout_item/gloves/brown + name = "Brown Gloves" + item_path = /obj/item/clothing/gloves/color/brown + +/datum/loadout_item/gloves/green + name = "Green Gloves" + item_path = /obj/item/clothing/gloves/color/green + +/datum/loadout_item/gloves/grey + name = "Grey Gloves" + item_path = /obj/item/clothing/gloves/color/grey + +/datum/loadout_item/gloves/light_brown + name = "Light Brown Gloves" + item_path = /obj/item/clothing/gloves/color/light_brown + +/datum/loadout_item/gloves/orange + name = "Orange Gloves" + item_path = /obj/item/clothing/gloves/color/orange + +/datum/loadout_item/gloves/purple + name = "Purple Gloves" + item_path = /obj/item/clothing/gloves/color/purple + +/datum/loadout_item/gloves/red + name = "Red Gloves" + item_path = /obj/item/clothing/gloves/color/red + +/datum/loadout_item/gloves/white + name = "White Gloves" + item_path = /obj/item/clothing/gloves/color/white + +/datum/loadout_item/gloves/rainbow + name = "Rainbow Gloves" + item_path = /obj/item/clothing/gloves/color/rainbow + + + + diff --git a/modular_doppler/Loadouts/categories/heads.dm b/modular_doppler/Loadouts/categories/heads.dm new file mode 100644 index 0000000000000..ccc6ddc8f5cad --- /dev/null +++ b/modular_doppler/Loadouts/categories/heads.dm @@ -0,0 +1,55 @@ +/datum/loadout_item/head/kitty + name = "Kitty Ears" + item_path = /obj/item/clothing/head/costume/kitty + +/datum/loadout_item/head/chicken + name = "Chicken Hat" + item_path = /obj/item/clothing/head/costume/chicken + +/datum/loadout_item/head/griffin + name = "Griffin Hat" + item_path = /obj/item/clothing/head/costume/griffin + +/datum/loadout_item/head/rabbit + name = "Rabbit Ears" + item_path = /obj/item/clothing/head/costume/rabbitears + +/datum/loadout_item/head/tv_head + name = "TV Head" + item_path = /obj/item/clothing/head/costume/tv_head + +/datum/loadout_item/head/wizard + name = "Wizard Hat" + item_path = /obj/item/clothing/head/wizard/fake + +/datum/loadout_item/head/witch + name = "Witch Hat" + item_path = /obj/item/clothing/head/wizard/marisa/fake + +/datum/loadout_item/head/wig_random + name = "Random Wig" + item_path = /obj/item/clothing/head/wig/random + +/datum/loadout_item/head/cardborg + name = "Cardborg" + item_path = /obj/item/clothing/head/costume/cardborg + +/datum/loadout_item/head/pirate + name = "Pirate Hat" + item_path = /obj/item/clothing/head/costume/pirate + +/datum/loadout_item/head/cone + name = "Cone Hat" + item_path = /obj/item/clothing/head/cone + +/datum/loadout_item/head/party + name = "Party Hat" + item_path = /obj/item/clothing/head/costume/party + +/datum/loadout_item/head/rice_hat + name = "Rice Hat" + item_path = /obj/item/clothing/head/costume/rice_hat + +/datum/loadout_item/head/welding + name = "Welding Mask" + item_path = /obj/item/clothing/head/utility/welding diff --git a/tgstation.dme b/tgstation.dme index 6b2d2820ca7d2..daa86bbf13929 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6365,6 +6365,11 @@ #include "modular_doppler\icspawn\observer_spawn.dm" #include "modular_doppler\icspawn\spell.dm" #include "modular_doppler\languages\language_datums.dm" +#include "modular_doppler\Loadouts\categories\belts.dm" +#include "modular_doppler\Loadouts\categories\ears.dm" +#include "modular_doppler\Loadouts\categories\glasses.dm" +#include "modular_doppler\Loadouts\categories\gloves.dm" +#include "modular_doppler\Loadouts\categories\heads.dm" #include "modular_doppler\Loadouts\categories\shoes.dm" #include "modular_doppler\modular_cosmetics\code\jacket_pockets.dm" #include "modular_doppler\modular_cosmetics\code\neck\collar.dm" From 77d50254d738c8d3a1839550b9e2cccca7ec3a1f Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:57:38 -0500 Subject: [PATCH 03/17] duplicates --- modular_doppler/Loadouts/categories/heads.dm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modular_doppler/Loadouts/categories/heads.dm b/modular_doppler/Loadouts/categories/heads.dm index ccc6ddc8f5cad..c1dcb43bcb29d 100644 --- a/modular_doppler/Loadouts/categories/heads.dm +++ b/modular_doppler/Loadouts/categories/heads.dm @@ -1,7 +1,3 @@ -/datum/loadout_item/head/kitty - name = "Kitty Ears" - item_path = /obj/item/clothing/head/costume/kitty - /datum/loadout_item/head/chicken name = "Chicken Hat" item_path = /obj/item/clothing/head/costume/chicken @@ -10,10 +6,6 @@ name = "Griffin Hat" item_path = /obj/item/clothing/head/costume/griffin -/datum/loadout_item/head/rabbit - name = "Rabbit Ears" - item_path = /obj/item/clothing/head/costume/rabbitears - /datum/loadout_item/head/tv_head name = "TV Head" item_path = /obj/item/clothing/head/costume/tv_head From ee0ba5610d1b14250b3ba3513c801bd1ad1796de Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:31:12 -0500 Subject: [PATCH 04/17] MORE CATEGORIES AAAAAAA --- modular_doppler/Loadouts/READEME.md | 23 ++++++++ .../Loadouts/categories/inhands.dm | 23 ++++++++ modular_doppler/Loadouts/categories/masks.dm | 56 +++++++++++++++++++ tgstation.dme | 2 + 4 files changed, 104 insertions(+) create mode 100644 modular_doppler/Loadouts/READEME.md create mode 100644 modular_doppler/Loadouts/categories/inhands.dm create mode 100644 modular_doppler/Loadouts/categories/masks.dm diff --git a/modular_doppler/Loadouts/READEME.md b/modular_doppler/Loadouts/READEME.md new file mode 100644 index 0000000000000..e6e6ab1ca1a9a --- /dev/null +++ b/modular_doppler/Loadouts/READEME.md @@ -0,0 +1,23 @@ +# LOADOUT CATEGORIES + +Most loadout categories are added in, if it is one that is stock TG just add in additional items in the respecitve files. + +If you need to add more categories the following format should be followed: + +## Format + +```DM +/datum/loadout_category/ + category_name = "" + category_ui_icon = FA_ICON_GLASSES // A Fontawesome icon to be used for the Category item + type_to_generate = /datum/loadout_item/ + tab_order = /datum/loadout_category/head::tab_order + 1 //This is where it will place the item in the tab order + +/datum/loadout_item/ + abstract_type = /datum/loadout_item/glasses + +/datum/loadout_item//insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.glasses) + LAZYADD(outfit.backpack_contents, outfit.glasses) // This will dictate if the item will go into the backpack if the slot is already occupied + outfit.glasses = item_path +``` diff --git a/modular_doppler/Loadouts/categories/inhands.dm b/modular_doppler/Loadouts/categories/inhands.dm new file mode 100644 index 0000000000000..802e9d53514b4 --- /dev/null +++ b/modular_doppler/Loadouts/categories/inhands.dm @@ -0,0 +1,23 @@ +/datum/loadout_item/inhand/cane/crutch + name = "Crutch" + item_path = /obj/item/cane/crutch + +/datum/loadout_item/inhand/skateboard + name = "Skateboard" + item_path = /obj/item/melee/skateboard + +/datum/loadout_item/inhand/bouquet_mixed + name = "Mixed Bouquet" + item_path = /obj/item/bouquet + +/datum/loadout_item/inhand/bouquet_sunflower + name = "Sunflower Bouquet" + item_path = /obj/item/bouquet/sunflower + +/datum/loadout_item/inhand/bouquet_poppy + name = "Poppy Bouquet" + item_path = /obj/item/bouquet/poppy + +/datum/loadout_item/inhand/bouquet_rose + name = "Rose Bouquet" + item_path = /obj/item/bouquet/rose diff --git a/modular_doppler/Loadouts/categories/masks.dm b/modular_doppler/Loadouts/categories/masks.dm new file mode 100644 index 0000000000000..f29fb9616ed15 --- /dev/null +++ b/modular_doppler/Loadouts/categories/masks.dm @@ -0,0 +1,56 @@ +/datum/loadout_category/face + category_name = "Face" + category_ui_icon = FA_ICON_MASK + type_to_generate = /datum/loadout_item/mask + tab_order = /datum/loadout_category/glasses::tab_order + 1 + +/* +* LOADOUT ITEM DATUMS FOR THE MASK SLOT +*/ +/datum/loadout_item/mask + abstract_type = /datum/loadout_item/mask + +/datum/loadout_item/mask/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.mask) + LAZYADD(outfit.backpack_contents, outfit.mask) + outfit.mask = item_path + +/datum/loadout_item/mask/face_mask + name = "Face Mask" + item_path = /obj/item/clothing/mask/breath + +/datum/loadout_item/mask/gas + name = "Gas Mask" + item_path = /obj/item/clothing/mask/gas + +/datum/loadout_item/mask/plaguedoctor + name = "Plague Doctor Mask" + item_path = /obj/item/clothing/mask/plaguedoctor + +/datum/loadout_item/mask/clown + name = "Clown Mask" + item_path = /obj/item/clothing/mask/clown_hat + +/datum/loadout_item/mask/balaclava + name = "Balaclava" + item_path = /obj/item/clothing/mask/balaclava + +/datum/loadout_item/mask/gas/atmos + name = "Atmos Gas Mask" + item_path = /obj/item/clothing/mask/gas/atmos + +/datum/loadout_item/mask/gas/explorer + name = "Explorer Gas Mask" + item_path = /obj/item/clothing/mask/gas/explorer + +/datum/loadout_item/mask/whistle + name = "Whistle" + item_path = /obj/item/clothing/mask/whistle + +/datum/loadout_item/mask/fakemoustache + name = "Fake Moustache" + item_path = /obj/item/clothing/mask/fakemoustache + +/datum/loadout_item/mask/surgical + name = "Surgical Mask" + item_path = /obj/item/clothing/mask/surgical diff --git a/tgstation.dme b/tgstation.dme index daa86bbf13929..367d2d3a1b727 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6370,6 +6370,8 @@ #include "modular_doppler\Loadouts\categories\glasses.dm" #include "modular_doppler\Loadouts\categories\gloves.dm" #include "modular_doppler\Loadouts\categories\heads.dm" +#include "modular_doppler\Loadouts\categories\inhands.dm" +#include "modular_doppler\Loadouts\categories\masks.dm" #include "modular_doppler\Loadouts\categories\shoes.dm" #include "modular_doppler\modular_cosmetics\code\jacket_pockets.dm" #include "modular_doppler\modular_cosmetics\code\neck\collar.dm" From 9983577e764bd7b134905a403c115567f46e583a Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:42:28 -0500 Subject: [PATCH 05/17] Minor Mistakes --- modular_doppler/Loadouts/categories/masks.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modular_doppler/Loadouts/categories/masks.dm b/modular_doppler/Loadouts/categories/masks.dm index f29fb9616ed15..f7e83c5651240 100644 --- a/modular_doppler/Loadouts/categories/masks.dm +++ b/modular_doppler/Loadouts/categories/masks.dm @@ -25,11 +25,11 @@ /datum/loadout_item/mask/plaguedoctor name = "Plague Doctor Mask" - item_path = /obj/item/clothing/mask/plaguedoctor + item_path = /obj/item/clothing/mask/gas/plaguedoctor /datum/loadout_item/mask/clown name = "Clown Mask" - item_path = /obj/item/clothing/mask/clown_hat + item_path = /obj/item/clothing/mask/gas/clown_hat /datum/loadout_item/mask/balaclava name = "Balaclava" From 7437619b7303594dc5bf283287f14ba87706a8e7 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:41:26 -0500 Subject: [PATCH 06/17] Pocket and helpers --- code/__DEFINES/~doppler_defines/loadout.dm | 34 +++ .../Loadouts/categories/pockets.dm | 226 ++++++++++++++++++ modular_doppler/Loadouts/loadout_helpers.dm | 175 ++++++++++++++ tgstation.dme | 3 + 4 files changed, 438 insertions(+) create mode 100644 code/__DEFINES/~doppler_defines/loadout.dm create mode 100644 modular_doppler/Loadouts/categories/pockets.dm create mode 100644 modular_doppler/Loadouts/loadout_helpers.dm diff --git a/code/__DEFINES/~doppler_defines/loadout.dm b/code/__DEFINES/~doppler_defines/loadout.dm new file mode 100644 index 0000000000000..30882b45b9d63 --- /dev/null +++ b/code/__DEFINES/~doppler_defines/loadout.dm @@ -0,0 +1,34 @@ +/// Defines for what loadout slot a corresponding item belongs to. +#define LOADOUT_ITEM_BELT "belt" +#define LOADOUT_ITEM_EARS "ears" +#define LOADOUT_ITEM_GLASSES "glasses" +#define LOADOUT_ITEM_GLOVES "gloves" +#define LOADOUT_ITEM_HEAD "head" +#define LOADOUT_ITEM_MASK "mask" +#define LOADOUT_ITEM_NECK "neck" +#define LOADOUT_ITEM_SHOES "shoes" +#define LOADOUT_ITEM_SUIT "suit" +#define LOADOUT_ITEM_UNIFORM "under" +#define LOADOUT_ITEM_ACCESSORY "accessory" +#define LOADOUT_ITEM_INHAND "inhand_items" +#define LOADOUT_ITEM_MISC "pocket_items" +#define LOADOUT_ITEM_TOYS "toys" + +/// Used to set custom descriptions. +#define INFO_DESCRIBED "description" + +/// Max amonut of misc / backpack items that are allowed. +#define MAX_ALLOWED_MISC_ITEMS 3 +/// The maximum allowed amount of erp items allowed in any given character's loadout +#define MAX_ALLOWED_ERP_ITEMS 7 + +/// Defines for extra info blurbs, for loadout items. +#define TOOLTIP_NO_ARMOR "Armorless" +#define TOOLTIP_NO_DAMAGE "CEREMONIAL - This item has very low force and is cosmetic." +#define TOOLTIP_RANDOM_COLOR "Random Color" +#define TOOLTIP_GREYSCALE "GREYSCALED - This item can be customized via the greyscale modification UI." +#define TOOLTIP_RENAMABLE "RENAMABLE - This item can be given a custom name." + +#define LOADOUT_OVERRIDE_JOB "Delete job items" +#define LOADOUT_OVERRIDE_BACKPACK "Move job to backpack" +#define LOADOUT_OVERRIDE_CASE "Place all in case" diff --git a/modular_doppler/Loadouts/categories/pockets.dm b/modular_doppler/Loadouts/categories/pockets.dm new file mode 100644 index 0000000000000..b9cfda99c470a --- /dev/null +++ b/modular_doppler/Loadouts/categories/pockets.dm @@ -0,0 +1,226 @@ +// The wallet loadout item is special, and puts the player's ID and other small items into it on initialize (fancy!) +/datum/loadout_item/pocket_items/wallet + name = "Wallet" + item_path = /obj/item/storage/wallet + additional_displayed_text = list("Auto-Filled") + +// We add our wallet manually, later, so no need to put it in any outfits. +/datum/loadout_item/pocket_items/wallet/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only) + return FALSE + +// We didn't spawn any item yet, so nothing to call here. +/datum/loadout_item/pocket_items/wallet/on_equip_item( + obj/item/equipped_item, + datum/preferences/preference_source, + list/preference_list, + mob/living/carbon/human/equipper, + visuals_only = FALSE, +) + return FALSE + +// We add our wallet at the very end of character initialization (after quirks, etc) to ensure the backpack / their ID is all set by now. +/datum/loadout_item/pocket_items/wallet/post_equip_item(datum/preferences/preference_source, mob/living/carbon/human/equipper) + var/obj/item/card/id/advanced/id_card = equipper.get_item_by_slot(ITEM_SLOT_ID) + if(istype(id_card, /obj/item/storage/wallet)) + return + + var/obj/item/storage/wallet/wallet = new(equipper) + if(istype(id_card)) + equipper.temporarilyRemoveItemFromInventory(id_card, force = TRUE) + equipper.equip_to_slot_if_possible(wallet, ITEM_SLOT_ID, initial = TRUE) + id_card.forceMove(wallet) + + if(equipper.back) + var/list/backpack_stuff = equipper.back.atom_storage?.return_inv(FALSE) + for(var/obj/item/thing in backpack_stuff) + if(wallet.contents.len >= 3) + break + if(thing.w_class <= WEIGHT_CLASS_SMALL) + wallet.atom_storage.attempt_insert(src, thing, equipper, TRUE, FALSE) + else + if(!equipper.equip_to_slot_if_possible(wallet, slot = ITEM_SLOT_BACKPACK, initial = TRUE)) + wallet.forceMove(equipper.drop_location()) + +/* +* GUM +*/ + +/datum/loadout_item/pocket_items/gum_pack + name = "Pack of Gum" + item_path = /obj/item/storage/box/gum + +/datum/loadout_item/pocket_items/gum_pack_nicotine + name = "Pack of Nicotine Gum" + item_path = /obj/item/storage/box/gum/nicotine + +/datum/loadout_item/pocket_items/gum_pack_hp + name = "Pack of HP+ Gum" + item_path = /obj/item/storage/box/gum/happiness + +/* +* LIPSTICK +*/ + +/datum/loadout_item/pocket_items/lipstick_green + name = "Green Lipstick" + item_path = /obj/item/lipstick/green + +/datum/loadout_item/pocket_items/lipstick_white + name = "White Lipstick" + item_path = /obj/item/lipstick/white + +/datum/loadout_item/pocket_items/lipstick_blue + name = "Blue Lipstick" + item_path = /obj/item/lipstick/blue + +/datum/loadout_item/pocket_items/lipstick_black + name = "Black Lipstick" + item_path = /obj/item/lipstick/black + +/datum/loadout_item/pocket_items/lipstick_jade + name = "Jade Lipstick" + item_path = /obj/item/lipstick/jade + +/datum/loadout_item/pocket_items/lipstick_purple + name = "Purple Lipstick" + item_path = /obj/item/lipstick/purple + +/datum/loadout_item/pocket_items/lipstick_red + name = "Red Lipstick" + item_path = /obj/item/lipstick + +/* +* MISC +*/ + +/datum/loadout_item/pocket_items/rag + name = "Rag" + item_path = /obj/item/reagent_containers/cup/rag + +/datum/loadout_item/pocket_items/razor + name = "Razor" + item_path = /obj/item/razor + +/datum/loadout_item/pocket_items/matches + name = "Matchbox" + item_path = /obj/item/storage/box/matches + +/datum/loadout_item/pocket_items/cheaplighter + name = "Cheap Lighter" + item_path = /obj/item/lighter/greyscale + +/datum/loadout_item/pocket_items/zippolighter + name = "Zippo Lighter" + item_path = /obj/item/lighter + +/*/datum/loadout_item/pocket_items/ttsdevice //To be added + name = "Text-to-Speech Device" + item_path = /obj/item/ttsdevice*/ + +/datum/loadout_item/pocket_items/paicard + name = "Personal AI Device" + item_path = /obj/item/pai_card + +/datum/loadout_item/pocket_items/link_scryer + name = "MODlink Scryer" + item_path = /obj/item/clothing/neck/link_scryer/loaded + +/datum/loadout_item/pocket_items/cigarettes + name = "Cigarette Pack" + item_path = /obj/item/storage/fancy/cigarettes + +/datum/loadout_item/pocket_items/cigar //smoking is bad mkay + name = "Cigar" + item_path = /obj/item/cigarette/cigar + +/datum/loadout_item/pocket_items/flask + name = "Flask" + item_path = /obj/item/reagent_containers/cup/glass/flask + +/datum/loadout_item/pocket_items/multipen + name = "Multicolored Pen" + item_path = /obj/item/pen/fourcolor + +/datum/loadout_item/pocket_items/fountainpen + name = "Fancy Pen" + item_path = /obj/item/pen/fountain + +/datum/loadout_item/pocket_items/tapeplayer + name = "Universal Recorder" + item_path = /obj/item/taperecorder + +/datum/loadout_item/pocket_items/tape + name = "Spare Cassette Tape" + item_path = /obj/item/tape/random + +/datum/loadout_item/pocket_items/newspaper + name = "Newspaper" + item_path = /obj/item/newspaper + +/datum/loadout_item/pocket_items/clipboard + name = "Clipboard" + item_path = /obj/item/clipboard + +/datum/loadout_item/pocket_items/folder + name = "Folder" + item_path = /obj/item/folder + +/* +* UTILITY +*/ + +/datum/loadout_item/pocket_items/moth_mre + name = "Mothic Rations Pack" + item_path = /obj/item/storage/box/mothic_rations + +/datum/loadout_item/pocket_items/cloth_ten + name = "Ten Cloth Sheets" + item_path = /obj/item/stack/sheet/cloth/ten + +/datum/loadout_item/pocket_items/medkit + name = "First-Aid Kit" + item_path = /obj/item/storage/medkit/regular + +/datum/loadout_item/pocket_items/six_beer + name = "Beer Six-Pack" + item_path = /obj/item/storage/cans/sixbeer + +/datum/loadout_item/pocket_items/six_soda + name = "Soda Six-Pack" + item_path = /obj/item/storage/cans/sixsoda + +/datum/loadout_item/pocket_items/power_cell + name = "Standard Power Cell" + item_path = /obj/item/stock_parts/power_store/cell + +/datum/loadout_item/pocket_items/soap + name = "Bar of Soap" + item_path = /obj/item/soap + +/datum/loadout_item/pocket_items/mini_extinguisher + name = "Mini Fire Extinguisher" + item_path = /obj/item/extinguisher/mini + +/datum/loadout_item/pocket_items/binoculars + name = "Pair of Binoculars" + item_path = /obj/item/binoculars + +/datum/loadout_item/pocket_items/drugs_happy + name = "Happy Pills" + item_path = /obj/item/storage/pill_bottle/happy + +/datum/loadout_item/pocket_items/drugs_lsd + name = "Mindbreaker Pills" + item_path = /obj/item/storage/pill_bottle/lsd + +/datum/loadout_item/pocket_items/drugs_weed + name = "Cannabis Seeds" + item_path = /obj/item/seeds/cannabis + +/datum/loadout_item/pocket_items/drugs_reishi + name = "Reishi Seeds" + item_path = /obj/item/seeds/reishi + +/datum/loadout_item/pocket_items/drugs_liberty + name = "Liberty Cap Seeds" + item_path = /obj/item/seeds/liberty diff --git a/modular_doppler/Loadouts/loadout_helpers.dm b/modular_doppler/Loadouts/loadout_helpers.dm new file mode 100644 index 0000000000000..6e17d5e2290cf --- /dev/null +++ b/modular_doppler/Loadouts/loadout_helpers.dm @@ -0,0 +1,175 @@ +// -- The loadout item datum and related procs. -- + +/* + * Generate a list of singleton loadout_item datums from all subtypes of [type_to_generate] + * + * returns a list of singleton datums. + */ +/proc/generate_loadout_items(type_to_generate) + RETURN_TYPE(/list) + + . = list() + if(!ispath(type_to_generate)) + CRASH("generate_loadout_items(): called with an invalid or null path as an argument!") + + for(var/datum/loadout_item/found_type as anything in subtypesof(type_to_generate)) + /// Any item without a name is "abstract" + if(isnull(initial(found_type.name))) + continue + + if(!ispath(initial(found_type.item_path))) + stack_trace("generate_loadout_items(): Attempted to instantiate a loadout item ([initial(found_type.name)]) with an invalid or null typepath! (got path: [initial(found_type.item_path)])") + continue + + var/datum/loadout_item/spawned_type = new found_type() + // Let's sanitize in case somebody inserted the player's byond name instead of ckey in canonical form + if(spawned_type.ckeywhitelist) + for (var/i = 1, i <= length(spawned_type.ckeywhitelist), i++) + spawned_type.ckeywhitelist[i] = ckey(spawned_type.ckeywhitelist[i]) + GLOB.all_loadout_datums[spawned_type.item_path] = spawned_type + . |= spawned_type + + +/datum/loadout_item + /// If set, it's a list containing ckeys which only can get the item + var/list/ckeywhitelist + /// If set, is a list of job names of which can get the loadout item + var/list/restricted_roles + /// If set, is a list of job names of which can't get the loadout item + var/list/blacklisted_roles + /// If set, is a list of species which can get the loadout item + var/list/restricted_species + /// Whether the item is restricted to supporters + var/donator_only + /// Whether the item requires a specific season in order to be available + var/required_season = null + /// If the item won't appear when the ERP config is disabled + var/erp_item = FALSE + /// If the item goes into the special erp box + var/erp_box = FALSE + +/* + * Place our [var/item_path] into [outfit]. + * + * By default, just adds the item into the outfit's backpack contents, if non-visual. + * + * equipper - If we're equipping our outfit onto a mob at the time, this is the mob it is equipped on. Can be null. + * outfit - The outfit we're equipping our items into. + * visual - If TRUE, then our outfit is only for visual use (for example, a preview). + * override_items - The type of override to use. + */ +/datum/loadout_item/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE, override_items = LOADOUT_OVERRIDE_BACKPACK) + if(!visuals_only) + LAZYADD(outfit.backpack_contents, item_path) + +/* + * To be called before insert_path_into_outfit() + * + * Checks if an important_for_life item exists and puts the loadout item into the backpack if they would take up the same slot as it. + * + * equipper - If we're equipping our outfit onto a mob at the time, this is the mob it is equipped on. Can be null. + * outfit - The outfit we're equipping our items into. + * outfit_important_for_life - The outfit whose slots we want to make sure we don't equip an item into. + * visual - If TRUE, then our outfit is only for visual use (for example, a preview). + * + * Returns TRUE if there is an important_for_life item in the slot that the loadout item would normally occupy, FALSE otherwise + */ +/datum/loadout_item/proc/pre_equip_item(datum/outfit/outfit, datum/outfit/outfit_important_for_life, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(!visuals_only) + LAZYADD(outfit.backpack_contents, item_path) + +/* + * Called after the item is equipped on [equipper], at the end of character setup. + */ +/datum/loadout_item/proc/post_equip_item(datum/preferences/preference_source, mob/living/carbon/human/equipper) + return FALSE + +/** + * Called before a loadout item is given to a mob, making sure that they're + * elligible to receive it, based on all of that item's restrictions, if any. + * + * Returns `TRUE` if `target` is allowed to receive this item, `FALSE` if not. + */ +/datum/loadout_item/proc/can_be_applied_to(mob/living/target, datum/preferences/preference_source, datum/job/equipping_job, silent = FALSE) + var/client/client = preference_source.parent + if(restricted_roles && equipping_job && !(equipping_job.title in restricted_roles)) + if(client && !silent) + to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to job restrictions!")) + return FALSE + + if(blacklisted_roles && equipping_job && (equipping_job.title in blacklisted_roles)) + if(client && !silent) + to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to job blacklists!")) + return FALSE + + if(iscarbon(target)) + var/mob/living/carbon/carbon_target = target + var/datum/dna/dna = carbon_target.dna + if(!istype(dna) || (restricted_species && !(dna.species.id in restricted_species))) + if(client && !silent) + to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to species restrictions!")) + return FALSE + + if(LAZYLEN(ckeywhitelist) && !(client?.ckey in ckeywhitelist)) + if(client && !silent) + to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to not being apart of its CKEY whitelist!")) + return FALSE + + return TRUE + + +/datum/loadout_item/get_ui_buttons() + var/list/buttons = ..() + + if(can_be_named) + UNTYPED_LIST_ADD(buttons, list( + "label" = "Change description", + "act_key" = "set_description", + "button_icon" = FA_ICON_PEN, + "active_key" = INFO_DESCRIBED, + )) + + return buttons + +/datum/loadout_item/to_ui_data() + var/list/formatted_item = ..() + formatted_item["ckey_whitelist"] = ckeywhitelist + formatted_item["restricted_roles"] = restricted_roles + formatted_item["blacklisted_roles"] = blacklisted_roles + formatted_item["restricted_species"] = restricted_species + + + return formatted_item + + +/datum/loadout_item/handle_loadout_action(datum/preference_middleware/loadout/manager, mob/user, action, params) + if(action == "set_description" && can_be_named) + return set_description(manager, user) + + return ..() + + +/// Sets the description of the item. +/datum/loadout_item/proc/set_description(datum/preference_middleware/loadout/manager, mob/user) + var/list/loadout = manager.preferences.read_preference(/datum/preference/loadout) + var/input_desc = tgui_input_text( + user = user, + message = "What description do you want to give the [name]? Leave blank to clear.", + title = "[name] description", + default = loadout?[item_path]?[INFO_DESCRIBED], // plop in existing description (if any) + max_length = MAX_DESC_LEN, + ) + if(QDELETED(src) || QDELETED(user) || QDELETED(manager) || QDELETED(manager.preferences)) + return FALSE + + loadout = manager.preferences.read_preference(/datum/preference/loadout) // Make sure no shenanigans happened + if(!loadout?[item_path]) + return FALSE + + if(input_desc) + loadout[item_path][INFO_DESCRIBED] = input_desc + else if(input_desc == "") + loadout[item_path] -= INFO_DESCRIBED + + manager.preferences.update_preference(GLOB.preference_entries[/datum/preference/loadout], loadout) + return TRUE // just so that it updates the UI. Gonna change it later, upstream. diff --git a/tgstation.dme b/tgstation.dme index 367d2d3a1b727..a9c730a2c80a8 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -395,6 +395,7 @@ #include "code\__DEFINES\traits\declarations.dm" #include "code\__DEFINES\traits\macros.dm" #include "code\__DEFINES\traits\sources.dm" +#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_dreamluau.dm" #include "code\__HELPERS\_lists.dm" @@ -6365,6 +6366,7 @@ #include "modular_doppler\icspawn\observer_spawn.dm" #include "modular_doppler\icspawn\spell.dm" #include "modular_doppler\languages\language_datums.dm" +#include "modular_doppler\Loadouts\loadout_helpers.dm" #include "modular_doppler\Loadouts\categories\belts.dm" #include "modular_doppler\Loadouts\categories\ears.dm" #include "modular_doppler\Loadouts\categories\glasses.dm" @@ -6372,6 +6374,7 @@ #include "modular_doppler\Loadouts\categories\heads.dm" #include "modular_doppler\Loadouts\categories\inhands.dm" #include "modular_doppler\Loadouts\categories\masks.dm" +#include "modular_doppler\Loadouts\categories\pockets.dm" #include "modular_doppler\Loadouts\categories\shoes.dm" #include "modular_doppler\modular_cosmetics\code\jacket_pockets.dm" #include "modular_doppler\modular_cosmetics\code\neck\collar.dm" From 0a1569f4a3927a39e48e0d0761bb9d47054b3e87 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:17:29 -0500 Subject: [PATCH 07/17] Post_equip now works --- code/controllers/subsystem/ticker.dm | 9 ++++++ .../modules/mob/dead/new_player/new_player.dm | 9 ++++++ modular_doppler/Loadouts/READEME.md | 28 ++++++++++++++++++- modular_doppler/Loadouts/loadout_helpers.dm | 16 +---------- 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index ff76464bee56a..baca9a1235486 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -427,6 +427,15 @@ SUBSYSTEM_DEF(ticker) if(new_player_mob.client?.prefs?.should_be_random_hardcore(player_assigned_role, new_player_living.mind)) new_player_mob.client.prefs.hardcore_random_setup(new_player_living) SSquirks.AssignQuirks(new_player_living, new_player_mob.client) + + //DOPPLER EDIT ADDITION + if(ishuman(new_player_living)) + var/list/loadout = loadout_list_to_datums(new_player_mob.client?.prefs?.read_preference(/datum/preference/loadout)) + for(var/datum/loadout_item/item as anything in loadout) + if (item.restricted_roles && length(item.restricted_roles) && !(player_assigned_role.title in item.restricted_roles)) + continue + item.post_equip_item(new_player_mob.client?.prefs, new_player_living) + //DOPPLER EDIT END CHECK_TICK if(captainless) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 4db5ae888496c..fbece48ddab86 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -250,6 +250,15 @@ humanc.put_in_hands(new /obj/item/crowbar/large/emergency(get_turf(humanc))) //if hands full then just drops on the floor log_manifest(character.mind.key, character.mind, character, latejoin = TRUE) + //DOPPLER EDIT ADDITION + if(humanc) + var/list/loadout = loadout_list_to_datums(humanc.client?.prefs?.read_preference(/datum/preference/loadout)) + for(var/datum/loadout_item/item as anything in loadout) + if (item.restricted_roles && length(item.restricted_roles) && !(job.title in item.restricted_roles)) + continue + item.post_equip_item(humanc.client?.prefs, humanc) + //DOPPLER EDIT END + /mob/dead/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee) //TODO: figure out a way to exclude wizards/nukeops/demons from this. for(var/C in GLOB.employmentCabinets) diff --git a/modular_doppler/Loadouts/READEME.md b/modular_doppler/Loadouts/READEME.md index e6e6ab1ca1a9a..c82a1bd001a55 100644 --- a/modular_doppler/Loadouts/READEME.md +++ b/modular_doppler/Loadouts/READEME.md @@ -2,7 +2,7 @@ Most loadout categories are added in, if it is one that is stock TG just add in additional items in the respecitve files. -If you need to add more categories the following format should be followed: +If you need to add more categories or items the following format should be followed: ## Format @@ -21,3 +21,29 @@ If you need to add more categories the following format should be followed: LAZYADD(outfit.backpack_contents, outfit.glasses) // This will dictate if the item will go into the backpack if the slot is already occupied outfit.glasses = item_path ``` + +```DM + /datum/loadout_item/pocket_items/ + name = "" + item_path = + /* Here there could be additional vars specified current list of possible vars as follows: + restricted_roles // If the item is only allowed on specific roles I.E Security Items + blacklisted_roles // If the item cannot be given to specific roles I.E. Prisoner + restricted_species // If the item would cause issues with a species + required_season = null // If the item is a seasonal one and should only show up then + erp_item = FALSE // If the item is suggestive + erp_box = FALSE // If the item is suggestive and should be put in a box + /* +``` + +## Helper Functions + +### Post equip Item + +`/datum/loadout_item/proc/post_equip_item` +This proc particulalrly is useful if you wish for a specific item to do something after it gets equipped to the character. As an exapmple take the wallet, equip it on the ID card slot then just put the ID into the wallet so you dont have to put your own ID in your wallet. Useful for that sort of thing. + +### Pre equip Item + +`/datum/loadout_item/proc/pre_equip_item` +Useful for doing checks on a item before it gets equipped for whatever reason, most of the time check to see if the slot would affect someone who has a item there they need to survive, I.E. Plasmamen. diff --git a/modular_doppler/Loadouts/loadout_helpers.dm b/modular_doppler/Loadouts/loadout_helpers.dm index 6e17d5e2290cf..5231f468aaf4b 100644 --- a/modular_doppler/Loadouts/loadout_helpers.dm +++ b/modular_doppler/Loadouts/loadout_helpers.dm @@ -22,25 +22,17 @@ continue var/datum/loadout_item/spawned_type = new found_type() - // Let's sanitize in case somebody inserted the player's byond name instead of ckey in canonical form - if(spawned_type.ckeywhitelist) - for (var/i = 1, i <= length(spawned_type.ckeywhitelist), i++) - spawned_type.ckeywhitelist[i] = ckey(spawned_type.ckeywhitelist[i]) GLOB.all_loadout_datums[spawned_type.item_path] = spawned_type . |= spawned_type /datum/loadout_item - /// If set, it's a list containing ckeys which only can get the item - var/list/ckeywhitelist /// If set, is a list of job names of which can get the loadout item var/list/restricted_roles /// If set, is a list of job names of which can't get the loadout item var/list/blacklisted_roles /// If set, is a list of species which can get the loadout item var/list/restricted_species - /// Whether the item is restricted to supporters - var/donator_only /// Whether the item requires a specific season in order to be available var/required_season = null /// If the item won't appear when the ERP config is disabled @@ -110,11 +102,6 @@ to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to species restrictions!")) return FALSE - if(LAZYLEN(ckeywhitelist) && !(client?.ckey in ckeywhitelist)) - if(client && !silent) - to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to not being apart of its CKEY whitelist!")) - return FALSE - return TRUE @@ -133,7 +120,6 @@ /datum/loadout_item/to_ui_data() var/list/formatted_item = ..() - formatted_item["ckey_whitelist"] = ckeywhitelist formatted_item["restricted_roles"] = restricted_roles formatted_item["blacklisted_roles"] = blacklisted_roles formatted_item["restricted_species"] = restricted_species @@ -172,4 +158,4 @@ loadout[item_path] -= INFO_DESCRIBED manager.preferences.update_preference(GLOB.preference_entries[/datum/preference/loadout], loadout) - return TRUE // just so that it updates the UI. Gonna change it later, upstream. + return TRUE From 20986c49775b7083b89728b2404d86791dbe1f3e Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:12:37 -0500 Subject: [PATCH 08/17] More fixes --- modular_doppler/Loadouts/categories/gloves.dm | 2 +- modular_doppler/Loadouts/categories/shoes.dm | 35 +-- ...loadout_helpers.dm => loadout_checkers.dm} | 0 .../Loadouts/loadout_outfit_helpers.dm | 238 ++++++++++++++++++ tgstation.dme | 3 +- 5 files changed, 262 insertions(+), 16 deletions(-) rename modular_doppler/Loadouts/{loadout_helpers.dm => loadout_checkers.dm} (100%) create mode 100644 modular_doppler/Loadouts/loadout_outfit_helpers.dm diff --git a/modular_doppler/Loadouts/categories/gloves.dm b/modular_doppler/Loadouts/categories/gloves.dm index 0451180b348d5..d3842ef96f019 100644 --- a/modular_doppler/Loadouts/categories/gloves.dm +++ b/modular_doppler/Loadouts/categories/gloves.dm @@ -6,7 +6,7 @@ category_name = "Hands" category_ui_icon = FA_ICON_HAND type_to_generate = /datum/loadout_item/gloves - tab_order = /datum/loadout_category/ears::tab_order + 1 + tab_order = /datum/loadout_category/feet::tab_order + 1 /datum/loadout_item/gloves abstract_type = /datum/loadout_item/gloves diff --git a/modular_doppler/Loadouts/categories/shoes.dm b/modular_doppler/Loadouts/categories/shoes.dm index a5f2d6a14fd8f..7c8cdcb2d2753 100644 --- a/modular_doppler/Loadouts/categories/shoes.dm +++ b/modular_doppler/Loadouts/categories/shoes.dm @@ -2,7 +2,7 @@ category_name = "Feet" category_ui_icon = FA_ICON_SHOE_PRINTS type_to_generate = /datum/loadout_item/shoes - tab_order = /datum/loadout_category/glasses::tab_order + 1 + tab_order = /datum/loadout_category/head::tab_order + 1 /* * LOADOUT ITEM DATUMS FOR THE SHOE SLOT @@ -10,29 +10,36 @@ /datum/loadout_item/shoes abstract_type = /datum/loadout_item/shoes +/datum/loadout_item/shoes/pre_equip_item(datum/outfit/outfit, datum/outfit/outfit_important_for_life, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(initial(outfit_important_for_life.shoes)) + .. () + return TRUE -/datum/loadout_item/shoes/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) - if(outfit.shoes) - LAZYADD(outfit.backpack_contents, outfit.shoes) - outfit.shoes = item_path +/datum/loadout_item/shoes/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE, override_items = LOADOUT_OVERRIDE_BACKPACK) + if(override_items == LOADOUT_OVERRIDE_BACKPACK && !visuals_only) + if(outfit.shoes) + LAZYADD(outfit.backpack_contents, outfit.shoes) + outfit.shoes = item_path + else + outfit.shoes = item_path -/datum/loadout_item/shoes/jackboots - name = "Jackboots" - item_path = /obj/item/clothing/shoes/jackboots - -/datum/loadout_item/shoes/sneakers/white - name = "White Sneakers" - item_path = /obj/item/clothing/shoes/sneakers/white +/datum/loadout_item/shoes/sneakers + name = "Sneakers" + item_path = /obj/item/clothing/shoes/sneakers -/datum/loadout_item/shoes/sneakers/rainbow +/datum/loadout_item/shoes/sneakers_rainbow name = "Rainbow Sneakers" item_path = /obj/item/clothing/shoes/sneakers/rainbow +/datum/loadout_item/shoes/jackboots + name = "Jackboots" + item_path = /obj/item/clothing/shoes/jackboots + /datum/loadout_item/shoes/workboots name = "Work Boots" item_path = /obj/item/clothing/shoes/workboots -/datum/loadout_item/shoes/workboots/mining +/datum/loadout_item/shoes/workboots_mining name = "Mining Boots" item_path = /obj/item/clothing/shoes/workboots/mining diff --git a/modular_doppler/Loadouts/loadout_helpers.dm b/modular_doppler/Loadouts/loadout_checkers.dm similarity index 100% rename from modular_doppler/Loadouts/loadout_helpers.dm rename to modular_doppler/Loadouts/loadout_checkers.dm diff --git a/modular_doppler/Loadouts/loadout_outfit_helpers.dm b/modular_doppler/Loadouts/loadout_outfit_helpers.dm new file mode 100644 index 0000000000000..144f4c3e48154 --- /dev/null +++ b/modular_doppler/Loadouts/loadout_outfit_helpers.dm @@ -0,0 +1,238 @@ +/// -- Outfit and mob helpers to equip our loadout items. -- + +/// An empty outfit we fill in with our loadout items to dress our dummy. +/datum/outfit/player_loadout + name = "Player Loadout" + +/datum/outfit/player_loadout/equip(mob/living/carbon/human/user, visualsOnly) + . = ..() + user.equip_outfit_and_loadout(new /datum/outfit(), user.client.prefs) + +/* + * Actually equip our mob with our job outfit and our loadout items. + * Loadout items override the pre-existing item in the corresponding slot of the job outfit. + * Some job items are preserved after being overridden - belt items, ear items, and glasses. + * The rest of the slots, the items are overridden completely and deleted. + * + * Plasmamen are snowflaked to not have any envirosuit pieces removed just in case. + * Their loadout items for those slots will be added to their backpack on spawn. + * + * outfit - the job outfit we're equipping + * visuals_only - whether we call special equipped procs, or if we just look like we equipped it + * preference_source - the preferences of the thing we're equipping + * equipping_job - The job that's being applied. + */ +/mob/living/carbon/human/equip_outfit_and_loadout( + datum/outfit/outfit = /datum/outfit, + datum/preferences/preference_source = GLOB.preference_entries_by_key[ckey], + visuals_only = FALSE, + datum/job/equipping_job, +) + if (!preference_source) + equipOutfit(outfit, visuals_only) // no prefs for loadout items, but we should still equip the outfit. + return FALSE + + var/datum/outfit/equipped_outfit + + if(ispath(outfit)) + equipped_outfit = new outfit() + else if(istype(outfit)) + equipped_outfit = outfit + else + CRASH("Outfit passed to equip_outfit_and_loadout was neither a path nor an instantiated type!") + + var/override_preference = FALSE //preference_source.read_preference(/datum/preference/choiced/loadout_override_preference) Pref doesnt exist, keeping as a holdout + + var/list/loadout_list = preference_source?.read_preference(/datum/preference/loadout) + var/list/loadout_datums = loadout_list_to_datums(loadout_list) + var/obj/item/storage/briefcase/empty/briefcase + // var/obj/item/storage/box/erp/erpbox + // var/erp_enabled = !CONFIG_GET(flag/disable_erp_preferences) holdout things + if(override_preference == LOADOUT_OVERRIDE_CASE && !visuals_only) + briefcase = new(loc) + for(var/datum/loadout_item/item as anything in loadout_datums) + /*if (erp_enabled && item.erp_box == TRUE) + if (isnull(erpbox)) + erpbox = new(loc) + new item.item_path(erpbox)*/ + //else + if (!item.can_be_applied_to(src, preference_source, equipping_job)) + continue + new item.item_path(briefcase) + + briefcase.name = "[preference_source.read_preference(/datum/preference/name/real_name)]'s travel suitcase" + equipOutfit(equipped_outfit, visuals_only) + put_in_hands(briefcase) + else + for(var/datum/loadout_item/item as anything in loadout_datums) + /*if (erp_enabled && item.erp_box == TRUE) + if (isnull(erpbox)) + erpbox = new(loc) + new item.item_path(erpbox)*/ + //else + if (!item.can_be_applied_to(src, preference_source, equipping_job)) + continue + // Make sure the item is not overriding an important for life outfit item + var/datum/outfit/outfit_important_for_life = dna.species.outfit_important_for_life + if(!outfit_important_for_life || !item.pre_equip_item(equipped_outfit, outfit_important_for_life, src, visuals_only)) + item.insert_path_into_outfit(equipped_outfit, src, visuals_only, override_preference) + equipOutfit(equipped_outfit, visuals_only) + + var/list/new_contents = isnull(briefcase) ? get_all_gear() : briefcase.get_all_contents() + + for(var/datum/loadout_item/item as anything in loadout_datums) + if(item.restricted_roles && equipping_job && !(equipping_job.title in item.restricted_roles)) + continue + + var/obj/item/equipped = locate(item.item_path) in new_contents + /*if (!isnull(erpbox) && item.erp_box) + equipped = locate(item.item_path) in erpbox*/ + for(var/atom/equipped_item in new_contents) + if(equipped_item.type == item.item_path) + equipped = equipped_item + break + + if(isnull(equipped)) + continue + + item.on_equip_item( + equipped_item = equipped, + preference_source = preference_source, + preference_list = loadout_list, + equipper = src, + visuals_only = visuals_only, + ) + + /*if (!isnull(erpbox)) + if (!isnull(briefcase)) + briefcase.contents += erpbox + else + erpbox.equip_to_best_slot(src)*/ + + regenerate_icons() + return TRUE + +// cyborgs can wear hats from loadout +/* + * Actually equip our mob with our job outfit and our loadout items. + * Loadout items override the pre-existing item in the corresponding slot of the job outfit. + * Some job items are preserved after being overridden - belt items, ear items, and glasses. + * The rest of the slots, the items are overridden completely and deleted. + * + * Plasmamen are snowflaked to not have any envirosuit pieces removed just in case. + * Their loadout items for those slots will be added to their backpack on spawn. + * + * outfit - the job outfit we're equipping + * visuals_only - whether we call special equipped procs, or if we just look like we equipped it + * preference_source - the preferences of the thing we're equipping + * equipping_job - The job that's being applied. + */ +/mob/living/silicon/robot/proc/equip_outfit_and_loadout(datum/outfit/outfit, datum/preferences/preference_source = GLOB.preference_entries_by_key[ckey], visuals_only = FALSE, datum/job/equipping_job) + var/list/loadout_datums = loadout_list_to_datums(preference_source?.read_preference(/datum/preference/loadout)) + for (var/datum/loadout_item/head/item in loadout_datums) + if (!item.can_be_applied_to(src, preference_source, equipping_job)) + continue + place_on_head(new item.item_path) + break + + +/* + * Removes all invalid paths from loadout lists. + * + * passed_list - the loadout list we're sanitizing. + * + * returns a list + */ +/proc/update_loadout_list(list/passed_list) + RETURN_TYPE(/list) + + var/list/list_to_update = LAZYLISTDUPLICATE(passed_list) + for(var/thing in list_to_update) //thing, 'cause it could be a lot of things + if(ispath(thing)) + break + var/our_path = text2path(list_to_update[thing]) + + LAZYREMOVE(list_to_update, thing) + if(ispath(our_path)) + LAZYSET(list_to_update, our_path, list()) + + return list_to_update + +/* + * Removes all invalid paths from loadout lists. + * + * passed_list - the loadout list we're sanitizing. + * + * returns a list + */ +/proc/sanitize_loadout_list(list/passed_list) + RETURN_TYPE(/list) + + var/list/list_to_clean = LAZYLISTDUPLICATE(passed_list) + for(var/path in list_to_clean) + if(!ispath(path)) + stack_trace("invalid path found in loadout list! (Path: [path])") + LAZYREMOVE(list_to_clean, path) + + else if(!(path in GLOB.all_loadout_datums)) + stack_trace("invalid loadout slot found in loadout list! Path: [path]") + LAZYREMOVE(list_to_clean, path) + + return list_to_clean + +/obj/item/storage/briefcase/empty/PopulateContents() + return + +// Cyborg loadouts (currently used for hats) +/mob/living/silicon/robot/on_job_equipping(datum/job/equipping, client/player_client) + . = ..() + dress_up_as_job( + equipping = equipping, + visual_only = FALSE, + player_client = player_client, + consistent = FALSE, + ) + +// Cyborg loadouts (currently used for hats) +/mob/living/silicon/robot/dress_up_as_job(datum/job/equipping, visual_only = FALSE, client/player_client, consistent = FALSE) + . = ..() + equip_outfit_and_loadout(equipping.get_outfit(consistent), player_client?.prefs, visual_only, equipping) + +// originally made as a workaround the fact borgs lose their hats on module change, this +// is how borgs can pick up and drop hats + +// if a borg clicks a hat, they try to put it on +/obj/item/clothing/head/attack_robot_secondary(mob/living/silicon/robot/user, list/modifiers) + . = ..() + if (. != SECONDARY_ATTACK_CALL_NORMAL) + return + + if (!Adjacent(user)) + return + + balloon_alert(user, "picking up hat...") + if (!do_after(user, 3 SECONDS, src)) + return + if (QDELETED(src) || !Adjacent(user) || user.incapacitated()) + return + user.place_on_head(src) + balloon_alert(user, "picked up hat") + +// if a borg right clicks themself, they try to drop their hat +/mob/living/silicon/robot/attack_robot_secondary(mob/user, list/modifiers) + . = ..() + if (. != SECONDARY_ATTACK_CALL_NORMAL) + return + + if (user != src || isnull(hat)) + return + + balloon_alert(user, "dropping hat...") + if (!do_after(user, 3 SECONDS, src)) + return + if (QDELETED(src) || !Adjacent(user) || user.incapacitated() || isnull(hat)) + return + hat.forceMove(get_turf(src)) + hat = null + update_icons() + balloon_alert(user, "dropped hat") diff --git a/tgstation.dme b/tgstation.dme index a9c730a2c80a8..ed65e2b2a722d 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6366,7 +6366,8 @@ #include "modular_doppler\icspawn\observer_spawn.dm" #include "modular_doppler\icspawn\spell.dm" #include "modular_doppler\languages\language_datums.dm" -#include "modular_doppler\Loadouts\loadout_helpers.dm" +#include "modular_doppler\Loadouts\loadout_checkers.dm" +#include "modular_doppler\Loadouts\loadout_outfit_helpers.dm" #include "modular_doppler\Loadouts\categories\belts.dm" #include "modular_doppler\Loadouts\categories\ears.dm" #include "modular_doppler\Loadouts\categories\glasses.dm" From cee3abea2245e98d505e244aa4a55996f2c4d094 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:15:41 -0500 Subject: [PATCH 09/17] The rest of the loadouts --- code/modules/loadout/loadout_items.dm | 7 + .../Loadouts/categories/clothing.dm | 355 ++++++++++++++++++ modular_doppler/Loadouts/categories/erp.dm | 44 +++ .../Loadouts/categories/inhands.dm | 1 + .../Loadouts/categories/pockets.dm | 4 + .../Loadouts/categories/weapons.dm | 45 +++ modular_doppler/Loadouts/loadout_checkers.dm | 2 + .../Loadouts/loadout_outfit_helpers.dm | 4 + tgstation.dme | 3 + 9 files changed, 465 insertions(+) create mode 100644 modular_doppler/Loadouts/categories/clothing.dm create mode 100644 modular_doppler/Loadouts/categories/erp.dm create mode 100644 modular_doppler/Loadouts/categories/weapons.dm diff --git a/code/modules/loadout/loadout_items.dm b/code/modules/loadout/loadout_items.dm index 37a457f06c5ef..28cd6e7ea05ca 100644 --- a/code/modules/loadout/loadout_items.dm +++ b/code/modules/loadout/loadout_items.dm @@ -256,6 +256,13 @@ GLOBAL_LIST_INIT(all_loadout_categories, init_loadout_categories()) equipped_item.name = trim(item_details[INFO_NAMED], PREVENT_CHARACTER_TRIM_LOSS(MAX_NAME_LEN)) ADD_TRAIT(equipped_item, TRAIT_WAS_RENAMED, "Loadout") + // DOPPLER EDIT ADDITION START - Loadout item descriptions + if(can_be_named && item_details?[INFO_DESCRIBED] && !visuals_only) + equipped_item.desc = item_details[INFO_DESCRIBED] + ADD_TRAIT(equipped_item, TRAIT_WAS_RENAMED, "Loadout") + equipped_item.on_loadout_custom_described() + // DOPPLER EDIT ADDITION END + if(can_be_reskinned && item_details?[INFO_RESKIN]) var/skin_chosen = item_details[INFO_RESKIN] if(skin_chosen in equipped_item.unique_reskin) diff --git a/modular_doppler/Loadouts/categories/clothing.dm b/modular_doppler/Loadouts/categories/clothing.dm new file mode 100644 index 0000000000000..a0b9f22f3f0c0 --- /dev/null +++ b/modular_doppler/Loadouts/categories/clothing.dm @@ -0,0 +1,355 @@ +/datum/loadout_category/suit + category_name = "Suit" + category_ui_icon = FA_ICON_VEST + type_to_generate = /datum/loadout_item/suit + tab_order = /datum/loadout_category/neck::tab_order + 1 + +/* +* LOADOUT ITEM DATUMS FOR THE (EXO/OUTER)SUIT SLOT +*/ + +/datum/loadout_item/suit + abstract_type = /datum/loadout_item/suit + +/datum/loadout_item/suit/pre_equip_item(datum/outfit/outfit, datum/outfit/outfit_important_for_life, mob/living/carbon/human/equipper, visuals_only = FALSE) // don't bother storing in backpack, can't fit + if(initial(outfit_important_for_life.suit)) + return TRUE + +/datum/loadout_item/suit/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE, override_items = LOADOUT_OVERRIDE_BACKPACK) + if(override_items == LOADOUT_OVERRIDE_BACKPACK && !visuals_only) + if(outfit.suit) + LAZYADD(outfit.backpack_contents, outfit.suit) + outfit.suit = item_path + else + outfit.suit = item_path + +/* +* WINTER COATS +*/ + +/datum/loadout_item/suit/winter_coat + name = "Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat + +/datum/loadout_item/suit/winter_coat_greyscale + name = "Greyscale Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/custom + +/* +* SUITS / SUIT JACKETS +*/ + +/datum/loadout_item/suit/recolorable + name = "Recolorable Formal Suit Jacket" + item_path = /obj/item/clothing/suit/toggle/lawyer/greyscale + +/datum/loadout_item/suit/black_suit_jacket + name = "Black Formal Suit Jacket" + item_path = /obj/item/clothing/suit/toggle/lawyer/black + +/datum/loadout_item/suit/blue_suit_jacket + name = "Blue Formal Suit Jacket" + item_path = /obj/item/clothing/suit/toggle/lawyer + +/datum/loadout_item/suit/purple_suit_jacket + name = "Purple Formal Suit Jacket" + item_path = /obj/item/clothing/suit/toggle/lawyer/purple + +/* +* SUSPENDERS +*/ + +/datum/loadout_item/suit/suspenders + name = "Recolorable Suspenders" + item_path = /obj/item/clothing/suit/toggle/suspenders + +/* +* DRESSES +*/ + +/datum/loadout_item/suit/white_dress + name = "White Dress" + item_path = /obj/item/clothing/suit/costume/whitedress + +/* +* LABCOATS +*/ + +/datum/loadout_item/suit/labcoat + name = "Labcoat" + item_path = /obj/item/clothing/suit/toggle/labcoat + +/datum/loadout_item/suit/labcoat_green + name = "Green Labcoat" + item_path = /obj/item/clothing/suit/toggle/labcoat/mad + +/* +* PONCHOS +*/ + +/datum/loadout_item/suit/poncho + name = "Poncho" + item_path = /obj/item/clothing/suit/costume/poncho + +/datum/loadout_item/suit/poncho_green + name = "Green Poncho" + item_path = /obj/item/clothing/suit/costume/poncho/green + +/datum/loadout_item/suit/poncho_red + name = "Red Poncho" + item_path = /obj/item/clothing/suit/costume/poncho/red + +/* +* JACKETS +*/ + +/datum/loadout_item/suit/bomber_jacket + name = "Bomber Jacket" + item_path = /obj/item/clothing/suit/jacket/bomber + +/datum/loadout_item/suit/military_jacket + name = "Military Jacket" + item_path = /obj/item/clothing/suit/jacket/miljacket + +/datum/loadout_item/suit/puffer_jacket + name = "Puffer Jacket" + item_path = /obj/item/clothing/suit/jacket/puffer + +/datum/loadout_item/suit/puffer_vest + name = "Puffer Vest" + item_path = /obj/item/clothing/suit/jacket/puffer/vest + +/datum/loadout_item/suit/leather_jacket + name = "Leather Jacket" + item_path = /obj/item/clothing/suit/jacket/leather + +/datum/loadout_item/suit/leather_jacket/biker + name = "Biker Jacket" + item_path = /obj/item/clothing/suit/jacket/leather/biker + +/datum/loadout_item/suit/jacket_sweater + name = "Recolorable Sweater Jacket" + item_path = /obj/item/clothing/suit/toggle/jacket/sweater + +/datum/loadout_item/suit/jacket_oversized + name = "Recolorable Oversized Jacket" + item_path = /obj/item/clothing/suit/jacket/oversized + +/datum/loadout_item/suit/jacket_fancy + name = "Recolorable Fancy Fur Coat" + item_path = /obj/item/clothing/suit/jacket/fancy + +/datum/loadout_item/suit/ethereal_raincoat + name = "Ethereal Raincoat" + item_path = /obj/item/clothing/suit/hooded/ethereal_raincoat + +/* +* COSTUMES +*/ + +/datum/loadout_item/suit/owl + name = "Owl Cloak" + item_path = /obj/item/clothing/suit/toggle/owlwings + +/datum/loadout_item/suit/griffin + name = "Griffon Cloak" + item_path = /obj/item/clothing/suit/toggle/owlwings/griffinwings + +/datum/loadout_item/suit/syndi + name = "Black And Red Space Suit Replica" + item_path = /obj/item/clothing/suit/syndicatefake + +/datum/loadout_item/suit/bee + name = "Bee Outfit" + item_path = /obj/item/clothing/suit/hooded/bee_costume + +/datum/loadout_item/suit/plague_doctor + name = "Plague Doctor Suit" + item_path = /obj/item/clothing/suit/bio_suit/plaguedoctorsuit + +/datum/loadout_item/suit/snowman + name = "Snowman Outfit" + item_path = /obj/item/clothing/suit/costume/snowman + +/datum/loadout_item/suit/chicken + name = "Chicken Suit" + item_path = /obj/item/clothing/suit/costume/chickensuit + +/datum/loadout_item/suit/monkey + name = "Monkey Suit" + item_path = /obj/item/clothing/suit/costume/monkeysuit + +/datum/loadout_item/suit/cardborg + name = "Cardborg Suit" + item_path = /obj/item/clothing/suit/costume/cardborg + +/datum/loadout_item/suit/xenos + name = "Xenos Suit" + item_path = /obj/item/clothing/suit/costume/xenos + +/datum/loadout_item/suit/ian_costume + name = "Corgi Costume" + item_path = /obj/item/clothing/suit/hooded/ian_costume + +/datum/loadout_item/suit/carp_costume + name = "Carp Costume" + item_path = /obj/item/clothing/suit/hooded/carp_costume + +/datum/loadout_item/suit/shark_costume + name = "Shark Costume" + item_path = /obj/item/clothing/suit/hooded/shark_costume + +/datum/loadout_item/suit/shork_costume + name = "Shork Costume" + item_path = /obj/item/clothing/suit/hooded/shork_costume + +/datum/loadout_item/suit/wizard + name = "Wizard Robe" + item_path = /obj/item/clothing/suit/wizrobe/fake + +/datum/loadout_item/suit/witch + name = "Witch Robe" + item_path = /obj/item/clothing/suit/wizrobe/marisa/fake + +/* +* MISC +*/ + +/datum/loadout_item/suit/recolorable_overalls + name = "Recolorable Overalls" + item_path = /obj/item/clothing/suit/apron/overalls + +/* +* HAWAIIAN +*/ + +/datum/loadout_item/suit/hawaiian_shirt + name = "Hawaiian Shirt" + item_path = /obj/item/clothing/suit/costume/hawaiian + +/* +* MISC +*/ + +/datum/loadout_item/suit/frontierjacket + abstract_type = /datum/loadout_item/suit/frontierjacket + +/* +* HOODIES +*/ +/datum/loadout_item/suit/hoodie + abstract_type = /datum/loadout_item/suit/hoodie + +/* +* JOB-LOCKED +*/ + +// WINTER COATS +/datum/loadout_item/suit/coat_med + name = "Medical Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/medical + +/datum/loadout_item/suit/coat_paramedic + name = "Paramedic Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/medical/paramedic + +/datum/loadout_item/suit/coat_robotics + name = "Robotics Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/science/robotics + +/datum/loadout_item/suit/coat_sci + name = "Science Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/science + +/datum/loadout_item/suit/coat_eng + name = "Engineering Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/engineering + +/datum/loadout_item/suit/coat_atmos + name = "Atmospherics Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/engineering/atmos + +/datum/loadout_item/suit/coat_hydro + name = "Hydroponics Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/hydro + +/datum/loadout_item/suit/coat_cargo + name = "Cargo Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/cargo + +/datum/loadout_item/suit/coat_miner + name = "Mining Winter Coat" + item_path = /obj/item/clothing/suit/hooded/wintercoat/miner + +// JACKETS +/datum/loadout_item/suit/navybluejacketofficer + name = "Security Officer's Navy Blue Formal Jacket" + item_path = /obj/item/clothing/suit/jacket/officer/blue + restricted_roles = list(JOB_WARDEN, JOB_DETECTIVE, JOB_SECURITY_OFFICER, JOB_HEAD_OF_SECURITY) + +/datum/loadout_item/suit/navybluejacketwarden + name = "Warden's Navy Blue Formal Jacket" + item_path = /obj/item/clothing/suit/jacket/warden/blue + restricted_roles = list(JOB_WARDEN) + +/datum/loadout_item/suit/navybluejackethos + name = "Head of Security's Navy Blue Formal Jacket" + item_path = /obj/item/clothing/suit/jacket/hos/blue + restricted_roles = list(JOB_HEAD_OF_SECURITY) + +/datum/loadout_item/suit/qm_jacket + name = "Quartermaster's Overcoat" + item_path = /obj/item/clothing/suit/jacket/quartermaster + restricted_roles = list(JOB_QUARTERMASTER) + +/* +* FAMILIES +*/ + +/datum/loadout_item/suit/tmc + name = "TMC Coat" + item_path = /obj/item/clothing/suit/costume/tmc + +/datum/loadout_item/suit/pg + name = "PG Coat" + item_path = /obj/item/clothing/suit/costume/pg + +/datum/loadout_item/suit/deckers + name = "Deckers Hoodie" + item_path = /obj/item/clothing/suit/costume/deckers + +/datum/loadout_item/suit/soviet + name = "Soviet Coat" + item_path = /obj/item/clothing/suit/costume/soviet + +/datum/loadout_item/suit/yuri + name = "Yuri Coat" + item_path = /obj/item/clothing/suit/costume/yuri + +/* +* CHAPLAIN +*/ + +/datum/loadout_item/suit/chap_nun + name = "Nun's Habit" + item_path = /obj/item/clothing/suit/chaplainsuit/nun + +/datum/loadout_item/suit/chap_holiday + name = "Chaplain's Holiday Robe" + item_path = /obj/item/clothing/suit/chaplainsuit/holidaypriest + +/datum/loadout_item/suit/chap_brownmonk + name = "Monk's Brown Habit" + item_path = /obj/item/clothing/suit/hooded/chaplainsuit/monkhabit + +/datum/loadout_item/suit/chap_eastmonk + name = "Eastern Monk's Robe" + item_path = /obj/item/clothing/suit/chaplainsuit/monkrobeeast + +/datum/loadout_item/suit/chap_shrinehand + name = "Shrinehand Robe" + item_path = /obj/item/clothing/suit/chaplainsuit/shrinehand + +/datum/loadout_item/suit/chap_blackmonk + name = "Monk's Black Habit" + item_path = /obj/item/clothing/suit/chaplainsuit/habit diff --git a/modular_doppler/Loadouts/categories/erp.dm b/modular_doppler/Loadouts/categories/erp.dm new file mode 100644 index 0000000000000..cf3fed7887af0 --- /dev/null +++ b/modular_doppler/Loadouts/categories/erp.dm @@ -0,0 +1,44 @@ +/datum/loadout_category/erp + category_name = "Erotic" + category_ui_icon = FA_ICON_HEART + erp_category = TRUE + type_to_generate = /datum/loadout_item/erp + tab_order = /datum/loadout_category/pocket::tab_order + 1 + +/datum/loadout_category/erp/New() + . = ..() + category_info = "([MAX_ALLOWED_ERP_ITEMS] allowed)" + +/datum/loadout_category/erp/handle_duplicate_entires( + datum/preference_middleware/loadout/manager, + datum/loadout_item/conflicting_item, + datum/loadout_item/added_item, + list/datum/loadout_item/all_loadout_items, +) + var/list/datum/loadout_item/erp/other_items = list() + for(var/datum/loadout_item/erp/other_item in all_loadout_items) + other_items += other_item + + if(length(other_items) >= MAX_ALLOWED_ERP_ITEMS) + manager.deselect_item(other_items[1]) + return TRUE + +/datum/loadout_item/erp/pre_equip_item(datum/outfit/outfit, datum/outfit/outfit_important_for_life, mob/living/carbon/human/equipper, visuals_only = FALSE) + return FALSE + +/datum/loadout_item/erp + abstract_type = /datum/loadout_item/erp + erp_item = TRUE + erp_box = TRUE + +/* +* SEX TOYS +*/ + +/datum/loadout_item/erp/banana + name = "Banana" + item_path = /obj/item/food/grown/banana + +/datum/loadout_item/erp/pickle + name = "Pickle" + item_path = /obj/item/food/pickle diff --git a/modular_doppler/Loadouts/categories/inhands.dm b/modular_doppler/Loadouts/categories/inhands.dm index 802e9d53514b4..61478e1754c7f 100644 --- a/modular_doppler/Loadouts/categories/inhands.dm +++ b/modular_doppler/Loadouts/categories/inhands.dm @@ -1,3 +1,4 @@ + /datum/loadout_item/inhand/cane/crutch name = "Crutch" item_path = /obj/item/cane/crutch diff --git a/modular_doppler/Loadouts/categories/pockets.dm b/modular_doppler/Loadouts/categories/pockets.dm index b9cfda99c470a..1f97a7f0ad622 100644 --- a/modular_doppler/Loadouts/categories/pockets.dm +++ b/modular_doppler/Loadouts/categories/pockets.dm @@ -1,3 +1,7 @@ +// Because plushes have a second desc var that needs to be updated +/obj/item/toy/plush/on_loadout_custom_described() + normal_desc = desc + // The wallet loadout item is special, and puts the player's ID and other small items into it on initialize (fancy!) /datum/loadout_item/pocket_items/wallet name = "Wallet" diff --git a/modular_doppler/Loadouts/categories/weapons.dm b/modular_doppler/Loadouts/categories/weapons.dm new file mode 100644 index 0000000000000..923dc94ca099c --- /dev/null +++ b/modular_doppler/Loadouts/categories/weapons.dm @@ -0,0 +1,45 @@ +/// Inhand items (Moves overrided items to backpack) +/datum/loadout_category/weapons + category_name = "Weapons" + category_ui_icon = FA_ICON_GUN + type_to_generate = /datum/loadout_item/weapon + tab_order = /datum/loadout_category/inhands::tab_order + 1 + +/datum/loadout_item/weapon + abstract_type = /datum/loadout_item/weapon + +/datum/loadout_item/weapon/insert_path_into_outfit(datum/outfit/outfit, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(outfit.l_hand && !outfit.r_hand) + outfit.r_hand = item_path + else + if(outfit.l_hand) + LAZYADD(outfit.backpack_contents, outfit.l_hand) + outfit.l_hand = item_path + +/datum/loadout_item/weapon/toy_sword + name = "Toy Sword" + item_path = /obj/item/toy/sword + +/datum/loadout_item/weapon/toy_gun + name = "Toy Gun" + item_path = /obj/item/toy/gun + +/datum/loadout_item/weapon/toy_laser_red + name = "Red Toy Laser" + item_path = /obj/item/gun/energy/laser/redtag + +/datum/loadout_item/weapon/toy_laser_blue + name = "Blue Toy Laser" + item_path = /obj/item/gun/energy/laser/bluetag + +/datum/loadout_item/weapon/donk_pistol + name = "Donk Pistol" + item_path = /obj/item/gun/ballistic/automatic/pistol/toy + +/datum/loadout_item/weapon/donk_shotgun + name = "Donk Shotgun" + item_path = /obj/item/gun/ballistic/shotgun/toy/unrestricted + +/datum/loadout_item/weapon/donk_rifle + name = "Donk Rifle" + item_path = /obj/item/gun/ballistic/automatic/toy/unrestricted diff --git a/modular_doppler/Loadouts/loadout_checkers.dm b/modular_doppler/Loadouts/loadout_checkers.dm index 5231f468aaf4b..4b6983f5110bd 100644 --- a/modular_doppler/Loadouts/loadout_checkers.dm +++ b/modular_doppler/Loadouts/loadout_checkers.dm @@ -25,6 +25,8 @@ GLOB.all_loadout_datums[spawned_type.item_path] = spawned_type . |= spawned_type +/datum/loadout_category + var/erp_category = FALSE /datum/loadout_item /// If set, is a list of job names of which can get the loadout item diff --git a/modular_doppler/Loadouts/loadout_outfit_helpers.dm b/modular_doppler/Loadouts/loadout_outfit_helpers.dm index 144f4c3e48154..80cb471c6e86b 100644 --- a/modular_doppler/Loadouts/loadout_outfit_helpers.dm +++ b/modular_doppler/Loadouts/loadout_outfit_helpers.dm @@ -1,5 +1,9 @@ /// -- Outfit and mob helpers to equip our loadout items. -- +/// Called after a loadout item gets a custom description +/atom/proc/on_loadout_custom_described() + return + /// An empty outfit we fill in with our loadout items to dress our dummy. /datum/outfit/player_loadout name = "Player Loadout" diff --git a/tgstation.dme b/tgstation.dme index ed65e2b2a722d..e0c467d15a0ba 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6369,7 +6369,9 @@ #include "modular_doppler\Loadouts\loadout_checkers.dm" #include "modular_doppler\Loadouts\loadout_outfit_helpers.dm" #include "modular_doppler\Loadouts\categories\belts.dm" +#include "modular_doppler\Loadouts\categories\clothing.dm" #include "modular_doppler\Loadouts\categories\ears.dm" +#include "modular_doppler\Loadouts\categories\erp.dm" #include "modular_doppler\Loadouts\categories\glasses.dm" #include "modular_doppler\Loadouts\categories\gloves.dm" #include "modular_doppler\Loadouts\categories\heads.dm" @@ -6377,6 +6379,7 @@ #include "modular_doppler\Loadouts\categories\masks.dm" #include "modular_doppler\Loadouts\categories\pockets.dm" #include "modular_doppler\Loadouts\categories\shoes.dm" +#include "modular_doppler\Loadouts\categories\weapons.dm" #include "modular_doppler\modular_cosmetics\code\jacket_pockets.dm" #include "modular_doppler\modular_cosmetics\code\neck\collar.dm" #include "modular_doppler\modular_cosmetics\code\suits\jacket.dm" From 1d30317a86b68e999bd33818d517f68e99b7a7b3 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:08:37 -0500 Subject: [PATCH 10/17] does THIS fix it? --- modular_doppler/{Loadouts => loadout_categories}/READEME.md | 0 .../{Loadouts => loadout_categories}/categories/belts.dm | 0 .../{Loadouts => loadout_categories}/categories/clothing.dm | 0 .../{Loadouts => loadout_categories}/categories/ears.dm | 0 .../{Loadouts => loadout_categories}/categories/erp.dm | 0 .../{Loadouts => loadout_categories}/categories/glasses.dm | 0 .../{Loadouts => loadout_categories}/categories/gloves.dm | 0 .../{Loadouts => loadout_categories}/categories/heads.dm | 0 .../{Loadouts => loadout_categories}/categories/inhands.dm | 0 .../{Loadouts => loadout_categories}/categories/masks.dm | 0 .../{Loadouts => loadout_categories}/categories/pockets.dm | 0 .../{Loadouts => loadout_categories}/categories/shoes.dm | 0 .../{Loadouts => loadout_categories}/categories/weapons.dm | 0 .../{Loadouts => loadout_categories}/loadout_checkers.dm | 0 .../{Loadouts => loadout_categories}/loadout_outfit_helpers.dm | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename modular_doppler/{Loadouts => loadout_categories}/READEME.md (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/belts.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/clothing.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/ears.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/erp.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/glasses.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/gloves.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/heads.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/inhands.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/masks.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/pockets.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/shoes.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/categories/weapons.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/loadout_checkers.dm (100%) rename modular_doppler/{Loadouts => loadout_categories}/loadout_outfit_helpers.dm (100%) diff --git a/modular_doppler/Loadouts/READEME.md b/modular_doppler/loadout_categories/READEME.md similarity index 100% rename from modular_doppler/Loadouts/READEME.md rename to modular_doppler/loadout_categories/READEME.md diff --git a/modular_doppler/Loadouts/categories/belts.dm b/modular_doppler/loadout_categories/categories/belts.dm similarity index 100% rename from modular_doppler/Loadouts/categories/belts.dm rename to modular_doppler/loadout_categories/categories/belts.dm diff --git a/modular_doppler/Loadouts/categories/clothing.dm b/modular_doppler/loadout_categories/categories/clothing.dm similarity index 100% rename from modular_doppler/Loadouts/categories/clothing.dm rename to modular_doppler/loadout_categories/categories/clothing.dm diff --git a/modular_doppler/Loadouts/categories/ears.dm b/modular_doppler/loadout_categories/categories/ears.dm similarity index 100% rename from modular_doppler/Loadouts/categories/ears.dm rename to modular_doppler/loadout_categories/categories/ears.dm diff --git a/modular_doppler/Loadouts/categories/erp.dm b/modular_doppler/loadout_categories/categories/erp.dm similarity index 100% rename from modular_doppler/Loadouts/categories/erp.dm rename to modular_doppler/loadout_categories/categories/erp.dm diff --git a/modular_doppler/Loadouts/categories/glasses.dm b/modular_doppler/loadout_categories/categories/glasses.dm similarity index 100% rename from modular_doppler/Loadouts/categories/glasses.dm rename to modular_doppler/loadout_categories/categories/glasses.dm diff --git a/modular_doppler/Loadouts/categories/gloves.dm b/modular_doppler/loadout_categories/categories/gloves.dm similarity index 100% rename from modular_doppler/Loadouts/categories/gloves.dm rename to modular_doppler/loadout_categories/categories/gloves.dm diff --git a/modular_doppler/Loadouts/categories/heads.dm b/modular_doppler/loadout_categories/categories/heads.dm similarity index 100% rename from modular_doppler/Loadouts/categories/heads.dm rename to modular_doppler/loadout_categories/categories/heads.dm diff --git a/modular_doppler/Loadouts/categories/inhands.dm b/modular_doppler/loadout_categories/categories/inhands.dm similarity index 100% rename from modular_doppler/Loadouts/categories/inhands.dm rename to modular_doppler/loadout_categories/categories/inhands.dm diff --git a/modular_doppler/Loadouts/categories/masks.dm b/modular_doppler/loadout_categories/categories/masks.dm similarity index 100% rename from modular_doppler/Loadouts/categories/masks.dm rename to modular_doppler/loadout_categories/categories/masks.dm diff --git a/modular_doppler/Loadouts/categories/pockets.dm b/modular_doppler/loadout_categories/categories/pockets.dm similarity index 100% rename from modular_doppler/Loadouts/categories/pockets.dm rename to modular_doppler/loadout_categories/categories/pockets.dm diff --git a/modular_doppler/Loadouts/categories/shoes.dm b/modular_doppler/loadout_categories/categories/shoes.dm similarity index 100% rename from modular_doppler/Loadouts/categories/shoes.dm rename to modular_doppler/loadout_categories/categories/shoes.dm diff --git a/modular_doppler/Loadouts/categories/weapons.dm b/modular_doppler/loadout_categories/categories/weapons.dm similarity index 100% rename from modular_doppler/Loadouts/categories/weapons.dm rename to modular_doppler/loadout_categories/categories/weapons.dm diff --git a/modular_doppler/Loadouts/loadout_checkers.dm b/modular_doppler/loadout_categories/loadout_checkers.dm similarity index 100% rename from modular_doppler/Loadouts/loadout_checkers.dm rename to modular_doppler/loadout_categories/loadout_checkers.dm diff --git a/modular_doppler/Loadouts/loadout_outfit_helpers.dm b/modular_doppler/loadout_categories/loadout_outfit_helpers.dm similarity index 100% rename from modular_doppler/Loadouts/loadout_outfit_helpers.dm rename to modular_doppler/loadout_categories/loadout_outfit_helpers.dm From 2dab75ab5bf4dad7aab707471dc335b0e72e40bd Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:12:44 -0500 Subject: [PATCH 11/17] Ticking --- tgstation.dme | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tgstation.dme b/tgstation.dme index e0c467d15a0ba..b9f365a8fb750 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6366,20 +6366,20 @@ #include "modular_doppler\icspawn\observer_spawn.dm" #include "modular_doppler\icspawn\spell.dm" #include "modular_doppler\languages\language_datums.dm" -#include "modular_doppler\Loadouts\loadout_checkers.dm" -#include "modular_doppler\Loadouts\loadout_outfit_helpers.dm" -#include "modular_doppler\Loadouts\categories\belts.dm" -#include "modular_doppler\Loadouts\categories\clothing.dm" -#include "modular_doppler\Loadouts\categories\ears.dm" -#include "modular_doppler\Loadouts\categories\erp.dm" -#include "modular_doppler\Loadouts\categories\glasses.dm" -#include "modular_doppler\Loadouts\categories\gloves.dm" -#include "modular_doppler\Loadouts\categories\heads.dm" -#include "modular_doppler\Loadouts\categories\inhands.dm" -#include "modular_doppler\Loadouts\categories\masks.dm" -#include "modular_doppler\Loadouts\categories\pockets.dm" -#include "modular_doppler\Loadouts\categories\shoes.dm" -#include "modular_doppler\Loadouts\categories\weapons.dm" +#include "modular_doppler\loadout_categories\loadout_checkers.dm" +#include "modular_doppler\loadout_categories\loadout_outfit_helpers.dm" +#include "modular_doppler\loadout_categories\categories\belts.dm" +#include "modular_doppler\loadout_categories\categories\clothing.dm" +#include "modular_doppler\loadout_categories\categories\ears.dm" +#include "modular_doppler\loadout_categories\categories\erp.dm" +#include "modular_doppler\loadout_categories\categories\glasses.dm" +#include "modular_doppler\loadout_categories\categories\gloves.dm" +#include "modular_doppler\loadout_categories\categories\heads.dm" +#include "modular_doppler\loadout_categories\categories\inhands.dm" +#include "modular_doppler\loadout_categories\categories\masks.dm" +#include "modular_doppler\loadout_categories\categories\pockets.dm" +#include "modular_doppler\loadout_categories\categories\shoes.dm" +#include "modular_doppler\loadout_categories\categories\weapons.dm" #include "modular_doppler\modular_cosmetics\code\jacket_pockets.dm" #include "modular_doppler\modular_cosmetics\code\neck\collar.dm" #include "modular_doppler\modular_cosmetics\code\suits\jacket.dm" From aff8d20bab16e2fa87701b65ccecf54826173c47 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:20:45 -0500 Subject: [PATCH 12/17] I fixed your mother --- .../loadout_categories/loadout_checkers.dm | 7 + .../loadout_outfit_helpers.dm | 242 ------------------ tgstation.dme | 1 - 3 files changed, 7 insertions(+), 243 deletions(-) delete mode 100644 modular_doppler/loadout_categories/loadout_outfit_helpers.dm diff --git a/modular_doppler/loadout_categories/loadout_checkers.dm b/modular_doppler/loadout_categories/loadout_checkers.dm index 4b6983f5110bd..d0cedb5e4e3a3 100644 --- a/modular_doppler/loadout_categories/loadout_checkers.dm +++ b/modular_doppler/loadout_categories/loadout_checkers.dm @@ -1,5 +1,9 @@ // -- The loadout item datum and related procs. -- +/// Called after a loadout item gets a custom description +/atom/proc/on_loadout_custom_described() + return + /* * Generate a list of singleton loadout_item datums from all subtypes of [type_to_generate] * @@ -69,6 +73,9 @@ * Returns TRUE if there is an important_for_life item in the slot that the loadout item would normally occupy, FALSE otherwise */ /datum/loadout_item/proc/pre_equip_item(datum/outfit/outfit, datum/outfit/outfit_important_for_life, mob/living/carbon/human/equipper, visuals_only = FALSE) + outfit_important_for_life = equipper.dna.species.outfit_important_for_life + if(!outfit_important_for_life || !pre_equip_item(outfit, outfit_important_for_life, src, visuals_only)) + insert_path_into_outfit(outfit, src, visuals_only) if(!visuals_only) LAZYADD(outfit.backpack_contents, item_path) diff --git a/modular_doppler/loadout_categories/loadout_outfit_helpers.dm b/modular_doppler/loadout_categories/loadout_outfit_helpers.dm deleted file mode 100644 index 80cb471c6e86b..0000000000000 --- a/modular_doppler/loadout_categories/loadout_outfit_helpers.dm +++ /dev/null @@ -1,242 +0,0 @@ -/// -- Outfit and mob helpers to equip our loadout items. -- - -/// Called after a loadout item gets a custom description -/atom/proc/on_loadout_custom_described() - return - -/// An empty outfit we fill in with our loadout items to dress our dummy. -/datum/outfit/player_loadout - name = "Player Loadout" - -/datum/outfit/player_loadout/equip(mob/living/carbon/human/user, visualsOnly) - . = ..() - user.equip_outfit_and_loadout(new /datum/outfit(), user.client.prefs) - -/* - * Actually equip our mob with our job outfit and our loadout items. - * Loadout items override the pre-existing item in the corresponding slot of the job outfit. - * Some job items are preserved after being overridden - belt items, ear items, and glasses. - * The rest of the slots, the items are overridden completely and deleted. - * - * Plasmamen are snowflaked to not have any envirosuit pieces removed just in case. - * Their loadout items for those slots will be added to their backpack on spawn. - * - * outfit - the job outfit we're equipping - * visuals_only - whether we call special equipped procs, or if we just look like we equipped it - * preference_source - the preferences of the thing we're equipping - * equipping_job - The job that's being applied. - */ -/mob/living/carbon/human/equip_outfit_and_loadout( - datum/outfit/outfit = /datum/outfit, - datum/preferences/preference_source = GLOB.preference_entries_by_key[ckey], - visuals_only = FALSE, - datum/job/equipping_job, -) - if (!preference_source) - equipOutfit(outfit, visuals_only) // no prefs for loadout items, but we should still equip the outfit. - return FALSE - - var/datum/outfit/equipped_outfit - - if(ispath(outfit)) - equipped_outfit = new outfit() - else if(istype(outfit)) - equipped_outfit = outfit - else - CRASH("Outfit passed to equip_outfit_and_loadout was neither a path nor an instantiated type!") - - var/override_preference = FALSE //preference_source.read_preference(/datum/preference/choiced/loadout_override_preference) Pref doesnt exist, keeping as a holdout - - var/list/loadout_list = preference_source?.read_preference(/datum/preference/loadout) - var/list/loadout_datums = loadout_list_to_datums(loadout_list) - var/obj/item/storage/briefcase/empty/briefcase - // var/obj/item/storage/box/erp/erpbox - // var/erp_enabled = !CONFIG_GET(flag/disable_erp_preferences) holdout things - if(override_preference == LOADOUT_OVERRIDE_CASE && !visuals_only) - briefcase = new(loc) - for(var/datum/loadout_item/item as anything in loadout_datums) - /*if (erp_enabled && item.erp_box == TRUE) - if (isnull(erpbox)) - erpbox = new(loc) - new item.item_path(erpbox)*/ - //else - if (!item.can_be_applied_to(src, preference_source, equipping_job)) - continue - new item.item_path(briefcase) - - briefcase.name = "[preference_source.read_preference(/datum/preference/name/real_name)]'s travel suitcase" - equipOutfit(equipped_outfit, visuals_only) - put_in_hands(briefcase) - else - for(var/datum/loadout_item/item as anything in loadout_datums) - /*if (erp_enabled && item.erp_box == TRUE) - if (isnull(erpbox)) - erpbox = new(loc) - new item.item_path(erpbox)*/ - //else - if (!item.can_be_applied_to(src, preference_source, equipping_job)) - continue - // Make sure the item is not overriding an important for life outfit item - var/datum/outfit/outfit_important_for_life = dna.species.outfit_important_for_life - if(!outfit_important_for_life || !item.pre_equip_item(equipped_outfit, outfit_important_for_life, src, visuals_only)) - item.insert_path_into_outfit(equipped_outfit, src, visuals_only, override_preference) - equipOutfit(equipped_outfit, visuals_only) - - var/list/new_contents = isnull(briefcase) ? get_all_gear() : briefcase.get_all_contents() - - for(var/datum/loadout_item/item as anything in loadout_datums) - if(item.restricted_roles && equipping_job && !(equipping_job.title in item.restricted_roles)) - continue - - var/obj/item/equipped = locate(item.item_path) in new_contents - /*if (!isnull(erpbox) && item.erp_box) - equipped = locate(item.item_path) in erpbox*/ - for(var/atom/equipped_item in new_contents) - if(equipped_item.type == item.item_path) - equipped = equipped_item - break - - if(isnull(equipped)) - continue - - item.on_equip_item( - equipped_item = equipped, - preference_source = preference_source, - preference_list = loadout_list, - equipper = src, - visuals_only = visuals_only, - ) - - /*if (!isnull(erpbox)) - if (!isnull(briefcase)) - briefcase.contents += erpbox - else - erpbox.equip_to_best_slot(src)*/ - - regenerate_icons() - return TRUE - -// cyborgs can wear hats from loadout -/* - * Actually equip our mob with our job outfit and our loadout items. - * Loadout items override the pre-existing item in the corresponding slot of the job outfit. - * Some job items are preserved after being overridden - belt items, ear items, and glasses. - * The rest of the slots, the items are overridden completely and deleted. - * - * Plasmamen are snowflaked to not have any envirosuit pieces removed just in case. - * Their loadout items for those slots will be added to their backpack on spawn. - * - * outfit - the job outfit we're equipping - * visuals_only - whether we call special equipped procs, or if we just look like we equipped it - * preference_source - the preferences of the thing we're equipping - * equipping_job - The job that's being applied. - */ -/mob/living/silicon/robot/proc/equip_outfit_and_loadout(datum/outfit/outfit, datum/preferences/preference_source = GLOB.preference_entries_by_key[ckey], visuals_only = FALSE, datum/job/equipping_job) - var/list/loadout_datums = loadout_list_to_datums(preference_source?.read_preference(/datum/preference/loadout)) - for (var/datum/loadout_item/head/item in loadout_datums) - if (!item.can_be_applied_to(src, preference_source, equipping_job)) - continue - place_on_head(new item.item_path) - break - - -/* - * Removes all invalid paths from loadout lists. - * - * passed_list - the loadout list we're sanitizing. - * - * returns a list - */ -/proc/update_loadout_list(list/passed_list) - RETURN_TYPE(/list) - - var/list/list_to_update = LAZYLISTDUPLICATE(passed_list) - for(var/thing in list_to_update) //thing, 'cause it could be a lot of things - if(ispath(thing)) - break - var/our_path = text2path(list_to_update[thing]) - - LAZYREMOVE(list_to_update, thing) - if(ispath(our_path)) - LAZYSET(list_to_update, our_path, list()) - - return list_to_update - -/* - * Removes all invalid paths from loadout lists. - * - * passed_list - the loadout list we're sanitizing. - * - * returns a list - */ -/proc/sanitize_loadout_list(list/passed_list) - RETURN_TYPE(/list) - - var/list/list_to_clean = LAZYLISTDUPLICATE(passed_list) - for(var/path in list_to_clean) - if(!ispath(path)) - stack_trace("invalid path found in loadout list! (Path: [path])") - LAZYREMOVE(list_to_clean, path) - - else if(!(path in GLOB.all_loadout_datums)) - stack_trace("invalid loadout slot found in loadout list! Path: [path]") - LAZYREMOVE(list_to_clean, path) - - return list_to_clean - -/obj/item/storage/briefcase/empty/PopulateContents() - return - -// Cyborg loadouts (currently used for hats) -/mob/living/silicon/robot/on_job_equipping(datum/job/equipping, client/player_client) - . = ..() - dress_up_as_job( - equipping = equipping, - visual_only = FALSE, - player_client = player_client, - consistent = FALSE, - ) - -// Cyborg loadouts (currently used for hats) -/mob/living/silicon/robot/dress_up_as_job(datum/job/equipping, visual_only = FALSE, client/player_client, consistent = FALSE) - . = ..() - equip_outfit_and_loadout(equipping.get_outfit(consistent), player_client?.prefs, visual_only, equipping) - -// originally made as a workaround the fact borgs lose their hats on module change, this -// is how borgs can pick up and drop hats - -// if a borg clicks a hat, they try to put it on -/obj/item/clothing/head/attack_robot_secondary(mob/living/silicon/robot/user, list/modifiers) - . = ..() - if (. != SECONDARY_ATTACK_CALL_NORMAL) - return - - if (!Adjacent(user)) - return - - balloon_alert(user, "picking up hat...") - if (!do_after(user, 3 SECONDS, src)) - return - if (QDELETED(src) || !Adjacent(user) || user.incapacitated()) - return - user.place_on_head(src) - balloon_alert(user, "picked up hat") - -// if a borg right clicks themself, they try to drop their hat -/mob/living/silicon/robot/attack_robot_secondary(mob/user, list/modifiers) - . = ..() - if (. != SECONDARY_ATTACK_CALL_NORMAL) - return - - if (user != src || isnull(hat)) - return - - balloon_alert(user, "dropping hat...") - if (!do_after(user, 3 SECONDS, src)) - return - if (QDELETED(src) || !Adjacent(user) || user.incapacitated() || isnull(hat)) - return - hat.forceMove(get_turf(src)) - hat = null - update_icons() - balloon_alert(user, "dropped hat") diff --git a/tgstation.dme b/tgstation.dme index b9f365a8fb750..cfe3cc302c660 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6367,7 +6367,6 @@ #include "modular_doppler\icspawn\spell.dm" #include "modular_doppler\languages\language_datums.dm" #include "modular_doppler\loadout_categories\loadout_checkers.dm" -#include "modular_doppler\loadout_categories\loadout_outfit_helpers.dm" #include "modular_doppler\loadout_categories\categories\belts.dm" #include "modular_doppler\loadout_categories\categories\clothing.dm" #include "modular_doppler\loadout_categories\categories\ears.dm" From b1c898411e372e390f2e4bc13fee2b3a08f6c290 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:26:05 -0500 Subject: [PATCH 13/17] Clean up and use defines --- code/__DEFINES/~doppler_defines/loadout.dm | 16 ---------------- code/modules/loadout/categories/pocket.dm | 2 +- .../loadout_categories/categories/erp.dm | 1 + .../loadout_categories/categories/masks.dm | 5 +++++ .../loadout_categories/categories/pockets.dm | 3 +++ 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/code/__DEFINES/~doppler_defines/loadout.dm b/code/__DEFINES/~doppler_defines/loadout.dm index 30882b45b9d63..c018313eac038 100644 --- a/code/__DEFINES/~doppler_defines/loadout.dm +++ b/code/__DEFINES/~doppler_defines/loadout.dm @@ -1,19 +1,3 @@ -/// Defines for what loadout slot a corresponding item belongs to. -#define LOADOUT_ITEM_BELT "belt" -#define LOADOUT_ITEM_EARS "ears" -#define LOADOUT_ITEM_GLASSES "glasses" -#define LOADOUT_ITEM_GLOVES "gloves" -#define LOADOUT_ITEM_HEAD "head" -#define LOADOUT_ITEM_MASK "mask" -#define LOADOUT_ITEM_NECK "neck" -#define LOADOUT_ITEM_SHOES "shoes" -#define LOADOUT_ITEM_SUIT "suit" -#define LOADOUT_ITEM_UNIFORM "under" -#define LOADOUT_ITEM_ACCESSORY "accessory" -#define LOADOUT_ITEM_INHAND "inhand_items" -#define LOADOUT_ITEM_MISC "pocket_items" -#define LOADOUT_ITEM_TOYS "toys" - /// Used to set custom descriptions. #define INFO_DESCRIBED "description" diff --git a/code/modules/loadout/categories/pocket.dm b/code/modules/loadout/categories/pocket.dm index fd3f11e112b27..4ae0ade2157ce 100644 --- a/code/modules/loadout/categories/pocket.dm +++ b/code/modules/loadout/categories/pocket.dm @@ -5,7 +5,7 @@ type_to_generate = /datum/loadout_item/pocket_items tab_order = /datum/loadout_category/head::tab_order + 5 /// How many pocket items are allowed - VAR_PRIVATE/max_allowed = 2 + var/max_allowed = 2 // DOPPLER EDIT CAHANGE - ORIGINAL: VAR_PRIVATE/max_allowed = 2 /datum/loadout_category/pocket/New() . = ..() diff --git a/modular_doppler/loadout_categories/categories/erp.dm b/modular_doppler/loadout_categories/categories/erp.dm index cf3fed7887af0..7c7028eeebf8c 100644 --- a/modular_doppler/loadout_categories/categories/erp.dm +++ b/modular_doppler/loadout_categories/categories/erp.dm @@ -4,6 +4,7 @@ erp_category = TRUE type_to_generate = /datum/loadout_item/erp tab_order = /datum/loadout_category/pocket::tab_order + 1 + var/max_allowed = MAX_ALLOWED_ERP_ITEMS /datum/loadout_category/erp/New() . = ..() diff --git a/modular_doppler/loadout_categories/categories/masks.dm b/modular_doppler/loadout_categories/categories/masks.dm index f7e83c5651240..d17d4775becb3 100644 --- a/modular_doppler/loadout_categories/categories/masks.dm +++ b/modular_doppler/loadout_categories/categories/masks.dm @@ -7,6 +7,11 @@ /* * LOADOUT ITEM DATUMS FOR THE MASK SLOT */ +/datum/loadout_item/mask/pre_equip_item(datum/outfit/outfit, datum/outfit/outfit_important_for_life, mob/living/carbon/human/equipper, visuals_only = FALSE) + if(initial(outfit_important_for_life.mask)) + ..() + return TRUE + /datum/loadout_item/mask abstract_type = /datum/loadout_item/mask diff --git a/modular_doppler/loadout_categories/categories/pockets.dm b/modular_doppler/loadout_categories/categories/pockets.dm index 1f97a7f0ad622..3ea588abc8ea3 100644 --- a/modular_doppler/loadout_categories/categories/pockets.dm +++ b/modular_doppler/loadout_categories/categories/pockets.dm @@ -1,3 +1,6 @@ +/datum/loadout_category/pocket + max_allowed = MAX_ALLOWED_MISC_ITEMS + // Because plushes have a second desc var that needs to be updated /obj/item/toy/plush/on_loadout_custom_described() normal_desc = desc From 0acd218c80ded0b84767873fd931a31c60a1e30c Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:45:16 -0500 Subject: [PATCH 14/17] Cleanup and Doc --- modular_doppler/loadout_categories/READEME.md | 5 +++++ modular_doppler/loadout_categories/loadout_checkers.dm | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modular_doppler/loadout_categories/READEME.md b/modular_doppler/loadout_categories/READEME.md index c82a1bd001a55..65985e5ac5d7d 100644 --- a/modular_doppler/loadout_categories/READEME.md +++ b/modular_doppler/loadout_categories/READEME.md @@ -47,3 +47,8 @@ This proc particulalrly is useful if you wish for a specific item to do somethin `/datum/loadout_item/proc/pre_equip_item` Useful for doing checks on a item before it gets equipped for whatever reason, most of the time check to see if the slot would affect someone who has a item there they need to survive, I.E. Plasmamen. + +### Can be applied to + +`/datum/loadout_item/proc/can_be_applied_to` +Checkes if the item passes requirements and isn't blacklisted based on role or species or restricted to specific role diff --git a/modular_doppler/loadout_categories/loadout_checkers.dm b/modular_doppler/loadout_categories/loadout_checkers.dm index d0cedb5e4e3a3..0adb23e74274e 100644 --- a/modular_doppler/loadout_categories/loadout_checkers.dm +++ b/modular_doppler/loadout_categories/loadout_checkers.dm @@ -1,5 +1,4 @@ // -- The loadout item datum and related procs. -- - /// Called after a loadout item gets a custom description /atom/proc/on_loadout_custom_described() return @@ -110,10 +109,8 @@ if(client && !silent) to_chat(target, span_warning("You were unable to get a loadout item ([initial(item_path.name)]) due to species restrictions!")) return FALSE - return TRUE - /datum/loadout_item/get_ui_buttons() var/list/buttons = ..() @@ -124,7 +121,6 @@ "button_icon" = FA_ICON_PEN, "active_key" = INFO_DESCRIBED, )) - return buttons /datum/loadout_item/to_ui_data() @@ -133,17 +129,13 @@ formatted_item["blacklisted_roles"] = blacklisted_roles formatted_item["restricted_species"] = restricted_species - return formatted_item - /datum/loadout_item/handle_loadout_action(datum/preference_middleware/loadout/manager, mob/user, action, params) if(action == "set_description" && can_be_named) return set_description(manager, user) - return ..() - /// Sets the description of the item. /datum/loadout_item/proc/set_description(datum/preference_middleware/loadout/manager, mob/user) var/list/loadout = manager.preferences.read_preference(/datum/preference/loadout) From a6cb7bc6281efe1e5e7acdfd060d6d52a3643f92 Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:08:01 -0500 Subject: [PATCH 15/17] Re-Order --- tgstation.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index 5753e4cbd2a5d..f22d5d42fdeb2 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -396,8 +396,8 @@ #include "code\__DEFINES\traits\declarations.dm" #include "code\__DEFINES\traits\macros.dm" #include "code\__DEFINES\traits\sources.dm" -#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__DEFINES\~doppler_defines\enterprise_resource_planning.dm" +#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__DEFINES\~doppler_defines\species.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_dreamluau.dm" From 772c41d584a5419e883892f76d3fe55ee5a047ee Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:20:28 -0500 Subject: [PATCH 16/17] Re-Order....AGAIN --- tgstation.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index 10cff540e0d7c..7eb9a482ec201 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -397,8 +397,8 @@ #include "code\__DEFINES\traits\macros.dm" #include "code\__DEFINES\traits\sources.dm" #include "code\__DEFINES\~doppler_defines\enterprise_resource_planning.dm" -#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__DEFINES\~doppler_defines\keybindings.dm" +#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__DEFINES\~doppler_defines\living.dm" #include "code\__DEFINES\~doppler_defines\species.dm" #include "code\__HELPERS\_auxtools_api.dm" From 9e3a44fc91a0c3ea5e930bc60988a03dca9af13f Mon Sep 17 00:00:00 2001 From: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:47:11 -0500 Subject: [PATCH 17/17] ORDER AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --- tgstation.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index 7eb9a482ec201..c5e2feed37199 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -398,8 +398,8 @@ #include "code\__DEFINES\traits\sources.dm" #include "code\__DEFINES\~doppler_defines\enterprise_resource_planning.dm" #include "code\__DEFINES\~doppler_defines\keybindings.dm" -#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__DEFINES\~doppler_defines\living.dm" +#include "code\__DEFINES\~doppler_defines\loadout.dm" #include "code\__DEFINES\~doppler_defines\species.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_dreamluau.dm"