From bebaf1d975debf18d15a66d2bb2874e09a2f1f72 Mon Sep 17 00:00:00 2001 From: synthtwo <127706731+SynthTwo@users.noreply.github.com> Date: Fri, 25 Oct 2024 19:57:06 +0100 Subject: [PATCH 1/6] satchel --- code/__DEFINES/traits/declarations.dm | 4 +++ code/_globalvars/traits/_traits.dm | 1 + code/game/objects/items/storage/backpack.dm | 27 +++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index a2257f2793fd..cc7056fb6583 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1346,4 +1346,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai ///A "fake" effect that should not be subject to normal effect removal methods (like the effect remover component) #define TRAIT_ILLUSORY_EFFECT "illusory_effect" +// /obj/item +/// Applied to a satchel that is being worn on the belt. Iris addition. +#define TRAIT_BELT_SATCHEL "belt_satchel" + // END TRAIT DEFINES diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 0d0c35a5c978..50d53a41bc78 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -576,6 +576,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_BAIT_UNCONSUMABLE" = TRAIT_BAIT_UNCONSUMABLE, "TRAIT_BAKEABLE" = TRAIT_BAKEABLE, "TRAIT_BASIC_QUALITY_BAIT" = TRAIT_BASIC_QUALITY_BAIT, + "TRAIT_BELT_SATCHEL" = TRAIT_BELT_SATCHEL, "TRAIT_BLIND_TOOL" = TRAIT_BLIND_TOOL, "TRAIT_BYPASS_RANGED_ARMOR" = TRAIT_BYPASS_RANGED_ARMOR, "TRAIT_CONTRABAND_BLOCKER" = TRAIT_CONTRABAND_BLOCKER, diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 55778b2521ed..bd4b41f4923e 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -28,6 +28,12 @@ . = ..() AddElement(/datum/element/attack_equip) +/obj/item/storage/backpack/equipped(mob/user, slot, initial) + if(slot == ITEM_SLOT_BACK) + if(HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) + slowdown++ + . = ..() + /* * Backpack Types */ @@ -295,6 +301,27 @@ desc = "A trendy looking satchel." icon_state = "satchel-norm" inhand_icon_state = "satchel-norm" + slot_flags = ITEM_SLOT_BACK | ITEM_SLOT_BELT //iris addition + +/obj/item/storage/backpack/satchel/Initialize(mapload) + . = ..() + atom_storage.max_total_storage = 18 + +/obj/item/storage/backpack/satchel/equipped(mob/user, slot, initial) + . = ..() + if(slot == ITEM_SLOT_BELT) + ADD_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) + if(istype(user.get_item_by_slot(ITEM_SLOT_BACK), /obj/item/storage/backpack)) + var/obj/item/storage/backpack/selected_bag = user.get_item_by_slot(ITEM_SLOT_BACK) + selected_bag.slowdown++ + +/obj/item/storage/backpack/satchel/dropped(mob/user, silent) + . = ..() + if(HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) + REMOVE_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) + if(istype(user.get_item_by_slot(ITEM_SLOT_BACK), /obj/item/storage/backpack)) + var/obj/item/storage/backpack/selected_bag = user.get_item_by_slot(ITEM_SLOT_BACK) + selected_bag.slowdown = initial(selected_bag.slowdown) /obj/item/storage/backpack/satchel/leather name = "leather satchel" From 02a7e343634e1bd07ac157f6f9de32834150bd72 Mon Sep 17 00:00:00 2001 From: synthtwo <127706731+SynthTwo@users.noreply.github.com> Date: Sat, 9 Nov 2024 15:34:39 +0000 Subject: [PATCH 2/6] e --- code/game/objects/items/storage/backpack.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index bd4b41f4923e..d6756a472fa3 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -34,6 +34,10 @@ slowdown++ . = ..() +/obj/item/storage/backpack/dropped(mob/user, silent) + . = ..() + slowdown = initial(slowdown) + /* * Backpack Types */ From 7cbfa47c219cbba2588fe34d80824b877751ef88 Mon Sep 17 00:00:00 2001 From: SynthTee <127706731+SynthTwo@users.noreply.github.com> Date: Sat, 9 Nov 2024 18:20:16 +0000 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/game/objects/items/storage/backpack.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index d6756a472fa3..a4e6aa2a5125 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -29,9 +29,8 @@ AddElement(/datum/element/attack_equip) /obj/item/storage/backpack/equipped(mob/user, slot, initial) - if(slot == ITEM_SLOT_BACK) - if(HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) - slowdown++ + if(slot == ITEM_SLOT_BACK && HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) + slowdown++ . = ..() /obj/item/storage/backpack/dropped(mob/user, silent) @@ -323,8 +322,8 @@ . = ..() if(HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) REMOVE_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) - if(istype(user.get_item_by_slot(ITEM_SLOT_BACK), /obj/item/storage/backpack)) - var/obj/item/storage/backpack/selected_bag = user.get_item_by_slot(ITEM_SLOT_BACK) + var/obj/item/storage/backpack/selected_bag = user.get_item_by_slot(ITEM_SLOT_BACK) + if(istype(selected_bag)) selected_bag.slowdown = initial(selected_bag.slowdown) /obj/item/storage/backpack/satchel/leather From d082db121532d0c9ab10361c26fe2e5f22928524 Mon Sep 17 00:00:00 2001 From: synthtwo <127706731+SynthTwo@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:06:41 +0000 Subject: [PATCH 4/6] Applies cassy fix --- code/game/objects/items/storage/backpack.dm | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index a4e6aa2a5125..fb4b65d753c0 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -29,14 +29,16 @@ AddElement(/datum/element/attack_equip) /obj/item/storage/backpack/equipped(mob/user, slot, initial) - if(slot == ITEM_SLOT_BACK && HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) - slowdown++ . = ..() + if(slot == ITEM_SLOT_BACK) + var/obj/item/storage/backpack/satchel/worn_satchel = user.get_item_by_slot(ITEM_SLOT_BELT) + if(istype(worn_satchel) && HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) + slowdown = 1.5 + user.update_equipment_speed_mods() /obj/item/storage/backpack/dropped(mob/user, silent) . = ..() slowdown = initial(slowdown) - /* * Backpack Types */ @@ -314,18 +316,17 @@ . = ..() if(slot == ITEM_SLOT_BELT) ADD_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) - if(istype(user.get_item_by_slot(ITEM_SLOT_BACK), /obj/item/storage/backpack)) - var/obj/item/storage/backpack/selected_bag = user.get_item_by_slot(ITEM_SLOT_BACK) - selected_bag.slowdown++ + var/obj/item/storage/backpack/worn_backpack = user.get_item_by_slot(ITEM_SLOT_BACK) + if(istype(worn_backpack)) + worn_backpack.slowdown = 1.5 + user.update_equipment_speed_mods() /obj/item/storage/backpack/satchel/dropped(mob/user, silent) . = ..() - if(HAS_TRAIT(user, TRAIT_BELT_SATCHEL)) - REMOVE_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) - var/obj/item/storage/backpack/selected_bag = user.get_item_by_slot(ITEM_SLOT_BACK) - if(istype(selected_bag)) - selected_bag.slowdown = initial(selected_bag.slowdown) - + REMOVE_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) + var/obj/item/storage/backpack/worn_backpack = user.get_item_by_slot(ITEM_SLOT_BACK) + if(istype(worn_backpack)) + worn_backpack.slowdown = initial(worn_backpack.slowdown) /obj/item/storage/backpack/satchel/leather name = "leather satchel" desc = "It's a very fancy satchel made with fine leather." From 036e195d305916848f17e6788f2a6aa308f7bce2 Mon Sep 17 00:00:00 2001 From: SynthTee <127706731+SynthTwo@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:13:56 +0000 Subject: [PATCH 5/6] Update code/game/objects/items/storage/backpack.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/game/objects/items/storage/backpack.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index fb4b65d753c0..1b6b5c243ea6 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -40,6 +40,7 @@ . = ..() slowdown = initial(slowdown) /* + * Backpack Types */ From 6218cbf0112a76b953fceb7ebecb89a0ce3f97d7 Mon Sep 17 00:00:00 2001 From: synthtwo <127706731+SynthTwo@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:01:49 +0000 Subject: [PATCH 6/6] e --- code/_globalvars/traits/_traits.dm | 2 +- code/game/objects/items/storage/backpack.dm | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 50d53a41bc78..3369bfd80a82 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -576,7 +576,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_BAIT_UNCONSUMABLE" = TRAIT_BAIT_UNCONSUMABLE, "TRAIT_BAKEABLE" = TRAIT_BAKEABLE, "TRAIT_BASIC_QUALITY_BAIT" = TRAIT_BASIC_QUALITY_BAIT, - "TRAIT_BELT_SATCHEL" = TRAIT_BELT_SATCHEL, + "TRAIT_BELT_SATCHEL" = TRAIT_BELT_SATCHEL, //iris edit "TRAIT_BLIND_TOOL" = TRAIT_BLIND_TOOL, "TRAIT_BYPASS_RANGED_ARMOR" = TRAIT_BYPASS_RANGED_ARMOR, "TRAIT_CONTRABAND_BLOCKER" = TRAIT_CONTRABAND_BLOCKER, diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 1b6b5c243ea6..506a371f4b5e 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -28,7 +28,7 @@ . = ..() AddElement(/datum/element/attack_equip) -/obj/item/storage/backpack/equipped(mob/user, slot, initial) +/obj/item/storage/backpack/equipped(mob/user, slot, initial) //iris edit start . = ..() if(slot == ITEM_SLOT_BACK) var/obj/item/storage/backpack/satchel/worn_satchel = user.get_item_by_slot(ITEM_SLOT_BELT) @@ -38,7 +38,7 @@ /obj/item/storage/backpack/dropped(mob/user, silent) . = ..() - slowdown = initial(slowdown) + slowdown = initial(slowdown) //iris edit end /* * Backpack Types @@ -307,13 +307,13 @@ desc = "A trendy looking satchel." icon_state = "satchel-norm" inhand_icon_state = "satchel-norm" - slot_flags = ITEM_SLOT_BACK | ITEM_SLOT_BELT //iris addition + slot_flags = ITEM_SLOT_BACK | ITEM_SLOT_BELT //iris edit /obj/item/storage/backpack/satchel/Initialize(mapload) . = ..() atom_storage.max_total_storage = 18 -/obj/item/storage/backpack/satchel/equipped(mob/user, slot, initial) +/obj/item/storage/backpack/satchel/equipped(mob/user, slot, initial) //iris edit start . = ..() if(slot == ITEM_SLOT_BELT) ADD_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) @@ -327,7 +327,8 @@ REMOVE_TRAIT(user, TRAIT_BELT_SATCHEL, CLOTHING_TRAIT) var/obj/item/storage/backpack/worn_backpack = user.get_item_by_slot(ITEM_SLOT_BACK) if(istype(worn_backpack)) - worn_backpack.slowdown = initial(worn_backpack.slowdown) + worn_backpack.slowdown = initial(worn_backpack.slowdown) //iris edit end + /obj/item/storage/backpack/satchel/leather name = "leather satchel" desc = "It's a very fancy satchel made with fine leather."