mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-12 01:43:40 +00:00
191 lines
5.1 KiB
Plaintext
191 lines
5.1 KiB
Plaintext
////////////////INTERNAL MAGAZINES//////////////////////
|
|
|
|
/obj/item/ammo_box/magazine/internal
|
|
desc = "Oh god, this shouldn't be here"
|
|
|
|
//internals magazines are accessible, so replace spent ammo if full when trying to put a live one in
|
|
/obj/item/ammo_box/magazine/internal/give_round(obj/item/ammo_casing/R)
|
|
return ..(R,1)
|
|
|
|
|
|
|
|
// Revolver internal mags
|
|
/obj/item/ammo_box/magazine/internal/cylinder
|
|
name = "revolver cylinder"
|
|
ammo_type = /obj/item/ammo_casing/a357
|
|
caliber = "357"
|
|
max_ammo = 7
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/ammo_count(countempties = 1)
|
|
var/boolets = 0
|
|
for(var/obj/item/ammo_casing/bullet in stored_ammo)
|
|
if(bullet && (bullet.BB || countempties))
|
|
boolets++
|
|
|
|
return boolets
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/get_round(keep = 0)
|
|
rotate()
|
|
|
|
var/b = stored_ammo[1]
|
|
if(!keep)
|
|
stored_ammo[1] = null
|
|
|
|
return b
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/proc/rotate()
|
|
var/b = stored_ammo[1]
|
|
stored_ammo.Cut(1,2)
|
|
stored_ammo.Insert(0, b)
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/proc/spin()
|
|
for(var/i in 1 to rand(0, max_ammo*2))
|
|
rotate()
|
|
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0)
|
|
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
|
|
return 0
|
|
|
|
for(var/i in 1 to stored_ammo.len)
|
|
var/obj/item/ammo_casing/bullet = stored_ammo[i]
|
|
if(!bullet || !bullet.BB) // found a spent ammo
|
|
stored_ammo[i] = R
|
|
R.loc = src
|
|
|
|
if(bullet)
|
|
bullet.loc = get_turf(src.loc)
|
|
return 1
|
|
|
|
return 0
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/rev38
|
|
name = "detective revolver cylinder"
|
|
ammo_type = /obj/item/ammo_casing/c38
|
|
caliber = "38"
|
|
max_ammo = 6
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/grenademulti
|
|
name = "grenade launcher internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/a40mm
|
|
caliber = "40mm"
|
|
max_ammo = 6
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/rev762
|
|
name = "nagant revolver cylinder"
|
|
ammo_type = /obj/item/ammo_casing/n762
|
|
caliber = "n762"
|
|
max_ammo = 7
|
|
|
|
// Shotgun internal mags
|
|
/obj/item/ammo_box/magazine/internal/shot
|
|
name = "shotgun internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
|
|
caliber = "shotgun"
|
|
max_ammo = 4
|
|
multiload = 0
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/ammo_count(countempties = 1)
|
|
if (!countempties)
|
|
var/boolets = 0
|
|
for(var/obj/item/ammo_casing/bullet in stored_ammo)
|
|
if(bullet.BB)
|
|
boolets++
|
|
return boolets
|
|
else
|
|
return ..()
|
|
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/tube
|
|
name = "dual feed shotgun internal tube"
|
|
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
|
|
max_ammo = 4
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/lethal
|
|
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/com
|
|
name = "combat shotgun internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
|
|
max_ammo = 6
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/com/compact
|
|
name = "compact combat shotgun internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
|
|
max_ammo = 4
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/dual
|
|
name = "double-barrel shotgun internal magazine"
|
|
max_ammo = 2
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/improvised
|
|
name = "improvised shotgun internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/shotgun/improvised
|
|
max_ammo = 1
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/riot
|
|
name = "riot shotgun internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
|
|
max_ammo = 6
|
|
|
|
|
|
|
|
|
|
/obj/item/ammo_box/magazine/internal/grenadelauncher
|
|
name = "grenade launcher internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/a40mm
|
|
caliber = "40mm"
|
|
max_ammo = 1
|
|
|
|
/obj/item/ammo_box/magazine/internal/rocketlauncher
|
|
name = "grenade launcher internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/caseless/a84mm
|
|
caliber = "84mm"
|
|
max_ammo = 1
|
|
|
|
/obj/item/ammo_box/magazine/internal/speargun
|
|
name = "speargun internal magazine"
|
|
ammo_type = /obj/item/ammo_casing/caseless/magspear
|
|
caliber = "speargun"
|
|
max_ammo = 1
|
|
|
|
/obj/item/ammo_box/magazine/internal/cylinder/rus357
|
|
name = "russian revolver cylinder"
|
|
ammo_type = /obj/item/ammo_casing/a357
|
|
caliber = "357"
|
|
max_ammo = 6
|
|
multiload = 0
|
|
|
|
/obj/item/ammo_box/magazine/internal/rus357/New()
|
|
stored_ammo += new ammo_type(src)
|
|
..()
|
|
|
|
/obj/item/ammo_box/magazine/internal/boltaction
|
|
name = "bolt action rifle internal magazine"
|
|
desc = "Oh god, this shouldn't be here"
|
|
ammo_type = /obj/item/ammo_casing/a762
|
|
caliber = "a762"
|
|
max_ammo = 5
|
|
multiload = 1
|
|
|
|
/obj/item/ammo_box/magazine/internal/boltaction/enchanted
|
|
max_ammo = 1
|
|
ammo_type = /obj/item/ammo_casing/a762/enchanted
|
|
|
|
/obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage
|
|
ammo_type = /obj/item/ammo_casing/magic/arcane_barrage
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/toy
|
|
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
|
caliber = "foam_force"
|
|
max_ammo = 4
|
|
|
|
/obj/item/ammo_box/magazine/internal/shot/toy/crossbow
|
|
max_ammo = 5
|
|
|
|
/obj/item/ammo_box/magazine/internal/minigun
|
|
name = "gatling gun fusion core"
|
|
ammo_type = /obj/item/ammo_casing/caseless/laser/gatling
|
|
caliber = "gatling"
|
|
max_ammo = 5000
|