From 3403ebc2b47c1976a6d2db7ebdd46e62671af8e4 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Tue, 4 Feb 2025 21:25:37 -0500 Subject: [PATCH 01/21] Guns can jam now. That was easy enough, time for the hard part. --- code/modules/projectiles/guns/ballistic.dm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index ac9567a72e50..a1b4c261c0d6 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -119,10 +119,18 @@ chambered = null else if(empty_chamber) chambered = null - if (chamber_next_round && (magazine?.max_ammo > 1)) + if (chamber_next_round && (magazine?.max_ammo > 1) && !condition_check(from_firing)) chamber_round() SEND_SIGNAL(src, COMSIG_GUN_CHAMBER_PROCESSED) +/// Handles weapon condition. Returning TRUE prevents process_chamber from automatically loading a new round +/obj/item/gun/ballistic/proc/condition_check(from_firing = TRUE) + if(bolt_type == BOLT_TYPE_NO_BOLT || !from_firing) //The revolver is one of the most reliable firearm designs in the universe, and you of course need no more than 6 bullets for any purpose. + return FALSE + if(prob(100)) //PLACEHOLDER + bolt_locked = TRUE //*click* + return TRUE + ///Used to chamber a new round and eject the old one /obj/item/gun/ballistic/proc/chamber_round(keep_bullet = FALSE) if (chambered || !magazine) From ba94020c07d42ab30affe568755ee6662ebb82d8 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Sat, 8 Feb 2025 23:30:01 -0500 Subject: [PATCH 02/21] Initial design for jamming, guns now jam. sometimes. --- .../projectiles/ammunition/_ammo_casing.dm | 2 ++ .../modules/projectiles/ammunition/_firing.dm | 3 +++ .../ammunition/ballistic/pistol.dm | 3 +++ .../ammunition/ballistic/revolver.dm | 1 + .../projectiles/ammunition/ballistic/smg.dm | 2 ++ code/modules/projectiles/guns/ballistic.dm | 26 ++++++++++++++++++- 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/ammunition/_ammo_casing.dm b/code/modules/projectiles/ammunition/_ammo_casing.dm index 5edadbca9567..6e739f9056ee 100644 --- a/code/modules/projectiles/ammunition/_ammo_casing.dm +++ b/code/modules/projectiles/ammunition/_ammo_casing.dm @@ -44,6 +44,8 @@ var/click_cooldown_override = 0 ///If true, overrides the bouncing sfx from the turf to this one var/list/bounce_sfx_override + ///Multiplier for weapon gun_wear + var/wear_modifier = 1 ///What this casing can be stacked into. var/obj/item/ammo_box/magazine/stack_type = /obj/item/ammo_box/magazine/ammo_stack diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm index 5ed202107770..08778591fde1 100644 --- a/code/modules/projectiles/ammunition/_firing.dm +++ b/code/modules/projectiles/ammunition/_firing.dm @@ -20,6 +20,9 @@ user.changeNext_move(click_cooldown_override) user.newtonian_move(get_dir(target, user)) + var/obj/item/gun/ballistic/foulmouth = fired_from + if(istype(foulmouth)) + foulmouth.gun_wear = clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 100) update_appearance() return TRUE diff --git a/code/modules/projectiles/ammunition/ballistic/pistol.dm b/code/modules/projectiles/ammunition/ballistic/pistol.dm index fd13eca2e3e5..08e59a74e016 100644 --- a/code/modules/projectiles/ammunition/ballistic/pistol.dm +++ b/code/modules/projectiles/ammunition/ballistic/pistol.dm @@ -12,6 +12,7 @@ desc = "A 10mm surplus bullet casing." bullet_skin = "surplus" projectile_type = /obj/projectile/bullet/c10mm/surplus + wear_modifier = 2 /obj/item/ammo_casing/c10mm/ap name = "10mm armor-piercing bullet casing" @@ -46,6 +47,7 @@ desc = "A 9mm surplus bullet casing." bullet_skin = "surplus" projectile_type = /obj/projectile/bullet/c9mm/surplus + wear_modifier = 2 /obj/item/ammo_casing/c9mm/ap name = "9mm armor-piercing bullet casing" @@ -80,6 +82,7 @@ desc = "A .45 surplus bullet casing." bullet_skin = "surplus" projectile_type = /obj/projectile/bullet/c45/surplus + wear_modifier = 2 /obj/item/ammo_casing/c45/ap name = ".45 armor-piercing bullet casing" diff --git a/code/modules/projectiles/ammunition/ballistic/revolver.dm b/code/modules/projectiles/ammunition/ballistic/revolver.dm index 60c3722b934a..c5710f7a1a74 100644 --- a/code/modules/projectiles/ammunition/ballistic/revolver.dm +++ b/code/modules/projectiles/ammunition/ballistic/revolver.dm @@ -59,6 +59,7 @@ name = ".38 surplus bullet casing" desc = "A .38 surplus bullet casing." projectile_type = /obj/projectile/bullet/c38/surplus + wear_modifier = 2 /obj/item/ammo_casing/c38/trac name = ".38 TRAC bullet casing" diff --git a/code/modules/projectiles/ammunition/ballistic/smg.dm b/code/modules/projectiles/ammunition/ballistic/smg.dm index e949b475e58c..6457a0b11dc4 100644 --- a/code/modules/projectiles/ammunition/ballistic/smg.dm +++ b/code/modules/projectiles/ammunition/ballistic/smg.dm @@ -42,6 +42,7 @@ caliber = "4.6x30mm" projectile_type = /obj/projectile/bullet/c46x30mm/recycled stack_size = 15 + wear_modifier = 2 /obj/item/ammo_casing/c46x30mm/ap name = "4.6x30mm armor-piercing bullet casing" @@ -83,6 +84,7 @@ name = "5.56mm HITP caseless surplus round" desc = "A 5.56mm HITP caseless surplus round." projectile_type = /obj/projectile/bullet/c556mm/surplus + wear_modifier = 2 /obj/item/ammo_casing/caseless/c556mm/ap name = "5.56mm HITP caseless armor-piercing round" diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index a1b4c261c0d6..6d2dd8d6e31f 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -8,6 +8,11 @@ spawn_no_ammo = TRUE; \ } + +#define JAM_CHANCE_MINOR 10 +#define JAM_GRACE_MINOR 6 +#define JAM_CHANCE_MAJOR 20 + ///Subtype for any kind of ballistic gun ///This has a shitload of vars on it, and I'm sorry for that, but it does make making new subtypes really easy /obj/item/gun/ballistic @@ -18,6 +23,16 @@ safety = TRUE // when we load the gun, should it instantly chamber the next round? var/always_chambers = FALSE + /// How utterly fucked the gun is. High gun_wear can cause failure to cycle rounds in some guns + var/gun_wear = 0 + /// How much gun_wear is generated when we shoot. Increased when using surplus rounds + var/wear_rate = 1 + /// Number of times we have successfully fired since the last time the the gun has jammed. Low but not abysmal condition will only jam so often. + var/last_jam = 0 + /// Gun will start to jam at this % of condition + var/wear_minor_threshold = 50 + /// Gun will start to jam A LOT at this condition + var/wear_major_threshold = 70 min_recoil = 0.1 @@ -127,9 +142,18 @@ /obj/item/gun/ballistic/proc/condition_check(from_firing = TRUE) if(bolt_type == BOLT_TYPE_NO_BOLT || !from_firing) //The revolver is one of the most reliable firearm designs in the universe, and you of course need no more than 6 bullets for any purpose. return FALSE - if(prob(100)) //PLACEHOLDER + if(gun_wear < wear_minor_threshold) + say("Jam roll failed due to high condition, new last_jam of [last_jam]") + return FALSE + say("Rolling jam attempt with [gun_wear]% damage") + if(gun_wear >= wear_major_threshold ? prob(JAM_CHANCE_MAJOR) : prob(JAM_CHANCE_MINOR) && last_jam >= JAM_GRACE_MINOR) //PLACEHOLDER bolt_locked = TRUE //*click* + last_jam = 0 // sighs and erases number on whiteboard + say("Jam roll succeeded") return TRUE + last_jam++ + say("Jam roll failed, new last_jam of [last_jam]") + ///Used to chamber a new round and eject the old one /obj/item/gun/ballistic/proc/chamber_round(keep_bullet = FALSE) From cb0dfccbc13b95f1e08e1cb6f1b4b7ba69769394 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Sun, 9 Feb 2025 00:01:48 -0500 Subject: [PATCH 03/21] desc work and better numbers --- .../modules/projectiles/ammunition/_firing.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm index 08778591fde1..59e66a010324 100644 --- a/code/modules/projectiles/ammunition/_firing.dm +++ b/code/modules/projectiles/ammunition/_firing.dm @@ -22,7 +22,7 @@ user.newtonian_move(get_dir(target, user)) var/obj/item/gun/ballistic/foulmouth = fired_from if(istype(foulmouth)) - foulmouth.gun_wear = clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 100) + foulmouth.gun_wear = round(clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 100), 0.1) update_appearance() return TRUE diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 6d2dd8d6e31f..7336e3fc8b90 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -29,10 +29,10 @@ var/wear_rate = 1 /// Number of times we have successfully fired since the last time the the gun has jammed. Low but not abysmal condition will only jam so often. var/last_jam = 0 - /// Gun will start to jam at this % of condition - var/wear_minor_threshold = 50 - /// Gun will start to jam A LOT at this condition - var/wear_major_threshold = 70 + /// Gun will start to jam at this level of wear + var/wear_minor_threshold = 60 + /// Gun will start to jam more at this level of wear. The grace period between jams is also removed, here, so it's worse than it looks + var/wear_major_threshold = 80 min_recoil = 0.1 @@ -372,6 +372,20 @@ . = ..() var/count_chambered = !(bolt_type == BOLT_TYPE_NO_BOLT || bolt_type == BOLT_TYPE_OPEN) . += "It has [get_ammo(count_chambered)] round\s remaining." + if(bolt_type != BOLT_TYPE_NO_BOLT) + var/conditionstr = span_red("abysmal dogshit") + switch(gun_wear) + if(0 to 19.9) + conditionstr = span_nicegreen("pristine") + if(20 to 39.9) + conditionstr = span_green("good") + if(40 to 59.9) + conditionstr = "decent" + if(60 to 79.9) + conditionstr = span_red("poor") + if(80 to 100) + conditionstr = span_warning("terrible") + . += "it is in [conditionstr] condition[gun_wear >= wear_minor_threshold ? gun_wear >= wear_major_threshold ? " and will suffer constant malfunctions" : " and will suffer from regular malfunctions" :""]." if (!chambered) . += "It does not seem to have a round chambered." if (bolt_locked) From f0dbf71b64d3b1abacaa6dae99d5af3ab222969d Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Sat, 15 Feb 2025 12:07:28 -0500 Subject: [PATCH 04/21] initial generic values & repair kit framework --- code/game/objects/items/gunrepairkit.dm | 39 +++++++++++++++ .../modules/projectiles/ammunition/_firing.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 49 +++++++++---------- .../projectiles/guns/ballistic/assault.dm | 1 + .../projectiles/guns/ballistic/automatic.dm | 2 + .../projectiles/guns/ballistic/gauss.dm | 1 + .../modules/projectiles/guns/ballistic/hmg.dm | 1 + .../projectiles/guns/ballistic/marksman.dm | 1 + .../projectiles/guns/ballistic/rifle.dm | 1 + .../projectiles/guns/ballistic/shotgun.dm | 1 + .../modules/projectiles/guns/ballistic/smg.dm | 1 + .../modules/projectiles/guns/ballistic/toy.dm | 2 + .../frontier_import/ballistics.dm | 1 + .../manufacturer/hunter_pride/ballistics.dm | 4 ++ shiptest.dme | 1 + 15 files changed, 81 insertions(+), 26 deletions(-) create mode 100644 code/game/objects/items/gunrepairkit.dm diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm new file mode 100644 index 000000000000..98c9c2de14b2 --- /dev/null +++ b/code/game/objects/items/gunrepairkit.dm @@ -0,0 +1,39 @@ +/obj/item/gun_fixer + name = "firearm maintenance kit" + desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Several chemicals required for a full cleaning process result in each kit being single-use." + w_class = WEIGHT_CLASS_BULKY //no carrying these around, sorry :( + /// How much wear will this clean from a gun? + var/wear_reduction = 60 + /// Number of times this gun fixer can be used + var/uses = 1 + +/obj/item/gun_fixer/afterattack(atom/target, mob/user, proximity) + if(!proximity) + return + var/obj/item/gun/ballistic/fixable = target + if(!istype(fixable)) + return + fixable.add_overlay(GLOB.cleaning_bubbles) + playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) + user.visible_message("[user] starts to wipe down [fixable] with [src]!", "You start to wipe down [fixable] with [src]...") + if(do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) + fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 200) + uses-- + +/// Remember: you can always trust a loaded gun to go off at least once. +/obj/item/gun_fixer/proc/accidents_happen(obj/item/gun/ballistic/whoops, mob/darwin) + . = TRUE + if(!whoops.magazine) + return + if(whoops.internal_magazine && !whoops.magazine.ammo_count(TRUE)) + return + if(prob(1)) //this gets called I think once per decisecond so we don't really want a high chance here. its like firing the force of nature and expecting it to not explode + if(whoops.safety) + whoops.safety = FALSE + if(prob(50)) //you got lucky. THIS time. + return + if(!whoops.chambered) + whoops.chamber_round() + if(prob(50)) + return + whoops.unsafe_shot(darwin) diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm index 59e66a010324..d4e5981677b7 100644 --- a/code/modules/projectiles/ammunition/_firing.dm +++ b/code/modules/projectiles/ammunition/_firing.dm @@ -22,7 +22,7 @@ user.newtonian_move(get_dir(target, user)) var/obj/item/gun/ballistic/foulmouth = fired_from if(istype(foulmouth)) - foulmouth.gun_wear = round(clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 100), 0.1) + foulmouth.gun_wear = round(clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 300), 0.1) update_appearance() return TRUE diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 7336e3fc8b90..722784b3ad5b 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -10,7 +10,7 @@ #define JAM_CHANCE_MINOR 10 -#define JAM_GRACE_MINOR 6 +#define JAM_GRACE_MINOR 4 #define JAM_CHANCE_MAJOR 20 ///Subtype for any kind of ballistic gun @@ -30,9 +30,9 @@ /// Number of times we have successfully fired since the last time the the gun has jammed. Low but not abysmal condition will only jam so often. var/last_jam = 0 /// Gun will start to jam at this level of wear - var/wear_minor_threshold = 60 - /// Gun will start to jam more at this level of wear. The grace period between jams is also removed, here, so it's worse than it looks - var/wear_major_threshold = 80 + var/wear_minor_threshold = 80 + /// Gun will start to jam more at this level of wear. The grace period between jams is also removed, so it's worse than it looks + var/wear_major_threshold = 130 min_recoil = 0.1 @@ -140,19 +140,20 @@ /// Handles weapon condition. Returning TRUE prevents process_chamber from automatically loading a new round /obj/item/gun/ballistic/proc/condition_check(from_firing = TRUE) - if(bolt_type == BOLT_TYPE_NO_BOLT || !from_firing) //The revolver is one of the most reliable firearm designs in the universe, and you of course need no more than 6 bullets for any purpose. + if(bolt_type == BOLT_TYPE_NO_BOLT || !from_firing || !magazine.ammo_count(FALSE)) //The revolver is one of the most reliable firearms ever designed, as long as you don't need to fire any more than six bullets at something. Which you, of course, do not. return FALSE + last_jam++ if(gun_wear < wear_minor_threshold) - say("Jam roll failed due to high condition, new last_jam of [last_jam]") + //say("Jam roll failed due to high condition, new last_jam of [last_jam]") return FALSE - say("Rolling jam attempt with [gun_wear]% damage") - if(gun_wear >= wear_major_threshold ? prob(JAM_CHANCE_MAJOR) : prob(JAM_CHANCE_MINOR) && last_jam >= JAM_GRACE_MINOR) //PLACEHOLDER + //say("Rolling jam attempt with [gun_wear]% damage") + if(gun_wear >= wear_major_threshold ? prob(JAM_CHANCE_MAJOR) : prob(JAM_CHANCE_MINOR) && last_jam >= JAM_GRACE_MINOR) //PLACEHOLDER //LESS PLACEHOLDER NOW bolt_locked = TRUE //*click* last_jam = 0 // sighs and erases number on whiteboard - say("Jam roll succeeded") + playsound(src, 'sound/weapons/gun/general/dry_fire_old.ogg', 50, TRUE, -15) //click. uhoh. + //say("Jam roll succeeded") return TRUE - last_jam++ - say("Jam roll failed, new last_jam of [last_jam]") + //say("Jam roll failed, new last_jam of [last_jam]") ///Used to chamber a new round and eject the old one @@ -372,26 +373,24 @@ . = ..() var/count_chambered = !(bolt_type == BOLT_TYPE_NO_BOLT || bolt_type == BOLT_TYPE_OPEN) . += "It has [get_ammo(count_chambered)] round\s remaining." - if(bolt_type != BOLT_TYPE_NO_BOLT) - var/conditionstr = span_red("abysmal dogshit") - switch(gun_wear) - if(0 to 19.9) - conditionstr = span_nicegreen("pristine") - if(20 to 39.9) - conditionstr = span_green("good") - if(40 to 59.9) - conditionstr = "decent" - if(60 to 79.9) - conditionstr = span_red("poor") - if(80 to 100) - conditionstr = span_warning("terrible") - . += "it is in [conditionstr] condition[gun_wear >= wear_minor_threshold ? gun_wear >= wear_major_threshold ? " and will suffer constant malfunctions" : " and will suffer from regular malfunctions" :""]." if (!chambered) . += "It does not seem to have a round chambered." if (bolt_locked) . += "The [bolt_wording] is locked back and needs to be released before firing." if(bolt_type != BOLT_TYPE_NO_BOLT) . += "You can [bolt_wording] [src] by pressing the unique action key. By default, this is space" + var/conditionstr = span_boldwarning("critical") + var/minorhalf = wear_minor_threshold / 2 + var/majorhalf = wear_minor_threshold + (wear_major_threshold-wear_minor_threshold) / 2 + if(gun_wear <= minorhalf) + conditionstr = span_green("good") + else if(gun_wear <= wear_minor_threshold) + conditionstr = span_nicegreen("decent") //nicegreen is less neon than green so it looks less :))) + else if(gun_wear <= majorhalf) + conditionstr = span_red("poor") + else if(gun_wear <= wear_major_threshold) //TTD: switch doesn't play nice with variables but this sucks + conditionstr = span_warning("terrible") + . += "it is in [conditionstr] condition[gun_wear >= wear_minor_threshold ? gun_wear >= wear_major_threshold ? " and will suffer constant malfunctions" : " and will suffer from regular malfunctions" :""]." ///Gets the number of bullets in the gun /obj/item/gun/ballistic/proc/get_ammo(countchambered = TRUE) diff --git a/code/modules/projectiles/guns/ballistic/assault.dm b/code/modules/projectiles/guns/ballistic/assault.dm index 55c67c633d39..51806056d475 100644 --- a/code/modules/projectiles/guns/ballistic/assault.dm +++ b/code/modules/projectiles/guns/ballistic/assault.dm @@ -24,6 +24,7 @@ gunslinger_spread_bonus = 16 light_range = 2 + wear_rate = 0.4 // TTD BALANCE THESE /obj/item/gun/ballistic/automatic/assault/skm name = "\improper SKM-24" diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index fd893e432f30..6502a3f9f083 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -20,6 +20,7 @@ recoil = 0 recoil_unwielded = 4 wield_slowdown = PDW_SLOWDOWN + wear_rate = 0.3 //TTD BALANCE THESE /obj/item/gun/ballistic/automatic/zip_pistol name = "makeshift pistol" @@ -33,3 +34,4 @@ actions_types = list() show_magazine_on_sprite = TRUE weapon_weight = WEAPON_LIGHT + wear_rate = 0.8 //TTD BALANCE THESE //it's a. piece of shit. diff --git a/code/modules/projectiles/guns/ballistic/gauss.dm b/code/modules/projectiles/guns/ballistic/gauss.dm index 0b4319d5be8a..f91d54d9e298 100644 --- a/code/modules/projectiles/guns/ballistic/gauss.dm +++ b/code/modules/projectiles/guns/ballistic/gauss.dm @@ -32,3 +32,4 @@ wield_slowdown = HEAVY_RIFLE_SLOWDOWN wield_delay = 1 SECONDS fire_select_icon_state_prefix = "pellet_" + wear_rate = 0.1 //TTD BALANCE THESE diff --git a/code/modules/projectiles/guns/ballistic/hmg.dm b/code/modules/projectiles/guns/ballistic/hmg.dm index 1c318164ee76..8c6c89139f13 100644 --- a/code/modules/projectiles/guns/ballistic/hmg.dm +++ b/code/modules/projectiles/guns/ballistic/hmg.dm @@ -41,6 +41,7 @@ /obj/structure/railing, /obj/structure/flippedtable ) + wear_rate = 0.4 //TTD BALANCE THESE /obj/item/gun/ballistic/automatic/hmg/Initialize() diff --git a/code/modules/projectiles/guns/ballistic/marksman.dm b/code/modules/projectiles/guns/ballistic/marksman.dm index 557ccc5ca21b..c97277493ed1 100644 --- a/code/modules/projectiles/guns/ballistic/marksman.dm +++ b/code/modules/projectiles/guns/ballistic/marksman.dm @@ -11,3 +11,4 @@ min_recoil = 0.1 light_range = 2 + wear_rate = 0.6 //TTD BALANCE THESE diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index 819c32b888c1..7d42558b73c9 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -36,6 +36,7 @@ recoil_unwielded = 4 wield_slowdown = RIFLE_SLOWDOWN wield_delay = 1.2 SECONDS + wear_rate = 0.6 //TTD BALANCE THESE /obj/item/gun/ballistic/rifle/update_overlays() . = ..() diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index c05b9a63eb40..9263cb45fe4d 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -44,6 +44,7 @@ gunslinger_recoil_bonus = -1 min_recoil = 0.1 + wear_rate = 0.8 //TTD BALANCE THESE /obj/item/gun/ballistic/shotgun/blow_up(mob/user) if(chambered && chambered.BB) diff --git a/code/modules/projectiles/guns/ballistic/smg.dm b/code/modules/projectiles/guns/ballistic/smg.dm index faa52c29f268..e01e25b227eb 100644 --- a/code/modules/projectiles/guns/ballistic/smg.dm +++ b/code/modules/projectiles/guns/ballistic/smg.dm @@ -27,6 +27,7 @@ gunslinger_recoil_bonus = 2 gunslinger_spread_bonus = 16 + wear_rate = 0.5 //TTD BALANCE THESE /obj/item/gun/ballistic/automatic/smg/wt550 name = "\improper WT-550 Automatic Rifle" diff --git a/code/modules/projectiles/guns/ballistic/toy.dm b/code/modules/projectiles/guns/ballistic/toy.dm index 016cbe94f4c5..9c92989e9371 100644 --- a/code/modules/projectiles/guns/ballistic/toy.dm +++ b/code/modules/projectiles/guns/ballistic/toy.dm @@ -22,6 +22,7 @@ manufacturer = MANUFACTURER_NANOTRASEN recoil = -10 //its a toy... recoil_unwielded = -10 + wear_rate = 0 /obj/item/gun/ballistic/automatic/toy/pistol @@ -74,6 +75,7 @@ pb_knockback = 0 recoil = -10 //its a toy... recoil_unwielded = -10 + wear_rate = 0 /obj/item/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0, from_firing = TRUE, chamber_next_round = TRUE, atom/shooter) . = ..() diff --git a/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm b/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm index 4a48dd5ea2b4..018658a6b909 100644 --- a/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm @@ -34,6 +34,7 @@ load_empty_sound = 'sound/weapons/gun/pistol/candor_reload.ogg' eject_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' eject_empty_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' + wear_rate = 0.4 /obj/item/gun/ballistic/automatic/pistol/mauler/ComponentInitialize() . = ..() diff --git a/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm b/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm index f391f835032b..bd7780d0c9dd 100644 --- a/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm @@ -231,12 +231,14 @@ EMPTY_GUN_HELPER(revolver/detective) eject_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' eject_empty_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' show_magazine_on_sprite = TRUE + wear_rate = 0.2 //HP weapons are more resistant to general wear NO_MAG_GUN_HELPER(automatic/pistol/candor) /obj/item/gun/ballistic/automatic/pistol/candor/factory //also give this to the srm, their candors should probably look factory fresh from how well taken care of they are desc = "A classic semi-automatic handgun, widely popular throughout the Frontier. An engraving on the slide marks it as a product of 'Hunter's Pride Arms and Ammunition'. This example has been kept in especially good shape, and may as well be fresh out of the workshop. Chambered in .45." item_state = "hp_generic_fresh" + wear_rate = 0.1 //factory guns are now OBJECTIVELY better. if they happen to be candors. NO_MAG_GUN_HELPER(automatic/pistol/candor/factory) @@ -273,6 +275,7 @@ NO_MAG_GUN_HELPER(automatic/pistol/candor/factory) bolt_type = BOLT_TYPE_OPEN rack_sound = 'sound/weapons/gun/smg/uzi_cocked.ogg' fire_sound = 'sound/weapons/gun/smg/firestorm.ogg' + wear_rate = 0.4 //HP weapons are more resistant to wear manufacturer = MANUFACTURER_HUNTERSPRIDE @@ -961,6 +964,7 @@ EMPTY_GUN_HELPER(shotgun/doublebarrel/beacon) ) default_attachments = list(/obj/item/attachment/scope) + wear_rate = 0.5 //HP weapons are more resistant to wear /obj/item/gun/ballistic/rifle/scout name = "HP Scout" diff --git a/shiptest.dme b/shiptest.dme index 103c22c910c8..85b06f842577 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1234,6 +1234,7 @@ #include "code\game\objects\items\gear_packs.dm" #include "code\game\objects\items\gift.dm" #include "code\game\objects\items\granters.dm" +#include "code\game\objects\items\gunrepairkit.dm" #include "code\game\objects\items\handcuffs.dm" #include "code\game\objects\items\holosign_creator.dm" #include "code\game\objects\items\hot_potato.dm" From 01ab5d0d719a37c65340d996e86c41d1b0bceb2c Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Tue, 18 Feb 2025 20:05:46 -0500 Subject: [PATCH 05/21] Repair kit work. it works now. probably. no sprite, though. --- code/game/objects/items/gunrepairkit.dm | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index 98c9c2de14b2..bcdd71801ed7 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -1,24 +1,33 @@ /obj/item/gun_fixer name = "firearm maintenance kit" - desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Several chemicals required for a full cleaning process result in each kit being single-use." + desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Several chemicals required for a full cleaning process are expended, and each kit only contains enough for a single use." w_class = WEIGHT_CLASS_BULKY //no carrying these around, sorry :( /// How much wear will this clean from a gun? var/wear_reduction = 60 /// Number of times this gun fixer can be used var/uses = 1 +/obj/item/gun_fixer/examine(mob/user) + . = ..() + . += "it can be used [uses] more times." + /obj/item/gun_fixer/afterattack(atom/target, mob/user, proximity) if(!proximity) return + if(!uses) + to_chat(user, span_warning("[src] is out of uses!")) + return var/obj/item/gun/ballistic/fixable = target if(!istype(fixable)) return fixable.add_overlay(GLOB.cleaning_bubbles) playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) user.visible_message("[user] starts to wipe down [fixable] with [src]!", "You start to wipe down [fixable] with [src]...") - if(do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) - fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 200) - uses-- + if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) + return + user.visible_message("[user] finishes cleaning [fixable]!", "You clean [fixable]." + fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 200) + uses-- /// Remember: you can always trust a loaded gun to go off at least once. /obj/item/gun_fixer/proc/accidents_happen(obj/item/gun/ballistic/whoops, mob/darwin) @@ -27,13 +36,13 @@ return if(whoops.internal_magazine && !whoops.magazine.ammo_count(TRUE)) return - if(prob(1)) //this gets called I think once per decisecond so we don't really want a high chance here. its like firing the force of nature and expecting it to not explode - if(whoops.safety) + if(prob(1)) //this gets called I think once per decisecond so we don't really want a high chance here + if(whoops.safety) //TTD: FLAVORTEXT whoops.safety = FALSE if(prob(50)) //you got lucky. THIS time. return - if(!whoops.chambered) + if(!whoops.chambered)//TTD: FLAVORTEXT whoops.chamber_round() if(prob(50)) return - whoops.unsafe_shot(darwin) + whoops.unsafe_shot(darwin)//TTD: FLAVORTEXT From 985c2b7011ad2a27d906d794234da55247ea8f57 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Tue, 18 Feb 2025 20:46:50 -0500 Subject: [PATCH 06/21] forgor --- code/game/objects/items/gunrepairkit.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index bcdd71801ed7..c15fcc8cb532 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -25,7 +25,7 @@ user.visible_message("[user] starts to wipe down [fixable] with [src]!", "You start to wipe down [fixable] with [src]...") if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) return - user.visible_message("[user] finishes cleaning [fixable]!", "You clean [fixable]." + user.visible_message("[user] finishes cleaning [fixable]!", "You clean [fixable].") fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 200) uses-- @@ -46,3 +46,4 @@ if(prob(50)) return whoops.unsafe_shot(darwin)//TTD: FLAVORTEXT + return FALSE From c489c7987da17696a175296cab48820b37a92f30 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Fri, 21 Feb 2025 13:52:06 -0500 Subject: [PATCH 07/21] whoops --- code/game/objects/items/gunrepairkit.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index c15fcc8cb532..b1ce1391d0b3 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -24,8 +24,8 @@ playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) user.visible_message("[user] starts to wipe down [fixable] with [src]!", "You start to wipe down [fixable] with [src]...") if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) - return user.visible_message("[user] finishes cleaning [fixable]!", "You clean [fixable].") + return fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 200) uses-- From 668866d579fb82c381cb4ba39a9a3d528101dd9c Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Wed, 5 Mar 2025 14:25:43 -0500 Subject: [PATCH 08/21] waugh --- .../manufacturer/hunter_pride/ballistics.dm | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm b/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm index bd088f889cbc..98f4da5f75b8 100644 --- a/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm @@ -247,23 +247,6 @@ EMPTY_GUN_HELPER(revolver/detective) ) - slot_available = list( - ATTACHMENT_SLOT_MUZZLE = 1, - ATTACHMENT_SLOT_RAIL = 1, - ) - - slot_offsets = list( - ATTACHMENT_SLOT_MUZZLE = list( - "x" = 31, - "y" = 23, - ), - ATTACHMENT_SLOT_RAIL = list( - "x" = 21, - "y" = 18, - ) - ) - - NO_MAG_GUN_HELPER(automatic/pistol/candor) /obj/item/gun/ballistic/automatic/pistol/candor/factory //also give this to the srm, their candors should probably look factory fresh from how well taken care of they are From 836c4846b6c51b14650c8f8c6de2261a72afdce0 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 13:49:10 -0500 Subject: [PATCH 09/21] Numbers! They're probably fine. Mostly. Aiming for about 3-5 magazines worth of continuous use before dealing with malfunctions --- code/game/objects/items/gunrepairkit.dm | 32 +++++++++++-------- .../modules/projectiles/ammunition/_firing.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 10 +++--- .../projectiles/guns/ballistic/assault.dm | 3 +- .../projectiles/guns/ballistic/automatic.dm | 3 +- .../projectiles/guns/ballistic/gauss.dm | 2 +- .../modules/projectiles/guns/ballistic/hmg.dm | 2 +- .../projectiles/guns/ballistic/marksman.dm | 1 - .../projectiles/guns/ballistic/rifle.dm | 1 - .../projectiles/guns/ballistic/shotgun.dm | 2 +- .../modules/projectiles/guns/ballistic/smg.dm | 5 ++- .../frontier_import/ballistics.dm | 9 +++++- .../manufacturer/hunter_pride/ballistics.dm | 6 ++-- 13 files changed, 46 insertions(+), 32 deletions(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index b1ce1391d0b3..d44826f6573f 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -1,11 +1,14 @@ /obj/item/gun_fixer name = "firearm maintenance kit" - desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Several chemicals required for a full cleaning process are expended, and each kit only contains enough for a single use." + desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state." + icon = 'icons/obj/items.dmi' + icon_state = "paint_neutral" w_class = WEIGHT_CLASS_BULKY //no carrying these around, sorry :( + custom_materials = list(/datum/material/iron = 500) /// How much wear will this clean from a gun? var/wear_reduction = 60 /// Number of times this gun fixer can be used - var/uses = 1 + var/uses = 5 /obj/item/gun_fixer/examine(mob/user) . = ..() @@ -22,12 +25,14 @@ return fixable.add_overlay(GLOB.cleaning_bubbles) playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) - user.visible_message("[user] starts to wipe down [fixable] with [src]!", "You start to wipe down [fixable] with [src]...") + user.visible_message(span_notice("[user] starts to wipe down [fixable] with [src]!"), span_notice("You start to wipe down [fixable] with [src]...")) if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) - user.visible_message("[user] finishes cleaning [fixable]!", "You clean [fixable].") + user.visible_message(span_notice("[user] finishes cleaning [fixable]!"), span_notice("You clean [fixable].")) return - fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 200) + fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 300) uses-- + if(!uses) + icon_state = "paint_empty" /// Remember: you can always trust a loaded gun to go off at least once. /obj/item/gun_fixer/proc/accidents_happen(obj/item/gun/ballistic/whoops, mob/darwin) @@ -36,14 +41,15 @@ return if(whoops.internal_magazine && !whoops.magazine.ammo_count(TRUE)) return - if(prob(1)) //this gets called I think once per decisecond so we don't really want a high chance here - if(whoops.safety) //TTD: FLAVORTEXT + if(prob(2)) //this gets called I think once per decisecond so we don't really want a high chance here + if(whoops.safety) whoops.safety = FALSE - if(prob(50)) //you got lucky. THIS time. - return - if(!whoops.chambered)//TTD: FLAVORTEXT + to_chat(darwin, span_warning("You bump the safety-")) + return + if(!whoops.chambered) + to_chat(darwin, span_warning("You accidentally [whoops.bolt_wording] [whoops]-")) whoops.chamber_round() - if(prob(50)) - return - whoops.unsafe_shot(darwin)//TTD: FLAVORTEXT + return + to_chat(darwin, span_warning("The trigger on [whoops] gets caught-")) + whoops.unsafe_shot(darwin) return FALSE diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm index d4e5981677b7..174eaf9dfc22 100644 --- a/code/modules/projectiles/ammunition/_firing.dm +++ b/code/modules/projectiles/ammunition/_firing.dm @@ -22,7 +22,7 @@ user.newtonian_move(get_dir(target, user)) var/obj/item/gun/ballistic/foulmouth = fired_from if(istype(foulmouth)) - foulmouth.gun_wear = round(clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 300), 0.1) + foulmouth.gun_wear = round(clamp(foulmouth.gun_wear + foulmouth.wear_rate * wear_modifier, 0, 300), 0.01) update_appearance() return TRUE diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 09dad649fa0c..714fbb15e229 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -11,7 +11,7 @@ #define JAM_CHANCE_MINOR 10 #define JAM_GRACE_MINOR 4 -#define JAM_CHANCE_MAJOR 20 +#define JAM_CHANCE_MAJOR 30 ///Subtype for any kind of ballistic gun ///This has a shitload of vars on it, and I'm sorry for that, but it does make making new subtypes really easy @@ -26,13 +26,13 @@ /// How utterly fucked the gun is. High gun_wear can cause failure to cycle rounds in some guns var/gun_wear = 0 /// How much gun_wear is generated when we shoot. Increased when using surplus rounds - var/wear_rate = 1 + var/wear_rate = 1 // 60 to malfunction, 180 to critical /// Number of times we have successfully fired since the last time the the gun has jammed. Low but not abysmal condition will only jam so often. var/last_jam = 0 /// Gun will start to jam at this level of wear - var/wear_minor_threshold = 80 - /// Gun will start to jam more at this level of wear. The grace period between jams is also removed, so it's worse than it looks - var/wear_major_threshold = 130 + var/wear_minor_threshold = 60 + /// Gun will start to jam more at this level of wear. The grace period between jams is also removed for extra fun + var/wear_major_threshold = 180 min_recoil = 0.1 diff --git a/code/modules/projectiles/guns/ballistic/assault.dm b/code/modules/projectiles/guns/ballistic/assault.dm index 0f11f4dacfbd..b45142dac94c 100644 --- a/code/modules/projectiles/guns/ballistic/assault.dm +++ b/code/modules/projectiles/guns/ballistic/assault.dm @@ -24,7 +24,7 @@ gunslinger_spread_bonus = 16 light_range = 2 - wear_rate = 0.4 // TTD BALANCE THESE + wear_rate = 0.6 // 100 to malfunction, 300 to critical /obj/item/gun/ballistic/automatic/assault/skm name = "\improper SKM-24" @@ -97,6 +97,7 @@ icon_state = "skm_pirate" item_state = "skm_pirate" manufacturer = MANUFACTURER_NONE + wear_rate = 1.2 // 50 to malfunction, 150 to critical /obj/item/gun/ballistic/automatic/assault/skm/inteq name = "\improper SKM-44" diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index 6502a3f9f083..382a1a2f90cf 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -20,7 +20,6 @@ recoil = 0 recoil_unwielded = 4 wield_slowdown = PDW_SLOWDOWN - wear_rate = 0.3 //TTD BALANCE THESE /obj/item/gun/ballistic/automatic/zip_pistol name = "makeshift pistol" @@ -34,4 +33,4 @@ actions_types = list() show_magazine_on_sprite = TRUE weapon_weight = WEAPON_LIGHT - wear_rate = 0.8 //TTD BALANCE THESE //it's a. piece of shit. + wear_rate = 5 //it's a. piece of shit. diff --git a/code/modules/projectiles/guns/ballistic/gauss.dm b/code/modules/projectiles/guns/ballistic/gauss.dm index f91d54d9e298..a5666f16d77c 100644 --- a/code/modules/projectiles/guns/ballistic/gauss.dm +++ b/code/modules/projectiles/guns/ballistic/gauss.dm @@ -32,4 +32,4 @@ wield_slowdown = HEAVY_RIFLE_SLOWDOWN wield_delay = 1 SECONDS fire_select_icon_state_prefix = "pellet_" - wear_rate = 0.1 //TTD BALANCE THESE + wear_rate = 0 // magnetically accelerated, very little if any wear to the gun diff --git a/code/modules/projectiles/guns/ballistic/hmg.dm b/code/modules/projectiles/guns/ballistic/hmg.dm index 8c6c89139f13..f1007f6f7244 100644 --- a/code/modules/projectiles/guns/ballistic/hmg.dm +++ b/code/modules/projectiles/guns/ballistic/hmg.dm @@ -41,7 +41,7 @@ /obj/structure/railing, /obj/structure/flippedtable ) - wear_rate = 0.4 //TTD BALANCE THESE + wear_rate = 0.2 //300 to malfunction, 900 to critical /obj/item/gun/ballistic/automatic/hmg/Initialize() diff --git a/code/modules/projectiles/guns/ballistic/marksman.dm b/code/modules/projectiles/guns/ballistic/marksman.dm index c97277493ed1..557ccc5ca21b 100644 --- a/code/modules/projectiles/guns/ballistic/marksman.dm +++ b/code/modules/projectiles/guns/ballistic/marksman.dm @@ -11,4 +11,3 @@ min_recoil = 0.1 light_range = 2 - wear_rate = 0.6 //TTD BALANCE THESE diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index 5dfd2f883710..7846bec2fe34 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -36,7 +36,6 @@ recoil_unwielded = 4 wield_slowdown = RIFLE_SLOWDOWN wield_delay = 1.2 SECONDS - wear_rate = 0.6 //TTD BALANCE THESE /obj/item/gun/ballistic/rifle/update_overlays() . = ..() diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index ca5ebea2e5f5..60afc6f5e354 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -44,7 +44,7 @@ gunslinger_recoil_bonus = -1 min_recoil = 0.1 - wear_rate = 0.8 //TTD BALANCE THESE + wear_rate = 2 //30 to malfunction, 90 to critical /obj/item/gun/ballistic/shotgun/blow_up(mob/user) if(chambered && chambered.BB) diff --git a/code/modules/projectiles/guns/ballistic/smg.dm b/code/modules/projectiles/guns/ballistic/smg.dm index 5d4d98e7d684..e3ddc611b40a 100644 --- a/code/modules/projectiles/guns/ballistic/smg.dm +++ b/code/modules/projectiles/guns/ballistic/smg.dm @@ -27,7 +27,7 @@ gunslinger_recoil_bonus = 2 gunslinger_spread_bonus = 16 - wear_rate = 0.5 //TTD BALANCE THESE + wear_rate = 0.5 // 120 to malfunction, 360 to critical /obj/item/gun/ballistic/automatic/smg/wt550 name = "\improper WT-550 Automatic Rifle" @@ -102,6 +102,9 @@ wield_delay = 0.6 SECONDS wield_slowdown = SMG_SLOWDOWN + + wear_rate = 0.8 //75 to malfunction, 225 to critical + unique_attachments = list( /obj/item/attachment/foldable_stock ) diff --git a/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm b/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm index 922b798db213..d943cb596331 100644 --- a/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/frontier_import/ballistics.dm @@ -34,7 +34,8 @@ load_empty_sound = 'sound/weapons/gun/pistol/candor_reload.ogg' eject_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' eject_empty_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' - wear_rate = 0.4 + + wear_rate = 2 // 30 to malfunction, 90 to critical slot_available = list( @@ -107,6 +108,8 @@ eject_sound = 'sound/weapons/gun/smg/spitter_unload.ogg' eject_empty_sound = 'sound/weapons/gun/smg/spitter_unload.ogg' + wear_rate = 2 // 30 to malfunction, 90 to critical + valid_attachments = list( /obj/item/attachment/silencer, /obj/item/attachment/foldable_stock/spitter @@ -179,6 +182,8 @@ eject_sound = 'sound/weapons/gun/smg/pounder_unload.ogg' eject_empty_sound = 'sound/weapons/gun/smg/pounder_unload.ogg' + wear_rate = 1 + gun_firemodes = list(FIREMODE_FULLAUTO) default_firemode = FIREMODE_FULLAUTO @@ -252,6 +257,8 @@ eject_sound = 'sound/weapons/gun/hmg/shredder_unload.ogg' eject_empty_sound = 'sound/weapons/gun/hmg/shredder_unload.ogg' + wear_rate = 3 // 20 to malfunction, 60 to critical + manufacturer = MANUFACTURER_IMPORT has_bipod = FALSE diff --git a/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm b/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm index 98f4da5f75b8..b2d99402b526 100644 --- a/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/hunter_pride/ballistics.dm @@ -228,7 +228,7 @@ EMPTY_GUN_HELPER(revolver/detective) eject_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' eject_empty_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' show_magazine_on_sprite = TRUE - wear_rate = 0.2 //HP weapons are more resistant to general wear + wear_rate = 0.66 //HP weapons are more resistant to wear slot_available = list( ATTACHMENT_SLOT_MUZZLE = 1, @@ -252,7 +252,7 @@ NO_MAG_GUN_HELPER(automatic/pistol/candor) /obj/item/gun/ballistic/automatic/pistol/candor/factory //also give this to the srm, their candors should probably look factory fresh from how well taken care of they are desc = "A classic semi-automatic handgun, widely popular throughout the Frontier. An engraving on the slide marks it as a product of 'Hunter's Pride Arms and Ammunition'. This example has been kept in especially good shape, and may as well be fresh out of the workshop. Chambered in .45." item_state = "hp_generic_fresh" - wear_rate = 0.1 //factory guns are now OBJECTIVELY better. if they happen to be candors. + wear_rate = 0.6 //factory guns are now OBJECTIVELY better. if they happen to be candors. NO_MAG_GUN_HELPER(automatic/pistol/candor/factory) @@ -1127,7 +1127,7 @@ EMPTY_GUN_HELPER(shotgun/doublebarrel/beacon) ) ) - wear_rate = 0.5 //HP weapons are more resistant to wear + wear_rate = 0.8 //HP weapons are more resistant to wear /obj/item/gun/ballistic/rifle/scout name = "HP Scout" From 5bba5092d2581ebc85a4a3a97216beb50c811edc Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 16:53:43 -0500 Subject: [PATCH 10/21] Player-accessible repair kits, accidents now occur from the gun instead of the repair kit --- code/game/objects/items/gunrepairkit.dm | 22 +--------------------- code/modules/cargo/packs/sec_supply.dm | 7 +++++++ code/modules/projectiles/guns/ballistic.dm | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index d44826f6573f..66f459a6b1eb 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -26,30 +26,10 @@ fixable.add_overlay(GLOB.cleaning_bubbles) playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) user.visible_message(span_notice("[user] starts to wipe down [fixable] with [src]!"), span_notice("You start to wipe down [fixable] with [src]...")) - if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(accidents_happen), fixable, user))) + if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(fixable, TYPE_PROC_REF(/obj/item/gun/ballistic, accidents_happen), user))) user.visible_message(span_notice("[user] finishes cleaning [fixable]!"), span_notice("You clean [fixable].")) return fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 300) uses-- if(!uses) icon_state = "paint_empty" - -/// Remember: you can always trust a loaded gun to go off at least once. -/obj/item/gun_fixer/proc/accidents_happen(obj/item/gun/ballistic/whoops, mob/darwin) - . = TRUE - if(!whoops.magazine) - return - if(whoops.internal_magazine && !whoops.magazine.ammo_count(TRUE)) - return - if(prob(2)) //this gets called I think once per decisecond so we don't really want a high chance here - if(whoops.safety) - whoops.safety = FALSE - to_chat(darwin, span_warning("You bump the safety-")) - return - if(!whoops.chambered) - to_chat(darwin, span_warning("You accidentally [whoops.bolt_wording] [whoops]-")) - whoops.chamber_round() - return - to_chat(darwin, span_warning("The trigger on [whoops] gets caught-")) - whoops.unsafe_shot(darwin) - return FALSE diff --git a/code/modules/cargo/packs/sec_supply.dm b/code/modules/cargo/packs/sec_supply.dm index 5a643df3cbac..c77d6a4425f9 100644 --- a/code/modules/cargo/packs/sec_supply.dm +++ b/code/modules/cargo/packs/sec_supply.dm @@ -29,6 +29,13 @@ cost = 150 crate_name = "sandbag crate" +/datum/supply_pack/sec_supply/maintenance_kit + name = "Firearm Maintenance Kit" + desc = "Contains a five-use firearm maintenance kit, useful for cleaning blood, sand, and mud out of guns." + contains = list(/obj/item/gun_fixer) + cost = 500 + crate_name = "maintenance kit crate" + /datum/supply_pack/sec_supply/flashbangs name = "Flashbangs Crate" desc = "Contains seven flashbangs for use in door breaching and riot control." diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 714fbb15e229..b884567d43e1 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -424,3 +424,22 @@ . = ..() process_chamber(empty_chamber,TRUE) +/// Remember: you can always trust a loaded gun to go off at least once. +/obj/item/gun/ballistic/proc/accidents_happen(mob/darwin) + . = TRUE + if(!magazine) + return + if(internal_magazine && !magazine.ammo_count(TRUE)) + return + if(prob(2)) //this gets called I think once per decisecond so we don't really want a high chance here + if(safety) + safety = FALSE + to_chat(darwin, span_warning("You bump the safety-")) + return + if(!chambered) + to_chat(darwin, span_warning("You accidentally [bolt_wording] [src]-")) + chamber_round() + return + to_chat(darwin, span_warning("The trigger on [src] gets caught-")) + unsafe_shot(darwin) + return FALSE From ee40d7a0eb98b5a479ddd2b40c48c6e5bbcf6c9a Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 17:07:57 -0500 Subject: [PATCH 11/21] Flavortext runover, indev cleaning and a slight price reduction. We'll go with slight, sure. --- code/game/objects/items/gunrepairkit.dm | 13 ++++++++----- code/modules/cargo/packs/sec_supply.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 11 +++-------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index 66f459a6b1eb..1416e3a5b843 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -1,11 +1,10 @@ /obj/item/gun_fixer name = "firearm maintenance kit" - desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state." - icon = 'icons/obj/items.dmi' + desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Chemicals included in the kit are expended in a cleaning cycle, preventing re-use more than a few times." icon_state = "paint_neutral" w_class = WEIGHT_CLASS_BULKY //no carrying these around, sorry :( custom_materials = list(/datum/material/iron = 500) - /// How much wear will this clean from a gun? + /// Amount of wear removed from a gun on use var/wear_reduction = 60 /// Number of times this gun fixer can be used var/uses = 5 @@ -23,13 +22,17 @@ var/obj/item/gun/ballistic/fixable = target if(!istype(fixable)) return + if(!fixable.gun_wear) + to_chat(user, span_notice("[fixable] is already in good condition!")) + return fixable.add_overlay(GLOB.cleaning_bubbles) playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) - user.visible_message(span_notice("[user] starts to wipe down [fixable] with [src]!"), span_notice("You start to wipe down [fixable] with [src]...")) + user.visible_message(span_notice("[user] starts to wipe down [fixable] with [src]!"), span_notice("You start to give [fixable] a deep clean with [src]...")) if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(fixable, TYPE_PROC_REF(/obj/item/gun/ballistic, accidents_happen), user))) - user.visible_message(span_notice("[user] finishes cleaning [fixable]!"), span_notice("You clean [fixable].")) return + fixable.wash(CLEAN_SCRUB) fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 300) + user.visible_message(span_notice("[user] finishes cleaning [fixable]!"), span_notice("You finish cleaning [fixable], [fixable.gun_wear < wear_reduction ? "and it's in pretty good condition" : "though it would benefit from another cycle"].")) uses-- if(!uses) icon_state = "paint_empty" diff --git a/code/modules/cargo/packs/sec_supply.dm b/code/modules/cargo/packs/sec_supply.dm index c77d6a4425f9..2216cf1ba25e 100644 --- a/code/modules/cargo/packs/sec_supply.dm +++ b/code/modules/cargo/packs/sec_supply.dm @@ -33,7 +33,7 @@ name = "Firearm Maintenance Kit" desc = "Contains a five-use firearm maintenance kit, useful for cleaning blood, sand, and mud out of guns." contains = list(/obj/item/gun_fixer) - cost = 500 + cost = 100 //Price check this later. It's probably fine but it might be okay if it's a little more expensive crate_name = "maintenance kit crate" /datum/supply_pack/sec_supply/flashbangs diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index b884567d43e1..46a888a90d74 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -140,21 +140,16 @@ /// Handles weapon condition. Returning TRUE prevents process_chamber from automatically loading a new round /obj/item/gun/ballistic/proc/condition_check(from_firing = TRUE) - if(bolt_type == BOLT_TYPE_NO_BOLT || !from_firing || !magazine.ammo_count(FALSE)) //The revolver is one of the most reliable firearms ever designed, as long as you don't need to fire any more than six bullets at something. Which you, of course, do not. + if(bolt_type == BOLT_TYPE_NO_BOLT || !from_firing || !magazine.ammo_count(FALSE)) //The revolver is one of the most reliable firearms ever designed, as long as you don't need to fire any more than six bullets at something. Which, of course, you do not. return FALSE last_jam++ if(gun_wear < wear_minor_threshold) - //say("Jam roll failed due to high condition, new last_jam of [last_jam]") return FALSE - //say("Rolling jam attempt with [gun_wear]% damage") - if(gun_wear >= wear_major_threshold ? prob(JAM_CHANCE_MAJOR) : prob(JAM_CHANCE_MINOR) && last_jam >= JAM_GRACE_MINOR) //PLACEHOLDER //LESS PLACEHOLDER NOW - bolt_locked = TRUE //*click* + if(gun_wear >= wear_major_threshold ? prob(JAM_CHANCE_MAJOR) : prob(JAM_CHANCE_MINOR) && last_jam >= JAM_GRACE_MINOR) + bolt_locked = TRUE last_jam = 0 // sighs and erases number on whiteboard playsound(src, 'sound/weapons/gun/general/dry_fire_old.ogg', 50, TRUE, -15) //click. uhoh. - //say("Jam roll succeeded") return TRUE - //say("Jam roll failed, new last_jam of [last_jam]") - ///Used to chamber a new round and eject the old one /obj/item/gun/ballistic/proc/chamber_round(keep_bullet = FALSE) From 1e0b73709684165edbfd3c6a328f83ebc4e5f692 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 17:18:34 -0500 Subject: [PATCH 12/21] Testing fixes, probably feature complete enough --- code/game/objects/items/gunrepairkit.dm | 2 ++ code/modules/projectiles/guns/ballistic.dm | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index 1416e3a5b843..d4a259b518b3 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -29,7 +29,9 @@ playsound(src, 'sound/misc/slip.ogg', 15, TRUE, -8) user.visible_message(span_notice("[user] starts to wipe down [fixable] with [src]!"), span_notice("You start to give [fixable] a deep clean with [src]...")) if(!do_after(user, 20 SECONDS, target = target, extra_checks = CALLBACK(fixable, TYPE_PROC_REF(/obj/item/gun/ballistic, accidents_happen), user))) + fixable.cut_overlay(GLOB.cleaning_bubbles) return + fixable.cut_overlay(GLOB.cleaning_bubbles) fixable.wash(CLEAN_SCRUB) fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 300) user.visible_message(span_notice("[user] finishes cleaning [fixable]!"), span_notice("You finish cleaning [fixable], [fixable.gun_wear < wear_reduction ? "and it's in pretty good condition" : "though it would benefit from another cycle"].")) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 46a888a90d74..88dace7745a0 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -426,15 +426,15 @@ return if(internal_magazine && !magazine.ammo_count(TRUE)) return - if(prob(2)) //this gets called I think once per decisecond so we don't really want a high chance here + if(prob(1)) //this gets called I think once per decisecond so we don't really want a high chance here if(safety) - safety = FALSE + toggle_safety(darwin) to_chat(darwin, span_warning("You bump the safety-")) return if(!chambered) - to_chat(darwin, span_warning("You accidentally [bolt_wording] [src]-")) + to_chat(darwin, span_warning("You accidentally rack the [bolt_wording] of [src]-")) chamber_round() return - to_chat(darwin, span_warning("The trigger on [src] gets caught-")) + to_chat(darwin, span_boldwarning("The trigger on [src] gets caught-")) unsafe_shot(darwin) return FALSE From 40f0a9459e01340ecb2ffc74804adbb6b81876b0 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 17:21:55 -0500 Subject: [PATCH 13/21] Underbarrels can't jam, otherwise something really emberassing could happen. Lucky me, the E-40 still has its laser taped on the ballistic instead of vice versa, so I don't need to handle that --- .../game/objects/items/attachments/gun_attachments/ballistic.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/objects/items/attachments/gun_attachments/ballistic.dm b/code/game/objects/items/attachments/gun_attachments/ballistic.dm index 51e6a64de049..16e01a6a9581 100644 --- a/code/game/objects/items/attachments/gun_attachments/ballistic.dm +++ b/code/game/objects/items/attachments/gun_attachments/ballistic.dm @@ -37,6 +37,7 @@ allowed_ammo_types = list( /obj/item/ammo_box/magazine/internal/shot/underbarrel, ) + wear_rate = 0 /obj/item/attachment/gun/ballistic/shotgun name = "underbarrel shotgun" @@ -74,6 +75,7 @@ allowed_ammo_types = list( /obj/item/ammo_box/magazine/m22lr_himehabu/hognose, ) + wear_rate = 0 /obj/item/ammo_box/magazine/m22lr_himehabu/hognose name = "Hognose magazine (.22 LR)" From 290273c383ccda6a363dd7b3876fff47e51aadc7 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 17:24:15 -0500 Subject: [PATCH 14/21] Surplus bullets lose their damage reduction in exchange for the doubled wear rate. This was part of the plan. I think. --- code/modules/projectiles/projectile/bullets/pistol.dm | 3 --- code/modules/projectiles/projectile/bullets/revolver.dm | 1 - code/modules/projectiles/projectile/bullets/smg.dm | 1 - 3 files changed, 5 deletions(-) diff --git a/code/modules/projectiles/projectile/bullets/pistol.dm b/code/modules/projectiles/projectile/bullets/pistol.dm index 9330233a4876..fea8a88c0972 100644 --- a/code/modules/projectiles/projectile/bullets/pistol.dm +++ b/code/modules/projectiles/projectile/bullets/pistol.dm @@ -47,7 +47,6 @@ /obj/projectile/bullet/c9mm/surplus name = "9mm surplus bullet" - damage = 15 speed_mod = BULLET_SPEED_SURPLUS_MOD /obj/projectile/bullet/c9mm/ap @@ -81,7 +80,6 @@ /obj/projectile/bullet/c10mm/surplus name = "10mm surplus bullet" - damage = 20 speed_mod = BULLET_SPEED_SURPLUS_MOD /obj/projectile/bullet/c10mm/ap @@ -115,7 +113,6 @@ /obj/projectile/bullet/c45/surplus name = ".45 surplus bullet" - damage = 22 speed_mod = BULLET_SPEED_SURPLUS_MOD /obj/projectile/bullet/c45/ap diff --git a/code/modules/projectiles/projectile/bullets/revolver.dm b/code/modules/projectiles/projectile/bullets/revolver.dm index 45206fc24d7c..298db2b978db 100644 --- a/code/modules/projectiles/projectile/bullets/revolver.dm +++ b/code/modules/projectiles/projectile/bullets/revolver.dm @@ -8,7 +8,6 @@ bullet_identifier = "small bullet" /obj/projectile/bullet/c38/surplus - damage = 15 speed_mod = BULLET_SPEED_SURPLUS_MOD /obj/projectile/bullet/c38/match diff --git a/code/modules/projectiles/projectile/bullets/smg.dm b/code/modules/projectiles/projectile/bullets/smg.dm index 79865347caa5..68e13145cebd 100644 --- a/code/modules/projectiles/projectile/bullets/smg.dm +++ b/code/modules/projectiles/projectile/bullets/smg.dm @@ -76,7 +76,6 @@ /obj/projectile/bullet/c556mm/surplus name = "5.56mm HITP surplus bullet" - damage = 15 speed_mod = BULLET_SPEED_SURPLUS_MOD /obj/projectile/bullet/c556mm/ap From fd5d871ef86e1bbac91dc3cbebc36adb82325f32 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 17:37:03 -0500 Subject: [PATCH 15/21] Switches shotgun wear to automatic shotguns only. Pump action shotguns Never Jam Or Break. --- code/modules/projectiles/guns/ballistic.dm | 2 +- code/modules/projectiles/guns/ballistic/shotgun.dm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 88dace7745a0..36f7e694eec1 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -373,7 +373,7 @@ . += "It does not seem to have a round chambered." if (bolt_locked) . += "The [bolt_wording] is locked back and needs to be released before firing." - if(bolt_type != BOLT_TYPE_NO_BOLT) + if(bolt_type != BOLT_TYPE_NO_BOLT && wear_rate) . += "You can [bolt_wording] [src] by pressing the unique action key. By default, this is space" var/conditionstr = span_boldwarning("critical") var/minorhalf = wear_minor_threshold / 2 diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 60afc6f5e354..951c6ffa0253 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -44,7 +44,7 @@ gunslinger_recoil_bonus = -1 min_recoil = 0.1 - wear_rate = 2 //30 to malfunction, 90 to critical + wear_rate = 0 /obj/item/gun/ballistic/shotgun/blow_up(mob/user) if(chambered && chambered.BB) @@ -68,6 +68,7 @@ semi_auto = TRUE gunslinger_recoil_bonus = 1 + wear_rate = 2 //30 to malfunction, 90 to critical //Dual Feed Shotgun From 3a55a8df278ed196e7527aeda2fe09a7f7f286e7 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 17:45:53 -0500 Subject: [PATCH 16/21] better sprite. Not like this one is being used right now. --- code/game/objects/items/gunrepairkit.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gunrepairkit.dm index d4a259b518b3..37465e0d60ff 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gunrepairkit.dm @@ -1,7 +1,8 @@ /obj/item/gun_fixer name = "firearm maintenance kit" desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Chemicals included in the kit are expended in a cleaning cycle, preventing re-use more than a few times." - icon_state = "paint_neutral" + icon = 'icons/obj/improvised.dmi' + icon_state = "kitsuitcase" w_class = WEIGHT_CLASS_BULKY //no carrying these around, sorry :( custom_materials = list(/datum/material/iron = 500) /// Amount of wear removed from a gun on use @@ -36,5 +37,3 @@ fixable.gun_wear = clamp(fixable.gun_wear - wear_reduction, 0, 300) user.visible_message(span_notice("[user] finishes cleaning [fixable]!"), span_notice("You finish cleaning [fixable], [fixable.gun_wear < wear_reduction ? "and it's in pretty good condition" : "though it would benefit from another cycle"].")) uses-- - if(!uses) - icon_state = "paint_empty" From a7fda0f2dc492d9bff08e362b02311a441f6e2d6 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 18:00:55 -0500 Subject: [PATCH 17/21] wear rate on marksman rifles for readability --- code/modules/projectiles/guns/ballistic/marksman.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/ballistic/marksman.dm b/code/modules/projectiles/guns/ballistic/marksman.dm index 557ccc5ca21b..0493b12a3149 100644 --- a/code/modules/projectiles/guns/ballistic/marksman.dm +++ b/code/modules/projectiles/guns/ballistic/marksman.dm @@ -11,3 +11,4 @@ min_recoil = 0.1 light_range = 2 + wear_rate = 1 From 1156cfa8a7630b65c40a7232b915fea537115549 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 18:08:54 -0500 Subject: [PATCH 18/21] pistol readability, also obliterates duplicate candor/penix definitions --- .../projectiles/guns/ballistic/pistol.dm | 45 +------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm index a346e7193c77..4183afdd34d6 100644 --- a/code/modules/projectiles/guns/ballistic/pistol.dm +++ b/code/modules/projectiles/guns/ballistic/pistol.dm @@ -24,56 +24,13 @@ muzzleflash_iconstate = "muzzle_flash_light" light_range = 1 + wear_rate = 1 refused_attachments = list( /obj/item/attachment/gun, /obj/item/attachment/sling ) - -/obj/item/gun/ballistic/automatic/pistol/candor - name = "\improper Candor" - desc = "A classic semi-automatic handgun, widely popular throughout the Frontier. An engraving on the slide marks it as a product of Hunter's Pride. Chambered in .45." - icon_state = "candor" - item_state = "hp_generic" - icon = 'icons/obj/guns/manufacturer/hunterspride/48x32.dmi' - lefthand_file = 'icons/obj/guns/manufacturer/hunterspride/lefthand.dmi' - righthand_file = 'icons/obj/guns/manufacturer/hunterspride/righthand.dmi' - mob_overlay_icon = 'icons/obj/guns/manufacturer/hunterspride/onmob.dmi' - - default_ammo_type = /obj/item/ammo_box/magazine/m45 - allowed_ammo_types = list( - /obj/item/ammo_box/magazine/m45, - ) - fire_sound = 'sound/weapons/gun/pistol/candor.ogg' - rack_sound = 'sound/weapons/gun/pistol/candor_cocked.ogg' - lock_back_sound = 'sound/weapons/gun/pistol/slide_lock.ogg' - bolt_drop_sound = 'sound/weapons/gun/pistol/candor_cocked.ogg' - manufacturer = MANUFACTURER_HUNTERSPRIDE - load_sound = 'sound/weapons/gun/pistol/candor_reload.ogg' - load_empty_sound = 'sound/weapons/gun/pistol/candor_reload.ogg' - eject_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' - eject_empty_sound = 'sound/weapons/gun/pistol/candor_unload.ogg' - show_magazine_on_sprite = TRUE - -NO_MAG_GUN_HELPER(automatic/pistol/candor) - -/obj/item/gun/ballistic/automatic/pistol/candor/factory //also give this to the srm, their candors should probably look factory fresh from how well taken care of they are - desc = "A classic semi-automatic handgun, widely popular throughout the Frontier. An engraving on the slide marks it as a product of 'Hunter's Pride Arms and Ammunition'. This example has been kept in especially good shape, and may as well be fresh out of the workshop. Chambered in .45." - item_state = "hp_generic_fresh" - -NO_MAG_GUN_HELPER(automatic/pistol/candor/factory) - -/obj/item/gun/ballistic/automatic/pistol/candor/factory/update_overlays() - . = ..() - . += "[initial(icon_state)]_factory" - -/obj/item/gun/ballistic/automatic/pistol/candor/phenex - name = "\improper HP Phenex" - desc = "A uniquely modified version of the Candor, famously created by Hunter's Pride. Named after the daemonic Phoenix of legend that the Ashen Huntsman had once slain, this hell-kissed weapon is more visually intimidating than its original counterpart, but mechanically acts the same. Chambered in .45." - icon_state = "phenex" - item_state = "hp_phenex" - /obj/item/gun/ballistic/automatic/pistol/commissar name = "\improper Commissar" desc = "A Nanotrasen-issue handgun, modified with a voice box to further enhance its effectiveness in troop discipline." From b77ac7d98afa72a2932b3bc243a7421b3e74e906 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 18:12:58 -0500 Subject: [PATCH 19/21] rattlesnake statted as an SMG --- .../projectiles/guns/manufacturer/scarborough/ballistics.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm b/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm index 9d6d8800222c..f07b87ef94d2 100644 --- a/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm @@ -264,6 +264,7 @@ NO_MAG_GUN_HELPER(automatic/pistol/asp) burst_size = 3 burst_delay = 0.1 SECONDS fire_delay = 0.4 SECONDS + wear_rate = 0.5 //120 to malfunction, 360 to critical gun_firemodes = list(FIREMODE_SEMIAUTO, FIREMODE_BURST) default_firemode = FIREMODE_SEMIAUTO From db02f6fa7af7e459820027a626115de6de62f416 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Thu, 6 Mar 2025 18:20:37 -0500 Subject: [PATCH 20/21] Name switch for readability repair kit > maint kit in code --- .../objects/items/{gunrepairkit.dm => gun_maint_kit.dm} | 6 +++--- code/modules/cargo/packs/sec_supply.dm | 2 +- shiptest.dme | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename code/game/objects/items/{gunrepairkit.dm => gun_maint_kit.dm} (92%) diff --git a/code/game/objects/items/gunrepairkit.dm b/code/game/objects/items/gun_maint_kit.dm similarity index 92% rename from code/game/objects/items/gunrepairkit.dm rename to code/game/objects/items/gun_maint_kit.dm index 37465e0d60ff..6f847701a266 100644 --- a/code/game/objects/items/gunrepairkit.dm +++ b/code/game/objects/items/gun_maint_kit.dm @@ -1,4 +1,4 @@ -/obj/item/gun_fixer +/obj/item/gun_maint_kit name = "firearm maintenance kit" desc = "A toolkit containing everything needed to scrub the frontier-gunk out of a gun and return it to a mostly-usable state. Chemicals included in the kit are expended in a cleaning cycle, preventing re-use more than a few times." icon = 'icons/obj/improvised.dmi' @@ -10,11 +10,11 @@ /// Number of times this gun fixer can be used var/uses = 5 -/obj/item/gun_fixer/examine(mob/user) +/obj/item/gun_maint_kit/examine(mob/user) . = ..() . += "it can be used [uses] more times." -/obj/item/gun_fixer/afterattack(atom/target, mob/user, proximity) +/obj/item/gun_maint_kit/afterattack(atom/target, mob/user, proximity) if(!proximity) return if(!uses) diff --git a/code/modules/cargo/packs/sec_supply.dm b/code/modules/cargo/packs/sec_supply.dm index 2216cf1ba25e..ff64f009ca05 100644 --- a/code/modules/cargo/packs/sec_supply.dm +++ b/code/modules/cargo/packs/sec_supply.dm @@ -32,7 +32,7 @@ /datum/supply_pack/sec_supply/maintenance_kit name = "Firearm Maintenance Kit" desc = "Contains a five-use firearm maintenance kit, useful for cleaning blood, sand, and mud out of guns." - contains = list(/obj/item/gun_fixer) + contains = list(/obj/item/gun_maint_kit) cost = 100 //Price check this later. It's probably fine but it might be okay if it's a little more expensive crate_name = "maintenance kit crate" diff --git a/shiptest.dme b/shiptest.dme index 0f2a39fa0f81..56ead7025b5c 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1237,7 +1237,7 @@ #include "code\game\objects\items\gear_packs.dm" #include "code\game\objects\items\gift.dm" #include "code\game\objects\items\granters.dm" -#include "code\game\objects\items\gunrepairkit.dm" +#include "code\game\objects\items\gun_maint_kit.dm" #include "code\game\objects\items\handcuffs.dm" #include "code\game\objects\items\holosign_creator.dm" #include "code\game\objects\items\hot_potato.dm" From e519b38319af846edcb8d9cf36ced27606f596e5 Mon Sep 17 00:00:00 2001 From: SomeguyManperson Date: Sat, 8 Mar 2025 13:28:37 -0500 Subject: [PATCH 21/21] Maintenance ND now checks if there is a chambered round OR a magazine, chance for maintenance ND reduced somewhat. It is still probably guaranteed. --- code/modules/projectiles/guns/ballistic.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 36f7e694eec1..a281b750ccae 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -422,11 +422,11 @@ /// Remember: you can always trust a loaded gun to go off at least once. /obj/item/gun/ballistic/proc/accidents_happen(mob/darwin) . = TRUE - if(!magazine) + if(!magazine && !chambered) return if(internal_magazine && !magazine.ammo_count(TRUE)) return - if(prob(1)) //this gets called I think once per decisecond so we don't really want a high chance here + if(prob(0.5)) //this gets called I think once per decisecond so we don't really want a high chance here if(safety) toggle_safety(darwin) to_chat(darwin, span_warning("You bump the safety-"))