Revert "sync"

This reverts commit a432886ba3.
This commit is contained in:
LetterJay
2017-02-07 23:21:03 -06:00
parent 84f36e3496
commit ceebde6620
134 changed files with 0 additions and 366166 deletions
@@ -1,69 +0,0 @@
/obj/item/ammo_box/a357
name = "speed loader (.357)"
desc = "Designed to quickly reload revolvers."
icon_state = "357"
ammo_type = /obj/item/ammo_casing/a357
max_ammo = 7
multiple_sprites = 1
/obj/item/ammo_box/c38
name = "speed loader (.38)"
desc = "Designed to quickly reload revolvers."
icon_state = "38"
ammo_type = /obj/item/ammo_casing/c38
max_ammo = 6
multiple_sprites = 1
/obj/item/ammo_box/c9mm
name = "ammo box (9mm)"
icon_state = "9mmbox"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/c9mm
max_ammo = 30
/obj/item/ammo_box/c10mm
name = "ammo box (10mm)"
icon_state = "10mmbox"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/c10mm
max_ammo = 20
/obj/item/ammo_box/c45
name = "ammo box (.45)"
icon_state = "45box"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/c45
max_ammo = 20
/obj/item/ammo_box/a40mm
name = "ammo box (40mm grenades)"
icon_state = "40mm"
ammo_type = /obj/item/ammo_casing/a40mm
max_ammo = 4
multiple_sprites = 1
/obj/item/ammo_box/a762
name = "stripper clip (7.62mm)"
desc = "A stripper clip."
icon_state = "762"
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 5
multiple_sprites = 1
/obj/item/ammo_box/n762
name = "ammo box (7.62x38mmR)"
icon_state = "10mmbox"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/n762
max_ammo = 14
/obj/item/ammo_box/foambox
name = "ammo box (Foam Darts)"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foambox"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
max_ammo = 40
/obj/item/ammo_box/foambox/riot
icon_state = "foambox_riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
@@ -1,499 +0,0 @@
////////////////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/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/speargun
name = "speargun internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/magspear
caliber = "speargun"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/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/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
///////////EXTERNAL MAGAZINES////////////////
/obj/item/ammo_box/magazine/m10mm
name = "pistol magazine (10mm)"
desc = "A gun magazine."
icon_state = "9x19p"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/c10mm
caliber = "10mm"
max_ammo = 8
multiple_sprites = 2
/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)"
ammo_type = /obj/item/ammo_casing/c46x30mmap
/obj/item/ammo_box/magazine/wt550m9/wttx
name = "wt550 magazine (Toxin Tipped 4.6x30mm)"
ammo_type = /obj/item/ammo_casing/c46x30mmtox
/obj/item/ammo_box/magazine/wt550m9/wtic
name = "wt550 magazine (Incindiary 4.6x30mm)"
ammo_type = /obj/item/ammo_casing/c46x30mminc
/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/c9mmap
/obj/item/ammo_box/magazine/smgm9mm/toxin
name = "SMG magazine (Toxin Tipped 9mm)"
ammo_type = /obj/item/ammo_casing/c9mmtox
/obj/item/ammo_box/magazine/smgm9mm/fire
name = "SMG Magazine (Incindiary 9mm)"
ammo_type = /obj/item/ammo_casing/c9mminc
/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"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/c45nostamina
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"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/a50
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"
origin_tech = "combat=5;syndicate=1"
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
origin_tech = "combat=3;syndicate=1"
caliber = "shotgun"
max_ammo = 8
/obj/item/ammo_box/magazine/m12g/update_icon()
..()
icon_state = "[initial(icon_state)]-[Ceiling(ammo_count(0)/8)*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/incendiary/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/breach
name = "shotgun magazine (12g breacher slugs)"
icon_state = "m12gbc"
ammo_type = /obj/item/ammo_casing/shotgun/breaching
//// SNIPER MAGAZINES
/obj/item/ammo_box/magazine/sniper_rounds
name = "sniper rounds (.50)"
icon_state = ".50mag"
origin_tech = "combat=6;syndicate=2"
ammo_type = /obj/item/ammo_casing/point50
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"
origin_tech = "combat=6;syndicate=3"
ammo_type = /obj/item/ammo_casing/soporific
max_ammo = 3
caliber = ".50"
/obj/item/ammo_box/magazine/sniper_rounds/haemorrhage
name = "sniper rounds (Bleed)"
desc = "Haemorrhage sniper rounds, leaves your target in a pool of crimson pain"
icon_state = "haemorrhage"
ammo_type = /obj/item/ammo_casing/haemorrhage
max_ammo = 5
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/penetrator
origin_tech = "combat=6;syndicate=3"
max_ammo = 5
//// SAW MAGAZINES
/obj/item/ammo_box/magazine/mm556x45
name = "box magazine (5.56x45mm)"
icon_state = "a762-50"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/mm556x45
caliber = "mm55645"
max_ammo = 50
/obj/item/ammo_box/magazine/mm556x45/bleeding
name = "box magazine (Bleeding 5.56x45mm)"
origin_tech = "combat=3"
ammo_type = /obj/item/ammo_casing/mm556x45/bleeding
/obj/item/ammo_box/magazine/mm556x45/hollow
name = "box magazine (Hollow-Point 5.56x45mm)"
origin_tech = "combat=3"
ammo_type = /obj/item/ammo_casing/mm556x45/hollow
/obj/item/ammo_box/magazine/mm556x45/ap
name = "box magazine (Armor Penetrating 5.56x45mm)"
origin_tech = "combat=4"
ammo_type = /obj/item/ammo_casing/mm556x45/ap
/obj/item/ammo_box/magazine/mm556x45/incen
name = "box magazine (Incendiary 5.56x45mm)"
origin_tech = "combat=4"
ammo_type = /obj/item/ammo_casing/mm556x45/incen
/obj/item/ammo_box/magazine/mm556x45/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-20"
max_ammo = 20
/obj/item/ammo_box/magazine/toy/smg/update_icon()
..()
icon_state = "smg9mm-[round(ammo_count(),5)]"
/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/riot
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/m762
name = "donksoft box magazine"
caliber = "foam_force"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
max_ammo = 50
/obj/item/ammo_box/magazine/toy/m762/update_icon()
..()
icon_state = "a762-[round(ammo_count(),10)]"
//// 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
@@ -1,81 +0,0 @@
/obj/item/weapon/gun/energy/gun
name = "energy gun"
desc = "A basic hybrid energy gun with two settings: disable and kill."
icon_state = "energy"
item_state = null //so the human update icon uses the icon_state instead.
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser)
origin_tech = "combat=4;magnets=3"
modifystate = 2
can_flashlight = 1
ammo_x_offset = 3
flight_x_offset = 15
flight_y_offset = 10
/obj/item/weapon/gun/energy/gun/mini
name = "miniature energy gun"
desc = "A small, pistol-sized energy gun with a built-in flashlight. It has two settings: stun and kill."
icon_state = "mini"
item_state = "gun"
w_class = 2
cell_type = /obj/item/weapon/stock_parts/cell{charge = 600; maxcharge = 600}
ammo_x_offset = 2
charge_sections = 3
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
/obj/item/weapon/gun/energy/gun/mini/New()
F = new /obj/item/device/flashlight/seclite(src)
..()
/obj/item/weapon/gun/energy/gun/mini/update_icon()
..()
if(F && F.on)
add_overlay("mini-light")
/obj/item/weapon/gun/energy/gun/hos
name = "\improper X-01 MultiPhase Energy Gun"
desc = "This is an expensive, modern recreation of an antique laser gun. This gun has several unique firemodes, but lacks the ability to recharge over time."
icon_state = "hoslaser"
origin_tech = null
force = 10
ammo_type = list(/obj/item/ammo_casing/energy/electrode/hos, /obj/item/ammo_casing/energy/laser/hos, /obj/item/ammo_casing/energy/disabler)
ammo_x_offset = 4
/obj/item/weapon/gun/energy/gun/dragnet
name = "\improper DRAGnet"
desc = "The \"Dynamic Rapid-Apprehension of the Guilty\" net is a revolution in law enforcement technology."
icon_state = "dragnet"
origin_tech = "combat=4;magnets=3;bluespace=4"
ammo_type = list(/obj/item/ammo_casing/energy/net, /obj/item/ammo_casing/energy/trap)
can_flashlight = 0
ammo_x_offset = 1
/obj/item/weapon/gun/energy/gun/dragnet/snare
name = "Energy Snare Launcher"
desc = "Fires an energy snare that slows the target down"
ammo_type = list(/obj/item/ammo_casing/energy/trap)
/obj/item/weapon/gun/energy/gun/turret
name = "hybrid turret gun"
desc = "A heavy hybrid energy cannon with two settings: Stun and kill."
icon_state = "turretlaser"
item_state = "turretlaser"
slot_flags = null
w_class = 5
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
weapon_weight = WEAPON_MEDIUM
can_flashlight = 0
trigger_guard = TRIGGER_GUARD_NONE
ammo_x_offset = 2
/obj/item/weapon/gun/energy/gun/nuclear
name = "advanced energy gun"
desc = "An energy gun with an experimental miniaturized nuclear reactor that automatically charges the internal power cell."
icon_state = "nucgun"
item_state = "nucgun"
origin_tech = "combat=4;magnets=4;powerstorage=4"
charge_delay = 5
pin = null
can_charge = 0
ammo_x_offset = 1
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/disabler)
selfcharge = 1
-208
View File
@@ -1,208 +0,0 @@
/obj/item/weapon/gun/projectile
desc = "Now comes in flavors like GUN. Uses 10mm ammo, for some reason"
name = "projectile gun"
icon_state = "pistol"
origin_tech = "combat=2;materials=2"
w_class = 3
var/mag_type = /obj/item/ammo_box/magazine/m10mm //Removes the need for max_ammo and caliber info
var/obj/item/ammo_box/magazine/magazine
/obj/item/weapon/gun/projectile/New()
..()
if (!magazine)
magazine = new mag_type(src)
chamber_round()
update_icon()
/obj/item/weapon/gun/projectile/update_icon()
..()
if(current_skin)
icon_state = "[current_skin][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
else
icon_state = "[initial(icon_state)][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
/obj/item/weapon/gun/projectile/process_chamber(eject_casing = 1, empty_chamber = 1)
// if(in_chamber)
// return 1
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(isnull(AC) || !istype(AC))
chamber_round()
return
if(eject_casing)
AC.loc = get_turf(src) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
if(empty_chamber)
chambered = null
chamber_round()
return
/obj/item/weapon/gun/projectile/proc/chamber_round()
if (chambered || !magazine)
return
else if (magazine.ammo_count())
chambered = magazine.get_round()
chambered.loc = src
return
/obj/item/weapon/gun/projectile/can_shoot()
if(!magazine || !magazine.ammo_count(0))
return 0
return 1
/obj/item/weapon/gun/projectile/attackby(obj/item/A, mob/user, params)
..()
if (istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if (!magazine && istype(AM, mag_type))
user.remove_from_mob(AM)
magazine = AM
magazine.loc = src
user << "<span class='notice'>You load a new magazine into \the [src].</span>"
chamber_round()
A.update_icon()
update_icon()
return 1
else if (magazine)
user << "<span class='notice'>There's already a magazine in \the [src].</span>"
if(istype(A, /obj/item/weapon/suppressor))
var/obj/item/weapon/suppressor/S = A
if(can_suppress)
if(!suppressed)
if(!user.unEquip(A))
return
user << "<span class='notice'>You screw [S] onto [src].</span>"
suppressed = A
S.oldsound = fire_sound
S.initial_w_class = w_class
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
w_class = 3 //so pistols do not fit in pockets when suppressed
A.loc = src
update_icon()
return
else
user << "<span class='warning'>[src] already has a suppressor!</span>"
return
else
user << "<span class='warning'>You can't seem to figure out how to fit [S] on [src]!</span>"
return
return 0
/obj/item/weapon/gun/projectile/attack_hand(mob/user)
if(loc == user)
if(suppressed && can_unsuppress)
var/obj/item/weapon/suppressor/S = suppressed
if(user.l_hand != src && user.r_hand != src)
..()
return
user << "<span class='notice'>You unscrew [suppressed] from [src].</span>"
user.put_in_hands(suppressed)
fire_sound = S.oldsound
w_class = S.initial_w_class
suppressed = 0
update_icon()
return
..()
/obj/item/weapon/gun/projectile/attack_self(mob/living/user)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(magazine)
magazine.loc = get_turf(src.loc)
user.put_in_hands(magazine)
magazine.update_icon()
magazine = null
user << "<span class='notice'>You pull the magazine out of \the [src].</span>"
else if(chambered)
AC.loc = get_turf(src)
AC.SpinAnimation(10, 1)
chambered = null
user << "<span class='notice'>You unload the round from \the [src]'s chamber.</span>"
else
user << "<span class='notice'>There's no magazine in \the [src].</span>"
update_icon()
return
/obj/item/weapon/gun/projectile/examine(mob/user)
..()
user << "Has [get_ammo()] round\s remaining."
/obj/item/weapon/gun/projectile/proc/get_ammo(countchambered = 1)
var/boolets = 0 //mature var names for mature people
if (chambered && countchambered)
boolets++
if (magazine)
boolets += magazine.ammo_count()
return boolets
/obj/item/weapon/gun/projectile/suicide_act(mob/user)
if (src.chambered && src.chambered.BB && !src.chambered.BB.nodamage)
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
sleep(25)
if(user.l_hand == src || user.r_hand == src)
process_fire(user, user, 0, zone_override = "head")
user.visible_message("<span class='suicide'>[user] blows \his brains out with the [src.name]!</span>")
return(BRUTELOSS)
else
user.visible_message("<span class='suicide'>[user] panics and starts choking to death!</span>")
return(OXYLOSS)
else
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [src.name]! It looks like \he's trying to commit suicide!</b></span>")
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
return (OXYLOSS)
/obj/item/weapon/gun/projectile/proc/sawoff(mob/user)
if(sawn_state == SAWN_OFF)
user << "<span class='warning'>\The [src] is already shortened!</span>"
return
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message("[user] begins to shorten \the [src].", "<span class='notice'>You begin to shorten \the [src]...</span>")
//if there's any live ammo inside the gun, makes it go off
if(blow_up(user))
user.visible_message("<span class='danger'>\The [src] goes off!</span>", "<span class='danger'>\The [src] goes off in your face!</span>")
return
if(do_after(user, 30, target = src))
if(sawn_state == SAWN_OFF)
return
user.visible_message("[user] shortens \the [src]!", "<span class='notice'>You shorten \the [src].</span>")
name = "sawn-off [src.name]"
desc = sawn_desc
w_class = 3
item_state = "gun"//phil235 is it different with different skin?
slot_flags &= ~SLOT_BACK //you can't sling it on your back
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
sawn_state = SAWN_OFF
update_icon()
return 1
// Sawing guns related proc
/obj/item/weapon/gun/projectile/proc/blow_up(mob/user)
. = 0
for(var/obj/item/ammo_casing/AC in magazine.stored_ammo)
if(AC.BB)
process_fire(user, user,0)
. = 1
/obj/item/weapon/suppressor
name = "suppressor"
desc = "A universal syndicate small-arms suppressor for maximum espionage."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "suppressor"
w_class = 2
var/oldsound = null
var/initial_w_class = null
/obj/item/weapon/suppressor/specialoffer
name = "cheap suppressor"
desc = "A foreign knock-off suppressor, it feels flimsy, cheap, and brittle. Still fits all weapons."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "suppressor"
@@ -1,409 +0,0 @@
/obj/item/weapon/gun/projectile/automatic
origin_tech = "combat=4;materials=2"
w_class = 3
var/alarmed = 0
var/select = 1
can_suppress = 1
burst_size = 3
fire_delay = 2
actions_types = list(/datum/action/item_action/toggle_firemode)
/obj/item/weapon/gun/projectile/automatic/proto
name = "\improper NanoTrasen Saber SMG"
desc = "A prototype three-round burst 9mm submachine gun, designated 'SABR'. Has a threaded barrel for suppressors."
icon_state = "saber"
mag_type = /obj/item/ammo_box/magazine/smgm9mm
pin = null
/obj/item/weapon/gun/projectile/automatic/proto/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/update_icon()
..()
cut_overlays()
if(!select)
add_overlay("[initial(icon_state)]semi")
if(select == 1)
add_overlay("[initial(icon_state)]burst")
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
/obj/item/weapon/gun/projectile/automatic/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
if(istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if(istype(AM, mag_type))
if(magazine)
user << "<span class='notice'>You perform a tactical reload on \the [src], replacing the magazine.</span>"
magazine.loc = get_turf(src.loc)
magazine.update_icon()
magazine = null
else
user << "<span class='notice'>You insert the magazine into \the [src].</span>"
user.remove_from_mob(AM)
magazine = AM
magazine.loc = src
chamber_round()
A.update_icon()
update_icon()
return 1
/obj/item/weapon/gun/projectile/automatic/ui_action_click()
burst_select()
/obj/item/weapon/gun/projectile/automatic/proc/burst_select()
var/mob/living/carbon/human/user = usr
select = !select
if(!select)
burst_size = 1
fire_delay = 0
user << "<span class='notice'>You switch to semi-automatic.</span>"
else
burst_size = initial(burst_size)
fire_delay = initial(fire_delay)
user << "<span class='notice'>You switch to [burst_size]-rnd burst.</span>"
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
update_icon()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/weapon/gun/projectile/automatic/can_shoot()
return get_ammo()
/obj/item/weapon/gun/projectile/automatic/proc/empty_alarm()
if(!chambered && !get_ammo() && !alarmed)
playsound(src.loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
update_icon()
alarmed = 1
return
/obj/item/weapon/gun/projectile/automatic/c20r
name = "\improper C-20r SMG"
desc = "A bullpup two-round burst .45 SMG, designated 'C-20r'. Has a 'Scarborough Arms - Per falcis, per pravitas' buttstamp."
icon_state = "c20r"
item_state = "c20r"
origin_tech = "combat=5;materials=2;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/smgm45
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
fire_delay = 2
burst_size = 2
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/automatic/c20r/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/c20r/New()
..()
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/c20r/afterattack()
..()
empty_alarm()
return
/obj/item/weapon/gun/projectile/automatic/c20r/update_icon()
..()
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
/obj/item/weapon/gun/projectile/automatic/wt550
name = "security auto rifle"
desc = "An outdated personal defence weapon. Uses 4.6x30mm rounds and is designated the WT-550 Automatic Rifle."
icon_state = "wt550"
item_state = "arg"
mag_type = /obj/item/ammo_box/magazine/wt550m9
fire_delay = 2
can_suppress = 0
burst_size = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/wt550/update_icon()
..()
icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
/obj/item/weapon/gun/projectile/automatic/mini_uzi
name = "\improper 'Type U3' Uzi"
desc = "A lightweight, burst-fire submachine gun, for when you really want someone dead. Uses 9mm rounds."
icon_state = "mini-uzi"
origin_tech = "combat=4;materials=2;syndicate=4"
mag_type = /obj/item/ammo_box/magazine/uzim9mm
burst_size = 2
/obj/item/weapon/gun/projectile/automatic/m90
name = "\improper M-90gl Carbine"
desc = "A three-round burst 5.56 toploading carbine, designated 'M-90gl'. Has an attached underbarrel grenade launcher which can be toggled on and off."
icon_state = "m90"
item_state = "m90"
origin_tech = "combat=5;materials=2;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/m556
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
can_suppress = 0
var/obj/item/weapon/gun/projectile/revolver/grenadelauncher/underbarrel
burst_size = 3
fire_delay = 2
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/automatic/m90/New()
..()
underbarrel = new /obj/item/weapon/gun/projectile/revolver/grenadelauncher(src)
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/m90/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/m90/unrestricted/New()
..()
underbarrel = new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/unrestricted(src)
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
if(select == 2)
underbarrel.afterattack(target, user, flag, params)
else
..()
return
/obj/item/weapon/gun/projectile/automatic/m90/attackby(obj/item/A, mob/user, params)
if(istype(A, /obj/item/ammo_casing))
if(istype(A, underbarrel.magazine.ammo_type))
underbarrel.attack_self()
underbarrel.attackby(A, user, params)
else
..()
/obj/item/weapon/gun/projectile/automatic/m90/update_icon()
..()
cut_overlays()
switch(select)
if(0)
add_overlay("[initial(icon_state)]semi")
if(1)
add_overlay("[initial(icon_state)]burst")
if(2)
add_overlay("[initial(icon_state)]gren")
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
return
/obj/item/weapon/gun/projectile/automatic/m90/burst_select()
var/mob/living/carbon/human/user = usr
switch(select)
if(0)
select = 1
burst_size = initial(burst_size)
fire_delay = initial(fire_delay)
user << "<span class='notice'>You switch to [burst_size]-rnd burst.</span>"
if(1)
select = 2
user << "<span class='notice'>You switch to grenades.</span>"
if(2)
select = 0
burst_size = 1
fire_delay = 0
user << "<span class='notice'>You switch to semi-auto.</span>"
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/tommygun
name = "\improper Thompson SMG"
desc = "Based on the classic 'Chicago Typewriter'."
icon_state = "tommygun"
item_state = "shotgun"
w_class = 5
slot_flags = 0
origin_tech = "combat=5;materials=1;syndicate=3"
mag_type = /obj/item/ammo_box/magazine/tommygunm45
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
can_suppress = 0
burst_size = 4
fire_delay = 1
/obj/item/weapon/gun/projectile/automatic/ar
name = "\improper NT-ARG 'Boarder'"
desc = "A robust assault rile used by Nanotrasen fighting forces."
icon_state = "arg"
item_state = "arg"
slot_flags = 0
origin_tech = "combat=6;engineering=4"
mag_type = /obj/item/ammo_box/magazine/m556
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
can_suppress = 0
burst_size = 3
fire_delay = 1
// Bulldog shotgun //
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog
name = "\improper 'Bulldog' Shotgun"
desc = "A semi-auto, mag-fed shotgun for combat in narrow corridors, nicknamed 'Bulldog' by boarding parties. Compatible only with specialized 8-round drum magazines."
icon_state = "bulldog"
item_state = "bulldog"
w_class = 3
origin_tech = "combat=6;materials=4;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/m12g
fire_sound = 'sound/weapons/Gunshot.ogg'
can_suppress = 0
burst_size = 1
fire_delay = 0
pin = /obj/item/device/firing_pin/implant/pindicate
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/New()
..()
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/proc/update_magazine()
if(magazine)
src.overlays = 0
add_overlay("[magazine.icon_state]")
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/update_icon()
src.overlays = 0
update_magazine()
icon_state = "bulldog[chambered ? "" : "-e"]"
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/afterattack()
..()
empty_alarm()
return
// L6 SAW //
/obj/item/weapon/gun/projectile/automatic/l6_saw
name = "\improper L6 SAW"
desc = "A heavily modified 5.56x45mm light machine gun, designated 'L6 SAW'. Has 'Aussec Armoury - 2531' engraved on the receiver below the designation."
icon_state = "l6closed100"
item_state = "l6closedmag"
w_class = 5
slot_flags = 0
origin_tech = "combat=6;engineering=3;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/mm556x45
weapon_weight = WEAPON_MEDIUM
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
var/cover_open = 0
can_suppress = 0
burst_size = 3
fire_delay = 1
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/automatic/l6_saw/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_self(mob/user)
cover_open = !cover_open
user << "<span class='notice'>You [cover_open ? "open" : "close"] [src]'s cover.</span>"
update_icon()
/obj/item/weapon/gun/projectile/automatic/l6_saw/update_icon()
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? Ceiling(get_ammo(0)/12.5)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
/obj/item/weapon/gun/projectile/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params) //what I tried to do here is just add a check to see if the cover is open or not and add an icon_state change because I can't figure out how c-20rs do it with overlays
if(cover_open)
user << "<span class='warning'>[src]'s cover is open! Close it before firing!</span>"
else
..()
update_icon()
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_hand(mob/user)
if(loc != user)
..()
return //let them pick it up
if(!cover_open || (cover_open && !magazine))
..()
else if(cover_open && magazine)
//drop the mag
magazine.update_icon()
magazine.loc = get_turf(src.loc)
user.put_in_hands(magazine)
magazine = null
update_icon()
user << "<span class='notice'>You remove the magazine from [src].</span>"
/obj/item/weapon/gun/projectile/automatic/l6_saw/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
if(!cover_open)
user << "<span class='warning'>[src]'s cover is closed! You can't insert a new mag.</span>"
return
..()
// SNIPER //
/obj/item/weapon/gun/projectile/automatic/sniper_rifle
name = "sniper rifle"
desc = "The kind of gun that will leave you crying for mummy before you even realise your leg's missing"
icon_state = "sniper"
item_state = "sniper"
recoil = 2
weapon_weight = WEAPON_MEDIUM
mag_type = /obj/item/ammo_box/magazine/sniper_rounds
fire_delay = 40
burst_size = 1
origin_tech = "combat=7"
can_unsuppress = 1
can_suppress = 1
w_class = 3
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
slot_flags = SLOT_BACK
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/sniper_rifle/update_icon()
if(magazine)
icon_state = "sniper-mag"
else
icon_state = "sniper"
/obj/item/weapon/gun/projectile/automatic/sniper_rifle/syndicate
name = "syndicate sniper rifle"
desc = "Syndicate flavoured sniper rifle, it packs quite a punch, a punch to your face"
pin = /obj/item/device/firing_pin/implant/pindicate
origin_tech = "combat=7;syndicate=6"
// Laser rifle (rechargeable magazine) //
/obj/item/weapon/gun/projectile/automatic/laser
name = "laser rifle"
desc = "Though sometimes mocked for the relatively weak firepower of their energy weapons, the logistic miracle of rechargable ammunition has given Nanotrasen a decisive edge over many a foe."
icon_state = "oldrifle"
item_state = "arg"
mag_type = /obj/item/ammo_box/magazine/recharge
fire_delay = 2
can_suppress = 0
burst_size = 0
actions_types = list()
fire_sound = 'sound/weapons/Laser.ogg'
/obj/item/weapon/gun/projectile/automatic/laser/process_chamber(eject_casing = 0, empty_chamber = 1)
..() //we changed the default value of the first argument
/obj/item/weapon/gun/projectile/automatic/laser/update_icon()
..()
icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
return
@@ -1,153 +0,0 @@
//The ammo/gun is stored in a back slot item
/obj/item/weapon/minigunpack
name = "backpack power source"
desc = "The massive external power source for the laser gatling gun"
icon = 'icons/obj/guns/minigun.dmi'
icon_state = "holstered"
item_state = "backpack"
slot_flags = SLOT_BACK
w_class = 5
var/obj/item/weapon/gun/projectile/minigun/gun = null
var/armed = 0 //whether the gun is attached, 0 is attached, 1 is the gun is wielded.
var/overheat = 0
var/overheat_max = 40
var/heat_diffusion = 1
/obj/item/weapon/minigunpack/New()
gun = new(src)
START_PROCESSING(SSobj, src)
..()
/obj/item/weapon/minigunpack/Destroy()
STOP_PROCESSING(SSobj, src)
..()
/obj/item/weapon/minigunpack/process()
overheat = max(0, overheat - heat_diffusion)
/obj/item/weapon/minigunpack/attack_hand(var/mob/living/carbon/user)
if(src.loc == user)
if(!armed)
if(user.get_item_by_slot(slot_back) == src)
armed = 1
if(!user.put_in_hands(gun))
armed = 0
user << "<span class='warning'>You need a free hand to hold the gun!</span>"
return
update_icon()
gun.forceMove(user)
user.update_inv_back()
else
user << "<span class='warning'>You are already holding the gun!</span>"
else
..()
/obj/item/weapon/minigunpack/attackby(obj/item/weapon/W, mob/user, params)
if(W == gun) //Don't need armed check, because if you have the gun assume its armed.
user.unEquip(gun,1)
else
..()
/obj/item/weapon/minigunpack/dropped(mob/user)
if(armed)
user.unEquip(gun,1)
/obj/item/weapon/minigunpack/MouseDrop(atom/over_object)
if(armed)
return
if(iscarbon(usr))
var/mob/M = usr
if(!over_object)
return
if(!M.restrained() && !M.stat)
if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(!M.unEquip(src))
return
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
if(slot_l_hand)
M.put_in_l_hand(src)
/obj/item/weapon/minigunpack/update_icon()
if(armed)
icon_state = "notholstered"
else
icon_state = "holstered"
/obj/item/weapon/minigunpack/proc/attach_gun(var/mob/user)
if(!gun)
gun = new(src)
gun.forceMove(src)
armed = 0
if(user)
user << "<span class='notice'>You attach the [gun.name] to the [name].</span>"
else
src.visible_message("<span class='warning'>The [gun.name] snaps back onto the [name]!</span>")
update_icon()
user.update_inv_back()
/obj/item/weapon/gun/projectile/minigun
name = "laser gatling gun"
desc = "An advanced laser cannon with an incredible rate of fire. Requires a bulky backpack power source to use."
icon = 'icons/obj/guns/minigun.dmi'
icon_state = "minigun_spin"
item_state = "minigun"
origin_tech = "combat=6;powerstorage=5;magnets=4"
flags = CONDUCT | HANDSLOW
slowdown = 1
slot_flags = null
w_class = 5
materials = list()
burst_size = 3
automatic = 0
fire_delay = 1
weapon_weight = WEAPON_HEAVY
fire_sound = 'sound/weapons/Laser.ogg'
mag_type = /obj/item/ammo_box/magazine/internal/minigun
var/obj/item/weapon/minigunpack/ammo_pack
/obj/item/weapon/gun/projectile/minigun/attack_self(mob/living/user)
return
/obj/item/weapon/gun/projectile/minigun/dropped(mob/user)
if(ammo_pack)
ammo_pack.attach_gun(user)
else
qdel(src)
/obj/item/weapon/gun/projectile/minigun/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
if(ammo_pack)
if(ammo_pack.overheat < ammo_pack.overheat_max)
. = ..()
ammo_pack.overheat++
else
user << "The gun's heat sensor locked the trigger to prevent lens damage."
/obj/item/weapon/gun/projectile/minigun/afterattack(atom/target, mob/living/user, flag, params)
if(!ammo_pack || ammo_pack.loc != user)
user << "You need the backpack power source to fire the gun!"
..()
/obj/item/weapon/gun/projectile/minigun/New()
if(!ammo_pack)
if(istype(loc,/obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one.
ammo_pack = loc
else
qdel(src)//No pack, no gun
..()
/obj/item/weapon/gun/projectile/minigun/dropped(mob/living/user)
ammo_pack.attach_gun(user)
/obj/item/weapon/gun/projectile/minigun/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
@@ -1,81 +0,0 @@
//KEEP IN MIND: These are different from gun/grenadelauncher. These are designed to shoot premade rocket and grenade projectiles, not flashbangs or chemistry casings etc.
//Put handheld rocket launchers here if someone ever decides to make something so hilarious ~Paprika
/obj/item/weapon/gun/projectile/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"
item_state = "gun"
mag_type = /obj/item/ammo_box/magazine/internal/grenadelauncher
fire_sound = 'sound/weapons/grenadelaunch.ogg'
w_class = 3
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
chamber_round()
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg
desc = "A 6-shot grenade launcher."
name = "multi grenade launcher"
icon = 'icons/mecha/mecha_equipment.dmi'
icon_state = "mecha_grenadelnchr"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/grenademulti
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg/attack_self()
return
/obj/item/weapon/gun/projectile/automatic/gyropistol
name = "gyrojet pistol"
desc = "A prototype pistol designed to fire self propelled rockets."
icon_state = "gyropistol"
fire_sound = 'sound/weapons/grenadelaunch.ogg'
origin_tech = "combat=5"
mag_type = /obj/item/ammo_box/magazine/m75
burst_size = 1
fire_delay = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/gyropistol/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/gyropistol/update_icon()
..()
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
/obj/item/weapon/gun/projectile/automatic/speargun
name = "kinetic speargun"
desc = "A weapon favored by carp hunters. Fires specialized spears using kinetic energy."
icon_state = "speargun"
item_state = "speargun"
w_class = 4
origin_tech = "combat=4;engineering=4"
force = 10
can_suppress = 0
mag_type = /obj/item/ammo_box/magazine/internal/speargun
fire_sound = 'sound/weapons/grenadelaunch.ogg'
burst_size = 1
fire_delay = 0
select = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/speargun/update_icon()
return
/obj/item/weapon/gun/projectile/automatic/speargun/attack_self()
return
/obj/item/weapon/gun/projectile/automatic/speargun/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/speargun/attackby(obj/item/A, mob/user, params)
var/num_loaded = magazine.attackby(A, user, params, 1)
if(num_loaded)
user << "<span class='notice'>You load [num_loaded] spear\s into \the [src].</span>"
update_icon()
chamber_round()
@@ -1,58 +0,0 @@
/obj/item/weapon/gun/projectile/automatic/pistol
name = "stechkin pistol"
desc = "A small, easily concealable 10mm handgun. Has a threaded barrel for suppressors."
icon_state = "pistol"
w_class = 2
origin_tech = "combat=3;materials=2;syndicate=4"
mag_type = /obj/item/ammo_box/magazine/m10mm
can_suppress = 1
burst_size = 1
fire_delay = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/pistol/update_icon()
..()
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
return
/obj/item/weapon/gun/projectile/automatic/pistol/m1911
name = "\improper M1911"
desc = "A classic .45 handgun with a small magazine capacity."
icon_state = "m1911"
w_class = 3
mag_type = /obj/item/ammo_box/magazine/m45
can_suppress = 0
/obj/item/weapon/gun/projectile/automatic/pistol/deagle
name = "desert eagle"
desc = "A robust .50 AE handgun."
icon_state = "deagle"
force = 14
mag_type = /obj/item/ammo_box/magazine/m50
can_suppress = 0
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/update_icon()
..()
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/gold
desc = "A gold plated desert eagle folded over a million times by superior martian gunsmiths. Uses .50 AE ammo."
icon_state = "deagleg"
item_state = "deagleg"
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/camo
desc = "A Deagle brand Deagle for operators operating operationally. Uses .50 AE ammo."
icon_state = "deaglecamo"
item_state = "deagleg"
/obj/item/weapon/gun/projectile/automatic/pistol/APS
name = "stechkin APS pistol"
desc = "The original russian version of a widely used Syndicate sidearm. Uses 9mm ammo."
icon_state = "aps"
w_class = 3
origin_tech = "combat=3;materials=2;syndicate=3"
mag_type = /obj/item/ammo_box/magazine/pistolm9mm
can_suppress = 0
burst_size = 3
fire_delay = 2
actions_types = list(/datum/action/item_action/toggle_firemode)
@@ -1,373 +0,0 @@
/obj/item/weapon/gun/projectile/revolver
name = "\improper .357 revolver"
desc = "A suspicious revolver. Uses .357 ammo." //usually used by syndicates
icon_state = "revolver"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder
origin_tech = "combat=3;materials=2"
/obj/item/weapon/gun/projectile/revolver/New()
..()
if(!istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder))
verbs -= /obj/item/weapon/gun/projectile/revolver/verb/spin
/obj/item/weapon/gun/projectile/revolver/chamber_round(var/spin = 1)
if(spin)
chambered = magazine.get_round(1)
else
chambered = magazine.stored_ammo[1]
return
/obj/item/weapon/gun/projectile/revolver/shoot_with_empty_chamber(mob/living/user as mob|obj)
..()
chamber_round(1)
/obj/item/weapon/gun/projectile/revolver/process_chamber()
return ..(0, 1)
/obj/item/weapon/gun/projectile/revolver/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
var/num_loaded = magazine.attackby(A, user, params, 1)
if(num_loaded)
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src].</span>"
A.update_icon()
update_icon()
chamber_round(0)
if(unique_rename)
if(istype(A, /obj/item/weapon/pen))
rename_gun(user)
/obj/item/weapon/gun/projectile/revolver/attack_self(mob/living/user)
var/num_unloaded = 0
chambered = null
while (get_ammo() > 0)
var/obj/item/ammo_casing/CB
CB = magazine.get_round(0)
if(CB)
CB.loc = get_turf(src.loc)
CB.SpinAnimation(10, 1)
CB.update_icon()
num_unloaded++
if (num_unloaded)
user << "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>"
else
user << "<span class='warning'>[src] is empty!</span>"
/obj/item/weapon/gun/projectile/revolver/verb/spin()
set name = "Spin Chamber"
set category = "Object"
set desc = "Click to spin your revolver's chamber."
var/mob/M = usr
if(M.stat || !in_range(M,src))
return
if(istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder))
var/obj/item/ammo_box/magazine/internal/cylinder/C = magazine
C.spin()
chamber_round(0)
usr.visible_message("[usr] spins [src]'s chamber.", "<span class='notice'>You spin [src]'s chamber.</span>")
else
verbs -= /obj/item/weapon/gun/projectile/revolver/verb/spin
/obj/item/weapon/gun/projectile/revolver/can_shoot()
return get_ammo(0,0)
/obj/item/weapon/gun/projectile/revolver/get_ammo(countchambered = 0, countempties = 1)
var/boolets = 0 //mature var names for mature people
if (chambered && countchambered)
boolets++
if (magazine)
boolets += magazine.ammo_count(countempties)
return boolets
/obj/item/weapon/gun/projectile/revolver/examine(mob/user)
..()
user << "[get_ammo(0,0)] of those are live rounds."
/obj/item/weapon/gun/projectile/revolver/detective
name = "\improper .38 Mars Special"
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
icon_state = "detective"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/projectile/revolver/detective/New()
..()
options["Default"] = "detective"
options["Leopard Spots"] = "detective_leopard"
options["Black Panther"] = "detective_panther"
options["Gold Trim"] = "detective_gold"
options["The Peacemaker"] = "detective_peacemaker"
options["Cancel"] = null
/obj/item/weapon/gun/projectile/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
if(magazine.caliber != initial(magazine.caliber))
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
playsound(user, fire_sound, 50, 1)
user << "<span class='userdanger'>[src] blows up in your face!</span>"
user.take_organ_damage(0,20)
user.unEquip(src)
return 0
..()
/obj/item/weapon/gun/projectile/revolver/detective/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/weapon/screwdriver))
if(magazine.caliber == "38")
user << "<span class='notice'>You begin to reinforce the barrel of [src]...</span>"
if(magazine.ammo_count())
afterattack(user, user) //you know the drill
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
return
if(do_after(user, 30/A.toolspeed, target = src))
if(magazine.ammo_count())
user << "<span class='warning'>You can't modify it!</span>"
return
magazine.caliber = "357"
desc = "The barrel and chamber assembly seems to have been modified."
user << "<span class='notice'>You reinforce the barrel of [src]. Now it will fire .357 rounds.</span>"
else
user << "<span class='notice'>You begin to revert the modifications to [src]...</span>"
if(magazine.ammo_count())
afterattack(user, user) //and again
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
return
if(do_after(user, 30/A.toolspeed, target = src))
if(magazine.ammo_count())
user << "<span class='warning'>You can't modify it!</span>"
return
magazine.caliber = "38"
desc = initial(desc)
user << "<span class='notice'>You remove the modifications on [src]. Now it will fire .38 rounds.</span>"
/obj/item/weapon/gun/projectile/revolver/mateba
name = "\improper Unica 6 auto-revolver"
desc = "A retro high-powered autorevolver typically used by officers of the New Russia military. Uses .357 ammo."
icon_state = "mateba"
/obj/item/weapon/gun/projectile/revolver/golden
name = "\improper Golden revolver"
desc = "This ain't no game, ain't never been no show, And I'll gladly gun down the oldest lady you know. Uses .357 ammo."
icon_state = "goldrevolver"
fire_sound = 'sound/weapons/resonator_blast.ogg'
recoil = 8
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/revolver/nagant
name = "nagant revolver"
desc = "An old model of revolver that originated in Russia. Able to be suppressed. Uses 7.62x38mmR ammo."
icon_state = "nagant"
origin_tech = "combat=3"
can_suppress = 1
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev762
// A gun to play Russian Roulette!
// You can spin the chamber to randomize the position of the bullet.
/obj/item/weapon/gun/projectile/revolver/russian
name = "\improper russian revolver"
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism requiring you to spin the chamber before each trigger pull."
origin_tech = "combat=2;materials=2"
mag_type = /obj/item/ammo_box/magazine/internal/rus357
var/spun = 0
/obj/item/weapon/gun/projectile/revolver/russian/New()
..()
Spin()
update_icon()
/obj/item/weapon/gun/projectile/revolver/russian/proc/Spin()
chambered = null
var/random = rand(1, magazine.max_ammo)
if(random <= get_ammo(0,0))
chamber_round()
spun = 1
/obj/item/weapon/gun/projectile/revolver/russian/attackby(obj/item/A, mob/user, params)
var/num_loaded = ..()
if(num_loaded)
user.visible_message("[user] loads a single bullet into the revolver and spins the chamber.", "<span class='notice'>You load a single bullet into the chamber and spin it.</span>")
else
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
if(get_ammo() > 0)
Spin()
update_icon()
A.update_icon()
return
/obj/item/weapon/gun/projectile/revolver/russian/attack_self(mob/user)
if(!spun && can_shoot())
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
Spin()
else
var/num_unloaded = 0
while (get_ammo() > 0)
var/obj/item/ammo_casing/CB
CB = magazine.get_round()
chambered = null
CB.loc = get_turf(src.loc)
CB.update_icon()
num_unloaded++
if (num_unloaded)
user << "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>"
else
user << "<span class='notice'>[src] is empty.</span>"
/obj/item/weapon/gun/projectile/revolver/russian/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)
if(flag)
if(!(target in user.contents) && ismob(target))
if(user.a_intent == "harm") // Flogging action
return
if(isliving(user))
if(!can_trigger_gun(user))
return
if(target != user)
if(ismob(target))
user << "<span class='warning'>A mechanism prevents you from shooting anyone but yourself!</span>"
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!spun)
user << "<span class='warning'>You need to spin the revolver's chamber first!</span>"
return
spun = 0
if(chambered)
var/obj/item/ammo_casing/AC = chambered
if(AC.fire(user, user))
playsound(user, fire_sound, 50, 1)
var/zone = check_zone(user.zone_selected)
var/obj/item/bodypart/affecting = H.get_bodypart(zone)
if(zone == "head" || zone == "eyes" || zone == "mouth")
shoot_self(user, affecting)
else
user.visible_message("<span class='danger'>[user.name] cowardly fires [src] at \his [affecting.name]!</span>", "<span class='userdanger'>You cowardly fire [src] at your [affecting.name]!</span>", "<span class='italics'>You hear a gunshot!</span>")
return
user.visible_message("<span class='danger'>*click*</span>")
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
/obj/item/weapon/gun/projectile/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head")
user.apply_damage(300, BRUTE, affecting)
user.visible_message("<span class='danger'>[user.name] fires [src] at \his head!</span>", "<span class='userdanger'>You fire [src] at your head!</span>", "<span class='italics'>You hear a gunshot!</span>")
/obj/item/weapon/gun/projectile/revolver/russian/soul
name = "cursed russian revolver"
desc = "To play with this revolver requires wagering your very soul."
/obj/item/weapon/gun/projectile/revolver/russian/soul/shoot_self(mob/living/user)
..()
var/obj/item/device/soulstone/anybody/SS = new /obj/item/device/soulstone/anybody(get_turf(src))
if(!SS.transfer_soul("FORCE", user)) //Something went wrong
qdel(SS)
return
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfiet!</span>")
/////////////////////////////
// DOUBLE BARRELED SHOTGUN //
/////////////////////////////
/obj/item/weapon/gun/projectile/revolver/doublebarrel
name = "double-barreled shotgun"
desc = "A true classic."
icon_state = "dshotgun"
item_state = "shotgun"
w_class = 4
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
mag_type = /obj/item/ammo_box/magazine/internal/shot/dual
sawn_desc = "Omar's coming!"
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/projectile/revolver/doublebarrel/New()
..()
options["Default"] = "dshotgun"
options["Dark Red Finish"] = "dshotgun-d"
options["Ash"] = "dshotgun-f"
options["Faded Grey"] = "dshotgun-g"
options["Maple"] = "dshotgun-l"
options["Rosewood"] = "dshotgun-p"
options["Cancel"] = null
/obj/item/weapon/gun/projectile/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
chamber_round()
if(istype(A, /obj/item/weapon/melee/energy))
var/obj/item/weapon/melee/energy/W = A
if(W.active)
sawoff(user)
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
sawoff(user)
/obj/item/weapon/gun/projectile/revolver/doublebarrel/attack_self(mob/living/user)
var/num_unloaded = 0
while (get_ammo() > 0)
var/obj/item/ammo_casing/CB
CB = magazine.get_round(0)
chambered = null
CB.loc = get_turf(src.loc)
CB.update_icon()
num_unloaded++
if (num_unloaded)
user << "<span class='notice'>You break open \the [src] and unload [num_unloaded] shell\s.</span>"
else
user << "<span class='warning'>[src] is empty!</span>"
// IMPROVISED SHOTGUN //
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
name = "improvised shotgun"
desc = "Essentially a tube that aims shotgun shells."
icon_state = "ishotgun"
item_state = "shotgun"
w_class = 4
force = 10
slot_flags = null
mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised
sawn_desc = "I'm just here for the gasoline."
unique_rename = 0
unique_reskin = 0
var/slung = 0
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/stack/cable_coil) && !sawn_state)
var/obj/item/stack/cable_coil/C = A
if(C.use(10))
slot_flags = SLOT_BACK
user << "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>"
slung = 1
update_icon()
else
user << "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>"
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/update_icon()
..()
if(slung)
icon_state += "sling"
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/sawoff(mob/user)
. = ..()
if(. && slung) //sawing off the gun removes the sling
new /obj/item/stack/cable_coil(get_turf(src), 10)
slung = 0
update_icon()
@@ -1,212 +0,0 @@
/obj/item/weapon/gun/projectile/shotgun
name = "shotgun"
desc = "A traditional shotgun with wood furniture and a four-shell capacity underneath."
icon_state = "shotgun"
item_state = "shotgun"
w_class = 4
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
origin_tech = "combat=4;materials=2"
mag_type = /obj/item/ammo_box/magazine/internal/shot
var/recentpump = 0 // to prevent spammage
/obj/item/weapon/gun/projectile/shotgun/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
var/num_loaded = magazine.attackby(A, user, params, 1)
if(num_loaded)
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
A.update_icon()
update_icon()
/obj/item/weapon/gun/projectile/shotgun/process_chamber()
return ..(0, 0)
/obj/item/weapon/gun/projectile/shotgun/chamber_round()
return
/obj/item/weapon/gun/projectile/shotgun/can_shoot()
if(!chambered)
return 0
return (chambered.BB ? 1 : 0)
/obj/item/weapon/gun/projectile/shotgun/attack_self(mob/living/user)
if(recentpump)
return
pump(user)
recentpump = 1
spawn(10)
recentpump = 0
return
/obj/item/weapon/gun/projectile/shotgun/blow_up(mob/user)
. = 0
if(chambered && chambered.BB)
process_fire(user, user,0)
. = 1
/obj/item/weapon/gun/projectile/shotgun/proc/pump(mob/M)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
pump_unload(M)
pump_reload(M)
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/proc/pump_unload(mob/M)
if(chambered)//We have a shell in the chamber
chambered.loc = get_turf(src)//Eject casing
chambered.SpinAnimation(5, 1)
chambered = null
/obj/item/weapon/gun/projectile/shotgun/proc/pump_reload(mob/M)
if(!magazine.ammo_count())
return 0
var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing.
chambered = AC
/obj/item/weapon/gun/projectile/shotgun/examine(mob/user)
..()
if (chambered)
user << "A [chambered.BB ? "live" : "spent"] one is in the chamber."
/obj/item/weapon/gun/projectile/shotgun/lethal
mag_type = /obj/item/ammo_box/magazine/internal/shot/lethal
// RIOT SHOTGUN //
/obj/item/weapon/gun/projectile/shotgun/riot //for spawn in the armory
name = "riot shotgun"
desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control."
icon_state = "riotshotgun"
mag_type = /obj/item/ammo_box/magazine/internal/shot/riot
sawn_desc = "Come with me if you want to live."
/obj/item/weapon/gun/projectile/shotgun/riot/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
sawoff(user)
if(istype(A, /obj/item/weapon/melee/energy))
var/obj/item/weapon/melee/energy/W = A
if(W.active)
sawoff(user)
///////////////////////
// BOLT ACTION RIFLE //
///////////////////////
/obj/item/weapon/gun/projectile/shotgun/boltaction
name = "\improper Mosin Nagant"
desc = "This piece of junk looks like something that could have been used 700 years ago. It feels slightly moist."
icon_state = "moistnugget"
item_state = "moistnugget"
slot_flags = 0 //no SLOT_BACK sprite, alas
mag_type = /obj/item/ammo_box/magazine/internal/boltaction
var/bolt_open = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/pump(mob/M)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
if(bolt_open)
pump_reload(M)
else
pump_unload(M)
bolt_open = !bolt_open
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
if(!bolt_open)
user << "<span class='notice'>The bolt is closed!</span>"
return
. = ..()
/obj/item/weapon/gun/projectile/shotgun/boltaction/examine(mob/user)
..()
user << "The bolt is [bolt_open ? "open" : "closed"]."
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted
name = "enchanted bolt action rifle"
desc = "Careful not to lose your head."
var/guns_left = 30
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/New()
..()
bolt_open = 1
pump()
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/dropped()
..()
guns_left = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
..()
if(guns_left)
var/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/GUN = new
GUN.guns_left = src.guns_left - 1
user.drop_item()
user.swap_hand()
user.put_in_hands(GUN)
else
user.drop_item()
src.throw_at_fast(pick(oview(7,get_turf(user))),1,1)
user.visible_message("<span class='warning'>[user] tosses aside the spent rifle!</span>")
// Automatic Shotguns//
/obj/item/weapon/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
..()
src.pump(user)
/obj/item/weapon/gun/projectile/shotgun/automatic/combat
name = "combat shotgun"
desc = "A semi automatic shotgun with tactical furniture and a six-shell capacity underneath."
icon_state = "cshotgun"
origin_tech = "combat=6"
mag_type = /obj/item/ammo_box/magazine/internal/shot/com
w_class = 5
//Dual Feed Shotgun
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube
name = "cycler shotgun"
desc = "An advanced shotgun with two separate magazine tubes, allowing you to quickly toggle between ammo types."
icon_state = "cycler"
origin_tech = "combat=4;materials=2"
mag_type = /obj/item/ammo_box/magazine/internal/shot/tube
w_class = 5
var/toggled = 0
var/obj/item/ammo_box/magazine/internal/shot/alternate_magazine
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/New()
..()
if (!alternate_magazine)
alternate_magazine = new mag_type(src)
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/attack_self(mob/living/user)
if(!chambered && magazine.contents.len)
pump()
else
toggle_tube(user)
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/proc/toggle_tube(mob/living/user)
var/current_mag = magazine
var/alt_mag = alternate_magazine
magazine = alt_mag
alternate_magazine = current_mag
toggled = !toggled
if(toggled)
user << "You switch to tube B."
else
user << "You switch to tube A."
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/AltClick(mob/living/user)
if(user.incapacitated() || !Adjacent(user) || !istype(user))
return
pump()
// DOUBLE BARRELED SHOTGUN and IMPROVISED SHOTGUN are in revolver.dm
@@ -1,108 +0,0 @@
/obj/item/weapon/gun/projectile/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
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
force = 0
throwforce = 0
burst_size = 3
can_suppress = 0
clumsy_check = 0
needs_permit = 0
/obj/item/weapon/gun/projectile/automatic/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/toy/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/toy/pistol
name = "foam force pistol"
desc = "A small, easily concealable toy handgun. Ages 8 and up."
icon_state = "pistol"
w_class = 2
mag_type = /obj/item/ammo_box/magazine/toy/pistol
fire_sound = 'sound/weapons/Gunshot.ogg'
can_suppress = 0
burst_size = 1
fire_delay = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/toy/pistol/update_icon()
..()
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot
mag_type = /obj/item/ammo_box/magazine/toy/pistol/riot
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot/New()
magazine = new /obj/item/ammo_box/magazine/toy/pistol/riot(src)
..()
/obj/item/weapon/gun/projectile/automatic/toy/pistol/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/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
origin_tech = null
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy
clumsy_check = 0
needs_permit = 0
/obj/item/weapon/gun/projectile/shotgun/toy/process_chamber()
..()
if(chambered && !chambered.BB)
qdel(chambered)
/obj/item/weapon/gun/projectile/shotgun/toy/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/shotgun/toy/crossbow
name = "foam force crossbow"
desc = "A weapon favored by many overactive children. Ages 8 and up."
icon = 'icons/obj/toy.dmi'
icon_state = "foamcrossbow"
item_state = "crossbow"
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy/crossbow
fire_sound = 'sound/items/syringeproj.ogg'
slot_flags = SLOT_BELT
w_class = 2
/obj/item/weapon/gun/projectile/automatic/c20r/toy
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 = 0
needs_permit = 0
mag_type = /obj/item/ammo_box/magazine/toy/smgm45
/obj/item/weapon/gun/projectile/automatic/c20r/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/c20r/toy/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy
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 = 0
needs_permit = 0
mag_type = /obj/item/ammo_box/magazine/toy/m762
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/unrestricted
pin = /obj/item/device/firing_pin