From b759429310fa919b4e3a078833487c8465010b88 Mon Sep 17 00:00:00 2001 From: datlo Date: Sat, 7 Dec 2024 11:09:32 +0100 Subject: [PATCH 1/3] Allow wearing emag and cmag on id slot --- code/game/objects/items/weapons/cards_ids.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 716ed73ca835..052dab141f63 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -37,6 +37,7 @@ origin_tech = "magnets=2;syndicate=2" flags = NOBLUDGEON flags_2 = NO_MAT_REDEMPTION_2 + slot_flags = ITEM_SLOT_ID /obj/item/card/emag/attack__legacy__attackchain() return @@ -70,6 +71,7 @@ origin_tech = "magnets=2;syndicate=2" flags = NOBLUDGEON flags_2 = NO_MAT_REDEMPTION_2 + slot_flags = ITEM_SLOT_ID /obj/item/card/cmag/Initialize(mapload) . = ..() From 599f348682d6ee559856c8717eed14047fd2272e Mon Sep 17 00:00:00 2001 From: datlo Date: Sat, 7 Dec 2024 11:11:41 +0100 Subject: [PATCH 2/3] remove cmag --- code/game/objects/items/weapons/cards_ids.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 052dab141f63..93bf9f8646fe 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -71,7 +71,6 @@ origin_tech = "magnets=2;syndicate=2" flags = NOBLUDGEON flags_2 = NO_MAT_REDEMPTION_2 - slot_flags = ITEM_SLOT_ID /obj/item/card/cmag/Initialize(mapload) . = ..() From e133478554761cb050bfe4f479d012efabc29aea Mon Sep 17 00:00:00 2001 From: datlo Date: Sat, 7 Dec 2024 20:02:28 +0100 Subject: [PATCH 3/3] tweak quick equip --- code/game/objects/items.dm | 2 ++ code/game/objects/items/weapons/cards_ids.dm | 7 +++++-- code/game/objects/items/weapons/storage/bags.dm | 7 +++++++ code/modules/mob/mob.dm | 2 ++ .../reagents/reagent_containers/glass_containers.dm | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 9c49a9e595ba..8c6c7ce3ab8f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -50,6 +50,8 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons var/w_class = WEIGHT_CLASS_NORMAL /// This is used to determine on which slots an item can fit. var/slot_flags = 0 + /// If set, this determines which slots are considered when using quick equip + var/prefered_slot_flags = 0 /// Determines what it can pass over/through. IE. 'PASSTABLE' will allow it to pass over tables pass_flags = PASSTABLE pressure_resistance = 4 diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 93bf9f8646fe..fce3b2ae12ff 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -11,6 +11,8 @@ desc = "A card." icon = 'icons/obj/card.dmi' w_class = WEIGHT_CLASS_TINY + slot_flags = ITEM_SLOT_ID + var/associated_account_number = 0 var/list/files = list() @@ -28,6 +30,7 @@ icon_state = "emag" item_state = "card-id" origin_tech = "magnets=2;syndicate=2" + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS /obj/item/card/emag desc = "It's a card with a magnetic strip attached to some circuitry." @@ -37,7 +40,7 @@ origin_tech = "magnets=2;syndicate=2" flags = NOBLUDGEON flags_2 = NO_MAT_REDEMPTION_2 - slot_flags = ITEM_SLOT_ID + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS /obj/item/card/emag/attack__legacy__attackchain() return @@ -71,6 +74,7 @@ origin_tech = "magnets=2;syndicate=2" flags = NOBLUDGEON flags_2 = NO_MAT_REDEMPTION_2 + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS /obj/item/card/cmag/Initialize(mapload) . = ..() @@ -95,7 +99,6 @@ var/total_mining_points = 0 var/list/access = list() var/registered_name = "Unknown" // The name registered_name on the card - slot_flags = ITEM_SLOT_ID armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 100, ACID = 100) resistance_flags = FIRE_PROOF | ACID_PROOF var/untrackable // Can not be tracked by AI's diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index a9fc87d9fdd8..8c252af99ccd 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -162,6 +162,7 @@ icon_state = "satchel" origin_tech = "engineering=2" slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BOTH_POCKETS + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_NORMAL storage_slots = 10 max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class @@ -195,6 +196,7 @@ storage_slots = 40 //the number of plant pieces it can carry. max_combined_w_class = 40 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class max_w_class = WEIGHT_CLASS_NORMAL + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_TINY can_hold = list( /obj/item/seeds, @@ -409,6 +411,7 @@ desc = "A bag for storing pills, patches, and bottles." storage_slots = 50 max_combined_w_class = 200 + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_TINY can_hold = list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/patch, @@ -426,6 +429,7 @@ desc = "A bag for the safe transportation and disposal of biowaste and other biological materials." storage_slots = 25 max_combined_w_class = 200 + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_TINY can_hold = list(/obj/item/slime_extract, /obj/item/food/monkeycube, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, @@ -444,6 +448,7 @@ item_state = "mailbag" storage_slots = 14 max_combined_w_class = 28 + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_TINY can_hold = list(/obj/item/envelope, /obj/item/stamp, /obj/item/pen, /obj/item/paper, /obj/item/mail_scanner) resistance_flags = FLAMMABLE @@ -459,6 +464,7 @@ item_state = "construction_bag" storage_slots = 30 max_combined_w_class = 60 + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_TINY can_hold = list(/obj/item/airlock_electronics, /obj/item/firelock_electronics, /obj/item/firealarm_electronics, /obj/item/apc_electronics, /obj/item/airalarm_electronics, /obj/item/camera_assembly, /obj/item/stock_parts/cell, /obj/item/circuitboard, /obj/item/stack/cable_coil) resistance_flags = FLAMMABLE @@ -474,6 +480,7 @@ icon_state = "satchel" origin_tech = "engineering=2" slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BOTH_POCKETS + prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS w_class = WEIGHT_CLASS_NORMAL storage_slots = 15 max_combined_w_class = 60 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index b1a145c43906..8ec9f514dde0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -331,6 +331,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ for(var/slot in GLOB.slot_equipment_priority) if(isstorage(W) && slot == ITEM_SLOT_HEAD) // Storage items should be put on the belt before the head continue + if(W.prefered_slot_flags && !(W.prefered_slot_flags & slot)) //If there's a prefered slot flags list, make sure this slot is in it + continue if(equip_to_slot_if_possible(W, slot, FALSE, TRUE)) //del_on_fail = 0; disable_warning = 0 return 1 diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm index 496f385e4dbf..1d762b91cb52 100644 --- a/code/modules/reagents/reagent_containers/glass_containers.dm +++ b/code/modules/reagents/reagent_containers/glass_containers.dm @@ -299,6 +299,7 @@ volume = 120 armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 75, ACID = 50) //Weak melee protection, because you can wear it on your head slot_flags = ITEM_SLOT_HEAD + prefered_slot_flags = ITEM_SLOT_IN_BACKPACK resistance_flags = NONE blocks_emissive = EMISSIVE_BLOCK_GENERIC container_type = OPENCONTAINER