Files
Bubberstation/code/modules/projectiles/guns/ballistic/toy.dm
SkyratBot 39bdedc029 [MIRROR] Splits ballistic firearms "mag_type" into "accepted_magazine_type" and "spawn_magazine_type", fixing a few funny magazine bugs [MDB IGNORE] (#22680)
* Splits ballistic firearms "mag_type" into "accepted_magazine_type" and "spawn_magazine_type", fixing a few funny magazine bugs (#76973)

## About The Pull Request

As the title says, mag type has been split into two variable that do
different things:

Accepted magazine type handles what magazines that gun will accept, type
and any subtypes. If spawn magazine type isnt defined, then it will be
made equal to accepted magazine type to prevent having to double define
magazines on every gun ever.

Spawn magazine type is separate from accepted magazine type, spawn
magazine type is what magazine the gun will actually spawn with. This
exists because there are a few weapons which are made to spawn with
special magazines, that can't use normal magazines anymore. For example,
the riot dart pre-loaded donk soft pistol can only ever be reloaded with
the riot subtype of donk soft magazines at the moment. This isn't
typically something people notice because new magazines are usually not
a thing people come by with these specific weapons, but its a problem I
noticed while coding some weapons.
## Why It's Good For The Game

In short, certain weapons (mostly donksoft weapons, but there's a single
traitor pistol subtype that spawns with fire ammo) will no longer be
limited to the exact subtype of magazine they spawned with, allowing
them to use the normal versions of those magazines as well.
## Changelog
🆑
refactor: The mag_type variable on guns has been split between
accepted_magazine_type and spawn_magazine_type, allowing weapons to
safely spawn with subtypes of their normal magazines without breaking
the weapon
fix: Several weapons that spawned with special magazines, the riot dart
pre-loaded donk pistol for example, will now be able to accept normal
donksoft magazines that don't spawn loaded with riot darts.
/🆑

* Splits ballistic firearms "mag_type" into "accepted_magazine_type" and "spawn_magazine_type", fixing a few funny magazine bugs

* merge conflict

* merge conflict continued

---------

Co-authored-by: Paxilmaniac <82386923+Paxilmaniac@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-07-25 20:24:07 -04:00

112 lines
4.0 KiB
Plaintext

/obj/item/gun/ballistic/automatic/toy
name = "foam force SMG"
desc = "A prototype three-round burst toy submachine gun. Ages 8 and up."
icon_state = "saber"
selector_switch_icon = TRUE
inhand_icon_state = "gun"
accepted_magazine_type = /obj/item/ammo_box/magazine/toy/smg
fire_sound = 'sound/items/syringeproj.ogg'
force = 0
throwforce = 0
burst_size = 3
can_suppress = TRUE
clumsy_check = FALSE
item_flags = NONE
gun_flags = TOY_FIREARM_OVERLAY | NOT_A_REAL_GUN
casing_ejector = FALSE
/obj/item/gun/ballistic/automatic/toy/unrestricted
pin = /obj/item/firing_pin
/obj/item/gun/ballistic/automatic/pistol/toy
name = "foam force pistol"
desc = "A small, easily concealable toy handgun. Ages 8 and up."
accepted_magazine_type = /obj/item/ammo_box/magazine/toy/pistol
fire_sound = 'sound/items/syringeproj.ogg'
gun_flags = TOY_FIREARM_OVERLAY | NOT_A_REAL_GUN
/obj/item/gun/ballistic/automatic/pistol/toy/riot
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/pistol/riot
/obj/item/gun/ballistic/automatic/pistol/riot/Initialize(mapload)
magazine = new /obj/item/ammo_box/magazine/toy/pistol/riot(src)
return ..()
/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."
force = 0
throwforce = 0
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/shot/toy
fire_sound = 'sound/items/syringeproj.ogg'
clumsy_check = FALSE
item_flags = NONE
casing_ejector = FALSE
can_suppress = FALSE
weapon_weight = WEAPON_LIGHT
pb_knockback = 0
gun_flags = TOY_FIREARM_OVERLAY | NOT_A_REAL_GUN
/obj/item/gun/ballistic/shotgun/toy/handle_chamber()
. = ..()
if(chambered && !chambered.loaded_projectile)
qdel(chambered)
/obj/item/gun/ballistic/shotgun/toy/unrestricted
pin = /obj/item/firing_pin
/obj/item/gun/ballistic/shotgun/toy/crossbow
name = "foam force crossbow"
desc = "A weapon favored by many overactive children. Ages 8 and up."
icon = 'icons/obj/toys/toy.dmi'
icon_state = "foamcrossbow"
inhand_icon_state = "crossbow"
lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
inhand_x_dimension = 32
inhand_y_dimension = 32
worn_icon_state = "gun"
worn_icon = null
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/shot/toy/crossbow
fire_sound = 'sound/items/syringeproj.ogg'
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
gun_flags = NONE
/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 three-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
can_suppress = TRUE
item_flags = NONE
accepted_magazine_type = /obj/item/ammo_box/magazine/toy/smgm45
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/smgm45/riot
casing_ejector = FALSE
clumsy_check = FALSE
gun_flags = TOY_FIREARM_OVERLAY | NOT_A_REAL_GUN
/obj/item/gun/ballistic/automatic/c20r/toy/unrestricted //Use this for actual toys
pin = /obj/item/firing_pin
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/smgm45
/obj/item/gun/ballistic/automatic/c20r/toy/unrestricted/riot
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/smgm45/riot
/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."
fire_sound = 'sound/items/syringeproj.ogg'
can_suppress = FALSE
item_flags = NONE
accepted_magazine_type = /obj/item/ammo_box/magazine/toy/m762
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/m762/riot
casing_ejector = FALSE
clumsy_check = FALSE
gun_flags = TOY_FIREARM_OVERLAY | NOT_A_REAL_GUN
/obj/item/gun/ballistic/automatic/l6_saw/toy/unrestricted //Use this for actual toys
pin = /obj/item/firing_pin
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/m762
/obj/item/gun/ballistic/automatic/l6_saw/toy/unrestricted/riot
spawn_magazine_type = /obj/item/ammo_box/magazine/toy/m762/riot