initial commit - cross reference with 5th port - obviously has compile errors

This commit is contained in:
LetterJay
2016-07-03 02:17:19 -05:00
commit 35a1723e98
4355 changed files with 2221257 additions and 0 deletions

View File

@@ -0,0 +1,167 @@
/obj/item/ammo_casing
name = "bullet casing"
desc = "A bullet casing."
icon = 'icons/obj/ammo.dmi'
icon_state = "s-casing"
flags = CONDUCT
slot_flags = SLOT_BELT
throwforce = 0
w_class = 1
var/fire_sound = null //What sound should play when this ammo is fired
var/caliber = null //Which kind of guns it can be loaded into
var/projectile_type = null //The bullet type to create when New() is called
var/obj/item/projectile/BB = null //The loaded bullet
var/pellets = 1 //Pellets for spreadshot
var/variance = 0 //Variance for inaccuracy fundamental to the casing
var/randomspread = 0 //Randomspread for automatics
var/delay = 0 //Delay for energy weapons
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
/obj/item/ammo_casing/New()
..()
if(projectile_type)
BB = new projectile_type(src)
pixel_x = rand(-10, 10)
pixel_y = rand(-10, 10)
setDir(pick(alldirs))
update_icon()
/obj/item/ammo_casing/update_icon()
..()
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent"]"
/obj/item/ammo_casing/proc/newshot() //For energy weapons, shotgun shells and wands (!).
if (!BB)
BB = new projectile_type(src)
return
/obj/item/ammo_casing/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/ammo_box))
var/obj/item/ammo_box/box = I
if(isturf(loc))
var/boolets = 0
for(var/obj/item/ammo_casing/bullet in loc)
if (box.stored_ammo.len >= box.max_ammo)
break
if (bullet.BB)
if (box.give_round(bullet, 0))
boolets++
else
continue
if (boolets > 0)
box.update_icon()
user << "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>"
else
user << "<span class='warning'>You fail to collect anything!</span>"
else
..()
//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 = CONDUCT
slot_flags = SLOT_BELT
item_state = "syringe_kit"
materials = list(MAT_METAL=30000)
throwforce = 2
w_class = 1
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
/obj/item/ammo_box/New()
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.loc = 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.loc = get_turf(src.loc)
stored_ammo += R
R.loc = 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 = 0, 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.drop_item()
AC.loc = src
num_loaded++
if(num_loaded)
if(!silent)
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
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)
user.put_in_hands(A)
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

View File

@@ -0,0 +1,408 @@
/obj/item/ammo_casing/a357
desc = "A .357 bullet casing."
caliber = "357"
projectile_type = /obj/item/projectile/bullet
/obj/item/ammo_casing/a762
desc = "A 7.62 bullet casing."
icon_state = "762-casing"
caliber = "a762"
projectile_type = /obj/item/projectile/bullet
/obj/item/ammo_casing/a762/enchanted
projectile_type = /obj/item/projectile/bullet/weakbullet3
/obj/item/ammo_casing/a50
desc = "A .50AE bullet casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet
/obj/item/ammo_casing/c38
desc = "A .38 bullet casing."
caliber = "38"
projectile_type = /obj/item/projectile/bullet/weakbullet2
/obj/item/ammo_casing/c10mm
desc = "A 10mm bullet casing."
caliber = "10mm"
projectile_type = /obj/item/projectile/bullet/midbullet3
/obj/item/ammo_casing/c9mm
desc = "A 9mm bullet casing."
caliber = "9mm"
projectile_type = /obj/item/projectile/bullet/weakbullet3
/obj/item/ammo_casing/c9mmap
desc = "A 9mm bullet casing."
caliber = "9mm"
projectile_type =/obj/item/projectile/bullet/armourpiercing
/obj/item/ammo_casing/c9mmtox
desc = "A 9mm bullet casing."
caliber = "9mm"
projectile_type = /obj/item/projectile/bullet/toxinbullet
/obj/item/ammo_casing/c9mminc
desc = "A 9mm bullet casing."
caliber = "9mm"
projectile_type = /obj/item/projectile/bullet/incendiary/firebullet
/obj/item/ammo_casing/c46x30mm
desc = "A 4.6x30mm bullet casing."
caliber = "4.6x30mm"
projectile_type = /obj/item/projectile/bullet/weakbullet3
/obj/item/ammo_casing/c46x30mmap
desc = "A 4.6x30mm bullet casing."
caliber = "4.6x30mm"
projectile_type =/obj/item/projectile/bullet/armourpiercing
/obj/item/ammo_casing/c46x30mmtox
desc = "A 4.6x30mm bullet casing."
caliber = "4.6x30mm"
projectile_type = /obj/item/projectile/bullet/toxinbullet
/obj/item/ammo_casing/c46x30mminc
desc = "A 4.6x30mm bullet casing."
caliber = "4.6x30mm"
projectile_type = /obj/item/projectile/bullet/incendiary/firebullet
/obj/item/ammo_casing/c45
desc = "A .45 bullet casing."
caliber = ".45"
projectile_type = /obj/item/projectile/bullet/midbullet
/obj/item/ammo_casing/c45nostamina
desc = "A .45 bullet casing."
caliber = ".45"
projectile_type = /obj/item/projectile/bullet/midbullet3
/obj/item/ammo_casing/n762
desc = "A 7.62x38mmR bullet casing."
caliber = "n762"
projectile_type = /obj/item/projectile/bullet
/obj/item/ammo_casing/a556
desc = "A 5.56mm bullet casing."
caliber = "a556"
projectile_type = /obj/item/projectile/bullet/heavybullet
/obj/item/ammo_casing/a40mm
name = "40mm HE shell"
desc = "A cased high explosive grenade that can only be activated once fired out of a grenade launcher."
caliber = "40mm"
icon_state = "40mmHE"
projectile_type = /obj/item/projectile/bullet/a40mm
/////SNIPER ROUNDS
/obj/item/ammo_casing/point50
desc = "A .50 bullet casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper
icon_state = ".50"
/obj/item/ammo_casing/soporific
desc = "A .50 bullet casing, specialised in sending the target to sleep, instead of hell."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper/soporific
icon_state = ".50"
/obj/item/ammo_casing/haemorrhage
desc = "A .50 bullet casing, specialised in causing massive bloodloss"
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper/haemorrhage
icon_state = ".50"
/obj/item/ammo_casing/penetrator
desc = "A .50 caliber penetrator round casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper/penetrator
icon_state = ".50"
/// SAW ROUNDS
/obj/item/ammo_casing/mm556x45
desc = "A 556x45mm bullet casing."
icon_state = "762-casing"
caliber = "mm55645"
projectile_type = /obj/item/projectile/bullet/saw
/obj/item/ammo_casing/mm556x45/bleeding
desc = "A 556x45mm bullet casing with specialized inner-casing, that when it makes contact with a target, release tiny shrapnel to induce internal bleeding."
icon_state = "762-casing"
projectile_type = /obj/item/projectile/bullet/saw/bleeding
/obj/item/ammo_casing/mm556x45/hollow
desc = "A 556x45mm bullet casing designed to cause more damage to unarmored targets."
projectile_type = /obj/item/projectile/bullet/saw/hollow
/obj/item/ammo_casing/mm556x45/ap
desc = "A 556x45mm bullet casing designed with a hardened-tipped core to help penetrate armored targets."
projectile_type = /obj/item/projectile/bullet/saw/ap
/obj/item/ammo_casing/mm556x45/incen
desc = "A 556x45mm bullet casing designed with a chemical-filled capsule on the tip that when bursted, reacts with the atmosphere to produce a fireball, engulfing the target in flames. "
projectile_type = /obj/item/projectile/bullet/saw/incen
//SHOTGUN ROUNDS
/obj/item/ammo_casing/shotgun
name = "shotgun slug"
desc = "A 12 gauge lead slug."
icon_state = "blshell"
caliber = "shotgun"
projectile_type = /obj/item/projectile/bullet
materials = list(MAT_METAL=4000)
/obj/item/ammo_casing/shotgun/buckshot
name = "buckshot shell"
desc = "A 12 gauge buckshot shell."
icon_state = "gshell"
projectile_type = /obj/item/projectile/bullet/pellet
pellets = 6
variance = 25
/obj/item/ammo_casing/shotgun/rubbershot
name = "rubber shot"
desc = "A shotgun casing filled with densely-packed rubber balls, used to incapacitate crowds from a distance."
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/rpellet
pellets = 6
variance = 25
materials = list(MAT_METAL=4000)
/obj/item/ammo_casing/shotgun/beanbag
name = "beanbag slug"
desc = "A weak beanbag slug for riot control."
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/weakbullet
materials = list(MAT_METAL=250)
/obj/item/ammo_casing/shotgun/improvised
name = "improvised shell"
desc = "An extremely weak shotgun shell with multiple small pellets made out of metal shards."
icon_state = "improvshell"
projectile_type = /obj/item/projectile/bullet/pellet/weak
materials = list(MAT_METAL=250)
pellets = 10
variance = 25
/obj/item/ammo_casing/shotgun/improvised/overload/
name = "overloaded improvised shell"
desc = "An extremely weak shotgun shell with multiple small pellets made out of metal shards. This one has been packed with even more \
propellant. It's like playing russian roulette, with a shotgun."
icon_state = "improvshell"
projectile_type = /obj/item/projectile/bullet/pellet/overload
materials = list(MAT_METAL=250)
pellets = 4
variance = 40
/obj/item/ammo_casing/shotgun/stunslug
name = "taser slug"
desc = "A stunning taser slug."
icon_state = "stunshell"
projectile_type = /obj/item/projectile/bullet/stunshot
materials = list(MAT_METAL=250)
/obj/item/ammo_casing/shotgun/meteorshot
name = "meteorshot shell"
desc = "A shotgun shell rigged with CMC technology, which launches a massive slug when fired."
icon_state = "mshell"
projectile_type = /obj/item/projectile/bullet/meteorshot
/obj/item/ammo_casing/shotgun/breaching
name = "breaching shell"
desc = "An economic version of the meteorshot, utilizing similar technologies. Great for busting down doors."
icon_state = "mshell"
projectile_type = /obj/item/projectile/bullet/meteorshot/weak
/obj/item/ammo_casing/shotgun/pulseslug
name = "pulse slug"
desc = "A delicate device which can be loaded into a shotgun. The primer acts as a button which triggers the gain medium and fires a powerful \
energy blast. While the heat and power drain limit it to one use, it can still allow an operator to engage targets that ballistic ammunition \
would have difficulty with."
icon_state = "pshell"
projectile_type = /obj/item/projectile/beam/pulse/shot
/obj/item/ammo_casing/shotgun/incendiary
name = "incendiary slug"
desc = "An incendiary-coated shotgun slug."
icon_state = "ishell"
projectile_type = /obj/item/projectile/bullet/incendiary/shell
/obj/item/ammo_casing/shotgun/frag12
name = "FRAG-12 slug"
desc = "A high explosive breaching round for a 12 gauge shotgun."
icon_state = "heshell"
projectile_type = /obj/item/projectile/bullet/frag12
/obj/item/ammo_casing/shotgun/incendiary/dragonsbreath
name = "dragonsbreath shell"
desc = "A shotgun shell which fires a spread of incendiary pellets."
icon_state = "ishell2"
projectile_type = /obj/item/projectile/bullet/incendiary/shell/dragonsbreath
pellets = 4
variance = 35
/obj/item/ammo_casing/shotgun/ion
name = "ion shell"
desc = "An advanced shotgun shell which uses a subspace ansible crystal to produce an effect similar to a standard ion rifle. \
The unique properties of the crystal splot the pulse into a spread of individually weaker bolts."
icon_state = "ionshell"
projectile_type = /obj/item/projectile/ion/weak
pellets = 4
variance = 35
/obj/item/ammo_casing/shotgun/laserslug
name = "laser slug"
desc = "An advanced shotgun shell that uses a micro laser to replicate the effects of a laser weapon in a ballistic package."
icon_state = "lshell"
projectile_type = /obj/item/projectile/beam/laser
/obj/item/ammo_casing/shotgun/techshell
name = "unloaded technological shell"
desc = "A high-tech shotgun shell which can be loaded with materials to produce unique effects."
icon_state = "cshell"
projectile_type = null
/obj/item/ammo_casing/shotgun/dart
name = "shotgun dart"
desc = "A dart for use in shotguns. Can be injected with up to 30 units of any chemical."
icon_state = "cshell"
projectile_type = /obj/item/projectile/bullet/dart
/obj/item/ammo_casing/shotgun/dart/New()
..()
flags |= OPENCONTAINER
create_reagents(30)
reagents.set_reacting(FALSE)
/obj/item/ammo_casing/shotgun/dart/attackby()
return
/obj/item/ammo_casing/shotgun/dart/bioterror
desc = "A shotgun dart filled with deadly toxins."
/obj/item/ammo_casing/shotgun/dart/bioterror/New()
..()
reagents.add_reagent("neurotoxin", 6)
reagents.add_reagent("spore", 6)
reagents.add_reagent("mutetoxin", 6) //;HELP OPS IN MAINT
reagents.add_reagent("coniine", 6)
reagents.add_reagent("sodium_thiopental", 6)
// Caseless Ammunition
/obj/item/ammo_casing/caseless
desc = "A caseless bullet casing."
/obj/item/ammo_casing/caseless/fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params, distro, quiet)
if (..())
loc = null
return 1
else
return 0
/obj/item/ammo_casing/caseless/update_icon()
..()
icon_state = "[initial(icon_state)]"
/obj/item/ammo_casing/caseless/a75
desc = "A .75 bullet casing."
caliber = "75"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/bullet/gyro
/obj/item/ammo_casing/caseless/magspear
name = "magnetic spear"
desc = "A reusable spear that is typically loaded into kinetic spearguns."
projectile_type = /obj/item/projectile/bullet/reusable/magspear
caliber = "speargun"
icon_state = "magspear"
throwforce = 15 //still deadly when thrown
throw_speed = 3
/obj/item/ammo_casing/caseless/laser
name = "laser casing"
desc = "You shouldn't be seeing this."
caliber = "laser"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/beam
fire_sound = 'sound/weapons/Laser.ogg'
/obj/item/ammo_casing/caseless/laser/gatling
projectile_type = /obj/item/projectile/beam/weak
variance = 0.8
click_cooldown_override = 1
/obj/item/ammo_casing/caseless/foam_dart
name = "foam dart"
desc = "Its nerf or nothing! Ages 8 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart
caliber = "foam_force"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
var/modified = 0
/obj/item/ammo_casing/caseless/foam_dart/update_icon()
..()
if (modified)
icon_state = "foamdart_empty"
desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
if(BB)
BB.icon_state = "foamdart_empty"
else
icon_state = "foamdart"
desc = "Its nerf or nothing! Ages 8 and up."
if(BB)
BB.icon_state = "foamdart_empty"
/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params)
..()
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
if (istype(A, /obj/item/weapon/screwdriver) && !modified)
modified = 1
FD.damage_type = BRUTE
update_icon()
else if ((istype(A, /obj/item/weapon/pen)) && modified && !FD.pen)
if(!user.unEquip(A))
return
A.loc = FD
FD.pen = A
FD.damage = 5
FD.nodamage = 0
user << "<span class='notice'>You insert [A] into [src].</span>"
return
/obj/item/ammo_casing/caseless/foam_dart/attack_self(mob/living/user)
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
if(FD.pen)
FD.damage = initial(FD.damage)
FD.nodamage = initial(FD.nodamage)
user.put_in_hands(FD.pen)
user << "<span class='notice'>You remove [FD.pen] from [src].</span>"
FD.pen = null
/obj/item/ammo_casing/caseless/foam_dart/riot
name = "riot foam dart"
desc = "Whose smart idea was it to use toys as crowd control? Ages 18 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/riot
icon_state = "foamdart_riot"

View File

@@ -0,0 +1,69 @@
/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

View File

@@ -0,0 +1,219 @@
/obj/item/ammo_casing/energy
name = "energy weapon lens"
desc = "The part of the gun that makes the laser go pew"
caliber = "energy"
projectile_type = /obj/item/projectile/energy
var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot.
var/select_name = "energy"
fire_sound = 'sound/weapons/Laser.ogg'
/obj/item/ammo_casing/energy/laser
projectile_type = /obj/item/projectile/beam/laser
select_name = "kill"
/obj/item/ammo_casing/energy/lasergun
projectile_type = /obj/item/projectile/beam/laser
e_cost = 83
select_name = "kill"
/obj/item/ammo_casing/energy/laser/hos
e_cost = 100
/obj/item/ammo_casing/energy/laser/practice
projectile_type = /obj/item/projectile/beam/practice
select_name = "practice"
/obj/item/ammo_casing/energy/laser/scatter
projectile_type = /obj/item/projectile/beam/scatter
pellets = 5
variance = 25
select_name = "scatter"
/obj/item/ammo_casing/energy/laser/heavy
projectile_type = /obj/item/projectile/beam/laser/heavylaser
select_name = "anti-vehicle"
fire_sound = 'sound/weapons/lasercannonfire.ogg'
/obj/item/ammo_casing/energy/laser/pulse
projectile_type = /obj/item/projectile/beam/pulse
e_cost = 200
select_name = "DESTROY"
fire_sound = 'sound/weapons/pulse.ogg'
/obj/item/ammo_casing/energy/laser/bluetag
projectile_type = /obj/item/projectile/beam/lasertag/bluetag
select_name = "bluetag"
/obj/item/ammo_casing/energy/laser/redtag
projectile_type = /obj/item/projectile/beam/lasertag/redtag
select_name = "redtag"
/obj/item/ammo_casing/energy/xray
projectile_type = /obj/item/projectile/beam/xray
e_cost = 50
fire_sound = 'sound/weapons/laser3.ogg'
/obj/item/ammo_casing/energy/electrode
projectile_type = /obj/item/projectile/energy/electrode
select_name = "stun"
fire_sound = 'sound/weapons/taser.ogg'
e_cost = 200
/obj/item/ammo_casing/energy/electrode/gun
fire_sound = 'sound/weapons/gunshot.ogg'
e_cost = 100
/obj/item/ammo_casing/energy/electrode/hos
e_cost = 200
/obj/item/ammo_casing/energy/ion
projectile_type = /obj/item/projectile/ion
select_name = "ion"
fire_sound = 'sound/weapons/IonRifle.ogg'
/obj/item/ammo_casing/energy/declone
projectile_type = /obj/item/projectile/energy/declone
select_name = "declone"
fire_sound = 'sound/weapons/pulse3.ogg'
/obj/item/ammo_casing/energy/mindflayer
projectile_type = /obj/item/projectile/beam/mindflayer
select_name = "MINDFUCK"
fire_sound = 'sound/weapons/Laser.ogg'
/obj/item/ammo_casing/energy/flora
fire_sound = 'sound/effects/stealthoff.ogg'
/obj/item/ammo_casing/energy/flora/yield
projectile_type = /obj/item/projectile/energy/florayield
select_name = "yield"
/obj/item/ammo_casing/energy/flora/mut
projectile_type = /obj/item/projectile/energy/floramut
select_name = "mutation"
/obj/item/ammo_casing/energy/temp
projectile_type = /obj/item/projectile/temp
select_name = "freeze"
e_cost = 250
fire_sound = 'sound/weapons/pulse3.ogg'
/obj/item/ammo_casing/energy/temp/hot
projectile_type = /obj/item/projectile/temp/hot
select_name = "bake"
/obj/item/ammo_casing/energy/meteor
projectile_type = /obj/item/projectile/meteor
select_name = "goddamn meteor"
/obj/item/ammo_casing/energy/kinetic
projectile_type = /obj/item/projectile/kinetic
select_name = "kinetic"
e_cost = 500
fire_sound = 'sound/weapons/Kenetic_accel.ogg' // fine spelling there chap
/obj/item/ammo_casing/energy/kinetic/super
projectile_type = /obj/item/projectile/kinetic/super
/obj/item/ammo_casing/energy/kinetic/hyper
projectile_type = /obj/item/projectile/kinetic/hyper
/obj/item/ammo_casing/energy/disabler
projectile_type = /obj/item/projectile/beam/disabler
select_name = "disable"
e_cost = 50
fire_sound = "sound/weapons/taser2.ogg"
/obj/item/ammo_casing/energy/plasma
projectile_type = /obj/item/projectile/plasma
select_name = "plasma burst"
fire_sound = 'sound/weapons/plasma_cutter.ogg'
delay = 15
e_cost = 25
/obj/item/ammo_casing/energy/plasma/adv
projectile_type = /obj/item/projectile/plasma/adv
delay = 10
e_cost = 10
/obj/item/ammo_casing/energy/wormhole
projectile_type = /obj/item/projectile/beam/wormhole
e_cost = 0
fire_sound = "sound/weapons/pulse3.ogg"
var/obj/item/weapon/gun/energy/wormhole_projector/gun = null
select_name = "blue"
/obj/item/ammo_casing/energy/wormhole/orange
projectile_type = /obj/item/projectile/beam/wormhole/orange
select_name = "orange"
/obj/item/ammo_casing/energy/bolt
projectile_type = /obj/item/projectile/energy/bolt
select_name = "bolt"
e_cost = 500
fire_sound = 'sound/weapons/Genhit.ogg'
/obj/item/ammo_casing/energy/bolt/large
projectile_type = /obj/item/projectile/energy/bolt/large
select_name = "heavy bolt"
obj/item/ammo_casing/energy/net
projectile_type = /obj/item/projectile/energy/net
select_name = "netting"
pellets = 6
variance = 40
/obj/item/ammo_casing/energy/trap
projectile_type = /obj/item/projectile/energy/trap
select_name = "snare"
/obj/item/ammo_casing/energy/instakill
projectile_type = /obj/item/projectile/beam/instakill
e_cost = 0
select_name = "DESTROY"
/obj/item/ammo_casing/energy/instakill/blue
projectile_type = /obj/item/projectile/beam/instakill/blue
/obj/item/ammo_casing/energy/instakill/red
projectile_type = /obj/item/projectile/beam/instakill/red
/obj/item/ammo_casing/energy/shock_revolver
fire_sound = 'sound/magic/lightningbolt.ogg'
e_cost = 200
select_name = "stun"
projectile_type = /obj/item/projectile/energy/shock_revolver
/obj/item/ammo_casing/energy/gravityrepulse
projectile_type = /obj/item/projectile/gravityrepulse
e_cost = 0
fire_sound = "sound/weapons/wave.ogg"
select_name = "repulse"
delay = 50
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
/obj/item/ammo_casing/energy/gravityrepulse/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
gun = G
/obj/item/ammo_casing/energy/gravityattract
projectile_type = /obj/item/projectile/gravityattract
e_cost = 0
fire_sound = "sound/weapons/wave.ogg"
select_name = "attract"
delay = 50
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
/obj/item/ammo_casing/energy/gravityattract/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
gun = G
/obj/item/ammo_casing/energy/gravitychaos
projectile_type = /obj/item/projectile/gravitychaos
e_cost = 0
fire_sound = "sound/weapons/wave.ogg"
select_name = "chaos"
delay = 50
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
/obj/item/ammo_casing/energy/gravitychaos/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
gun = G

View File

@@ -0,0 +1,499 @@
////////////////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

View File

@@ -0,0 +1,46 @@
/obj/item/ammo_casing/magic
name = "magic casing"
desc = "I didn't even know magic needed ammo..."
projectile_type = /obj/item/projectile/magic
/obj/item/ammo_casing/magic/change
projectile_type = /obj/item/projectile/magic/change
/obj/item/ammo_casing/magic/animate
projectile_type = /obj/item/projectile/magic/animate
/obj/item/ammo_casing/magic/heal
projectile_type = /obj/item/projectile/magic/resurrection
/obj/item/ammo_casing/magic/death
projectile_type = /obj/item/projectile/magic/death
/obj/item/ammo_casing/magic/teleport
projectile_type = /obj/item/projectile/magic/teleport
/obj/item/ammo_casing/magic/door
projectile_type = /obj/item/projectile/magic/door
/obj/item/ammo_casing/magic/fireball
projectile_type = /obj/item/projectile/magic/fireball
/obj/item/ammo_casing/magic/chaos
projectile_type = /obj/item/projectile/magic
/obj/item/ammo_casing/magic/chaos/newshot()
projectile_type = pick(typesof(/obj/item/projectile/magic))
..()
/obj/item/ammo_casing/magic/honk
projectile_type = /obj/item/projectile/bullet/honker
/obj/item/ammo_casing/syringegun
name = "syringe gun spring"
desc = "A high-power spring that throws syringes."
projectile_type = null
/obj/item/ammo_casing/energy/c3dbullet
projectile_type = /obj/item/projectile/bullet/midbullet3
select_name = "spraydown"
fire_sound = 'sound/weapons/gunshot_smg.ogg'
e_cost = 20

View File

@@ -0,0 +1,98 @@
/obj/item/ammo_casing/proc/fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params, distro, quiet, zone_override = "",spread)
distro += variance
for (var/i = max(1, pellets), i > 0, i--)
var/targloc = get_turf(target)
ready_proj(target, user, quiet, zone_override)
if(distro) //We have to spread a pixel-precision bullet. throw_proj was called before so angles should exist by now...
if(randomspread)
spread = round((rand() - 0.5) * distro)
else //Smart spread
spread = round((i / pellets - 0.5) * distro)
if(!throw_proj(target, targloc, user, params, spread))
return 0
if(i > 1)
newshot()
if(click_cooldown_override)
user.changeNext_move(click_cooldown_override)
else
user.changeNext_move(CLICK_CD_RANGE)
user.newtonian_move(get_dir(target, user))
update_icon()
return 1
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
if (!BB)
return
BB.original = target
BB.firer = user
if (zone_override)
BB.def_zone = zone_override
else
BB.def_zone = user.zone_selected
BB.suppressed = quiet
if(reagents && BB.reagents)
reagents.trans_to(BB, reagents.total_volume) //For chemical darts/bullets
qdel(reagents)
/obj/item/ammo_casing/proc/throw_proj(atom/target, turf/targloc, mob/living/user, params, spread)
var/turf/curloc = get_turf(user)
if (!istype(targloc) || !istype(curloc) || !BB)
return 0
BB.ammo_casing = src
if(targloc == curloc)
if(target) //if the target is right on our location we go straight to bullet_act()
target.bullet_act(BB, BB.def_zone)
qdel(BB)
BB = null
return 1
BB.preparePixelProjectile(target, targloc, user, params, spread)
if(BB)
BB.fire()
BB = null
return 1
/obj/item/ammo_casing/proc/spread(turf/target, turf/current, distro)
var/dx = abs(target.x - current.x)
var/dy = abs(target.y - current.y)
return locate(target.x + round(gaussian(0, distro) * (dy+2)/8, 1), target.y + round(gaussian(0, distro) * (dx+2)/8, 1), target.z)
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
var/turf/curloc = get_turf(user)
src.loc = get_turf(user)
src.starting = get_turf(user)
src.current = curloc
src.yo = targloc.y - curloc.y
src.xo = targloc.x - curloc.x
if(params)
var/list/mouse_control = params2list(params)
if(mouse_control["icon-x"])
src.p_x = text2num(mouse_control["icon-x"])
if(mouse_control["icon-y"])
src.p_y = text2num(mouse_control["icon-y"])
if(mouse_control["screen-loc"])
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
// world << "X: [screen_loc_X[1]] PixelX: [screen_loc_X[2]] / Y: [screen_loc_Y[1]] PixelY: [screen_loc_Y[2]]"
var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32
var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32
//Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average.
var/screenview = (user.client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
var/ox = round(screenview/2) //"origin" x
var/oy = round(screenview/2) //"origin" y
// world << "Pixel position: [x] [y]"
var/angle = Atan2(y - oy, x - ox)
// world << "Angle: [angle]"
src.Angle = angle
if(spread)
src.Angle += spread

View File

@@ -0,0 +1,511 @@
/obj/item/weapon/gun
name = "gun"
desc = "It's a gun. It's pretty terrible, though."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "detective"
item_state = "gun"
flags = CONDUCT
slot_flags = SLOT_BELT
materials = list(MAT_METAL=2000)
w_class = 3
throwforce = 5
throw_speed = 3
throw_range = 5
force = 5
origin_tech = "combat=1"
needs_permit = 1
attack_verb = list("struck", "hit", "bashed")
var/fire_sound = "gunshot"
var/suppressed = 0 //whether or not a message is displayed when fired
var/can_suppress = 0
var/can_unsuppress = 1
var/recoil = 0 //boom boom shake the room
var/clumsy_check = 1
var/obj/item/ammo_casing/chambered = null
var/trigger_guard = TRIGGER_GUARD_NORMAL //trigger guard on the weapon, hulks can't fire them with their big meaty fingers
var/sawn_desc = null //description change if weapon is sawn-off
var/sawn_state = SAWN_INTACT
var/burst_size = 1 //how large a burst is
var/fire_delay = 0 //rate of fire for burst firing and semi auto
var/firing_burst = 0 //Prevent the weapon from firing again while already firing
var/semicd = 0 //cooldown handler
var/weapon_weight = WEAPON_LIGHT
var/spread = 0 //Spread induced by the gun itself.
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
var/unique_rename = 0 //allows renaming with a pen
var/unique_reskin = 0 //allows one-time reskinning
var/current_skin = null //the skin choice if we had a reskin
var/list/options = list()
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
var/obj/item/device/firing_pin/pin = /obj/item/device/firing_pin //standard firing pin for most guns
var/obj/item/device/flashlight/F = null
var/can_flashlight = 0
var/list/upgrades = list()
var/ammo_x_offset = 0 //used for positioning ammo count overlay on sprite
var/ammo_y_offset = 0
var/flight_x_offset = 0
var/flight_y_offset = 0
//Zooming
var/zoomable = FALSE //whether the gun generates a Zoom action on creation
var/zoomed = FALSE //Zoom toggle
var/zoom_amt = 3 //Distance in TURFs to move the user's screen forward (the "zoom" effect)
var/datum/action/toggle_scope_zoom/azoom
/obj/item/weapon/gun/New()
..()
if(pin)
pin = new pin(src)
if(F)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
new /datum/action/item_action/toggle_gunlight(src)
build_zooming()
/obj/item/weapon/gun/CheckParts(list/parts_list)
..()
var/obj/item/weapon/gun/G = locate(/obj/item/weapon/gun) in contents
if(G)
G.loc = loc
qdel(G.pin)
G.pin = null
visible_message("[G] can now fit a new pin, but old one was destroyed in the process.")
qdel(src)
/obj/item/weapon/gun/examine(mob/user)
..()
if(pin)
user << "It has [pin] installed."
else
user << "It doesn't have a firing pin installed, and won't fire."
if(unique_reskin && !current_skin)
user << "<span class='notice'>Alt-click it to reskin it.</span>"
if(unique_rename)
user << "<span class='notice'>Use a pen on it to rename it.</span>"
/obj/item/weapon/gun/proc/process_chamber()
return 0
//check if there's enough ammo/energy/whatever to shoot one time
//i.e if clicking would make it shoot
/obj/item/weapon/gun/proc/can_shoot()
return 1
/obj/item/weapon/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
user << "<span class='danger'>*click*</span>"
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
return
/obj/item/weapon/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
if(recoil)
shake_camera(user, recoil + 1, recoil)
if(suppressed)
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
if(!message)
return
if(pointblank)
user.visible_message("<span class='danger'>[user] fires [src] point blank at [pbtarget]!</span>", "<span class='danger'>You fire [src] point blank at [pbtarget]!</span>", "<span class='italics'>You hear a [istype(src, /obj/item/weapon/gun/energy) ? "laser blast" : "gunshot"]!</span>")
else
user.visible_message("<span class='danger'>[user] fires [src]!</span>", "<span class='danger'>You fire [src]!</span>", "You hear a [istype(src, /obj/item/weapon/gun/energy) ? "laser blast" : "gunshot"]!")
if(weapon_weight >= WEAPON_MEDIUM)
if(user.get_inactive_hand())
if(prob(15))
if(user.drop_item())
user.visible_message("<span class='danger'>[src] flies out of [user]'s hands!</span>", "<span class='userdanger'>[src] kicks out of your grip!</span>")
/obj/item/weapon/gun/emp_act(severity)
for(var/obj/O in contents)
O.emp_act(severity)
/obj/item/weapon/gun/afterattack(atom/target, mob/living/user, flag, params)
if(firing_burst)
return
if(flag) //It's adjacent, is the user, or is on the user's person
if(target in user.contents) //can't shoot stuff inside us.
return
if(!ismob(target) || user.a_intent == "harm") //melee attack
return
if(target == user && user.zone_selected != "mouth") //so we can't shoot ourselves (unless mouth selected)
return
if(istype(user))//Check if the user can use the gun, if the user isn't alive(turrets) assume it can.
var/mob/living/L = user
if(!can_trigger_gun(L))
return
if(!can_shoot()) //Just because you can pull the trigger doesn't mean it can't shoot.
shoot_with_empty_chamber(user)
return
if(flag)
if(user.zone_selected == "mouth")
handle_suicide(user, target, params)
return
//Exclude lasertag guns from the CLUMSY check.
if(clumsy_check)
if(istype(user))
if (user.disabilities & CLUMSY && prob(40))
user << "<span class='userdanger'>You shoot yourself in the foot with \the [src]!</span>"
var/shot_leg = pick("l_leg", "r_leg")
process_fire(user,user,0,params, zone_override = shot_leg)
user.drop_item()
return
if(weapon_weight == WEAPON_HEAVY && user.get_inactive_hand())
user << "<span class='userdanger'>You need both hands free to fire \the [src]!</span>"
return
process_fire(target,user,1,params)
/obj/item/weapon/gun/proc/can_trigger_gun(var/mob/living/user)
if(!handle_pins(user) || !user.can_use_guns(src))
return 0
return 1
/obj/item/weapon/gun/proc/handle_pins(mob/living/user)
if(pin)
if(pin.pin_auth(user) || pin.emagged)
return 1
else
pin.auth_fail(user)
return 0
else
user << "<span class='warning'>\The [src]'s trigger is locked. This weapon doesn't have a firing pin installed!</span>"
return 0
obj/item/weapon/gun/proc/newshot()
return
/obj/item/weapon/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
add_fingerprint(user)
if(semicd)
return
if(weapon_weight)
if(user.get_inactive_hand())
recoil = 4 //one-handed kick
else
recoil = initial(recoil)
if(burst_size > 1)
firing_burst = 1
for(var/i = 1 to burst_size)
if(!user)
break
if(!issilicon(user))
if( i>1 && !(src in get_both_hands(user))) //for burst firing
break
if(chambered)
var/sprd = 0
if(randomspread)
sprd = round((rand() - 0.5) * spread)
else //Smart spread
sprd = round((i / burst_size - 0.5) * spread)
if(!chambered.fire(target, user, params, ,suppressed, zone_override, sprd))
shoot_with_empty_chamber(user)
break
else
if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot
shoot_live_shot(user, 1, target, message)
else
shoot_live_shot(user, 0, target, message)
else
shoot_with_empty_chamber(user)
break
process_chamber()
update_icon()
sleep(fire_delay)
firing_burst = 0
else
if(chambered)
if(!chambered.fire(target, user, params, , suppressed, zone_override, spread))
shoot_with_empty_chamber(user)
return
else
if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot
shoot_live_shot(user, 1, target, message)
else
shoot_live_shot(user, 0, target, message)
else
shoot_with_empty_chamber(user)
return
process_chamber()
update_icon()
semicd = 1
spawn(fire_delay)
semicd = 0
if(user)
if(user.hand)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
feedback_add_details("gun_fired","[src.type]")
/obj/item/weapon/gun/attack(mob/M as mob, mob/user)
if(user.a_intent == "harm") //Flogging
..()
else
return
/obj/item/weapon/gun/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/flashlight/seclite))
var/obj/item/device/flashlight/seclite/S = I
if(can_flashlight)
if(!F)
if(!user.unEquip(I))
return
user << "<span class='notice'>You click [S] into place on [src].</span>"
if(S.on)
SetLuminosity(0)
F = S
I.loc = src
update_icon()
update_gunlight(user)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
var/datum/action/A = new /datum/action/item_action/toggle_gunlight(src)
if(loc == user)
A.Grant(user)
if(istype(I, /obj/item/weapon/screwdriver))
if(F && can_flashlight)
for(var/obj/item/device/flashlight/seclite/S in src)
user << "<span class='notice'>You unscrew the seclite from [src].</span>"
F = null
S.loc = get_turf(user)
update_gunlight(user)
S.update_brightness(user)
update_icon()
verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
qdel(TGL)
if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
rename_gun(user)
..()
/obj/item/weapon/gun/proc/toggle_gunlight()
set name = "Toggle Gunlight"
set category = "Object"
set desc = "Click to toggle your weapon's attached flashlight."
if(!F)
return
var/mob/living/carbon/human/user = usr
if(!isturf(user.loc))
user << "<span class='warning'>You cannot turn the light on while in this [user.loc]!</span>"
F.on = !F.on
user << "<span class='notice'>You toggle the gunlight [F.on ? "on":"off"].</span>"
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
update_gunlight(user)
return
/obj/item/weapon/gun/proc/update_gunlight(mob/user = null)
if(F)
if(F.on)
if(loc == user)
user.AddLuminosity(F.brightness_on)
else if(isturf(loc))
SetLuminosity(F.brightness_on)
else
if(loc == user)
user.AddLuminosity(-F.brightness_on)
else if(isturf(loc))
SetLuminosity(0)
update_icon()
else
if(loc == user)
user.AddLuminosity(-5)
else if(isturf(loc))
SetLuminosity(0)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/weapon/gun/pickup(mob/user)
..()
if(F)
if(F.on)
user.AddLuminosity(F.brightness_on)
SetLuminosity(0)
if(azoom)
azoom.Grant(user)
/obj/item/weapon/gun/dropped(mob/user)
..()
if(F)
if(F.on)
user.AddLuminosity(-F.brightness_on)
SetLuminosity(F.brightness_on)
zoom(user,FALSE)
if(azoom)
azoom.Remove(user)
/obj/item/weapon/gun/AltClick(mob/user)
..()
if(user.incapacitated())
user << "<span class='warning'>You can't do that right now!</span>"
return
if(unique_reskin && !current_skin && loc == user)
reskin_gun(user)
/obj/item/weapon/gun/proc/reskin_gun(mob/M)
var/choice = input(M,"Warning, you can only reskin your weapon once!","Reskin Gun") in options
if(src && choice && !current_skin && !M.incapacitated() && in_range(M,src))
if(options[choice] == null)
return
current_skin = options[choice]
M << "Your gun is now skinned as [choice]. Say hello to your new friend."
update_icon()
/obj/item/weapon/gun/proc/rename_gun(mob/M)
var/input = stripped_input(M,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
name = input
M << "You name the gun [input]. Say hello to your new friend."
return
/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
if(!ishuman(user) || !ishuman(target))
return
if(semicd)
return
if(user == target)
target.visible_message("<span class='warning'>[user] sticks [src] in their mouth, ready to pull the trigger...</span>", \
"<span class='userdanger'>You stick [src] in your mouth, ready to pull the trigger...</span>")
else
target.visible_message("<span class='warning'>[user] points [src] at [target]'s head, ready to pull the trigger...</span>", \
"<span class='userdanger'>[user] points [src] at your head, ready to pull the trigger...</span>")
semicd = 1
if(!do_mob(user, target, 120) || user.zone_selected != "mouth")
if(user)
if(user == target)
user.visible_message("<span class='notice'>[user] decided life was worth living.</span>")
else if(target && target.Adjacent(user))
target.visible_message("<span class='notice'>[user] has decided to spare [target]'s life.</span>", "<span class='notice'>[user] has decided to spare your life!</span>")
semicd = 0
return
semicd = 0
target.visible_message("<span class='warning'>[user] pulls the trigger!</span>", "<span class='userdanger'>[user] pulls the trigger!</span>")
if(chambered && chambered.BB)
chambered.BB.damage *= 5
process_fire(target, user, 1, params)
/obj/item/weapon/gun/proc/unlock() //used in summon guns and as a convience for admins
if(pin)
qdel(pin)
pin = new /obj/item/device/firing_pin
/////////////
// ZOOMING //
/////////////
/datum/action/toggle_scope_zoom
name = "Toggle Scope"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING
button_icon_state = "sniper_zoom"
var/obj/item/weapon/gun/gun = null
/datum/action/toggle_scope_zoom/Trigger()
gun.zoom(owner)
/datum/action/toggle_scope_zoom/IsAvailable()
. = ..()
if(!. && gun)
gun.zoom(owner, FALSE)
/datum/action/toggle_scope_zoom/Remove(mob/living/L)
gun.zoom(L, FALSE)
..()
/obj/item/weapon/gun/proc/zoom(mob/living/user, forced_zoom)
if(!user || !user.client)
return
switch(forced_zoom)
if(FALSE)
zoomed = FALSE
if(TRUE)
zoomed = TRUE
else
zoomed = !zoomed
if(zoomed)
var/_x = 0
var/_y = 0
switch(user.dir)
if(NORTH)
_y = zoom_amt
if(EAST)
_x = zoom_amt
if(SOUTH)
_y = -zoom_amt
if(WEST)
_x = -zoom_amt
user.client.pixel_x = world.icon_size*_x
user.client.pixel_y = world.icon_size*_y
else
user.client.pixel_x = 0
user.client.pixel_y = 0
//Proc, so that gun accessories/scopes/etc. can easily add zooming.
/obj/item/weapon/gun/proc/build_zooming()
if(azoom)
return
if(zoomable)
azoom = new()
azoom.gun = src
/obj/item/weapon/gun/burn()
if(pin)
qdel(pin)
.=..()

View File

@@ -0,0 +1,172 @@
/obj/item/weapon/gun/energy
icon_state = "energy"
name = "energy gun"
desc = "A basic energy-based gun."
icon = 'icons/obj/guns/energy.dmi'
var/obj/item/weapon/stock_parts/cell/power_supply //What type of power cell this uses
var/cell_type = /obj/item/weapon/stock_parts/cell
var/modifystate = 0
var/list/ammo_type = list(/obj/item/ammo_casing/energy)
var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next.
var/can_charge = 1 //Can it be charged in a recharger?
var/charge_sections = 4
ammo_x_offset = 2
var/shaded_charge = 0 //if this gun uses a stateful charge bar for more detail
var/selfcharge = 0
var/charge_tick = 0
var/charge_delay = 4
/obj/item/weapon/gun/energy/emp_act(severity)
power_supply.use(round(power_supply.charge / severity))
update_icon()
/obj/item/weapon/gun/energy/New()
..()
if(cell_type)
power_supply = new cell_type(src)
else
power_supply = new(src)
power_supply.give(power_supply.maxcharge)
var/obj/item/ammo_casing/energy/shot
for (var/i = 1, i <= ammo_type.len, i++)
var/shottype = ammo_type[i]
shot = new shottype(src)
ammo_type[i] = shot
shot = ammo_type[select]
fire_sound = shot.fire_sound
fire_delay = shot.delay
if(selfcharge)
START_PROCESSING(SSobj, src)
update_icon()
return
/obj/item/weapon/gun/energy/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/weapon/gun/energy/process()
if(selfcharge)
charge_tick++
if(charge_tick < charge_delay)
return
charge_tick = 0
if(!power_supply)
return
power_supply.give(100)
update_icon()
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
if(ammo_type.len > 1)
select_fire(user)
update_icon()
/obj/item/weapon/gun/energy/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
newshot() //prepare a new shot
..()
/obj/item/weapon/gun/energy/can_shoot()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
return power_supply.charge >= shot.e_cost
/obj/item/weapon/gun/energy/newshot()
if (!ammo_type || !power_supply)
return
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(power_supply.charge >= shot.e_cost) //if there's enough power in the power_supply cell...
chambered = shot //...prepare a new shot based on the current ammo type selected
chambered.newshot()
return
/obj/item/weapon/gun/energy/process_chamber()
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
var/obj/item/ammo_casing/energy/shot = chambered
power_supply.use(shot.e_cost)//... drain the power_supply cell
chambered = null //either way, released the prepared shot
return
/obj/item/weapon/gun/energy/proc/select_fire(mob/living/user)
select++
if (select > ammo_type.len)
select = 1
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
fire_sound = shot.fire_sound
fire_delay = shot.delay
if (shot.select_name)
user << "<span class='notice'>[src] is now set to [shot.select_name].</span>"
update_icon()
return
/obj/item/weapon/gun/energy/update_icon()
cut_overlays()
var/ratio = Ceiling((power_supply.charge / power_supply.maxcharge) * charge_sections)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
var/iconState = "[icon_state]_charge"
var/itemState = null
if(!initial(item_state))
itemState = icon_state
if (modifystate)
add_overlay("[icon_state]_[shot.select_name]")
iconState += "_[shot.select_name]"
if(itemState)
itemState += "[shot.select_name]"
if(power_supply.charge < shot.e_cost)
add_overlay("[icon_state]_empty")
else
if(!shaded_charge)
for(var/i = ratio, i >= 1, i--)
add_overlay(image(icon = icon, icon_state = iconState, pixel_x = ammo_x_offset * (i -1)))
else
add_overlay(image(icon = icon, icon_state = "[icon_state]_charge[ratio]"))
if(F && can_flashlight)
var/iconF = "flight"
if(F.on)
iconF = "flight_on"
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
if(itemState)
itemState += "[ratio]"
item_state = itemState
/obj/item/weapon/gun/energy/ui_action_click()
toggle_gunlight()
/obj/item/weapon/gun/energy/suicide_act(mob/user)
if (src.can_shoot())
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)
user.visible_message("<span class='suicide'>[user] melts \his face off with the [src.name]!</span>")
playsound(loc, fire_sound, 50, 1, -1)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
power_supply.use(shot.e_cost)
update_icon()
return(FIRELOSS)
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/energy/proc/robocharge()
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
if(R.cell.use(shot.e_cost)) //Take power from the borg...
power_supply.give(shot.e_cost) //... to recharge the shot
/obj/item/weapon/gun/energy/on_varedit(modified_var)
if(modified_var == "selfcharge")
if(selfcharge)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
..()
/obj/item/weapon/gun/energy/burn()
if(power_supply)
qdel(power_supply)
.=..()

View File

@@ -0,0 +1,128 @@
/obj/item/weapon/gun/energy/laser
name = "laser gun"
desc = "A basic energy-based laser gun that fires concentrated beams of light which pass through glass and thin metal."
icon_state = "laser"
item_state = "laser"
w_class = 3
materials = list(MAT_METAL=2000)
origin_tech = "combat=4;magnets=2"
ammo_type = list(/obj/item/ammo_casing/energy/lasergun)
ammo_x_offset = 1
shaded_charge = 1
/obj/item/weapon/gun/energy/laser/practice
name = "practice laser gun"
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
origin_tech = "combat=2;magnets=2"
ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
clumsy_check = 0
needs_permit = 0
/obj/item/weapon/gun/energy/laser/retro
name ="retro laser gun"
icon_state = "retro"
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's private security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
ammo_x_offset = 3
/obj/item/weapon/gun/energy/laser/captain
name = "antique laser gun"
icon_state = "caplaser"
item_state = "caplaser"
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
force = 10
origin_tech = null
ammo_x_offset = 3
selfcharge = 1
/obj/item/weapon/gun/energy/laser/captain/scattershot
name = "scatter shot laser rifle"
icon_state = "lasercannon"
item_state = "laser"
desc = "An industrial-grade heavy-duty laser rifle with a modified laser lense to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theorically infinite use."
origin_tech = "combat=5;materials=4;powerstorage=4"
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
/obj/item/weapon/gun/energy/laser/cyborg
can_charge = 0
desc = "An energy-based laser gun that draws power from the cyborg's internal energy cell directly. So this is what freedom looks like?"
origin_tech = null
/obj/item/weapon/gun/energy/laser/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/laser/cyborg/emp_act()
return
/obj/item/weapon/gun/energy/laser/scatter
name = "scatter laser gun"
desc = "A laser gun equipped with a refraction kit that spreads bolts."
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
///Laser Cannon
/obj/item/weapon/gun/energy/lasercannon
name = "accelerator laser cannon"
desc = "An advanced laser cannon that does more damage the farther away the target is."
icon_state = "lasercannon"
item_state = "laser"
w_class = 4
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
origin_tech = "combat=4;magnets=4;powerstorage=3"
ammo_type = list(/obj/item/ammo_casing/energy/laser/accelerator)
pin = null
ammo_x_offset = 3
/obj/item/ammo_casing/energy/laser/accelerator
projectile_type = /obj/item/projectile/beam/laser/accelerator
select_name = "accelerator"
fire_sound = 'sound/weapons/lasercannonfire.ogg'
/obj/item/projectile/beam/laser/accelerator
name = "accelerator laser"
icon_state = "scatterlaser"
range = 255
damage = 6
/obj/item/projectile/beam/laser/accelerator/Range()
..()
damage += 7
transform *= TransformUsingVariable(20 , 100, 1)
/obj/item/weapon/gun/energy/xray
name = "xray laser gun"
desc = "A high-power laser gun capable of expelling concentrated xray blasts that pass through multiple soft targets and heavier materials"
icon_state = "xray"
item_state = null
origin_tech = "combat=6;materials=4;magnets=4;syndicate=1"
ammo_type = list(/obj/item/ammo_casing/energy/xray)
pin = null
ammo_x_offset = 3
////////Laser Tag////////////////////
/obj/item/weapon/gun/energy/laser/bluetag
name = "laser tag gun"
icon_state = "bluetag"
desc = "A retro laser gun modified to fire harmless blue beams of light. Sound effects included!"
ammo_type = list(/obj/item/ammo_casing/energy/laser/bluetag)
origin_tech = "combat=2;magnets=2"
clumsy_check = 0
needs_permit = 0
pin = /obj/item/device/firing_pin/tag/blue
ammo_x_offset = 2
selfcharge = 1
/obj/item/weapon/gun/energy/laser/redtag
name = "laser tag gun"
icon_state = "redtag"
desc = "A retro laser gun modified to fire harmless beams red of light. Sound effects included!"
ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag)
origin_tech = "combat=2;magnets=2"
clumsy_check = 0
needs_permit = 0
pin = /obj/item/device/firing_pin/tag/red
ammo_x_offset = 2
selfcharge = 1

View File

@@ -0,0 +1,81 @@
/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

View File

@@ -0,0 +1,81 @@
/obj/item/weapon/gun/energy/pulse
name = "pulse rifle"
desc = "A heavy-duty, multifaceted energy rifle with three modes. Preferred by front-line combat personnel."
icon_state = "pulse"
item_state = null
w_class = 4
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse, /obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
cell_type = "/obj/item/weapon/stock_parts/cell/pulse"
/obj/item/weapon/gun/energy/pulse/emp_act(severity)
return
/obj/item/weapon/gun/energy/pulse/prize
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/energy/pulse/prize/New()
. = ..()
poi_list |= src
var/msg = "A pulse rifle prize has been created at ([x],[y],[z] - (\
<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>\
JMP</a>)"
message_admins(msg)
log_game(msg)
notify_ghosts("Someone won a pulse rifle as a prize!", source = src,
action = NOTIFY_ORBIT)
/obj/item/weapon/gun/energy/pulse/prize/Destroy()
poi_list -= src
. = ..()
/obj/item/weapon/gun/energy/pulse/loyalpin
pin = /obj/item/device/firing_pin/implant/mindshield
/obj/item/weapon/gun/energy/pulse/carbine
name = "pulse carbine"
desc = "A compact variant of the pulse rifle with less firepower but easier storage."
w_class = 3
slot_flags = SLOT_BELT
icon_state = "pulse_carbine"
item_state = "pulse"
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/carbine"
can_flashlight = 1
flight_x_offset = 18
flight_y_offset = 12
/obj/item/weapon/gun/energy/pulse/carbine/loyalpin
pin = /obj/item/device/firing_pin/implant/mindshield
/obj/item/weapon/gun/energy/pulse/pistol
name = "pulse pistol"
desc = "A pulse rifle in an easily concealed handgun package with low capacity."
w_class = 2
slot_flags = SLOT_BELT
icon_state = "pulse_pistol"
item_state = "gun"
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/pistol"
can_charge = 0
/obj/item/weapon/gun/energy/pulse/pistol/loyalpin
pin = /obj/item/device/firing_pin/implant/mindshield
/obj/item/weapon/gun/energy/pulse/destroyer
name = "pulse destroyer"
desc = "A heavy-duty energy rifle built for pure destruction."
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse)
/obj/item/weapon/gun/energy/pulse/destroyer/attack_self(mob/living/user)
user << "<span class='danger'>[src.name] has three settings, and they are all DESTROY.</span>"
/obj/item/weapon/gun/energy/pulse/pistol/m1911
name = "\improper M1911-P"
desc = "A compact pulse core in a classic handgun frame for Nanotrasen officers. It's not the size of the gun, it's the size of the hole it puts through people."
icon_state = "m1911"
item_state = "gun"
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"

View File

@@ -0,0 +1,410 @@
/obj/item/weapon/gun/energy/ionrifle
name = "ion rifle"
desc = "A man-portable anti-armor weapon designed to disable mechanical threats at range."
icon_state = "ionrifle"
item_state = null //so the human update icon uses the icon_state instead.
origin_tech = "combat=4;magnets=4"
can_flashlight = 1
w_class = 5
flags = CONDUCT
slot_flags = SLOT_BACK
ammo_type = list(/obj/item/ammo_casing/energy/ion)
ammo_x_offset = 3
flight_x_offset = 17
flight_y_offset = 9
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
return
/obj/item/weapon/gun/energy/ionrifle/carbine
name = "ion carbine"
desc = "The MK.II Prototype Ion Projector is a lightweight carbine version of the larger ion rifle, built to be ergonomic and efficient."
icon_state = "ioncarbine"
w_class = 3
slot_flags = SLOT_BELT
pin = null
ammo_x_offset = 2
flight_x_offset = 18
flight_y_offset = 11
/obj/item/weapon/gun/energy/decloner
name = "biological demolecularisor"
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
icon_state = "decloner"
origin_tech = "combat=4;materials=4;biotech=5;plasmatech=6"
ammo_type = list(/obj/item/ammo_casing/energy/declone)
pin = null
ammo_x_offset = 1
/obj/item/weapon/gun/energy/decloner/update_icon()
..()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(power_supply.charge > shot.e_cost)
add_overlay("decloner_spin")
/obj/item/weapon/gun/energy/floragun
name = "floral somatoray"
desc = "A tool that discharges controlled radiation which induces mutation in plant cells."
icon_state = "flora"
item_state = "gun"
ammo_type = list(/obj/item/ammo_casing/energy/flora/yield, /obj/item/ammo_casing/energy/flora/mut)
origin_tech = "materials=2;biotech=4"
modifystate = 1
ammo_x_offset = 1
selfcharge = 1
/obj/item/weapon/gun/energy/meteorgun
name = "meteor gun"
desc = "For the love of god, make sure you're aiming this the right way!"
icon_state = "riotgun"
item_state = "c20r"
w_class = 4
ammo_type = list(/obj/item/ammo_casing/energy/meteor)
cell_type = "/obj/item/weapon/stock_parts/cell/potato"
clumsy_check = 0 //Admin spawn only, might as well let clowns use it.
selfcharge = 1
/obj/item/weapon/gun/energy/meteorgun/pen
name = "meteor pen"
desc = "The pen is mightier than the sword."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pen"
item_state = "pen"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
w_class = 1
/obj/item/weapon/gun/energy/mindflayer
name = "\improper Mind Flayer"
desc = "A prototype weapon recovered from the ruins of Research-Station Epsilon."
icon_state = "xray"
item_state = null
ammo_type = list(/obj/item/ammo_casing/energy/mindflayer)
ammo_x_offset = 2
/obj/item/weapon/gun/energy/kinetic_accelerator
name = "proto-kinetic accelerator"
desc = "In the year 2544, only a year after the discovery of a potentially \
world-changing substance, now colloquially referred to as plasma, the \
Nanotrasen-UEG mining conglomerate introduced a prototype of a gun-like \
device intended for quick, effective mining of plasma in the low \
pressures of the solar system. Included in this presentation were \
demonstrations of the gun being fired at collections of rocks contained \
in vacuumed environments, obliterating them instantly while maintaining \
the structure of the ores buried within them. Additionally, volunteers \
were called from the crowd to have the gun used on them, only proving that \
the gun caused little harm to objects in standard pressure. \n\
An official from an unnamed, now long dissipated company observed this \
presentation and offered to share their self-recharger cells, powered \
by the user's bioelectrical field, another new and unknown technology. \
They warned that the cells were incredibly experimental and several times \
had injured workers, but the scientists as Nanotrasen were unable to resist \
the money-saving potential of self recharging cells. Upon accepting this \
offer, it took only a matter of days to prove the volatility of these cells, \
as they exploded left and right whenever inserted into the prototype devices, \
only throwing more money in the bin. \n\
Whenever the Nanotrasen scientists were on the edge of giving up, a \
breakthrough was made by head researcher Miles Parks McCollum, who \
demonstrated that the cells could be stabilized when exposed to radium \
then cooled with cryostylane. After this discovery, the low pressure gun, \
now named the Kinetic Accelerator, was hastily completed and made compatible \
with the self-recharging cells. As a result of poor testing, the currently \
used guns lose their charge when not in use, and when two Kinetic Accelerators \
come in proximity of one another, they will interfere with each other. Despite \
this, the shoddy guns still see use in the mining of plasma to this day."
icon_state = "kineticgun"
item_state = "kineticgun"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic)
cell_type = /obj/item/weapon/stock_parts/cell/emproof
// Apparently these are safe to carry? I'm sure goliaths would disagree.
needs_permit = 0
unique_rename = 1
origin_tech = "combat=3;powerstorage=3;engineering=3"
weapon_weight = WEAPON_LIGHT
can_flashlight = 1
flight_x_offset = 15
flight_y_offset = 9
var/overheat_time = 16
var/holds_charge = FALSE
var/unique_frequency = FALSE // modified by KA modkits
var/overheat = FALSE
/obj/item/weapon/gun/energy/kinetic_accelerator/super
name = "super-kinetic accelerator"
desc = "An upgraded, superior version of the proto-kinetic accelerator."
icon_state = "kineticgun_u"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/super)
overheat_time = 15
origin_tech = "materials=5;powerstorage=3;engineering=4;magnets=3;combat=3"
/obj/item/weapon/gun/energy/kinetic_accelerator/hyper
name = "hyper-kinetic accelerator"
desc = "An upgraded, even more superior version of the proto-kinetic accelerator."
icon_state = "kineticgun_h"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/hyper)
overheat_time = 14
origin_tech = "materials=6;powerstorage=4;engineering=4;magnets=4;combat=4"
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg
holds_charge = TRUE
unique_frequency = TRUE
/obj/item/weapon/gun/energy/kinetic_accelerator/hyper/cyborg
holds_charge = TRUE
unique_frequency = TRUE
/obj/item/weapon/gun/energy/kinetic_accelerator/New()
. = ..()
if(!holds_charge)
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/shoot_live_shot()
. = ..()
attempt_reload()
/obj/item/weapon/gun/energy/kinetic_accelerator/equipped(mob/user)
. = ..()
if(!can_shoot())
attempt_reload()
/obj/item/weapon/gun/energy/kinetic_accelerator/dropped()
. = ..()
if(!holds_charge)
// Put it on a delay because moving item from slot to hand
// calls dropped().
sleep(1)
if(!ismob(loc))
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
power_supply.use(500)
update_icon()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload()
if(overheat)
return
overheat = TRUE
var/carried = 0
if(!unique_frequency)
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/K in \
loc.GetAllContents())
carried++
carried = max(carried, 1)
else
carried = 1
addtimer(src, "reload", overheat_time * carried)
/obj/item/weapon/gun/energy/kinetic_accelerator/emp_act(severity)
return
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(500)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else
loc << "<span class='warning'>[src] silently charges up.<span>"
update_icon()
overheat = FALSE
/obj/item/weapon/gun/energy/kinetic_accelerator/update_icon()
cut_overlays()
if(!can_shoot())
add_overlay("kineticgun_empty")
if(F && can_flashlight)
var/iconF = "flight"
if(F.on)
iconF = "flight_on"
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
name = "mini energy crossbow"
desc = "A weapon favored by syndicate stealth specialists."
icon_state = "crossbow"
item_state = "crossbow"
w_class = 2
materials = list(MAT_METAL=2000)
origin_tech = "combat=4;magnets=4;syndicate=5"
suppressed = 1
ammo_type = list(/obj/item/ammo_casing/energy/bolt)
weapon_weight = WEAPON_LIGHT
unique_rename = 0
overheat_time = 20
holds_charge = TRUE
unique_frequency = TRUE
can_flashlight = 0
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large
name = "energy crossbow"
desc = "A reverse engineered weapon using syndicate technology."
icon_state = "crossbowlarge"
w_class = 3
materials = list(MAT_METAL=4000)
origin_tech = "combat=4;magnets=4;syndicate=2"
suppressed = 0
ammo_type = list(/obj/item/ammo_casing/energy/bolt/large)
pin = null
/obj/item/weapon/gun/energy/kinetic_accelerator/suicide_act(mob/user)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
user.visible_message("<span class='suicide'>[user] cocks the [src.name] and pretends to blow \his brains out! It looks like \he's trying to commit suicide!</b></span>")
shoot_live_shot()
return (OXYLOSS)
/obj/item/weapon/gun/energy/plasmacutter
name = "plasma cutter"
desc = "A mining tool capable of expelling concentrated plasma bursts. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
icon_state = "plasmacutter"
item_state = "plasmacutter"
modifystate = -1
origin_tech = "combat=1;materials=3;magnets=2;plasmatech=3;engineering=1"
ammo_type = list(/obj/item/ammo_casing/energy/plasma)
flags = CONDUCT | OPENCONTAINER
attack_verb = list("attacked", "slashed", "cut", "sliced")
force = 12
sharpness = IS_SHARP
can_charge = 0
heat = 3800
/obj/item/weapon/gun/energy/plasmacutter/examine(mob/user)
..()
if(power_supply)
user <<"<span class='notice'>[src] is [round(power_supply.percent())]% charged.</span>"
/obj/item/weapon/gun/energy/plasmacutter/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/stack/sheet/mineral/plasma))
var/obj/item/stack/sheet/S = A
S.use(1)
power_supply.give(1000)
user << "<span class='notice'>You insert [A] in [src], recharging it.</span>"
else if(istype(A, /obj/item/weapon/ore/plasma))
qdel(A)
power_supply.give(500)
user << "<span class='notice'>You insert [A] in [src], recharging it.</span>"
else
..()
/obj/item/weapon/gun/energy/plasmacutter/update_icon()
return
/obj/item/weapon/gun/energy/plasmacutter/adv
name = "advanced plasma cutter"
icon_state = "adv_plasmacutter"
origin_tech = "combat=3;materials=4;magnets=3;plasmatech=4;engineering=2"
force = 15
ammo_type = list(/obj/item/ammo_casing/energy/plasma/adv)
/obj/item/weapon/gun/energy/wormhole_projector
name = "bluespace wormhole projector"
desc = "A projector that emits high density quantum-coupled bluespace beams."
ammo_type = list(/obj/item/ammo_casing/energy/wormhole, /obj/item/ammo_casing/energy/wormhole/orange)
item_state = null
icon_state = "wormhole_projector"
origin_tech = "combat=4;bluespace=6;plasmatech=4;engineering=4"
var/obj/effect/portal/blue
var/obj/effect/portal/orange
/obj/item/weapon/gun/energy/wormhole_projector/update_icon()
icon_state = "[initial(icon_state)][select]"
item_state = icon_state
return
/obj/item/weapon/gun/energy/wormhole_projector/process_chamber()
..()
select_fire()
/obj/item/weapon/gun/energy/wormhole_projector/proc/portal_destroyed(obj/effect/portal/P)
if(P.icon_state == "portal")
blue = null
if(orange)
orange.target = null
else
orange = null
if(blue)
blue.target = null
/obj/item/weapon/gun/energy/wormhole_projector/proc/create_portal(obj/item/projectile/beam/wormhole/W)
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(W), null, src)
P.precision = 0
if(W.name == "bluespace beam")
qdel(blue)
blue = P
else
qdel(orange)
P.icon_state = "portal1"
orange = P
if(orange && blue)
blue.target = get_turf(orange)
orange.target = get_turf(blue)
/* 3d printer 'pseudo guns' for borgs */
/obj/item/weapon/gun/energy/printer
name = "cyborg lmg"
desc = "A machinegun that fires 3d-printed flachettes slowly regenerated using a cyborg's internal power source."
icon_state = "l6closed0"
icon = 'icons/obj/guns/projectile.dmi'
cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
ammo_type = list(/obj/item/ammo_casing/energy/c3dbullet)
can_charge = 0
/obj/item/weapon/gun/energy/printer/update_icon()
return
/obj/item/weapon/gun/energy/printer/emp_act()
return
/obj/item/weapon/gun/energy/printer/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/temperature
name = "temperature gun"
icon_state = "freezegun"
desc = "A gun that changes temperatures."
origin_tech = "combat=4;materials=4;powerstorage=3;magnets=2"
ammo_type = list(/obj/item/ammo_casing/energy/temp, /obj/item/ammo_casing/energy/temp/hot)
cell_type = "/obj/item/weapon/stock_parts/cell/high"
pin = null
/obj/item/weapon/gun/energy/laser/instakill
name = "instakill rifle"
icon_state = "instagib"
item_state = "instagib"
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit."
ammo_type = list(/obj/item/ammo_casing/energy/instakill)
force = 60
origin_tech = "combat=7;magnets=6"
/obj/item/weapon/gun/energy/laser/instakill/red
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit. This one has a red design."
icon_state = "instagibred"
item_state = "instagibred"
ammo_type = list(/obj/item/ammo_casing/energy/instakill/red)
/obj/item/weapon/gun/energy/laser/instakill/blue
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit. This one has a blue design."
icon_state = "instagibblue"
item_state = "instagibblue"
ammo_type = list(/obj/item/ammo_casing/energy/instakill/blue)
/obj/item/weapon/gun/energy/laser/instakill/emp_act() //implying you could stop the instagib
return
/obj/item/weapon/gun/energy/gravity_gun
name = "one-point bluespace-gravitational manipulator"
icon_state = "gravity_gun"
item_state = "gravity_gun"
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity"
ammo_type = list(/obj/item/ammo_casing/energy/gravityrepulse, /obj/item/ammo_casing/energy/gravityattract, /obj/item/ammo_casing/energy/gravitychaos)
origin_tech = "combat=4;magnets=4;materials=6;powerstorage=4;bluespace=4"
item_state = null
icon_state = "gravity_gun"
var/power = 4

View File

@@ -0,0 +1,54 @@
/obj/item/weapon/gun/energy/taser
name = "taser gun"
desc = "A low-capacity, energy-based stun gun used by security teams to subdue targets at range."
icon_state = "taser"
item_state = null //so the human update icon uses the icon_state instead.
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
origin_tech = "combat=3"
ammo_x_offset = 3
/obj/item/weapon/gun/energy/shock_revolver
name = "tesla gun"
desc = "An experimental gun based on an experimental engine, it's about as likely to kill it's operator as it is the target."
icon_state = "tesla"
item_state = "tesla"
ammo_type = list(/obj/item/ammo_casing/energy/shock_revolver)
origin_tech = "combat=4;materials=4;powerstorage=4"
can_flashlight = 0
pin = null
shaded_charge = 1
/obj/item/weapon/gun/energy/gun/advtaser
name = "hybrid taser"
desc = "A dual-mode taser designed to fire both short-range high-power electrodes and long-range disabler beams."
icon_state = "advtaser"
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/disabler)
origin_tech = "combat=4"
ammo_x_offset = 2
/obj/item/weapon/gun/energy/gun/advtaser/cyborg
name = "cyborg taser"
desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating."
can_flashlight = 0
can_charge = 0
/obj/item/weapon/gun/energy/gun/advtaser/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/disabler
name = "disabler"
desc = "A self-defense weapon that exhausts organic targets, weakening them until they collapse."
icon_state = "disabler"
item_state = "combat=3"
ammo_type = list(/obj/item/ammo_casing/energy/disabler)
ammo_x_offset = 3
/obj/item/weapon/gun/energy/disabler/cyborg
name = "cyborg disabler"
desc = "An integrated disabler that draws from a cyborg's power cell. This weapon contains a limiter to prevent the cyborg's power cell from overheating."
can_charge = 0
/obj/item/weapon/gun/energy/disabler/cyborg/newshot()
..()
robocharge()

View File

@@ -0,0 +1,53 @@
/obj/item/weapon/gun/grenadelauncher
name = "grenade launcher"
desc = "a terrible, terrible thing. it's really awful!"
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "riotgun"
item_state = "riotgun"
w_class = 4
throw_speed = 2
throw_range = 7
force = 5
var/list/grenades = new/list()
var/max_grenades = 3
materials = list(MAT_METAL=2000)
/obj/item/weapon/gun/grenadelauncher/examine(mob/user)
..()
user << "[grenades.len] / [max_grenades] grenades loaded."
/obj/item/weapon/gun/grenadelauncher/attackby(obj/item/I, mob/user, params)
if((istype(I, /obj/item/weapon/grenade)))
if(grenades.len < max_grenades)
if(!user.unEquip(I))
return
I.loc = src
grenades += I
user << "<span class='notice'>You put the grenade in the grenade launcher.</span>"
user << "<span class='notice'>[grenades.len] / [max_grenades] Grenades.</span>"
else
usr << "<span class='danger'>The grenade launcher cannot hold more grenades.</span>"
/obj/item/weapon/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
if(target == user)
return
if(grenades.len)
fire_grenade(target,user)
else
usr << "<span class='danger'>The grenade launcher is empty.</span>"
/obj/item/weapon/gun/grenadelauncher/proc/fire_grenade(atom/target, mob/user)
user.visible_message("<span class='danger'>[user] fired a grenade!</span>", \
"<span class='danger'>You fire the grenade launcher!</span>")
var/obj/item/weapon/grenade/chem_grenade/F = grenades[1] //Now with less copypasta!
grenades -= F
F.loc = user.loc
F.throw_at_fast(target, 30, 2,user)
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
F.active = 1
F.icon_state = initial(icon_state) + "_active"
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
addtimer(F, "prime", 15)

View File

@@ -0,0 +1,81 @@
/obj/item/weapon/gun/magic
name = "staff of nothing"
desc = "This staff is boring to watch because even though it came first you've seen everything it can do in other staves for years."
icon = 'icons/obj/guns/magic.dmi'
icon_state = "staffofnothing"
item_state = "staff"
fire_sound = 'sound/weapons/emitter.ogg'
flags = CONDUCT
w_class = 5
var/max_charges = 6
var/charges = 0
var/recharge_rate = 4
var/charge_tick = 0
var/can_charge = 1
var/ammo_type
var/no_den_usage
origin_tech = null
clumsy_check = 0
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead
pin = /obj/item/device/firing_pin/magic
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
/obj/item/weapon/gun/magic/afterattack(atom/target, mob/living/user, flag)
newshot()
if(no_den_usage)
var/area/A = get_area(user)
if(istype(A, /area/wizard_station))
user << "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>"
return
else
no_den_usage = 0
..()
/obj/item/weapon/gun/magic/can_shoot()
return charges
/obj/item/weapon/gun/magic/newshot()
if (charges && chambered)
chambered.newshot()
return
/obj/item/weapon/gun/magic/process_chamber()
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
charges--//... drain a charge
return
/obj/item/weapon/gun/magic/New()
..()
charges = max_charges
chambered = new ammo_type(src)
if(can_charge)
START_PROCESSING(SSobj, src)
/obj/item/weapon/gun/magic/Destroy()
if(can_charge)
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/weapon/gun/magic/process()
charge_tick++
if(charge_tick < recharge_rate || charges >= max_charges)
return 0
charge_tick = 0
charges++
return 1
/obj/item/weapon/gun/magic/update_icon()
return
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
user << "<span class='warning'>The [name] whizzles quietly.<span>"
return
/obj/item/weapon/gun/magic/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is twisting the [src.name] above \his head, releasing a magical blast! It looks like \he's trying to commit suicide.</span>")
playsound(loc, fire_sound, 50, 1, -1)
return (FIRELOSS)

View File

@@ -0,0 +1,61 @@
/obj/item/weapon/gun/magic/staff/
slot_flags = SLOT_BACK
/obj/item/weapon/gun/magic/staff/change
name = "staff of change"
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
fire_sound = "sound/magic/Staff_Change.ogg"
ammo_type = /obj/item/ammo_casing/magic/change
icon_state = "staffofchange"
item_state = "staffofchange"
/obj/item/weapon/gun/magic/staff/animate
name = "staff of animation"
desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
fire_sound = "sound/magic/Staff_animation.ogg"
ammo_type = /obj/item/ammo_casing/magic/animate
icon_state = "staffofanimation"
item_state = "staffofanimation"
/obj/item/weapon/gun/magic/staff/healing
name = "staff of healing"
desc = "An artefact that spits bolts of restoring magic which can remove ailments of all kinds and even raise the dead."
fire_sound = "sound/magic/Staff_Healing.ogg"
ammo_type = /obj/item/ammo_casing/magic/heal
icon_state = "staffofhealing"
item_state = "staffofhealing"
/obj/item/weapon/gun/magic/staff/healing/handle_suicide() //Stops people trying to commit suicide to heal themselves
return
/obj/item/weapon/gun/magic/staff/chaos
name = "staff of chaos"
desc = "An artefact that spits bolts of chaotic magic that can potentially do anything."
fire_sound = "sound/magic/Staff_Chaos.ogg"
ammo_type = /obj/item/ammo_casing/magic/chaos
icon_state = "staffofchaos"
item_state = "staffofchaos"
max_charges = 10
recharge_rate = 2
no_den_usage = 1
/obj/item/weapon/gun/magic/staff/door
name = "staff of door creation"
desc = "An artefact that spits bolts of transformative magic that can create doors in walls."
fire_sound = "sound/magic/Staff_Door.ogg"
ammo_type = /obj/item/ammo_casing/magic/door
icon_state = "staffofdoor"
item_state = "staffofdoor"
max_charges = 10
recharge_rate = 2
no_den_usage = 1
/obj/item/weapon/gun/magic/staff/honk
name = "staff of the honkmother"
desc = "Honk"
fire_sound = "sound/items/airhorn.ogg"
ammo_type = /obj/item/ammo_casing/magic/honk
icon_state = "honker"
item_state = "honker"
max_charges = 4
recharge_rate = 8

View File

@@ -0,0 +1,168 @@
/obj/item/weapon/gun/magic/wand/
name = "wand of nothing"
desc = "It's not just a stick, it's a MAGIC stick!"
ammo_type = /obj/item/ammo_casing/magic
icon_state = "nothingwand"
item_state = "wand"
w_class = 2
can_charge = 0
max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths)
var/variable_charges = 1
/obj/item/weapon/gun/magic/wand/New()
if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges
if(prob(33))
max_charges = Ceiling(max_charges / 3)
else
max_charges = Ceiling(max_charges / 2)
..()
/obj/item/weapon/gun/magic/wand/examine(mob/user)
..()
user << "Has [charges] charge\s remaining."
/obj/item/weapon/gun/magic/wand/update_icon()
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
/obj/item/weapon/gun/magic/wand/attack(atom/target, mob/living/user)
if(target == user)
return
..()
/obj/item/weapon/gun/magic/wand/afterattack(atom/target, mob/living/user)
if(!charges)
shoot_with_empty_chamber(user)
return
if(target == user)
if(no_den_usage)
var/area/A = get_area(user)
if(istype(A, /area/wizard_station))
user << "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>"
return
else
no_den_usage = 0
zap_self(user)
else
..()
update_icon()
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user)
user.visible_message("<span class='danger'>[user] zaps \himself with [src].</span>")
playsound(user, fire_sound, 50, 1)
user.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> zapped \himself with a <b>[src]</b>"
/////////////////////////////////////
//WAND OF DEATH
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/death
name = "wand of death"
desc = "This deadly wand overwhelms the victim's body with pure energy, slaying them without fail."
fire_sound = "sound/magic/WandoDeath.ogg"
ammo_type = /obj/item/ammo_casing/magic/death
icon_state = "deathwand"
max_charges = 3 //3, 2, 2, 1
/obj/item/weapon/gun/magic/wand/death/zap_self(mob/living/user)
var/message ="<span class='warning'>You irradiate yourself with pure energy! "
message += pick("Do not pass go. Do not collect 200 zorkmids.</span>","You feel more confident in your spell casting skills.</span>","You Die...</span>","Do you want your possessions identified?</span>")
user << message
user.adjustOxyLoss(500)
charges--
..()
/////////////////////////////////////
//WAND OF HEALING
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/resurrection
name = "wand of healing"
desc = "This wand uses healing magics to heal and revive. They are rarely utilized within the Wizard Federation for some reason."
ammo_type = /obj/item/ammo_casing/magic/heal
fire_sound = "sound/magic/Staff_Healing.ogg"
icon_state = "revivewand"
max_charges = 10 //10, 5, 5, 4
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
user.revive(full_heal = 1)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.regenerate_limbs()
user << "<span class='notice'>You feel great!</span>"
charges--
..()
/////////////////////////////////////
//WAND OF POLYMORPH
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/polymorph
name = "wand of polymorph"
desc = "This wand is attuned to chaos and will radically alter the victim's form."
ammo_type = /obj/item/ammo_casing/magic/change
icon_state = "polywand"
fire_sound = "sound/magic/Staff_Change.ogg"
max_charges = 10 //10, 5, 5, 4
/obj/item/weapon/gun/magic/wand/polymorph/zap_self(mob/living/user)
..() //because the user mob ceases to exists by the time wabbajack fully resolves
wabbajack(user)
charges--
/////////////////////////////////////
//WAND OF TELEPORTATION
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/teleport
name = "wand of teleportation"
desc = "This wand will wrench targets through space and time to move them somewhere else."
ammo_type = /obj/item/ammo_casing/magic/teleport
fire_sound = "sound/magic/Wand_Teleport.ogg"
icon_state = "telewand"
max_charges = 10 //10, 5, 5, 4
no_den_usage = 1
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
if(do_teleport(user, user, 10))
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(3, user.loc)
smoke.start()
charges--
..()
/////////////////////////////////////
//WAND OF DOOR CREATION
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/door
name = "wand of door creation"
desc = "This particular wand can create doors in any wall for the unscrupulous wizard who shuns teleportation magics."
ammo_type = /obj/item/ammo_casing/magic/door
icon_state = "doorwand"
fire_sound = "sound/magic/Staff_Door.ogg"
max_charges = 20 //20, 10, 10, 7
no_den_usage = 1
/obj/item/weapon/gun/magic/wand/door/zap_self(mob/living/user)
user << "<span class='notice'>You feel vaguely more open with your feelings.</span>"
charges--
..()
/////////////////////////////////////
//WAND OF FIREBALL
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/fireball
name = "wand of fireball"
desc = "This wand shoots scorching balls of fire that explode into destructive flames."
fire_sound = "sound/magic/Fireball.ogg"
ammo_type = /obj/item/ammo_casing/magic/fireball
icon_state = "firewand"
max_charges = 8 //8, 4, 4, 3
/obj/item/weapon/gun/magic/wand/fireball/zap_self(mob/living/user)
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
charges--
..()

View File

@@ -0,0 +1,127 @@
/obj/item/weapon/gun/medbeam
name = "Medical Beamgun"
desc = "Delivers medical nanites in a focused beam."
icon = 'icons/obj/chronos.dmi'
icon_state = "chronogun"
item_state = "chronogun"
w_class = 3.0
var/mob/living/current_target
var/last_check = 0
var/check_delay = 10 //Check los as often as possible, max resolution is SSobj tick though
var/max_range = 8
var/active = 0
var/datum/beam/current_beam = null
var/mounted = 0 //Denotes if this is a handheld or mounted version
weapon_weight = WEAPON_MEDIUM
/obj/item/weapon/gun/medbeam/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/weapon/gun/medbeam/dropped(mob/user)
..()
LoseTarget()
/obj/item/weapon/gun/medbeam/equipped(mob/user)
..()
LoseTarget()
/obj/item/weapon/gun/medbeam/proc/LoseTarget()
if(active)
qdel(current_beam)
active = 0
on_beam_release(current_target)
current_target = null
/obj/item/weapon/gun/medbeam/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
if(isliving(user))
add_fingerprint(user)
if(current_target)
LoseTarget()
if(!isliving(target))
return
current_target = target
active = 1
current_beam = new(user,current_target,time=6000,beam_icon_state="medbeam",btype=/obj/effect/ebeam/medical)
addtimer(current_beam, "Start", 0)
feedback_add_details("gun_fired","[src.type]")
/obj/item/weapon/gun/medbeam/process()
var/source = loc
if(!mounted && !ishuman(source))
LoseTarget()
return
if(!current_target)
LoseTarget()
return
if(world.time <= last_check+check_delay)
return
last_check = world.time
if(get_dist(source, current_target)>max_range || !los_check(source, current_target))
LoseTarget()
if(ishuman(source))
source << "<span class='warning'>You lose control of the beam!</span>"
return
if(current_target)
on_beam_tick(current_target)
/obj/item/weapon/gun/medbeam/proc/los_check(atom/movable/user, mob/target)
var/turf/user_turf = user.loc
if(mounted)
user_turf = get_turf(user)
else if(!istype(user_turf))
return 0
var/obj/dummy = new(user_turf)
dummy.pass_flags |= PASSTABLE|PASSGLASS|PASSGRILLE //Grille/Glass so it can be used through common windows
for(var/turf/turf in getline(user_turf,target))
if(mounted && turf == user_turf)
continue //Mechs are dense and thus fail the check
if(turf.density)
qdel(dummy)
return 0
for(var/atom/movable/AM in turf)
if(!AM.CanPass(dummy,turf,1))
qdel(dummy)
return 0
for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams!
if(B.owner != current_beam)
explosion(B.loc,0,3,5,8)
qdel(dummy)
return 0
qdel(dummy)
return 1
/obj/item/weapon/gun/medbeam/proc/on_beam_hit(var/mob/living/target)
return
/obj/item/weapon/gun/medbeam/proc/on_beam_tick(var/mob/living/target)
if(target.health != target.maxHealth)
PoolOrNew(/obj/effect/overlay/temp/heal, list(get_turf(target), "#80F5FF"))
target.adjustBruteLoss(-4)
target.adjustFireLoss(-4)
return
/obj/item/weapon/gun/medbeam/proc/on_beam_release(var/mob/living/target)
return
/obj/effect/ebeam/medical
name = "medical beam"
//////////////////////////////Mech Version///////////////////////////////
/obj/item/weapon/gun/medbeam/mech
mounted = 1
/obj/item/weapon/gun/medbeam/mech/New()
..()
STOP_PROCESSING(SSobj, src) //Mech mediguns do not process until installed, and are controlled by the holder obj

View File

@@ -0,0 +1,28 @@
/obj/item/weapon/gun/energy/gun/advtaser/mounted
name = "mounted taser"
desc = "An arm mounted dual-mode weapon that fires electrodes and disabler shots."
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "taser"
item_state = "armcannonstun4"
force = 5
selfcharge = 1
can_flashlight = 0
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead
/obj/item/weapon/gun/energy/gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
..()
src.loc = null//send it to nullspace to get retrieved by the implant later on. gotta cover those edge cases.
/obj/item/weapon/gun/energy/laser/mounted
name = "mounted laser"
desc = "An arm mounted cannon that fires lethal lasers."
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "laser"
item_state = "armcannonlase"
force = 5
selfcharge = 1
trigger_guard = TRIGGER_GUARD_ALLOW_ALL
/obj/item/weapon/gun/energy/laser/mounted/dropped()
..()
src.loc = null

View File

@@ -0,0 +1,208 @@
/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"

View File

@@ -0,0 +1,409 @@
/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

View File

@@ -0,0 +1,153 @@
//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)
..()

View File

@@ -0,0 +1,81 @@
//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()

View File

@@ -0,0 +1,58 @@
/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)

View File

@@ -0,0 +1,373 @@
/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()

View File

@@ -0,0 +1,212 @@
/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

View File

@@ -0,0 +1,108 @@
/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

View File

@@ -0,0 +1,93 @@
/obj/item/weapon/gun/syringe
name = "syringe gun"
desc = "A spring loaded rifle designed to fit syringes, used to incapacitate unruly patients from a distance."
icon_state = "syringegun"
item_state = "syringegun"
w_class = 3
throw_speed = 3
throw_range = 7
force = 4
materials = list(MAT_METAL=2000)
origin_tech = "combat=2;biotech=3"
clumsy_check = 0
fire_sound = 'sound/items/syringeproj.ogg'
var/list/syringes = list()
var/max_syringes = 1
/obj/item/weapon/gun/syringe/New()
..()
chambered = new /obj/item/ammo_casing/syringegun(src)
/obj/item/weapon/gun/syringe/newshot()
if(!syringes.len) return
var/obj/item/weapon/reagent_containers/syringe/S = syringes[1]
if(!S) return
chambered.BB = new S.projectile_type (src)
S.reagents.trans_to(chambered.BB, S.reagents.total_volume)
chambered.BB.name = S.name
syringes.Remove(S)
qdel(S)
return
/obj/item/weapon/gun/syringe/process_chamber()
return
/obj/item/weapon/gun/syringe/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
if(target == loc)
return
newshot()
..()
/obj/item/weapon/gun/syringe/examine(mob/user)
..()
user << "Can hold [max_syringes] syringe\s. Has [syringes.len] syringe\s remaining."
/obj/item/weapon/gun/syringe/attack_self(mob/living/user)
if(!syringes.len)
user << "<span class='warning'>[src] is empty!</span>"
return 0
var/obj/item/weapon/reagent_containers/syringe/S = syringes[syringes.len]
if(!S) return 0
S.loc = user.loc
syringes.Remove(S)
user << "<span class='notice'>You unload [S] from \the [src].</span>"
return 1
/obj/item/weapon/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = 1)
if(istype(A, /obj/item/weapon/reagent_containers/syringe))
if(syringes.len < max_syringes)
if(!user.unEquip(A))
return
user << "<span class='notice'>You load [A] into \the [src].</span>"
syringes.Add(A)
A.loc = src
return 1
else
usr << "<span class='warning'>[src] cannot hold more syringes!</span>"
return 0
/obj/item/weapon/gun/syringe/rapidsyringe
name = "rapid syringe gun"
desc = "A modification of the syringe gun design, using a rotating cylinder to store up to six syringes."
icon_state = "rapidsyringegun"
max_syringes = 6
/obj/item/weapon/gun/syringe/syndicate
name = "dart pistol"
desc = "A small spring-loaded sidearm that functions identically to a syringe gun."
icon_state = "syringe_pistol"
item_state = "gun" //Smaller inhand
w_class = 2
origin_tech = "combat=2;syndicate=2;biotech=3"
force = 2 //Also very weak because it's smaller
suppressed = 1 //Softer fire sound
can_unsuppress = 0 //Permanently silenced

View File

@@ -0,0 +1,219 @@
/obj/item/device/firing_pin
name = "electronic firing pin"
desc = "A small authentication device, to be inserted into a firearm receiver to allow operation. NT safety regulations require all new designs to incorporate one."
icon = 'icons/obj/device.dmi'
icon_state = "firing_pin"
item_state = "pen"
origin_tech = "materials=2;combat=4"
flags = CONDUCT
w_class = 1
attack_verb = list("poked")
var/emagged = 0
var/fail_message = "<span class='warning'>INVALID USER.</span>"
var/selfdestruct = 0 // Explode when user check is failed.
var/force_replace = 0 // Can forcefully replace other pins.
var/pin_removeable = 0 // Can be replaced by any pin.
var/obj/item/weapon/gun/gun
/obj/item/device/firing_pin/New(newloc)
..()
if(istype(newloc, /obj/item/weapon/gun))
gun = newloc
/obj/item/device/firing_pin/afterattack(atom/target, mob/user, proximity_flag)
if(proximity_flag)
if(istype(target, /obj/item/weapon/gun))
var/obj/item/weapon/gun/G = target
if(G.pin && (force_replace || G.pin.pin_removeable))
G.pin.loc = get_turf(G)
G.pin.gun_remove(user)
user << "<span class ='notice'>You remove [G]'s old pin.</span>"
if(!G.pin)
if(!user.unEquip(src))
return
gun_insert(user, G)
user << "<span class ='notice'>You insert [src] into [G].</span>"
else
user << "<span class ='notice'>This firearm already has a firing pin installed.</span>"
/obj/item/device/firing_pin/emag_act(mob/user)
if(!emagged)
emagged = 1
user << "<span class='notice'>You override the authentication mechanism.</span>"
/obj/item/device/firing_pin/proc/gun_insert(mob/living/user, obj/item/weapon/gun/G)
gun = G
loc = gun
gun.pin = src
return
/obj/item/device/firing_pin/proc/gun_remove(mob/living/user)
gun.pin = null
gun = null
return
/obj/item/device/firing_pin/proc/pin_auth(mob/living/user)
return 1
/obj/item/device/firing_pin/proc/auth_fail(mob/living/user)
user.show_message(fail_message, 1)
if(selfdestruct)
user.show_message("<span class='danger'>SELF-DESTRUCTING...</span><br>", 1)
user << "<span class='userdanger'>[gun] explodes!</span>"
explosion(get_turf(gun), -1, 0, 2, 3)
if(gun)
qdel(gun)
/obj/item/device/firing_pin/magic
name = "magic crystal shard"
desc = "A small enchanted shard which allows magical weapons to fire."
// Test pin, works only near firing range.
/obj/item/device/firing_pin/test_range
name = "test-range firing pin"
desc = "This safety firing pin allows weapons to be fired within proximity to a firing range."
fail_message = "<span class='warning'>TEST RANGE CHECK FAILED.</span>"
pin_removeable = 1
origin_tech = "combat=2;materials=2"
/obj/item/device/firing_pin/test_range/pin_auth(mob/living/user)
for(var/obj/machinery/magnetic_controller/M in range(user, 3))
return 1
return 0
// Implant pin, checks for implant
/obj/item/device/firing_pin/implant
name = "implant-keyed firing pin"
desc = "This is a security firing pin which only authorizes users who are implanted with a certain device."
fail_message = "<span class='warning'>IMPLANT CHECK FAILED.</span>"
var/obj/item/weapon/implant/req_implant = null
/obj/item/device/firing_pin/implant/pin_auth(mob/living/user)
for(var/obj/item/weapon/implant/I in user)
if(req_implant && I.imp_in == user && I.type == req_implant)
return 1
return 0
/obj/item/device/firing_pin/implant/mindshield
name = "mindshield firing pin"
desc = "This Security firing pin authorizes the weapon for only mindshield-implanted users."
icon_state = "firing_pin_loyalty"
req_implant = /obj/item/weapon/implant/mindshield
/obj/item/device/firing_pin/implant/pindicate
name = "syndicate firing pin"
icon_state = "firing_pin_pindi"
req_implant = /obj/item/weapon/implant/weapons_auth
// Honk pin, clown's joke item.
// Can replace other pins. Replace a pin in cap's laser for extra fun!
/obj/item/device/firing_pin/clown
name = "hilarious firing pin"
desc = "Advanced clowntech that can convert any firearm into a far more useful object."
color = "yellow"
fail_message = "<span class='warning'>HONK!</span>"
force_replace = 1
/obj/item/device/firing_pin/clown/pin_auth(mob/living/user)
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
return 0
// Ultra-honk pin, clown's deadly joke item.
// A gun with ultra-honk pin is useful for clown and useless for everyone else.
/obj/item/device/firing_pin/clown/ultra/pin_auth(mob/living/user)
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
if(!(user.disabilities & CLUMSY) && !(user.mind && user.mind.assigned_role == "Clown"))
return 0
return 1
/obj/item/device/firing_pin/clown/ultra/gun_insert(mob/living/user, obj/item/weapon/gun/G)
..()
G.clumsy_check = 0
/obj/item/device/firing_pin/clown/ultra/gun_remove(mob/living/user)
gun.clumsy_check = initial(gun.clumsy_check)
..()
// Now two times deadlier!
/obj/item/device/firing_pin/clown/ultra/selfdestruct
desc = "Advanced clowntech that can convert any firearm into a far more useful object. It has a small nitrobananium charge on it."
selfdestruct = 1
// DNA-keyed pin.
// When you want to keep your toys for youself.
/obj/item/device/firing_pin/dna
name = "DNA-keyed firing pin"
desc = "This is a DNA-locked firing pin which only authorizes one user. Attempt to fire once to DNA-link."
icon_state = "firing_pin_dna"
fail_message = "<span class='warning'>DNA CHECK FAILED.</span>"
var/unique_enzymes = null
/obj/item/device/firing_pin/dna/afterattack(atom/target, mob/user, proximity_flag)
..()
if(proximity_flag && iscarbon(target))
var/mob/living/carbon/M = target
if(M.dna && M.dna.unique_enzymes)
unique_enzymes = M.dna.unique_enzymes
user << "<span class='notice'>DNA-LOCK SET.</span>"
/obj/item/device/firing_pin/dna/pin_auth(mob/living/carbon/user)
if(istype(user) && user.dna && user.dna.unique_enzymes)
if(user.dna.unique_enzymes == unique_enzymes)
return 1
return 0
/obj/item/device/firing_pin/dna/auth_fail(mob/living/carbon/user)
if(!unique_enzymes)
if(istype(user) && user.dna && user.dna.unique_enzymes)
unique_enzymes = user.dna.unique_enzymes
user << "<span class='notice'>DNA-LOCK SET.</span>"
else
..()
/obj/item/device/firing_pin/dna/dredd
desc = "This is a DNA-locked firing pin which only authorizes one user. Attempt to fire once to DNA-link. It has a small explosive charge on it."
selfdestruct = 1
// Laser tag pins
/obj/item/device/firing_pin/tag
name = "laser tag firing pin"
desc = "A recreational firing pin, used in laser tag units to ensure users have their vests on."
fail_message = "<span class='warning'>SUIT CHECK FAILED.</span>"
var/obj/item/clothing/suit/suit_requirement = null
var/tagcolor = ""
/obj/item/device/firing_pin/tag/pin_auth(mob/living/user)
if(ishuman(user))
var/mob/living/carbon/human/M = user
if(istype(M.wear_suit, suit_requirement))
return 1
user << "<span class='warning'>You need to be wearing [tagcolor] laser tag armor!</span>"
return 0
/obj/item/device/firing_pin/tag/red
name = "red laser tag firing pin"
icon_state = "firing_pin_red"
suit_requirement = /obj/item/clothing/suit/redtag
tagcolor = "red"
/obj/item/device/firing_pin/tag/blue
name = "blue laser tag firing pin"
icon_state = "firing_pin_blue"
suit_requirement = /obj/item/clothing/suit/bluetag
tagcolor = "blue"
/obj/item/device/firing_pin/Destroy()
if(gun)
gun.pin = null
return ..()

View File

@@ -0,0 +1,221 @@
/obj/item/projectile
name = "projectile"
icon = 'icons/obj/projectiles.dmi'
icon_state = "bullet"
density = 0
anchored = 1
flags = ABSTRACT
unacidable = 1
pass_flags = PASSTABLE
mouse_opacity = 0
hitsound = 'sound/weapons/pierce.ogg'
var/hitsound_wall = ""
pressure_resistance = INFINITY
burn_state = LAVA_PROOF
var/def_zone = "" //Aiming at
var/mob/firer = null//Who shot it
var/obj/item/ammo_casing/ammo_casing = null
var/suppressed = 0 //Attack message
var/yo = null
var/xo = null
var/current = null
var/atom/original = null // the original target clicked
var/turf/starting = null // the projectile's starting turf
var/list/permutated = list() // we've passed through these atoms, don't try to hit them again
var/paused = FALSE //for suspending the projectile midair
var/p_x = 16
var/p_y = 16 // the pixel location of the tile that the player clicked. Default is the center
var/speed = 1 //Amount of deciseconds it takes for projectile to travel
var/Angle = 0
var/spread = 0 //amount (in degrees) of projectile spread
var/legacy = 0 //legacy projectile system
animate_movement = 0 //Use SLIDE_STEPS in conjunction with legacy
var/damage = 10
var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here
var/nodamage = 0 //Determines if the projectile will skip any damage inflictions
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb
var/projectile_type = "/obj/item/projectile"
var/range = 50 //This will de-increment every step. When 0, it will delete the projectile.
//Effects
var/stun = 0
var/weaken = 0
var/paralyze = 0
var/irradiate = 0
var/stutter = 0
var/slur = 0
var/eyeblur = 0
var/drowsy = 0
var/stamina = 0
var/jitter = 0
var/forcedodge = 0 //to pass through everything
/obj/item/projectile/New()
permutated = list()
return ..()
/obj/item/projectile/proc/Range()
range--
if(range <= 0 && loc)
on_range()
/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
qdel(src)
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0, hit_zone)
if(!isliving(target))
return 0
var/mob/living/L = target
if(blocked != 100) // not completely blocked
var/organ_hit_text = ""
if(L.has_limbs)
organ_hit_text = " in \the [parse_zone(def_zone)]"
if(suppressed)
playsound(loc, hitsound, 5, 1, -1)
L << "<span class='userdanger'>You're shot by \a [src][organ_hit_text]!</span>"
else
if(hitsound)
var/volume = vol_by_damage()
playsound(loc, hitsound, volume, 1, -1)
L.visible_message("<span class='danger'>[L] is hit by \a [src][organ_hit_text]!</span>", \
"<span class='userdanger'>[L] is hit by \a [src][organ_hit_text]!</span>") //X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
L.on_hit(type)
var/reagent_note
if(reagents && reagents.reagent_list)
reagent_note = " REAGENTS:"
for(var/datum/reagent/R in reagents.reagent_list)
reagent_note += R.id + " ("
reagent_note += num2text(R.volume) + ") "
add_logs(firer, L, "shot", src, reagent_note)
return L.apply_effects(stun, weaken, paralyze, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter)
/obj/item/projectile/proc/vol_by_damage()
if(src.damage)
return Clamp((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
else
return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume
/obj/item/projectile/Bump(atom/A, yes)
if(!yes) //prevents double bumps.
return
if(firer)
if(A == firer || (A == firer.loc && istype(A, /obj/mecha))) //cannot shoot yourself or your mech
loc = A.loc
return 0
var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
if(isturf(A) && hitsound_wall)
var/volume = Clamp(vol_by_damage() + 20, 0, 100)
if(suppressed)
volume = 5
playsound(loc, hitsound_wall, volume, 1, -1)
var/turf/target_turf = get_turf(A)
var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null
if(permutation == -1 || forcedodge)// the bullet passes through a dense object!
loc = target_turf
if(A)
permutated.Add(A)
return 0
else
if(A && A.density && !ismob(A) && !(A.flags & ON_BORDER)) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs on that tile.
var/list/mobs_list = list()
for(var/mob/living/L in target_turf)
mobs_list += L
if(mobs_list.len)
var/mob/living/picked_mob = pick(mobs_list)
picked_mob.bullet_act(src, def_zone)
qdel(src)
/obj/item/projectile/Process_Spacemove(var/movement_dir = 0)
return 1 //Bullets don't drift in space
/obj/item/projectile/proc/fire(var/setAngle)
if(setAngle)
Angle = setAngle
if(!legacy) //new projectiles
set waitfor = 0
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
if(!Angle)
Angle=round(Get_Angle(src,current))
if(spread)
Angle += (rand() - 0.5) * spread
var/matrix/M = new
M.Turn(Angle)
transform = M
var/Pixel_x=round(sin(Angle)+16*sin(Angle)*2)
var/Pixel_y=round(cos(Angle)+16*cos(Angle)*2)
var/pixel_x_offset = pixel_x + Pixel_x
var/pixel_y_offset = pixel_y + Pixel_y
var/new_x = x
var/new_y = y
while(pixel_x_offset > 16)
pixel_x_offset -= 32
pixel_x -= 32
new_x++// x++
while(pixel_x_offset < -16)
pixel_x_offset += 32
pixel_x += 32
new_x--
while(pixel_y_offset > 16)
pixel_y_offset -= 32
pixel_y -= 32
new_y++
while(pixel_y_offset < -16)
pixel_y_offset += 32
pixel_y += 32
new_y--
speed = round(speed)
step_towards(src, locate(new_x, new_y, z))
if(speed <= 1)
pixel_x = pixel_x_offset
pixel_y = pixel_y_offset
else
animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (speed <= 3 ? speed - 1 : speed)))
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(max(1, speed))
else //old projectile system
set waitfor = 0
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
step_towards(src, current)
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(1)
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
..()
if(isliving(AM) && AM.density && !checkpass(PASSMOB))
Bump(AM, 1)
/obj/item/projectile/Destroy()
ammo_casing = null
return ..()
/obj/item/projectile/proc/dumbfire(var/dir)
current = get_ranged_target_turf(src, dir, world.maxx)
fire()

View File

@@ -0,0 +1,139 @@
/obj/item/projectile/beam
name = "laser"
icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 20
luminosity = 1
damage_type = BURN
hitsound = 'sound/weapons/sear.ogg'
hitsound_wall = 'sound/weapons/effects/searwall.ogg'
flag = "laser"
eyeblur = 2
/obj/item/projectile/beam/laser
/obj/item/projectile/beam/laser/heavylaser
name = "heavy laser"
icon_state = "heavylaser"
damage = 40
/obj/item/projectile/beam/laser/on_hit(atom/target, blocked = 0)
. = ..()
if(iscarbon(target))
var/mob/living/carbon/M = target
M.IgniteMob()
/obj/item/projectile/beam/weak
damage = 15
armour_penetration = 50
/obj/item/projectile/beam/practice
name = "practice laser"
damage = 0
nodamage = 1
/obj/item/projectile/beam/scatter
name = "laser pellet"
icon_state = "scatterlaser"
damage = 5
/obj/item/projectile/beam/xray
name = "xray beam"
icon_state = "xray"
damage = 15
irradiate = 30
range = 15
forcedodge = 1
/obj/item/projectile/beam/disabler
name = "disabler beam"
icon_state = "omnilaser"
damage = 36
damage_type = STAMINA
flag = "energy"
hitsound = 'sound/weapons/tap.ogg'
eyeblur = 0
/obj/item/projectile/beam/pulse
name = "pulse"
icon_state = "u_laser"
damage = 50
luminosity = 2
/obj/item/projectile/beam/pulse/on_hit(atom/target, blocked = 0)
. = ..()
if(istype(target,/turf/)||istype(target,/obj/structure/))
target.ex_act(2)
/obj/item/projectile/beam/pulse/shot
damage = 40
/obj/item/projectile/beam/pulse/heavy
name = "heavy pulse laser"
icon_state = "pulse1_bl"
var/life = 20
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0, hit_zone)
life -= 10
if(life > 0)
. = -1
..()
/obj/item/projectile/beam/emitter
name = "emitter beam"
icon_state = "emitter"
damage = 30
legacy = 1
luminosity = 2
animate_movement = SLIDE_STEPS
/obj/item/projectile/beam/emitter/singularity_pull()
return //don't want the emitters to miss
/obj/item/projectile/beam/emitter/Destroy()
..()
return QDEL_HINT_PUTINPOOL
/obj/item/projectile/beam/lasertag
name = "laser tag beam"
icon_state = "omnilaser"
hitsound = null
damage = 0
damage_type = STAMINA
flag = "laser"
var/suit_types = list(/obj/item/clothing/suit/redtag, /obj/item/clothing/suit/bluetag)
/obj/item/projectile/beam/lasertag/on_hit(atom/target, blocked = 0)
. = ..()
if(ishuman(target))
var/mob/living/carbon/human/M = target
if(istype(M.wear_suit))
if(M.wear_suit.type in suit_types)
M.adjustStaminaLoss(34)
/obj/item/projectile/beam/lasertag/redtag
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
/obj/item/projectile/beam/lasertag/bluetag
icon_state = "bluelaser"
suit_types = list(/obj/item/clothing/suit/redtag)
/obj/item/projectile/beam/instakill
name = "instagib laser"
icon_state = "purple_laser"
damage = 200
damage_type = BURN
/obj/item/projectile/beam/instakill/blue
icon_state = "blue_laser"
/obj/item/projectile/beam/instakill/red
icon_state = "red_laser"
/obj/item/projectile/beam/instakill/on_hit(atom/target)
. = ..()
if(iscarbon(target))
var/mob/living/carbon/M = target
M.visible_message("<span class='danger'>[M] explodes into a shower of gibs!</span>")
M.gib()

View File

@@ -0,0 +1,322 @@
/obj/item/projectile/bullet
name = "bullet"
icon_state = "bullet"
damage = 60
damage_type = BRUTE
nodamage = 0
flag = "bullet"
hitsound_wall = "ricochet"
/obj/item/projectile/bullet/weakbullet //beanbag, heavy stamina damage
damage = 5
stamina = 80
/obj/item/projectile/bullet/weakbullet2 //detective revolver instastuns, but multiple shots are better for keeping punks down
damage = 15
weaken = 3
stamina = 50
/obj/item/projectile/bullet/weakbullet3
damage = 20
/obj/item/projectile/bullet/toxinbullet
damage = 15
damage_type = TOX
/obj/item/projectile/bullet/incendiary/firebullet
damage = 10
/obj/item/projectile/bullet/armourpiercing
damage = 17
armour_penetration = 10
/obj/item/projectile/bullet/pellet
name = "pellet"
damage = 15
/obj/item/projectile/bullet/pellet/weak/New()
damage = 6
range = rand(8)
/obj/item/projectile/bullet/pellet/weak/on_range()
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
..()
/obj/item/projectile/bullet/pellet/overload/New()
damage = 3
range = rand(10)
/obj/item/projectile/bullet/pellet/overload/on_hit(atom/target, blocked = 0)
..()
explosion(target, 0, 0, 2)
/obj/item/projectile/bullet/pellet/overload/on_range()
explosion(src, 0, 0, 2)
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(3, 3, src)
sparks.start()
..()
/obj/item/projectile/bullet/midbullet
damage = 20
stamina = 65 //two round bursts from the c20r knocks people down
/obj/item/projectile/bullet/midbullet2
damage = 25
/obj/item/projectile/bullet/midbullet3
damage = 30
/obj/item/projectile/bullet/heavybullet
damage = 35
/obj/item/projectile/bullet/rpellet
damage = 3
stamina = 25
/obj/item/projectile/bullet/stunshot //taser slugs for shotguns, nothing special
name = "stunshot"
damage = 5
stun = 5
weaken = 5
stutter = 5
jitter = 20
range = 7
icon_state = "spark"
color = "#FFFF00"
/obj/item/projectile/bullet/incendiary/on_hit(atom/target, blocked = 0)
. = ..()
if(iscarbon(target))
var/mob/living/carbon/M = target
M.adjust_fire_stacks(4)
M.IgniteMob()
/obj/item/projectile/bullet/incendiary/shell
name = "incendiary slug"
damage = 20
/obj/item/projectile/bullet/incendiary/shell/Move()
..()
var/turf/location = get_turf(src)
if(location)
PoolOrNew(/obj/effect/hotspot, location)
location.hotspot_expose(700, 50, 1)
/obj/item/projectile/bullet/incendiary/shell/dragonsbreath
name = "dragonsbreath round"
damage = 5
/obj/item/projectile/bullet/meteorshot
name = "meteor"
icon = 'icons/obj/meteor.dmi'
icon_state = "dust"
damage = 30
weaken = 8
stun = 8
hitsound = 'sound/effects/meteorimpact.ogg'
/obj/item/projectile/bullet/meteorshot/weak
damage = 10
weaken = 4
stun = 4
/obj/item/projectile/bullet/honker
damage = 0
weaken = 3
stun = 3
forcedodge = 1
nodamage = 1
hitsound = 'sound/items/bikehorn.ogg'
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "banana"
range = 200
/obj/item/projectile/bullet/honker/New()
..()
SpinAnimation()
/obj/item/projectile/bullet/meteorshot/on_hit(atom/target, blocked = 0)
. = ..()
if(istype(target, /atom/movable))
var/atom/movable/M = target
var/atom/throw_target = get_edge_target_turf(M, get_dir(src, get_step_away(M, src)))
M.throw_at(throw_target, 3, 2)
/obj/item/projectile/bullet/meteorshot/New()
..()
SpinAnimation()
/obj/item/projectile/bullet/mime
damage = 20
/obj/item/projectile/bullet/mime/on_hit(atom/target, blocked = 0)
. = ..()
if(iscarbon(target))
var/mob/living/carbon/M = target
M.silent = max(M.silent, 10)
/obj/item/projectile/bullet/dart
name = "dart"
icon_state = "cbbolt"
damage = 6
var/piercing = 0
/obj/item/projectile/bullet/dart/New()
..()
create_reagents(50)
reagents.set_reacting(FALSE)
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0, hit_zone)
if(iscarbon(target))
var/mob/living/carbon/M = target
if(blocked != 100) // not completely blocked
if(M.can_inject(null,0,hit_zone,piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
return 1
else
blocked = 100
target.visible_message("<span class='danger'>The [name] was deflected!</span>", \
"<span class='userdanger'>You were protected against the [name]!</span>")
..(target, blocked, hit_zone)
reagents.set_reacting(TRUE)
reagents.handle_reactions()
return 1
/obj/item/projectile/bullet/dart/metalfoam/New()
..()
reagents.add_reagent("aluminium", 15)
reagents.add_reagent("foaming_agent", 5)
reagents.add_reagent("facid", 5)
//This one is for future syringe guns update
/obj/item/projectile/bullet/dart/syringe
name = "syringe"
icon = 'icons/obj/chemical.dmi'
icon_state = "syringeproj"
//Piercing Syringe
/obj/item/projectile/bullet/dart/syringe/piercing
piercing = 1
/obj/item/projectile/bullet/neurotoxin
name = "neurotoxin spit"
icon_state = "neurotoxin"
damage = 5
damage_type = TOX
weaken = 5
/obj/item/projectile/bullet/neurotoxin/on_hit(atom/target, blocked = 0)
if(isalien(target))
weaken = 0
nodamage = 1
. = ..() // Execute the rest of the code.
//// SNIPER BULLETS
/obj/item/projectile/bullet/sniper
damage = 70
stun = 5
weaken = 5
armour_penetration = 50
var/breakthings = TRUE
/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0, hit_zone)
if((blocked != 100) && (!ismob(target) && breakthings))
target.ex_act(rand(1,2))
return ..()
/obj/item/projectile/bullet/sniper/soporific
armour_penetration = 0
nodamage = 1
stun = 0
weaken = 0
breakthings = FALSE
/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone)
if((blocked != 100) && istype(target, /mob/living))
var/mob/living/L = target
L.Sleeping(20)
return ..()
/obj/item/projectile/bullet/sniper/haemorrhage
armour_penetration = 15
damage = 15
stun = 0
weaken = 0
breakthings = FALSE
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone)
if((blocked != 100) && iscarbon(target))
var/mob/living/carbon/C = target
C.bleed(100)
return ..()
/obj/item/projectile/bullet/sniper/penetrator
icon_state = "gauss"
name = "penetrator round"
damage = 60
forcedodge = 1
stun = 0
weaken = 0
breakthings = FALSE
//// SAW BULLETS
/obj/item/projectile/bullet/saw
damage = 45
armour_penetration = 5
/obj/item/projectile/bullet/saw/bleeding
damage = 20
armour_penetration = 0
/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0, hit_zone)
. = ..()
if((blocked != 100) && iscarbon(target))
var/mob/living/carbon/C = target
C.bleed(35)
/obj/item/projectile/bullet/saw/hollow
damage = 60
armour_penetration = -10
/obj/item/projectile/bullet/saw/ap
damage = 40
armour_penetration = 75
/obj/item/projectile/bullet/saw/incen
damage = 7
armour_penetration = 0
obj/item/projectile/bullet/saw/incen/Move()
..()
var/turf/location = get_turf(src)
if(location)
PoolOrNew(/obj/effect/hotspot, location)
location.hotspot_expose(700, 50, 1)
/obj/item/projectile/bullet/saw/incen/on_hit(atom/target, blocked = 0)
. = ..()
if(iscarbon(target))
var/mob/living/carbon/M = target
M.adjust_fire_stacks(3)
M.IgniteMob()

View File

@@ -0,0 +1,190 @@
/obj/item/projectile/energy
name = "energy"
icon_state = "spark"
damage = 0
damage_type = BURN
flag = "energy"
/obj/item/projectile/energy/electrode
name = "electrode"
icon_state = "spark"
color = "#FFFF00"
nodamage = 1
stun = 5
weaken = 5
stutter = 5
jitter = 20
hitsound = 'sound/weapons/taserhit.ogg'
range = 7
/obj/item/projectile/energy/electrode/on_hit(atom/target, blocked = 0)
. = ..()
if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - burst into sparks!
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
else if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.dna && C.dna.check_mutation(HULK))
C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
else if(C.status_flags & CANWEAKEN)
addtimer(C, "do_jitter_animation", 5, FALSE, jitter)
/obj/item/projectile/energy/electrode/on_range() //to ensure the bolt sparks when it reaches the end of its range if it didn't hit a target yet
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
..()
/obj/item/projectile/energy/net
name = "energy netting"
icon_state = "e_netting"
damage = 10
damage_type = STAMINA
hitsound = 'sound/weapons/taserhit.ogg'
range = 10
/obj/item/projectile/energy/net/New()
..()
SpinAnimation()
/obj/item/projectile/energy/net/on_hit(atom/target, blocked = 0)
if(isliving(target))
var/turf/Tloc = get_turf(target)
if(!locate(/obj/effect/nettingportal) in Tloc)
new/obj/effect/nettingportal(Tloc)
..()
/obj/item/projectile/energy/net/on_range()
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
..()
/obj/effect/nettingportal
name = "DRAGnet teleportation field"
desc = "A field of bluespace energy, locking on to teleport a target."
icon = 'icons/effects/effects.dmi'
icon_state = "dragnetfield"
anchored = 1
unacidable = 1
/obj/effect/nettingportal/New()
..()
SetLuminosity(3)
var/obj/item/device/radio/beacon/teletarget = null
for(var/obj/machinery/computer/teleporter/com in machines)
if(com.target)
if(com.power_station && com.power_station.teleporter_hub && com.power_station.engaged)
teletarget = com.target
if(teletarget)
spawn(30)
for(var/mob/living/L in get_turf(src))
do_teleport(L, teletarget, 2)//teleport what's in the tile to the beacon
qdel(src)
else
spawn(30)
for(var/mob/living/L in get_turf(src))
do_teleport(L, L, 15) //Otherwise it just warps you off somewhere.
qdel(src)
/obj/item/projectile/energy/trap
name = "energy snare"
icon_state = "e_snare"
nodamage = 1
weaken = 1
hitsound = 'sound/weapons/taserhit.ogg'
range = 4
/obj/item/projectile/energy/trap/on_hit(atom/target, blocked = 0)
if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - drop a trap
new/obj/item/weapon/restraints/legcuffs/beartrap/energy(get_turf(loc))
else if(iscarbon(target))
var/obj/item/weapon/restraints/legcuffs/beartrap/B = new /obj/item/weapon/restraints/legcuffs/beartrap/energy(get_turf(target))
B.Crossed(target)
..()
/obj/item/projectile/energy/trap/on_range()
new/obj/item/weapon/restraints/legcuffs/beartrap/energy(loc)
..()
/obj/item/projectile/energy/trap/cyborg
name = "Energy Bola"
icon_state = "e_snare"
nodamage = 1
weaken = 0
hitsound = 'sound/weapons/taserhit.ogg'
range = 10
/obj/item/projectile/energy/trap/cyborg/on_hit(atom/target, blocked = 0)
if(!ismob(target) || blocked >= 100)
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
qdel(src)
if(iscarbon(target))
var/obj/item/weapon/restraints/legcuffs/beartrap/B = new /obj/item/weapon/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target))
B.Crossed(target)
spawn(10)
qdel(src)
..()
/obj/item/projectile/energy/trap/cyborg/on_range()
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
qdel(src)
/obj/item/projectile/energy/declone
name = "radiation beam"
icon_state = "declone"
damage = 20
damage_type = CLONE
irradiate = 10
/obj/item/projectile/energy/dart //ninja throwing dart
name = "dart"
icon_state = "toxin"
damage = 5
damage_type = TOX
weaken = 5
range = 7
/obj/item/projectile/energy/bolt //ebow bolts
name = "bolt"
icon_state = "cbbolt"
damage = 15
damage_type = TOX
nodamage = 0
weaken = 5
stutter = 5
/obj/item/projectile/energy/bolt/large
damage = 20
/obj/item/ammo_casing/energy/plasma
projectile_type = /obj/item/projectile/plasma
select_name = "plasma burst"
fire_sound = 'sound/weapons/pulse.ogg'
/obj/item/ammo_casing/energy/plasma/adv
projectile_type = /obj/item/projectile/plasma/adv
/obj/item/projectile/energy/shock_revolver
name = "shock bolt"
icon_state = "purple_laser"
var/chain
/obj/item/ammo_casing/energy/shock_revolver/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
..()
var/obj/item/projectile/hook/P = BB
spawn(1)
P.chain = P.Beam(user,icon_state="purple_lightning",icon = 'icons/effects/effects.dmi',time=1000, maxdistance = 30)
/obj/item/projectile/energy/shock_revolver/on_hit(atom/target)
. = ..()
if(isliving(target))
tesla_zap(src, 3, 10000)
qdel(chain)

View File

@@ -0,0 +1,332 @@
/obj/item/projectile/magic
name = "bolt of nothing"
icon_state = "energy"
damage = 0
damage_type = OXY
nodamage = 1
armour_penetration = 100
flag = "magic"
/obj/item/projectile/magic/death
name = "bolt of death"
icon_state = "pulse1_bl"
/obj/item/projectile/magic/death/on_hit(target)
. = ..()
if(ismob(target))
var/mob/M = target
M.death(0)
/obj/item/projectile/magic/fireball
name = "bolt of fireball"
icon_state = "fireball"
damage = 10
damage_type = BRUTE
nodamage = 0
/obj/item/projectile/magic/fireball/Range()
var/turf/T1 = get_step(src,turn(dir, -45))
var/turf/T2 = get_step(src,turn(dir, 45))
var/mob/living/L = locate(/mob/living) in T1 //if there's a mob alive in our front right diagonal, we hit it.
if(L && L.stat != DEAD)
Bump(L) //Magic Bullet #teachthecontroversy
return
L = locate(/mob/living) in T2
if(L && L.stat != DEAD)
Bump(L)
return
..()
/obj/item/projectile/magic/fireball/on_hit(target)
. = ..()
var/turf/T = get_turf(target)
explosion(T, -1, 0, 2, 3, 0, flame_range = 2)
if(ismob(target)) //multiple flavors of pain
var/mob/living/M = target
M.take_overall_damage(0,10) //between this 10 burn, the 10 brute, the explosion brute, and the onfire burn, your at about 65 damage if you stop drop and roll immediately
/obj/item/projectile/magic/resurrection
name = "bolt of resurrection"
icon_state = "ion"
damage = 0
damage_type = OXY
nodamage = 1
/obj/item/projectile/magic/resurrection/on_hit(mob/living/carbon/target)
. = ..()
if(isliving(target))
if(target.hellbound)
return
if(iscarbon(target))
var/mob/living/carbon/C = target
C.regenerate_limbs()
if(target.revive(full_heal = 1))
target.grab_ghost(force = TRUE) // even suicides
target << "<span class='notice'>You rise with a start, \
you're alive!!!</span>"
else if(target.stat != DEAD)
target << "<span class='notice'>You feel great!</span>"
/obj/item/projectile/magic/teleport
name = "bolt of teleportation"
icon_state = "bluespace"
damage = 0
damage_type = OXY
nodamage = 1
var/inner_tele_radius = 0
var/outer_tele_radius = 6
/obj/item/projectile/magic/teleport/on_hit(mob/target)
. = ..()
var/teleammount = 0
var/teleloc = target
if(!isturf(target))
teleloc = target.loc
for(var/atom/movable/stuff in teleloc)
if(!stuff.anchored && stuff.loc)
if(do_teleport(stuff, stuff, 10))
teleammount++
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(max(round(4 - teleammount),0), stuff.loc) //Smoke drops off if a lot of stuff is moved for the sake of sanity
smoke.start()
/obj/item/projectile/magic/door
name = "bolt of door creation"
icon_state = "energy"
damage = 0
damage_type = OXY
nodamage = 1
var/list/door_types = list(/obj/structure/mineral_door/wood,/obj/structure/mineral_door/iron,/obj/structure/mineral_door/silver,\
/obj/structure/mineral_door/gold,/obj/structure/mineral_door/uranium,/obj/structure/mineral_door/sandstone,/obj/structure/mineral_door/transparent/plasma,\
/obj/structure/mineral_door/transparent/diamond)
/obj/item/projectile/magic/door/on_hit(atom/target)
. = ..()
if(istype(target, /obj/machinery/door))
OpenDoor(target)
else
var/turf/T = get_turf(target)
if(istype(T,/turf/closed) && !istype(T, /turf/closed/indestructible))
CreateDoor(T)
/obj/item/projectile/magic/door/proc/CreateDoor(turf/T)
var/door_type = pick(door_types)
var/obj/structure/mineral_door/D = new door_type(T)
T.ChangeTurf(/turf/open/floor/plating)
D.Open()
/obj/item/projectile/magic/door/proc/OpenDoor(var/obj/machinery/door/D)
if(istype(D,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/A = D
A.locked = 0
D.open()
/obj/item/projectile/magic/change
name = "bolt of change"
icon_state = "ice_1"
damage = 0
damage_type = BURN
nodamage = 1
/obj/item/projectile/magic/change/on_hit(atom/change)
. = ..()
wabbajack(change)
/proc/wabbajack(mob/living/M)
if(!istype(M) || M.stat == DEAD || M.notransform || (GODMODE & M.status_flags))
return
M.notransform = 1
M.canmove = 0
M.icon = null
M.cut_overlays()
M.invisibility = INVISIBILITY_ABSTRACT
var/list/contents = M.contents.Copy()
if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi)
qdel(Robot.mmi)
Robot.notify_ai(1)
else
for(var/obj/item/W in contents)
if(!M.unEquip(W))
qdel(W)
var/mob/living/new_mob
var/randomize = pick("monkey","robot","slime","xeno","humanoid","animal")
switch(randomize)
if("monkey")
new_mob = new /mob/living/carbon/monkey(M.loc)
if("robot")
var/robot = pick("cyborg","syndiborg","drone")
switch(robot)
if("cyborg")
new_mob = new /mob/living/silicon/robot(M.loc)
if("syndiborg")
var/path
if(prob(50))
path = /mob/living/silicon/robot/syndicate
else
path = /mob/living/silicon/robot/syndicate/medical
new_mob = new path(M.loc)
if("drone")
new_mob = new /mob/living/simple_animal/drone/polymorphed(M.loc)
if(issilicon(new_mob))
new_mob.gender = M.gender
new_mob.invisibility = 0
new_mob.job = "Cyborg"
var/mob/living/silicon/robot/Robot = new_mob
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
if("slime")
new_mob = new /mob/living/simple_animal/slime/random(M.loc)
if("xeno")
if(prob(50))
new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc)
else
new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc)
if("animal")
var/path
if(prob(50))
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat","killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp")
switch(beast)
if("carp")
path = /mob/living/simple_animal/hostile/carp
if("bear")
path = /mob/living/simple_animal/hostile/bear
if("mushroom")
path = /mob/living/simple_animal/hostile/mushroom
if("statue")
path = /mob/living/simple_animal/hostile/statue
if("bat")
path = /mob/living/simple_animal/hostile/retaliate/bat
if("goat")
path = /mob/living/simple_animal/hostile/retaliate/goat
if("killertomato")
path = /mob/living/simple_animal/hostile/killertomato
if("spiderbase")
path = /mob/living/simple_animal/hostile/poison/giant_spider
if("spiderhunter")
path = /mob/living/simple_animal/hostile/poison/giant_spider/hunter
if("blobbernaut")
path = /mob/living/simple_animal/hostile/blob/blobbernaut/independent
if("magicarp")
path = /mob/living/simple_animal/hostile/carp/ranged
if("chaosmagicarp")
path = /mob/living/simple_animal/hostile/carp/ranged/chaos
else
var/animal = pick("parrot","corgi","crab","pug","cat","mouse","chicken","cow","lizard","chick","fox","butterfly","cak")
switch(animal)
if("parrot")
path = /mob/living/simple_animal/parrot
if("corgi")
path = /mob/living/simple_animal/pet/dog/corgi
if("crab")
path = /mob/living/simple_animal/crab
if("pug")
path = /mob/living/simple_animal/pet/dog/pug
if("cat")
path = /mob/living/simple_animal/pet/cat
if("mouse")
path = /mob/living/simple_animal/mouse
if("chicken")
path = /mob/living/simple_animal/chicken
if("cow")
path = /mob/living/simple_animal/cow
if("lizard")
path = /mob/living/simple_animal/hostile/lizard
if("fox")
path = /mob/living/simple_animal/pet/fox
if("butterfly")
path = /mob/living/simple_animal/butterfly
if("cak")
path = /mob/living/simple_animal/pet/cat/cak
if("chick")
path = /mob/living/simple_animal/chick
new_mob = new path(M.loc)
if("humanoid")
new_mob = new /mob/living/carbon/human(M.loc)
var/datum/preferences/A = new() //Randomize appearance for the human
A.copy_to(new_mob, icon_updates=0)
var/mob/living/carbon/human/H = new_mob
if(prob(50))
var/list/all_species = list()
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!S.dangerous_existence)
all_species += speciestype
H.set_species(pick(all_species), icon_update=0)
H.update_body()
H.update_hair()
H.update_body_parts()
H.dna.update_dna_identity()
if(!new_mob)
return
new_mob.languages_spoken |= HUMAN
new_mob.languages_understood |= HUMAN
new_mob.attack_log = M.attack_log
// Some forms can still wear some items
for(var/obj/item/W in contents)
new_mob.equip_to_appropriate_slot(W)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>[M.real_name] ([M.ckey]) became [new_mob.real_name].</font>")
new_mob.a_intent = "harm"
M.wabbajack_act(new_mob)
new_mob << "<span class='warning'>Your form morphs into that of \
a [randomize].</span>"
qdel(M)
return new_mob
/obj/item/projectile/magic/animate
name = "bolt of animation"
icon_state = "red_1"
damage = 0
damage_type = BURN
nodamage = 1
/obj/item/projectile/magic/animate/Bump(atom/change)
..()
if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects))
if(istype(change, /obj/structure/closet/statue))
for(var/mob/living/carbon/human/H in change.contents)
var/mob/living/simple_animal/hostile/statue/S = new /mob/living/simple_animal/hostile/statue(change.loc, firer)
S.name = "statue of [H.name]"
S.faction = list("\ref[firer]")
S.icon = change.icon
S.icon_state = change.icon_state
S.overlays = change.overlays
S.color = change.color
if(H.mind)
H.mind.transfer_to(S)
S << "<span class='userdanger'>You are an animate statue. You cannot move when monitored, but are nearly invincible and deadly when unobserved! Do not harm [firer.name], your creator.</span>"
H = change
H.loc = S
qdel(src)
return
else
var/obj/O = change
if(istype(O, /obj/item/weapon/gun))
new /mob/living/simple_animal/hostile/mimic/copy/ranged(O.loc, O, firer)
else
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
else if(istype(change, /mob/living/simple_animal/hostile/mimic/copy))
// Change our allegiance!
var/mob/living/simple_animal/hostile/mimic/copy/C = change
C.ChangeOwner(firer)

View File

@@ -0,0 +1,64 @@
/obj/item/projectile/bullet/reusable
name = "reusable bullet"
desc = "How do you even reuse a bullet?"
var/ammo_type = /obj/item/ammo_casing/caseless/
var/dropped = 0
/obj/item/projectile/bullet/reusable/on_hit(atom/target, blocked = 0)
. = ..()
handle_drop()
/obj/item/projectile/bullet/reusable/on_range()
handle_drop()
..()
/obj/item/projectile/bullet/reusable/proc/handle_drop()
if(!dropped)
new ammo_type(src.loc)
dropped = 1
/obj/item/projectile/bullet/reusable/magspear
name = "magnetic spear"
desc = "WHITE WHALE, HOLY GRAIL"
damage = 30 //takes 3 spears to kill a mega carp, one to kill a normal carp
icon_state = "magspear"
ammo_type = /obj/item/ammo_casing/caseless/magspear
/obj/item/projectile/bullet/reusable/foam_dart
name = "foam dart"
desc = "I hope you're wearing eye protection."
damage = 0 // It's a damn toy.
damage_type = OXY
nodamage = 1
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
range = 10
var/obj/item/weapon/pen/pen = null
/obj/item/projectile/bullet/reusable/foam_dart/handle_drop()
if(dropped)
return
dropped = 1
var/obj/item/ammo_casing/caseless/foam_dart/newdart = new ammo_type(src.loc)
var/obj/item/ammo_casing/caseless/foam_dart/old_dart = ammo_casing
newdart.modified = old_dart.modified
if(pen)
var/obj/item/projectile/bullet/reusable/foam_dart/newdart_FD = newdart.BB
newdart_FD.pen = pen
pen.loc = newdart_FD
pen = null
newdart.BB.damage = damage
newdart.BB.nodamage = nodamage
newdart.BB.damage_type = damage_type
newdart.update_icon()
/obj/item/projectile/bullet/reusable/foam_dart/Destroy()
pen = null
return ..()
/obj/item/projectile/bullet/reusable/foam_dart/riot
name = "riot foam dart"
icon_state = "foamdart_riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
stamina = 25

View File

@@ -0,0 +1,346 @@
/obj/item/projectile/ion
name = "ion bolt"
icon_state = "ion"
damage = 0
damage_type = BURN
nodamage = 1
flag = "energy"
/obj/item/projectile/ion/on_hit(atom/target, blocked = 0)
..()
empulse(target, 1, 1)
return 1
/obj/item/projectile/ion/weak
/obj/item/projectile/ion/weak/on_hit(atom/target, blocked = 0)
..()
empulse(target, 0, 0)
return 1
/obj/item/projectile/bullet/gyro
name ="explosive bolt"
icon_state= "bolter"
damage = 50
/obj/item/projectile/bullet/gyro/on_hit(atom/target, blocked = 0)
..()
explosion(target, -1, 0, 2)
return 1
/obj/item/projectile/bullet/a40mm
name ="40mm grenade"
desc = "USE A WEEL GUN"
icon_state= "bolter"
damage = 60
/obj/item/projectile/bullet/a40mm/on_hit(atom/target, blocked = 0)
..()
explosion(target, -1, 0, 2, 1, 0, flame_range = 3)
return 1
/obj/item/projectile/temp
name = "freeze beam"
icon_state = "ice_2"
damage = 0
damage_type = BURN
nodamage = 1
flag = "energy"
var/temperature = 100
/obj/item/projectile/temp/on_hit(atom/target, blocked = 0)//These two could likely check temp protection on the mob
..()
if(isliving(target))
var/mob/M = target
M.bodytemperature = temperature
return 1
/obj/item/projectile/temp/hot
name = "heat beam"
temperature = 400
/obj/item/projectile/meteor
name = "meteor"
icon = 'icons/obj/meteor.dmi'
icon_state = "small1"
damage = 0
damage_type = BRUTE
nodamage = 1
flag = "bullet"
/obj/item/projectile/meteor/Bump(atom/A, yes)
if(!yes) //prevents multi bumps.
return
if(A == firer)
loc = A.loc
return
A.ex_act(2)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
for(var/mob/M in urange(10, src))
if(!M.stat)
shake_camera(M, 3, 1)
qdel(src)
/obj/item/projectile/energy/floramut
name = "alpha somatoray"
icon_state = "energy"
damage = 0
damage_type = TOX
nodamage = 1
flag = "energy"
/obj/item/projectile/energy/floramut/on_hit(atom/target, blocked = 0)
. = ..()
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.dna.species.id == "pod")
randmuti(C)
randmut(C)
C.updateappearance()
C.domutcheck()
/obj/item/projectile/energy/florayield
name = "beta somatoray"
icon_state = "energy2"
damage = 0
damage_type = TOX
nodamage = 1
flag = "energy"
/obj/item/projectile/beam/mindflayer
name = "flayer ray"
/obj/item/projectile/beam/mindflayer/on_hit(atom/target, blocked = 0)
. = ..()
if(ishuman(target))
var/mob/living/carbon/human/M = target
M.adjustBrainLoss(20)
M.hallucination += 20
/obj/item/projectile/kinetic
name = "kinetic force"
icon_state = null
damage = 10
damage_type = BRUTE
flag = "bomb"
range = 3
var/splash = 0
/obj/item/projectile/kinetic/super
damage = 11
range = 4
/obj/item/projectile/kinetic/hyper
damage = 12
range = 5
splash = 1
/obj/item/projectile/kinetic/New()
var/turf/proj_turf = get_turf(src)
if(!istype(proj_turf, /turf))
return
var/datum/gas_mixture/environment = proj_turf.return_air()
var/pressure = environment.return_pressure()
if(pressure < 50)
name = "full strength kinetic force"
damage *= 4
..()
/obj/item/projectile/kinetic/on_range()
new /obj/effect/kinetic_blast(src.loc)
..()
/obj/item/projectile/kinetic/on_hit(atom/target)
. = ..()
var/turf/target_turf= get_turf(target)
if(istype(target_turf, /turf/closed/mineral))
var/turf/closed/mineral/M = target_turf
M.gets_drilled(firer)
new /obj/effect/kinetic_blast(target_turf)
if(src.splash)
for(var/turf/T in range(splash, target_turf))
if(istype(T, /turf/closed/mineral))
var/turf/closed/mineral/M = T
M.gets_drilled(firer)
/obj/effect/kinetic_blast
name = "kinetic explosion"
icon = 'icons/obj/projectiles.dmi'
icon_state = "kinetic_blast"
layer = ABOVE_ALL_MOB_LAYER
/obj/effect/kinetic_blast/New()
spawn(4)
qdel(src)
/obj/item/projectile/beam/wormhole
name = "bluespace beam"
icon_state = "spark"
hitsound = "sparks"
damage = 3
var/obj/item/weapon/gun/energy/wormhole_projector/gun
color = "#33CCFF"
/obj/item/projectile/beam/wormhole/orange
name = "orange bluespace beam"
color = "#FF6600"
/obj/item/projectile/beam/wormhole/New(var/obj/item/ammo_casing/energy/wormhole/casing)
if(casing)
gun = casing.gun
/obj/item/ammo_casing/energy/wormhole/New(var/obj/item/weapon/gun/energy/wormhole_projector/wh)
gun = wh
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
if(ismob(target))
var/turf/portal_destination = pick(orange(6, src))
do_teleport(target, portal_destination)
return ..()
if(!gun)
qdel(src)
gun.create_portal(src)
/obj/item/projectile/bullet/frag12
name ="explosive slug"
damage = 25
weaken = 5
/obj/item/projectile/bullet/frag12/on_hit(atom/target, blocked = 0)
..()
explosion(target, -1, 0, 1)
return 1
/obj/item/projectile/plasma
name = "plasma blast"
icon_state = "plasmacutter"
damage_type = BRUTE
damage = 5
range = 5
/obj/item/projectile/plasma/New()
var/turf/proj_turf = get_turf(src)
if(!istype(proj_turf, /turf))
return
var/datum/gas_mixture/environment = proj_turf.return_air()
if(environment)
var/pressure = environment.return_pressure()
if(pressure < 60)
name = "full strength plasma blast"
damage *= 4
..()
/obj/item/projectile/plasma/on_hit(atom/target)
. = ..()
if(istype(target, /turf/closed/mineral))
var/turf/closed/mineral/M = target
M.gets_drilled(firer)
Range()
if(range > 0)
return -1
/obj/item/projectile/plasma/adv
damage = 7
range = 7
/obj/item/projectile/plasma/adv/mech
damage = 10
range = 8
/obj/item/projectile/gravityrepulse
name = "repulsion bolt"
icon = 'icons/effects/effects.dmi'
icon_state = "chronofield"
hitsound = "sound/weapons/wave.ogg"
damage = 0
damage_type = BRUTE
nodamage = 1
color = "#33CCFF"
var/turf/T
var/power = 4
/obj/item/projectile/gravityrepulse/New(var/obj/item/ammo_casing/energy/gravityrepulse/C)
..()
if(C) //Hard-coded maximum power so servers can't be crashed by trying to throw the entire Z level's items
power = min(C.gun.power, 15)
/obj/item/projectile/gravityrepulse/on_hit()
. = ..()
T = get_turf(src)
for(var/atom/movable/A in range(T, power))
if(A == src || (firer && A == src.firer) || A.anchored)
continue
var/throwtarget = get_edge_target_turf(src, get_dir(src, get_step_away(A, src)))
A.throw_at_fast(throwtarget,power+1,1)
for(var/turf/F in range(T,power))
var/obj/effect/overlay/gravfield = new /obj/effect/overlay{icon='icons/effects/effects.dmi'; icon_state="shieldsparkles"; mouse_opacity=0; density=0}()
F.overlays += gravfield
spawn(5)
F.overlays -= gravfield
/obj/item/projectile/gravityattract
name = "attraction bolt"
icon = 'icons/effects/effects.dmi'
icon_state = "chronofield"
hitsound = "sound/weapons/wave.ogg"
damage = 0
damage_type = BRUTE
nodamage = 1
color = "#FF6600"
var/turf/T
var/power = 4
/obj/item/projectile/gravityattract/New(var/obj/item/ammo_casing/energy/gravityattract/C)
..()
if(C) //Hard-coded maximum power so servers can't be crashed by trying to throw the entire Z level's items
power = min(C.gun.power, 15)
/obj/item/projectile/gravityattract/on_hit()
. = ..()
T = get_turf(src)
for(var/atom/movable/A in range(T, power))
if(A == src || (firer && A == src.firer) || A.anchored)
continue
A.throw_at_fast(T, power+1, 1)
for(var/turf/F in range(T,power))
var/obj/effect/overlay/gravfield = new /obj/effect/overlay{icon='icons/effects/effects.dmi'; icon_state="shieldsparkles"; mouse_opacity=0; density=0}()
F.overlays += gravfield
spawn(5)
F.overlays -= gravfield
/obj/item/projectile/gravitychaos
name = "gravitational blast"
icon = 'icons/effects/effects.dmi'
icon_state = "chronofield"
hitsound = "sound/weapons/wave.ogg"
damage = 0
damage_type = BRUTE
nodamage = 1
color = "#101010"
var/turf/T
var/power = 4
/obj/item/projectile/gravitychaos/New(var/obj/item/ammo_casing/energy/gravitychaos/C)
..()
if(C) //Hard-coded maximum power so servers can't be crashed by trying to throw the entire Z level's items
power = min(C.gun.power, 15)
/obj/item/projectile/gravitychaos/on_hit()
. = ..()
T = get_turf(src)
for(var/atom/movable/A in range(T, power))
if(A == src|| (firer && A == src.firer) || A.anchored)
continue
A.throw_at_fast(get_edge_target_turf(A, pick(cardinal)), power+1, 1)
for(var/turf/Z in range(T,power))
var/obj/effect/overlay/gravfield = new /obj/effect/overlay{icon='icons/effects/effects.dmi'; icon_state="shieldsparkles"; mouse_opacity=0; density=0}()
Z.overlays += gravfield
spawn(5)
Z.overlays -= gravfield