mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Splits up projectile files (#36018)
This commit is contained in:
121
code/modules/projectiles/boxes_magazines/_box_magazine.dm
Normal file
121
code/modules/projectiles/boxes_magazines/_box_magazine.dm
Normal file
@@ -0,0 +1,121 @@
|
||||
//Boxes of ammo
|
||||
/obj/item/ammo_box
|
||||
name = "ammo box (null_reference_exception)"
|
||||
desc = "A box of ammo."
|
||||
icon_state = "357"
|
||||
icon = 'icons/obj/ammo.dmi'
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BELT
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
materials = list(MAT_METAL=30000)
|
||||
throwforce = 2
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
var/list/stored_ammo = list()
|
||||
var/ammo_type = /obj/item/ammo_casing
|
||||
var/max_ammo = 7
|
||||
var/multiple_sprites = 0
|
||||
var/caliber
|
||||
var/multiload = 1
|
||||
var/start_empty = 0
|
||||
|
||||
/obj/item/ammo_box/Initialize()
|
||||
. = ..()
|
||||
if(!start_empty)
|
||||
for(var/i = 1, i <= max_ammo, i++)
|
||||
stored_ammo += new ammo_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/ammo_box/proc/get_round(keep = 0)
|
||||
if (!stored_ammo.len)
|
||||
return null
|
||||
else
|
||||
var/b = stored_ammo[stored_ammo.len]
|
||||
stored_ammo -= b
|
||||
if (keep)
|
||||
stored_ammo.Insert(1,b)
|
||||
return b
|
||||
|
||||
/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0)
|
||||
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
|
||||
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
|
||||
return 0
|
||||
|
||||
if (stored_ammo.len < max_ammo)
|
||||
stored_ammo += R
|
||||
R.forceMove(src)
|
||||
return 1
|
||||
|
||||
//for accessibles magazines (e.g internal ones) when full, start replacing spent ammo
|
||||
else if(replace_spent)
|
||||
for(var/obj/item/ammo_casing/AC in stored_ammo)
|
||||
if(!AC.BB)//found a spent ammo
|
||||
stored_ammo -= AC
|
||||
AC.forceMove(get_turf(src.loc))
|
||||
|
||||
stored_ammo += R
|
||||
R.forceMove(src)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/item/ammo_box/proc/can_load(mob/user)
|
||||
return 1
|
||||
|
||||
/obj/item/ammo_box/attackby(obj/item/A, mob/user, params, silent = FALSE, replace_spent = 0)
|
||||
var/num_loaded = 0
|
||||
if(!can_load(user))
|
||||
return
|
||||
if(istype(A, /obj/item/ammo_box))
|
||||
var/obj/item/ammo_box/AM = A
|
||||
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
|
||||
var/did_load = give_round(AC, replace_spent)
|
||||
if(did_load)
|
||||
AM.stored_ammo -= AC
|
||||
num_loaded++
|
||||
if(!did_load || !multiload)
|
||||
break
|
||||
if(istype(A, /obj/item/ammo_casing))
|
||||
var/obj/item/ammo_casing/AC = A
|
||||
if(give_round(AC, replace_spent))
|
||||
user.transferItemToLoc(AC, src, TRUE)
|
||||
num_loaded++
|
||||
|
||||
if(num_loaded)
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>")
|
||||
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, 1)
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
|
||||
return num_loaded
|
||||
|
||||
/obj/item/ammo_box/attack_self(mob/user)
|
||||
var/obj/item/ammo_casing/A = get_round()
|
||||
if(A)
|
||||
if(!user.put_in_hands(A))
|
||||
A.bounce_away(FALSE, NONE)
|
||||
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, 1)
|
||||
to_chat(user, "<span class='notice'>You remove a round from \the [src]!</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/item/ammo_box/update_icon()
|
||||
switch(multiple_sprites)
|
||||
if(1)
|
||||
icon_state = "[initial(icon_state)]-[stored_ammo.len]"
|
||||
if(2)
|
||||
icon_state = "[initial(icon_state)]-[stored_ammo.len ? "[max_ammo]" : "0"]"
|
||||
desc = "[initial(desc)] There are [stored_ammo.len] shell\s left!"
|
||||
|
||||
//Behavior for magazines
|
||||
/obj/item/ammo_box/magazine/proc/ammo_count()
|
||||
return stored_ammo.len
|
||||
|
||||
/obj/item/ammo_box/magazine/proc/empty_magazine()
|
||||
var/turf_mag = get_turf(src)
|
||||
for(var/obj/item/ammo in stored_ammo)
|
||||
ammo.forceMove(turf_mag)
|
||||
stored_ammo -= ammo
|
||||
8
code/modules/projectiles/boxes_magazines/external/grenade.dm
vendored
Normal file
8
code/modules/projectiles/boxes_magazines/external/grenade.dm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/obj/item/ammo_box/magazine/m75
|
||||
name = "specialized magazine (.75)"
|
||||
icon_state = "75"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/a75
|
||||
caliber = "75"
|
||||
multiple_sprites = 2
|
||||
max_ammo = 8
|
||||
|
||||
22
code/modules/projectiles/boxes_magazines/external/lmg.dm
vendored
Normal file
22
code/modules/projectiles/boxes_magazines/external/lmg.dm
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/obj/item/ammo_box/magazine/mm195x129
|
||||
name = "box magazine (1.95x129mm)"
|
||||
icon_state = "a762-50"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129
|
||||
caliber = "mm195129"
|
||||
max_ammo = 50
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/hollow
|
||||
name = "box magazine (Hollow-Point 1.95x129mm)"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129/hollow
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/ap
|
||||
name = "box magazine (Armor Penetrating 1.95x129mm)"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/incen
|
||||
name = "box magazine (Incendiary 1.95x129mm)"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129/incen
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/update_icon()
|
||||
..()
|
||||
icon_state = "a762-[round(ammo_count(),10)]"
|
||||
56
code/modules/projectiles/boxes_magazines/external/pistol.dm
vendored
Normal file
56
code/modules/projectiles/boxes_magazines/external/pistol.dm
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
/obj/item/ammo_box/magazine/m10mm
|
||||
name = "pistol magazine (10mm)"
|
||||
desc = "A gun magazine."
|
||||
icon_state = "9x19p"
|
||||
ammo_type = /obj/item/ammo_casing/c10mm
|
||||
caliber = "10mm"
|
||||
max_ammo = 8
|
||||
multiple_sprites = 2
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/fire
|
||||
name = "pistol magazine (10mm incendiary)"
|
||||
icon_state = "9x19pI"
|
||||
desc = "A gun magazine. Loaded with rounds which ignite the target."
|
||||
ammo_type = /obj/item/ammo_casing/c10mm/fire
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/hp
|
||||
name = "pistol magazine (10mm HP)"
|
||||
icon_state = "9x19pH"
|
||||
desc= "A gun magazine. Loaded with hollow-point rounds, extremely effective against unarmored targets, but nearly useless against protective clothing."
|
||||
ammo_type = /obj/item/ammo_casing/c10mm/hp
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/ap
|
||||
name = "pistol magazine (10mm AP)"
|
||||
icon_state = "9x19pA"
|
||||
desc= "A gun magazine. Loaded with rounds which penetrate armour, but are less effective against normal targets."
|
||||
ammo_type = /obj/item/ammo_casing/c10mm/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/m45
|
||||
name = "handgun magazine (.45)"
|
||||
icon_state = "45-8"
|
||||
ammo_type = /obj/item/ammo_casing/c45
|
||||
caliber = ".45"
|
||||
max_ammo = 8
|
||||
|
||||
/obj/item/ammo_box/magazine/m45/update_icon()
|
||||
..()
|
||||
icon_state = "45-[ammo_count() ? "8" : "0"]"
|
||||
|
||||
/obj/item/ammo_box/magazine/pistolm9mm
|
||||
name = "pistol magazine (9mm)"
|
||||
icon_state = "9x19p-8"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm
|
||||
caliber = "9mm"
|
||||
max_ammo = 15
|
||||
|
||||
/obj/item/ammo_box/magazine/pistolm9mm/update_icon()
|
||||
..()
|
||||
icon_state = "9x19p-[ammo_count() ? "8" : "0"]"
|
||||
|
||||
/obj/item/ammo_box/magazine/m50
|
||||
name = "handgun magazine (.50ae)"
|
||||
icon_state = "50ae"
|
||||
ammo_type = /obj/item/ammo_casing/a50AE
|
||||
caliber = ".50"
|
||||
max_ammo = 7
|
||||
multiple_sprites = 1
|
||||
14
code/modules/projectiles/boxes_magazines/external/rechargable.dm
vendored
Normal file
14
code/modules/projectiles/boxes_magazines/external/rechargable.dm
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/obj/item/ammo_box/magazine/recharge
|
||||
name = "power pack"
|
||||
desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles."
|
||||
icon_state = "oldrifle-20"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/laser
|
||||
caliber = "laser"
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/recharge/update_icon()
|
||||
desc = "[initial(desc)] It has [stored_ammo.len] shot\s left."
|
||||
icon_state = "oldrifle-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
|
||||
return
|
||||
21
code/modules/projectiles/boxes_magazines/external/rifle.dm
vendored
Normal file
21
code/modules/projectiles/boxes_magazines/external/rifle.dm
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/obj/item/ammo_box/magazine/m10mm/rifle
|
||||
name = "rifle magazine (10mm)"
|
||||
desc = "A well-worn magazine fitted for the surplus rifle."
|
||||
icon_state = "75-8"
|
||||
ammo_type = /obj/item/ammo_casing/c10mm
|
||||
caliber = "10mm"
|
||||
max_ammo = 10
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/rifle/update_icon()
|
||||
if(ammo_count())
|
||||
icon_state = "75-8"
|
||||
else
|
||||
icon_state = "75-0"
|
||||
|
||||
/obj/item/ammo_box/magazine/m556
|
||||
name = "toploader magazine (5.56mm)"
|
||||
icon_state = "5.56m"
|
||||
ammo_type = /obj/item/ammo_casing/a556
|
||||
caliber = "a556"
|
||||
max_ammo = 30
|
||||
multiple_sprites = 2
|
||||
36
code/modules/projectiles/boxes_magazines/external/shotgun.dm
vendored
Normal file
36
code/modules/projectiles/boxes_magazines/external/shotgun.dm
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/obj/item/ammo_box/magazine/m12g
|
||||
name = "shotgun magazine (12g taser slugs)"
|
||||
desc = "A drum magazine."
|
||||
icon_state = "m12gs"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/stunslug
|
||||
caliber = "shotgun"
|
||||
max_ammo = 8
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)]-[CEILING(ammo_count(0)/8, 1)*8]"
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/buckshot
|
||||
name = "shotgun magazine (12g buckshot slugs)"
|
||||
icon_state = "m12gb"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/slug
|
||||
name = "shotgun magazine (12g slugs)"
|
||||
icon_state = "m12gb"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/dragon
|
||||
name = "shotgun magazine (12g dragon's breath)"
|
||||
icon_state = "m12gf"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/dragonsbreath
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/bioterror
|
||||
name = "shotgun magazine (12g bioterror)"
|
||||
icon_state = "m12gt"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/dart/bioterror
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/meteor
|
||||
name = "shotgun magazine (12g meteor slugs)"
|
||||
icon_state = "m12gbc"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/meteorslug
|
||||
76
code/modules/projectiles/boxes_magazines/external/smg.dm
vendored
Normal file
76
code/modules/projectiles/boxes_magazines/external/smg.dm
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
/obj/item/ammo_box/magazine/wt550m9
|
||||
name = "wt550 magazine (4.6x30mm)"
|
||||
icon_state = "46x30mmt-20"
|
||||
ammo_type = /obj/item/ammo_casing/c46x30mm
|
||||
caliber = "4.6x30mm"
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/update_icon()
|
||||
..()
|
||||
icon_state = "46x30mmt-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtap
|
||||
name = "wt550 magazine (Armour Piercing 4.6x30mm)"
|
||||
icon_state = "46x30mmtA-20"
|
||||
ammo_type = /obj/item/ammo_casing/c46x30mm/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtap/update_icon()
|
||||
..()
|
||||
icon_state = "46x30mmtA-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtic
|
||||
name = "wt550 magazine (Incindiary 4.6x30mm)"
|
||||
icon_state = "46x30mmtI-20"
|
||||
ammo_type = /obj/item/ammo_casing/c46x30mm/inc
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtic/update_icon()
|
||||
..()
|
||||
icon_state = "46x30mmtI-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/uzim9mm
|
||||
name = "uzi magazine (9mm)"
|
||||
icon_state = "uzi9mm-32"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm
|
||||
caliber = "9mm"
|
||||
max_ammo = 32
|
||||
|
||||
/obj/item/ammo_box/magazine/uzim9mm/update_icon()
|
||||
..()
|
||||
icon_state = "uzi9mm-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm
|
||||
name = "SMG magazine (9mm)"
|
||||
icon_state = "smg9mm-42"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm
|
||||
caliber = "9mm"
|
||||
max_ammo = 21
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm/update_icon()
|
||||
..()
|
||||
icon_state = "smg9mm-[ammo_count() ? "42" : "0"]"
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm/ap
|
||||
name = "SMG magazine (Armour Piercing 9mm)"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm/fire
|
||||
name = "SMG Magazine (Incindiary 9mm)"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm/inc
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm45
|
||||
name = "SMG magazine (.45)"
|
||||
icon_state = "c20r45-24"
|
||||
ammo_type = /obj/item/ammo_casing/c45/nostamina
|
||||
caliber = ".45"
|
||||
max_ammo = 24
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm45/update_icon()
|
||||
..()
|
||||
icon_state = "c20r45-[round(ammo_count(),2)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/tommygunm45
|
||||
name = "drum magazine (.45)"
|
||||
icon_state = "drum45"
|
||||
ammo_type = /obj/item/ammo_casing/c45
|
||||
caliber = ".45"
|
||||
max_ammo = 50
|
||||
26
code/modules/projectiles/boxes_magazines/external/sniper.dm
vendored
Normal file
26
code/modules/projectiles/boxes_magazines/external/sniper.dm
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/obj/item/ammo_box/magazine/sniper_rounds
|
||||
name = "sniper rounds (.50)"
|
||||
icon_state = ".50mag"
|
||||
ammo_type = /obj/item/ammo_casing/p50
|
||||
max_ammo = 6
|
||||
caliber = ".50"
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds/update_icon()
|
||||
if(ammo_count())
|
||||
icon_state = "[initial(icon_state)]-ammo"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds/soporific
|
||||
name = "sniper rounds (Zzzzz)"
|
||||
desc = "Soporific sniper rounds, designed for happy days and dead quiet nights..."
|
||||
icon_state = "soporific"
|
||||
ammo_type = /obj/item/ammo_casing/p50/soporific
|
||||
max_ammo = 3
|
||||
caliber = ".50"
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds/penetrator
|
||||
name = "sniper rounds (penetrator)"
|
||||
desc = "An extremely powerful round capable of passing straight through cover and anyone unfortunate enough to be behind it."
|
||||
ammo_type = /obj/item/ammo_casing/p50/penetrator
|
||||
max_ammo = 5
|
||||
55
code/modules/projectiles/boxes_magazines/external/toy.dm
vendored
Normal file
55
code/modules/projectiles/boxes_magazines/external/toy.dm
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/obj/item/ammo_box/magazine/toy
|
||||
name = "foam force META magazine"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
caliber = "foam_force"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smg
|
||||
name = "foam force SMG magazine"
|
||||
icon_state = "smg9mm-42"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smg/update_icon()
|
||||
..()
|
||||
if(ammo_count())
|
||||
icon_state = "smg9mm-42"
|
||||
else
|
||||
icon_state = "smg9mm-0"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smg/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/pistol
|
||||
name = "foam force pistol magazine"
|
||||
icon_state = "9x19p"
|
||||
max_ammo = 8
|
||||
multiple_sprites = 2
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/pistol/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smgm45
|
||||
name = "donksoft SMG magazine"
|
||||
caliber = "foam_force"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smgm45/update_icon()
|
||||
..()
|
||||
icon_state = "c20r45-[round(ammo_count(),2)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smgm45/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/m762
|
||||
name = "donksoft box magazine"
|
||||
caliber = "foam_force"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
max_ammo = 50
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/m762/update_icon()
|
||||
..()
|
||||
icon_state = "a762-[round(ammo_count(),10)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/m762/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
@@ -1,340 +0,0 @@
|
||||
|
||||
///////////EXTERNAL MAGAZINES////////////////
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm
|
||||
name = "pistol magazine (10mm)"
|
||||
desc = "A gun magazine."
|
||||
icon_state = "9x19p"
|
||||
ammo_type = /obj/item/ammo_casing/c10mm
|
||||
caliber = "10mm"
|
||||
max_ammo = 8
|
||||
multiple_sprites = 2
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/rifle
|
||||
name = "rifle magazine (10mm)"
|
||||
desc = "A well-worn magazine fitted for the surplus rifle."
|
||||
icon_state = "75-8"
|
||||
ammo_type = /obj/item/ammo_casing/c10mm
|
||||
caliber = "10mm"
|
||||
max_ammo = 10
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/rifle/update_icon()
|
||||
if(ammo_count())
|
||||
icon_state = "75-8"
|
||||
else
|
||||
icon_state = "75-0"
|
||||
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/fire
|
||||
name = "pistol magazine (10mm incendiary)"
|
||||
icon_state = "9x19pI"
|
||||
desc = "A gun magazine. Loaded with rounds which ignite the target."
|
||||
ammo_type = /obj/item/ammo_casing/c10mm/fire
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/hp
|
||||
name = "pistol magazine (10mm HP)"
|
||||
icon_state = "9x19pH"
|
||||
desc= "A gun magazine. Loaded with hollow-point rounds, extremely effective against unarmored targets, but nearly useless against protective clothing."
|
||||
ammo_type = /obj/item/ammo_casing/c10mm/hp
|
||||
|
||||
/obj/item/ammo_box/magazine/m10mm/ap
|
||||
name = "pistol magazine (10mm AP)"
|
||||
icon_state = "9x19pA"
|
||||
desc= "A gun magazine. Loaded with rounds which penetrate armour, but are less effective against normal targets."
|
||||
ammo_type = /obj/item/ammo_casing/c10mm/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/m45
|
||||
name = "handgun magazine (.45)"
|
||||
icon_state = "45-8"
|
||||
ammo_type = /obj/item/ammo_casing/c45
|
||||
caliber = ".45"
|
||||
max_ammo = 8
|
||||
|
||||
/obj/item/ammo_box/magazine/m45/update_icon()
|
||||
..()
|
||||
icon_state = "45-[ammo_count() ? "8" : "0"]"
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9
|
||||
name = "wt550 magazine (4.6x30mm)"
|
||||
icon_state = "46x30mmt-20"
|
||||
ammo_type = /obj/item/ammo_casing/c46x30mm
|
||||
caliber = "4.6x30mm"
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/update_icon()
|
||||
..()
|
||||
icon_state = "46x30mmt-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtap
|
||||
name = "wt550 magazine (Armour Piercing 4.6x30mm)"
|
||||
icon_state = "46x30mmtA-20"
|
||||
ammo_type = /obj/item/ammo_casing/c46x30mm/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtap/update_icon()
|
||||
..()
|
||||
icon_state = "46x30mmtA-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtic
|
||||
name = "wt550 magazine (Incindiary 4.6x30mm)"
|
||||
icon_state = "46x30mmtI-20"
|
||||
ammo_type = /obj/item/ammo_casing/c46x30mm/inc
|
||||
|
||||
/obj/item/ammo_box/magazine/wt550m9/wtic/update_icon()
|
||||
..()
|
||||
icon_state = "46x30mmtI-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/uzim9mm
|
||||
name = "uzi magazine (9mm)"
|
||||
icon_state = "uzi9mm-32"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm
|
||||
caliber = "9mm"
|
||||
max_ammo = 32
|
||||
|
||||
/obj/item/ammo_box/magazine/uzim9mm/update_icon()
|
||||
..()
|
||||
icon_state = "uzi9mm-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm
|
||||
name = "SMG magazine (9mm)"
|
||||
icon_state = "smg9mm-42"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm
|
||||
caliber = "9mm"
|
||||
max_ammo = 21
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm/update_icon()
|
||||
..()
|
||||
icon_state = "smg9mm-[ammo_count() ? "42" : "0"]"
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm/ap
|
||||
name = "SMG magazine (Armour Piercing 9mm)"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm9mm/fire
|
||||
name = "SMG Magazine (Incindiary 9mm)"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm/inc
|
||||
|
||||
/obj/item/ammo_box/magazine/pistolm9mm
|
||||
name = "pistol magazine (9mm)"
|
||||
icon_state = "9x19p-8"
|
||||
ammo_type = /obj/item/ammo_casing/c9mm
|
||||
caliber = "9mm"
|
||||
max_ammo = 15
|
||||
|
||||
/obj/item/ammo_box/magazine/pistolm9mm/update_icon()
|
||||
..()
|
||||
icon_state = "9x19p-[ammo_count() ? "8" : "0"]"
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm45
|
||||
name = "SMG magazine (.45)"
|
||||
icon_state = "c20r45-24"
|
||||
ammo_type = /obj/item/ammo_casing/c45/nostamina
|
||||
caliber = ".45"
|
||||
max_ammo = 24
|
||||
|
||||
/obj/item/ammo_box/magazine/smgm45/update_icon()
|
||||
..()
|
||||
icon_state = "c20r45-[round(ammo_count(),2)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/tommygunm45
|
||||
name = "drum magazine (.45)"
|
||||
icon_state = "drum45"
|
||||
ammo_type = /obj/item/ammo_casing/c45
|
||||
caliber = ".45"
|
||||
max_ammo = 50
|
||||
|
||||
/obj/item/ammo_box/magazine/m50
|
||||
name = "handgun magazine (.50ae)"
|
||||
icon_state = "50ae"
|
||||
ammo_type = /obj/item/ammo_casing/a50AE
|
||||
caliber = ".50"
|
||||
max_ammo = 7
|
||||
multiple_sprites = 1
|
||||
|
||||
/obj/item/ammo_box/magazine/m75
|
||||
name = "specialized magazine (.75)"
|
||||
icon_state = "75"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/a75
|
||||
caliber = "75"
|
||||
multiple_sprites = 2
|
||||
max_ammo = 8
|
||||
|
||||
/obj/item/ammo_box/magazine/m556
|
||||
name = "toploader magazine (5.56mm)"
|
||||
icon_state = "5.56m"
|
||||
ammo_type = /obj/item/ammo_casing/a556
|
||||
caliber = "a556"
|
||||
max_ammo = 30
|
||||
multiple_sprites = 2
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g
|
||||
name = "shotgun magazine (12g taser slugs)"
|
||||
desc = "A drum magazine."
|
||||
icon_state = "m12gs"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/stunslug
|
||||
caliber = "shotgun"
|
||||
max_ammo = 8
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)]-[CEILING(ammo_count(0)/8, 1)*8]"
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/buckshot
|
||||
name = "shotgun magazine (12g buckshot slugs)"
|
||||
icon_state = "m12gb"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/slug
|
||||
name = "shotgun magazine (12g slugs)"
|
||||
icon_state = "m12gb"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/dragon
|
||||
name = "shotgun magazine (12g dragon's breath)"
|
||||
icon_state = "m12gf"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/dragonsbreath
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/bioterror
|
||||
name = "shotgun magazine (12g bioterror)"
|
||||
icon_state = "m12gt"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/dart/bioterror
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/meteor
|
||||
name = "shotgun magazine (12g meteor slugs)"
|
||||
icon_state = "m12gbc"
|
||||
ammo_type = /obj/item/ammo_casing/shotgun/meteorslug
|
||||
|
||||
|
||||
//// SNIPER MAGAZINES
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds
|
||||
name = "sniper rounds (.50)"
|
||||
icon_state = ".50mag"
|
||||
ammo_type = /obj/item/ammo_casing/p50
|
||||
max_ammo = 6
|
||||
caliber = ".50"
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds/update_icon()
|
||||
if(ammo_count())
|
||||
icon_state = "[initial(icon_state)]-ammo"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds/soporific
|
||||
name = "sniper rounds (Zzzzz)"
|
||||
desc = "Soporific sniper rounds, designed for happy days and dead quiet nights..."
|
||||
icon_state = "soporific"
|
||||
ammo_type = /obj/item/ammo_casing/p50/soporific
|
||||
max_ammo = 3
|
||||
caliber = ".50"
|
||||
|
||||
/obj/item/ammo_box/magazine/sniper_rounds/penetrator
|
||||
name = "sniper rounds (penetrator)"
|
||||
desc = "An extremely powerful round capable of passing straight through cover and anyone unfortunate enough to be behind it."
|
||||
ammo_type = /obj/item/ammo_casing/p50/penetrator
|
||||
max_ammo = 5
|
||||
|
||||
//// SAW MAGAZINES
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129
|
||||
name = "box magazine (1.95x129mm)"
|
||||
icon_state = "a762-50"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129
|
||||
caliber = "mm195129"
|
||||
max_ammo = 50
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/hollow
|
||||
name = "box magazine (Hollow-Point 1.95x129mm)"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129/hollow
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/ap
|
||||
name = "box magazine (Armor Penetrating 1.95x129mm)"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129/ap
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/incen
|
||||
name = "box magazine (Incendiary 1.95x129mm)"
|
||||
ammo_type = /obj/item/ammo_casing/mm195x129/incen
|
||||
|
||||
/obj/item/ammo_box/magazine/mm195x129/update_icon()
|
||||
..()
|
||||
icon_state = "a762-[round(ammo_count(),10)]"
|
||||
|
||||
|
||||
|
||||
|
||||
////TOY GUN MAGAZINES
|
||||
|
||||
/obj/item/ammo_box/magazine/toy
|
||||
name = "foam force META magazine"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
caliber = "foam_force"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smg
|
||||
name = "foam force SMG magazine"
|
||||
icon_state = "smg9mm-42"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smg/update_icon()
|
||||
..()
|
||||
if(ammo_count())
|
||||
icon_state = "smg9mm-42"
|
||||
else
|
||||
icon_state = "smg9mm-0"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smg/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/pistol
|
||||
name = "foam force pistol magazine"
|
||||
icon_state = "9x19p"
|
||||
max_ammo = 8
|
||||
multiple_sprites = 2
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/pistol/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smgm45
|
||||
name = "donksoft SMG magazine"
|
||||
caliber = "foam_force"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smgm45/update_icon()
|
||||
..()
|
||||
icon_state = "c20r45-[round(ammo_count(),2)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/smgm45/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/m762
|
||||
name = "donksoft box magazine"
|
||||
caliber = "foam_force"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
max_ammo = 50
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/m762/update_icon()
|
||||
..()
|
||||
icon_state = "a762-[round(ammo_count(),10)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/toy/m762/riot
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
|
||||
|
||||
|
||||
|
||||
|
||||
//// RECHARGEABLE MAGAZINES
|
||||
|
||||
/obj/item/ammo_box/magazine/recharge
|
||||
name = "power pack"
|
||||
desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles."
|
||||
icon_state = "oldrifle-20"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/laser
|
||||
caliber = "laser"
|
||||
max_ammo = 20
|
||||
|
||||
/obj/item/ammo_box/magazine/recharge/update_icon()
|
||||
desc = "[initial(desc)] It has [stored_ammo.len] shot\s left."
|
||||
icon_state = "oldrifle-[round(ammo_count(),4)]"
|
||||
|
||||
/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
|
||||
return
|
||||
@@ -0,0 +1,47 @@
|
||||
/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 FALSE
|
||||
|
||||
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.forceMove(src)
|
||||
|
||||
if(bullet)
|
||||
bullet.forceMove(drop_location())
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
@@ -0,0 +1,7 @@
|
||||
/obj/item/ammo_box/magazine/internal
|
||||
desc = "Oh god, this shouldn't be here"
|
||||
flags_1 = CONDUCT_1|ABSTRACT_1
|
||||
|
||||
//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)
|
||||
17
code/modules/projectiles/boxes_magazines/internal/grenade.dm
Normal file
17
code/modules/projectiles/boxes_magazines/internal/grenade.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/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/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
|
||||
11
code/modules/projectiles/boxes_magazines/internal/misc.dm
Normal file
11
code/modules/projectiles/boxes_magazines/internal/misc.dm
Normal file
@@ -0,0 +1,11 @@
|
||||
/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/minigun
|
||||
name = "gatling gun fusion core"
|
||||
ammo_type = /obj/item/ammo_casing/caseless/laser/gatling
|
||||
caliber = "gatling"
|
||||
max_ammo = 5000
|
||||
@@ -0,0 +1,22 @@
|
||||
/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/rev762
|
||||
name = "nagant revolver cylinder"
|
||||
ammo_type = /obj/item/ammo_casing/n762
|
||||
caliber = "n762"
|
||||
max_ammo = 7
|
||||
|
||||
/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/Initialize()
|
||||
stored_ammo += new ammo_type(src)
|
||||
. = ..()
|
||||
15
code/modules/projectiles/boxes_magazines/internal/rifle.dm
Normal file
15
code/modules/projectiles/boxes_magazines/internal/rifle.dm
Normal file
@@ -0,0 +1,15 @@
|
||||
/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
|
||||
|
||||
48
code/modules/projectiles/boxes_magazines/internal/shotgun.dm
Normal file
48
code/modules/projectiles/boxes_magazines/internal/shotgun.dm
Normal file
@@ -0,0 +1,48 @@
|
||||
/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
|
||||
7
code/modules/projectiles/boxes_magazines/internal/toy.dm
Normal file
7
code/modules/projectiles/boxes_magazines/internal/toy.dm
Normal file
@@ -0,0 +1,7 @@
|
||||
/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
|
||||
@@ -1,191 +0,0 @@
|
||||
////////////////INTERNAL MAGAZINES//////////////////////
|
||||
|
||||
/obj/item/ammo_box/magazine/internal
|
||||
desc = "Oh god, this shouldn't be here"
|
||||
flags_1 = CONDUCT_1|ABSTRACT_1
|
||||
|
||||
//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.forceMove(src)
|
||||
|
||||
if(bullet)
|
||||
bullet.forceMove(drop_location())
|
||||
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/Initialize()
|
||||
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
|
||||
Reference in New Issue
Block a user