Skip to content

Commit

Permalink
refactor: cleanup new revolvers a bit (#471)
Browse files Browse the repository at this point in the history
## Что этот PR делает

Рефактор револьверов, фикс некоторых багов, добавление новых звуков

## Почему это хорошо для игры

Фикс багов и рефактор - всегда хорошо

## Тестирование
Зашел в игру, пострелял, поперезаряжал, снова пострелял

## Changelog

:cl:
tweak: Снижен разброс анаконды с 30 до 20
fix: РШ-12 и Анаконда теперь не стреляет разложенными
fix: Анаконду теперь нельзя заряжать сложенной
imageadd: Спрайт разложенной анаконды
soundadd: Звук выстрела, вынимание и задвигание барабана для анаконды
/:cl:
  • Loading branch information
Gaxeer authored Oct 17, 2023
1 parent e43d988 commit 284ed01
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 28 deletions.
62 changes: 37 additions & 25 deletions modular_ss220/objects/code/weapons.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
// Base heavy revolver
/obj/item/gun/projectile/revolver/reclinable
var/snapback_sound = 'modular_ss220/objects/sound/weapons/cylinder/snapback_rsh12.ogg'
var/reclined_sound = 'modular_ss220/objects/sound/weapons/cylinder/reclined_rsh12.ogg'
var/dry_fire_sound = 'sound/weapons/empty.ogg'
var/reclined = FALSE

/obj/item/gun/projectile/revolver/reclinable/attack_self(mob/living/user)
reclined = !reclined
playsound(user, reclined ? reclined_sound : snapback_sound, 50, 1)
update_icon()

if(reclined)
return ..()

/obj/item/gun/projectile/revolver/reclinable/update_icon_state()
icon_state = initial(icon_state) + (reclined ? "_reclined" : "")

/obj/item/gun/projectile/revolver/reclinable/attackby(obj/item/A, mob/user, params)
if(!reclined)
return
return ..()

/obj/item/gun/projectile/revolver/reclinable/process_fire(atom/target, mob/living/user, message, params, zone_override, bonus_spread)
if (!reclined)
return ..()

to_chat(user, "<span class='danger'>*click*</span>")
playsound(user, dry_fire_sound, 100, 1)

// Colt Anaconda .44

/obj/item/gun/projectile/revolver/anaconda
/obj/item/gun/projectile/revolver/reclinable/anaconda
name = "Анаконда"
desc = "Крупнокалиберный револьвер двадцатого века. Несмотря на то, что оружие хранилось в хороших условиях, старина даёт о себе знать."
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/d44
Expand All @@ -9,16 +39,13 @@
icon = 'modular_ss220/objects/icons/guns.dmi'
icon_state = "anaconda"
item_state = "anaconda"
fire_sound = 'modular_ss220/objects/sound/weapons/gunshots/gunshot_anaconda.ogg'

/obj/item/gun/projectile/revolver/anaconda/attackby(obj/item/A, mob/user, params)
/obj/item/gun/projectile/revolver/reclinable/anaconda/attackby(obj/item/A, mob/user, params)
if(istype(A, /obj/item/ammo_box/box_d44))
return
return ..()

/obj/item/gun/projectile/revolver/anaconda/process_fire(atom/target, mob/living/user, message, params, zone_override, bonus_spread)
bonus_spread += 30
. = ..()

/obj/item/ammo_box/magazine/internal/cylinder/d44
name = ".44 revolver cylinder"
ammo_type = /obj/item/ammo_casing/d44
Expand All @@ -42,6 +69,7 @@
flag = "bullet"
hitsound_wall = "ricochet"
impact_effect_type = /obj/effect/temp_visual/impact_effect
spread = 20

/obj/item/ammo_box/speed_loader_d44
name = "speed loader (.44)"
Expand All @@ -63,12 +91,12 @@

/obj/structure/displaycase/hos
alert = TRUE
start_showpiece_type = /obj/item/gun/projectile/revolver/anaconda
start_showpiece_type = /obj/item/gun/projectile/revolver/reclinable/anaconda
req_access = list(ACCESS_HOS)

// RSH-12 12.7

/obj/item/gun/projectile/revolver/rsh12
/obj/item/gun/projectile/revolver/reclinable/rsh12
name = "РШ-12"
desc = "Тяжёлый револьвер винтовочного калибра с откидным стволом. По слухам, всё ещё находится на вооружении у СССП."
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rsh12
Expand All @@ -78,26 +106,10 @@
icon_state = "rsh12"
item_state = "rsh12"
fire_sound = 'modular_ss220/objects/sound/weapons/gunshots/gunshot_rsh12.ogg'
var/snapback_sound = 'modular_ss220/objects/sound/weapons/cylinder/snapback_rsh12.ogg'
var/reclined_sound = 'modular_ss220/objects/sound/weapons/cylinder/reclined_rsh12.ogg'
var/reclined = FALSE

/obj/item/gun/projectile/revolver/rsh12/attack_self(mob/living/user)
reclined = !reclined
playsound(user, snapback_sound, 50, 1)
update_icon()
if(reclined)
playsound(user, reclined_sound, 50, 1)
return ..()

/obj/item/gun/projectile/revolver/rsh12/update_icon_state()
icon_state = initial(icon_state) + (reclined ? "_reclined" : "")

/obj/item/gun/projectile/revolver/rsh12/attackby(obj/item/A, mob/user, params)
/obj/item/gun/projectile/revolver/reclinable/rsh12/attackby(obj/item/A, mob/user, params)
if(istype(A, /obj/item/ammo_box/box_mm127))
return
if(!reclined)
return
return ..()

/obj/item/ammo_box/magazine/internal/cylinder/rsh12
Expand Down
Binary file modified modular_ss220/objects/icons/guns.dmi
Binary file not shown.
Binary file not shown.
Binary file modified modular_ss220/objects/sound/weapons/gunshots/gunshot_rsh12.ogg
Binary file not shown.
6 changes: 3 additions & 3 deletions modular_ss220/outfits/code/outfits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@

backpack_contents = list(
/obj/item/storage/box/soviet = 1,
/obj/item/gun/projectile/revolver/anaconda = 1,
/obj/item/gun/projectile/revolver/reclinable/anaconda = 1,
/obj/item/ammo_box/speed_loader_d44 = 2,
/obj/item/storage/fancy/cigarettes/cigpack_syndicate = 1,
/obj/item/lighter/zippo/engraved = 1
)

/datum/outfit/admin/soviet/officer
belt = /obj/item/gun/projectile/revolver/rsh12
belt = /obj/item/gun/projectile/revolver/reclinable/rsh12

backpack_contents = list(
/obj/item/storage/box/soviet = 1,
Expand All @@ -67,7 +67,7 @@
)

/datum/outfit/admin/soviet/admiral
belt = /obj/item/gun/projectile/revolver/rsh12
belt = /obj/item/gun/projectile/revolver/reclinable/rsh12

backpack_contents = list(
/obj/item/storage/box/soviet = 1,
Expand Down

0 comments on commit 284ed01

Please sign in to comment.