diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 70b0ad3b41..1d11225d84 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -48,7 +48,9 @@ ///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 + //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,7 +857,7 @@ 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) user.visible_message(SPAN_NOTICE("[user] loads [magazine] into [src]!"), @@ -1075,7 +1077,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&&!special_chamber) + click_empty(user) + return if(!able_to_fire(user) || !target || !get_turf(user) || !get_turf(target)) return NONE @@ -1297,6 +1301,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&&!special_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!")) @@ -1353,18 +1360,26 @@ and you're good to go. flags_gun_features ^= GUN_CAN_POINTBLANK //Reset this. return TRUE + if(EXECUTION_CHECK) //Execution if(!able_to_fire(user)) //Can they actually use guns in the first place? return ..() 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&&!special_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&&!special_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. 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/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, 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.