From 9570c9bec933512cf503b654b60684c8625adead Mon Sep 17 00:00:00 2001 From: ariaworld <143797359+ariaworld@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:52:13 +0100 Subject: [PATCH 1/2] Refactor, clean and optimize tailbag code. --- .../crafting/recipes/recipes_clothing.dm | 6 +- .../game/objects/items/storage/tailbag.dm | 122 ------------------ .../game/objects/items/storage/wallets.dm | 40 ++++++ .../code/modules/client/loadout/hands.dm | 48 +++---- tgstation.dme | 1 - 5 files changed, 67 insertions(+), 150 deletions(-) delete mode 100644 modular_splurt/code/game/objects/items/storage/tailbag.dm diff --git a/modular_splurt/code/datums/components/crafting/recipes/recipes_clothing.dm b/modular_splurt/code/datums/components/crafting/recipes/recipes_clothing.dm index 612975c5f43a..41669bdbd1b2 100644 --- a/modular_splurt/code/datums/components/crafting/recipes/recipes_clothing.dm +++ b/modular_splurt/code/datums/components/crafting/recipes/recipes_clothing.dm @@ -1,14 +1,14 @@ /datum/crafting_recipe/tailbag name = "Tailbag" - result = /obj/item/storage/tailbag + result = /obj/item/storage/wallet/tailbag reqs = list(/obj/item/stack/sheet/leather = 2) time = 30 category = CAT_CLOTHING /datum/crafting_recipe/tailbag_xl name = "XL Tailbag" - result = /obj/item/storage/tailbag/xtralg - reqs = list(/obj/item/storage/tailbag = 1, + result = /obj/item/storage/wallet/tailbag/xtralg + reqs = list(/obj/item/storage/wallet/tailbag = 1, /obj/item/stack/sheet/leather = 2) time = 30 category = CAT_CLOTHING diff --git a/modular_splurt/code/game/objects/items/storage/tailbag.dm b/modular_splurt/code/game/objects/items/storage/tailbag.dm deleted file mode 100644 index 0098544d8bf8..000000000000 --- a/modular_splurt/code/game/objects/items/storage/tailbag.dm +++ /dev/null @@ -1,122 +0,0 @@ -/obj/item/storage/tailbag - name = "tailbag" - desc = "A bag for holding small items. It fastens around the base of the tail." - icon = 'modular_splurt/icons/obj/storage.dmi' - icon_state = "tailbag" - w_class = WEIGHT_CLASS_SMALL - resistance_flags = FLAMMABLE - slot_flags = ITEM_SLOT_ID - - var/obj/item/card/id/front_id = null - var/list/combined_access - -/obj/item/storage/tailbag/ComponentInitialize() - . = ..() - var/datum/component/storage/STR = GetComponent(/datum/component/storage) - STR.max_items = 6 - STR.cant_hold = typecacheof(list(/obj/item/screwdriver/power)) - STR.can_hold = typecacheof(list( - /obj/item/stack/spacecash, - /obj/item/holochip, - /obj/item/card, - /obj/item/clothing/mask/cigarette, - /obj/item/flashlight/pen, - /obj/item/seeds, - /obj/item/stack/medical, - /obj/item/toy/crayon, - /obj/item/coin, - /obj/item/dice, - /obj/item/disk, - /obj/item/implanter, - /obj/item/lighter, - /obj/item/lipstick, - /obj/item/match, - /obj/item/paper, - /obj/item/pen, - /obj/item/photo, - /obj/item/reagent_containers/dropper, - /obj/item/reagent_containers/syringe, - /obj/item/screwdriver, - /obj/item/multitool, - /obj/item/wrench, - /obj/item/wirecutters, - /obj/item/valentine, - /obj/item/stamp, - /obj/item/key, - /obj/item/cartridge, - /obj/item/camera_film, - /obj/item/stack/ore/bluespace_crystal, - /obj/item/reagent_containers/food/snacks/grown/poppy, - /obj/item/instrument/harmonica, - /obj/item/mining_voucher, - /obj/item/suit_voucher, - /obj/item/reagent_containers/pill, - /obj/item/gun/ballistic/derringer, - /obj/item/genital_equipment/condom, - /obj/item/restraints/handcuffs, - /obj/item/assembly/flash, - /obj/item/laser_pointer, - /obj/item/pda, - /obj/item/paicard)) - -/obj/item/storage/tailbag/Exited(atom/movable/AM) - . = ..() - refreshID() - -/obj/item/storage/tailbag/proc/refreshID() - LAZYCLEARLIST(combined_access) - if(!(front_id in src)) - front_id = null - for(var/obj/item/card/id/I in contents) - if(!front_id) - front_id = I - LAZYINITLIST(combined_access) - combined_access |= I.access - update_icon() - -/obj/item/storage/tailbag/Entered(atom/movable/AM) - . = ..() - refreshID() - -/obj/item/storage/tailbag/update_icon_state() - var/new_state = "tailbag" - if(front_id) - new_state = "tailbag_id" - if(new_state != icon_state) //avoid so many icon state changes. - icon_state = new_state - -/obj/item/storage/tailbag/GetID() - return front_id - -/obj/item/storage/tailbag/RemoveID() - if(!front_id) - return - . = front_id - front_id.forceMove(get_turf(src)) - -/obj/item/storage/tailbag/InsertID(obj/item/inserting_item) - var/obj/item/card/inserting_id = inserting_item.RemoveID() - if(!inserting_id) - return FALSE - attackby(inserting_id) - if(inserting_id in contents) - return TRUE - return FALSE - -/obj/item/storage/tailbag/GetAccess() - if(LAZYLEN(combined_access)) - return combined_access - else - return ..() - -/obj/item/storage/tailbag/xtralg - name = "XL Tailbag" - desc = "A larger tail bag for larger creatures" - icon = 'modular_splurt/icons/obj/storage.dmi' - icon_state = "tailbag_xl" - -/obj/item/storage/tailbag/xtralg/ComponentInitialize() - . = ..() - var/datum/component/storage/STR = GetComponent(/datum/component/storage) - STR.max_items = 8 - diff --git a/modular_splurt/code/game/objects/items/storage/wallets.dm b/modular_splurt/code/game/objects/items/storage/wallets.dm index 8e08e7b456fa..3c10c035ceed 100644 --- a/modular_splurt/code/game/objects/items/storage/wallets.dm +++ b/modular_splurt/code/game/objects/items/storage/wallets.dm @@ -18,3 +18,43 @@ /obj/item/storage/wallet/bluespace/update_icon_state() // Don't update icons return + +// Tailbags +/obj/item/storage/wallet/tailbag + name = "tailbag" + desc = "A bag for holding small items. It fastens around the base of the tail." + icon = 'modular_splurt/icons/obj/storage.dmi' + icon_state = "tailbag" + +/obj/item/storage/wallet/tailbag/update_icon_state() + // Don't update icons + return + +/obj/item/storage/wallet/tailbag/ComponentInitialize() + . = ..() + var/datum/component/storage/STR = GetComponent(/datum/component/storage) + STR.max_items = 6 + STR.can_hold += typecacheof(list( // Extra items that can go in tailbags, more than wallets + /obj/item/restraints/handcuffs, + /obj/item/assembly/flash, + /obj/item/laser_pointer, + /obj/item/pda, + /obj/item/paicard + )) + +/obj/item/storage/wallet/tailbag/xtralg + name = "XL Tailbag" + desc = "A larger tail bag for larger creatures" + icon = 'modular_splurt/icons/obj/storage.dmi' + icon_state = "tailbag_xl" + +/obj/item/storage/wallet/tailbag/xtralg/update_icon_state() + // Don't update icons + return + +/obj/item/storage/wallet/tailbag/xtralg/ComponentInitialize() + . = ..() + var/datum/component/storage/STR = GetComponent(/datum/component/storage) + STR.max_items = 8 + +// diff --git a/modular_splurt/code/modules/client/loadout/hands.dm b/modular_splurt/code/modules/client/loadout/hands.dm index bd9f3d501eb8..c2fd269d6bec 100644 --- a/modular_splurt/code/modules/client/loadout/hands.dm +++ b/modular_splurt/code/modules/client/loadout/hands.dm @@ -1,24 +1,24 @@ -/datum/gear/hands/paicard - name = "pAI device" - description = "A personal AI device for checking and downloading various personalities." - path = /obj/item/paicard - -/datum/gear/hands/tailbag - name = "Tailbag" - description = "A bag for holding small personal items, which fastens around the base of the tail." - path = /obj/item/storage/tailbag - -/datum/gear/hands/tarotdeck - name = "Tarot Deck" - description = "A full 78 card deck of Tarot Cards, no refunds on false predicitons." - path = /obj/item/toy/cards/deck/tarot - -//MODIFIED COSTS - MODULAR SPLURT -/datum/gear/hands/straightrazor - cost = 6 - -/datum/gear/hands/flask - cost = 1 - -/datum/gear/hands/cigar - cost = 2 +/datum/gear/hands/paicard + name = "pAI device" + description = "A personal AI device for checking and downloading various personalities." + path = /obj/item/paicard + +/datum/gear/hands/tailbag + name = "Tailbag" + description = "A bag for holding small personal items, which fastens around the base of the tail." + path = /obj/item/storage/wallet/tailbag + +/datum/gear/hands/tarotdeck + name = "Tarot Deck" + description = "A full 78 card deck of Tarot Cards, no refunds on false predicitons." + path = /obj/item/toy/cards/deck/tarot + +//MODIFIED COSTS - MODULAR SPLURT +/datum/gear/hands/straightrazor + cost = 6 + +/datum/gear/hands/flask + cost = 1 + +/datum/gear/hands/cigar + cost = 2 diff --git a/tgstation.dme b/tgstation.dme index aa9434adf875..53191a727b0d 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4582,7 +4582,6 @@ #include "modular_splurt\code\game\objects\items\storage\boxes.dm" #include "modular_splurt\code\game\objects\items\storage\firstaid.dm" #include "modular_splurt\code\game\objects\items\storage\secure.dm" -#include "modular_splurt\code\game\objects\items\storage\tailbag.dm" #include "modular_splurt\code\game\objects\items\storage\wallets.dm" #include "modular_splurt\code\game\objects\items\tanks\tank_types.dm" #include "modular_splurt\code\game\objects\items\weaponry\armyknife.dm" From d442c445646eb9ce0bf1b2a76d2222af889b30ff Mon Sep 17 00:00:00 2001 From: ariaworld <143797359+ariaworld@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:55:47 +0100 Subject: [PATCH 2/2] Add: RUNLEVEL_POSTGAME to shuttles to let shuttles move after round is over. --- code/controllers/subsystem/shuttle.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index cf7ab159b6b5..706cdab38826 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -5,6 +5,7 @@ SUBSYSTEM_DEF(shuttle) wait = 10 init_order = INIT_ORDER_SHUTTLE flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK + runlevels = RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME // Splurt edit: Add RUNLEVEL_POSTGAME to let shuttles move after round is over. var/list/mobile = list() var/list/stationary = list()