Here we go again...

This commit is contained in:
TheDZD
2016-05-27 19:14:04 -04:00
parent aad02ad697
commit 95d7a68a75
54 changed files with 3403 additions and 3296 deletions

View File

@@ -6,13 +6,16 @@
flags = CONDUCT
slot_flags = SLOT_BELT
throwforce = 1
w_class = 1.0
var/caliber = "" //Which kind of guns it can be loaded into
var/projectile_type = ""//The bullet type to create when New() is called
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
var/deviation = 0
var/spread = 0
var/pellets = 1 //Pellets for spreadshot
var/variance = 0 //Variance for inaccuracy fundamental to the casing
var/delay = 0 //Delay for energy weapons
var/randomspread = 0 //Randomspread for automatics
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()
@@ -29,54 +32,45 @@
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent"]"
/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/screwdriver))
if(BB)
if(initial(BB.name) == "bullet")
var/tmp_label = ""
var/label_text = sanitize(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label))
if(length(label_text) > 20)
to_chat(user, "<span class='warning''>The inscription can be at most 20 characters long.</span>")
/obj/item/ammo_casing/attackby(obj/item/I as obj, mob/user as mob, 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
if(label_text == "")
to_chat(user, "<span class='notice'>You scratch the inscription off of [initial(BB)].</span>")
BB.name = initial(BB.name)
continue
if (boolets > 0)
box.update_icon()
to_chat(user, "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>")
else
to_chat(user, "<span class='warning'>You fail to collect anything!</span>")
else
if(istype(I, /obj/item/weapon/screwdriver))
if(BB)
if(initial(BB.name) == "bullet")
var/tmp_label = ""
var/label_text = sanitize(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label))
if(length(label_text) > 20)
to_chat(user, "<span class='warning''>The inscription can be at most 20 characters long.</span>")
else
to_chat(user, "<span class='notice'>You inscribe \"[label_text]\" into \the [initial(BB.name)].</span>")
BB.name = "[initial(BB.name)] \"[label_text]\""
if(label_text == "")
to_chat(user, "<span class='notice'>You scratch the inscription off of [initial(BB)].</span>")
BB.name = initial(BB.name)
else
to_chat(user, "<span class='notice'>You inscribe \"[label_text]\" into \the [initial(BB.name)].</span>")
BB.name = "[initial(BB.name)] \"[label_text]\""
else
to_chat(user, "<span class='notice'>You can only inscribe a metal bullet.</span>")//because inscribing beanbags is silly
else
to_chat(user, "<span class='notice'>You can only inscribe a metal bullet.</span>")//because inscribing beanbags is silly
else
to_chat(user, "<span class='notice'>There is no bullet in the casing to inscribe anything into.</span>")
/obj/item/ammo_casing/attackby(obj/item/ammo_box/box as obj, mob/user as mob, params)
if(!istype(box, /obj/item/ammo_box))
return
if(isturf(loc))
var/boolets = 0
for(var/obj/item/ammo_casing/pew in loc)
if(box.stored_ammo.len >= box.max_ammo)
break
if(pew.BB)
if(box.give_round(pew))
boolets++
else
continue
if(boolets > 0)
box.update_icon()
to_chat(user, "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>")
else
to_chat(user, "<span class='notice'>You fail to collect anything.</span>")
/obj/item/ammo_casing/proc/newshot() //For energy weapons, shotgun shells and wands (!).
if(!BB)
BB = new projectile_type(src)
return
to_chat(user, "<span class='notice'>There is no bullet in the casing to inscribe anything into.</span>")
..()
//Boxes of ammo
/obj/item/ammo_box
@@ -89,53 +83,78 @@
item_state = "syringe_kit"
materials = list(MAT_METAL=30000)
throwforce = 2
w_class = 1.0
w_class = 1
throw_speed = 4
throw_range = 10
var/list/stored_ammo = list()
var/obj/item/ammo_casing/ammo_type
var/ammo_type = /obj/item/ammo_casing
var/max_ammo = 7
var/multiple_sprites = 0
var/caliber = ""
var/caliber
var/multiload = 1
/obj/item/ammo_box/New()
for(var/i = 1, i <= max_ammo, i++)
for(var/i in 1 to max_ammo)
stored_ammo += new ammo_type(src)
update_icon()
/obj/item/ammo_box/proc/get_round(var/keep = 0)
if(!stored_ammo.len)
/obj/item/ammo_box/Destroy()
for(atom/A in stored_ammo)
qdel(A)
stored_ammo = null
return ..()
/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)
if (keep)
stored_ammo.Insert(1,b)
return b
/obj/item/ammo_box/proc/give_round(var/obj/item/ammo_casing/r)
var/obj/item/ammo_casing/rb = r
if(rb)
if(stored_ammo.len < max_ammo && rb.caliber == caliber)
stored_ammo += rb
rb.loc = src
return 1
/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/attackby(var/obj/item/A as obj, mob/user as mob, var/silent = 0, params)
/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/didload = give_round(AC)
if(didload)
var/did_load = give_round(AC, replace_spent)
if(did_load)
AM.stored_ammo -= AC
num_loaded++
if(!multiload || !didload)
if(!multiload || !did_load)
break
if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/AC = A
if(give_round(AC))
if(give_round(AC, replace_spent))
user.drop_item()
AC.loc = src
num_loaded++

View File

@@ -1,128 +1,137 @@
/obj/item/ammo_casing/a357
desc = "A .357 bullet casing."
caliber = "357"
projectile_type = "/obj/item/projectile/bullet"
projectile_type = /obj/item/projectile/bullet
/obj/item/ammo_casing/a762
desc = "A 7.62mm 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"
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/rubber"
/obj/item/ammo_casing/cap
desc = "A cap for children toys."
caliber = "caps"
projectile_type = "/obj/item/projectile/bullet/cap"
projectile_type = /obj/item/projectile/bullet/weakbullet2/rubber
/obj/item/ammo_casing/c10mm
desc = "A 10mm bullet casing."
caliber = "10mm"
projectile_type = "/obj/item/projectile/bullet/midbullet3"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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/shotgun
name = "shotgun slug"
desc = "A 12 gauge lead slug."
icon_state = "blshell"
caliber = "shotgun"
projectile_type = "/obj/item/projectile/bullet"
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"
projectile_type = /obj/item/projectile/bullet/pellet
pellets = 6
deviation = 30
deviation = 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"
projectile_type = /obj/item/projectile/bullet/rpellet
pellets = 6
deviation = 30
deviation = 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/rubber"
projectile_type = /obj/item/projectile/bullet/weakbullet/rubber
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 = "gshell"
projectile_type = "/obj/item/projectile/bullet/pellet/weak"
projectile_type = /obj/item/projectile/bullet/pellet/weak
materials = list(MAT_METAL=250)
pellets = 5
deviation = 30
deviation = 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/random"
projectile_type = /obj/item/projectile/bullet/pellet/random
materials = list(MAT_METAL=250)
pellets = 5
deviation = 30
deviation = 40
/obj/item/ammo_casing/shotgun/improvised/overload/New()
..()
@@ -132,15 +141,20 @@
name = "taser slug"
desc = "A stunning taser slug."
icon_state = "stunshell"
projectile_type = "/obj/item/projectile/bullet/stunshot"
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"
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"
@@ -148,42 +162,42 @@
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"
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"
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"
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"
projectile_type = /obj/item/projectile/bullet/incendiary/shell/dragonsbreath
pellets = 4
deviation = 30
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"
projectile_type = /obj/item/projectile/ion/weak
pellets = 4
deviation = 30
deviation = 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"
projectile_type = /obj/item/projectile/beam
/obj/item/ammo_casing/shotgun/techshell
name = "unloaded technological shell"
@@ -195,7 +209,7 @@
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"
projectile_type = /obj/item/projectile/bullet/dart
/obj/item/ammo_casing/shotgun/dart/New()
..()
@@ -206,93 +220,125 @@
/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("spores", 6)
reagents.add_reagent("mutetoxin", 6) //;HELP OPS IN MAINT
reagents.add_reagent("coniine", 6)
reagents.add_reagent("sodium_thiopental", 6)
/obj/item/ammo_casing/shotgun/tranquilizer
name = "tranquilizer darts"
desc = "A tranquilizer round used to subdue individuals utilizing stimulants."
icon_state = "cshell"
projectile_type = "/obj/item/projectile/bullet/dart/syringe/tranquilizer"
projectile_type = /obj/item/projectile/bullet/dart/syringe/tranquilizer
materials = list(MAT_METAL=250)
/obj/item/ammo_casing/syringegun
name = "syringe gun spring"
desc = "A high-power spring that throws syringes."
projectile_type = null
/obj/item/ammo_casing/a556
desc = "A 5.56mm bullet casing."
caliber = "a556"
projectile_type = /obj/item/projectile/bullet/heavybullet
/obj/item/ammo_casing/shotgun/fakebeanbag
name = "beanbag shell"
desc = "A weak beanbag shell."
icon_state = "bshell"
projectile_type = "/obj/item/projectile/bullet/weakbullet/booze"
/obj/item/ammo_casing/a762
desc = "A 7.62mm bullet casing."
icon_state = "762-casing"
caliber = "a762"
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"
projectile_type = /obj/item/projectile/bullet/weakbullet/booze
/obj/item/ammo_casing/rocket
name = "rocket shell"
desc = "A high explosive designed to be fired from a launcher."
icon_state = "rocketshell"
projectile_type = "/obj/item/missile"
projectile_type = /obj/item/missile
caliber = "rocket"
/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/a75
desc = "A .75 bullet casing."
caliber = "75"
projectile_type = "/obj/item/projectile/bullet/gyro"
projectile_type = /obj/item/projectile/bullet/gyro
/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"
projectile_type = /obj/item/projectile/bullet/a40mm
/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
//FOAM DARTS
/obj/item/ammo_casing/caseless/foam_dart
name = "foam dart"
desc = "It's nerf or nothing! Ages 8 and up."
projectile_type = "/obj/item/projectile/bullet/reusable/foam_dart"
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart
caliber = "foam_force"
icon = 'icons/obj/toyguns.dmi'
icon_state = "foamdart"
var/modified = 0
/obj/item/ammo_casing/caseless/foam_dart/update_icon()
if(modified)
icon_state = "foamdart_empty"
/obj/item/ammo_casing/caseless/foam_dart/attackby(var/obj/item/weapon/A as obj, mob/user as mob, params)
..()
if(istype(A, /obj/item/weapon/screwdriver) && !modified)
modified = 1
BB.damage_type = BRUTE
if (modified)
icon_state = "foamdart_empty"
desc = "It's nerf or nothing! ...Although, this one doesn't look too safe."
to_chat(user, "<span class='notice'>You pop the safety cap off of [src].</span>")
else if((istype(A, /obj/item/weapon/pen)) && modified && !BB.contents.len)
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.forceMove(BB)
BB.damage = 5
BB.nodamage = 0
A.loc = FD
FD.pen = A
FD.damage = 5
FD.nodamage = 0
to_chat(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)
to_chat(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"
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/riot
icon_state = "foamdart_riot"
/obj/item/ammo_casing/shotgun/dart/assassination
@@ -301,3 +347,8 @@
/obj/item/ammo_casing/shotgun/dart/assassination/New()
..()
reagents.add_reagent("neurotoxin", 6)
/obj/item/ammo_casing/cap
desc = "A cap for children toys."
caliber = "caps"
projectile_type = /obj/item/projectile/bullet/cap

View File

@@ -1,5 +1,6 @@
/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
@@ -7,18 +8,12 @@
/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/caps
name = "speed loader (caps)"
icon_state = "357"
ammo_type = /obj/item/ammo_casing/cap
max_ammo = 7
multiple_sprites = 1
/obj/item/ammo_box/c9mm
name = "ammo box (9mm)"
icon_state = "9mmbox"
@@ -55,6 +50,13 @@
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/shotgun
name = "Ammunition Box (slug)"
icon_state = "9mmbox"
@@ -99,3 +101,10 @@
/obj/item/ammo_box/foambox/riot
icon_state = "foambox_riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
/obj/item/ammo_box/caps
name = "speed loader (caps)"
icon_state = "357"
ammo_type = /obj/item/ammo_casing/cap
max_ammo = 7
multiple_sprites = 1

View File

@@ -0,0 +1,224 @@
/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 = 1000 //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 = 830
select_name = "kill"
/obj/item/ammo_casing/energy/laser/hos //allows balancing of HoS and blueshit guns seperately from other energy weapons
/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 = 0.8
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/scatter/pulse
projectile_type = /obj/item/projectile/beam/pulse
e_cost = 2000
select_name = "ANNIHILATE"
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 = 500
fire_sound = 'sound/weapons/laser3.ogg'
/obj/item/ammo_casing/energy/immolator
projectile_type = /obj/item/projectile/beam/immolator
fire_sound = 'sound/weapons/laser3.ogg'
e_cost = 1250
/obj/item/ammo_casing/energy/electrode
projectile_type = /obj/item/projectile/energy/electrode
select_name = "stun"
fire_sound = 'sound/weapons/taser.ogg'
e_cost = 2000
delay = 15
/obj/item/ammo_casing/energy/electrode/gun
fire_sound = 'sound/weapons/gunshot.ogg'
e_cost = 1000
/obj/item/ammo_casing/energy/electrode/hos //allows balancing of HoS and blueshit guns seperately from other energy weapons
/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
var/temperature = 300
e_cost = 100
fire_sound = 'sound/weapons/pulse3.ogg'
/obj/item/ammo_casing/energy/temp/newshot()
..()
BB.temperature = temperature
/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 = 5000
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 = 500
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 = 250
/obj/item/ammo_casing/energy/plasma/adv
projectile_type = /obj/item/projectile/plasma/adv
delay = 10
e_cost = 100
/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/New(var/obj/item/weapon/gun/energy/wormhole_projector/wh)
gun = wh
/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 = 5000
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/dart
projectile_type = /obj/item/projectile/energy/dart
fire_sound = 'sound/weapons/Genhit.ogg'
e_cost = 5000
select_name = "toxic dart"
/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/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/ammo_casing/energy/shock_revolver
fire_sound = 'sound/magic/lightningbolt.ogg'
e_cost = 2000
select_name = "lightning beam"
projectile_type = /obj/item/projectile/energy/shock_revolver
/obj/item/ammo_casing/energy/toxplasma
projectile_type = /obj/item/projectile/toxplasma
fire_sound = "sound/weapons/taser2.ogg"
select_name = "plasma dart"
/obj/item/ammo_casing/energy/clown
projectile_type = /obj/item/projectile/clown
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
select_name = "clown"
/obj/item/ammo_casing/energy/sniper
projectile_type = /obj/item/projectile/beam/sniper
fire_sound = 'sound/weapons/marauder.ogg'
fire_delay = 50
select_name = "sniper beam"
/obj/item/ammo_casing/energy/teleport
projectile_type = /obj/item/projectile/energy/teleport
fire_sound = 'sound/weapons/wave.ogg'
e_cost = 1250
select_name = "teleport beam"

View File

@@ -1,113 +1,160 @@
////////////////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"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/a357"
ammo_type = /obj/item/ammo_casing/a357
caliber = "357"
max_ammo = 7
/obj/item/ammo_box/magazine/internal/cylinder/ammo_count(var/countempties = 1)
if (!countempties)
var/boolets = 0
for (var/i = 1, i <= stored_ammo.len, i++)
var/obj/item/ammo_casing/bullet = stored_ammo[i]
if (bullet.BB)
boolets++
return boolets
else
return stored_ammo.len
/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/rus357
name = "russian revolver cylinder"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/a357"
caliber = "357"
max_ammo = 6
multiload = 0
/obj/item/ammo_box/magazine/internal/cylinder/get_round(keep = 0)
rotate()
/obj/item/ammo_box/magazine/internal/cylinder/rus357/New()
stored_ammo += new ammo_type(src)
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 = "d-tiv revolver cylinder"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/c38"
name = "detective revolver cylinder"
ammo_type = /obj/item/ammo_casing/c38
caliber = "38"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/rev762
name = "nagant revolver cylinder"
ammo_type = /obj/item/ammo_casing/n762
caliber = "n762"
max_ammo = 7
/obj/item/ammo_box/magazine/internal/cylinder/cap
name = "cap gun revolver cylinder"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/cap"
ammo_type = /obj/item/ammo_casing/cap
caliber = "cap"
max_ammo = 7
// Shotgun internal mags
/obj/item/ammo_box/magazine/internal/shot
name = "shotgun internal magazine"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/shotgun/beanbag"
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
caliber = "shotgun"
max_ammo = 4
multiload = 0
/obj/item/ammo_box/magazine/internal/shotcom
/obj/item/ammo_box/magazine/internal/shot/lethal
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
/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/com
name = "combat shotgun internal magazine"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/shotgun/buckshot"
caliber = "shotgun"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
max_ammo = 6
multiload = 0
/obj/item/ammo_box/magazine/internal/cylinder/dualshot
/obj/item/ammo_box/magazine/internal/shot/dual
name = "double-barrel shotgun internal magazine"
desc = "This doesn't even exist"
ammo_type = "/obj/item/ammo_casing/shotgun/beanbag"
caliber = "shotgun"
max_ammo = 2
multiload = 0
/obj/item/ammo_box/magazine/internal/cylinder/improvised
/obj/item/ammo_box/magazine/internal/shot/improvised
name = "improvised shotgun internal magazine"
desc = "This doesn't even exist"
ammo_type = "/obj/item/ammo_casing/shotgun/improvised"
caliber = "shotgun"
ammo_type = /obj/item/ammo_casing/shotgun/improvised
max_ammo = 1
multiload = 0
/obj/item/ammo_box/magazine/internal/shotriot
/obj/item/ammo_box/magazine/internal/shot/riot
name = "riot shotgun internal magazine"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/shotgun/rubbershot"
caliber = "shotgun"
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
max_ammo = 6
multiload = 0
/obj/item/ammo_box/magazine/internal/cylinder/grenadelauncher
/obj/item/ammo_box/magazine/internal/grenadelauncher
name = "grenade launcher internal magazine"
ammo_type = "/obj/item/ammo_casing/a40mm"
ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/cylinder/grenadelauncher/multi
ammo_type = "/obj/item/ammo_casing/a40mm"
ammo_type = /obj/item/ammo_casing/a40mm
max_ammo = 6
/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"
ammo_type = /obj/item/ammo_casing/a762
caliber = "a762"
max_ammo = 5
multiload = 1
/obj/item/ammo_box/magazine/internal/shot/toy
ammo_type = "/obj/item/ammo_casing/caseless/foam_dart"
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
max_ammo = 5
/obj/item/ammo_box/magazine/internal/shot/toy/tommygun
max_ammo = 10
@@ -116,17 +163,18 @@
/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"
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"
ammo_type = "/obj/item/ammo_casing/c45"
icon_state = "45-8"
ammo_type = /obj/item/ammo_casing/c45
caliber = ".45"
max_ammo = 8
@@ -137,7 +185,7 @@
/obj/item/ammo_box/magazine/wt550m9
name = "wt550 magazine (4.6x30mm)"
icon_state = "46x30mmt-20"
ammo_type = "/obj/item/ammo_casing/c46x30mm"
ammo_type = /obj/item/ammo_casing/c46x30mm
caliber = "4.6x30mm"
max_ammo = 20
@@ -147,20 +195,20 @@
/obj/item/ammo_box/magazine/wt550m9/wtap
name = "wt550 magazine (Armour Piercing 4.6x30mm)"
ammo_type = "/obj/item/ammo_casing/c46x30mmap"
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"
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"
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"
ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm"
max_ammo = 32
@@ -171,35 +219,46 @@
/obj/item/ammo_box/magazine/smgm9mm
name = "SMG magazine (9mm)"
icon_state = "smg9mm"
ammo_type = "/obj/item/ammo_casing/c9mm"
ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm"
max_ammo = 30
materials = list(MAT_METAL = 2000)
/obj/item/ammo_box/magazine/smgm9mm/ap
name = "SMG magazine (Armour Piercing 9mm)"
ammo_type = "/obj/item/ammo_casing/c9mmap"
ammo_type = /obj/item/ammo_casing/c9mmap
materials = list(MAT_METAL = 3000)
/obj/item/ammo_box/magazine/smgm9mm/toxin
name = "SMG magazine (Toxin Tipped 9mm)"
ammo_type = "/obj/item/ammo_casing/c9mmtox"
ammo_type = /obj/item/ammo_casing/c9mmtox
materials = list(MAT_METAL = 3000)
/obj/item/ammo_box/magazine/smgm9mm/fire
name = "SMG Magazine (Incendiary 9mm)"
ammo_type = "/obj/item/ammo_casing/c9mminc"
ammo_type = /obj/item/ammo_casing/c9mminc
materials = list(MAT_METAL = 3000)
/obj/item/ammo_box/magazine/smgm9mm/update_icon()
..()
icon_state = "[initial(icon_state)]-[round(ammo_count(),6)]"
/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"
origin_tech = "combat=2"
ammo_type = "/obj/item/ammo_casing/c45"
ammo_type = /obj/item/ammo_casing/c45
caliber = ".45"
max_ammo = 20
@@ -210,7 +269,7 @@
/obj/item/ammo_box/magazine/tommygunm45
name = "drum magazine (.45)"
icon_state = "drum45"
ammo_type = "/obj/item/ammo_casing/c45"
ammo_type = /obj/item/ammo_casing/c45
caliber = ".45"
max_ammo = 50
@@ -218,7 +277,7 @@
name = "handgun magazine (.50ae)"
icon_state = "50ae"
origin_tech = "combat=2"
ammo_type = "/obj/item/ammo_casing/a50"
ammo_type = /obj/item/ammo_casing/a50
caliber = ".50"
max_ammo = 7
multiple_sprites = 1
@@ -226,7 +285,7 @@
/obj/item/ammo_box/magazine/m75
name = "specialized magazine (.75)"
icon_state = "75"
ammo_type = "/obj/item/ammo_casing/caseless/a75"
ammo_type = /obj/item/ammo_casing/caseless/a75
caliber = "75"
multiple_sprites = 2
max_ammo = 8
@@ -235,50 +294,16 @@
name = "toploader magazine (5.56mm)"
icon_state = "5.56m"
origin_tech = "combat=5;syndicate=1"
ammo_type = "/obj/item/ammo_casing/a556"
ammo_type = /obj/item/ammo_casing/a556
caliber = "a556"
max_ammo = 30
multiple_sprites = 2
/obj/item/ammo_box/magazine/m762
name = "box magazine (7.62mm)"
icon_state = "a762"
origin_tech = "combat=2"
ammo_type = "/obj/item/ammo_casing/a762"
caliber = "a762"
max_ammo = 50
/obj/item/ammo_box/magazine/m762/update_icon()
..()
icon_state = "[initial(icon_state)]-[round(ammo_count(),10)]"
/obj/item/ammo_box/magazine/m762/buckshot
name = "box magazine (buckshot)"
icon_state = "b762"
caliber = "shotgun"
ammo_type ="/obj/item/ammo_casing/shotgun/buckshot"
max_ammo = 300 // Bluespace!
/obj/item/ammo_box/magazine/m762/buckshot/update_icon()
..()
icon_state = "[initial(icon_state)]-[round(ammo_count(),60)]"
/obj/item/ammo_box/magazine/m762/he // I am not a good person.
name = "box magazine (40mm high explosive)"
icon_state = "g762"
caliber = "40mm"
ammo_type ="/obj/item/ammo_casing/a40mm"
max_ammo = 25
/obj/item/ammo_box/magazine/m762/he/update_icon()
..()
icon_state = "[initial(icon_state)]-[round(ammo_count(),5)]"
/obj/item/ammo_box/magazine/m12g
name = "shotgun magazine (12g slugs)"
desc = "A drum magazine."
icon_state = "m12gb"
ammo_type = "/obj/item/ammo_casing/shotgun"
ammo_type = /obj/item/ammo_casing/shotgun
origin_tech = "combat=3;syndicate=1"
caliber = "shotgun"
max_ammo = 8
@@ -290,36 +315,45 @@
/obj/item/ammo_box/magazine/m12g/buckshot
name = "shotgun magazine (12g buckshot slugs)"
icon_state = "m12gb"
ammo_type = "/obj/item/ammo_casing/shotgun/buckshot"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
/obj/item/ammo_box/magazine/m12g/stun
name = "shotgun magazine (12g taser slugs)"
icon_state = "m12gs"
ammo_type = "/obj/item/ammo_casing/shotgun/stunslug"
ammo_type = /obj/item/ammo_casing/shotgun/stunslug
/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"
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
//FOAM DARTS
/obj/item/ammo_box/magazine/toy
name = "foam force META magazine"
ammo_type = "/obj/item/ammo_casing/caseless/foam_dart"
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-30"
max_ammo = 30
max_ammo = 20
/obj/item/ammo_box/magazine/toy/smg/update_icon()
..()
icon_state = "smg9mm-[round(ammo_count(),6)]"
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"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
/obj/item/ammo_box/magazine/toy/pistol
name = "foam force pistol magazine"
@@ -328,11 +362,11 @@
multiple_sprites = 2
/obj/item/ammo_box/magazine/toy/pistol/riot
ammo_type = "/obj/item/ammo_casing/caseless/foam_dart/riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
/obj/item/ammo_box/magazine/toy/smgm45
name = "donksoft SMG magazine"
ammo_type = "/obj/item/ammo_casing/caseless/foam_dart/riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
max_ammo = 20
/obj/item/ammo_box/magazine/toy/smgm45/update_icon()
@@ -341,7 +375,7 @@
/obj/item/ammo_box/magazine/toy/m762
name = "donksoft box magazine"
ammo_type = "/obj/item/ammo_casing/caseless/foam_dart/riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
max_ammo = 50
/obj/item/ammo_box/magazine/toy/m762/update_icon()

View File

@@ -0,0 +1,49 @@
/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/forcebolt
projectile_type = /obj/item/projectile/forcebolt
/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 = 200

View File

@@ -0,0 +1,95 @@
/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],":")
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
var/angle = Atan2(y - oy, x - ox)
src.Angle = angle
if(spread)
src.Angle += spread

View File

@@ -1,54 +1,59 @@
#define SAWN_INTACT 0
#define SAWN_OFF 1
#define SAWN_SAWING -1
/obj/item/weapon/gun
name = "gun"
desc = "Its a gun. It's pretty terrible, though."
desc = "It's a gun. It's pretty terrible, though."
icon = 'icons/obj/gun.dmi'
icon_state = "detective"
item_state = "gun"
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
flags = CONDUCT
slot_flags = SLOT_BELT
materials = list(MAT_METAL=2000)
w_class = 3.0
w_class = 3
throwforce = 5
throw_speed = 4
throw_speed = 3
throw_range = 5
force = 5.0
force = 5
origin_tech = "combat=1"
needs_permit = 1
attack_verb = list("struck", "hit", "bashed")
var/fire_sound = 'sound/weapons/Gunshot.ogg'
var/obj/item/projectile/in_chamber = null
var/silenced = 0
var/ghettomodded = 0
var/recoil = 0
var/fire_sound = "gunshot"
var/fire_sound_text = "gunshot" //the fire sound that shows in chat messages: laser blast, gunshot, etc.
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/sawn_desc = null
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/obj/item/ammo_casing/chambered = null // The round (not bullet) that is in the chamber. THIS MISPLACED ITEM BROUGHT TO YOU BY HACKY BUCKSHOT.
var/tmp/list/mob/living/target //List of who yer targeting.
var/tmp/lock_time = -100
var/tmp/mouthshoot = 0 ///To stop people from suiciding twice... >.>
var/automatic = 0 //Used to determine if you can target multiple people.
var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/firerate = 1 // 0 for one bullet after tarrget moves and aim is lowered,
//1 for keep shooting until aim is lowered
var/fire_delay = 0
var/last_fired = 0
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
var/randomspread = 1
var/unique_rename = 0 //allows renaming with a pen
var/unique_reskin = 0 //allows one-time reskinning
var/reskinned = 0 //whether or not the gun has been reskinned
var/current_skin = null
var/list/options = list()
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
var/obj/item/device/flashlight/F = null
var/can_flashlight = 0
var/heavy_weapon = 0
var/randomspread = 0
var/burst_size = 1
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
@@ -56,312 +61,196 @@
var/zoom_amt = 3 //Distance in TURFs to move the user's screen forward (the "zoom" effect)
var/datum/action/toggle_scope_zoom/azoom
proc/ready_to_fire()
if(world.time >= last_fired + fire_delay)
last_fired = world.time
return 1
else
return 0
proc/process_chambered()
return 0
proc/special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
if(!M.IsAdvancedToolUser())
return 0
return 1
proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "<span class='warning'>*click*</span>")
playsound(user, 'sound/weapons/emptyclick.ogg', 40, 1)
return
emp_act(severity)
for(var/obj/O in contents)
O.emp_act(severity)
proc/prepare_shot(var/obj/item/projectile/proj) //Transfer properties from the gun to the bullet
proj.shot_from = src
proj.silenced = silenced
return
/obj/item/weapon/gun/New()
..()
if(F)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
new /datum/action/item_action/toggle_gunlight(src)
build_zooming()
/obj/item/weapon/gun/examine(mob/user)
..()
if(unique_reskin && !reskinned)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
if(unique_rename)
to_chat(user, "<span class='notice'>Use a pen on it to rename it.</span>")
/obj/item/weapon/gun/pickup(mob/user)
/obj/item/weapon/gun/proc/process_chamber()
return 0
if(azoom)
azoom.Grant(user)
..()
/obj/item/weapon/gun/dropped(mob/user)
zoom(user,FALSE)
if(azoom)
azoom.Remove(user)
..()
/obj/item/weapon/gun/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
if(flag) return //we're placing gun on a table or in backpack
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
Fire(A,user,params) //Otherwise, fire normally.
/obj/item/weapon/gun/proc/isHandgun()
//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/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this
/obj/item/weapon/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "<span class='danger'>*click*</span>")
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
/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 [fire_sound_text]!</span>")
else
user.visible_message("<span class='danger'>[user] fires [src]!</span>", "<span class='danger'>You fire [src]!</span>", "You hear \a [fire_sound_text]!")
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, /mob/living))
var/mob/living/M = user
if ((CLUMSY in M.mutations) && prob(50))
to_chat(M, "<span class='danger'>[src] blows up in your face.</span>")
M.take_organ_damage(0,20)
M.drop_item()
qdel(src)
if(istype(user))
if (user.disabilities & CLUMSY && prob(40))
to_chat(user, "<span class='userdanger'>You shoot yourself in the foot with \the [src]!</span>")
var/shot_leg = pick("l_foot", "r_foot")
process_fire(user, user, 0, params, zone_override = shot_leg)
user.drop_item()
return
if (!user.IsAdvancedToolUser() || istype(user, /mob/living/simple_animal/diona))
to_chat(user, "<span class='danger'>You don't have the dexterity to do this!</span>")
if(weapon_weight == WEAPON_HEAVY && user.get_inactive_hand())
to_chat(user, "<span class='userdanger'>You need both hands free to fire \the [src]!</span>")
return
if(istype(user, /mob/living))
var/mob/living/M = user
if (HULK in M.mutations)
to_chat(M, "<span class='danger'>Your meaty finger is much too large for the trigger guard!</span>")
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.species.flags & NOGUNS)
to_chat(user, "<span class='warning'>Your fingers don't fit in the trigger guard!</span>")
return
if(H.martial_art && H.martial_art.name == "The Sleeping Carp") //great dishonor to famiry
to_chat(user, "<span class='danger'>Use of ranged weaponry would bring dishonor to the clan.</span>")
return
process_fire(target,user,1,params)
/obj/item/weapon/gun/proc/can_trigger_gun(var/mob/living/user)
if(!user.can_use_guns(src))
return 0
return 1
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(!special_check(user))
if(semicd)
return
if (!ready_to_fire())
if (world.time % 3) //to prevent spam
to_chat(user, "<span class='warning'>[src] is not ready to fire again!")
return
if(heavy_weapon)
if(weapon_weight)
if(user.get_inactive_hand())
recoil = 4 //one-handed kick
else
recoil = initial(recoil)
if (istype(in_chamber, /obj/item/projectile/bullet/blank)) // A hacky way of making blank shotgun shells work again. Honk.
in_chamber.delete()
in_chamber = null
return
user.changeNext_move(CLICK_CD_RANGE)
var/spread = 0
var/turf/targloc = get_turf(target)
for(var/f = 1 to burst_size)
if(!process_chambered()) //CHECK
return click_empty(user)
if(chambered)
for (var/i = max(1, chambered.pellets), i > 0, i--) //Previous way of doing it fucked up math for spreading. This way, even the first projectile is part of the spread code.
if(i != max(1, chambered.pellets)) //Have we fired the initial chambered bullet yet?
in_chamber = new chambered.projectile_type()
ready_projectile(target, user)
prepare_shot(in_chamber)
if(chambered.deviation)
if(randomspread) //Random spread
spread = (rand() - 0.5) * chambered.deviation
else //Smart spread
spread = (i / chambered.pellets - 0.5) * chambered.deviation
if(!process_projectile(targloc, user, params, spread))
return 0
else
ready_projectile(target, user)
prepare_shot(in_chamber)
if(!process_projectile(targloc, user, params, spread))
return 0
if(recoil)
spawn()
shake_camera(user, recoil + 1, recoil)
if(silenced)
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
if(f == 1) // Only print this once
user.visible_message("<span class='warning'>[user] fires [src][reflex ? " by reflex":""]!</span>", \
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>", \
"You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
if(heavy_weapon)
if(user.get_inactive_hand())
if(prob(15))
user.visible_message("<span class='danger'>[src] flies out of [user]'s hands!</span>", "<span class='userdanger'>[src] kicks out of your grip!</span>")
user.drop_item()
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
user.newtonian_move(get_dir(target, user))
if(chambered)
if(!chambered.fire(target, user, params, , suppressed, zone_override))
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()
sleep(fire_delay)
feedback_add_details("gun_fired","[src.type]")
/obj/item/weapon/gun/proc/ready_projectile(atom/target as mob|obj|turf, mob/living/user)
in_chamber.firer = user
in_chamber.def_zone = user.zone_sel.selecting
in_chamber.original = target
return
/obj/item/weapon/gun/proc/process_projectile(var/turf/targloc, mob/living/user as mob|obj, params, spread)
var/turf/curloc = user.loc
if (!istype(targloc) || !istype(curloc) || !in_chamber)
return 0
if(targloc == curloc) //Fire the projectile
user.bullet_act(in_chamber)
del(in_chamber)
update_icon()
return 1
in_chamber.loc = get_turf(user)
in_chamber.starting = get_turf(user)
in_chamber.current = curloc
in_chamber.OnFired()
in_chamber.yo = targloc.y - curloc.y
in_chamber.xo = targloc.x - curloc.x
if(params)
var/list/mouse_control = params2list(params)
if(mouse_control["icon-x"])
in_chamber.p_x = text2num(mouse_control["icon-x"])
if(mouse_control["icon-y"])
in_chamber.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],":")
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
var/ox = round(480/2) //"origin" x - Basically center of the screen. This is a bad way of doing it because if you are able to view MORE than 17 tiles at a time your aim will get fucked.
var/oy = round(480/2) //"origin" y - Basically center of the screen.
var/angle = Atan2(y - oy, x - ox)
in_chamber.Angle = angle
if(istype(user, /mob/living/carbon)) //Increase spread based on shock
var/mob/living/carbon/mob = user
if(mob.shock_stage > 120)
spread += rand(-5,5)
else if(mob.shock_stage > 70)
spread += rand(-2,2)
if(spread)
in_chamber.Angle += spread
if(in_chamber)
in_chamber.process()
in_chamber = null
return 1
/obj/item/weapon/gun/proc/can_fire()
return process_chambered()
/obj/item/weapon/gun/proc/can_hit(var/mob/living/target as mob, var/mob/living/user as mob)
return in_chamber.check_fire(target,user)
/obj/item/weapon/gun/proc/click_empty(mob/user = null)
if (user)
user.visible_message("*click click*", "\red <b>*click*</b>")
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
/obj/item/weapon/gun/attack(mob/M as mob, mob/user)
if(user.a_intent == "harm") //Flogging
..()
else
src.visible_message("*click click*")
playsound(src.loc, 'sound/weapons/empty.ogg', 100, 1)
return
/obj/item/weapon/gun/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
//Suicide handling.
if (M == user && user.zone_sel.selecting == "mouth" && !mouthshoot)
mouthshoot = 1
M.visible_message("<span class='warning'> [user] sticks their gun in their mouth, ready to pull the trigger...</span>")
if(!do_after(user, 40, target = M))
M.visible_message("<span class='warning'> [user] decided life was worth living</span>")
mouthshoot = 0
return
if (process_chambered())
user.visible_message("<span class='warning'>[user] pulls the trigger.</span>")
if(silenced)
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
if(istype(in_chamber, /obj/item/projectile/lasertag) || istype(in_chamber, /obj/item/projectile/bullet/reusable/foam_dart))
user.show_message("<span class='warning'>You feel rather silly, trying to commit suicide with a toy.</span>")
mouthshoot = 0
return
in_chamber.on_hit(M)
if (in_chamber.damage_type != STAMINA)
user.apply_damage(in_chamber.damage*2.5, in_chamber.damage_type, "head", used_weapon = "Point blank shot in the mouth with \a [in_chamber]", sharp=1)
user.death()
else
to_chat(user, "<span class='notice'>Ow...</span>")
user.apply_effect(110,STAMINA,0)
del(in_chamber)
mouthshoot = 0
return
else
click_empty(user)
mouthshoot = 0
return
if (src.process_chambered())
//Point blank shooting if on harm intent or target we were targeting.
if(user.a_intent == I_HARM)
user.visible_message("\red <b> \The [user] fires \the [src] point blank at [M]!</b>")
if(istype(in_chamber)) in_chamber.damage *= 1.3
Fire(M,user,0,0,1)
return
else if(target && M in target)
Fire(M,user,0,0,1) ///Otherwise, shoot!
return
else
return ..() //Pistolwhippin'
/obj/item/weapon/gun/attackby(var/obj/item/A as obj, mob/user as mob, params)
if(istype(A, /obj/item/device/flashlight/seclite))
var/obj/item/device/flashlight/seclite/S = A
/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.l_hand != src && user.r_hand != src)
to_chat(user, "<span class='notice'>You'll need [src] in your hands to do that.</span>")
if(!user.unEquip(I))
return
user.drop_item()
to_chat(user, "<span class='notice'>You click [S] into place on [src].</span>")
if(S.on)
set_light(0)
SetLuminosity(0)
F = S
A.loc = src
I.loc = src
update_icon()
update_gunlight(user)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
if(istype(A, /obj/item/weapon/screwdriver))
if(F)
if(user.l_hand != src && user.r_hand != src)
to_chat(user, "<span class='notice'>You'll need [src] in your hands to do that.</span>")
return
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)
to_chat(user, "<span class='notice'>You unscrew the seclite from [src].</span>")
F = null
@@ -370,8 +259,13 @@
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)
..()
return
/obj/item/weapon/gun/proc/toggle_gunlight()
set name = "Toggle Gunlight"
@@ -383,15 +277,14 @@
var/mob/living/carbon/human/user = usr
if(!isturf(user.loc))
to_chat(user, "You cannot turn the light on while in this [user.loc].")
to_chat(user, "<span class='warning'>You cannot turn the light on while in this [user.loc]!</span>")
F.on = !F.on
to_chat(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(var/mob/user = null)
/obj/item/weapon/gun/proc/update_gunlight(mob/user = null)
if(F)
if(F.on)
set_light(F.brightness_on)
@@ -400,7 +293,84 @@
update_icon()
else
set_light(0)
/obj/item/weapon/gun/pickup(mob/user)
..()
if(azoom)
azoom.Grant(user)
/obj/item/weapon/gun/dropped(mob/user)
..()
zoom(user,FALSE)
if(azoom)
azoom.Remove(user)
/obj/item/weapon/gun/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(unique_reskin && !reskinned && 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 && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
if(options[choice] == null)
return
if(sawn_state == SAWN_OFF)
icon_state = options[choice] + "-sawn"
else
icon_state = options[choice]
current_skin = icon_state
to_chat(M, "Your gun is now skinned as [choice]. Say hello to your new friend.")
reskinned = 1
/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
to_chat(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/isHandgun()
return 1
/////////////
// ZOOMING //
@@ -424,8 +394,6 @@
gun.zoom(L, FALSE)
..()
/obj/item/weapon/gun/proc/zoom(mob/living/user, forced_zoom)
if(!user || !user.client)
return

View File

@@ -115,4 +115,4 @@
/obj/item/projectile/energy/sonic/proc/split()
//TODO: create two more projectiles to either side of this one, fire at targets to the side of target turf.
return
return

View File

@@ -5,22 +5,22 @@
fire_sound = 'sound/weapons/Taser.ogg'
var/obj/item/weapon/stock_parts/cell/power_supply //What type of power cell this uses
var/charge_cost = 1000 //How much energy is needed to fire.
var/cell_type = "/obj/item/weapon/stock_parts/cell"
var/projectile_type = "/obj/item/projectile/beam"
var/modifystate
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
//self-recharging
var/self_recharge = 0 //if set, the weapon will recharge itself
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/use_external_power = 0 //if set, the weapon will look for an external power source to draw from, otherwise it recharges magically
var/recharge_time = 4
var/charge_tick = 0
var/charge_delay = 4
/obj/item/weapon/gun/energy/emp_act(severity)
if(power_supply)
power_supply.use(round(power_supply.charge / severity))
update_icon()
power_supply.use(round(power_supply.charge / severity))
update_icon()
/obj/item/weapon/gun/energy/New()
..()
@@ -29,7 +29,15 @@
else
power_supply = new(src)
power_supply.give(power_supply.maxcharge)
if(self_recharge)
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)
processing_objects.Add(src)
update_icon()
@@ -39,27 +47,122 @@
return ..()
/obj/item/weapon/gun/energy/process()
if(self_recharge) //Every [recharge_time] ticks, recharge a shot for the cyborg
if(selfcharge) //Every [recharge_time] ticks, recharge a shot for the cyborg
charge_tick++
if(charge_tick < recharge_time) return 0
if(charge_tick < recharge_time)
return 0
charge_tick = 0
if(!power_supply || power_supply.charge >= power_supply.maxcharge)
if(!power_supply)
return 0 // check if we actually need to recharge
if(use_external_power)
var/obj/item/weapon/stock_parts/cell/external = get_external_power_supply()
if(!external || !external.use(charge_cost/10)) //Take power from the borg...
return 0 //Note, uses /10 because of shitty mods to the cell system
power_supply.give(charge_cost) //... to recharge the shot
update_icon()
return 1
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
/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)
to_chat(user, "<span class='notice'>[src] is now set to [shot.select_name].</span>")
update_icon()
return
/obj/item/weapon/gun/energy/update_icon()
overlays.Cut()
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)
overlays += "[icon_state]_[shot.select_name]"
iconState += "_[shot.select_name]"
if(itemState)
itemState += "[shot.select_name]"
if(power_supply.charge < shot.e_cost)
overlays += "[icon_state]_empty"
else
if(!shaded_charge)
for(var/i = ratio, i >= 1, i--)
overlays += image(icon = icon, icon_state = iconState, pixel_x = ammo_x_offset * (i -1))
else
overlays += image(icon = icon, icon_state = "[icon_state]_charge[ratio]")
if(F && can_flashlight)
var/iconF = "flight"
if(F.on)
iconF = "flight_on"
overlays += 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
return R.cell
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/10)) //Take power from the borg... //Divided by 10 because cells and charge costs are fucked.
power_supply.give(shot.e_cost) //... to recharge the shot
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
if(istype(src.loc, /obj/item/rig_module))
var/obj/item/rig_module/module = src.loc
if(module.holder && module.holder.wearer)
@@ -69,29 +172,3 @@
if(istype(suit))
return suit.cell
return null
/obj/item/weapon/gun/energy/process_chambered()
if(in_chamber) return 1
if(!power_supply) return 0
if(!power_supply.use(charge_cost)) return 0
if(!projectile_type) return 0
in_chamber = new projectile_type(src)
return 1
/obj/item/weapon/gun/energy/update_icon()
if(cell_type)
var/ratio = power_supply.charge / power_supply.maxcharge
ratio = round(ratio, 0.25) * 100
if(modifystate)
icon_state = "[modifystate][ratio]"
else
icon_state = "[initial(icon_state)][ratio]"
else
icon_state = "energy0"
overlays.Cut()
if(F)
if(F.on)
overlays += "flight-on"
else
overlays += "flight"
return

View File

@@ -1,40 +0,0 @@
/obj/item/weapon/gun/energy/advtaser
name = "hybrid taser"
desc = "A hybrid taser designed to fire both short-range high-power electrodes and long-range disabler beams."
icon_state = "advtaser"
item_state = null //so the human update icon uses the icon_state instead.
cell_type = "/obj/item/weapon/stock_parts/cell"
origin_tech = null
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/energy/electrode"
charge_cost = 2000
modifystate = "advtaserstun"
can_flashlight = 1
fire_delay = 15
var/mode = 0 //0 = stun, 1 = disable
attack_self(mob/living/user as mob)
switch(mode)
if(0)
mode = 1
charge_cost = 500
fire_sound = 'sound/weapons/taser2.ogg'
to_chat(user, "\red [src.name] is now set to Disable.")
projectile_type = "/obj/item/projectile/beam/disabler"
modifystate = "advtaserdisable"
fire_delay = 0
if(1)
mode = 0
charge_cost = 2000
fire_sound = 'sound/weapons/Taser.ogg'
to_chat(user, "\red [src.name] is now set to stun.")
projectile_type = "/obj/item/projectile/energy/electrode"
modifystate = "advtaserstun"
fire_delay = 15
update_icon()
if(user.l_hand == src)
user.update_inv_l_hand()
else
user.update_inv_r_hand()

View File

@@ -1,37 +0,0 @@
/obj/item/weapon/gun/energy/blueshield
name = "advanced stun revolver"
desc = "An advanced stun revolver with the capacity to shoot both electrodes and lasers."
icon_state = "bsgun_stun"
item_state = "gun"
modifystate = "bsgun_stun"
force = 7
fire_sound = 'sound/weapons/gunshot.ogg'
charge_cost = 2000
projectile_type = "/obj/item/projectile/energy/electrode"
fire_delay = 15
var/fire_mode = 0 // 0 for taser, 1 for lethals.
/obj/item/weapon/gun/energy/blueshield/attack_self(mob/living/user as mob)
if(!fire_mode)
fire_mode = 1
charge_cost = 1000
fire_delay = 0
fire_sound = 'sound/weapons/Laser.ogg'
projectile_type = "/obj/item/projectile/beam"
modifystate = "bsgun_kill"
to_chat(user, "<span class = 'warning'>You adjust [src.name] to the kill setting.</span>")
else
fire_mode = 0
charge_cost = 2000
fire_delay = 15
projectile_type = "/obj/item/projectile/energy/electrode"
fire_sound = 'sound/weapons/gunshot.ogg'
modifystate = "bsgun_stun"
to_chat(user, "<span class = 'info'>You adjust [src.name] to the stun setting.</span>")
update_icon()

View File

@@ -1,45 +0,0 @@
/obj/item/weapon/gun/energy/hos
name = "head of security's energy gun"
desc = "This is a modern recreation of the captain's antique laser gun. This gun has several unique fire modes, but lacks the ability to recharge over time."
icon_state = "hoslaser"
item_state = null //so the human update icon uses the icon_state instead.
force = 10
fire_sound = 'sound/weapons/Taser.ogg'
origin_tech = "combat=3;magnets=2"
charge_cost = 2000
modifystate = "hoslaserstun"
projectile_type = "/obj/item/projectile/energy/electrode"
fire_delay = 15
var/mode = 2
attack_self(mob/living/user as mob)
switch(mode)
if(2)
mode = 0
charge_cost = 1000
fire_sound = 'sound/weapons/Laser.ogg'
to_chat(user, "\red [src.name] is now set to kill.")
projectile_type = "/obj/item/projectile/beam"
modifystate = "hoslaserkill"
fire_delay = 0
if(0)
mode = 1
charge_cost = 500
fire_sound = 'sound/weapons/taser2.ogg'
to_chat(user, "\red [src.name] is now set to disable.")
projectile_type = "/obj/item/projectile/beam/disabler"
modifystate = "hoslaserdisable"
fire_delay = 0
if(1)
mode = 2
charge_cost = 2000
fire_sound = 'sound/weapons/taser.ogg'
to_chat(user, "\red [src.name] is now set to stun.")
projectile_type = "/obj/item/projectile/energy/electrode"
modifystate = "hoslaserstun"
fire_delay = 15
update_icon()
if(user.l_hand == src)
user.update_inv_l_hand()
else
user.update_inv_r_hand()

View File

@@ -1,59 +1,63 @@
/obj/item/weapon/gun/energy/laser
name = "laser gun"
desc = "a basic weapon designed kill with concentrated energy bolts"
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"
fire_sound = 'sound/weapons/Laser.ogg'
charge_cost = 760
w_class = 3.0
w_class = 3
materials = list(MAT_METAL=2000)
origin_tech = "combat=3;magnets=2"
projectile_type = "/obj/item/projectile/beam"
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."
projectile_type = "/obj/item/projectile/practice"
ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
clumsy_check = 0
needs_permit = 0
obj/item/weapon/gun/energy/laser/retro
/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 security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
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 = "captain's antique laser gun"
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
self_recharge = 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?"
/obj/item/weapon/gun/energy/laser/cyborg/process()
return 1
/obj/item/weapon/gun/energy/laser/cyborg/process_chambered()
if(in_chamber)
return 1
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell && R.cell.charge >= 83)
R.cell.use(83)
in_chamber = new/obj/item/projectile/beam(src)
return 1
return 0
/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"
@@ -64,13 +68,18 @@ obj/item/weapon/gun/energy/laser/retro
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
fire_sound = 'sound/weapons/lasercannonfire.ogg'
origin_tech = "combat=4;materials=3;powerstorage=3"
projectile_type = "/obj/item/projectile/beam/laser/accelerator"
ammo_type = list(/obj/item/ammo_casing/energy/laser/accelerator)
ammo_x_offset = 3
/obj/item/weapon/gun/energy/lasercannon/isHandgun()
return 0
/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 = "heavylaser"
@@ -87,36 +96,29 @@ obj/item/weapon/gun/energy/laser/retro
use_external_power = 1
recharge_time = 10
/obj/item/weapon/gun/energy/lasercannon/cyborg
/obj/item/weapon/gun/energy/lasercannon/cyborg/process_chambered()
if(in_chamber)
return 1
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
R.cell.use(250)
in_chamber = new/obj/item/projectile/beam(src)
return 1
return 0
/obj/item/weapon/gun/energy/lasercannon/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/lasercannon/cyborg/emp_act()
return
/obj/item/weapon/gun/energy/xray
name = "xray laser gun"
desc = "A high-power laser gun capable of expelling concentrated xray blasts."
icon_state = "xray"
fire_sound = 'sound/weapons/laser3.ogg'
origin_tech = "combat=5;materials=3;magnets=2;syndicate=2"
projectile_type = "/obj/item/projectile/beam/xray"
charge_cost = 500
ammo_type = list(/obj/item/ammo_casing/energy/xray)
/obj/item/weapon/gun/energy/immolator
name = "Immolator laser gun"
desc = "A modified laser gun, shooting highly concetrated beams with higher intensity that ignites the target, for the cost of draining more power per shot"
icon_state = "immolator"
item_state = "laser"
fire_sound = 'sound/weapons/laser3.ogg'
projectile_type = "/obj/item/projectile/beam/immolator"
ammo_type = list(/obj/item/ammo_casing/energy/immolator)
origin_tech = "combat=4;materials=4;magnets=3;plasmatech=2"
charge_cost = 1250
////////Laser Tag////////////////////
@@ -124,34 +126,22 @@ obj/item/weapon/gun/energy/laser/retro
name = "laser tag gun"
icon_state = "bluetag"
desc = "Standard issue weapon of the Imperial Guard"
projectile_type = "/obj/item/projectile/lasertag/blue"
ammo_type = list(/obj/item/ammo_casing/energy/laser/bluetag)
origin_tech = "combat=1;magnets=2"
clumsy_check = 0
needs_permit = 0
self_recharge = 1
/obj/item/weapon/gun/energy/laser/bluetag/special_check(var/mob/living/carbon/human/M)
if(ishuman(M))
if(istype(M.wear_suit, /obj/item/clothing/suit/bluetag))
return 1
to_chat(M, "\red You need to be wearing your laser tag vest!")
return 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 = "Standard issue weapon of the Imperial Guard"
projectile_type = "/obj/item/projectile/lasertag/red"
ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag)
origin_tech = "combat=1;magnets=2"
clumsy_check = 0
needs_permit = 0
self_recharge = 1
/obj/item/weapon/gun/energy/laser/redtag/special_check(var/mob/living/carbon/human/M)
if(ishuman(M))
if(istype(M.wear_suit, /obj/item/clothing/suit/redtag))
return 1
to_chat(M, "\red You need to be wearing your laser tag vest!")
return 0
pin = /obj/item/device/firing_pin/tag/red
ammo_x_offset = 2
selfcharge = 1

View File

@@ -3,169 +3,133 @@
desc = "A basic energy-based gun with two settings: kill and disable."
icon_state = "energystun100"
item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser2.ogg'
charge_cost = 500
projectile_type = "/obj/item/projectile/beam/disabler"
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser)
origin_tech = "combat=3;magnets=2"
modifystate = "energystun"
modifystate = 2
can_flashlight = 1
var/mode = 0 //0 = disable, 1 = kill
attack_self(mob/living/user as mob)
switch(mode)
if(0)
mode = 1
charge_cost = 1000
fire_sound = 'sound/weapons/Laser.ogg'
to_chat(user, "\red [src.name] is now set to kill.")
projectile_type = "/obj/item/projectile/beam"
modifystate = "energykill"
if(1)
mode = 0
charge_cost = 500
fire_sound = 'sound/weapons/Taser2.ogg'
to_chat(user, "\red [src.name] is now set to disable.")
projectile_type = "/obj/item/projectile/beam/disabler"
modifystate = "energystun"
update_icon()
if(user.l_hand == src)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
ammo_x_offset = 3
flight_x_offset = 15
flight_y_offset = 10
/obj/item/weapon/gun/energy/gun/cyborg
desc = "An energy-based laser gun that draws power from the cyborg's internal energy cell directly. So this is what freedom looks like?"
/obj/item/weapon/gun/energy/gun/cyborg/process()
return 1
/obj/item/weapon/gun/energy/gun/cyborg/process_chambered()
if(in_chamber)
return 1
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell && R.cell.charge >= 83)
R.cell.use(83)
in_chamber = new projectile_type(src)
return 1
return 0
/obj/item/weapon/gun/energy/gun/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/gun/cyborg/emp_act()
return
/obj/item/weapon/gun/energy/gun/mounted
name = "mounted energy gun"
self_recharge = 1
use_external_power = 1
/obj/item/weapon/gun/energy/gun/nuclear
name = "Advanced Energy Gun"
desc = "An energy gun with an experimental miniaturized reactor."
icon_state = "nucgun"
origin_tech = "combat=3;materials=5;powerstorage=3"
var/lightfail = 0
can_flashlight = 0
can_charge = 0
/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
ammo_x_offset = 2
charge_sections = 3
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
New()
..()
processing_objects.Add(src)
/obj/item/weapon/gun/energy/gun/mini/New()
cell.maxcharge = 6000
cell.charge = 6000
F = new /obj/item/device/flashlight/seclite(src)
..()
/obj/item/weapon/gun/energy/gun/mini/update_icon()
..()
if(F && F.on)
overlays += "mini-light"
Destroy()
processing_objects.Remove(src)
return ..()
process()
charge_tick++
if(charge_tick < 4) return 0
charge_tick = 0
if(!power_supply) return 0
if((power_supply.charge / power_supply.maxcharge) != 1)
if(!failcheck()) return 0
power_supply.give(1000)
update_icon()
return 1
proc
failcheck()
lightfail = 0
if (prob(src.reliability)) return 1 //No failure
if (prob(src.reliability))
for (var/mob/living/M in range(0,src)) //Only a minor failure, enjoy your radiation if you're in the same tile or carrying it
if (src in M.contents)
to_chat(M, "\red Your gun feels pleasantly warm for a moment.")
else
to_chat(M, "\red You feel a warm sensation.")
M.apply_effect(rand(3,120), IRRADIATE)
lightfail = 1
else
for (var/mob/living/M in range(rand(1,4),src)) //Big failure, TIME FOR RADIATION BITCHES
if (src in M.contents)
to_chat(M, "\red Your gun's reactor overloads!")
to_chat(M, "\red You feel a wave of heat wash over you.")
M.apply_effect(300, IRRADIATE)
crit_fail = 1 //break the gun so it stops recharging
processing_objects.Remove(src)
update_icon()
return 0
update_charge()
if (crit_fail)
overlays += "nucgun-whee"
return
var/ratio = power_supply.charge / power_supply.maxcharge
ratio = round(ratio, 0.25) * 100
overlays += "nucgun-[ratio]"
update_reactor()
if(crit_fail)
overlays += "nucgun-crit"
return
if(lightfail)
overlays += "nucgun-medium"
else if ((power_supply.charge/power_supply.maxcharge) <= 0.5)
overlays += "nucgun-light"
else
overlays += "nucgun-clean"
update_mode()
if (mode == 0)
overlays += "nucgun-stun"
else if (mode == 1)
overlays += "nucgun-kill"
emp_act(severity)
..()
reliability = max(reliability - round(15/severity), 0) //Do not allow it to go negative!
update_icon()
overlays.Cut()
update_charge()
update_reactor()
update_mode()
/obj/item/weapon/gun/energy/gun/hos
name = "\improper X-01 MultiPhase Energy Gun"
desc = "This is a expensive, modern recreation of a antique laser gun. This gun has several unique firemodes, but lacks the ability to recharge over time."
icon_state = "hoslaser"
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/blueshield
name = "advanced stun revolver"
desc = "An advanced stun revolver with the capacity to shoot both electrodes and lasers."
icon_state = "bsgun_stun"
force = 7
ammo_type = list(/obj/item/ammo_casing/energy/electrode/hos, /obj/item/ammo_casing/energy/laser/hos)
ammo_x_offset = 4
/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
heavy_weapon = 1
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
weapon_weight = WEAPON_MEDIUM
can_flashlight = 0
projectile_type = /obj/item/projectile/energy/electrode
charge_cost = 1000
fire_delay = 15
trigger_guard = TRIGGER_GUARD_NONE
ammo_x_offset = 2
/obj/item/weapon/gun/energy/gun/turret/update_icon()
icon_state = initial(icon_state)
/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=3;materials=5;powerstorage=3"
var/fail_tick = 0
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
/obj/item/weapon/gun/energy/gun/nuclear/process()
if(fail_tick > 0)
fail_tick--
..()
/obj/item/weapon/gun/energy/gun/nuclear/shoot_live_shot()
failcheck()
update_icon()
..()
/obj/item/weapon/gun/energy/gun/nuclear/proc/failcheck()
if(!prob(reliability) && istype(loc, /mob/living))
var/mob/living/M = loc
switch(fail_tick)
if(0 to 200)
fail_tick += (2*(100-reliability))
M.rad_act(40)
to_chat(M, "<span class='userdanger'>Your [name] feels warmer.</span>")
if(201 to INFINITY)
SSobj.processing.Remove(src)
M.rad_act(80)
crit_fail = 1
to_chat(M, "<span class='userdanger'>Your [name]'s reactor overloads!</span>")
/obj/item/weapon/gun/energy/gun/nuclear/emp_act(severity)
..()
reliability = max(reliability - round(15/severity), 0) //Do not allow it to go negative!
/obj/item/weapon/gun/energy/gun/nuclear/update_icon()
..()
if(crit_fail)
overlays += "[icon_state]_fail_3"
else
switch(fail_tick)
if(0)
overlays += "[icon_state]_fail_0"
if(1 to 150)
overlays += "[icon_state]_fail_1"
if(151 to INFINITY)
overlays += "[icon_state]_fail_2"
/obj/item/weapon/gun/energy/gun/turret/attack_self(mob/living/user as mob)
switch(mode)
@@ -189,4 +153,4 @@
if(user.l_hand == src)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
user.update_inv_r_hand()

View File

@@ -1,64 +1,26 @@
/obj/item/weapon/gun/energy/pulse_rifle
/obj/item/weapon/gun/energy/pulse
name = "pulse rifle"
desc = "A heavy-duty, pulse-based energy weapon, preferred by front-line combat personnel."
desc = "A heavy-duty, multifaceted energy rifle with three modes. Preferred by front-line combat personnel."
icon_state = "pulse"
item_state = null //so the human update icon uses the icon_state instead.
item_state = null
w_class = 4
force = 10
fire_sound = 'sound/weapons/pulse.ogg'
charge_cost = 200
projectile_type = "/obj/item/projectile/beam/pulse"
cell_type = "/obj/item/weapon/stock_parts/cell/super"
var/mode = 2
flags = CONDUCT
slot_flags = SLOT_BACK
w_class = 4.0
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"
emp_act()
return
/obj/item/weapon/gun/energy/pulse/emp_act(severity)
return
attack_self(mob/living/user as mob)
switch(mode)
if(2)
mode = 0
charge_cost = 50
fire_sound = 'sound/weapons/Taser.ogg'
to_chat(user, "\red [src.name] is now set to stun.")
projectile_type = "/obj/item/projectile/energy/electrode"
if(0)
mode = 1
charge_cost = 100
fire_sound = 'sound/weapons/Laser.ogg'
to_chat(user, "\red [src.name] is now set to kill.")
projectile_type = "/obj/item/projectile/beam"
if(1)
mode = 2
charge_cost = 200
fire_sound = 'sound/weapons/pulse.ogg'
to_chat(user, "\red [src.name] is now set to DESTROY.")
projectile_type = "/obj/item/projectile/beam/pulse"
return
isHandgun()
return 0
/obj/item/weapon/gun/energy/pulse_rifle/cyborg/process_chambered()
if(in_chamber)
return 1
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
R.cell.use(charge_cost)
in_chamber = new projectile_type(src)
return 1
/obj/item/weapon/gun/energy/pulse/isHandgun()
return 0
/obj/item/weapon/gun/energy/pulse_rifle/cyborg
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
name = "pulse destroyer"
desc = "A heavy-duty, pulse-based energy weapon."
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
attack_self(mob/living/user as mob)
to_chat(user, "\red [src.name] has three settings, and they are all DESTROY.")
/obj/item/weapon/gun/energy/pulse_rifle/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/pulse_rifle/carbine
name = "pulse carbine"
@@ -69,7 +31,8 @@
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_rifle/pistol
name = "pulse pistol"
@@ -79,15 +42,26 @@
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_rifle/pistol/isHandgun()
return 1
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
name = "pulse destroyer"
desc = "A heavy-duty, pulse-based energy weapon."
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)
to_chat(user, "<span class='danger'>[src.name] has three settings, and they are all DESTROY.</span>")
/obj/item/weapon/gun/energy/pulse_rifle/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-p"
item_state = "gun"
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
isHandgun()
return 1
/obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911/isHandgun()
return 1

View File

@@ -8,7 +8,10 @@
w_class = 5.0
flags = CONDUCT
slot_flags = SLOT_BACK
projectile_type = "/obj/item/projectile/ion"
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
@@ -17,10 +20,12 @@
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"
item_state = "ioncarbine"
origin_tech = "combat=4;magnets=4;materials=4"
w_class = 3
slot_flags = SLOT_BELT
ammo_x_offset = 2
flight_x_offset = 18
flight_y_offset = 11
/obj/item/weapon/gun/energy/decloner
name = "biological demolecularisor"
@@ -28,8 +33,14 @@
icon_state = "decloner"
fire_sound = 'sound/weapons/pulse3.ogg'
origin_tech = "combat=5;materials=4;powerstorage=3"
projectile_type = "/obj/item/projectile/energy/declone"
ammo_type = list(/obj/item/ammo_casing/energy/declone)
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)
overlays += "decloner_spin"
/obj/item/weapon/gun/energy/floragun
name = "floral somatoray"
@@ -37,42 +48,11 @@
icon_state = "floramut100"
item_state = "gun"
fire_sound = 'sound/effects/stealthoff.ogg'
projectile_type = "/obj/item/projectile/energy/floramut"
ammo_type = list(/obj/item/ammo_casing/energy/flora/yield, /obj/item/ammo_casing/energy/flora/mut)
origin_tech = "materials=2;biotech=3;powerstorage=3"
modifystate = "floramut"
var/mode = 0 //0 = mutate, 1 = yield boost
needs_permit = 0
self_recharge = 1
/obj/item/weapon/gun/energy/floragun/attack_self(mob/living/user as mob)
switch(mode)
if(0)
mode = 1
charge_cost = 1000
to_chat(user, "\red The [src.name] is now set to increase yield.")
projectile_type = "/obj/item/projectile/energy/florayield"
modifystate = "florayield"
if(1)
mode = 0
charge_cost = 1000
to_chat(user, "\red The [src.name] is now set to induce mutations.")
projectile_type = "/obj/item/projectile/energy/floramut"
modifystate = "floramut"
update_icon()
return
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, flag)
if(flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/tray = target
if(process_chambered())
user.visible_message("\red <b> \The [user] fires \the [src] into \the [tray]!</b>")
Fire(target,user)
return
..()
modifystate = 1
ammo_x_offset = 1
selfcharge = 1
/obj/item/weapon/gun/energy/meteorgun
name = "meteor gun"
@@ -80,13 +60,10 @@
icon_state = "riotgun"
item_state = "c20r"
w_class = 4
projectile_type = "/obj/item/projectile/meteor"
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.
self_recharge = 1
recharge_time = 5 //Time it takes for shots to recharge (in ticks)
selfcharge = 1
/obj/item/weapon/gun/energy/meteorgun/pen
name = "meteor pen"
@@ -98,119 +75,115 @@
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"
projectile_type = "/obj/item/projectile/beam/mindflayer"
fire_sound = 'sound/weapons/Laser.ogg'
obj/item/weapon/gun/energy/staff/focus
name = "mental focus"
desc = "An artefact that channels the will of the user into destructive bolts of force. If you aren't careful with it, you might poke someone's brain out."
icon = 'icons/obj/wizard.dmi'
icon_state = "focus"
item_state = "focus"
projectile_type = "/obj/item/projectile/forcebolt"
/*
attack_self(mob/living/user as mob)
if(projectile_type == "/obj/item/projectile/forcebolt")
charge_cost = 200
to_chat(user, "\red The [src.name] will now strike a small area.")
projectile_type = "/obj/item/projectile/forcebolt/strong"
else
charge_cost = 100
to_chat(user, "\red The [src.name] will now strike only a single person.")
projectile_type = "/obj/item/projectile/forcebolt"
*/
/obj/item/weapon/gun/energy/clown
name = "HONK Rifle"
desc = "Clown Planet's finest."
icon_state = "energy"
projectile_type = "/obj/item/projectile/clown"
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
clumsy_check = 0
/obj/item/weapon/gun/energy/toxgun
name = "plasma pistol"
desc = "A specialized firearm designed to fire lethal bolts of toxins."
icon_state = "toxgun"
fire_sound = 'sound/effects/stealthoff.ogg'
w_class = 3.0
origin_tech = "combat=4;plasmatech=3"
projectile_type = "/obj/item/projectile/energy/plasma"
/obj/item/weapon/gun/energy/sniperrifle
name = "L.W.A.P. Sniper Rifle"
desc = "A rifle constructed of lightweight materials, fitted with a SMART aiming-system scope."
icon = 'icons/obj/gun.dmi'
icon_state = "esniper"
fire_sound = 'sound/weapons/marauder.ogg'
origin_tech = "combat=6;materials=5;powerstorage=4"
projectile_type = "/obj/item/projectile/beam/sniper"
slot_flags = SLOT_BACK
charge_cost = 2500
fire_delay = 50
w_class = 4.0
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
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 = "According to Nanotrasen accounting, this is mining equipment. It's been modified for extreme power output to crush rocks, but often serves as a miner's first defense against hostile alien life; it's not very powerful unless used in a low pressure environment."
icon_state = "kineticgun"
item_state = "kineticgun"
projectile_type = "/obj/item/projectile/kinetic"
fire_sound = 'sound/weapons/Kenetic_accel.ogg'
charge_cost = 5000
cell_type = "/obj/item/weapon/stock_parts/cell/emproof"
needs_permit = 0 // Aparently these are safe to carry? I'm sure Golliaths would disagree.
fire_delay = 16 //Because guncode is bad and you can bug the reload for rapid fire otherwise.
var/recently_fired = 0
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.
var/overheat_time = 16
unique_rename = 1
weapon_weight = WEAPON_LIGHT
origin_tech = "combat=2;powerstorage=1"
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"
projectile_type = "/obj/item/projectile/kinetic/super"
fire_delay = 15
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/super)
overheat_time = 15
origin_tech = "combat=3;powerstorage=2"
/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"
projectile_type = "/obj/item/projectile/kinetic/hyper"
fire_delay = 13
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/hyper)
overheat_time = 14
origin_tech = "combat=4;powerstorage=3"
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg
flags = NODROP
holds_charge = TRUE
unique_frequency = TRUE
/obj/item/weapon/gun/energy/kinetic_accelerator/Fire()
if(!recently_fired)
recently_fired = 1
spawn(fire_delay)
reload(usr)
..()
/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().
spawn(1)
if(!ismob(loc))
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
power_supply.use(5000)
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
spawn(overheat_time * carried)
reload()
overheat = FALSE
/obj/item/weapon/gun/energy/kinetic_accelerator/emp_act(severity)
return
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload(mob/living/user)
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(5000)
if(!silenced)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else if(user)
to_chat(usr, "<span class='warning'>You silently charge [src].<span>")
recently_fired = 0
else
to_chat(loc, "<span class='warning'>[src] silently charges up.<span>")
update_icon()
/obj/item/weapon/gun/energy/kinetic_accelerator/update_icon()
if(!can_shoot())
icon_state = "[initial(icon_state)]_empty"
else
icon_state = initial(icon_state)
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
name = "mini energy crossbow"
desc = "A weapon favored by syndicate stealth specialists."
@@ -219,10 +192,13 @@ obj/item/weapon/gun/energy/staff/focus
w_class = 2
materials = list(MAT_METAL=2000)
origin_tech = "combat=2;magnets=2;syndicate=5"
silenced = 1
projectile_type = "/obj/item/projectile/energy/bolt"
fire_sound = 'sound/weapons/Genhit.ogg'
fire_delay = 20
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
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large
name = "energy crossbow"
@@ -231,8 +207,8 @@ obj/item/weapon/gun/energy/staff/focus
w_class = 3
materials = list(MAT_METAL=4000)
origin_tech = "combat=2;magnets=2;syndicate=3" //can be further researched for more syndie tech
silenced = 0
projectile_type = "/obj/item/projectile/energy/bolt/large"
suppressed = 0
ammo_type = list(/obj/item/ammo_casing/energy/bolt/large)
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large/cyborg
desc = "One and done!"
@@ -240,27 +216,35 @@ obj/item/weapon/gun/energy/staff/focus
origin_tech = null
materials = list()
/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 = "plasmacutter"
modifystate = -1
origin_tech = "combat=1;materials=3;magnets=2;plasmatech=2;engineering=1"
projectile_type = /obj/item/projectile/plasma
ammo_type = list(/obj/item/ammo_casing/energy/plasma)
fire_sound = 'sound/weapons/laser.ogg'
flags = CONDUCT | OPENCONTAINER
attack_verb = list("attacked", "slashed", "cut", "sliced")
charge_cost = 250
fire_delay = 15
force = 12
sharpness = IS_SHARP
can_charge = 0
heat = 3800
/obj/item/weapon/gun/energy/plasmacutter/examine(mob/user)
..(user)
..()
if(power_supply)
to_chat(user, "<span class='notice'>[src] is [round(power_supply.percent())]% charged.</span>")
/obj/item/weapon/gun/energy/plasmacutter/attackby(var/obj/item/A, var/mob/user)
/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)
@@ -273,92 +257,34 @@ obj/item/weapon/gun/energy/staff/focus
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"
modifystate = "adv_plasmacutter"
origin_tech = "combat=3;materials=4;magnets=3;plasmatech=3;engineering=2"
projectile_type = /obj/item/projectile/plasma/adv
fire_delay = 10
charge_cost = 100
/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 = null
projectile_type = /obj/item/projectile/beam/disabler
fire_sound = 'sound/weapons/taser2.ogg'
cell_type = "/obj/item/weapon/stock_parts/cell"
charge_cost = 500
/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."
self_recharge = 1
use_external_power = 1
recharge_time = 2.5
/* 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/gun.dmi'
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
projectile_type = "/obj/item/projectile/bullet/midbullet3"
charge_cost = 200 //Yeah, let's NOT give them a 300 round clip that recharges, 20 is more reasonable and will actually hurt the borg's battery for overuse.
self_recharge = 1
use_external_power = 1
recharge_time = 5
/obj/item/weapon/gun/energy/printer/update_icon()
return
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."
projectile_type = "/obj/item/projectile/beam/wormhole"
charge_cost = 0
fire_sound = "sound/weapons/pulse3.ogg"
ammo_type = list(/obj/item/ammo_casing/energy/wormhole, /obj/item/ammo_casing/energy/wormhole/orange)
item_state = null
icon_state = "wormhole_projector100"
modifystate = "wormhole_projector"
var/obj/effect/portal/blue
var/obj/effect/portal/orange
var/mode = 0 //0 = blue 1 = 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/attack_self(mob/living/user as mob)
switch_modes()
/obj/item/weapon/gun/energy/wormhole_projector/proc/switch_modes(mob/living/user as mob)
switch(mode)
if(0)
mode = 1
to_chat(user, "<span class='warning'>[name] is now set to orange.</span>")
projectile_type = "/obj/item/projectile/beam/wormhole/orange"
modifystate = "wormhole_projector_orange"
if(1)
mode = 0
to_chat(user, "<span class='warning'>[name] is now set to blue.</span>")
projectile_type = "/obj/item/projectile/beam/wormhole"
modifystate = "wormhole_projector"
update_icon()
if(user.hand)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
/obj/item/weapon/gun/energy/wormhole_projector/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
/obj/item/weapon/gun/energy/wormhole_projector/process_chamber()
..()
switch_modes(user)
select_fire()
/obj/item/weapon/gun/energy/wormhole_projector/proc/portal_destroyed(obj/effect/portal/P)
if(P.icon_state == "portal")
@@ -373,7 +299,6 @@ obj/item/weapon/gun/energy/staff/focus
/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
P.failchance = 0
if(W.name == "bluespace beam")
qdel(blue)
blue = P
@@ -383,4 +308,259 @@ obj/item/weapon/gun/energy/staff/focus
orange = P
if(orange && blue)
blue.target = get_turf(orange)
orange.target = get_turf(blue)
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/gun.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/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 = null
/obj/item/weapon/gun/energy/laser/instakill/emp_act() //implying you could stop the instagib
return
/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/staff/focus
name = "mental focus"
desc = "An artefact that channels the will of the user into destructive bolts of force. If you aren't careful with it, you might poke someone's brain out."
icon = 'icons/obj/wizard.dmi'
icon_state = "focus"
item_state = "focus"
ammo_type = list(/obj/item/ammo_casing/forcebolt)
/obj/item/weapon/gun/energy/clown
name = "HONK Rifle"
desc = "Clown Planet's finest."
icon_state = "energy"
ammo_type = list(/obj/item/ammo_casing/energy/clown)
clumsy_check = 0
/obj/item/weapon/gun/energy/toxgun
name = "plasma pistol"
desc = "A specialized firearm designed to fire lethal bolts of toxins."
icon_state = "toxgun"
fire_sound = 'sound/effects/stealthoff.ogg'
w_class = 3
origin_tech = "combat=4;plasmatech=3"
ammo_type = list(/obj/item/ammo_casing/energy/toxplasma)
/obj/item/weapon/gun/energy/sniperrifle
name = "L.W.A.P. Sniper Rifle"
desc = "A rifle constructed of lightweight materials, fitted with a SMART aiming-system scope."
icon = 'icons/obj/gun.dmi'
icon_state = "esniper"
fire_sound = 'sound/weapons/marauder.ogg'
origin_tech = "combat=6;materials=5;powerstorage=4"
ammo_type = list(/obj/item/ammo_casing/energy/sniper)
slot_flags = SLOT_BACK
w_class = 4
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
/obj/item/weapon/gun/energy/temperature
name = "temperature gun"
icon = 'icons/obj/gun_temperature.dmi'
icon_state = "tempgun_4"
item_state = "tempgun_4"
slot_flags = SLOT_BACK
w_class = 4
fire_sound = 'sound/weapons/pulse3.ogg'
desc = "A gun that changes the body temperature of its targets."
var/temperature = 300
var/target_temperature = 300
var/e_cost = 1000
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
ammo_type = /obj/item/ammo_casing/energy/temp
cell_type = "/obj/item/weapon/stock_parts/cell"
var/powercost = ""
var/powercostcolor = ""
var/emagged = 0 //ups the temperature cap from 500 to 1000, targets hit by beams over 500 Kelvin will burst into flames
var/dat = ""
/obj/item/weapon/gun/energy/temperature/New()
..()
update_icon()
processing_objects.Add(src)
/obj/item/weapon/gun/energy/temperature/Destroy()
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/energy/temperature/newshot()
..()
chambered.temperature = temperature
chambered.e_cost = e_cost
/obj/item/weapon/gun/energy/temperature/attack_self(mob/living/user as mob)
user.set_machine(src)
update_dat()
user << browse("<TITLE>Temperature Gun Configuration</TITLE><HR>[dat]", "window=tempgun;size=510x120")
onclose(user, "tempgun")
/obj/item/weapon/gun/energy/temperature/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
emagged = 1
to_chat(user, "<span class='caution'>You double the gun's temperature cap! Targets hit by searing beams will burst into flames!</span>")
desc = "A gun that changes the body temperature of its targets. Its temperature cap has been hacked."
/obj/item/weapon/gun/energy/temperature/Topic(href, href_list)
if (..())
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["temp"])
var/amount = text2num(href_list["temp"])
if(amount > 0)
target_temperature = min((500 + 500*emagged), target_temperature+amount)
else
target_temperature = max(0, target_temperature+amount)
if (istype(loc, /mob))
attack_self(loc)
add_fingerprint(usr)
return
/obj/item/weapon/gun/energy/temperature/process()
switch(temperature)
if(0 to 100)
charge_cost = 3000
powercost = "High"
if(100 to 250)
charge_cost = 2000
powercost = "Medium"
if(251 to 300)
charge_cost = 1000
powercost = "Low"
if(301 to 400)
charge_cost = 2000
powercost = "Medium"
if(401 to 1000)
charge_cost = 3000
powercost = "High"
switch(powercost)
if("High") powercostcolor = "orange"
if("Medium") powercostcolor = "green"
else powercostcolor = "blue"
if(target_temperature != temperature)
var/difference = abs(target_temperature - temperature)
if(difference >= (10 + 40*emagged)) //so emagged temp guns adjust their temperature much more quickly
if(target_temperature < temperature)
temperature -= (10 + 40*emagged)
else
temperature += (10 + 40*emagged)
else
temperature = target_temperature
update_icon()
if (istype(loc, /mob/living/carbon))
var /mob/living/carbon/M = loc
if (src == M.machine)
update_dat()
M << browse("<TITLE>Temperature Gun Configuration</TITLE><HR>[dat]", "window=tempgun;size=510x102")
return
/obj/item/weapon/gun/energy/temperature/proc/update_dat()
dat = ""
dat += "Current output temperature: "
if(temperature > 500)
dat += "<FONT color=red><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
dat += "<FONT color=red><B> SEARING!</B></FONT>"
else if(temperature > (T0C + 50))
dat += "<FONT color=red><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
else if(temperature > (T0C - 50))
dat += "<FONT color=black><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
else
dat += "<FONT color=blue><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
dat += "<BR>"
dat += "Target output temperature: " //might be string idiocy, but at least it's easy to read
dat += "<A href='?src=\ref[src];temp=-100'>-</A> "
dat += "<A href='?src=\ref[src];temp=-10'>-</A> "
dat += "<A href='?src=\ref[src];temp=-1'>-</A> "
dat += "[target_temperature] "
dat += "<A href='?src=\ref[src];temp=1'>+</A> "
dat += "<A href='?src=\ref[src];temp=10'>+</A> "
dat += "<A href='?src=\ref[src];temp=100'>+</A>"
dat += "<BR>"
dat += "Power cost: "
dat += "<FONT color=[powercostcolor]><B>[powercost]</B></FONT>"
/obj/item/weapon/gun/energy/temperature/proc/update_temperature()
switch(temperature)
if(501 to INFINITY)
item_state = "tempgun_8"
if(400 to 500)
item_state = "tempgun_7"
if(360 to 400)
item_state = "tempgun_6"
if(335 to 360)
item_state = "tempgun_5"
if(295 to 335)
item_state = "tempgun_4"
if(260 to 295)
item_state = "tempgun_3"
if(200 to 260)
item_state = "tempgun_2"
if(120 to 260)
item_state = "tempgun_1"
if(-INFINITY to 120)
item_state = "tempgun_0"
icon_state = item_state
/obj/item/weapon/gun/energy/temperature/update_icon()
overlays = 0
update_temperature()
update_charge()
/obj/item/weapon/gun/energy/temperature/proc/update_charge()
var/charge = power_supply.charge
switch(charge)
if(9000 to INFINITY) overlays += "900"
if(8000 to 9000) overlays += "800"
if(7000 to 8000) overlays += "700"
if(6000 to 7000) overlays += "600"
if(5000 to 6000) overlays += "500"
if(4000 to 5000) overlays += "400"
if(3000 to 4000) overlays += "300"
if(2000 to 3000) overlays += "200"
if(1000 to 2002) overlays += "100"
if(-INFINITY to 1000) overlays += "0"

View File

@@ -1,13 +1,11 @@
/obj/item/weapon/gun/energy/taser
name = "taser gun"
desc = "A small, low capacity gun used for non-lethal takedowns."
icon_state = "taser"
item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/energy/electrode"
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
ammo_x_offset = 3
cell_type = "/obj/item/weapon/stock_parts/cell/crap"
fire_delay = 15
/obj/item/weapon/gun/energy/taser/mounted
name = "mounted taser gun"
@@ -18,67 +16,52 @@
name = "taser gun"
desc = "A small, low capacity gun used for non-lethal takedowns."
icon_state = "taser"
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/energy/electrode"
cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
self_recharge = 1
recharge_time = 10 //Time it takes for shots to recharge (in ticks)
/obj/item/weapon/gun/energy/disabler/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/shock_revolver
name = "tesla revolver"
desc = "A high-tech revolver that fires internal, reusable shock cartridges in a revolving cylinder. The cartridges can be recharged using conventional rechargers."
icon_state = "stunrevolver"
item_state = "gun"
fire_sound = 'sound/weapons/gunshot.ogg'
projectile_type = "/obj/item/projectile/energy/shock_revolver"
charge_cost = 2000
ammo_type = list(/obj/item/ammo_casing/energy/shock_revolver)
can_flashlight = 0
shaded_charge = 1
/obj/item/projectile/energy/shock_revolver
name = "shock bolt"
icon_state = "purple_laser"
var/chain
/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 = null
ammo_x_offset = 2
/obj/item/projectile/energy/shock_revolver/OnFired()
spawn(1)
chain = Beam(firer, icon_state="purple_lightning", icon = 'icons/effects/effects.dmi',time=1000, maxdistance = 30)
/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/projectile/energy/shock_revolver/on_hit(atom/target)
. = ..()
if(isliving(target))
tesla_zap(src, 3, 10000)
qdel(chain)
/obj/item/weapon/gun/energy/gun/advtaser/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/crossbow
name = "mini energy-crossbow"
desc = "A weapon favored by many of the syndicates stealth specialists."
icon_state = "crossbow"
w_class = 2.0
item_state = "crossbow"
materials = list(MAT_METAL=2000)
origin_tech = "combat=2;magnets=2;syndicate=5"
silenced = 1
fire_sound = 'sound/weapons/Genhit.ogg'
projectile_type = "/obj/item/projectile/energy/bolt"
cell_type = "/obj/item/weapon/stock_parts/cell/crap"
self_recharge = 1
/obj/item/weapon/gun/energy/crossbow/ninja
name = "energy dart thrower"
projectile_type = /obj/item/projectile/energy/dart
/obj/item/weapon/gun/energy/crossbow/update_icon()
return
/obj/item/weapon/gun/energy/crossbow/largecrossbow
name = "Energy Crossbow"
desc = "A weapon favored by syndicate carp hunters."
icon_state = "crossbowlarge"
silenced = 0
w_class = 3.0
force = 10
materials = list(MAT_METAL=4000)
projectile_type = "/obj/item/projectile/energy/bolt/large"
/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 = null
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

@@ -5,11 +5,9 @@
desc = "An extremely high-tech bluespace energy gun capable of teleporting targets to far off locations."
icon_state = "telegun"
item_state = "ionrifle"
fire_sound = 'sound/weapons/wave.ogg'
origin_tech = "combat=6;materials=7;powerstorage=5;bluespace=5;syndicate=4"
cell_type = "/obj/item/weapon/stock_parts/cell/crap"
projectile_type = "/obj/item/projectile/energy/teleport"
charge_cost = 1250
ammo_type = list(/obj/item/ammo_casing/energy/teleport)
var/teleport_target = null
/obj/item/weapon/gun/energy/telegun/Destroy()
@@ -36,4 +34,4 @@
L[tmpname] = R
var/desc = input("Please select a location to lock in.", "Telegun Target Interface") in L
teleport_target = L[desc]
teleport_target = L[desc]

View File

@@ -1,182 +0,0 @@
/obj/item/weapon/gun/energy/temperature
name = "temperature gun"
icon = 'icons/obj/gun_temperature.dmi'
icon_state = "tempgun_4"
item_state = "tempgun_4"
slot_flags = SLOT_BACK
w_class = 4.0
fire_sound = 'sound/weapons/pulse3.ogg'
desc = "A gun that changes the body temperature of its targets."
var/temperature = 300
var/target_temperature = 300
charge_cost = 90
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
projectile_type = /obj/item/projectile/temp
cell_type = /obj/item/weapon/stock_parts/cell/temperaturegun
var/powercost = ""
var/powercostcolor = ""
var/emagged = 0 //ups the temperature cap from 500 to 1000, targets hit by beams over 500 Kelvin will burst into flames
var/dat = ""
/obj/item/weapon/gun/energy/temperature/New()
..()
update_icon()
processing_objects.Add(src)
/obj/item/weapon/gun/energy/temperature/Destroy()
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/energy/temperature/attack_self(mob/living/user as mob)
user.set_machine(src)
update_dat()
user << browse("<TITLE>Temperature Gun Configuration</TITLE><HR>[dat]", "window=tempgun;size=510x120")
onclose(user, "tempgun")
/obj/item/weapon/gun/energy/temperature/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
emagged = 1
to_chat(user, "<span class='caution'>You double the gun's temperature cap! Targets hit by searing beams will burst into flames!</span>")
desc = "A gun that changes the body temperature of its targets. Its temperature cap has been hacked."
/obj/item/weapon/gun/energy/temperature/Topic(href, href_list)
if (..())
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["temp"])
var/amount = text2num(href_list["temp"])
if(amount > 0)
target_temperature = min((500 + 500*emagged), target_temperature+amount)
else
target_temperature = max(0, target_temperature+amount)
if (istype(loc, /mob))
attack_self(loc)
add_fingerprint(usr)
return
/obj/item/weapon/gun/energy/temperature/process()
switch(temperature)
if(0 to 100)
charge_cost = 300
powercost = "High"
if(100 to 250)
charge_cost = 180
powercost = "Medium"
if(251 to 300)
charge_cost = 90
powercost = "Low"
if(301 to 400)
charge_cost = 180
powercost = "Medium"
if(401 to 1000)
charge_cost = 300
powercost = "High"
switch(powercost)
if("High") powercostcolor = "orange"
if("Medium") powercostcolor = "green"
else powercostcolor = "blue"
if(target_temperature != temperature)
var/difference = abs(target_temperature - temperature)
if(difference >= (10 + 40*emagged)) //so emagged temp guns adjust their temperature much more quickly
if(target_temperature < temperature)
temperature -= (10 + 40*emagged)
else
temperature += (10 + 40*emagged)
else
temperature = target_temperature
update_icon()
if (istype(loc, /mob/living/carbon))
var /mob/living/carbon/M = loc
if (src == M.machine)
update_dat()
M << browse("<TITLE>Temperature Gun Configuration</TITLE><HR>[dat]", "window=tempgun;size=510x102")
if(power_supply)
power_supply.give(50)
update_icon()
return
/obj/item/weapon/gun/energy/temperature/proc/update_dat()
dat = ""
dat += "Current output temperature: "
if(temperature > 500)
dat += "<FONT color=red><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
dat += "<FONT color=red><B> SEARING!</B></FONT>"
else if(temperature > (T0C + 50))
dat += "<FONT color=red><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
else if(temperature > (T0C - 50))
dat += "<FONT color=black><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
else
dat += "<FONT color=blue><B>[temperature]</B> ([round(temperature-T0C)]&deg;C)</FONT>"
dat += "<BR>"
dat += "Target output temperature: " //might be string idiocy, but at least it's easy to read
dat += "<A href='?src=\ref[src];temp=-100'>-</A> "
dat += "<A href='?src=\ref[src];temp=-10'>-</A> "
dat += "<A href='?src=\ref[src];temp=-1'>-</A> "
dat += "[target_temperature] "
dat += "<A href='?src=\ref[src];temp=1'>+</A> "
dat += "<A href='?src=\ref[src];temp=10'>+</A> "
dat += "<A href='?src=\ref[src];temp=100'>+</A>"
dat += "<BR>"
dat += "Power cost: "
dat += "<FONT color=[powercostcolor]><B>[powercost]</B></FONT>"
/obj/item/weapon/gun/energy/temperature/proc/update_temperature()
switch(temperature)
if(501 to INFINITY)
item_state = "tempgun_8"
if(400 to 500)
item_state = "tempgun_7"
if(360 to 400)
item_state = "tempgun_6"
if(335 to 360)
item_state = "tempgun_5"
if(295 to 335)
item_state = "tempgun_4"
if(260 to 295)
item_state = "tempgun_3"
if(200 to 260)
item_state = "tempgun_2"
if(120 to 260)
item_state = "tempgun_1"
if(-INFINITY to 120)
item_state = "tempgun_0"
icon_state = item_state
/obj/item/weapon/gun/energy/temperature/proc/update_charge()
var/charge = power_supply.charge
switch(charge)
if(900 to INFINITY) overlays += "900"
if(800 to 900) overlays += "800"
if(700 to 800) overlays += "700"
if(600 to 700) overlays += "600"
if(500 to 600) overlays += "500"
if(400 to 500) overlays += "400"
if(300 to 400) overlays += "300"
if(200 to 300) overlays += "200"
if(100 to 200) overlays += "100"
if(-INFINITY to 100) overlays += "0"
/obj/item/weapon/gun/energy/temperature/proc/update_user()
if (istype(loc,/mob/living/carbon))
var/mob/living/carbon/M = loc
M.update_inv_back()
M.update_inv_l_hand()
M.update_inv_r_hand()
/obj/item/weapon/gun/energy/temperature/update_icon()
overlays = 0
update_temperature()
update_user()
update_charge()

View File

@@ -0,0 +1,54 @@
/obj/item/weapon/gun/grenadelauncher
name = "grenade launcher"
desc = "a terrible, terrible thing. it's really awful!"
icon = 'icons/obj/gun.dmi'
icon_state = "riotgun"
item_state = "riotgun"
w_class = 4
throw_speed = 2
throw_range = 10
force = 5
var/list/grenades = new/list()
var/max_grenades = 3
materials = list(MAT_METAL=2000)
/obj/item/weapon/gun/grenadelauncher/examine(mob/user)
if(..(user, 2))
to_chat(user, "<span class='notice'>[grenades.len] / [max_grenades] [ammo_name]s.</span>")
/obj/item/weapon/gun/grenadelauncher/attackby(obj/item/I as obj, mob/user as mob, params)
if((istype(I, /obj/item/weapon/grenade)))
if(grenades.len < max_grenades)
if(!user.unEquip(I))
return
I.loc = src
grenades += I
to_chat(user, "<span class='notice'>You put the [ammo_name] in the [name].</span>")
to_chat(user, "<span class='notice'>[grenades.len] / [max_grenades] [ammo_name]s.</span>")
else
to_chat(user, "<span class='warning'>The grenade launcher cannot hold more [ammo_name]s.</span>")
/obj/item/weapon/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
if(target == user)
return
if(grenades.len)
fire_grenade(target,user)
else
to_chat(user, "<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(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)
spawn(15)
F.prime()

View File

@@ -4,32 +4,25 @@
icon = 'icons/obj/gun.dmi'
icon_state = "staffofnothing"
item_state = "staff"
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'
fire_sound = 'sound/weapons/emitter.ogg'
flags = CONDUCT
w_class = 5
var/projectile_type = /obj/item/projectile/magic
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
/obj/item/weapon/gun/magic/emp_act(severity)
return
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/process_chambered()
if(in_chamber) return 1
if(!charges) return 0
if(!projectile_type) return 0
in_chamber = new projectile_type(src)
return 1
/obj/item/weapon/gun/magic/afterattack(atom/target as mob, mob/living/user as mob, flag)
/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))
@@ -38,22 +31,38 @@
else
no_den_usage = 0
..()
if(charges && !in_chamber && !flag) charges--
/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
if(can_charge) processing_objects.Add(src)
chambered = new ammo_type(src)
if(can_charge)
processing_objects.Add(src)
/obj/item/weapon/gun/magic/Destroy()
if(can_charge) processing_objects.Remove(src)
if(can_charge)
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/magic/process()
charge_tick++
if(charge_tick < recharge_rate || charges >= max_charges) return 0
if(charge_tick < recharge_rate || charges >= max_charges)
return 0
charge_tick = 0
charges++
return 1
@@ -63,4 +72,9 @@
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "<span class='warning'>The [name] whizzles quietly.<span>")
return
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

@@ -4,49 +4,53 @@ obj/item/weapon/gun/magic/staff/
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"
projectile_type = "/obj/item/projectile/magic/change"
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."
projectile_type = "/obj/item/projectile/magic/animate"
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."
projectile_type = "/obj/item/projectile/magic/resurrection"
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."
projectile_type = "/obj/item/projectile/magic"
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/chaos/process_chambered() //Snowflake proc, because this uses projectile_type instead of ammo_casing for whatever reason.
projectile_type = pick(typesof(/obj/item/projectile/magic))
if(in_chamber) return 1
if(!charges) return 0
in_chamber = new projectile_type(src)
return 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."
projectile_type = "/obj/item/projectile/magic/door"
ammo_type = /obj/item/ammo_casing/magic/door
icon_state = "staffofdoor"
item_state = "staffofdoor"
max_charges = 10
recharge_rate = 2
no_den_usage = 1
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

@@ -1,21 +1,13 @@
/obj/item/weapon/gun/magic/wand/
name = "wand of nothing"
desc = "It's not just a stick, it's a MAGIC stick!"
projectile_type = "/obj/item/projectile/magic"
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
var/drained = 0
/obj/item/projectile/magic/fireball/Range()
var/mob/living/L = locate(/mob/living) in (range(src, 1) - firer)
if(L && L.stat != DEAD)
Bump(L) //Magic Bullet #teachthecontroversy
return
..()
/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
@@ -26,26 +18,21 @@
..()
/obj/item/weapon/gun/magic/wand/examine(mob/user)
..(user)
..()
to_chat(user, "Has [charges] charge\s remaining.")
/obj/item/weapon/gun/magic/wand/attack_self(mob/living/user as mob)
if(charges)
zap_self(user)
else
to_chat(user, "<span class='caution'>The [name] whizzles quietly.<span>")
..()
/obj/item/weapon/gun/magic/wand/update_icon()
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
/obj/item/weapon/gun/magic/wand/attack(atom/target as mob, mob/living/user as mob)
/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 as mob, mob/living/user as mob)
if(!charges && !drained)
to_chat(user, "<span class='warning'>The [name] whizzles quietly.<span>")
icon_state = "[icon_state]-drained"
drained = 1
/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)
@@ -53,74 +40,83 @@
if(istype(A, /area/wizard_station))
to_chat(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
else
no_den_usage = 0
zap_self(user)
else
..()
update_icon()
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user as mob)
user.visible_message("<span class='notice'>[user] zaps \himself with [src]!</span>")
/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."
projectile_type = "/obj/item/projectile/magic/death"
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 as mob)
if(alert(user, "You really want to zap yourself with the wand of death?",, "Yes", "No") == "Yes" && charges && user.get_active_hand() == src && isliving(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>")
to_chat(user, message)
user.adjustOxyLoss(500)
charges--
..()
/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>")
to_chat(user, message)
user.adjustBurnLoss(500)
charges--
..()
/////////////////////////////////////
//WAND OF HEALING
/////////////////////////////////////
/obj/item/weapon/gun/magic/wand/resurrection
name = "wand of resurrection"
desc = "This wand uses healing magics to heal and revive. They are rarely utilized within the Wizard Federation for some reason."
projectile_type = "/obj/item/projectile/magic/resurrection"
ammo_type = /obj/item/ammo_casing/magic/heal
icon_state = "revivewand"
max_charges = 3 //3, 2, 2, 1
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user as mob)
user.setToxLoss(0)
user.setOxyLoss(0)
user.setCloneLoss(0)
user.SetParalysis(0)
user.SetStunned(0)
user.SetWeakened(0)
user.radiation = 0
user.heal_overall_damage(user.getBruteLoss(), user.getFireLoss())
user.reagents.clear_reagents()
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
user.revive()
to_chat(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."
projectile_type = "/obj/item/projectile/magic/change"
ammo_type = /obj/item/ammo_casing/magic/change
icon_state = "polywand"
max_charges = 10 //10, 5, 5, 4
/obj/item/weapon/gun/magic/wand/polymorph/zap_self(mob/living/user as mob)
if(alert(user, "Your new form might not have arms to zap with... Continue?",, "Yes", "No") == "Yes" && charges && user.get_active_hand() == src && isliving(user))
..() //because the user mob ceases to exists by the time wabbajack fully resolves
wabbajack(user)
charges--
/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."
projectile_type = "/obj/item/projectile/magic/teleport"
ammo_type = /obj/item/ammo_casing/magic/teleport
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 as mob)
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
do_teleport(user, user, 10)
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
smoke.set_up(10, 0, user.loc)
@@ -128,25 +124,34 @@
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."
projectile_type = "/obj/item/projectile/magic/door"
ammo_type = /obj/item/ammo_casing/magic/door
icon_state = "doorwand"
max_charges = 20 //20, 10, 10, 7
/obj/item/weapon/gun/magic/wand/door/zap_self()
return
/obj/item/weapon/gun/magic/wand/door/zap_self(mob/living/user)
to_chat(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."
projectile_type = "/obj/item/projectile/magic/fireball"
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 as mob)
if(alert(user, "Zapping yourself with a wand of fireball is probably a bad idea, do it anyway?",, "Yes", "No") == "Yes" && charges && user.get_active_hand() == src && isliving(user))
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
charges--
..()
/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

@@ -4,7 +4,7 @@
icon = 'icons/obj/chronos.dmi'
icon_state = "chronogun"
item_state = "chronogun"
w_class = 3.0
w_class = 3
var/mob/living/current_target
var/last_check = 0
@@ -13,7 +13,7 @@
var/active = 0
var/datum/beam/current_beam = null
heavy_weapon = 1
weapon_weight = WEAPON_MEDIUM
/obj/item/weapon/gun/medbeam/New()
..()
@@ -34,7 +34,7 @@
on_beam_release(current_target)
current_target = null
/obj/item/weapon/gun/medbeam/Fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
/obj/item/weapon/gun/medbeam/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
add_fingerprint(user)
if(current_target)
@@ -113,4 +113,4 @@
return
/obj/effect/ebeam/medical
name = "medical beam"
name = "medical beam"

View File

@@ -1,31 +1,31 @@
/obj/item/weapon/gun/energy/advtaser/mounted
name = "mounted taser"
desc = "An arm mounted dual-mode weapon that fires electrodes and disabler shots."
icon_state = "armcannonstun"
item_state = "armcannonstun"
modifystate = "armcannonstun"
icon_state = "taser"
item_state = "armcannonstun4"
force = 5
self_recharge = 1
flags = NODROP
slot_flags = null
w_class = 5.0
w_class = 5
can_flashlight = 0
selfcharge = 1
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead
/obj/item/weapon/gun/energy/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. Doesn't come with a charge beam."
icon_state = "armcannonlase"
icon_state = "laser"
item_state = "armcannonlase"
modifystate = "armcannonlase"
force = 5
self_recharge = 1
flags = NODROP
slot_flags = null
w_class = 5.0
w_class = 5
materials = null
selfcharge = 1
trigger_guard = TRIGGER_GUARD_ALLOW_ALL
/obj/item/weapon/gun/energy/laser/mounted/dropped()
src.loc = null
..()
src.loc = null

View File

@@ -1,22 +1,13 @@
#define SPEEDLOADER 0
#define FROM_BOX 1
#define MAGAZINE 2
/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.0
w_class = 3
materials = list(MAT_METAL=1000)
// recoil = 1
var/mag_type = "/obj/item/ammo_box/magazine/m10mm" //Removes the need for max_ammo and caliber info
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
// var/obj/item/ammo_casing/chambered = null // The round (not bullet) that is in the chamber.
/obj/item/weapon/gun/projectile/New()
..()
@@ -26,31 +17,26 @@
update_icon()
return
/obj/item/weapon/gun/projectile/update_icon()
..()
if(reskinned && current_skin)
icon_state = "[current_skin][suppressed ? "-suppressed" : ""]"
else
icon_state = "[initial(icon_state)][suppressed ? "-suppressed" : ""]"
/obj/item/weapon/gun/projectile/process_chambered(var/eject_casing = 1, var/empty_chamber = 1 )
// if(in_chamber)
// return 1
/obj/item/weapon/gun/projectile/process_chamber(eject_casing = 1, empty_chamber = 1)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(isnull(AC) || !istype(AC))
return 0
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()
if(AC.BB)
if(AC.reagents && AC.BB.reagents)
var/datum/reagents/casting_reagents = AC.reagents
casting_reagents.trans_to(AC.BB, casting_reagents.total_volume) //For chemical darts/bullets
qdel(casting_reagents)
in_chamber = AC.BB //Load projectile into chamber.
AC.BB.loc = src //Set projectile loc to gun.
AC.update_icon()
return 1
return 0
return
/obj/item/weapon/gun/projectile/proc/chamber_round()
if(chambered || !magazine)
@@ -60,12 +46,16 @@
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(var/obj/item/A as obj, mob/user as mob, params)
..()
if(istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if(!magazine && istype(AM, text2path(mag_type)))
if(!magazine && istype(AM, mag_type))
user.remove_from_mob(AM)
magazine = AM
magazine.loc = src
@@ -79,13 +69,11 @@
if(istype(A, /obj/item/weapon/suppressor))
var/obj/item/weapon/suppressor/S = A
if(can_suppress)
if(!silenced)
if(user.l_hand != src && user.r_hand != src)
to_chat(user, "<span class='notice'>You'll need [src] in your hands to do that.</span>")
if(!suppressed)
if(!user.unEquip(A))
return
user.drop_item()
to_chat(user, "<span class='notice'>You screw [S] onto [src].</span>")
silenced = A
suppressed = A
S.oldsound = fire_sound
S.initial_w_class = w_class
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
@@ -101,39 +89,45 @@
return
return 0
/obj/item/weapon/gun/projectile/attack_hand(mob/user as mob)
/obj/item/weapon/gun/projectile/attack_hand(mob/user)
if(loc == user)
if(silenced && can_unsuppress)
var/obj/item/weapon/suppressor/S = silenced
if(suppressed && can_unsuppress)
var/obj/item/weapon/suppressor/S = suppressed
if(user.l_hand != src && user.r_hand != src)
..()
return
to_chat(user, "<span class='notice'>You unscrew [silenced] from [src].</span>")
user.put_in_hands(silenced)
user.put_in_hands(suppressed)
fire_sound = S.oldsound
w_class = S.initial_w_class
silenced = 0
suppressed = 0
update_icon()
return
..()
/obj/item/weapon/gun/projectile/attack_self(mob/living/user as mob)
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
to_chat(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
to_chat(user, "<span class='notice'>You unload the round from \the [src]'s chamber.</span>")
else
to_chat(user, "<span class='notice'>There's no magazine in \the [src].</span>")
update_icon()
return
/obj/item/weapon/gun/projectile/examine(mob/user)
..(user)
..()
to_chat(user, "Has [get_ammo()] round\s remaining.")
/obj/item/weapon/gun/projectile/proc/get_ammo(var/countchambered = 1)
/obj/item/weapon/gun/projectile/proc/get_ammo(countchambered = 1)
var/boolets = 0 //mature var names for mature people
if(chambered && countchambered)
boolets++
@@ -141,6 +135,22 @@
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/suppressor
name = "suppressor"
desc = "A universal syndicate small-arms suppressor for maximum espionage."
@@ -150,3 +160,9 @@
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/gun.dmi'
icon_state = "suppressor"

View File

@@ -15,7 +15,7 @@
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"
mag_type = /obj/item/ammo_box/magazine/smgm9mm
origin_tech = "combat=4;materials=2"
/obj/item/weapon/gun/projectile/automatic/update_icon()
@@ -25,7 +25,7 @@
overlays += "[initial(icon_state)]semi"
if(select == 1)
overlays += "[initial(icon_state)]burst"
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][silenced ? "-suppressed" : ""]"
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
return
/obj/item/weapon/gun/projectile/automatic/attackby(var/obj/item/A as obj, mob/user as mob, params)
@@ -34,7 +34,7 @@
return
if(istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if(istype(AM, text2path(mag_type)))
if(istype(AM, mag_type))
if(magazine)
to_chat(user, "<span class='notice'>You perform a tactical reload on \the [src], replacing the magazine.</span>")
magazine.forceMove(get_turf(src.loc))
@@ -69,6 +69,9 @@
update_icon()
return
/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)
@@ -82,7 +85,7 @@
icon_state = "c20r"
item_state = "c20r"
origin_tech = "combat=5;materials=2;syndicate=8"
mag_type = "/obj/item/ammo_box/magazine/smgm45"
mag_type = /obj/item/ammo_box/magazine/smgm45
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
fire_delay = 2
burst_size = 2
@@ -99,7 +102,7 @@
/obj/item/weapon/gun/projectile/automatic/c20r/update_icon()
..()
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][silenced ? "-suppressed" : ""]"
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
return
/obj/item/weapon/gun/projectile/automatic/wt550
@@ -107,7 +110,7 @@
desc = "An outdated personal defense weapon utilized by law enforcement. The WT-550 Automatic Rifle fires 4.6x30mm rounds."
icon_state = "wt550"
item_state = "arg"
mag_type = "/obj/item/ammo_box/magazine/wt550m9"
mag_type = /obj/item/ammo_box/magazine/wt550m9
fire_delay = 2
can_suppress = 0
burst_size = 1
@@ -123,80 +126,16 @@
desc = "A lightweight, burst-fire submachine gun, for when you really want someone dead. Uses 9mm rounds."
icon_state = "mini-uzi"
origin_tech = "combat=5;materials=2;syndicate=8"
mag_type = "/obj/item/ammo_box/magazine/uzim9mm"
mag_type = /obj/item/ammo_box/magazine/uzim9mm
burst_size = 2
/obj/item/weapon/gun/projectile/automatic/l6_saw
name = "\improper L6 SAW"
desc = "A heavily modified 7.62 light machine gun, designated 'L6 SAW'. Has 'Aussec Armoury - 2531' engraved on the reciever below the designation."
icon_state = "l6closed100"
item_state = "l6closedmag"
w_class = 5
slot_flags = 0
origin_tech = "combat=5;materials=1;syndicate=2"
mag_type = "/obj/item/ammo_box/magazine/m762"
fire_sound = 'sound/weapons/Gunshot3.ogg'
var/cover_open = 0
can_suppress = 0
burst_size = 5
fire_delay = 3
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_self(mob/user as mob)
cover_open = !cover_open
to_chat(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()
if(magazine && magazine.caliber != "a762")
icon_state = "l6[cover_open ? "open" : "closed"]0"
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? round(magazine.ammo_count() * 2, 25) : "-empty"]"
/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)
to_chat(user, "<span class='notice'>[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 as mob)
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()
to_chat(user, "<span class='notice'>You remove the magazine from [src].</span>")
/obj/item/weapon/gun/projectile/automatic/l6_saw/attackby(var/obj/item/A as obj, mob/user as mob, params)
if(!cover_open && istype(A, mag_type))
to_chat(user, "<span class='notice'>[src]'s cover is closed! You can't insert a new mag!</span>")
return
..()
/obj/item/weapon/gun/projectile/automatic/l6_saw/devastator
name = "\improper 'Devastator' LMG"
desc = "A heavily modified L6 SAW designed to chamber wide rounds. Commonly used by elite Syndicate boarding teams "
mag_type = "/obj/item/ammo_box/magazine/m762/buckshot"
/obj/item/weapon/gun/projectile/automatic/l6_saw/devastator/New()
..()
mag_type = "/obj/item/ammo_box/magazine/m762" // Workaround so it spawns with a shotgun mag loaded, but can still load regular LMG mags.
/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=8"
mag_type = "/obj/item/ammo_box/magazine/m556"
mag_type = /obj/item/ammo_box/magazine/m556
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
action_button_name = "Toggle Grenade Launcher"
can_suppress = 0
@@ -215,12 +154,11 @@
underbarrel.afterattack(target, user, flag, params)
else
..()
empty_alarm()
return
/obj/item/weapon/gun/projectile/automatic/m90/attackby(var/obj/item/A, mob/user, params)
if(istype(A, /obj/item/ammo_casing))
if(istype(A, text2path(underbarrel.magazine.ammo_type)))
if(istype(A, underbarrel.magazine.ammo_type))
underbarrel.attack_self()
underbarrel.attackby(A, user, params)
else
@@ -267,11 +205,11 @@
w_class = 5
slot_flags = 0
origin_tech = "combat=5;materials=1;syndicate=2"
mag_type = "/obj/item/ammo_box/magazine/tommygunm45"
mag_type = /obj/item/ammo_box/magazine/tommygunm45
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
can_suppress = 0
fire_delay = 1
burst_size = 4
fire_delay = 1
/obj/item/weapon/gun/projectile/automatic/ar
name = "ARG"
@@ -285,3 +223,40 @@
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 compact, mag-fed semi-automatic 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.0
origin_tech = "combat=5;materials=4;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/m12g
fire_sound = 'sound/weapons/Gunshot4.ogg'
can_suppress = 0
burst_size = 1
fire_delay = 0
action_button_name = null
/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)
overlays.Cut()
overlays += "[magazine.icon_state]"
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/update_icon()
overlays.Cut()
update_magazine()
icon_state = "bulldog[chambered ? "" : "-e"]"
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
..()
empty_alarm()
return

View File

@@ -1,323 +0,0 @@
//AMMUNITION
/obj/item/weapon/arrow
name = "bolt"
desc = "It's got a tip for you - get the point?"
icon = 'icons/obj/weapons.dmi'
icon_state = "bolt"
item_state = "bolt"
throwforce = 8
w_class = 3.0
sharp = 1
edge = 0
/obj/item/weapon/arrow/proc/removed() //Helper for metal rods falling apart.
return
/obj/item/weapon/spike
name = "alloy spike"
desc = "It's about a foot of weird silver metal with a wicked point."
sharp = 1
edge = 0
throwforce = 5
w_class = 2
icon = 'icons/obj/weapons.dmi'
icon_state = "metal-rod"
item_state = "bolt"
/obj/item/weapon/arrow/quill
name = "vox quill"
desc = "A wickedly barbed quill from some bizarre animal."
icon_state = "quill"
item_state = "quill"
throwforce = 5
/obj/item/weapon/arrow/rod
name = "metal rod"
desc = "Don't cry for me, Orithena."
icon_state = "metal-rod"
/obj/item/weapon/arrow/rod/removed(mob/user)
if(throwforce == 15) // The rod has been superheated - we don't want it to be useable when removed from the bow.
to_chat(user, "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow.")
var/obj/item/weapon/shard/shrapnel/S = new()
S.loc = get_turf(src)
qdel(src)
/obj/item/weapon/arrow/baguette
name = "baguette"
desc = "Still warm from the oven!"
icon = 'icons/obj/weapons.dmi'
icon_state = "baguette"
item_state = "baguette"
throwforce = 3
sharp = 0
/obj/item/weapon/gun/launcher/crossbow
name = "powered crossbow"
desc = "A 2557AD twist on an old classic. Pick up that can."
icon_state = "crossbow"
item_state = "crossbow-solid"
fire_sound = 'sound/weapons/punchmiss.ogg' // TODO: Decent THWOK noise.
// ejectshell = 0 // No spent shells.
mouthshoot = 1 // No suiciding with this weapon, causes runtimes.
fire_sound_text = "a solid thunk"
fire_delay = 25
var/tension = 0 // Current draw on the bow.
var/max_tension = 5 // Highest possible tension.
var/release_speed = 5 // Speed per unit of tension.
var/obj/item/weapon/stock_parts/cell/cell = null // Used for firing superheated rods.
var/current_user // Used to check if the crossbow has changed hands since being drawn.
/obj/item/weapon/gun/launcher/crossbow/emp_act(severity)
if(cell && severity)
cell.use(100*severity)
/obj/item/weapon/gun/launcher/crossbow/special_check(user)
if(tension <= 0)
to_chat(user, "\red \The [src] is not drawn back!")
return 0
return 1
/obj/item/weapon/gun/launcher/crossbow/update_release_force()
release_force = tension*release_speed
/obj/item/weapon/gun/launcher/crossbow/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
if(!..()) return //Only do this on a successful shot.
icon_state = "crossbow"
tension = 0
/obj/item/weapon/gun/launcher/crossbow/attack_self(mob/living/user as mob)
if(tension)
if(in_chamber && in_chamber.loc == src) //Just in case they click it the tick after firing.
user.visible_message("[user] relaxes the tension on [src]'s string and removes [in_chamber].","You relax the tension on [src]'s string and remove [in_chamber].")
in_chamber.loc = get_turf(src)
var/obj/item/weapon/arrow/A = in_chamber
in_chamber = null
A.removed(user)
else
user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.")
tension = 0
icon_state = "crossbow"
else
draw(user)
/obj/item/weapon/gun/launcher/crossbow/proc/draw(var/mob/user as mob)
if(!in_chamber)
to_chat(user, "You don't have anything nocked to [src].")
return
if(user.restrained())
return
current_user = user
user.visible_message("[user] begins to draw back the string of [src].","You begin to draw back the string of [src].")
tension = 1
spawn(25) increase_tension(user) //TODO: This needs to be changed to something less shit.
/obj/item/weapon/gun/launcher/crossbow/proc/increase_tension(var/mob/user as mob)
if(!in_chamber || !tension || current_user != user) //Arrow has been fired, bow has been relaxed or user has changed.
return
tension++
icon_state = "crossbow-drawn"
if(tension>=max_tension)
tension = max_tension
to_chat(usr, "[src] clunks as you draw the string to its maximum tension!")
else
user.visible_message("[usr] draws back the string of [src]!","You continue drawing back the string of [src]!")
spawn(25) increase_tension(user)
/obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob, params)
if(!in_chamber)
if (istype(W,/obj/item/weapon/arrow))
user.drop_item()
in_chamber = W
in_chamber.loc = src
user.visible_message("[user] slides [in_chamber] into [src].","You slide [in_chamber] into [src].")
icon_state = "crossbow-nocked"
return
else if(istype(W,/obj/item/stack/rods))
var/obj/item/stack/rods/R = W
R.use(1)
in_chamber = new /obj/item/weapon/arrow/rod(src)
in_chamber.fingerprintslast = src.fingerprintslast
in_chamber.loc = src
icon_state = "crossbow-nocked"
user.visible_message("[user] jams [in_chamber] into [src].","You jam [in_chamber] into [src].")
superheat_rod(user)
return
if(istype(W, /obj/item/weapon/stock_parts/cell))
if(!cell)
user.drop_item()
W.loc = src
cell = W
to_chat(user, "<span class='notice'>You jam [cell] into [src] and wire it to the firing coil.</span>")
superheat_rod(user)
else
to_chat(user, "<span class='notice'>[src] already has a cell installed.</span>")
else if(istype(W, /obj/item/weapon/screwdriver))
if(cell)
var/obj/item/C = cell
C.loc = get_turf(user)
to_chat(user, "<span class='notice'>You jimmy [cell] out of [src] with [W].</span>")
cell = null
else
to_chat(user, "<span class='notice'>[src] doesn't have a cell installed.</span>")
else
..()
/obj/item/weapon/gun/launcher/crossbow/proc/superheat_rod(var/mob/user)
if(!user || !cell || !in_chamber) return
if(cell.charge < 500) return
if(in_chamber.throwforce >= 15) return
if(!istype(in_chamber,/obj/item/weapon/arrow/rod)) return
to_chat(user, "<span class='notice'>[in_chamber] plinks and crackles as it begins to glow red-hot.</span>")
in_chamber.throwforce = 15
in_chamber.icon_state = "metal-rod-superheated"
cell.use(500)
/obj/item/weapon/gun/launcher/crossbow/french
name = "french powered crossbow"
/obj/item/weapon/gun/launcher/crossbow/french/attackby(obj/item/W as obj, mob/user as mob, params)
if(!in_chamber)
if (istype(W,/obj/item/weapon/reagent_containers/food/snacks/baguette))
user.drop_item()
in_chamber = W
in_chamber.loc = src
user.visible_message("[user] slides [in_chamber] into [src].","You slide [in_chamber] into [src].")
icon_state = "crossbow-nocked"
return
else if (istype(W,/obj/item/weapon/arrow))
user.visible_message("\The [src] only takes baguettes.")
return
else if(istype(W,/obj/item/stack/rods))
user.visible_message("\The [src] only takes baguettes.")
return
if(istype(W, /obj/item/weapon/stock_parts/cell))
user.visible_message("The [src] is too simple be adapted with a cell.")
return
else
..()
/obj/item/weapon/gun/launcher/crossbow/french/increase_tension(var/mob/user as mob)
if(!in_chamber || !tension || current_user != user) //Arrow has been fired, bow has been relaxed or user has changed.
return
tension++
icon_state = "fcrossbow-drawn"
if(tension>=max_tension)
tension = max_tension
to_chat(usr, "[src] clunks as you draw the string to its maximum tension!")
else
user.visible_message("[usr] draws back the string of [src]!","You continue drawing back the string of [src]!")
spawn(25) increase_tension(user)
// Crossbow construction.
/obj/item/weapon/crossbowframe
name = "crossbow frame"
desc = "A half-finished crossbow."
icon_state = "crossbowframe0"
item_state = "crossbow-solid"
var/buildstate = 0
/obj/item/weapon/crossbowframe/update_icon()
icon_state = "crossbowframe[buildstate]"
/obj/item/weapon/crossbowframe/examine(mob/user)
..(user)
switch(buildstate)
if(1)
to_chat(user, "It has a loose rod frame in place.")
if(2)
to_chat(user, "It has a steel backbone welded in place.")
if(3)
to_chat(user, "It has a steel backbone and a cell mount installed.")
if(4)
to_chat(user, "It has a steel backbone, plastic lath and a cell mount installed.")
if(5)
to_chat(user, "It has a steel cable loosely strung across the lath.")
/obj/item/weapon/crossbowframe/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/stack/rods))
if(buildstate == 0)
var/obj/item/stack/rods/R = W
if(R.amount >= 3)
R.use(3)
to_chat(user, "\blue You assemble a backbone of rods around the wooden stock.")
buildstate++
update_icon()
else
to_chat(user, "\blue You need at least three rods to complete this task.")
return
else if(istype(W,/obj/item/weapon/weldingtool))
if(buildstate == 1)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
to_chat(user, "\blue You weld the rods into place.")
buildstate++
update_icon()
return
else if(istype(W,/obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(buildstate == 2)
if(C.amount >= 5)
C.use(5)
to_chat(user, "\blue You wire a crude cell mount into the top of the crossbow.")
buildstate++
update_icon()
else
to_chat(user, "\blue You need at least five segments of cable coil to complete this task.")
return
else if(buildstate == 4)
if(C.amount >= 5)
C.use(5)
to_chat(user, "\blue You string a steel cable across the crossbow's lath.")
buildstate++
update_icon()
else
to_chat(user, "\blue You need at least five segments of cable coil to complete this task.")
return
else if(istype(W,/obj/item/stack/sheet/mineral/plastic))
if(buildstate == 3)
var/obj/item/stack/sheet/mineral/plastic/P = W
if(P.amount >= 3)
P.use(3)
to_chat(user, "\blue You assemble and install a heavy plastic lath onto the crossbow.")
buildstate++
update_icon()
else
to_chat(user, "\blue You need at least three plastic sheets to complete this task.")
return
else if(istype(W,/obj/item/weapon/screwdriver))
if(buildstate == 5)
to_chat(user, "\blue You secure the crossbow's various parts.")
new /obj/item/weapon/gun/launcher/crossbow(get_turf(src))
qdel(src)
return
else
..()

View File

@@ -1,91 +0,0 @@
/obj/item/weapon/gun/launcher
name = "launcher"
desc = "A device that launches things."
icon = 'icons/obj/weapons.dmi'
w_class = 5.0
flags = CONDUCT
slot_flags = SLOT_BACK
var/release_force = 0
var/fire_sound_text = "a launcher firing"
//Check if we're drawing and if the bow is loaded.
/obj/item/weapon/gun/launcher/proc/chamber_round()
return (!isnull(in_chamber))
//This should not fit in a combat belt or holster.
/obj/item/weapon/gun/launcher/isHandgun()
return 0
//Launchers are mechanical, no other impact.
/obj/item/weapon/gun/launcher/emp_act(severity)
return
//This normally uses a proc on projectiles and our ammo is not strictly speaking a projectile.
/obj/item/weapon/gun/launcher/can_hit(var/mob/living/target as mob, var/mob/living/user as mob)
return
//Override this to avoid a runtime with suicide handling.
/obj/item/weapon/gun/launcher/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (M == user && user.zone_sel.selecting == "mouth")
to_chat(user, "\red Shooting yourself with \a [src] is pretty tricky. You can't seem to manage it.")
return
..()
/obj/item/weapon/gun/launcher/proc/update_release_force()
return 0
/obj/item/weapon/gun/launcher/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
if (!user.IsAdvancedToolUser())
to_chat(user, "\red You don't have the dexterity to do this!")
return 0
add_fingerprint(user)
//Make sure target turfs both exist.
var/turf/curloc = get_turf(user)
var/turf/targloc = get_turf(target)
if (!istype(targloc) || !istype(curloc))
return 0
if(!special_check(user))
return 0
if (!ready_to_fire())
if (world.time % 3) //to prevent spam
to_chat(user, "<span class='warning'>[src] is not ready to fire again!")
return 0
if(!chamber_round()) //CHECK
return click_empty(user)
if(!in_chamber)
return 0
update_release_force()
playsound(user, fire_sound, 50, 1)
user.visible_message("<span class='warning'>[user] fires [src][reflex ? " by reflex":""]!</span>", \
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>", \
"You hear [fire_sound_text]!")
in_chamber.loc = get_turf(user)
in_chamber.throw_at(target,10,release_force)
sleep(1)
in_chamber = null
update_icon()
if(user.hand)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
return 1
/obj/item/weapon/gun/launcher/attack_self(mob/living/user as mob)
return

View File

@@ -1,44 +1,12 @@
//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/automatic/gyropistol
name = "gyrojet pistol"
desc = "A prototype pistol designed to fire self propelled rockets."
icon_state = "gyropistol"
fire_sound = 'sound/effects/Explosion1.ogg'
origin_tech = "combat=3"
mag_type = "/obj/item/ammo_box/magazine/m75"
burst_size = 1
fire_delay = 0
/obj/item/weapon/gun/projectile/automatic/gyropistol/isHandgun()
return 1
/obj/item/weapon/gun/projectile/automatic/gyropistol/New()
..()
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/gyropistol/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
..()
if(!chambered && !get_ammo() && !alarmed)
playsound(user, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
update_icon()
alarmed = 1
return
/obj/item/weapon/gun/projectile/automatic/gyropistol/update_icon()
..()
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
return
/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/cylinder/grenadelauncher"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/grenadelauncher
fire_sound = 'sound/weapons/grenadelaunch.ogg'
w_class = 3
@@ -52,7 +20,7 @@
name = "multi grenade launcher"
icon_state = "bulldog"
item_state = "bulldog"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/grenadelauncher/multi"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/grenadelauncher/multi
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/multi/cyborg
desc = "A 6-shot grenade launcher."
@@ -60,4 +28,57 @@
icon_state = "mecha_grenadelnchr"
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/multi/cyborg/attack_self()
return
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/effects/Explosion1.ogg'
origin_tech = "combat=3"
mag_type = /obj/item/ammo_box/magazine/m75
burst_size = 1
fire_delay = 0
action_button_name = null
/obj/item/weapon/gun/projectile/automatic/gyropistol/isHandgun()
return 1
/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" : ""]"
return
/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
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
action_button_name = null
/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)
to_chat(user, "<span class='notice'>You load [num_loaded] spear\s into \the [src].</span>")
update_icon()
chamber_round()

View File

@@ -4,18 +4,18 @@
icon_state = "pistol"
w_class = 2
origin_tech = "combat=2;materials=2;syndicate=2"
mag_type = "/obj/item/ammo_box/magazine/m10mm"
mag_type = /obj/item/ammo_box/magazine/m10mm
can_suppress = 1
burst_size = 1
fire_delay = 0
action_button_name = null
/obj/item/weapon/gun/projectile/automatic/pistol/isHandgun()
return 1
/obj/item/weapon/gun/projectile/automatic/pistol/update_icon()
..()
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][silenced ? "-suppressed" : ""]"
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
return
/obj/item/weapon/gun/projectile/automatic/pistol/m2411
@@ -24,7 +24,7 @@
icon_state = "m2411"
w_class = 3.0
origin_tech = "combat=3;materials=2"
mag_type = "/obj/item/ammo_box/magazine/m45"
mag_type = /obj/item/ammo_box/magazine/m45
can_suppress = 0
/obj/item/weapon/gun/projectile/automatic/pistol/deagle
@@ -32,7 +32,7 @@
desc = "A robust .50 AE handgun."
icon_state = "deagle"
force = 14.0
mag_type = "/obj/item/ammo_box/magazine/m50"
mag_type = /obj/item/ammo_box/magazine/m50
can_suppress = 0
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/update_icon()
@@ -47,4 +47,16 @@
/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"
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
action_button_name = "Toggle Firemode"

View File

@@ -2,57 +2,80 @@
name = "\improper .357 revolver"
desc = "A suspicious revolver. Uses .357 ammo."
icon_state = "revolver"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder
/obj/item/weapon/gun/projectile/revolver/chamber_round()
if (chambered || !magazine)
return
else if (magazine.ammo_count())
/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/process_chambered()
/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(var/obj/item/A as obj, mob/user as mob, params)
var/num_loaded = 0
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/didload = magazine.give_round(AC)
if(didload)
AM.stored_ammo -= AC
num_loaded++
if(!didload || !magazine.multiload)
break
if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/AC = A
if(magazine.give_round(AC))
user.drop_item()
AC.loc = src
num_loaded++
/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)
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>")
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src].</span>")
A.update_icon()
update_icon()
chamber_round()
chamber_round(0)
/obj/item/weapon/gun/projectile/revolver/attack_self(mob/living/user as mob)
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)
chambered = null
CB.loc = get_turf(src.loc)
CB.SpinAnimation(10, 1)
CB.update_icon()
num_unloaded++
if(CB)
CB.loc = get_turf(src.loc)
CB.SpinAnimation(10, 1)
CB.update_icon()
num_unloaded++
if (num_unloaded)
to_chat(user, "<span class = 'notice'>You unload [num_unloaded] shell\s from [src]!</span>")
to_chat(user, "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>")
else
to_chat(user, "<span class='notice'>[src] is empty.</span>")
to_chat(user, "<span class='warning'>[src] is empty!</span>")
/obj/item/weapon/gun/projectile/revolver/get_ammo(var/countchambered = 0, var/countempties = 1)
/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++
@@ -61,119 +84,66 @@
return boolets
/obj/item/weapon/gun/projectile/revolver/examine(mob/user)
..(user)
..()
to_chat(user, "[get_ammo(0,0)] of those are live rounds.")
/obj/item/weapon/gun/projectile/revolver/verb/spin_revolver()
set name = "Spin cylinder"
set desc = "Fun when you're bored out of your skull."
set category = "Object"
usr.visible_message("<span class='warning'>[usr] spins the chamber of the revolver.</span>", "<span class='warning'>You spin the revolver's chamber.</span>")
playsound(src.loc, 'sound/weapons/revolver_spin.ogg', 100, 1)
Spin()
/obj/item/weapon/gun/projectile/revolver/proc/Spin()
chambered = null
var/random = rand(1, magazine.max_ammo)
if(random <= get_ammo(0,0))
chamber_round()
update_icon()
/obj/item/weapon/gun/projectile/revolver/capgun
name = "cap gun"
desc = "Looks almost like the real thing! Ages 8 and up."
origin_tech = "combat=1;materials=1"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/cap"
/obj/item/weapon/gun/projectile/revolver/detective
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
name = "\improper .38 Mars Special"
icon_state = "detective"
origin_tech = "combat=2;materials=2"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/rev38"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/projectile/revolver/detective/special_check(var/mob/living/carbon/human/M)
if(!ghettomodded)
return 1
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
to_chat(M, "<span class='danger'>[src] blows up in your face!</span>")
M.take_organ_damage(0,20)
M.drop_item()
qdel(src)
return 0
return 1
/obj/item/weapon/gun/projectile/revolver/detective/verb/rename_gun()
set name = "Name Gun"
set category = "Object"
set desc = "Click to rename your gun."
var/mob/M = usr
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))
name = input
to_chat(M, "You name the gun [input]. Say hello to your new friend.")
return 1
/obj/item/weapon/gun/projectile/revolver/detective/verb/reskin_gun()
set name = "Reskin gun"
set category = "Object"
set desc = "Click to reskin your gun."
var/mob/M = usr
var/list/options = list()
/obj/item/weapon/gun/projectile/revolver/detective/New()
..()
options["The Original"] = "detective"
options["Leopard Spots"] = "detective_leopard"
options["Black Panther"] = "detective_panther"
options["Gold Trim"] = "detective_gold"
options["The Peacemaker"] = "detective_peacemaker"
var/choice = input(M,"What do you want to skin the gun to?","Reskin Gun") in options
options["Cancel"] = null
if(src && choice && !M.stat && in_range(M,src))
icon_state = options[choice]
to_chat(M, "Your gun is now skinned as [choice]. Say hello to your new friend.")
return 1
/obj/item/weapon/gun/projectile/revolver/detective/attackby(var/obj/item/A as obj, mob/user as mob, params)
/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)
to_chat(user, "<span class='userdanger'>[src] blows up in your face!</span>")
user.take_organ_damage(0,20)
user.unEquip(src)
return 0
..()
if(istype(A, /obj/item/weapon/screwdriver) || istype(A, /obj/item/weapon/conversion_kit))
/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")
to_chat(user, "<span class='notice'>You begin to reinforce the barrel of [src].</span>")
to_chat(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='danger'>[src] goes off in your face!</span>")
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, target = src))
if(do_after(user, 30/A.toolspeed, target = src))
if(magazine.ammo_count())
to_chat(user, "<span class='notice'>You can't modify it!</span>")
to_chat(user, "<span class='warning'>You can't modify it!</span>")
return
if (istype(A, /obj/item/weapon/conversion_kit))
ghettomodded = 0
else
ghettomodded = 1
magazine.caliber = "357"
desc = "[initial(desc)] The barrel and chamber assembly seems to have been modified."
to_chat(user, "<span class='warning'>You reinforce the barrel of [src]! Now it will fire .357 rounds.</span>")
desc = "The barrel and chamber assembly seems to have been modified."
to_chat(user, "<span class='notice'>You reinforce the barrel of [src]. Now it will fire .357 rounds.</span>")
else
to_chat(user, "<span class='notice'>You begin to revert the modifications to [src].</span>")
to_chat(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='danger'>[src] goes off in your face!</span>")
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, target = src))
if(magazine.ammo_count())
to_chat(user, "<span class='notice'>You can't modify it!</span>")
to_chat(user, "<span class='warning'>You can't modify it!</span>")
return
ghettomodded = 0
magazine.caliber = "38"
desc = initial(desc)
to_chat(user, "<span class='warning'>You remove the modifications on [src]! Now it will fire .38 rounds.</span>")
to_chat(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"
@@ -181,6 +151,21 @@
icon_state = "mateba"
origin_tech = "combat=2;materials=2"
/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
/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.
@@ -188,35 +173,95 @@
name = "\improper Russian Revolver"
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism that spins the chamber before each trigger pull."
origin_tech = "combat=2;materials=2"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/rus357"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357
var/spun = 0
/obj/item/weapon/gun/projectile/revolver/russian/New()
..()
Spin()
update_icon()
/obj/item/weapon/gun/projectile/revolver/russian/attack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj)
/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
if(!chambered && target == user)
user.visible_message("\red *click*", "\red *click*")
return
/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
if(isliving(target) && isliving(user))
if(target == user)
var/obj/item/organ/external/affecting = user.zone_sel.selecting
if(affecting == "head")
var/obj/item/ammo_casing/AC = chambered
if(!process_chambered())
user.visible_message("\red *click*", "\red *click*")
return
if(!in_chamber)
return
var/obj/item/projectile/P = new AC.projectile_type
playsound(user, fire_sound, 50, 1)
user.visible_message("<span class='danger'>[user.name] fires [src] at \his head!</span>", "<span class='danger'>You fire [src] at your head!</span>", "You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
if(!P.nodamage)
user.apply_damage(300, BRUTE, affecting, sharp=1) // You are dead, dead, dead.
/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)
to_chat(user, "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>")
else
to_chat(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))
to_chat(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)
to_chat(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/capgun
name = "cap gun"
desc = "Looks almost like the real thing! Ages 8 and up."
origin_tech = "combat=1;materials=1"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/cap

View File

@@ -10,7 +10,6 @@
force = 5.0
flags = CONDUCT
origin_tech = "combat=8;materials=5"
projectile = /obj/item/missile
var/missile_speed = 2
var/missile_range = 30
var/max_rockets = 1
@@ -18,7 +17,12 @@
/obj/item/weapon/gun/rocketlauncher/examine(mob/user)
if(..(user, 2))
to_chat(user, "\blue [rockets.len] / [max_rockets] rockets.")
to_chat(user, "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>")
/obj/item/weapon/gun/rocketlauncher/Destroy()
for(var/datum/D in rockets)
qdel(D)
rockets = null
/obj/item/weapon/gun/rocketlauncher/attackby(obj/item/I as obj, mob/user as mob, params)
if(istype(I, /obj/item/ammo_casing/rocket))
@@ -26,15 +30,15 @@
user.drop_item()
I.loc = src
rockets += I
to_chat(user, "\blue You put the rocket in [src].")
to_chat(user, "\blue [rockets.len] / [max_rockets] rockets.")
to_chat(user, "<span class='notice'>You put the rocket in [src].</span>")
to_chat(user, "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>")
else
to_chat(usr, "\red [src] cannot hold more rockets.")
to_chat(usr, "<span class='notice'>[src] cannot hold more rockets.</span>")
/obj/item/weapon/gun/rocketlauncher/can_fire()
/obj/item/weapon/gun/rocketlauncher/can_shoot()
return rockets.len
/obj/item/weapon/gun/rocketlauncher/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
/obj/item/weapon/gun/rocketlauncher/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
if(rockets.len)
var/obj/item/ammo_casing/rocket/I = rockets[1]
var/obj/item/missile/M = new projectile(user.loc)
@@ -47,4 +51,4 @@
qdel(I)
return
else
to_chat(usr, "\red [src] is empty.")
to_chat(usr, "<span class='warning'>[src] is empty.</span>")

View File

@@ -0,0 +1,179 @@
/obj/item/weapon/gun/projectile/automatic/l6_saw
name = "\improper L6 SAW"
desc = "A heavily modified 7.62 light machine gun, designated 'L6 SAW'. Has 'Aussec Armoury - 2531' engraved on the reciever below the designation."
icon_state = "l6closed100"
item_state = "l6closedmag"
w_class = 5
slot_flags = 0
origin_tech = "combat=5;materials=1;syndicate=2"
mag_type = /obj/item/ammo_box/magazine/mm556x45
weapon_weight = WEAPON_MEDIUM
fire_sound = 'sound/weapons/Gunshot3.ogg'
var/cover_open = 0
can_suppress = 0
burst_size = 3
fire_delay = 1
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_self(mob/user)
cover_open = !cover_open
to_chat(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)
to_chat(user, "<span class='notice'>[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()
to_chat(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)
to_chat(user, "<span class='warning'>[src]'s cover is closed! You can't insert a new mag.</span>")
return
..()
//ammo//
/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) && istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target
H.drip(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()
//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)]"
/obj/item/ammo_box/magazine/mm556x45/buckshot //adminbus
name = "box magazine (buckshot)"
icon_state = "b762"
caliber = "shotgun"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
max_ammo = 300
/obj/item/ammo_box/magazine/mm556x45/buckshot/update_icon()
..()
icon_state = "b762-[round(ammo_count(),10)]"
/obj/item/ammo_box/magazine/m556x45/he // also adminbus
name = "box magazine (40mm high explosive)"
icon_state = "g762"
caliber = "40mm"
ammo_type =/obj/item/ammo_casing/a40mm
max_ammo = 25
/obj/item/ammo_box/magazine/mm556x45/he/update_icon()
..()
icon_state = "g762-[round(ammo_count(),5)]"
//casings//
/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

View File

@@ -8,26 +8,14 @@
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
mag_type = "/obj/item/ammo_box/magazine/internal/shot"
/obj/item/weapon/gun/projectile/shotgun/attackby(var/obj/item/A as obj, mob/user as mob, params)
var/num_loaded = 0
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/didload = magazine.give_round(AC)
if(didload)
AM.stored_ammo -= AC
num_loaded++
if(!didload || !magazine.multiload)
break
if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/AC = A
if(magazine && magazine.give_round(AC))
user.drop_item()
AC.loc = src
num_loaded++
/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)
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>")
A.update_icon()
@@ -40,8 +28,14 @@
/obj/item/weapon/gun/projectile/shotgun/chamber_round()
return
/obj/item/weapon/gun/projectile/shotgun/attack_self(mob/living/user as mob)
if(recentpump) 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)
@@ -49,7 +43,7 @@
return
/obj/item/weapon/gun/projectile/shotgun/proc/pump(mob/M as mob)
/obj/item/weapon/gun/projectile/shotgun/proc/pump(mob/M)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
pump_unload(M)
pump_reload(M)
@@ -61,36 +55,41 @@
chambered.loc = get_turf(src)//Eject casing
chambered.SpinAnimation(5, 1)
chambered = null
if(in_chamber)
in_chamber = null
/obj/item/weapon/gun/projectile/shotgun/proc/pump_reload(mob/M)
if(!magazine.ammo_count()) return 0
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)
..(user)
..()
if (chambered)
to_chat(user, "A [chambered.BB ? "live" : "spent"] one is in the chamber.")
/obj/item/weapon/gun/projectile/shotgun/isHandgun() //You cannot, in fact, holster a shotgun.
return 0
/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/shotriot"
mag_type = /obj/item/ammo_box/magazine/internal/shotriot
sawn_desc = "Come with me if you want to live."
/obj/item/weapon/gun/projectile/shotgun/riot/attackby(var/obj/item/A as obj, mob/user as mob, params)
/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/melee/energy) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
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 //
@@ -102,7 +101,7 @@
icon_state = "moistnugget"
item_state = "moistnugget"
slot_flags = 0 //no SLOT_BACK sprite, alas
mag_type = "/obj/item/ammo_box/magazine/internal/boltaction"
mag_type = /obj/item/ammo_box/magazine/internal/boltaction
var/bolt_open = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/pump(mob/M)
@@ -115,21 +114,21 @@
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/boltaction/attackby(var/obj/item/A as obj, mob/user as mob)
/obj/item/weapon/gun/projectile/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
if(!bolt_open)
to_chat(user, "<span class='notice'>The bolt is closed!</span>")
return
. = ..()
/obj/item/weapon/gun/projectile/shotgun/boltaction/examine(mob/user)
..(user)
..()
to_chat(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"
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/New()
..()
@@ -137,9 +136,10 @@
pump()
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/dropped()
..()
guns_left = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/Fire(atom/target as mob|obj|turf|area, mob/living/carbon/user as mob|obj, params, reflex = 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
@@ -156,6 +156,7 @@
/obj/item/ammo_box/magazine/internal/boltaction/enchanted
max_ammo =1
ammo_type = /obj/item/ammo_casing/a762/enchanted
/////////////////////////////
// DOUBLE BARRELED SHOTGUN //
@@ -166,22 +167,38 @@
desc = "A true classic."
icon_state = "dshotgun"
item_state = "shotgun"
w_class = 4.0
w_class = 4
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
origin_tech = "combat=3;materials=1"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/dualshot"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/dual
sawn_desc = "Omar's coming!"
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/projectile/revolver/doublebarrel/attackby(var/obj/item/A as obj, mob/user as mob, params)
/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/circular_saw) || istype(A, /obj/item/weapon/melee/energy) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
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 as mob)
/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
@@ -205,14 +222,17 @@
desc = "Essentially a tube that aims shotgun shells."
icon_state = "ishotgun"
item_state = "shotgun"
w_class = 4.0
w_class = 4
force = 10
slot_flags = null
origin_tech = "combat=2;materials=2"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/improvised"
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(var/obj/item/A as obj, mob/user as mob, params)
/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
@@ -220,21 +240,34 @@
slot_flags = SLOT_BACK
icon_state = "ishotgunsling"
to_chat(user, "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>")
slung = 1
update_icon()
else
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling.</span>")
return
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/update_icon()
..()
if (slung && (slot_flags & SLOT_BELT) )
slung = 0
icon_state = "ishotgun-sawn"
// Sawing guns related procs //
/obj/item/weapon/gun/projectile/proc/blow_up(mob/user as mob)
if(get_ammo())
afterattack(user, user)
playsound(user, fire_sound, 50, 1)
user.visible_message("<span class='danger'>The [src] goes off!</span>", "<span class='danger'>The [src] goes off in your face!</span>")
return
/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/gun/projectile/proc/sawoff(mob/user as mob)
/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/proc/sawoff(mob/user)
if(sawn_state == SAWN_OFF)
to_chat(user, "<span class='notice'>\The [src] is already shortened.</span>")
return
@@ -256,7 +289,7 @@
name = "sawn-off [src.name]"
desc = sawn_desc
icon_state = "[icon_state]-sawn"
w_class = 3.0
w_class = 3
item_state = "gun"
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)
@@ -266,56 +299,64 @@
else
sawn_state = SAWN_INTACT
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog
name = "\improper 'Bulldog' Shotgun"
desc = "A compact, mag-fed semi-automatic 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.0
origin_tech = "combat=5;materials=4;syndicate=6"
mag_type = "/obj/item/ammo_box/magazine/m12g"
fire_sound = 'sound/weapons/Gunshot4.ogg'
can_suppress = 0
burst_size = 1
fire_delay = 0
action_button_name = null
// Automatic Shotguns//
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/New()
/obj/item/weapon/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
..()
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/proc/update_magazine()
if(magazine)
overlays.Cut()
overlays += "[magazine.icon_state]"
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/update_icon()
overlays.Cut()
update_magazine()
icon_state = "bulldog[chambered ? "" : "-e"]"
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
..()
empty_alarm()
return
/obj/item/weapon/gun/projectile/shotgun/automatic/Fire(mob/living/user as mob|obj)
..()
pump(user)
// COMBAT SHOTGUN //
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=5;materials=2"
mag_type = "/obj/item/ammo_box/magazine/internal/shotcom"
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)
to_chat(user, "You switch to tube B.")
else
to_chat(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()
/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
//caneshotgun
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/cane
@@ -330,7 +371,7 @@
can_unsuppress = 0
slot_flags = null
origin_tech = "" // NO GIVAWAYS
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/improvised"
mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised
sawn_desc = "I'm sorry, but why did you saw your cane in the first place?"
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
@@ -354,4 +395,4 @@
to_chat(user, "\icon[src] That's [f_name]")
if(desc)
to_chat(user, desc)
to_chat(user, desc)

View File

@@ -5,7 +5,7 @@
item_state = "sniper"
recoil = 2
heavy_weapon = 1
mag_type = "/obj/item/ammo_box/magazine/sniper_rounds"
mag_type = /obj/item/ammo_box/magazine/sniper_rounds
fire_delay = 40
origin_tech = "combat=8"
can_unsuppress = 1
@@ -35,18 +35,18 @@
max_ammo = 6
caliber = ".50"
/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_box/magazine/sniper_rounds/update_icon()
if(ammo_count())
icon_state = "[initial(icon_state)]-ammo"
else
icon_state = "[initial(icon_state)]"
/obj/item/ammo_casing/point50
desc = "A .50 bullet casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper
icon_state = ".50"
/obj/item/projectile/bullet/sniper
damage = 70
stun = 5
@@ -69,8 +69,6 @@
origin_tech = "combat=6;syndicate=3"
ammo_type = /obj/item/ammo_casing/soporific
max_ammo = 3
caliber = ".50"
icon_state = ".50"
/obj/item/ammo_casing/soporific
desc = "A .50 bullet casing, specialised in sending the target to sleep, instead of hell."
@@ -79,10 +77,10 @@
icon_state = ".50"
/obj/item/projectile/bullet/sniper/soporific
armour_penetration = 0
nodamage = 1
stun = 0
weaken = 0
armour_penetration = 0
breakthings = FALSE
/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone)
@@ -102,8 +100,6 @@
origin_tech = "combat=7;syndicate=5"
ammo_type = /obj/item/ammo_casing/haemorrhage
max_ammo = 5
caliber = ".50"
icon_state = ".50"
/obj/item/ammo_casing/haemorrhage
desc = "A .50 bullet casing, specialised in causing massive bloodloss"
@@ -112,16 +108,16 @@
icon_state = ".50"
/obj/item/projectile/bullet/sniper/haemorrhage
armour_penetration = 15
damage = 15
stun = 0
weaken = 0
breakthings = FALSE
armour_penetration = 15
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone)
if((blocked != 100) && istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target
H.drip(1000)
H.drip(100)
return ..()
@@ -145,4 +141,4 @@
forcedodge = 1
stun = 0
weaken = 0
breakthings = FALSE
breakthings = FALSE

View File

@@ -4,7 +4,8 @@
icon = 'icons/obj/toyguns.dmi'
icon_state = "saber"
item_state = "gun"
mag_type = "/obj/item/ammo_box/magazine/toy/smg"
mag_type = /obj/item/ammo_box/magazine/toy/smg
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
force = 0
throwforce = 0
burst_size = 3
@@ -12,15 +13,15 @@
clumsy_check = 0
needs_permit = 0
/obj/item/weapon/gun/projectile/automatic/toy/process_chambered()
return ..(0, 1)
/obj/item/weapon/gun/projectile/automatic/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/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"
mag_type = /obj/item/ammo_box/magazine/toy/pistol
fire_sound = 'sound/weapons/Gunshot.ogg'
can_suppress = 0
burst_size = 1
@@ -34,35 +35,12 @@
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot
name = "foam force riot pistol"
desc = "RIOT! Ages 8 and up."
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/c20r/toy
name = "donksoft SMG"
desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
icon = 'icons/obj/toyguns.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_chambered()
return ..(0, 1)
/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/toyguns.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_chambered()
return ..(0, 1)
/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."
@@ -70,31 +48,52 @@
force = 0
throwforce = 0
origin_tech = null
mag_type = "/obj/item/ammo_box/magazine/internal/shot/toy"
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy
clumsy_check = 0
needs_permit = 0
/obj/item/weapon/gun/projectile/shotgun/toy/pump_unload()
if(chambered)//We have a shell in the chamber
chambered = null
if(in_chamber)
in_chamber = null
/obj/item/weapon/gun/projectile/shotgun/toy/process_chamber()
..()
if(chambered && !chambered.BB)
qdel(chambered)
/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_state = "crossbow"
item_state = "crossbow"
mag_type = "/obj/item/ammo_box/magazine/internal/shot/toy/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/toyguns.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/l6_saw/toy
name = "donksoft LMG"
desc = "A heavily modified toy light machine gun, designated 'L6 SAW'. Ages 8 and up."
icon = 'icons/obj/toyguns.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/shotgun/toy/tommygun
name = "tommy gun"
desc = "Looks almost like the real thing! Great for practicing Drive-bys. Ages 8 and up."
icon = 'icons/obj/gun.dmi'
icon_state = "tommy"
item_state = "shotgun"
mag_type = "/obj/item/ammo_box/magazine/internal/shot/toy/tommygun"
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy/tommygun
w_class = 2

View File

@@ -13,25 +13,41 @@
var/list/syringes = list()
var/max_syringes = 1
/obj/item/weapon/gun/syringe/process_chambered()
if(!syringes.len) return 0
/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 0
if(!S)
return
chambered.BB = new S.projectile_type (src)
in_chamber = new /obj/item/projectile/bullet/dart/syringe(src)
S.reagents.trans_to(in_chamber, S.reagents.total_volume)
in_chamber.name = S.name
chambered.BB.name = S.name
syringes.Remove(S)
qdel(S)
return 1
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)
..()
to_chat(user, "Can hold [max_syringes] syringe\s. Has [syringes.len] syringe\s remaining.")
/obj/item/weapon/gun/syringe/attack_self(mob/living/user as mob)
if(!syringes.len)
to_chat(user, "<span class='notice'>[src] is empty.</span>")
@@ -47,16 +63,17 @@
return 1
/obj/item/weapon/gun/syringe/attackby(var/obj/item/A as obj, mob/user as mob, var/show_msg = 1, params)
/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)
user.drop_item()
if(!user.unEquip(A))
return
to_chat(user, "<span class='notice'>You load [A] into \the [src]!</span>")
syringes.Add(A)
A.forceMove(src)
return 1
else
to_chat(usr, "<span class='notice'>[src] cannot hold more syringes.</span>")
to_chat(user, "<span class='notice'>[src] cannot hold more syringes.</span>")
return 0
/obj/item/weapon/gun/syringe/rapidsyringe
@@ -64,7 +81,7 @@
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."

View File

@@ -1,353 +1,224 @@
/*
#define BRUTE "brute"
#define BURN "burn"
#define TOX "tox"
#define OXY "oxy"
#define CLONE "clone"
#define ADD "add"
#define SET "set"
*/
/obj/item/projectile
name = "projectile"
icon = 'icons/obj/projectiles.dmi'
icon_state = "bullet"
density = 1
density = 0
unacidable = 1
anchored = 1 //There's a reason this is here, Mport. God fucking damn it -Agouri. Find&Fix by Pete. The reason this is here is to stop the curving of emitter shots.
flags = ABSTRACT
pass_flags = PASSTABLE
mouse_opacity = 0
hitsound = 'sound/weapons/pierce.ogg'
animate_movement = 0
var/bumped = 0 //Prevents it from hitting more than one guy at once
var/hitsound_wall = ""
pressure_resistance = INFINITY
var/def_zone = "" //Aiming at
var/mob/firer = null//Who shot it
var/silenced = 0 //Attack message
var/obj/item/ammo_casing/ammo_casing = null
var/suppressed = 0 //Attack message
var/yo = null
var/xo = null
var/current = null
var/obj/shot_from = null // the object which shot us
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
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 //Cael - bio and rad are also valid
var/projectile_type = "/obj/item/projectile"
var/kill_count = 50 //This will de-increment every process(). When 0, it will delete the projectile.
//Effects
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/slur = 0
var/stutter = 0
var/slur = 0
var/eyeblur = 0
var/drowsy = 0
var/stamina = 0
var/jitter = 0
var/embed = 0 // whether or not the projectile can embed itself in the mob
var/forcedodge = 0
var/forcedodge = 0 //to pass through everything
var/range = 0
var/proj_hit = 0
/obj/item/projectile/New()
permutated = list()
return ..()
var/chatlog_attacks = 1
/obj/item/projectile/proc/Range()
range--
if(range <= 0 && loc)
on_range()
var/speed = 1 //Amount of deciseconds it takes for projectile to travel. Animation is adjusted accordingly.
var/Angle = 0 //For new projectiles
var/spread = 0 //Amount of degrees by which the projectiles will be spread DURING MOVEMENT. It exists for chaotic types of projectiles, like bees or something.
var/legacy = 0 //Use the legacy projectile system or new pixel movement?
/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
qdel(src)
proc/delete()
// Garbage collect the projectiles
loc = null
proc/Range()
if(range)
range--
if(range <= 0)
on_range()
else
return
proc/on_range() //if we want there to be effects when they reach the end of their range
proj_hit = 1
del(src)
proc/on_hit(var/atom/target, var/blocked = 0, var/hit_zone)
if(!isliving(target)) return 0
if(isanimal(target)) return 0
var/mob/living/L = target
return L.apply_effects(stun, weaken, paralyze, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter)
proc/OnFired() //if assigned, allows for code when the projectile gets fired
return 1
proc/check_fire(var/mob/living/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not.
if(!istype(target) || !istype(user))
return 0
var/obj/item/projectile/test/in_chamber = new /obj/item/projectile/test(get_step_to(user,target)) //Making the test....
in_chamber.target = target
in_chamber.flags = flags //Set the flags...
in_chamber.pass_flags = pass_flags //And the pass flags to that of the real projectile...
in_chamber.firer = user
var/output = in_chamber.process() //Test it!
del(in_chamber) //No need for it anymore
return output //Send it back to the gun!
Bump(atom/A as mob|obj|turf|area)
if(A == firer)
loc = A.loc
return 0 //cannot shoot yourself
if(bumped)
return 1
bumped = 1
if(firer && istype(A, /mob))
var/mob/M = A
if(!istype(A, /mob/living))
loc = A.loc
return 0// nope.avi
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) + ") "
//Lower accurancy/longer range tradeoff. Distance matters a lot here, so at
// close distance, actually RAISE the chance to hit.
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(!def_zone)
visible_message("\blue \The [src] misses [M] narrowly!")
forcedodge = -1
else
*/
if(ishuman(A))
var/mob/living/carbon/human/H = A
var/obj/item/organ/external/organ = H.get_organ(check_zone(def_zone))
if(isnull(organ))
return
if(silenced)
playsound(loc, hitsound, 5, 1, -1)
to_chat(M, "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!")
else
playsound(loc, hitsound, 20, 1, -1)
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
if(istype(firer, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[key_name(firer)]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>[reagent_note]"
firer.attack_log += "\[[time_stamp()]\] <b>[key_name(firer)]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>[reagent_note]"
if(M.ckey && chatlog_attacks)
msg_admin_attack("[key_name_admin(firer)] shot [key_name_admin(M)] with a [src][reagent_note]") //BS12 EDIT ALG
if(!iscarbon(firer))
M.LAssailant = null
else
M.LAssailant = firer
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[key_name(M)]</b> with a <b>[src]</b>[reagent_note]"
if(M.ckey && chatlog_attacks)
msg_admin_attack("UNKNOWN shot [key_name_admin(M)] with a [src][reagent_note] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
spawn(0)
if(A)
var/turf/new_loc = 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!
spawn(1)
bumped = 0 // reset bumped variable... after a delay. We don't want the projectile to hit AGAIN. Fixes deflecting projectiles.
loc = new_loc
permutated.Add(A)
return 0
if(istype(A,/turf))
for(var/obj/O in A)
O.bullet_act(src)
for(var/mob/M in A)
M.bullet_act(src, def_zone)
if(!istype(src, /obj/item/projectile/beam/lightning))
density = 0
invisibility = 101
del(src)
return 1
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover, /obj/item/projectile))
return prob(95)
else
return 1
Process_Spacemove(var/movement_dir = 0)
return 1 //Bullets don't drift in space
process(var/setAngle)
if(setAngle) Angle = setAngle
if(!legacy)
spawn() //New projectile system
while(loc)
if(kill_count < 1)
del(src)
return
if(!paused)
kill_count--
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))
// to_chat(world, "[Angle] angle")
//overlays.Cut()
//var/icon/I=new(initial(icon),icon_state) //using initial(icon) makes sure that the angle for that is reset as well
//I.Turn(Angle)
//I.DrawBox(rgb(255,0,0,50),1,1,32,32)
//icon = I
if(spread) //Chaotic spread
Angle += (rand() - 0.5) * spread
var/matrix/M = new//matrix(transform)
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
//Not sure if using whiles for this is good
while(pixel_x_offset > 16)
// to_chat(world, "Pre-adjust coords (x++): xy [pixel_x] xy offset [pixel_x_offset]")
pixel_x_offset -= 32
pixel_x -= 32
new_x++// x++
while(pixel_x_offset < -16)
// to_chat(world, "Pre-adjust coords (x--): xy [pixel_x] xy offset [pixel_x_offset]")
pixel_x_offset += 32
pixel_x += 32
new_x--
while(pixel_y_offset > 16)
// to_chat(world, "Pre-adjust coords (y++): py [pixel_y] py offset [pixel_y_offset]")
pixel_y_offset -= 32
pixel_y -= 32
new_y++
while(pixel_y_offset < -16)
// to_chat(world, "Pre-adjust coords (y--): py [pixel_y] py offset [pixel_y_offset]")
pixel_y_offset += 32
pixel_y += 32
new_y--
speed = round(speed) //Just in case.
step_towards(src, locate(new_x, new_y, z)) //Original projectiles stepped towards 'current'
if(speed <= 1) //We should really only animate at speed 2
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)))
/*
var/turf/T = get_turf(src)
if(T)
T.color = "#6666FF"
spawn(10)
T.color = initial(T.color)
*/
if(!bumped && ((original && original.layer>=2.75) || ismob(original)))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
Range()
sleep(max(1, speed))
else
spawn() //Old projectile system
while(loc)
if(kill_count < 1)
del(src)
return
if(!paused)
kill_count--
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))
var/matrix/M = new//matrix(transform)
M.Turn(Angle)
transform = M //So there's no need to give icons directions again
step_towards(src, current)
if(!bumped && ((original && original.layer>=2.75) || ismob(original)))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
Range()
sleep(1)
proc/dumbfire(var/dir)
current = get_ranged_target_turf(src, dir, world.maxx) //world.maxx is the range. Not sure how to handle this better.
process()
/obj/item/projectile/test //Used to see if you can hit them.
invisibility = 101 //Nope! Can't see me!
yo = null
xo = null
var/target = null
var/result = 0 //To pass the message back to the gun.
Bump(atom/A as mob|obj|turf|area)
if(A == firer)
loc = A.loc
return //cannot shoot yourself
if(istype(A, /obj/item/projectile))
return
if(istype(A, /mob/living) || istype(A, /obj/mecha) || istype(A, /obj/spacepod) || istype(A, /obj/vehicle))
result = 2 //We hit someone, return 1!
return
result = 1
return
process()
var/turf/curloc = get_turf(src)
var/turf/targloc = get_turf(target)
if(!curloc || !targloc)
return 0
yo = targloc.y - curloc.y
xo = targloc.x - curloc.x
target = targloc
while(src) //Loop on through!
if(result)
return (result - 1)
if((!( target ) || loc == target))
target = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z) //Finding the target turf at map edge
step_towards(src, target)
var/mob/living/M = locate() in get_turf(src)
if(istype(M)) //If there is someting living...
return 1 //Return 1
else
M = locate() in get_step(src,target)
if(istype(M))
return 1
/proc/check_trajectory(atom/target as mob|obj, atom/firer as mob|obj, var/pass_flags=PASSTABLE|PASSGLASS|PASSGRILLE, flags=null) //Checks if you can hit them or not.
if(!istype(target) || !istype(firer))
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0, hit_zone)
if(!isliving(target))
return 0
var/obj/item/projectile/test/trace = new /obj/item/projectile/test(get_turf(firer)) //Making the test....
trace.target = target
if(!isnull(flags))
trace.flags = flags //Set the flags...
trace.pass_flags = pass_flags //And the pass flags to that of the real projectile...
var/output = trace.process() //Test it!
qdel(trace) //No need for it anymore
return output //Send it back to the gun!
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)
to_chat(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(L, firer, "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(ishuman(A))
var/mob/living/carbon/human/H = A
var/obj/item/organ/external/organ = H.get_organ(check_zone(def_zone))
if(isnull(organ))
return
else 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) //world.maxx is the range. Not sure how to handle this better.
fire()

View File

@@ -5,50 +5,27 @@
damage = 20
damage_type = BURN
hitsound = 'sound/weapons/sear.ogg'
hitsound_wall = 'sound/weapons/effects/searwall.ogg'
flag = "laser"
eyeblur = 2
/obj/item/projectile/practice
name = "laser"
icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
/obj/item/projectile/beam/laser
/obj/item/projectile/beam/laser/heavylaser
name = "heavy laser"
icon_state = "heavylaser"
damage = 40
/obj/item/projectile/beam/practice
name = "practice laser"
damage = 0
hitsound = null
damage_type = BURN
flag = "laser"
eyeblur = 2
chatlog_attacks = 0
nodamage = 1
/obj/item/projectile/beam/scatter
name = "laser pellet"
icon_state = "scatterlaser"
damage = 5
/obj/item/projectile/beam/heavylaser
name = "heavy laser"
icon_state = "heavylaser"
damage = 40
/obj/item/projectile/beam/sniper
name = "sniper beam"
icon_state = "sniperlaser"
damage = 60
stun = 5
weaken = 5
stutter = 5
/obj/item/projectile/beam/immolator
name = "immolation beam"
/obj/item/projectile/beam/immolator/on_hit(var/atom/target, var/blocked = 0)
. = ..()
if(istype(target, /mob/living/carbon))
var/mob/living/carbon/M = target
M.adjust_fire_stacks(1)
M.IgniteMob()
/obj/item/projectile/beam/xray
name = "xray beam"
icon_state = "xray"
@@ -82,41 +59,80 @@
name = "emitter beam"
icon_state = "emitter"
damage = 30
legacy = 1
animate_movement = SLIDE_STEPS
/obj/item/projectile/beam/emitter/singularity_pull()
return //don't want the emitters to miss
/obj/item/projectile/lasertag
/obj/item/projectile/beam/lasertag
name = "laser tag beam"
icon_state = "omnilaser"
hitsound = null
damage = 0
damage_type = STAMINA
flag = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
var/suit_types = list(/obj/item/clothing/suit/redtag, /obj/item/clothing/suit/bluetag)
chatlog_attacks = 0
/obj/item/projectile/lasertag/on_hit(var/atom/target, var/blocked = 0)
if(istype(target, /mob/living/carbon/human))
/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)
return 1
/obj/item/projectile/lasertag/omni
/obj/item/projectile/beam/lasertag/omni
name = "laser tag beam"
icon_state = "omnilaser"
/obj/item/projectile/lasertag/red
/obj/item/projectile/beam/lasertag/red
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
/obj/item/projectile/lasertag/blue
/obj/item/projectile/beam/lasertag/blue
icon_state = "bluelaser"
suit_types = list(/obj/item/clothing/suit/redtag)
/obj/item/projectile/beam/sniper
name = "sniper beam"
icon_state = "sniperlaser"
damage = 60
stun = 5
weaken = 5
stutter = 5
/obj/item/projectile/beam/immolator
name = "immolation beam"
/obj/item/projectile/beam/immolator/on_hit(var/atom/target, var/blocked = 0)
. = ..()
if(istype(target, /mob/living/carbon))
var/mob/living/carbon/M = target
M.adjust_fire_stacks(1)
M.IgniteMob()
/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()
/* //THIS CODE MAKES ME WANT TO STAB MY EYES OUT
/obj/item/projectile/beam/lightning
invisibility = 101
name = "lightning"
@@ -133,12 +149,12 @@
kill_count = 6
var/bullet_acted = 0
Bump(var/atom/A)
/obj/item/projectile/beam/lightning/Bump(var/atom/A)
if((A != firer) && !bullet_acted)
A.bullet_act(src)
bullet_acted = 1
proc/adjustAngle(angle)
/obj/item/projectile/beam/lightning/proc/adjustAngle(angle)
angle = round(angle) + 45
if(angle > 180)
angle -= 180
@@ -146,14 +162,9 @@
angle += 180
if(!angle)
angle = 1
/*if(angle < 0)
//angle = (round(abs(get_angle(A, user))) + 45) - 90
angle = round(angle) + 45 + 180
else
angle = round(angle) + 45*/
return angle
process()
/obj/item/projectile/beam/lightning/process()
var/first = 1 //So we don't make the overlay in the same tile as the firer
var/broke = 0
var/broken
@@ -239,16 +250,11 @@
f.break_tile()
f.hotspot_expose(1000,CELL_VOLUME)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
// to_chat(world, "deleting")
//qdel(src) //Delete if it passes the world edge
broken = 1
return
if(kill_count < 1)
// to_chat(world, "deleting")
//qdel(src)
broken = 1
kill_count--
// to_chat(world, "[x] [y]")
if(!bumped && !isturf(original))
if(loc == get_turf(original))
if(!(original in permutated))
@@ -263,7 +269,6 @@
Bump(original)
first = 0
if(broken)
// to_chat(world, "breaking")
break
else
last = get_turf(src.loc)
@@ -273,13 +278,9 @@
icon_state = "[tang]"
qdel(src)
return
/*cleanup(reference) //Waits .3 seconds then removes the overlay.
// to_chat(world, "setting invisibility")
sleep(50)
src.invisibility = 101
return*/
on_hit(atom/target, blocked = 0)
/obj/item/projectile/beam/lightning/on_hit(atom/target, blocked = 0)
if(istype(target, /mob/living))
var/mob/living/M = target
M.playsound_local(src, "explosion", 50, 1)
..()
..()
*/

View File

@@ -3,21 +3,10 @@
icon_state = "bullet"
damage = 60
damage_type = BRUTE
nodamage = 0
flag = "bullet"
embed = 1
sharp = 1
/obj/item/projectile/bullet/cap
name = "cap"
damage = 0
nodamage = 1
embed = 0
sharp = 0
/obj/item/projectile/bullet/cap/process()
loc = null
del(src)
hitsound_wall = "ricochet"
/obj/item/projectile/bullet/weakbullet //beanbag, heavy stamina damage
damage = 5
@@ -27,6 +16,26 @@
embed = 0
sharp = 0
/obj/item/projectile/bullet/weakbullet/booze
embed = 0
/obj/item/projectile/bullet/weakbullet/booze/on_hit(atom/target, blocked = 0)
if(..(target, blocked))
var/mob/living/M = target
M.dizziness += 20
M.slurring += 20
M.confused += 20
M.eye_blurry += 20
M.drowsyness += 20
for(var/datum/reagent/ethanol/A in M.reagents.reagent_list)
M.AdjustParalysis(2)
M.dizziness += 10
M.slurring += 10
M.confused += 10
M.eye_blurry += 10
M.drowsyness += 10
A.volume += 5 //Because we can
/obj/item/projectile/bullet/weakbullet2 //detective revolver instastuns, but multiple shots are better for keeping punks down
damage = 5
weaken = 3
@@ -44,6 +53,15 @@
damage = 15
damage_type = TOX
/obj/item/projectile/bullet/incendiary
/obj/item/projectile/bullet/incendiary/on_hit(var/atom/target, var/blocked = 0)
..()
if(istype(target, /mob/living/carbon))
var/mob/living/carbon/M = target
M.adjust_fire_stacks(1)
M.IgniteMob()
/obj/item/projectile/bullet/incendiary/firebullet
damage = 10
@@ -55,15 +73,34 @@
name = "pellet"
damage = 15
/obj/item/projectile/bullet/blank
name = "blankshot"
nodamage = 1
/obj/item/projectile/bullet/pellet/weak
damage = 6
/obj/item/projectile/bullet/pellet/weak/New()
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
damage = 3
/obj/item/projectile/bullet/pellet/random/New()
damage = rand(10)
/obj/item/projectile/bullet/pellet/overload/New()
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
@@ -89,39 +126,11 @@
weaken = 5
stutter = 5
jitter = 20
icon_state = "spark"
range = 7
embed = 0
sharp = 0
/obj/item/projectile/bullet/weakbullet/booze
embed = 0
on_hit(var/atom/target, var/blocked = 0)
if(..(target, blocked))
var/mob/living/M = target
M.dizziness += 20
M.slurring += 20
M.confused += 20
M.eye_blurry += 20
M.drowsyness += 20
for(var/datum/reagent/ethanol/A in M.reagents.reagent_list)
M.AdjustParalysis(2)
M.dizziness += 10
M.slurring += 10
M.confused += 10
M.eye_blurry += 10
M.drowsyness += 10
A.volume += 5 //Because we can
/obj/item/projectile/bullet/incendiary
/obj/item/projectile/bullet/incendiary/on_hit(var/atom/target, var/blocked = 0)
..()
if(istype(target, /mob/living/carbon))
var/mob/living/carbon/M = target
M.adjust_fire_stacks(1)
M.IgniteMob()
icon_state = "spark"
color = "#FFFF00"
/obj/item/projectile/bullet/incendiary/shell
name = "incendiary slug"
@@ -130,8 +139,9 @@
/obj/item/projectile/bullet/incendiary/shell/Move()
..()
var/turf/location = get_turf(src)
new /obj/effect/hotspot(location)
location.hotspot_expose(700, 50, 1)
if(location)
new /obj/effect/hotspot(location)
location.hotspot_expose(700, 50, 1)
/obj/item/projectile/bullet/incendiary/shell/dragonsbreath
name = "dragonsbreath round"
@@ -157,7 +167,25 @@
..()
SpinAnimation()
/obj/item/projectile/bullet/meteorshot/weak
damage = 10
weaken = 4
stun = 4
/obj/item/projectile/bullet/honker
damage = 0
weaken = 5
stun = 5
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/mime
damage = 0
@@ -168,7 +196,7 @@
/obj/item/projectile/bullet/mime/on_hit(var/atom/target, var/blocked = 0)
..(target, blocked)
if(istype(target, /mob/living/carbon))
if(iscarbon(target))
var/mob/living/carbon/M = target
M.silent = max(M.silent, 10)
else if(istype(target, /obj/mecha/combat/honker))
@@ -184,32 +212,38 @@
damage = 6
embed = 0
sharp = 0
var/piercing = 0
New()
..()
flags |= NOREACT
create_reagents(50)
/obj/item/projectile/bullet/dart/New()
..()
flags |= NOREACT
create_reagents(50)
on_hit(var/atom/target, var/blocked = 0, var/hit_zone)
if(istype(target, /mob/living/carbon))
var/mob/living/carbon/M = target
/obj/item/projectile/bullet/dart/on_hit(var/atom/target, var/blocked = 0, var/hit_zone)
if(iscarbon(target))
var/mob/living/carbon/M = target
if(blocked != 100)
if(M.can_inject(null,0,hit_zone)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
reagents.reaction(M, INGEST)
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>")
flags &= ~NOREACT
reagents.handle_reactions()
return 1
"<span class='userdanger'>You were protected against the [name]!</span>")
..(target, blocked, hit_zone)
flags &= ~NOREACT
reagents.handle_reactions()
return 1
/obj/item/projectile/bullet/dart/metalfoam
New()
..()
reagents.add_reagent("aluminum", 15)
reagents.add_reagent("fluorosurfactant", 5)
reagents.add_reagent("sacid", 5)
/obj/item/projectile/bullet/dart/metalfoam/New()
..()
reagents.add_reagent("aluminum", 15)
reagents.add_reagent("fluorosurfactant", 5)
reagents.add_reagent("sacid", 5)
//This one is for future syringe guns update
/obj/item/projectile/bullet/dart/syringe
@@ -218,9 +252,9 @@
icon_state = "syringeproj"
/obj/item/projectile/bullet/dart/syringe/tranquilizer
New()
..()
reagents.add_reagent("haloperidol", 15)
/obj/item/projectile/bullet/dart/syringe/tranquilizer/New()
..()
reagents.add_reagent("haloperidol", 15)
/obj/item/projectile/bullet/neurotoxin
name = "neurotoxin spit"
@@ -231,5 +265,17 @@
/obj/item/projectile/bullet/neurotoxin/on_hit(var/atom/target, var/blocked = 0)
if(isalien(target))
return 0
..() // Execute the rest of the code.
weaken = 0
nodamage = 1
. = ..() // Execute the rest of the code.
/obj/item/projectile/bullet/cap
name = "cap"
damage = 0
nodamage = 1
embed = 0
sharp = 0
/obj/item/projectile/bullet/cap/fire()
loc = null
qdel(src)

View File

@@ -5,7 +5,6 @@
damage_type = BURN
flag = "energy"
/obj/item/projectile/energy/electrode
name = "electrode"
icon_state = "spark"
@@ -20,26 +19,23 @@
//Damage will be handled on the MOB side, to prevent window shattering.
/obj/item/projectile/energy/electrode/on_hit(var/atom/target, var/blocked = 0)
if(!proj_hit)
if(!ismob(target) || blocked >= 2) //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()
proj_hit = 1
else if(iscarbon(target))
var/mob/living/carbon/C = target
if(HULK in C.mutations)
C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
else if(C.status_flags & CANWEAKEN)
C.do_jitter_animation(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
if(!proj_hit)
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread
. = ..()
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()
proj_hit = 1
else if(iscarbon(target))
var/mob/living/carbon/C = target
if(HULK in C.mutations)
C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
else if(C.status_flags & CANWEAKEN)
spawn(5)
C.do_jitter_animation(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/declone
@@ -49,7 +45,6 @@
damage_type = CLONE
irradiate = 10
/obj/item/projectile/energy/dart
name = "dart"
icon_state = "toxin"
@@ -63,7 +58,6 @@
icon_state = "toxin"
damage = 10
damage_type = TOX
nodamage = 0
weaken = 5
stutter = 5
@@ -77,12 +71,28 @@
stutter = 5
/obj/item/projectile/energy/bolt/large
name = "largebolt"
damage = 20
/obj/item/projectile/energy/plasma
/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)
/obj/item/projectile/energy/toxplasma
name = "plasma bolt"
icon_state = "energy"
damage = 20
damage_type = TOX
irradiate = 20
irradiate = 20

View File

@@ -10,21 +10,8 @@
name = "force bolt"
/obj/item/projectile/forcebolt/on_hit(var/atom/target, var/blocked = 0)
var/obj/T = target
var/throwdir = get_dir(firer,target)
T.throw_at(get_edge_target_turf(target, throwdir),10,10)
return 1
/*
/obj/item/projectile/forcebolt/strong/on_hit(var/atom/target, var/blocked = 0)
// NONE OF THIS WORKS. DO NOT USE.
var/throwdir = null
for(var/mob/M in hearers(2, src))
if(M.loc != src.loc)
throwdir = get_dir(src,target)
M.throw_at(get_edge_target_turf(M, throwdir),15,1)
return ..()
*/
. = ..()
if(blocked < 100)
var/obj/T = target
var/throwdir = get_dir(firer,target)
T.throw_at(get_edge_target_turf(target, throwdir),10,10)

View File

@@ -4,15 +4,14 @@
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"
damage = 9001
damage_type = OXY
nodamage = 0
flag = "magic"
damage_type = BURN //OXY does not kill IPCs
damage = 50000
/obj/item/projectile/magic/fireball
name = "bolt of fireball"
@@ -20,9 +19,22 @@
damage = 10
damage_type = BRUTE
nodamage = 0
flag = "magic"
/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(var/target)
. = ..()
var/turf/T = get_turf(target)
explosion(T, -1, 0, 2, 3, 0, flame_range = 2)
if(ismob(target)) //multiple flavors of pain
@@ -32,35 +44,13 @@
/obj/item/projectile/magic/resurrection
name = "bolt of resurrection"
icon_state = "ion"
damage = 0
damage_type = OXY
nodamage = 1
flag = "magic"
/obj/item/projectile/magic/resurrection/on_hit(var/mob/living/carbon/target)
if(istype(target,/mob))
var/old_stat = target.stat
if(isanimal(target) && target.stat == DEAD)
var/mob/living/simple_animal/O = target
var/mob/living/simple_animal/A = new O.type(O.loc)
A.real_name = O.real_name
A.name = O.name
if(iscorgi(O))
var/mob/living/simple_animal/pet/corgi/C = O
if(C.inventory_head)
C.inventory_head.loc = C.loc
if(C.inventory_back)
C.inventory_back.loc = C.loc
if(O.mind)
O.mind.transfer_to(A)
else
A.key = O.key
qdel(O)
target = A
else
target.revive()
target.suiciding = 0
. = ..()
if(ismob(target))
var/old_stat = stat
target.suiciding = 0
target.revive()
if(!target.ckey)
for(var/mob/dead/observer/ghost in player_list)
if(target.real_name == ghost.real_name)
@@ -74,14 +64,11 @@
/obj/item/projectile/magic/teleport
name = "bolt of teleportation"
icon_state = "bluespace"
damage = 0
damage_type = OXY
nodamage = 1
flag = "magic"
var/inner_tele_radius = 0
var/outer_tele_radius = 6
/obj/item/projectile/magic/teleport/on_hit(var/mob/target)
. = ..()
var/teleammount = 0
var/teleloc = target
if(!isturf(target))
@@ -97,37 +84,40 @@
/obj/item/projectile/magic/door
name = "bolt of door creation"
icon_state = "energy"
damage = 0
damage_type = OXY
nodamage = 1
flag = "magic"
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(var/atom/target)
. = ..()
var/atom/T = target.loc
if(isturf(target))
if(target.density)
new /obj/structure/mineral_door/wood(target)
target:ChangeTurf(/turf/simulated/floor/plating)
else if (isturf(T))
if(T.density)
new /obj/structure/mineral_door/wood(T)
T:ChangeTurf(/turf/simulated/floor/plating)
if(isturf(target) && target.density)
CreateDoor(target)
else if (isturf(T) && T.density)
CreateDoor(T
else if(istype(target, /obj/machinery/door))
OpenDoor(target))
/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/change
name = "bolt of change"
icon_state = "ice_1"
damage = 0
damage_type = BURN
nodamage = 1
flag = "magic"
/obj/item/projectile/magic/change/on_hit(var/atom/change)
. = ..()
wabbajack(change)
proc/wabbajack(mob/living/M)
if(istype(M))
if(istype(M, /mob/living) && M.stat != DEAD)
if(M.notransform) return
if(M.notransform)
return
M.notransform = 1
M.canmove = 0
M.icon = null
@@ -136,7 +126,9 @@ proc/wabbajack(mob/living/M)
if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi) qdel(Robot.mmi)
if(Robot.mmi)
qdel(Robot.mmi)
Robot.notify_ai(1)
else
if(ishuman(M))
var/mob/living/carbon/human/H = M
@@ -146,7 +138,8 @@ proc/wabbajack(mob/living/M)
for(var/i in H.internal_organs)
qdel(i)
for(var/obj/item/W in M)
M.unEquip(W)
M.unEquip(W, 1)
qdel(W)
var/mob/living/new_mob
@@ -166,8 +159,6 @@ proc/wabbajack(mob/living/M)
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
if("slime")
new_mob = new /mob/living/carbon/slime(M.loc)
/* if(prob(50))
new_mob.is_adult = 1*/
new_mob.universal_speak = 1
if("xeno")
if(prob(50))
@@ -175,14 +166,6 @@ proc/wabbajack(mob/living/M)
else
new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc)
new_mob.universal_speak = 1
/*var/alien_caste = pick("Hunter","Sentinel","Drone","Larva")
switch(alien_caste)
if("Hunter") new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc)
if("Sentinel") new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc)
if("Drone") new_mob = new /mob/living/carbon/alien/humanoid/drone(M.loc)
else new_mob = new /mob/living/carbon/alien/larva(M.loc)
new_mob.universal_speak = 1*/
if("animal")
if(prob(50))
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat", "tomato")
@@ -225,7 +208,6 @@ proc/wabbajack(mob/living/M)
randomize = picked_species
var/datum/preferences/A = new() //Randomize appearance for the human
A.copy_to(new_mob)
else
return
@@ -246,13 +228,10 @@ proc/wabbajack(mob/living/M)
/obj/item/projectile/magic/animate
name = "bolt of animation"
icon_state = "red_1"
damage = 0
damage_type = BURN
nodamage = 1
flag = "magic"
/obj/item/projectile/magic/animate/Bump(var/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)
@@ -273,4 +252,4 @@ proc/wabbajack(mob/living/M)
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)
C.ChangeOwner(firer)

View File

@@ -1,42 +1,63 @@
/obj/item/projectile/bullet/reusable
name = "reusable bullet"
desc = "How do you even reuse a bullet?"
var/obj/item/ammo_casing/caseless/ammo_type = /obj/item/ammo_casing/caseless/
var/hit = 0
ammo_type = /obj/item/ammo_casing/caseless/
var/dropped = 0
/obj/item/projectile/bullet/reusable/on_hit(var/atom/target, var/blocked = 0)
if(!proj_hit)
proj_hit = 1
if (src.contents.len)
var/obj/content
for(content in src.contents)
content.loc = src.loc
else
new ammo_type(src.loc)
..()
/obj/item/projectile/bullet/reusable/on_hit(atom/target, blocked = 0)
. = ..()
handle_drop()
/obj/item/projectile/bullet/reusable/on_range()
if(!proj_hit)
if (src.contents.len)
var/obj/content
for(content in src.contents)
content.loc = src.loc
else
new ammo_type(src.loc)
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
edge = 0
embed = 0
icon = 'icons/obj/toyguns.dmi'
icon_state = "foamdart"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
range = 10
range = 10
var/obj/item/weapon/pen/pen = null
edge = 0
embed = 0
/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"

View File

@@ -6,15 +6,15 @@
nodamage = 1
flag = "energy"
on_hit(var/atom/target, var/blocked = 0)
empulse(target, 1, 1)
return 1
/obj/item/projectile/ion/on_hit(var/atom/target, var/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
@@ -26,9 +26,10 @@
sharp = 1
edge = 1
on_hit(var/atom/target, var/blocked = 0)
explosion(target, -1, 0, 2)
return 1
/obj/item/projectile/bullet/gyro/on_hit(var/atom/target, var/blocked = 0)
..()
explosion(target, -1, 0, 2)
return 1
/obj/item/projectile/bullet/a40mm
name ="40mm grenade"
@@ -43,18 +44,17 @@
return 1
/obj/item/projectile/temp
name = "freeze beam"
name = "temperature beam"
icon_state = "temp_4"
damage = 0
damage_type = BURN
nodamage = 1
flag = "energy"
var/temperature = 300
var/obj/item/weapon/gun/energy/temperature/T = null
var/temperature = null
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
OnFired()
T = shot_from
temperature = T.temperature
/obj/item/projectile/temp/New()
spawn(1)
switch(temperature)
if(501 to INFINITY)
name = "searing beam" //if emagged
@@ -86,17 +86,19 @@
else
name = "temperature beam"//failsafe
icon_state = "temp_4"
..()
on_hit(var/atom/target, var/blocked = 0)//These two could likely check temp protection on the mob
if(istype(target, /mob/living))
var/mob/living/M = target
M.bodytemperature = temperature
if(temperature > 500)//emagged
M.adjust_fire_stacks(0.5)
M.IgniteMob()
playsound(M.loc, 'sound/effects/bamf.ogg', 50, 0)
return 1
/obj/item/projectile/temp/on_hit(var/atom/target, var/blocked = 0)//These two could likely check temp protection on the mob
..()
if(isliving(target))
var/mob/living/M = target
M.bodytemperature = temperature
if(temperature > 500)//emagged
M.adjust_fire_stacks(0.5)
M.IgniteMob()
playsound(M.loc, 'sound/effects/bamf.ogg', 50, 0)
return 1
/obj/item/projectile/meteor
name = "meteor"
@@ -107,26 +109,17 @@
nodamage = 1
flag = "bullet"
Bump(atom/A as mob|obj|turf|area)
if(A == firer)
loc = A.loc
return
sleep(-1) //Might not be important enough for a sleep(-1) but the sleep/spawn itself is necessary thanks to explosions and metoerhits
if(src)//Do not add to this if() statement, otherwise the meteor won't delete them
if(A)
A.ex_act(2)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))\
shake_camera(M, 3, 1)
qdel(src)
return 1
else
return 0
/obj/item/projectile/meteor/Bump(atom/A, yes)
if(yes)
return
if(A == firer)
loc = A.loc
return
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"
@@ -136,36 +129,31 @@
nodamage = 1
flag = "energy"
on_hit(var/atom/target, var/blocked = 0)
var/mob/living/M = target
if(ishuman(target))
var/mob/living/carbon/human/H = M
if((H.species.flags & IS_PLANT) && (M.nutrition < 500))
if(prob(15))
M.apply_effect((rand(30,80)),IRRADIATE)
M.Weaken(5)
for (var/mob/V in viewers(src))
V.show_message("\red [M] writhes in pain as \his vacuoles boil.", 3, "\red You hear the crunching of leaves.", 2)
if(prob(35))
// for (var/mob/V in viewers(src)) //Public messages commented out to prevent possible metaish genetics experimentation and stuff. - Cheridan
// V.show_message("\red [M] is mutated by the radiation beam.", 3, "\red You hear the snapping of twigs.", 2)
if(prob(80))
randmutb(M)
domutcheck(M,null)
else
randmutg(M)
domutcheck(M,null)
/obj/item/projectile/energy/floramut/on_hit(var/atom/target, var/blocked = 0)
..()
var/mob/living/M = target
if(ishuman(target))
var/mob/living/carbon/human/H = M
if((H.species.flags & IS_PLANT) && (M.nutrition < 500))
if(prob(15))
M.apply_effect((rand(30,80)),IRRADIATE)
M.Weaken(5)
for (var/mob/V in viewers(src))
V.show_message("<span class='warning'>[M] writhes in pain as \his vacuoles boil.</span>", 3, "<span class='warning'>You hear the crunching of leaves.</span>", 2)
if(prob(35))
if(prob(80))
randmutb(M)
domutcheck(M,null)
else
M.adjustFireLoss(rand(5,15))
M.show_message("\red The radiation beam singes you!")
// for (var/mob/V in viewers(src))
// V.show_message("\red [M] is singed by the radiation beam.", 3, "\red You hear the crackle of burning leaves.", 2)
else if(istype(target, /mob/living/carbon/))
// for (var/mob/V in viewers(src))
// V.show_message("The radiation beam dissipates harmlessly through [M]", 3)
M.show_message("\blue The radiation beam dissipates harmlessly through your body.")
else
return 1
randmutg(M)
domutcheck(M,null)
else
M.adjustFireLoss(rand(5,15))
M.show_message("<span class='warning'>The radiation beam singes you!</span>")
else if(istype(target, /mob/living/carbon/))
M.show_message("<span class='notice'>The radiation beam dissipates harmlessly through your body.</span>")
else
return 1
/obj/item/projectile/energy/florayield
name = "beta somatoray"
@@ -175,40 +163,42 @@
nodamage = 1
flag = "energy"
on_hit(var/atom/target, var/blocked = 0)
var/mob/M = target
if(ishuman(target)) //These rays make plantmen fat.
var/mob/living/carbon/human/H = M
if((H.species.flags & IS_PLANT) && (M.nutrition < 500))
M.nutrition += 30
else if (istype(target, /mob/living/carbon/))
M.show_message("\blue The radiation beam dissipates harmlessly through your body.")
else
return 1
/obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0)
..()
var/mob/M = target
if(ishuman(target)) //These rays make plantmen fat.
var/mob/living/carbon/human/H = M
if((H.species.flags & IS_PLANT) && (M.nutrition < 500))
M.nutrition += 30
else if (istype(target, /mob/living/carbon/))
M.show_message("<span class='notice'>The radiation beam dissipates harmlessly through your body.</span>")
else
return 1
/obj/item/projectile/beam/mindflayer
name = "flayer ray"
on_hit(var/atom/target, var/blocked = 0)
if(ishuman(target))
var/mob/living/carbon/human/M = target
M.adjustBrainLoss(20)
M.hallucination += 20
/obj/item/projectile/beam/mindflayer/on_hit(var/atom/target, var/blocked = 0)
. = ..()
if(ishuman(target))
var/mob/living/carbon/human/M = target
M.adjustBrainLoss(20)
M.hallucination += 20
/obj/item/projectile/clown
name = "snap-pop"
icon = 'icons/obj/toy.dmi'
icon_state = "snappop"
Bump(atom/A as mob|obj|turf|area)
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/decal/cleanable/ash(src.loc)
src.visible_message("\red The [src.name] explodes!","\red You hear a snap!")
playsound(src, 'sound/effects/snap.ogg', 50, 1)
qdel(src)
/obj/item/projectile/clown/Bump(atom/A as mob|obj|turf|area)
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/decal/cleanable/ash(src.loc)
src.visible_message("<span class='warning'>The [src.name] explodes!</span>","<span class='warning'>You hear a snap!</span>")
playsound(src, 'sound/effects/snap.ogg', 50, 1)
qdel(src)
/obj/item/projectile/kinetic
name = "kinetic force"
@@ -239,11 +229,9 @@ obj/item/projectile/kinetic/New()
damage *= 4
..()
/obj/item/projectile/kinetic/Range()
range--
if(range <= 0)
new /obj/item/effect/kinetic_blast(src.loc)
qdel(src)
/obj/item/projectile/kinetic/on_range()
new /obj/effect/kinetic_blast(src.loc)
..()
/obj/item/projectile/kinetic/on_hit(atom/target)
. = ..()
@@ -268,6 +256,40 @@ obj/item/projectile/kinetic/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/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/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
@@ -278,25 +300,6 @@ obj/item/projectile/kinetic/New()
explosion(target, -1, 0, 1)
return 1
/obj/item/projectile/energy/teleport
name = "teleportation burst"
icon_state = "bluespace"
damage = 0
nodamage = 1
var/obj/item/weapon/gun/energy/telegun/T = null
var/teleport_target = null
OnFired()
T = shot_from
teleport_target = T.teleport_target
/obj/item/projectile/energy/teleport/on_hit(var/atom/target, var/blocked = 0)
if(isliving(target))
if(teleport_target)
do_teleport(target, teleport_target, 0)//teleport what's in the tile to the beacon
else
do_teleport(target, target, 15) //Otherwise it just warps you off somewhere.
/obj/item/projectile/plasma
name = "plasma blast"
icon_state = "plasmacutter"
@@ -321,8 +324,9 @@ obj/item/projectile/kinetic/New()
if(istype(target, /turf/simulated/mineral))
var/turf/simulated/mineral/M = target
M.gets_drilled(firer)
range = max(range - 1, 1)
return -1
Range()
if(range > 0)
return -1
/obj/item/projectile/plasma/adv
range = 5
@@ -331,29 +335,24 @@ obj/item/projectile/kinetic/New()
damage = 10
range = 6
/obj/item/projectile/beam/wormhole
name = "bluespace beam"
icon_state = "spark"
hitsound = "sparks"
damage = 3
var/obj/item/weapon/gun/energy/wormhole_projector/gun = null
color = "#33CCFF"
/obj/item/projectile/energy/teleport
name = "teleportation burst"
icon_state = "bluespace"
damage = 0
nodamage = 1
var/obj/item/weapon/gun/energy/telegun/T = null
var/teleport_target = null
/obj/item/projectile/beam/wormhole/orange
name = "orange bluespace beam"
color = "#FF6600"
OnFired()
T = shot_from
teleport_target = T.teleport_target
/obj/item/projectile/beam/wormhole/OnFired()
gun = shot_from
/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/energy/teleport/on_hit(var/atom/target, var/blocked = 0)
if(isliving(target))
if(teleport_target)
do_teleport(target, teleport_target, 0)//teleport what's in the tile to the beacon
else
do_teleport(target, target, 15) //Otherwise it just warps you off somewhere.
/obj/item/projectile/snowball
name = "snowball"
@@ -363,6 +362,7 @@ obj/item/projectile/kinetic/New()
damage_type = BURN
/obj/item/projectile/snowball/on_hit(atom/target) //chilling
. = ..()
if(istype(target, /mob/living))
var/mob/living/M = target
M.bodytemperature = max(0, M.bodytemperature - 50) //each hit will drop your body temp, so don't get surrounded!
@@ -380,9 +380,10 @@ obj/item/projectile/kinetic/New()
..()
/obj/item/projectile/ornament/on_hit(atom/target) //knockback
..()
if(istype(target, /turf))
return 0
var/obj/T = target
var/throwdir = get_dir(firer,target)
T.throw_at(get_edge_target_turf(target, throwdir),10,10)
return 1
return 1

View File

@@ -1,111 +0,0 @@
/obj/item/weapon/gun/grenadelauncher
name = "grenade launcher"
icon = 'icons/obj/gun.dmi'
icon_state = "riotgun"
item_state = "riotgun"
w_class = 4.0
throw_speed = 2
throw_range = 10
force = 5.0
var/list/grenades = new/list()
var/max_grenades = 3
var/ammo_name = "grenade"
var/ammo_type = /obj/item/weapon/grenade
var/unloaded
materials = list(MAT_METAL=2000)
/obj/item/weapon/gun/grenadelauncher/examine(mob/user)
if(..(user, 2))
to_chat(user, "\blue [grenades.len] / [max_grenades] [ammo_name]s.")
/obj/item/weapon/gun/grenadelauncher/attackby(obj/item/I as obj, mob/user as mob, params)
if((istype(I, ammo_type)))
if(grenades.len < max_grenades)
user.drop_item()
I.loc = src
grenades += I
to_chat(user, "\blue You put the [ammo_name] in the [name].")
to_chat(user, "\blue [grenades.len] / [max_grenades] [ammo_name]s.")
else
to_chat(usr, "\red The grenade launcher cannot hold more [ammo_name]s.")
/obj/item/weapon/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
if (istype(target, /obj/item/weapon/storage/backpack ))
return
else if (locate (/obj/structure/table, src.loc))
return
else if(target == user)
return
if(grenades.len)
spawn(0) fire_grenade(target,user)
else
to_chat(usr, "\red The [name] is empty.")
/obj/item/weapon/gun/grenadelauncher/proc/fire_grenade(atom/target, mob/user)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] fired a [ammo_name]!", user), 1)
to_chat(user, "\red You fire the [name]!")
var/obj/item/weapon/grenade/chem_grenade/F = grenades[1] //Now with less copypasta!
grenades -= F
F.loc = user.loc
F.throw_at(target, 30, 2, user)
message_admins("[key_name_admin(user)] fired a [ammo_name] ([F.name]) from a launcher ([name]).")
log_game("[key_name_admin(user)] used a [ammo_name] ([name]).")
F.active = 1
F.icon_state = initial(icon_state) + "_active"
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
spawn(15)
F.prime()
/obj/item/weapon/gun/grenadelauncher/piecannon
name = "pie cannon"
icon = 'icons/obj/gun.dmi'
icon_state = "piecannon1"
item_state = "piecannon1"
w_class = 4.0
throw_speed = 2
throw_range = 10
force = 5.0
clumsy_check = 0
grenades = new/list()
max_grenades = 5
ammo_name = "cream pie"
ammo_type = /obj/item/weapon/reagent_containers/food/snacks/pie
/obj/item/weapon/gun/grenadelauncher/piecannon/New()
..()
for(var/i=0, i < max_grenades, i++)
var/obj/item/weapon/reagent_containers/food/snacks/pie/P = new /obj/item/weapon/reagent_containers/food/snacks/pie(src)
grenades += P
/obj/item/weapon/gun/grenadelauncher/piecannon/attackby(obj/item/I as obj, mob/user as mob, params)
if((istype(I, ammo_type)))
if(grenades.len < max_grenades)
user.drop_item()
I.loc = src
grenades += I
to_chat(user, "\blue You put the [ammo_name] in the [name].")
to_chat(user, "\blue [grenades.len] / [max_grenades] [ammo_name]s.")
icon_state = "piecannon1"
else
to_chat(usr, "\red The grenade launcher cannot hold more [ammo_name]s.")
/obj/item/weapon/gun/grenadelauncher/piecannon/fire_grenade(atom/target, mob/user)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] fired a [ammo_name]!", user), 1)
to_chat(user, "\red You fire the [name]!")
var/obj/item/weapon/reagent_containers/food/snacks/pie/P = grenades[1] //Now with less copypasta!
grenades -= P
P.loc = user.loc
P.throw_at(target, 30, 2, user)
if(!grenades.len)
icon_state = "piecannon0"

View File

@@ -17,6 +17,7 @@
w_class = 1
sharp = 1
var/mode = SYRINGE_DRAW
var/projectile_type = /obj/item/projectile/bullet/dart/syringe
/obj/item/weapon/reagent_containers/syringe/on_reagent_change()
update_icon()
@@ -533,4 +534,4 @@
reagents.add_reagent("capulettium_plus", 5)
reagents.add_reagent("sodium_thiopental", 5)
mode = SYRINGE_INJECT
update_icon()
update_icon()