More General Gun Fixes (#42693)

Fixes some incorrect sprite paths, bad implementation, and logic inconsistencies that were resulting in missing sprites and fucked up sprites. Fixed some weirdness with the RPG due to wrong bolt type. Fixed bullet count being incorrect on anything with an internal magazine. Fixed issue with internal magazine tacloads that was resulting in them locking up and being unable to shoot.

Closes #42683
Closes #42672
This commit is contained in:
Rob Bailey
2019-02-08 19:34:36 -08:00
committed by oranges
parent 92e30ce70a
commit 8d817adb5e
6 changed files with 28 additions and 14 deletions

View File

@@ -58,6 +58,8 @@
/obj/item/gun/ballistic/Initialize()
. = ..()
if (!spawnwithmagazine)
bolt_locked = TRUE
update_icon()
return
if (!magazine)
magazine = new mag_type(src)
@@ -200,6 +202,9 @@
return
if (istype(A, /obj/item/ammo_casing) || istype(A, /obj/item/ammo_box))
if (bolt_type == BOLT_TYPE_NO_BOLT || internal_magazine)
if (chambered && !chambered.BB)
chambered.forceMove(drop_location())
chambered = null
var/num_loaded = magazine.attackby(A, user, params, TRUE)
if (num_loaded)
to_chat(user, "<span class='notice'>You load [num_loaded] [cartridge_wording]\s into \the [src].</span>")
@@ -306,7 +311,8 @@
/obj/item/gun/ballistic/examine(mob/user)
..()
to_chat(user, "It has [get_ammo()] round\s remaining.")
var/count_chambered = !((bolt_type == BOLT_TYPE_NO_BOLT) || (bolt_type == BOLT_TYPE_OPEN))
to_chat(user, "It has [get_ammo(count_chambered)] round\s remaining.")
if (!chambered)
to_chat(user, "It does not seem to have a round chambered.")
if (bolt_locked)

View File

@@ -4,12 +4,13 @@
/obj/item/gun/ballistic/revolver/grenadelauncher//this is only used for underbarrel grenade launchers at the moment, but admins can still spawn it if they feel like being assholes
desc = "A break-operated grenade launcher."
name = "grenade launcher"
icon_state = "dshotgun-sawn"
icon_state = "dshotgun_sawn"
item_state = "gun"
mag_type = /obj/item/ammo_box/magazine/internal/grenadelauncher
fire_sound = 'sound/weapons/grenadelaunch.ogg'
w_class = WEIGHT_CLASS_NORMAL
pin = /obj/item/firing_pin/implant/pindicate
bolt_type = BOLT_TYPE_NO_BOLT
/obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted
pin = /obj/item/firing_pin
@@ -41,10 +42,6 @@
actions_types = list()
casing_ejector = FALSE
/obj/item/gun/ballistic/automatic/gyropistol/update_icon()
..()
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
/obj/item/gun/ballistic/rocketlauncher
name = "rocket propelled grenade launcher"
desc = "A reusable rocket propelled grenade launcher."
@@ -59,7 +56,9 @@
fire_delay = 0
casing_ejector = FALSE
weapon_weight = WEAPON_HEAVY
bolt_type = BOLT_TYPE_NO_BOLT
magazine_wording = "rocket"
empty_indicator = TRUE
/obj/item/gun/ballistic/rocketlauncher/handle_atom_del(atom/A)
if(A == chambered)
@@ -107,9 +106,6 @@
to_chat(user, "<span class='notice'>There's no rocket in [src].</span>")
update_icon()
/obj/item/gun/ballistic/rocketlauncher/update_icon()
icon_state = "[initial(icon_state)]-[chambered ? "1" : "0"]"
/obj/item/gun/ballistic/rocketlauncher/suicide_act(mob/living/user)
user.visible_message("<span class='warning'>[user] aims [src] at the ground! It looks like [user.p_theyre()] performing a sick rocket jump!<span>", \
"<span class='userdanger'>You aim [src] at the ground to perform a bisnasty rocket jump...</span>")

View File

@@ -26,7 +26,7 @@ obj/item/gun/ballistic/rifle/rack(mob/user = null)
bolt_locked = TRUE
update_icon()
return
drop_bolt()
drop_bolt(user)
obj/item/gun/ballistic/rifle/can_shoot()
if (bolt_locked)

View File

@@ -1,7 +1,6 @@
/obj/item/gun/ballistic/automatic/toy
name = "foam force SMG"
desc = "A prototype three-round burst toy submachine gun. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
icon_state = "saber"
item_state = "gun"
mag_type = /obj/item/ammo_box/magazine/toy/smg
@@ -14,6 +13,10 @@
item_flags = NONE
casing_ejector = FALSE
/obj/item/gun/ballistic/automatic/toy/update_icon()
. = ..()
add_overlay("[icon_state]_toy")
/obj/item/gun/ballistic/automatic/toy/unrestricted
pin = /obj/item/firing_pin
@@ -48,7 +51,6 @@
/obj/item/gun/ballistic/shotgun/toy
name = "foam force shotgun"
desc = "A toy shotgun with wood furniture and a four-shell capacity underneath. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
force = 0
throwforce = 0
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy
@@ -57,6 +59,10 @@
casing_ejector = FALSE
can_suppress = FALSE
/obj/item/gun/ballistic/shotgun/toy/update_icon()
. = ..()
add_overlay("[icon_state]_toy")
/obj/item/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0)
..()
if(chambered && !chambered.BB)
@@ -79,7 +85,6 @@
/obj/item/gun/ballistic/automatic/c20r/toy //This is the syndicate variant with syndicate firing pin and riot darts.
name = "donksoft SMG"
desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
can_suppress = TRUE
item_flags = NONE
mag_type = /obj/item/ammo_box/magazine/toy/smgm45/riot
@@ -93,10 +98,13 @@
/obj/item/gun/ballistic/automatic/c20r/toy/unrestricted/riot
mag_type = /obj/item/ammo_box/magazine/toy/smgm45/riot
/obj/item/gun/ballistic/automatic/c20r/toy/update_icon()
. = ..()
add_overlay("[icon_state]_toy")
/obj/item/gun/ballistic/automatic/l6_saw/toy //This is the syndicate variant with syndicate firing pin and riot darts.
name = "donksoft LMG"
desc = "A heavily modified toy light machine gun, designated 'L6 SAW'. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
can_suppress = FALSE
item_flags = NONE
mag_type = /obj/item/ammo_box/magazine/toy/m762/riot
@@ -109,3 +117,7 @@
/obj/item/gun/ballistic/automatic/l6_saw/toy/unrestricted/riot
mag_type = /obj/item/ammo_box/magazine/toy/m762/riot
/obj/item/gun/ballistic/automatic/l6_saw/toy/update_icon()
. = ..()
add_overlay("[icon_state]_toy")