Merge pull request #4750 from VOREStation/upstream-merge-5886

[MIRROR] Introduces caseless ammo, and a caseless rifle
This commit is contained in:
Novacat
2019-03-28 16:40:13 -04:00
committed by GitHub
7 changed files with 63 additions and 8 deletions

View File

@@ -13,7 +13,7 @@
var/caliber = "" //Which kind of guns it can be loaded into
var/projectile_type //The bullet type to create when New() is called
var/obj/item/projectile/BB = null //The loaded bullet - make it so that the projectiles are created only when needed?
// var/spent_icon = null
var/caseless = null //Caseless ammo deletes its self once the projectile is fired.
/obj/item/ammo_casing/New()
..()
@@ -47,9 +47,7 @@
BB.name = "[initial(BB.name)] (\"[label_text]\")"
/obj/item/ammo_casing/update_icon()
/* if(spent_icon && !BB)
icon_state = spent_icon*/
if(!BB) // This is really just a much better way of doing this.
if(!BB)
icon_state = "[initial(icon_state)]-spent"
/obj/item/ammo_casing/examine(mob/user)

View File

@@ -188,6 +188,21 @@
name = "speedloader (.45 AP)"
ammo_type = /obj/item/ammo_casing/a45/ap
///////// 5mm Caseless /////////
/obj/item/ammo_magazine/m5mmcaseless
name = "prototype rifle magazine (5mm caseless)"
ammo_type = /obj/item/ammo_casing/a5mmcaseless
icon_state = "caseless-mag"
caliber = "5mm caseless"
mag_type = MAGAZINE
max_ammo = 30
multiple_sprites = 1
/obj/item/ammo_magazine/m5mmcaseless/stun
icon_state = "caseless-mag-alt"
ammo_type = /obj/item/ammo_casing/a5mmcaseless/stun
///////// 9mm /////////
/obj/item/ammo_magazine/m9mm

View File

@@ -52,7 +52,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 130, "uranium" = 100)
/*
* .50 Action Express
* .44
*/
/obj/item/ammo_casing/a44
@@ -322,6 +322,22 @@
desc = "A 5.45mm hunting bullet casing."
projectile_type = /obj/item/projectile/bullet/rifle/a545/hunter
/*
* 5mm Caseless
*/
/obj/item/ammo_casing/a5mmcaseless
desc = "A 5mm solid phoron caseless round."
caliber = "5mm caseless"
icon_state = "casing" // Placeholder. Should probably be purple.
projectile_type = /obj/item/projectile/bullet/pistol // Close enough to be comparable.
matter = list(DEFAULT_WALL_MATERIAL = 180)
caseless = 1
/obj/item/ammo_casing/a5mmcaseless/stun
desc = "A 5mm solid phoron caseless stun round."
projectile_type = /obj/item/projectile/energy/electrode // Maybe nerf this considering there's 30 rounds in a mag.
/*
* Misc
*/

View File

@@ -10,7 +10,7 @@
w_class = ITEMSIZE_NORMAL
matter = list(DEFAULT_WALL_MATERIAL = 1000)
recoil = 1
projectile_type = /obj/item/projectile/bullet/pistol/strong //Only used for Cham Guns
projectile_type = /obj/item/projectile/bullet/pistol/strong //Only used for chameleon guns
var/caliber = ".357" //determines which casings will fit
var/handle_casings = EJECT_CASINGS //determines how spent casings should be handled
@@ -84,6 +84,10 @@
switch(handle_casings)
if(EJECT_CASINGS) //eject casing onto ground.
if(chambered.caseless)
qdel(chambered)
return
else
chambered.loc = get_turf(src)
playsound(src.loc, "casing", 50, 1)
if(CYCLE_CASINGS) //cycle the casing back to the end.

View File

@@ -0,0 +1,21 @@
/obj/item/weapon/gun/projectile/caseless/prototype
name = "prototype caseless rifle"
desc = "A rifle cooked up in NanoTrasen's R&D labs that operates with Kraut Space Magic<69> clockwork internals. Uses solid phoron 5mm caseless rounds."
icon_state = "caseless"
item_state = "caseless"
w_class = ITEMSIZE_LARGE
caliber = "5mm caseless"
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 3)
slot_flags = SLOT_BACK
load_method = MAGAZINE
magazine_type = null // R&D builds this. Starts unloaded.
allowed_magazines = list(/obj/item/ammo_magazine/m5mmcaseless)
/obj/item/weapon/gun/projectile/caseless/prototype/update_icon()
if(ammo_magazine)
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-empty"
/obj/item/weapon/gun/projectile/caseless/prototype/loaded
magazine_type = /obj/item/ammo_magazine/m5mmcaseless

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -2645,6 +2645,7 @@
#include "code\modules\projectiles\guns\projectile\automatic.dm"
#include "code\modules\projectiles\guns\projectile\automatic_vr.dm"
#include "code\modules\projectiles\guns\projectile\boltaction.dm"
#include "code\modules\projectiles\guns\projectile\caseless.dm"
#include "code\modules\projectiles\guns\projectile\contender.dm"
#include "code\modules\projectiles\guns\projectile\dartgun.dm"
#include "code\modules\projectiles\guns\projectile\pistol.dm"