From 61528d07b609b7c1bf5b87f939c84a73c0cf3b9a Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:20:10 +0200 Subject: [PATCH 1/8] Iteration I --- code/modules/mob/inventory.dm | 70 +++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 2ca15e6ca3e..8cf95552b40 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -1,3 +1,6 @@ +//This variable is needed in order to remember the origin of the storage of an item. +GLOBAL_VAR_INIT(quick_equip_memory_item, 0) +GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) //These procs handle putting s tuff in your hands //as they handle all relevant stuff like adding it to the player's screen and updating their overlays. @@ -448,14 +451,75 @@ to_chat(M, span_warning("You are unable to equip that!")) return FALSE - +//--> +// Stupidly complicated smart equip/unequip, what is this supposed to do: +// If the user is empty handed and triggers this function, then unolster an item with priority and with exceptions +// in the following order: +// 1-Armor slot; +// 2-Belt slot; +// 3-Holster contents, return ONLY firearms, all other items will be ignored; +// 4-Boot contents. + +// There's one more twist to this, for example, if the user had previously unsheathed a revolver from a shoulder holster, +// we clearly want the revolver to be re-sheathed in the previous location, this is why there are these new variables: +// quick_equip_memory_item and quick_equip_memory_origin, that keep track of this exact thing. +// If anything is broken, or not working properly, contact me or fix it -leonzrygin +//<-- /mob/verb/quick_equip() set name = "quick-equip" set hidden = 1 - + var/obj/item/I = get_active_held_item() - if (I) + var/obj/item/storage = get_item_by_slot(SLOT_S_STORE) + if(I) + if(I == GLOB.quick_equip_memory_item) //did I unsheathe my item from a holster or my boots? + if(GLOB.quick_equip_memory_origin == "SLOT_NECK") //was it previously coming from my holster? + storage = get_item_by_slot(SLOT_NECK) + GLOB.quick_equip_memory_item = null //hard reset all variables + GLOB.quick_equip_memory_origin = null + SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src) //store this exact item where it was coming from + return + else if(GLOB.quick_equip_memory_origin == "SLOT_SHOES") //was it previously coming from my boots? + storage = get_item_by_slot(SLOT_SHOES) + GLOB.quick_equip_memory_item = null //Hard reset all variables + GLOB.quick_equip_memory_origin = null + SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src) //store this exact item where it was coming from + return + GLOB.quick_equip_memory_item = null //hard reset for both variables, we want to forget the location immediately. + GLOB.quick_equip_memory_origin = null I.equip_to_best_slot(src) + return + else //Are we empty handed? + if(storage) //Are we carrying something in this storage slot? + if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this NOT a storage item? (we don't want to return a pouch or something in our hands, only items that have no storage) + storage.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. + return + storage = get_item_by_slot(SLOT_BELT) + if(storage) //We basically repeat the same checks but for belts + if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) + storage.attack_hand(src) + return + storage = get_item_by_slot(SLOT_NECK) //Are we wearing a holster? If yes, we want to prioritize the unholstering of the gun. + if(storage) //Are we carrying something in this storage slot? + if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this a storage item? + if(storage.contents.len) //there's something to take out. + var/obj/item/gun/firearm + for(var/obj/item/gun/F in storage.contents) //First thing, we want to obviously prioritize the unholstering of the gun. + firearm = F + break + firearm.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. + GLOB.quick_equip_memory_item = firearm + GLOB.quick_equip_memory_origin = "SLOT_NECK" + return + storage = get_item_by_slot(SLOT_SHOES) //Shoes are a little different, we don't want to return the item itself, but rather its contents. + if(storage) //Are we carrying something in this storage slot? + if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this a storage item? + if(storage.contents.len) //there's something to take out. + I = storage.contents[storage.contents.len] //take the item out + I.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. + GLOB.quick_equip_memory_item = I + GLOB.quick_equip_memory_origin = "SLOT_SHOES" + return //used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...) /mob/proc/getBackSlot() From 546ae6dcae76f9c4f14a98b4b37400e026636008 Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:50:27 +0200 Subject: [PATCH 2/8] Iteration II Adding OSHA approved standard issued fool-proof safeties. --- code/modules/keybindings/keybind/human.dm | 5 +---- code/modules/mob/inventory.dm | 25 +++++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/code/modules/keybindings/keybind/human.dm b/code/modules/keybindings/keybind/human.dm index 13c55680f9e..0eda66e9380 100644 --- a/code/modules/keybindings/keybind/human.dm +++ b/code/modules/keybindings/keybind/human.dm @@ -22,9 +22,7 @@ else if(isanimal(user.mob)) var/mob/living/simple_animal/SA = user.mob SA.quick_equip() - -/* /datum/keybinding/human/quick_equipbelt hotkey_keys = list("ShiftE") name = "quick_equipbelt" @@ -39,11 +37,10 @@ /datum/keybinding/human/bag_equip hotkey_keys = list("ShiftB") name = "bag_equip" - full_name = "Bag equip" + full_name = "Quick equip bag" description = "Put held thing in backpack or take out most recent thing from backpack" /datum/keybinding/human/bag_equip/down(client/user) var/mob/living/carbon/human/H = user.mob H.smart_equipbag() return TRUE -*/ diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 8cf95552b40..aaacc06d380 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -453,7 +453,7 @@ GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) //--> // Stupidly complicated smart equip/unequip, what is this supposed to do: -// If the user is empty handed and triggers this function, then unolster an item with priority and with exceptions +// If the user is empty handed and triggers this function, then unholster an item with priority and with exceptions // in the following order: // 1-Armor slot; // 2-Belt slot; @@ -468,21 +468,21 @@ GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) /mob/verb/quick_equip() set name = "quick-equip" set hidden = 1 - + + var/obj/item/storage var/obj/item/I = get_active_held_item() - var/obj/item/storage = get_item_by_slot(SLOT_S_STORE) if(I) if(I == GLOB.quick_equip_memory_item) //did I unsheathe my item from a holster or my boots? if(GLOB.quick_equip_memory_origin == "SLOT_NECK") //was it previously coming from my holster? - storage = get_item_by_slot(SLOT_NECK) GLOB.quick_equip_memory_item = null //hard reset all variables GLOB.quick_equip_memory_origin = null + storage = get_item_by_slot(SLOT_NECK) SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src) //store this exact item where it was coming from return else if(GLOB.quick_equip_memory_origin == "SLOT_SHOES") //was it previously coming from my boots? - storage = get_item_by_slot(SLOT_SHOES) GLOB.quick_equip_memory_item = null //Hard reset all variables GLOB.quick_equip_memory_origin = null + storage = get_item_by_slot(SLOT_SHOES) SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src) //store this exact item where it was coming from return GLOB.quick_equip_memory_item = null //hard reset for both variables, we want to forget the location immediately. @@ -490,6 +490,7 @@ GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) I.equip_to_best_slot(src) return else //Are we empty handed? + storage = get_item_by_slot(SLOT_S_STORE) if(storage) //Are we carrying something in this storage slot? if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this NOT a storage item? (we don't want to return a pouch or something in our hands, only items that have no storage) storage.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. @@ -507,18 +508,20 @@ GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) for(var/obj/item/gun/F in storage.contents) //First thing, we want to obviously prioritize the unholstering of the gun. firearm = F break - firearm.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. - GLOB.quick_equip_memory_item = firearm - GLOB.quick_equip_memory_origin = "SLOT_NECK" + if(firearm && !firearm.on_found(src)) + firearm.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. + GLOB.quick_equip_memory_item = firearm + GLOB.quick_equip_memory_origin = "SLOT_NECK" return storage = get_item_by_slot(SLOT_SHOES) //Shoes are a little different, we don't want to return the item itself, but rather its contents. if(storage) //Are we carrying something in this storage slot? if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this a storage item? if(storage.contents.len) //there's something to take out. I = storage.contents[storage.contents.len] //take the item out - I.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. - GLOB.quick_equip_memory_item = I - GLOB.quick_equip_memory_origin = "SLOT_SHOES" + if(I && !I.on_found(src)) + I.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. + GLOB.quick_equip_memory_item = I + GLOB.quick_equip_memory_origin = "SLOT_SHOES" return //used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...) From f1e036e43062d5edac026dcca1d2a31394cb6c15 Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:13:40 +0200 Subject: [PATCH 3/8] Iteration III --- code/modules/mob/inventory.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index aaacc06d380..ec8f2c5276a 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -492,14 +492,16 @@ GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) else //Are we empty handed? storage = get_item_by_slot(SLOT_S_STORE) if(storage) //Are we carrying something in this storage slot? - if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this NOT a storage item? (we don't want to return a pouch or something in our hands, only items that have no storage) - storage.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. - return + if(!istype(storage, /obj/item/flashlight)) //this is my personal preference, basically it ignores returning flashlights on your hands, why? because it's silly otherwise! + if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this NOT a storage item? (we don't want to return a pouch or something in our hands, only items that have no storage) + storage.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. + return storage = get_item_by_slot(SLOT_BELT) if(storage) //We basically repeat the same checks but for belts - if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) - storage.attack_hand(src) - return + if(!istype(storage, /obj/item/flashlight)) //this is my personal preference, basically it ignores returning flashlights on your hands, why? because it's silly otherwise! + if(!SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) + storage.attack_hand(src) + return storage = get_item_by_slot(SLOT_NECK) //Are we wearing a holster? If yes, we want to prioritize the unholstering of the gun. if(storage) //Are we carrying something in this storage slot? if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this a storage item? From f20e8ebc9f431c7e16b77b296ba7366fa08c4538 Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:18:23 +0200 Subject: [PATCH 4/8] Iteration IV Making shoulder holsters a good primary choice --- code/modules/mob/inventory.dm | 4 ++++ code/modules/projectiles/gun.dm | 2 ++ 2 files changed, 6 insertions(+) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index ec8f2c5276a..bb04a60a2e1 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -1,6 +1,7 @@ //This variable is needed in order to remember the origin of the storage of an item. GLOBAL_VAR_INIT(quick_equip_memory_item, 0) GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) +GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) //These procs handle putting s tuff in your hands //as they handle all relevant stuff like adding it to the player's screen and updating their overlays. @@ -511,9 +512,12 @@ GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) firearm = F break if(firearm && !firearm.on_found(src)) + GLOB.quick_equip_cowboy_delay_negation = 1 firearm.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. GLOB.quick_equip_memory_item = firearm GLOB.quick_equip_memory_origin = "SLOT_NECK" + spawn(1) //it's not needed, but let's wait for the system to actually process the firedelay. + GLOB.quick_equip_cowboy_delay_negation = 0 return storage = get_item_by_slot(SLOT_SHOES) //Shoes are a little different, we don't want to return the item itself, but rather its contents. if(storage) //Are we carrying something in this storage slot? diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index cf0ff89a436..b5e6afb86a2 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -876,6 +876,8 @@ ATTACHMENTS /obj/item/gun/proc/weapondraw(obj/item/gun/G, mob/living/user) // Eventually, this will be /obj/item/weapon and guns will be /obj/item/weapon/gun/etc. SOON.tm user.visible_message(span_danger("[user] grabs \a [G]!")) // probably could code in differences as to where you're picking it up from and so forth. later. var/time_till_gun_is_ready = max(draw_time,(user.AmountWeaponDrawDelay())) + if(GLOB.quick_equip_cowboy_delay_negation) + time_till_gun_is_ready = 0 user.SetWeaponDrawDelay(time_till_gun_is_ready) if(safety && user.a_intent == INTENT_HARM) toggle_safety(user, ignore_held = TRUE) From b66d2cf738477c61390592e35258eb08d3a8ce70 Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Sun, 8 Oct 2023 01:45:43 +0200 Subject: [PATCH 5/8] Iteration V --- code/modules/mob/inventory.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index bb04a60a2e1..133fe55aa14 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -470,8 +470,12 @@ GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) set name = "quick-equip" set hidden = 1 + if(incapacitated()) + return + var/obj/item/storage var/obj/item/I = get_active_held_item() + if(I) if(I == GLOB.quick_equip_memory_item) //did I unsheathe my item from a holster or my boots? if(GLOB.quick_equip_memory_origin == "SLOT_NECK") //was it previously coming from my holster? From 79a1e9338cead222662c982117cf8dbb5c5df22b Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Mon, 9 Oct 2023 22:03:49 +0200 Subject: [PATCH 6/8] Iteration VI Removing the use of 2 variables to make the system more consistent --- code/modules/mob/inventory.dm | 44 +++++++++---------- .../mob/living/carbon/human/inventory.dm | 2 +- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 133fe55aa14..41376cec692 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -1,6 +1,6 @@ //This variable is needed in order to remember the origin of the storage of an item. -GLOBAL_VAR_INIT(quick_equip_memory_item, 0) -GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) +// GLOBAL_VAR_INIT(quick_equip_memory_item, 0) +// GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) //These procs handle putting s tuff in your hands //as they handle all relevant stuff like adding it to the player's screen and updating their overlays. @@ -476,24 +476,26 @@ GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) var/obj/item/storage var/obj/item/I = get_active_held_item() - if(I) - if(I == GLOB.quick_equip_memory_item) //did I unsheathe my item from a holster or my boots? - if(GLOB.quick_equip_memory_origin == "SLOT_NECK") //was it previously coming from my holster? - GLOB.quick_equip_memory_item = null //hard reset all variables - GLOB.quick_equip_memory_origin = null + //obj/item/melee/onehanded + + if(I) //are we holding something in our hands? + storage = get_item_by_slot(SLOT_S_STORE) + if(storage) //if it's empty, put the revolver there (if I'm carrying a pouch there for example) + if(istype(I, /obj/item/gun/ballistic/revolver) || istype(I, /obj/item/gun/ballistic/automatic/pistol)) storage = get_item_by_slot(SLOT_NECK) - SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src) //store this exact item where it was coming from - return - else if(GLOB.quick_equip_memory_origin == "SLOT_SHOES") //was it previously coming from my boots? - GLOB.quick_equip_memory_item = null //Hard reset all variables - GLOB.quick_equip_memory_origin = null - storage = get_item_by_slot(SLOT_SHOES) - SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src) //store this exact item where it was coming from - return - GLOB.quick_equip_memory_item = null //hard reset for both variables, we want to forget the location immediately. - GLOB.quick_equip_memory_origin = null + if(storage) + if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) + if(SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src)) + return + + storage = get_item_by_slot(SLOT_SHOES) + if(istype(I, /obj/item/melee/onehanded/knife)) + if(storage) + if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) + if(SEND_SIGNAL(storage, COMSIG_TRY_STORAGE_INSERT, I, src)) + return I.equip_to_best_slot(src) - return + else //Are we empty handed? storage = get_item_by_slot(SLOT_S_STORE) if(storage) //Are we carrying something in this storage slot? @@ -518,11 +520,9 @@ GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) if(firearm && !firearm.on_found(src)) GLOB.quick_equip_cowboy_delay_negation = 1 firearm.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. - GLOB.quick_equip_memory_item = firearm - GLOB.quick_equip_memory_origin = "SLOT_NECK" spawn(1) //it's not needed, but let's wait for the system to actually process the firedelay. GLOB.quick_equip_cowboy_delay_negation = 0 - return + return storage = get_item_by_slot(SLOT_SHOES) //Shoes are a little different, we don't want to return the item itself, but rather its contents. if(storage) //Are we carrying something in this storage slot? if(SEND_SIGNAL(storage, COMSIG_CONTAINS_STORAGE)) //Is this a storage item? @@ -530,8 +530,6 @@ GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) I = storage.contents[storage.contents.len] //take the item out if(I && !I.on_found(src)) I.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. - GLOB.quick_equip_memory_item = I - GLOB.quick_equip_memory_origin = "SLOT_SHOES" return //used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index ed101a0819f..a01589f6de5 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -325,7 +325,7 @@ stored.attack_hand(src) // take out thing from backpack return -/mob/living/carbon/human/proc/smart_equipbelt() // put held thing in belt or take most recent item out of belt +/mob/living/carbon/human/proc/smart_equipbelt() // put held thing in belt or take most recent item out of belt // if(incapacitated()) return var/obj/item/thing = get_active_held_item() From fa5a7e139ccc6ded7dd0ae8133f0469b523bce0f Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:47:19 +0200 Subject: [PATCH 7/8] Iteration VII Thanks Dan, appreciate the mentoring! --- code/modules/mob/inventory.dm | 8 +------- code/modules/projectiles/gun.dm | 5 ++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 41376cec692..7d3d1ff35f6 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -1,7 +1,3 @@ -//This variable is needed in order to remember the origin of the storage of an item. -// GLOBAL_VAR_INIT(quick_equip_memory_item, 0) -// GLOBAL_VAR_INIT(quick_equip_memory_origin, 0) -GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) //These procs handle putting s tuff in your hands //as they handle all relevant stuff like adding it to the player's screen and updating their overlays. @@ -518,10 +514,8 @@ GLOBAL_VAR_INIT(quick_equip_cowboy_delay_negation, 0) firearm = F break if(firearm && !firearm.on_found(src)) - GLOB.quick_equip_cowboy_delay_negation = 1 + firearm.allow_quickdraw = TRUE firearm.attack_hand(src) //Slap my hands with the contents of this storage, which is allegedly only one item. - spawn(1) //it's not needed, but let's wait for the system to actually process the firedelay. - GLOB.quick_equip_cowboy_delay_negation = 0 return storage = get_item_by_slot(SLOT_SHOES) //Shoes are a little different, we don't want to return the item itself, but rather its contents. if(storage) //Are we carrying something in this storage slot? diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index b5e6afb86a2..b67b2d83319 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -177,6 +177,8 @@ ATTACHMENTS var/use_casing_sounds /// Is one of Kelp's wands? var/is_kelpwand = FALSE + /// Allow quickdraw (delay to draw the gun is 0s) + var/allow_quickdraw = FALSE /// Cooldown between times the gun will tell you it shot, 0.5 seconds cus its not super duper important COOLDOWN_DECLARE(shoot_message_antispam) @@ -876,7 +878,8 @@ ATTACHMENTS /obj/item/gun/proc/weapondraw(obj/item/gun/G, mob/living/user) // Eventually, this will be /obj/item/weapon and guns will be /obj/item/weapon/gun/etc. SOON.tm user.visible_message(span_danger("[user] grabs \a [G]!")) // probably could code in differences as to where you're picking it up from and so forth. later. var/time_till_gun_is_ready = max(draw_time,(user.AmountWeaponDrawDelay())) - if(GLOB.quick_equip_cowboy_delay_negation) + if(allow_quickdraw) + allow_quickdraw = FALSE time_till_gun_is_ready = 0 user.SetWeaponDrawDelay(time_till_gun_is_ready) if(safety && user.a_intent == INTENT_HARM) From 675c0067c7b0848f1bbcde8e15c4df4b5775d893 Mon Sep 17 00:00:00 2001 From: OverDriveZ <64517916+OverDriveZ@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:54:58 +0200 Subject: [PATCH 8/8] Iteration VII - bis Updating the comments, forgot --- code/modules/mob/inventory.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 7d3d1ff35f6..6dca30ca537 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -458,8 +458,7 @@ // 4-Boot contents. // There's one more twist to this, for example, if the user had previously unsheathed a revolver from a shoulder holster, -// we clearly want the revolver to be re-sheathed in the previous location, this is why there are these new variables: -// quick_equip_memory_item and quick_equip_memory_origin, that keep track of this exact thing. +// we clearly want the revolver to be re-sheathed in the previous location. // If anything is broken, or not working properly, contact me or fix it -leonzrygin //<-- /mob/verb/quick_equip()