From 7e72c0d2d2d79b28998966392faac7a6ffa4a8f8 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Wed, 20 Nov 2024 13:44:36 +0500 Subject: [PATCH 01/20] Auto catch toggleable --- code/datums/components/magazine_catcher.dm | 2 ++ code/game/objects/items/storage/storage.dm | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index c99c8565d2f..a628c1234a4 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -43,4 +43,6 @@ /datum/component/magazine_catcher/proc/try_to_catch_magazine(datum/source, obj/item/mag) if(!storage.can_be_inserted(mag, FALSE)) return FALSE + if(!storage.auto_catch) + return FALSE return storage.handle_item_insertion(mag, TRUE) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index bd81a515a77..aac1e2a70b4 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -78,6 +78,8 @@ var/refill_sound = null ///Flags for specifically storage items var/flags_storage = NONE + ///Auto catching empty magazines: 0 - disabled, 1 - enabled + var/obj/item/storage/holster/belt/pistol/auto_catch = 1 /obj/item/storage/MouseDrop(atom/over_object) if(!ishuman(usr)) @@ -623,6 +625,15 @@ else to_chat(usr, "Clicking [src] with an empty hand now opens the pouch storage menu.") +/obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() + set name = "Toggle Auto Catching Empty Magazines" + set category = "Object" + auto_catch = !auto_catch + if(!auto_catch) + to_chat(usr, "Auto catching disabled.") + else + to_chat(usr, "Auto catching enabled.") + /obj/item/storage/proc/quick_empty(atom/dest_object, mob/user) if(!user.CanReach(dest_object) || !user.CanReach(src)) return From a24d42d9eb776ae360142e12bea76af37f434690 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Wed, 20 Nov 2024 15:00:29 +0500 Subject: [PATCH 02/20] Desc red --- code/game/objects/items/storage/storage.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index aac1e2a70b4..388f1540b14 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -626,7 +626,7 @@ to_chat(usr, "Clicking [src] with an empty hand now opens the pouch storage menu.") /obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() - set name = "Toggle Auto Catching Empty Magazines" + set name = "Toggle Auto Catching Magazines" set category = "Object" auto_catch = !auto_catch if(!auto_catch) From a894d8618f78862c233fe950af3b7ca9b2ab90b8 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Thu, 21 Nov 2024 03:14:15 +0500 Subject: [PATCH 03/20] Revolver catch/restock --- code/game/objects/items/storage/holsters.dm | 12 ++++++++++++ code/game/objects/items/storage/storage.dm | 11 +---------- code/modules/projectiles/guns/revolvers.dm | 1 + 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index 30c99425162..5613a32fc75 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -101,6 +101,16 @@ underlays -= holstered_item_underlay QDEL_NULL(holstered_item_underlay) +/obj/item/storage/holster/belt/verb/toggle_auto_catch() + set name = "Toggle Auto Catching Magazines" + set category = "Object" + auto_catch = !auto_catch + if(!auto_catch) + to_chat(usr, "Auto catching disabled.") + else + to_chat(usr, "Auto catching enabled.") + + /obj/item/storage/holster/do_quick_equip(mob/user) //Will only draw the specific holstered item, not ammo etc. if(!holstered_item) return FALSE @@ -722,6 +732,8 @@ /obj/item/storage/holster/belt/revolver/Initialize(mapload, ...) . = ..() AddComponent(/datum/component/tac_reload_storage) + AddComponent(/datum/component/magazine_catcher) + AddComponent(/datum/component/easy_restock) /obj/item/storage/holster/belt/revolver/t457 name = "\improper T457 pattern revolver holster rig" diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index 388f1540b14..247d6f31a2d 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -79,7 +79,7 @@ ///Flags for specifically storage items var/flags_storage = NONE ///Auto catching empty magazines: 0 - disabled, 1 - enabled - var/obj/item/storage/holster/belt/pistol/auto_catch = 1 + var/auto_catch = 1 /obj/item/storage/MouseDrop(atom/over_object) if(!ishuman(usr)) @@ -625,15 +625,6 @@ else to_chat(usr, "Clicking [src] with an empty hand now opens the pouch storage menu.") -/obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() - set name = "Toggle Auto Catching Magazines" - set category = "Object" - auto_catch = !auto_catch - if(!auto_catch) - to_chat(usr, "Auto catching disabled.") - else - to_chat(usr, "Auto catching enabled.") - /obj/item/storage/proc/quick_empty(atom/dest_object, mob/user) if(!user.CanReach(dest_object) || !user.CanReach(src)) return diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 715b5f705b9..98d3aa2ba9b 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -95,6 +95,7 @@ S.remove_from_storage(new_magazine, get_turf(user), user) user.put_in_any_hand_if_possible(new_magazine) reload(new_magazine, user) + SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //SEND_SIGNAL in reload wont do anything for revolvers because of ammo_magazine/handful ejecting. Putting it here solve this problem but it's kinda weird if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return unique_gun_close(user) From 927fa894c29c44f308a20d2d50069069c1219ad9 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Thu, 21 Nov 2024 23:29:48 +0500 Subject: [PATCH 04/20] Fix invis magazine and non-reloadable T500/R-76 --- code/modules/projectiles/guns/revolvers.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 98d3aa2ba9b..33d586aec62 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -93,9 +93,9 @@ if(istype(new_magazine.loc, /obj/item/storage)) var/obj/item/storage/S = new_magazine.loc S.remove_from_storage(new_magazine, get_turf(user), user) - user.put_in_any_hand_if_possible(new_magazine) + //user.put_in_any_hand_if_possible(new_magazine) reload(new_magazine, user) - SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //SEND_SIGNAL in reload wont do anything for revolvers because of ammo_magazine/handful ejecting. Putting it here solve this problem but it's kinda weird + SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return unique_gun_close(user) From 049a3a8ed10fea50bc3e453b7b567aebff6bcf45 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Fri, 22 Nov 2024 15:26:21 +0500 Subject: [PATCH 05/20] Fix belt in suit slot auto_catch now working --- code/game/objects/items/storage/holsters.dm | 1 + code/modules/projectiles/guns/revolvers.dm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index 5613a32fc75..4e41effc7f6 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -728,6 +728,7 @@ /obj/item/storage/holster/belt/revolver name = "generic revolver belt" desc = "A revolver belt that is not a pistol belt" + flags_equip_slot = ITEM_SLOT_BELT|ITEM_SLOT_SUITSTORE /obj/item/storage/holster/belt/revolver/Initialize(mapload, ...) . = ..() diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 33d586aec62..c382eb186dd 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -95,7 +95,7 @@ S.remove_from_storage(new_magazine, get_turf(user), user) //user.put_in_any_hand_if_possible(new_magazine) reload(new_magazine, user) - SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) + SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //reload() wont SEND_SIGNAL because revolvers reload without unload() proc if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return unique_gun_close(user) From c429c279aba6f2650e443009e3dc0996d1a55f3d Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sat, 23 Nov 2024 00:30:14 +0500 Subject: [PATCH 06/20] Fixes --- code/game/objects/items/storage/holsters.dm | 11 ++++++++++- code/game/objects/items/storage/storage.dm | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index 4e41effc7f6..238984a34d3 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -101,7 +101,7 @@ underlays -= holstered_item_underlay QDEL_NULL(holstered_item_underlay) -/obj/item/storage/holster/belt/verb/toggle_auto_catch() +/obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() set name = "Toggle Auto Catching Magazines" set category = "Object" auto_catch = !auto_catch @@ -110,6 +110,15 @@ else to_chat(usr, "Auto catching enabled.") +/obj/item/storage/holster/belt/revolver/verb/toggle_auto_catch() + set name = "Toggle Auto Catching Speed Loaders" + set category = "Object" + auto_catch = !auto_catch + if(!auto_catch) + to_chat(usr, "Auto catching disabled.") + else + to_chat(usr, "Auto catching enabled.") + /obj/item/storage/holster/do_quick_equip(mob/user) //Will only draw the specific holstered item, not ammo etc. if(!holstered_item) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index 247d6f31a2d..c970f2fcbaa 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -78,8 +78,8 @@ var/refill_sound = null ///Flags for specifically storage items var/flags_storage = NONE - ///Auto catching empty magazines: 0 - disabled, 1 - enabled - var/auto_catch = 1 + ///Auto catching empty magazines: FALSE - disabled, TRUE - enabled + var/auto_catch = TRUE /obj/item/storage/MouseDrop(atom/over_object) if(!ishuman(usr)) From 533dfe84c16f6d7d19993a619efdc777c6895dfc Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sat, 23 Nov 2024 00:31:21 +0500 Subject: [PATCH 07/20] Fixes --- code/game/objects/items/storage/holsters.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index 238984a34d3..b8f95f89aa8 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -119,7 +119,6 @@ else to_chat(usr, "Auto catching enabled.") - /obj/item/storage/holster/do_quick_equip(mob/user) //Will only draw the specific holstered item, not ammo etc. if(!holstered_item) return FALSE From e72989ed17221c3cedeb3d7108f20634131c81a6 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sat, 23 Nov 2024 17:37:46 +0500 Subject: [PATCH 08/20] Fix 3 --- code/modules/projectiles/guns/revolvers.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index c382eb186dd..4f9056ef4aa 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -93,7 +93,6 @@ if(istype(new_magazine.loc, /obj/item/storage)) var/obj/item/storage/S = new_magazine.loc S.remove_from_storage(new_magazine, get_turf(user), user) - //user.put_in_any_hand_if_possible(new_magazine) reload(new_magazine, user) SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //reload() wont SEND_SIGNAL because revolvers reload without unload() proc if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) From 82b12c8ecf3d5b080db85bdb23df5fe016f50ff6 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sat, 23 Nov 2024 18:25:02 +0500 Subject: [PATCH 09/20] Second way of implementation --- code/modules/projectiles/guns/revolvers.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 4f9056ef4aa..7e160ac17f4 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -90,11 +90,13 @@ update_icon() if(!do_after(user, tac_reload_time, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return - if(istype(new_magazine.loc, /obj/item/storage)) - var/obj/item/storage/S = new_magazine.loc + var/obj/item/storage/S = new_magazine.loc + if(istype(S, /obj/item/storage)) S.remove_from_storage(new_magazine, get_turf(user), user) reload(new_magazine, user) SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //reload() wont SEND_SIGNAL because revolvers reload without unload() proc + if(!S.auto_catch) + user.put_in_any_hand_if_possible(new_magazine) if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return unique_gun_close(user) From 65bab57b5ca5158d6075ee042715e06b85e7c639 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Tue, 26 Nov 2024 21:25:41 +0500 Subject: [PATCH 10/20] Stable --- code/modules/projectiles/guns/revolvers.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 7e160ac17f4..293130db05f 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -90,13 +90,15 @@ update_icon() if(!do_after(user, tac_reload_time, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return - var/obj/item/storage/S = new_magazine.loc - if(istype(S, /obj/item/storage)) + if(istype(new_magazine.loc, /obj/item/storage)) + var/obj/item/storage/S = new_magazine.loc S.remove_from_storage(new_magazine, get_turf(user), user) + if(!S.auto_catch) + user.put_in_any_hand_if_possible(new_magazine) + else + new_magazine.forceMove(get_turf(src)) + SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //reload() wont SEND_SIGNAL because revolvers reload without unload() proc reload(new_magazine, user) - SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //reload() wont SEND_SIGNAL because revolvers reload without unload() proc - if(!S.auto_catch) - user.put_in_any_hand_if_possible(new_magazine) if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return unique_gun_close(user) From 673d6f7463db81aa6ea58fd417ba2540e1aa77a8 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Tue, 3 Dec 2024 23:30:51 +0500 Subject: [PATCH 11/20] Pomohite pojojda --- code/datums/components/magazine_catcher.dm | 17 +++++++++++++++++ code/game/objects/items/storage/holsters.dm | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index a628c1234a4..9e6c03fa18c 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -15,12 +15,14 @@ /datum/component/magazine_catcher/RegisterWithParent() . = ..() + add_verbs() RegisterSignal(parent, COMSIG_ITEM_EQUIPPED_TO_SLOT, PROC_REF(equipped_to_slot)) RegisterSignals(parent, list(COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED), PROC_REF(removed_from_slot)) storage = parent /datum/component/magazine_catcher/UnregisterFromParent() . = ..() + remove_verbs() UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED_TO_SLOT, COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED)) /datum/component/magazine_catcher/proc/equipped_to_slot(datum/source, mob/user, slot) @@ -40,9 +42,24 @@ wearer = null UnregisterSignal(user, COMSIG_MAGAZINE_DROP) +/datum/component/magazine_catcher/proc/add_verbs() + storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch + +/datum/component/magazine_catcher/proc/remove_verbs() + storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch + /datum/component/magazine_catcher/proc/try_to_catch_magazine(datum/source, obj/item/mag) if(!storage.can_be_inserted(mag, FALSE)) return FALSE if(!storage.auto_catch) return FALSE return storage.handle_item_insertion(mag, TRUE) + +/datum/component/magazine_catcher/verb/toggle_auto_catch() + set name = "Toggle Auto Catching Magazines" + set category = "Object" + storage.auto_catch = !storage.auto_catch + if(!storage.auto_catch) + to_chat(usr, "Auto catching disabled.") + else + to_chat(usr, "Auto catching enabled.") diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index b8f95f89aa8..0de90f63f01 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -101,7 +101,7 @@ underlays -= holstered_item_underlay QDEL_NULL(holstered_item_underlay) -/obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() +/*/obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() set name = "Toggle Auto Catching Magazines" set category = "Object" auto_catch = !auto_catch @@ -118,7 +118,7 @@ to_chat(usr, "Auto catching disabled.") else to_chat(usr, "Auto catching enabled.") - +*/ /obj/item/storage/holster/do_quick_equip(mob/user) //Will only draw the specific holstered item, not ammo etc. if(!holstered_item) return FALSE From 2a8342a36278cf2ff837511219d170dad5d4df14 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Wed, 4 Dec 2024 13:02:58 +0500 Subject: [PATCH 12/20] Mnogo fixikov --- code/datums/components/magazine_catcher.dm | 15 ++++++++------- code/game/objects/items/storage/holsters.dm | 18 ------------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index 9e6c03fa18c..242a49b9eee 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -15,14 +15,14 @@ /datum/component/magazine_catcher/RegisterWithParent() . = ..() - add_verbs() RegisterSignal(parent, COMSIG_ITEM_EQUIPPED_TO_SLOT, PROC_REF(equipped_to_slot)) RegisterSignals(parent, list(COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED), PROC_REF(removed_from_slot)) storage = parent + storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch /datum/component/magazine_catcher/UnregisterFromParent() . = ..() - remove_verbs() + storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED_TO_SLOT, COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED)) /datum/component/magazine_catcher/proc/equipped_to_slot(datum/source, mob/user, slot) @@ -41,13 +41,13 @@ wearer = null UnregisterSignal(user, COMSIG_MAGAZINE_DROP) - +/* /datum/component/magazine_catcher/proc/add_verbs() storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch /datum/component/magazine_catcher/proc/remove_verbs() storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch - +*/ /datum/component/magazine_catcher/proc/try_to_catch_magazine(datum/source, obj/item/mag) if(!storage.can_be_inserted(mag, FALSE)) return FALSE @@ -56,10 +56,11 @@ return storage.handle_item_insertion(mag, TRUE) /datum/component/magazine_catcher/verb/toggle_auto_catch() - set name = "Toggle Auto Catching Magazines" + set name = "Toggle Auto Catching Magazines/Speed Loaders" set category = "Object" - storage.auto_catch = !storage.auto_catch - if(!storage.auto_catch) + var/obj/item/storage/holst = src + holst.auto_catch = !holst.auto_catch + if(!holst.auto_catch) to_chat(usr, "Auto catching disabled.") else to_chat(usr, "Auto catching enabled.") diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index 0de90f63f01..643590db703 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -101,24 +101,6 @@ underlays -= holstered_item_underlay QDEL_NULL(holstered_item_underlay) -/*/obj/item/storage/holster/belt/pistol/verb/toggle_auto_catch() - set name = "Toggle Auto Catching Magazines" - set category = "Object" - auto_catch = !auto_catch - if(!auto_catch) - to_chat(usr, "Auto catching disabled.") - else - to_chat(usr, "Auto catching enabled.") - -/obj/item/storage/holster/belt/revolver/verb/toggle_auto_catch() - set name = "Toggle Auto Catching Speed Loaders" - set category = "Object" - auto_catch = !auto_catch - if(!auto_catch) - to_chat(usr, "Auto catching disabled.") - else - to_chat(usr, "Auto catching enabled.") -*/ /obj/item/storage/holster/do_quick_equip(mob/user) //Will only draw the specific holstered item, not ammo etc. if(!holstered_item) return FALSE From 2159c9d68a578ba2f059033d1bb2be5c2c4359f0 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Wed, 4 Dec 2024 13:42:16 +0500 Subject: [PATCH 13/20] Delete commentari --- code/datums/components/magazine_catcher.dm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index 242a49b9eee..f2fbba28338 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -41,13 +41,7 @@ wearer = null UnregisterSignal(user, COMSIG_MAGAZINE_DROP) -/* -/datum/component/magazine_catcher/proc/add_verbs() - storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch -/datum/component/magazine_catcher/proc/remove_verbs() - storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch -*/ /datum/component/magazine_catcher/proc/try_to_catch_magazine(datum/source, obj/item/mag) if(!storage.can_be_inserted(mag, FALSE)) return FALSE From 42a8e12dab2360a7ae7f96deef4c9bda69991d2d Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Wed, 4 Dec 2024 22:34:55 +0500 Subject: [PATCH 14/20] Maybe fix --- code/datums/components/magazine_catcher.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index f2fbba28338..2e4d895dd2f 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -22,7 +22,8 @@ /datum/component/magazine_catcher/UnregisterFromParent() . = ..() - storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch + if(storage) + storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED_TO_SLOT, COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED)) /datum/component/magazine_catcher/proc/equipped_to_slot(datum/source, mob/user, slot) From 9796c018d710aeb475458d06decc508b7b85c549 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Fri, 6 Dec 2024 01:08:06 +0500 Subject: [PATCH 15/20] Component modifying --- code/datums/components/magazine_catcher.dm | 12 ++++++++---- code/game/objects/items/storage/storage.dm | 2 -- code/modules/projectiles/guns/revolvers.dm | 5 +---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index 2e4d895dd2f..b3583c6b83f 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -2,6 +2,8 @@ var/mob/living/carbon/human/wearer ///Parent storage in which we want to collect magazines var/obj/item/storage/storage + ///Auto catching empty magazines: FALSE - disabled, TRUE - enabled + var/auto_catch /datum/component/magazine_catcher/Initialize() . = ..() @@ -11,6 +13,7 @@ /datum/component/magazine_catcher/Destroy(force, silent) storage = null wearer = null + auto_catch = null return ..() /datum/component/magazine_catcher/RegisterWithParent() @@ -19,6 +22,7 @@ RegisterSignals(parent, list(COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED), PROC_REF(removed_from_slot)) storage = parent storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch + auto_catch = TRUE /datum/component/magazine_catcher/UnregisterFromParent() . = ..() @@ -46,16 +50,16 @@ /datum/component/magazine_catcher/proc/try_to_catch_magazine(datum/source, obj/item/mag) if(!storage.can_be_inserted(mag, FALSE)) return FALSE - if(!storage.auto_catch) + if(!auto_catch) return FALSE return storage.handle_item_insertion(mag, TRUE) /datum/component/magazine_catcher/verb/toggle_auto_catch() set name = "Toggle Auto Catching Magazines/Speed Loaders" set category = "Object" - var/obj/item/storage/holst = src - holst.auto_catch = !holst.auto_catch - if(!holst.auto_catch) + var/datum/component/magazine_catcher/comp = GetComponent(/datum/component/magazine_catcher) + comp.auto_catch = !comp.auto_catch + if(!comp.auto_catch) to_chat(usr, "Auto catching disabled.") else to_chat(usr, "Auto catching enabled.") diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index c970f2fcbaa..bd81a515a77 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -78,8 +78,6 @@ var/refill_sound = null ///Flags for specifically storage items var/flags_storage = NONE - ///Auto catching empty magazines: FALSE - disabled, TRUE - enabled - var/auto_catch = TRUE /obj/item/storage/MouseDrop(atom/over_object) if(!ishuman(usr)) diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 293130db05f..1543e00d807 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -93,11 +93,8 @@ if(istype(new_magazine.loc, /obj/item/storage)) var/obj/item/storage/S = new_magazine.loc S.remove_from_storage(new_magazine, get_turf(user), user) - if(!S.auto_catch) + if(!SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine)) user.put_in_any_hand_if_possible(new_magazine) - else - new_magazine.forceMove(get_turf(src)) - SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine) //reload() wont SEND_SIGNAL because revolvers reload without unload() proc reload(new_magazine, user) if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return From 974c15948dc234ea2aebcf0952ab881510dbcfef Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sat, 7 Dec 2024 15:45:29 +0500 Subject: [PATCH 16/20] IconDiff naebka --- code/datums/components/magazine_catcher.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index b3583c6b83f..f555290f101 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -2,7 +2,7 @@ var/mob/living/carbon/human/wearer ///Parent storage in which we want to collect magazines var/obj/item/storage/storage - ///Auto catching empty magazines: FALSE - disabled, TRUE - enabled + ////Auto catching empty magazines: FALSE - disabled, TRUE - enabled var/auto_catch /datum/component/magazine_catcher/Initialize() From 34cf1f3d1a33ce6f75e4ecd384c9186b8191bdfd Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sun, 8 Dec 2024 17:34:15 +0500 Subject: [PATCH 17/20] Fixeki 4 --- code/datums/components/magazine_catcher.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index f555290f101..fc9636b229c 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -3,7 +3,7 @@ ///Parent storage in which we want to collect magazines var/obj/item/storage/storage ////Auto catching empty magazines: FALSE - disabled, TRUE - enabled - var/auto_catch + var/auto_catch = TRUE /datum/component/magazine_catcher/Initialize() . = ..() @@ -22,7 +22,6 @@ RegisterSignals(parent, list(COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED), PROC_REF(removed_from_slot)) storage = parent storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch - auto_catch = TRUE /datum/component/magazine_catcher/UnregisterFromParent() . = ..() From 8b6b6c5199bc16df93cff588d1b86f0780b9aecb Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Sun, 8 Dec 2024 17:37:05 +0500 Subject: [PATCH 18/20] verb to proc --- code/datums/components/magazine_catcher.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index fc9636b229c..aa041ee78ea 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -53,7 +53,7 @@ return FALSE return storage.handle_item_insertion(mag, TRUE) -/datum/component/magazine_catcher/verb/toggle_auto_catch() +/datum/component/magazine_catcher/proc/toggle_auto_catch() set name = "Toggle Auto Catching Magazines/Speed Loaders" set category = "Object" var/datum/component/magazine_catcher/comp = GetComponent(/datum/component/magazine_catcher) From 0b4087b2355f26a8185c644a6ae7bc8659b89ad9 Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Mon, 9 Dec 2024 13:13:55 +0500 Subject: [PATCH 19/20] Fixeki 6 --- code/datums/components/magazine_catcher.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index aa041ee78ea..aa268912077 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -21,12 +21,12 @@ RegisterSignal(parent, COMSIG_ITEM_EQUIPPED_TO_SLOT, PROC_REF(equipped_to_slot)) RegisterSignals(parent, list(COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED), PROC_REF(removed_from_slot)) storage = parent - storage.verbs += /datum/component/magazine_catcher/verb/toggle_auto_catch + storage.verbs += /datum/component/magazine_catcher/proc/toggle_auto_catch /datum/component/magazine_catcher/UnregisterFromParent() . = ..() if(storage) - storage.verbs -= /datum/component/magazine_catcher/verb/toggle_auto_catch + storage.verbs -= /datum/component/magazine_catcher/proc/toggle_auto_catch UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED_TO_SLOT, COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED)) /datum/component/magazine_catcher/proc/equipped_to_slot(datum/source, mob/user, slot) From e834d6b1a9ca8d3e6e365a037701561dfb7111cd Mon Sep 17 00:00:00 2001 From: CheBokJam Date: Mon, 9 Dec 2024 20:04:56 +0500 Subject: [PATCH 20/20] Fixeki 7 --- code/datums/components/magazine_catcher.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index aa268912077..1deb0c9a02f 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -13,7 +13,6 @@ /datum/component/magazine_catcher/Destroy(force, silent) storage = null wearer = null - auto_catch = null return ..() /datum/component/magazine_catcher/RegisterWithParent()