From 37ba5dbb8e7b899e6330965a4e058df44d6cdbad Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Sat, 10 Aug 2024 20:19:51 -0500 Subject: [PATCH 1/5] manual cocking Seriously, why IS it called cocking the gun? --- code/modules/projectiles/gun.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 70b0ad3b41..25b6d5bf55 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -48,7 +48,7 @@ ///world.time value, to prevent COCK COCK COCK COCK var/cock_cooldown = 0 ///Delay before we can cock again, in tenths of seconds - var/cock_delay = 30 + var/cock_delay = 5 /**How the bullet will behave once it leaves the gun, also used for basic bullet damage and effects, etc. Ammo will be replaced on New() for things that do not use mags.**/ @@ -855,9 +855,9 @@ User can be passed as null, (a gun reloading itself for instance), so we need to user.drop_inv_item_to_loc(magazine, src) //Click! current_mag = magazine replace_ammo(user,magazine) - if(!in_chamber) + /*if(!in_chamber) ready_in_chamber() - cock_gun(user) + cock_gun(user)*/ user.visible_message(SPAN_NOTICE("[user] loads [magazine] into [src]!"), SPAN_NOTICE("You load [magazine] into [src]!"), null, 3, CHAT_TYPE_COMBAT_ACTION) if(reload_sound) @@ -1075,7 +1075,9 @@ and you're good to go. /obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, params, reflex = FALSE, dual_wield) set waitfor = FALSE - + if(!in_chamber) + click_empty(user) + return if(!able_to_fire(user) || !target || !get_turf(user) || !get_turf(target)) return NONE From 71b01e8d955b2d7de51603674d4366e2d4a89b43 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Sat, 10 Aug 2024 21:09:59 -0500 Subject: [PATCH 2/5] fix PBs --- code/modules/projectiles/gun.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 25b6d5bf55..aa0a373591 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1299,6 +1299,9 @@ and you're good to go. if(active_attachable && !(active_attachable.flags_attach_features & ATTACH_PROJECTILE)) active_attachable.activate_attachment(src, null, TRUE)//We're not firing off a nade into our mouth. + if(!in_chamber) //did you even cock it? + click_empty(user) + return var/obj/projectile/projectile_to_fire = load_into_chamber(user) if(projectile_to_fire) //We actually have a projectile, let's move on. user.visible_message(SPAN_WARNING("[user] pulls the trigger!")) @@ -1354,6 +1357,9 @@ and you're good to go. flags_gun_features ^= GUN_CAN_POINTBLANK //Reset this. return TRUE + if(!in_chamber) //did you even cock it? + click_empty(user) + return if(EXECUTION_CHECK) //Execution if(!able_to_fire(user)) //Can they actually use guns in the first place? From 205c3ae6394708813c99b70cd33eab3b9513b263 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Sun, 11 Aug 2024 01:09:56 -0500 Subject: [PATCH 3/5] should probably click AFTER the do_after --- code/modules/projectiles/gun.dm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index aa0a373591..e4c27831a8 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1357,9 +1357,7 @@ and you're good to go. flags_gun_features ^= GUN_CAN_POINTBLANK //Reset this. return TRUE - if(!in_chamber) //did you even cock it? - click_empty(user) - return + if(EXECUTION_CHECK) //Execution if(!able_to_fire(user)) //Can they actually use guns in the first place? @@ -1367,12 +1365,19 @@ and you're good to go. user.visible_message(SPAN_DANGER("[user] puts [src] up to [attacked_mob], steadying their aim."), SPAN_WARNING("You put [src] up to [attacked_mob], steadying your aim."),null, null, CHAT_TYPE_COMBAT_ACTION) if(!do_after(user, 3 SECONDS, INTERRUPT_ALL|INTERRUPT_DIFF_INTENT, BUSY_ICON_HOSTILE)) return TRUE + if(!in_chamber) //did you even cock it? + click_empty(user) + return else if(user.a_intent != INTENT_HARM) //Thwack them return ..() if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_ATTACK_DEAD) && attacked_mob.stat == DEAD) // don't shoot dead people return afterattack(attacked_mob, user, TRUE) + if(!in_chamber) //did you even cock it? + click_empty(user) + return + user.next_move = world.time //No click delay on PBs. //Point blanking doesn't actually fire the projectile. Instead, it simulates firing the bullet proper. From a55bd1f8b17ec60bd32a74e5aa087df7287865a3 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Sun, 11 Aug 2024 14:58:02 -0500 Subject: [PATCH 4/5] other guns should probably be able to work too --- code/modules/projectiles/gun.dm | 14 ++++++++------ code/modules/projectiles/guns/flare_gun.dm | 1 + code/modules/projectiles/guns/revolvers.dm | 1 + code/modules/projectiles/guns/smartgun.dm | 1 + .../guns/specialist/launcher/launcher.dm | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index e4c27831a8..1d11225d84 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -49,6 +49,8 @@ var/cock_cooldown = 0 ///Delay before we can cock again, in tenths of seconds var/cock_delay = 5 + //it's a lot easier to give things a var than throw the code in everywhere + var/special_chamber = FALSE /**How the bullet will behave once it leaves the gun, also used for basic bullet damage and effects, etc. Ammo will be replaced on New() for things that do not use mags.**/ @@ -855,9 +857,9 @@ User can be passed as null, (a gun reloading itself for instance), so we need to user.drop_inv_item_to_loc(magazine, src) //Click! current_mag = magazine replace_ammo(user,magazine) - /*if(!in_chamber) + if(!in_chamber&&special_chamber) ready_in_chamber() - cock_gun(user)*/ + cock_gun(user) user.visible_message(SPAN_NOTICE("[user] loads [magazine] into [src]!"), SPAN_NOTICE("You load [magazine] into [src]!"), null, 3, CHAT_TYPE_COMBAT_ACTION) if(reload_sound) @@ -1075,7 +1077,7 @@ and you're good to go. /obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, params, reflex = FALSE, dual_wield) set waitfor = FALSE - if(!in_chamber) + if(!in_chamber&&!special_chamber) click_empty(user) return if(!able_to_fire(user) || !target || !get_turf(user) || !get_turf(target)) @@ -1299,7 +1301,7 @@ and you're good to go. if(active_attachable && !(active_attachable.flags_attach_features & ATTACH_PROJECTILE)) active_attachable.activate_attachment(src, null, TRUE)//We're not firing off a nade into our mouth. - if(!in_chamber) //did you even cock it? + if(!in_chamber&&!special_chamber) //did you even cock it? click_empty(user) return var/obj/projectile/projectile_to_fire = load_into_chamber(user) @@ -1365,7 +1367,7 @@ and you're good to go. user.visible_message(SPAN_DANGER("[user] puts [src] up to [attacked_mob], steadying their aim."), SPAN_WARNING("You put [src] up to [attacked_mob], steadying your aim."),null, null, CHAT_TYPE_COMBAT_ACTION) if(!do_after(user, 3 SECONDS, INTERRUPT_ALL|INTERRUPT_DIFF_INTENT, BUSY_ICON_HOSTILE)) return TRUE - if(!in_chamber) //did you even cock it? + if(!in_chamber&&!special_chamber) //did you even cock it? click_empty(user) return else if(user.a_intent != INTENT_HARM) //Thwack them @@ -1374,7 +1376,7 @@ and you're good to go. if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_ATTACK_DEAD) && attacked_mob.stat == DEAD) // don't shoot dead people return afterattack(attacked_mob, user, TRUE) - if(!in_chamber) //did you even cock it? + if(!in_chamber&&!special_chamber) //did you even cock it? click_empty(user) return diff --git a/code/modules/projectiles/guns/flare_gun.dm b/code/modules/projectiles/guns/flare_gun.dm index 407ecdf000..156f3ddf95 100644 --- a/code/modules/projectiles/guns/flare_gun.dm +++ b/code/modules/projectiles/guns/flare_gun.dm @@ -13,6 +13,7 @@ flags_gun_features = GUN_INTERNAL_MAG|GUN_CAN_POINTBLANK gun_category = GUN_CATEGORY_HANDGUN attachable_allowed = list(/obj/item/attachable/scope/mini/flaregun) + special_chamber = TRUE var/last_signal_flare_name diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 76e3e07106..6518cabe8b 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -25,6 +25,7 @@ has_empty_icon = FALSE has_open_icon = TRUE current_mag = /obj/item/ammo_magazine/internal/revolver + special_chamber = TRUE /obj/item/weapon/gun/revolver/Initialize(mapload, spawn_empty) . = ..() diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index dca1410900..9c1d37fc30 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -65,6 +65,7 @@ auto_retrieval_slot = WEAR_J_STORE start_semiauto = FALSE start_automatic = TRUE + special_chamber = TRUE /obj/item/weapon/gun/smartgun/Initialize(mapload, ...) diff --git a/code/modules/projectiles/guns/specialist/launcher/launcher.dm b/code/modules/projectiles/guns/specialist/launcher/launcher.dm index d0731b2d43..4c321eb296 100644 --- a/code/modules/projectiles/guns/specialist/launcher/launcher.dm +++ b/code/modules/projectiles/guns/specialist/launcher/launcher.dm @@ -5,6 +5,7 @@ gun_category = GUN_CATEGORY_HEAVY has_empty_icon = FALSE has_open_icon = FALSE + special_chamber = TRUE ///gun update_icon doesn't detect that guns with no magazine are loaded or not, and will always append _o or _e if possible. var/GL_has_empty_icon = TRUE ///gun update_icon doesn't detect that guns with no magazine are loaded or not, and will always append _o or _e if possible. From 79be17c233793c43e8c5c516b303d800a7b8ebbe Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:19:11 -0500 Subject: [PATCH 5/5] Update rifles.dm --- code/modules/projectiles/guns/rifles.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/projectiles/guns/rifles.dm b/code/modules/projectiles/guns/rifles.dm index 48918ef2ee..436e716964 100644 --- a/code/modules/projectiles/guns/rifles.dm +++ b/code/modules/projectiles/guns/rifles.dm @@ -44,6 +44,7 @@ fire_sound = "gun_pulse" reload_sound = 'sound/weapons/handling/m41_reload.ogg' unload_sound = 'sound/weapons/handling/m41_unload.ogg' + special_chamber = TRUE current_mag = /obj/item/ammo_magazine/rifle attachable_allowed = list( /obj/item/attachable/suppressor, @@ -120,6 +121,7 @@ reload_sound = 'sound/weapons/handling/nsg23_reload.ogg' unload_sound = 'sound/weapons/handling/nsg23_unload.ogg' cocked_sound = 'sound/weapons/handling/nsg23_cocked.ogg' + special_chamber = TRUE aim_slowdown = SLOWDOWN_ADS_QUICK wield_delay = WIELD_DELAY_VERY_FAST current_mag = /obj/item/ammo_magazine/rifle/nsg23 @@ -291,6 +293,7 @@ item_state = "m40sd" reload_sound = 'sound/weapons/handling/m40sd_reload.ogg' unload_sound = 'sound/weapons/handling/m40sd_unload.ogg' + special_chamber = FALSE //because FUCK you unacidable = TRUE indestructible = TRUE @@ -371,6 +374,7 @@ fire_sound = "gun_pulse" reload_sound = 'sound/weapons/handling/m41_reload.ogg' unload_sound = 'sound/weapons/handling/m41_unload.ogg' + special_chamber = TRUE current_mag = /obj/item/ammo_magazine/rifle/m41aMK1 attachable_allowed = list( /obj/item/attachable/suppressor, @@ -448,6 +452,7 @@ fire_sound = "gun_pulse" reload_sound = 'sound/weapons/handling/m41_reload.ogg' unload_sound = 'sound/weapons/handling/m41_unload.ogg' + special_chamber = TRUE current_mag = /obj/item/ammo_magazine/rifle/incendiary accepted_ammo = list( @@ -1238,6 +1243,7 @@ reload_sound = 'sound/weapons/handling/hpr_reload.ogg' unload_sound = 'sound/weapons/handling/hpr_unload.ogg' + special_chamber = TRUE fire_sound = 'sound/weapons/gun_hpr.ogg' aim_slowdown = SLOWDOWN_ADS_LMG current_mag = /obj/item/ammo_magazine/rifle/lmg @@ -1296,6 +1302,7 @@ fire_sound = 'sound/weapons/gun_type71.ogg' reload_sound = 'sound/weapons/handling/m41_reload.ogg' unload_sound = 'sound/weapons/handling/m41_unload.ogg' + special_chamber = TRUE current_mag = /obj/item/ammo_magazine/rifle/type71 wield_delay = WIELD_DELAY_FAST attachable_allowed = list( @@ -1555,6 +1562,7 @@ fire_sound = 'sound/weapons/gun_m4ra.ogg' reload_sound = 'sound/weapons/handling/l42_reload.ogg' unload_sound = 'sound/weapons/handling/l42_unload.ogg' + special_chamber = TRUE current_mag = /obj/item/ammo_magazine/rifle/m4ra attachable_allowed = list( /obj/item/attachable/suppressor,