mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
Fixes russian revolver ammo displaying incorrectly (#22253)
* clean up the russian revolver code * woops
This commit is contained in:
@@ -144,7 +144,7 @@
|
||||
caliber = "speargun"
|
||||
max_ammo = 1
|
||||
|
||||
/obj/item/ammo_box/magazine/internal/rus357
|
||||
/obj/item/ammo_box/magazine/internal/cylinder/rus357
|
||||
name = "russian revolver cylinder"
|
||||
ammo_type = /obj/item/ammo_casing/a357
|
||||
caliber = "357"
|
||||
|
||||
@@ -169,50 +169,30 @@
|
||||
name = "\improper russian revolver"
|
||||
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism requiring you to spin the chamber before each trigger pull."
|
||||
origin_tech = "combat=2;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/rus357
|
||||
var/spun = 0
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357
|
||||
var/spun = FALSE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/New()
|
||||
..()
|
||||
Spin()
|
||||
spin()
|
||||
spun = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/proc/Spin()
|
||||
chambered = null
|
||||
var/random = rand(1, magazine.max_ammo)
|
||||
if(random <= get_ammo(0,0))
|
||||
chamber_round()
|
||||
spun = 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/attackby(obj/item/A, mob/user, params)
|
||||
var/num_loaded = ..()
|
||||
if(num_loaded)
|
||||
user.visible_message("[user] loads a single bullet into the revolver and spins the chamber.", "<span class='notice'>You load a single bullet into the chamber and spin it.</span>")
|
||||
else
|
||||
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
|
||||
..()
|
||||
if(get_ammo() > 0)
|
||||
Spin()
|
||||
spin()
|
||||
spun = TRUE
|
||||
update_icon()
|
||||
A.update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/attack_self(mob/user)
|
||||
if(!spun && can_shoot())
|
||||
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
|
||||
Spin()
|
||||
else
|
||||
var/num_unloaded = 0
|
||||
while (get_ammo() > 0)
|
||||
var/obj/item/ammo_casing/CB
|
||||
CB = magazine.get_round()
|
||||
chambered = null
|
||||
CB.loc = get_turf(src.loc)
|
||||
CB.update_icon()
|
||||
num_unloaded++
|
||||
if (num_unloaded)
|
||||
user << "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] is empty.</span>"
|
||||
spin()
|
||||
spun = TRUE
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(flag)
|
||||
@@ -234,7 +214,7 @@
|
||||
user << "<span class='warning'>You need to spin the revolver's chamber first!</span>"
|
||||
return
|
||||
|
||||
spun = 0
|
||||
spun = FALSE
|
||||
|
||||
if(chambered)
|
||||
var/obj/item/ammo_casing/AC = chambered
|
||||
@@ -246,6 +226,7 @@
|
||||
shoot_self(user, affecting)
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user.name] cowardly fires [src] at [user.p_their()] [affecting.name]!</span>", "<span class='userdanger'>You cowardly fire [src] at your [affecting.name]!</span>", "<span class='italics'>You hear a gunshot!</span>")
|
||||
chambered = null
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>*click*</span>")
|
||||
@@ -267,8 +248,6 @@
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfiet!</span>")
|
||||
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
// DOUBLE BARRELED SHOTGUN //
|
||||
/////////////////////////////
|
||||
@@ -322,9 +301,6 @@
|
||||
else
|
||||
user << "<span class='warning'>[src] is empty!</span>"
|
||||
|
||||
|
||||
|
||||
|
||||
// IMPROVISED SHOTGUN //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised
|
||||
|
||||
Reference in New Issue
Block a user