SKS interaction tweaks and bolt-action rifle interaction fix (#89760)

## About The Pull Request
The SKS was repathed to the bolt rifle subtype in order to make it not
eject its entire magazine, and to make it act more like its real
counterpart (e.g. you have to keep the bolt open/locked back in order to
load more ammo).

Also fixes the issue where bolt-actions' interaction blocking was
non-functional due to being moved to a different proc, so now you need
to open the bolt on bolt-actions (and now the SKS) to load ammo.)

## Why It's Good For The Game
Ejecting your entire magazine on-use kind of sucked. The
bolt-open-to-load thing is for funsies.

## Changelog

🆑
fix: The Sakhno SKS no longer ejects its entire internal magazine upon
interaction. To facilitate this, it now requires the bolt to be open
like its bolt-action contemporaries in order to load ammunition.
fix: You can no longer force ammunition into Sakhno precision rifles and
other bolt-action-likes through a closed bolt.
/🆑

---------

Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
This commit is contained in:
Hatterhat
2025-03-07 12:49:56 -06:00
committed by Roxy
parent da150a0077
commit 49eaa12bb4
6 changed files with 47 additions and 53 deletions
+1 -1
View File
@@ -2392,7 +2392,7 @@
/area/awaymission/cabin/caves)
"my" = (
/obj/effect/decal/cleanable/dirt,
/obj/item/gun/ballistic/automatic/sks/chekhov,
/obj/item/gun/ballistic/rifle/sks/chekhov,
/turf/open/floor/mineral/plastitanium/red{
name = "soviet floor"
},
@@ -430,7 +430,7 @@
/datum/crafting_recipe/sks
name = "Sakhno SKS semi-automatic rifle"
result = /obj/item/gun/ballistic/automatic/sks/empty
result = /obj/item/gun/ballistic/rifle/sks/empty
reqs = list(
/obj/item/weaponcrafting/stock = 1,
/obj/item/weaponcrafting/receiver = 1,
@@ -318,48 +318,6 @@
return
..()
// SKS semi-automatic rifle //
/obj/item/gun/ballistic/automatic/sks
name = "\improper Sakhno SKS semi-automatic rifle"
desc = "A revival of the ancient SKS semi-automatic rifle, redesigned to utilize .310 Strilka rounds. Produced to celebrate the \
establishment of the Third Soviet Union in the Spinward Sector. In the wake of the union's collapse, these weapons now hold a \
unique place in history amongst the populace of the sector. However, they are strangely rarer than the Sakhno M2442 Army. \
Frontier settlers are known for owning one of these for hunting purposes. Or fighting off annoying tax collectors."
icon = 'icons/obj/weapons/guns/wide_guns.dmi'
icon_state = "sks"
worn_icon_state = "sks"
inhand_icon_state = "sks"
burst_size = 1
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/sks
internal_magazine = TRUE
bolt_type = BOLT_TYPE_NO_BOLT
can_suppress = FALSE
tac_reloads = FALSE
w_class = WEIGHT_CLASS_BULKY
slot_flags = ITEM_SLOT_BACK
weapon_weight = WEAPON_HEAVY
projectile_damage_multiplier = 0.5
fire_sound = 'sound/items/weapons/gun/rifle/shot_heavy.ogg'
fire_sound_volume = 90
drop_sound = 'sound/items/handling/gun/ballistics/rifle/rifle_drop1.ogg'
pickup_sound = 'sound/items/handling/gun/ballistics/rifle/rifle_pickup1.ogg'
actions_types = list()
SET_BASE_PIXEL(-8, 0)
/obj/item/gun/ballistic/automatic/sks/add_bayonet_point()
AddComponent(/datum/component/bayonet_attachable, offset_x = 38, offset_y = 12)
/obj/item/gun/ballistic/automatic/sks/chekhov
name = "\improper Chekhov's SKS semi-automatic rifle"
desc = "A revival of the ancient SKS semi-automatic rifle, redesigned to utilize .310 Strilka rounds. The name \
'Chekhov' is engraved in the side of the stock. You feel like this had some kind of significance at one point, \
but you cannot be sure as to what that might have been. Or whether that true meaning has yet to reveal itself."
/obj/item/gun/ballistic/automatic/sks/empty
spawn_magazine_type = /obj/item/ammo_box/magazine/internal/sks/empty
// Laser rifle (rechargeable magazine) //
/obj/item/gun/ballistic/automatic/laser
@@ -16,6 +16,8 @@
drop_sound = 'sound/items/handling/gun/ballistics/rifle/rifle_drop1.ogg'
pickup_sound = 'sound/items/handling/gun/ballistics/rifle/rifle_pickup1.ogg'
tac_reloads = FALSE
/// Does the bolt need to be open to interact with the gun (e.g. magazine interactions)?
var/need_bolt_lock_to_interact = FALSE
/obj/item/gun/ballistic/rifle/rack(mob/user = null)
if (bolt_locked == FALSE)
@@ -28,6 +30,13 @@
drop_bolt(user)
/obj/item/gun/ballistic/rifle/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(need_bolt_lock_to_interact && !bolt_locked && !istype(tool, /obj/item/knife))
balloon_alert(user, "bolt closed!")
return
return ..()
/obj/item/gun/ballistic/rifle/can_shoot()
if (bolt_locked)
return FALSE
@@ -58,6 +67,7 @@
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/boltaction
can_be_sawn_off = TRUE
weapon_weight = WEAPON_HEAVY
need_bolt_lock_to_interact = TRUE
var/jamming_chance = 20
var/unjam_chance = 10
var/jamming_increment = 5
@@ -97,13 +107,6 @@
jamming_chance = clamp (jamming_chance, 0, 100)
return ..()
/obj/item/gun/ballistic/rifle/boltaction/attackby(obj/item/item, mob/user, params)
if(!bolt_locked && !istype(item, /obj/item/knife))
balloon_alert(user, "bolt closed!")
return
. = ..()
/obj/item/gun/ballistic/rifle/boltaction/blow_up(mob/user)
. = FALSE
if(chambered?.loaded_projectile)
@@ -406,7 +409,7 @@
name = "anti-materiel sniper rifle"
desc = "A boltaction anti-materiel rifle, utilizing .50 BMG cartridges. While technically outdated in modern arms markets, it still works exceptionally well as \
an anti-personnel rifle. In particular, the employment of modern armored MODsuits utilizing advanced armor plating has given this weapon a new home on the battlefield. \
It is also able to be suppressed....somehow."
It is also able to be suppressed... somehow."
icon = 'icons/obj/weapons/guns/ballistic.dmi'
icon_state = "sniper"
lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
@@ -452,6 +455,38 @@
/obj/item/gun/ballistic/rifle/sniper_rifle/syndicate
desc = "A boltaction anti-materiel rifle, utilizing .50 BMG cartridges. While technically outdated in modern arms markets, it still works exceptionally well as \
an anti-personnel rifle. In particular, the employment of modern armored MODsuits utilizing advanced armor plating has given this weapon a new home on the battlefield. \
It is also able to be suppressed....somehow. This one seems to have a little picture of someone in a blood-red MODsuit stenciled on it, pointing at a green floppy disk. \
It is also able to be suppressed... somehow. This one seems to have a little picture of someone in a blood-red MODsuit stenciled on it, pointing at a green floppy disk. \
Who knows what that might mean."
pin = /obj/item/firing_pin/implant/pindicate
// SKS semi-automatic rifle //
/obj/item/gun/ballistic/rifle/sks
name = "\improper Sakhno SKS semi-automatic rifle"
desc = "A revival of the ancient SKS semi-automatic rifle, redesigned to utilize .310 Strilka rounds. Produced to celebrate the \
establishment of the Third Soviet Union in the Spinward Sector. In the wake of the union's collapse, these weapons now hold a \
unique place in history amongst the populace of the sector. However, they are strangely rarer than the Sakhno M2442 Army. \
Frontier settlers are known for owning one of these for hunting purposes. Or fighting off annoying tax collectors."
icon = 'icons/obj/weapons/guns/wide_guns.dmi'
icon_state = "sks"
worn_icon_state = "sks"
inhand_icon_state = "sks"
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/sks
need_bolt_lock_to_interact = TRUE
semi_auto = TRUE
slot_flags = ITEM_SLOT_BACK
projectile_damage_multiplier = 0.5
SET_BASE_PIXEL(-8, 0)
/obj/item/gun/ballistic/rifle/sks/add_bayonet_point()
AddComponent(/datum/component/bayonet_attachable, offset_x = 38, offset_y = 12)
/obj/item/gun/ballistic/rifle/sks/chekhov
name = "\improper Chekhov's SKS semi-automatic rifle"
desc = "A revival of the ancient SKS semi-automatic rifle, redesigned to utilize .310 Strilka rounds. The name \
'Chekhov' is engraved in the side of the stock. You feel like this had some kind of significance at one point, \
but you cannot be sure as to what that might have been. Or whether that true meaning has yet to reveal itself."
/obj/item/gun/ballistic/rifle/sks/empty
spawn_magazine_type = /obj/item/ammo_box/magazine/internal/sks/empty
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

@@ -0,0 +1 @@
/obj/item/gun/ballistic/automatic/sks/@SUBTYPES : /obj/item/gun/ballistic/rifle/sks/@SUBTYPES{@OLD}