12/21 modernizations from TG live (#103)

* sync (#3)

* shuttle auto call

* Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why

* Subsystem 12/21

Most Recent TG subsystem folder

* globalvars 12/21

Tossed out the flavor_misc and parallax files

* Onclick 12/21

as well as .dme updates

* _defines 12/21

ommited old _MC.dm

* _HELPERS 12/21

Preserved snowflake placement of furry sprites

* _defeines/genetics

reapplied narkism holdover for snowflake races.

* Oops forgot mutant colors

* modules porting 12/21 + Sounds/icons

Admin, Client and most of mob life files ommitted

* enviroment file

* Admin optimizations

ahelp log system kept

* Mob ports 12/21

Flavor text preserved

* datums ported 12/21

* Game ported 12/21

* batch of duplicate fixes/dogborg work

Dogborgs need to be modernized to refractored borg standards.

* moar fixes

* Maps and futher compile fixes
This commit is contained in:
Poojawa
2016-12-22 03:57:55 -06:00
committed by GitHub
parent f5e143a452
commit cf59ac1c3d
2215 changed files with 707445 additions and 87041 deletions
+7 -114
View File
@@ -6,7 +6,7 @@
flags = CONDUCT
slot_flags = SLOT_BELT
throwforce = 0
w_class = 1
w_class = WEIGHT_CLASS_TINY
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
@@ -16,6 +16,8 @@
var/randomspread = 0 //Randomspread for automatics
var/delay = 0 //Delay for energy weapons
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
var/firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect //the visual effect appearing when the ammo is fired.
/obj/item/ammo_casing/New()
..()
@@ -31,10 +33,10 @@
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent"]"
/obj/item/ammo_casing/proc/newshot() //For energy weapons, shotgun shells and wands (!).
if (!BB)
//proc to magically refill a casing with a new projectile
/obj/item/ammo_casing/proc/newshot() //For energy weapons, syringe gun, shotgun shells and wands (!).
if(!BB)
BB = new projectile_type(src)
return
/obj/item/ammo_casing/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/ammo_box))
@@ -55,113 +57,4 @@
else
user << "<span class='warning'>You fail to collect anything!</span>"
else
..()
//Boxes of ammo
/obj/item/ammo_box
name = "ammo box (null_reference_exception)"
desc = "A box of ammo."
icon_state = "357"
icon = 'icons/obj/ammo.dmi'
flags = CONDUCT
slot_flags = SLOT_BELT
item_state = "syringe_kit"
materials = list(MAT_METAL=30000)
throwforce = 2
w_class = 1
throw_speed = 3
throw_range = 7
var/list/stored_ammo = list()
var/ammo_type = /obj/item/ammo_casing
var/max_ammo = 7
var/multiple_sprites = 0
var/caliber
var/multiload = 1
/obj/item/ammo_box/New()
for(var/i = 1, i <= max_ammo, i++)
stored_ammo += new ammo_type(src)
update_icon()
/obj/item/ammo_box/proc/get_round(keep = 0)
if (!stored_ammo.len)
return null
else
var/b = stored_ammo[stored_ammo.len]
stored_ammo -= b
if (keep)
stored_ammo.Insert(1,b)
return b
/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0)
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
return 0
if (stored_ammo.len < max_ammo)
stored_ammo += R
R.loc = src
return 1
//for accessibles magazines (e.g internal ones) when full, start replacing spent ammo
else if(replace_spent)
for(var/obj/item/ammo_casing/AC in stored_ammo)
if(!AC.BB)//found a spent ammo
stored_ammo -= AC
AC.loc = get_turf(src.loc)
stored_ammo += R
R.loc = src
return 1
return 0
/obj/item/ammo_box/proc/can_load(mob/user)
return 1
/obj/item/ammo_box/attackby(obj/item/A, mob/user, params, silent = 0, replace_spent = 0)
var/num_loaded = 0
if(!can_load(user))
return
if(istype(A, /obj/item/ammo_box))
var/obj/item/ammo_box/AM = A
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
var/did_load = give_round(AC, replace_spent)
if(did_load)
AM.stored_ammo -= AC
num_loaded++
if(!did_load || !multiload)
break
if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/AC = A
if(give_round(AC, replace_spent))
user.drop_item()
AC.loc = src
num_loaded++
if(num_loaded)
if(!silent)
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
A.update_icon()
update_icon()
return num_loaded
/obj/item/ammo_box/attack_self(mob/user)
var/obj/item/ammo_casing/A = get_round()
if(A)
user.put_in_hands(A)
user << "<span class='notice'>You remove a round from \the [src]!</span>"
update_icon()
/obj/item/ammo_box/update_icon()
switch(multiple_sprites)
if(1)
icon_state = "[initial(icon_state)]-[stored_ammo.len]"
if(2)
icon_state = "[initial(icon_state)]-[stored_ammo.len ? "[max_ammo]" : "0"]"
desc = "[initial(desc)] There are [stored_ammo.len] shell\s left!"
//Behavior for magazines
/obj/item/ammo_box/magazine/proc/ammo_count()
return stored_ammo.len
return ..()
@@ -27,6 +27,15 @@
caliber = "10mm"
projectile_type = /obj/item/projectile/bullet/midbullet3
/obj/item/ammo_casing/c10mm/ap
projectile_type = /obj/item/projectile/bullet/midbullet3/ap
/obj/item/ammo_casing/c10mm/fire
projectile_type = /obj/item/projectile/bullet/midbullet3/fire
/obj/item/ammo_casing/c10mm/hp
projectile_type = /obj/item/projectile/bullet/midbullet3/hp
/obj/item/ammo_casing/c9mm
desc = "A 9mm bullet casing."
caliber = "9mm"
@@ -199,7 +208,7 @@
variance = 25
/obj/item/ammo_casing/shotgun/improvised/overload/
/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."
@@ -304,105 +313,3 @@
reagents.add_reagent("mutetoxin", 6) //;HELP OPS IN MAINT
reagents.add_reagent("coniine", 6)
reagents.add_reagent("sodium_thiopental", 6)
// Caseless Ammunition
/obj/item/ammo_casing/caseless
desc = "A caseless bullet casing."
/obj/item/ammo_casing/caseless/fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params, distro, quiet)
if (..())
loc = null
return 1
else
return 0
/obj/item/ammo_casing/caseless/update_icon()
..()
icon_state = "[initial(icon_state)]"
/obj/item/ammo_casing/caseless/a75
desc = "A .75 bullet casing."
caliber = "75"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/bullet/gyro
/obj/item/ammo_casing/caseless/magspear
name = "magnetic spear"
desc = "A reusable spear that is typically loaded into kinetic spearguns."
projectile_type = /obj/item/projectile/bullet/reusable/magspear
caliber = "speargun"
icon_state = "magspear"
throwforce = 15 //still deadly when thrown
throw_speed = 3
/obj/item/ammo_casing/caseless/laser
name = "laser casing"
desc = "You shouldn't be seeing this."
caliber = "laser"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/beam
fire_sound = 'sound/weapons/Laser.ogg'
/obj/item/ammo_casing/caseless/laser/gatling
projectile_type = /obj/item/projectile/beam/weak
variance = 0.8
click_cooldown_override = 1
/obj/item/ammo_casing/caseless/foam_dart
name = "foam dart"
desc = "Its nerf or nothing! Ages 8 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart
caliber = "foam_force"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
var/modified = 0
/obj/item/ammo_casing/caseless/foam_dart/update_icon()
..()
if (modified)
icon_state = "foamdart_empty"
desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
if(BB)
BB.icon_state = "foamdart_empty"
else
icon_state = "foamdart"
desc = "Its nerf or nothing! Ages 8 and up."
if(BB)
BB.icon_state = "foamdart_empty"
/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params)
..()
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
if (istype(A, /obj/item/weapon/screwdriver) && !modified)
modified = 1
FD.damage_type = BRUTE
update_icon()
else if ((istype(A, /obj/item/weapon/pen)) && modified && !FD.pen)
if(!user.unEquip(A))
return
A.loc = FD
FD.pen = A
FD.damage = 5
FD.nodamage = 0
user << "<span class='notice'>You insert [A] into [src].</span>"
return
/obj/item/ammo_casing/caseless/foam_dart/attack_self(mob/living/user)
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
if(FD.pen)
FD.damage = initial(FD.damage)
FD.nodamage = initial(FD.nodamage)
user.put_in_hands(FD.pen)
user << "<span class='notice'>You remove [FD.pen] from [src].</span>"
FD.pen = null
/obj/item/ammo_casing/caseless/foam_dart/riot
name = "riot foam dart"
desc = "Whose smart idea was it to use toys as crowd control? Ages 18 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/riot
icon_state = "foamdart_riot"
@@ -0,0 +1,126 @@
// Caseless Ammunition
/obj/item/ammo_casing/caseless
desc = "A caseless bullet casing."
firing_effect_type = null
/obj/item/ammo_casing/caseless/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread)
if (..()) //successfully firing
loc = null
return 1
else
return 0
/obj/item/ammo_casing/caseless/update_icon()
..()
icon_state = "[initial(icon_state)]"
/obj/item/ammo_casing/caseless/a75
desc = "A .75 bullet casing."
caliber = "75"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/bullet/gyro
/obj/item/ammo_casing/caseless/a84mm
desc = "An 84mm anti-armour rocket."
caliber = "84mm"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/bullet/a84mm
/obj/item/ammo_casing/caseless/magspear
name = "magnetic spear"
desc = "A reusable spear that is typically loaded into kinetic spearguns."
projectile_type = /obj/item/projectile/bullet/reusable/magspear
caliber = "speargun"
icon_state = "magspear"
throwforce = 15 //still deadly when thrown
throw_speed = 3
/obj/item/ammo_casing/caseless/laser
name = "laser casing"
desc = "You shouldn't be seeing this."
caliber = "laser"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/beam
fire_sound = 'sound/weapons/Laser.ogg'
firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect/energy
/obj/item/ammo_casing/caseless/laser/gatling
projectile_type = /obj/item/projectile/beam/weak
variance = 0.8
click_cooldown_override = 1
/obj/item/ammo_casing/caseless/foam_dart
name = "foam dart"
desc = "Its nerf or nothing! Ages 8 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart
caliber = "foam_force"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
var/modified = 0
/obj/item/ammo_casing/caseless/foam_dart/update_icon()
..()
if (modified)
icon_state = "foamdart_empty"
desc = "Its nerf or nothing! ... Although, this one doesn't look too safe."
if(BB)
BB.icon_state = "foamdart_empty"
else
icon_state = initial(icon_state)
desc = "Its nerf or nothing! Ages 8 and up."
if(BB)
BB.icon_state = initial(BB.icon_state)
/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.modified = 1
FD.damage_type = BRUTE
user << "<span class='notice'>You pop the safety cap off of [src].</span>"
update_icon()
else if (istype(A, /obj/item/weapon/pen))
if(modified)
if(!FD.pen)
if(!user.unEquip(A))
return
A.forceMove(FD)
FD.pen = A
FD.damage = 5
FD.nodamage = 0
user << "<span class='notice'>You insert [A] into [src].</span>"
else
user << "<span class='warning'>There's already something in [src].</span>"
else
user << "<span class='warning'>The safety cap prevents you from inserting [A] into [src].</span>"
else
return ..()
/obj/item/ammo_casing/caseless/foam_dart/attack_self(mob/living/user)
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
if(FD.pen)
FD.damage = initial(FD.damage)
FD.nodamage = initial(FD.nodamage)
user.put_in_hands(FD.pen)
user << "<span class='notice'>You remove [FD.pen] from [src].</span>"
FD.pen = null
/obj/item/ammo_casing/caseless/foam_dart/riot
name = "riot foam dart"
desc = "Whose smart idea was it to use toys as crowd control? Ages 18 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/riot
icon_state = "foamdart_riot"
/obj/item/ammo_casing/caseless/arrow
name = "arrow"
desc = "Stab, stab, stab."
icon_state = "arrow"
force = 10
sharpness = IS_SHARP
projectile_type = /obj/item/projectile/bullet/reusable/arrow
caliber = "arrow"
+21 -16
View File
@@ -6,6 +6,7 @@
var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot.
var/select_name = "energy"
fire_sound = 'sound/weapons/Laser.ogg'
firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect/energy
/obj/item/ammo_casing/energy/laser
projectile_type = /obj/item/projectile/beam/laser
@@ -29,6 +30,11 @@
variance = 25
select_name = "scatter"
/obj/item/ammo_casing/energy/laser/scatter/disabler
projectile_type = /obj/item/projectile/beam/disabler
pellets = 3
variance = 15
/obj/item/ammo_casing/energy/laser/heavy
projectile_type = /obj/item/projectile/beam/laser/heavylaser
select_name = "anti-vehicle"
@@ -106,18 +112,6 @@
projectile_type = /obj/item/projectile/meteor
select_name = "goddamn meteor"
/obj/item/ammo_casing/energy/kinetic
projectile_type = /obj/item/projectile/kinetic
select_name = "kinetic"
e_cost = 500
fire_sound = 'sound/weapons/Kenetic_accel.ogg' // fine spelling there chap
/obj/item/ammo_casing/energy/kinetic/super
projectile_type = /obj/item/projectile/kinetic/super
/obj/item/ammo_casing/energy/kinetic/hyper
projectile_type = /obj/item/projectile/kinetic/hyper
/obj/item/ammo_casing/energy/disabler
projectile_type = /obj/item/projectile/beam/disabler
select_name = "disable"
@@ -153,11 +147,14 @@
e_cost = 500
fire_sound = 'sound/weapons/Genhit.ogg'
/obj/item/ammo_casing/energy/bolt/halloween
projectile_type = /obj/item/projectile/energy/bolt/halloween
/obj/item/ammo_casing/energy/bolt/large
projectile_type = /obj/item/projectile/energy/bolt/large
select_name = "heavy bolt"
obj/item/ammo_casing/energy/net
/obj/item/ammo_casing/energy/net
projectile_type = /obj/item/projectile/energy/net
select_name = "netting"
pellets = 6
@@ -178,11 +175,11 @@ obj/item/ammo_casing/energy/net
/obj/item/ammo_casing/energy/instakill/red
projectile_type = /obj/item/projectile/beam/instakill/red
/obj/item/ammo_casing/energy/shock_revolver
/obj/item/ammo_casing/energy/tesla_revolver
fire_sound = 'sound/magic/lightningbolt.ogg'
e_cost = 200
select_name = "stun"
projectile_type = /obj/item/projectile/energy/shock_revolver
projectile_type = /obj/item/projectile/energy/tesla_revolver
/obj/item/ammo_casing/energy/gravityrepulse
projectile_type = /obj/item/projectile/gravityrepulse
@@ -216,4 +213,12 @@ obj/item/ammo_casing/energy/net
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
/obj/item/ammo_casing/energy/gravitychaos/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
gun = G
gun = G
/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
+29 -1
View File
@@ -2,6 +2,7 @@
name = "magic casing"
desc = "I didn't even know magic needed ammo..."
projectile_type = /obj/item/projectile/magic
firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect/magic
/obj/item/ammo_casing/magic/change
projectile_type = /obj/item/projectile/magic/change
@@ -27,6 +28,12 @@
/obj/item/ammo_casing/magic/chaos
projectile_type = /obj/item/projectile/magic
/obj/item/ammo_casing/magic/spellblade
projectile_type = /obj/item/projectile/magic/spellblade
/obj/item/ammo_casing/magic/arcane_barrage
projectile_type = /obj/item/projectile/magic/arcane_barrage
/obj/item/ammo_casing/magic/chaos/newshot()
projectile_type = pick(typesof(/obj/item/projectile/magic))
..()
@@ -37,10 +44,31 @@
/obj/item/ammo_casing/syringegun
name = "syringe gun spring"
desc = "A high-power spring that throws syringes."
projectile_type = null
projectile_type = /obj/item/projectile/bullet/dart/syringe
firing_effect_type = null
/obj/item/ammo_casing/syringegun/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
if(!BB)
return
if(istype(loc, /obj/item/weapon/gun/syringe))
var/obj/item/weapon/gun/syringe/SG = loc
if(!SG.syringes.len)
return
var/obj/item/weapon/reagent_containers/syringe/S = SG.syringes[1]
S.reagents.trans_to(BB, S.reagents.total_volume)
BB.name = S.name
var/obj/item/projectile/bullet/dart/D = BB
D.piercing = S.proj_piercing
SG.syringes.Remove(S)
qdel(S)
..()
/obj/item/ammo_casing/energy/c3dbullet
projectile_type = /obj/item/projectile/bullet/midbullet3
select_name = "spraydown"
fire_sound = 'sound/weapons/gunshot_smg.ogg'
e_cost = 20
firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect
+117
View File
@@ -0,0 +1,117 @@
//Boxes of ammo
/obj/item/ammo_box
name = "ammo box (null_reference_exception)"
desc = "A box of ammo."
icon_state = "357"
icon = 'icons/obj/ammo.dmi'
flags = CONDUCT
slot_flags = SLOT_BELT
item_state = "syringe_kit"
materials = list(MAT_METAL=30000)
throwforce = 2
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
var/list/stored_ammo = list()
var/ammo_type = /obj/item/ammo_casing
var/max_ammo = 7
var/multiple_sprites = 0
var/caliber
var/multiload = 1
var/start_empty = 0
/obj/item/ammo_box/New()
..()
if(!start_empty)
for(var/i = 1, i <= max_ammo, i++)
stored_ammo += new ammo_type(src)
update_icon()
/obj/item/ammo_box/proc/get_round(keep = 0)
if (!stored_ammo.len)
return null
else
var/b = stored_ammo[stored_ammo.len]
stored_ammo -= b
if (keep)
stored_ammo.Insert(1,b)
return b
/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0)
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
return 0
if (stored_ammo.len < max_ammo)
stored_ammo += R
R.forceMove(src)
return 1
//for accessibles magazines (e.g internal ones) when full, start replacing spent ammo
else if(replace_spent)
for(var/obj/item/ammo_casing/AC in stored_ammo)
if(!AC.BB)//found a spent ammo
stored_ammo -= AC
AC.forceMove(get_turf(src.loc))
stored_ammo += R
R.forceMove(src)
return 1
return 0
/obj/item/ammo_box/proc/can_load(mob/user)
return 1
/obj/item/ammo_box/attackby(obj/item/A, mob/user, params, silent = 0, replace_spent = 0)
var/num_loaded = 0
if(!can_load(user))
return
if(istype(A, /obj/item/ammo_box))
var/obj/item/ammo_box/AM = A
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
var/did_load = give_round(AC, replace_spent)
if(did_load)
AM.stored_ammo -= AC
num_loaded++
if(!did_load || !multiload)
break
if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/AC = A
if(give_round(AC, replace_spent))
user.drop_item()
AC.forceMove(src)
num_loaded++
if(num_loaded)
if(!silent)
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
A.update_icon()
update_icon()
return num_loaded
/obj/item/ammo_box/attack_self(mob/user)
var/obj/item/ammo_casing/A = get_round()
if(A)
user.put_in_hands(A)
user << "<span class='notice'>You remove a round from \the [src]!</span>"
update_icon()
/obj/item/ammo_box/update_icon()
switch(multiple_sprites)
if(1)
icon_state = "[initial(icon_state)]-[stored_ammo.len]"
if(2)
icon_state = "[initial(icon_state)]-[stored_ammo.len ? "[max_ammo]" : "0"]"
desc = "[initial(desc)] There are [stored_ammo.len] shell\s left!"
//Behavior for magazines
/obj/item/ammo_box/magazine/proc/ammo_count()
return stored_ammo.len
/obj/item/ammo_box/magazine/proc/empty_magazine()
var/turf_mag = get_turf(src)
for(var/obj/item/ammo in stored_ammo)
ammo.forceMove(turf_mag)
stored_ammo -= ammo
@@ -1,179 +1,3 @@
////////////////INTERNAL MAGAZINES//////////////////////
/obj/item/ammo_box/magazine/internal
desc = "Oh god, this shouldn't be here"
//internals magazines are accessible, so replace spent ammo if full when trying to put a live one in
/obj/item/ammo_box/magazine/internal/give_round(obj/item/ammo_casing/R)
return ..(R,1)
// Revolver internal mags
/obj/item/ammo_box/magazine/internal/cylinder
name = "revolver cylinder"
ammo_type = /obj/item/ammo_casing/a357
caliber = "357"
max_ammo = 7
/obj/item/ammo_box/magazine/internal/cylinder/ammo_count(countempties = 1)
var/boolets = 0
for(var/obj/item/ammo_casing/bullet in stored_ammo)
if(bullet && (bullet.BB || countempties))
boolets++
return boolets
/obj/item/ammo_box/magazine/internal/cylinder/get_round(keep = 0)
rotate()
var/b = stored_ammo[1]
if(!keep)
stored_ammo[1] = null
return b
/obj/item/ammo_box/magazine/internal/cylinder/proc/rotate()
var/b = stored_ammo[1]
stored_ammo.Cut(1,2)
stored_ammo.Insert(0, b)
/obj/item/ammo_box/magazine/internal/cylinder/proc/spin()
for(var/i in 1 to rand(0, max_ammo*2))
rotate()
/obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0)
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
return 0
for(var/i in 1 to stored_ammo.len)
var/obj/item/ammo_casing/bullet = stored_ammo[i]
if(!bullet || !bullet.BB) // found a spent ammo
stored_ammo[i] = R
R.loc = src
if(bullet)
bullet.loc = get_turf(src.loc)
return 1
return 0
/obj/item/ammo_box/magazine/internal/cylinder/rev38
name = "detective revolver cylinder"
ammo_type = /obj/item/ammo_casing/c38
caliber = "38"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/grenademulti
name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/rev762
name = "nagant revolver cylinder"
ammo_type = /obj/item/ammo_casing/n762
caliber = "n762"
max_ammo = 7
// Shotgun internal mags
/obj/item/ammo_box/magazine/internal/shot
name = "shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
caliber = "shotgun"
max_ammo = 4
multiload = 0
/obj/item/ammo_box/magazine/internal/shot/ammo_count(countempties = 1)
if (!countempties)
var/boolets = 0
for(var/obj/item/ammo_casing/bullet in stored_ammo)
if(bullet.BB)
boolets++
return boolets
else
return ..()
/obj/item/ammo_box/magazine/internal/shot/tube
name = "dual feed shotgun internal tube"
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
max_ammo = 4
/obj/item/ammo_box/magazine/internal/shot/lethal
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
/obj/item/ammo_box/magazine/internal/shot/com
name = "combat shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
max_ammo = 6
/obj/item/ammo_box/magazine/internal/shot/dual
name = "double-barrel shotgun internal magazine"
max_ammo = 2
/obj/item/ammo_box/magazine/internal/shot/improvised
name = "improvised shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/improvised
max_ammo = 1
/obj/item/ammo_box/magazine/internal/shot/riot
name = "riot shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
max_ammo = 6
/obj/item/ammo_box/magazine/internal/grenadelauncher
name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/speargun
name = "speargun internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/magspear
caliber = "speargun"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/rus357
name = "russian revolver cylinder"
ammo_type = /obj/item/ammo_casing/a357
caliber = "357"
max_ammo = 6
multiload = 0
/obj/item/ammo_box/magazine/internal/rus357/New()
stored_ammo += new ammo_type(src)
/obj/item/ammo_box/magazine/internal/boltaction
name = "bolt action rifle internal magazine"
desc = "Oh god, this shouldn't be here"
ammo_type = /obj/item/ammo_casing/a762
caliber = "a762"
max_ammo = 5
multiload = 1
/obj/item/ammo_box/magazine/internal/boltaction/enchanted
max_ammo =1
ammo_type = /obj/item/ammo_casing/a762/enchanted
/obj/item/ammo_box/magazine/internal/shot/toy
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
caliber = "foam_force"
max_ammo = 4
/obj/item/ammo_box/magazine/internal/shot/toy/crossbow
max_ammo = 5
/obj/item/ammo_box/magazine/internal/minigun
name = "gatling gun fusion core"
ammo_type = /obj/item/ammo_casing/caseless/laser/gatling
caliber = "gatling"
max_ammo = 5000
@@ -189,6 +13,21 @@
max_ammo = 8
multiple_sprites = 2
/obj/item/ammo_box/magazine/m10mm/fire
name = "pistol magazine (10mm incendiary)"
desc = "A gun magazine. Loaded with rounds which ignite the target."
ammo_type = /obj/item/ammo_casing/c10mm/fire
/obj/item/ammo_box/magazine/m10mm/hp
name = "pistol magazine (10mm HP)"
desc= "A gun magazine. Loaded with hollow-point rounds, extremely effective against unarmored targets, but nearly useless against protective clothing."
ammo_type = /obj/item/ammo_casing/c10mm/hp
/obj/item/ammo_box/magazine/m10mm/ap
name = "pistol magazine (10mm AP)"
desc= "A gun magazine. Loaded with rounds which penetrate armour, but are less effective against normal targets"
ammo_type = /obj/item/ammo_casing/c10mm/ap
/obj/item/ammo_box/magazine/m45
name = "handgun magazine (.45)"
icon_state = "45-8"
@@ -280,7 +119,7 @@
..()
icon_state = "c20r45-[round(ammo_count(),2)]"
obj/item/ammo_box/magazine/tommygunm45
/obj/item/ammo_box/magazine/tommygunm45
name = "drum magazine (.45)"
icon_state = "drum45"
ammo_type = /obj/item/ammo_casing/c45
@@ -439,12 +278,15 @@ obj/item/ammo_box/magazine/tommygunm45
/obj/item/ammo_box/magazine/toy/smg
name = "foam force SMG magazine"
icon_state = "smg9mm-20"
icon_state = "smg9mm-42"
max_ammo = 20
/obj/item/ammo_box/magazine/toy/smg/update_icon()
..()
icon_state = "smg9mm-[round(ammo_count(),5)]"
if(ammo_count())
icon_state = "smg9mm-42"
else
icon_state = "smg9mm-0"
/obj/item/ammo_box/magazine/toy/smg/riot
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
@@ -0,0 +1,192 @@
////////////////INTERNAL MAGAZINES//////////////////////
/obj/item/ammo_box/magazine/internal
desc = "Oh god, this shouldn't be here"
//internals magazines are accessible, so replace spent ammo if full when trying to put a live one in
/obj/item/ammo_box/magazine/internal/give_round(obj/item/ammo_casing/R)
return ..(R,1)
// Revolver internal mags
/obj/item/ammo_box/magazine/internal/cylinder
name = "revolver cylinder"
ammo_type = /obj/item/ammo_casing/a357
caliber = "357"
max_ammo = 7
/obj/item/ammo_box/magazine/internal/cylinder/ammo_count(countempties = 1)
var/boolets = 0
for(var/obj/item/ammo_casing/bullet in stored_ammo)
if(bullet && (bullet.BB || countempties))
boolets++
return boolets
/obj/item/ammo_box/magazine/internal/cylinder/get_round(keep = 0)
rotate()
var/b = stored_ammo[1]
if(!keep)
stored_ammo[1] = null
return b
/obj/item/ammo_box/magazine/internal/cylinder/proc/rotate()
var/b = stored_ammo[1]
stored_ammo.Cut(1,2)
stored_ammo.Insert(0, b)
/obj/item/ammo_box/magazine/internal/cylinder/proc/spin()
for(var/i in 1 to rand(0, max_ammo*2))
rotate()
/obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0)
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
return 0
for(var/i in 1 to stored_ammo.len)
var/obj/item/ammo_casing/bullet = stored_ammo[i]
if(!bullet || !bullet.BB) // found a spent ammo
stored_ammo[i] = R
R.loc = src
if(bullet)
bullet.loc = get_turf(src.loc)
return 1
return 0
/obj/item/ammo_box/magazine/internal/cylinder/rev38
name = "detective revolver cylinder"
ammo_type = /obj/item/ammo_casing/c38
caliber = "38"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/grenademulti
name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/rev762
name = "nagant revolver cylinder"
ammo_type = /obj/item/ammo_casing/n762
caliber = "n762"
max_ammo = 7
// Shotgun internal mags
/obj/item/ammo_box/magazine/internal/shot
name = "shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
caliber = "shotgun"
max_ammo = 4
multiload = 0
/obj/item/ammo_box/magazine/internal/shot/ammo_count(countempties = 1)
if (!countempties)
var/boolets = 0
for(var/obj/item/ammo_casing/bullet in stored_ammo)
if(bullet.BB)
boolets++
return boolets
else
return ..()
/obj/item/ammo_box/magazine/internal/shot/tube
name = "dual feed shotgun internal tube"
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
max_ammo = 4
/obj/item/ammo_box/magazine/internal/shot/lethal
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
/obj/item/ammo_box/magazine/internal/shot/com
name = "combat shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
max_ammo = 6
/obj/item/ammo_box/magazine/internal/shot/dual
name = "double-barrel shotgun internal magazine"
max_ammo = 2
/obj/item/ammo_box/magazine/internal/shot/improvised
name = "improvised shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/improvised
max_ammo = 1
/obj/item/ammo_box/magazine/internal/shot/riot
name = "riot shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/rubbershot
max_ammo = 6
/obj/item/ammo_box/magazine/internal/grenadelauncher
name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/rocketlauncher
name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/a84mm
caliber = "84mm"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/speargun
name = "speargun internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/magspear
caliber = "speargun"
max_ammo = 1
/obj/item/ammo_box/magazine/internal/cylinder/rus357
name = "russian revolver cylinder"
ammo_type = /obj/item/ammo_casing/a357
caliber = "357"
max_ammo = 6
multiload = 0
/obj/item/ammo_box/magazine/internal/rus357/New()
stored_ammo += new ammo_type(src)
..()
/obj/item/ammo_box/magazine/internal/boltaction
name = "bolt action rifle internal magazine"
desc = "Oh god, this shouldn't be here"
ammo_type = /obj/item/ammo_casing/a762
caliber = "a762"
max_ammo = 5
multiload = 1
/obj/item/ammo_box/magazine/internal/boltaction/enchanted
max_ammo = 1
ammo_type = /obj/item/ammo_casing/a762/enchanted
/obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage
ammo_type = /obj/item/ammo_casing/magic/arcane_barrage
/obj/item/ammo_box/magazine/internal/shot/toy
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
caliber = "foam_force"
max_ammo = 4
/obj/item/ammo_box/magazine/internal/shot/toy/crossbow
max_ammo = 5
/obj/item/ammo_box/magazine/internal/minigun
name = "gatling gun fusion core"
ammo_type = /obj/item/ammo_casing/caseless/laser/gatling
caliber = "gatling"
max_ammo = 5000
/obj/item/ammo_box/magazine/internal/bow
name = "bow internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/arrow
caliber = "arrow"
max_ammo = 1
+15 -51
View File
@@ -1,4 +1,4 @@
/obj/item/ammo_casing/proc/fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params, distro, quiet, zone_override = "",spread)
/obj/item/ammo_casing/proc/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread)
distro += variance
for (var/i = max(1, pellets), i > 0, i--)
var/targloc = get_turf(target)
@@ -20,7 +20,7 @@
update_icon()
return 1
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override)
if (!BB)
return
BB.original = target
@@ -39,17 +39,20 @@
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()
var/firing_dir
if(BB.firer)
firing_dir = BB.firer.dir
if(!BB.suppressed && firing_effect_type)
PoolOrNew(firing_effect_type, list(get_turf(src), firing_dir))
var/direct_target
if(targloc == curloc)
if(target) //if the target is right on our location we'll skip the travelling code in the proj's fire()
direct_target = target
if(!direct_target)
BB.preparePixelProjectile(target, targloc, user, params, spread)
BB.fire(null, direct_target)
BB = null
return 1
@@ -57,42 +60,3 @@
var/dx = abs(target.x - current.x)
var/dy = abs(target.y - current.y)
return locate(target.x + round(gaussian(0, distro) * (dy+2)/8, 1), target.y + round(gaussian(0, distro) * (dx+2)/8, 1), target.z)
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
var/turf/curloc = get_turf(user)
src.loc = get_turf(user)
src.starting = get_turf(user)
src.current = curloc
src.yo = targloc.y - curloc.y
src.xo = targloc.x - curloc.x
if(params)
var/list/mouse_control = params2list(params)
if(mouse_control["icon-x"])
src.p_x = text2num(mouse_control["icon-x"])
if(mouse_control["icon-y"])
src.p_y = text2num(mouse_control["icon-y"])
if(mouse_control["screen-loc"])
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
// world << "X: [screen_loc_X[1]] PixelX: [screen_loc_X[2]] / Y: [screen_loc_Y[1]] PixelY: [screen_loc_Y[2]]"
var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32
var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32
//Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average.
var/screenview = (user.client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
var/ox = round(screenview/2) //"origin" x
var/oy = round(screenview/2) //"origin" y
// world << "Pixel position: [x] [y]"
var/angle = Atan2(y - oy, x - ox)
// world << "Angle: [angle]"
src.Angle = angle
if(spread)
src.Angle += spread
+96 -94
View File
@@ -7,13 +7,14 @@
flags = CONDUCT
slot_flags = SLOT_BELT
materials = list(MAT_METAL=2000)
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
throwforce = 5
throw_speed = 3
throw_range = 5
force = 5
origin_tech = "combat=1"
needs_permit = 1
unique_rename = 0
attack_verb = list("struck", "hit", "bashed")
var/fire_sound = "gunshot"
@@ -31,11 +32,8 @@
var/firing_burst = 0 //Prevent the weapon from firing again while already firing
var/semicd = 0 //cooldown handler
var/weapon_weight = WEAPON_LIGHT
var/spread = 0 //Spread induced by the gun itself.
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
var/unique_rename = 0 //allows renaming with a pen
var/unique_reskin = 0 //allows one-time reskinning
var/current_skin = null //the skin choice if we had a reskin
var/list/options = list()
@@ -45,7 +43,7 @@
var/obj/item/device/firing_pin/pin = /obj/item/device/firing_pin //standard firing pin for most guns
var/obj/item/device/flashlight/F = null
var/obj/item/device/flashlight/gun_light = null
var/can_flashlight = 0
var/list/upgrades = list()
@@ -66,7 +64,7 @@
..()
if(pin)
pin = new pin(src)
if(F)
if(gun_light)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
new /datum/action/item_action/toggle_gunlight(src)
build_zooming()
@@ -79,7 +77,7 @@
G.loc = loc
qdel(G.pin)
G.pin = null
visible_message("[G] can now fit a new pin, but old one was destroyed in the process.")
visible_message("[G] can now fit a new pin, but old one was destroyed in the process.", null, null, 3)
qdel(src)
/obj/item/weapon/gun/examine(mob/user)
@@ -90,10 +88,8 @@
user << "It doesn't have a firing pin installed, and won't fire."
if(unique_reskin && !current_skin)
user << "<span class='notice'>Alt-click it to reskin it.</span>"
if(unique_rename)
user << "<span class='notice'>Use a pen on it to rename it.</span>"
//called after the gun has successfully fired its chambered ammo.
/obj/item/weapon/gun/proc/process_chamber()
return 0
@@ -107,7 +103,6 @@
/obj/item/weapon/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
user << "<span class='danger'>*click*</span>"
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
return
/obj/item/weapon/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
@@ -118,18 +113,11 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
if(!message)
return
if(pointblank)
user.visible_message("<span class='danger'>[user] fires [src] point blank at [pbtarget]!</span>", "<span class='danger'>You fire [src] point blank at [pbtarget]!</span>", "<span class='italics'>You hear a [istype(src, /obj/item/weapon/gun/energy) ? "laser blast" : "gunshot"]!</span>")
else
user.visible_message("<span class='danger'>[user] fires [src]!</span>", "<span class='danger'>You fire [src]!</span>", "You hear a [istype(src, /obj/item/weapon/gun/energy) ? "laser blast" : "gunshot"]!")
if(weapon_weight >= WEAPON_MEDIUM)
if(user.get_inactive_hand())
if(prob(15))
if(user.drop_item())
user.visible_message("<span class='danger'>[src] flies out of [user]'s hands!</span>", "<span class='userdanger'>[src] kicks out of your grip!</span>")
if(message)
if(pointblank)
user.visible_message("<span class='danger'>[user] fires [src] point blank at [pbtarget]!</span>", null, null, COMBAT_MESSAGE_RANGE)
else
user.visible_message("<span class='danger'>[user] fires [src]!</span>", null, null, COMBAT_MESSAGE_RANGE)
/obj/item/weapon/gun/emp_act(severity)
for(var/obj/O in contents)
@@ -142,7 +130,7 @@
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
if(!ismob(target) || user.a_intent == INTENT_HARM) //melee attack
return
if(target == user && user.zone_selected != "mouth") //so we can't shoot ourselves (unless mouth selected)
return
@@ -152,7 +140,7 @@
if(!can_trigger_gun(L))
return
if(!can_shoot()) //Just because you can pull the trigger doesn't mean it can't shoot.
if(!can_shoot()) //Just because you can pull the trigger doesn't mean it can shoot.
shoot_with_empty_chamber(user)
return
@@ -166,17 +154,31 @@
if(clumsy_check)
if(istype(user))
if (user.disabilities & CLUMSY && prob(40))
user << "<span class='userdanger'>You shoot yourself in the foot with \the [src]!</span>"
user << "<span class='userdanger'>You shoot yourself in the foot with [src]!</span>"
var/shot_leg = pick("l_leg", "r_leg")
process_fire(user,user,0,params, zone_override = shot_leg)
user.drop_item()
return
if(weapon_weight == WEAPON_HEAVY && user.get_inactive_hand())
user << "<span class='userdanger'>You need both hands free to fire \the [src]!</span>"
if(weapon_weight == WEAPON_HEAVY && user.get_inactive_held_item())
user << "<span class='userdanger'>You need both hands free to fire [src]!</span>"
return
process_fire(target,user,1,params)
//DUAL (or more!) WIELDING
var/bonus_spread = 0
var/loop_counter = 0
if(ishuman(user) && user.a_intent == INTENT_HARM)
var/mob/living/carbon/human/H = user
for(var/obj/item/weapon/gun/G in H.held_items)
if(G == src || G.weapon_weight >= WEAPON_MEDIUM)
continue
else if(G.can_trigger_gun(user))
bonus_spread += 24 * G.weapon_weight
loop_counter++
spawn(loop_counter)
G.process_fire(target,user,1,params, null, bonus_spread)
process_fire(target,user,1,params, null, bonus_spread)
@@ -195,23 +197,23 @@
pin.auth_fail(user)
return 0
else
user << "<span class='warning'>\The [src]'s trigger is locked. This weapon doesn't have a firing pin installed!</span>"
user << "<span class='warning'>[src]'s trigger is locked. This weapon doesn't have a firing pin installed!</span>"
return 0
obj/item/weapon/gun/proc/newshot()
/obj/item/weapon/gun/proc/recharge_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)
/obj/item/weapon/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
add_fingerprint(user)
if(semicd)
return
if(weapon_weight)
if(user.get_inactive_hand())
recoil = 4 //one-handed kick
else
recoil = initial(recoil)
var/sprd = 0
var/randomized_gun_spread = 0
if(spread)
randomized_gun_spread = rand(0,spread)
var/randomized_bonus_spread = rand(0, bonus_spread)
if(burst_size > 1)
firing_burst = 1
@@ -219,15 +221,15 @@ obj/item/weapon/gun/proc/newshot()
if(!user)
break
if(!issilicon(user))
if( i>1 && !(src in get_both_hands(user))) //for burst firing
if( i>1 && !(user.is_holding(src))) //for burst firing
break
if(chambered)
var/sprd = 0
if(chambered && chambered.BB)
if(randomspread)
sprd = round((rand() - 0.5) * spread)
sprd = round((rand() - 0.5) * (randomized_gun_spread + randomized_bonus_spread))
else //Smart spread
sprd = round((i / burst_size - 0.5) * spread)
if(!chambered.fire(target, user, params, ,suppressed, zone_override, sprd))
sprd = round((i / burst_size - 0.5) * (randomized_gun_spread + randomized_bonus_spread))
if(!chambered.fire_casing(target, user, params, ,suppressed, zone_override, sprd))
shoot_with_empty_chamber(user)
break
else
@@ -244,7 +246,8 @@ obj/item/weapon/gun/proc/newshot()
firing_burst = 0
else
if(chambered)
if(!chambered.fire(target, user, params, , suppressed, zone_override, spread))
sprd = round((pick(1,-1)) * (randomized_gun_spread + randomized_bonus_spread))
if(!chambered.fire_casing(target, user, params, , suppressed, zone_override, sprd))
shoot_with_empty_chamber(user)
return
else
@@ -262,29 +265,26 @@ obj/item/weapon/gun/proc/newshot()
semicd = 0
if(user)
if(user.hand)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
user.update_inv_hands()
feedback_add_details("gun_fired","[src.type]")
/obj/item/weapon/gun/attack(mob/M as mob, mob/user)
if(user.a_intent == "harm") //Flogging
if(user.a_intent == INTENT_HARM) //Flogging
..()
else
return
/obj/item/weapon/gun/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/flashlight/seclite))
var/obj/item/device/flashlight/seclite/S = I
if(can_flashlight)
if(!F)
if(can_flashlight)
if(istype(I, /obj/item/device/flashlight/seclite))
var/obj/item/device/flashlight/seclite/S = I
if(!gun_light)
if(!user.unEquip(I))
return
user << "<span class='notice'>You click [S] into place on [src].</span>"
if(S.on)
set_light(0)
F = S
SetLuminosity(0)
gun_light = S
I.loc = src
update_icon()
update_gunlight(user)
@@ -293,51 +293,57 @@ obj/item/weapon/gun/proc/newshot()
if(loc == user)
A.Grant(user)
if(istype(I, /obj/item/weapon/screwdriver))
if(F && can_flashlight)
for(var/obj/item/device/flashlight/seclite/S in src)
user << "<span class='notice'>You unscrew the seclite from [src].</span>"
F = null
S.loc = get_turf(user)
update_gunlight(user)
S.update_brightness(user)
update_icon()
verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
qdel(TGL)
if(istype(I, /obj/item/weapon/screwdriver))
if(gun_light)
for(var/obj/item/device/flashlight/seclite/S in src)
user << "<span class='notice'>You unscrew the seclite from [src].</span>"
gun_light = null
S.forceMove(get_turf(user))
update_gunlight(user)
S.update_brightness(user)
update_icon()
verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
qdel(TGL)
else
..()
if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
rename_gun(user)
..()
/obj/item/weapon/gun/proc/toggle_gunlight()
set name = "Toggle Gunlight"
set category = "Object"
set desc = "Click to toggle your weapon's attached flashlight."
if(!F)
if(!gun_light)
return
var/mob/living/carbon/human/user = usr
if(!isturf(user.loc))
user << "<span class='warning'>You cannot turn the light on while in this [user.loc]!</span>"
F.on = !F.on
user << "<span class='notice'>You toggle the gunlight [F.on ? "on":"off"].</span>"
gun_light.on = !gun_light.on
user << "<span class='notice'>You toggle the gunlight [gun_light.on ? "on":"off"].</span>"
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
update_gunlight(user)
return
/obj/item/weapon/gun/proc/update_gunlight(mob/user = null)
if(F)
if(F.on)
set_light(F.brightness_on)
if(gun_light)
if(gun_light.on)
if(loc == user)
user.AddLuminosity(gun_light.brightness_on)
else if(isturf(loc))
SetLuminosity(gun_light.brightness_on)
else
set_light(0)
if(loc == user)
user.AddLuminosity(-gun_light.brightness_on)
else if(isturf(loc))
SetLuminosity(0)
update_icon()
else
set_light(0)
if(loc == user)
user.AddLuminosity(-5)
else if(isturf(loc))
SetLuminosity(0)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
@@ -345,11 +351,19 @@ obj/item/weapon/gun/proc/newshot()
/obj/item/weapon/gun/pickup(mob/user)
..()
if(gun_light)
if(gun_light.on)
user.AddLuminosity(gun_light.brightness_on)
SetLuminosity(0)
if(azoom)
azoom.Grant(user)
/obj/item/weapon/gun/dropped(mob/user)
..()
if(gun_light)
if(gun_light.on)
user.AddLuminosity(-gun_light.brightness_on)
SetLuminosity(gun_light.brightness_on)
zoom(user,FALSE)
if(azoom)
azoom.Remove(user)
@@ -375,13 +389,6 @@ obj/item/weapon/gun/proc/newshot()
update_icon()
/obj/item/weapon/gun/proc/rename_gun(mob/M)
var/input = stripped_input(M,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
name = input
M << "You name the gun [input]. Say hello to your new friend."
return
/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
@@ -392,7 +399,7 @@ obj/item/weapon/gun/proc/newshot()
return
if(user == target)
target.visible_message("<span class='warning'>[user] sticks [src] in their mouth, ready to pull the trigger...</span>", \
target.visible_message("<span class='warning'>[user] sticks [src] in [user.p_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>", \
@@ -487,8 +494,3 @@ obj/item/weapon/gun/proc/newshot()
azoom = new()
azoom.gun = src
/obj/item/weapon/gun/burn()
if(pin)
qdel(pin)
.=..()
@@ -1,21 +1,25 @@
/obj/item/weapon/gun/projectile
/obj/item/weapon/gun/ballistic
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
w_class = WEIGHT_CLASS_NORMAL
var/spawnwithmagazine = 1
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/casing_ejector = 1 //whether the gun ejects the chambered casing
/obj/item/weapon/gun/projectile/New()
/obj/item/weapon/gun/ballistic/New()
..()
if(!spawnwithmagazine)
update_icon()
return
if (!magazine)
magazine = new mag_type(src)
chamber_round()
update_icon()
/obj/item/weapon/gun/projectile/update_icon()
/obj/item/weapon/gun/ballistic/update_icon()
..()
if(current_skin)
icon_state = "[current_skin][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
@@ -23,43 +27,38 @@
icon_state = "[initial(icon_state)][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
/obj/item/weapon/gun/projectile/process_chamber(eject_casing = 1, empty_chamber = 1)
// if(in_chamber)
// return 1
/obj/item/weapon/gun/ballistic/process_chamber(empty_chamber = 1)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(isnull(AC) || !istype(AC))
chamber_round()
return
if(eject_casing)
AC.loc = get_turf(src) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
if(empty_chamber)
chambered = null
if(istype(AC)) //there's a chambered round
if(casing_ejector)
AC.forceMove(get_turf(src)) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
chambered = null
else if(empty_chamber)
chambered = null
chamber_round()
return
/obj/item/weapon/gun/projectile/proc/chamber_round()
/obj/item/weapon/gun/ballistic/proc/chamber_round()
if (chambered || !magazine)
return
else if (magazine.ammo_count())
chambered = magazine.get_round()
chambered.loc = src
return
chambered.forceMove(src)
/obj/item/weapon/gun/projectile/can_shoot()
/obj/item/weapon/gun/ballistic/can_shoot()
if(!magazine || !magazine.ammo_count(0))
return 0
return 1
/obj/item/weapon/gun/projectile/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/attackby(obj/item/A, mob/user, params)
..()
if (istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if (!magazine && istype(AM, mag_type))
user.remove_from_mob(AM)
magazine = AM
magazine.loc = src
magazine.forceMove(src)
user << "<span class='notice'>You load a new magazine into \the [src].</span>"
chamber_round()
A.update_icon()
@@ -78,7 +77,7 @@
S.oldsound = fire_sound
S.initial_w_class = w_class
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
w_class = 3 //so pistols do not fit in pockets when suppressed
w_class = WEIGHT_CLASS_NORMAL //so pistols do not fit in pockets when suppressed
A.loc = src
update_icon()
return
@@ -90,11 +89,11 @@
return
return 0
/obj/item/weapon/gun/projectile/attack_hand(mob/user)
/obj/item/weapon/gun/ballistic/attack_hand(mob/user)
if(loc == user)
if(suppressed && can_unsuppress)
var/obj/item/weapon/suppressor/S = suppressed
if(user.l_hand != src && user.r_hand != src)
if(!user.is_holding(src))
..()
return
user << "<span class='notice'>You unscrew [suppressed] from [src].</span>"
@@ -106,7 +105,7 @@
return
..()
/obj/item/weapon/gun/projectile/attack_self(mob/living/user)
/obj/item/weapon/gun/ballistic/attack_self(mob/living/user)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(magazine)
magazine.loc = get_turf(src.loc)
@@ -125,11 +124,11 @@
return
/obj/item/weapon/gun/projectile/examine(mob/user)
/obj/item/weapon/gun/ballistic/examine(mob/user)
..()
user << "Has [get_ammo()] round\s remaining."
/obj/item/weapon/gun/projectile/proc/get_ammo(countchambered = 1)
/obj/item/weapon/gun/ballistic/proc/get_ammo(countchambered = 1)
var/boolets = 0 //mature var names for mature people
if (chambered && countchambered)
boolets++
@@ -137,25 +136,25 @@
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>")
/obj/item/weapon/gun/ballistic/suicide_act(mob/user)
if (chambered && chambered.BB && !chambered.BB.nodamage)
user.visible_message("<span class='suicide'>[user] is putting the barrel of [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!</span>")
sleep(25)
if(user.l_hand == src || user.r_hand == src)
if(user.is_holding(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>")
user.visible_message("<span class='suicide'>[user] blows [user.p_their()] brain[user.p_s()] out with [src]!</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>")
user.visible_message("<span class='suicide'>[user] is pretending to blow [user.p_their()] brain[user.p_s()] out with [src]! It looks like [user.p_theyre()] trying to commit suicide!</b></span>")
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
return (OXYLOSS)
/obj/item/weapon/gun/projectile/proc/sawoff(mob/user)
/obj/item/weapon/gun/ballistic/proc/sawoff(mob/user)
if(sawn_state == SAWN_OFF)
user << "<span class='warning'>\The [src] is already shortened!</span>"
return
@@ -173,8 +172,8 @@
user.visible_message("[user] shortens \the [src]!", "<span class='notice'>You shorten \the [src].</span>")
name = "sawn-off [src.name]"
desc = sawn_desc
w_class = 3
item_state = "gun"//phil235 is it different with different skin?
w_class = WEIGHT_CLASS_NORMAL
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)
sawn_state = SAWN_OFF
@@ -182,7 +181,7 @@
return 1
// Sawing guns related proc
/obj/item/weapon/gun/projectile/proc/blow_up(mob/user)
/obj/item/weapon/gun/ballistic/proc/blow_up(mob/user)
. = 0
for(var/obj/item/ammo_casing/AC in magazine.stored_ammo)
if(AC.BB)
@@ -195,7 +194,7 @@
desc = "A universal syndicate small-arms suppressor for maximum espionage."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "suppressor"
w_class = 2
w_class = WEIGHT_CLASS_SMALL
var/oldsound = null
var/initial_w_class = null
@@ -1,6 +1,6 @@
/obj/item/weapon/gun/projectile/automatic
/obj/item/weapon/gun/ballistic/automatic
origin_tech = "combat=4;materials=2"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
var/alarmed = 0
var/select = 1
can_suppress = 1
@@ -8,17 +8,17 @@
fire_delay = 2
actions_types = list(/datum/action/item_action/toggle_firemode)
/obj/item/weapon/gun/projectile/automatic/proto
/obj/item/weapon/gun/ballistic/automatic/proto
name = "\improper NanoTrasen Saber SMG"
desc = "A prototype three-round burst 9mm submachine gun, designated 'SABR'. Has a threaded barrel for suppressors."
icon_state = "saber"
mag_type = /obj/item/ammo_box/magazine/smgm9mm
pin = null
/obj/item/weapon/gun/projectile/automatic/proto/unrestricted
/obj/item/weapon/gun/ballistic/automatic/proto/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/update_icon()
/obj/item/weapon/gun/ballistic/automatic/update_icon()
..()
cut_overlays()
if(!select)
@@ -27,7 +27,7 @@
add_overlay("[initial(icon_state)]burst")
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
/obj/item/weapon/gun/projectile/automatic/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/automatic/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
@@ -36,7 +36,8 @@
if(istype(AM, mag_type))
if(magazine)
user << "<span class='notice'>You perform a tactical reload on \the [src], replacing the magazine.</span>"
magazine.loc = get_turf(src.loc)
magazine.dropped()
magazine.forceMove(get_turf(src.loc))
magazine.update_icon()
magazine = null
else
@@ -49,10 +50,10 @@
update_icon()
return 1
/obj/item/weapon/gun/projectile/automatic/ui_action_click()
/obj/item/weapon/gun/ballistic/automatic/ui_action_click()
burst_select()
/obj/item/weapon/gun/projectile/automatic/proc/burst_select()
/obj/item/weapon/gun/ballistic/automatic/proc/burst_select()
var/mob/living/carbon/human/user = usr
select = !select
if(!select)
@@ -70,17 +71,17 @@
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/weapon/gun/projectile/automatic/can_shoot()
/obj/item/weapon/gun/ballistic/automatic/can_shoot()
return get_ammo()
/obj/item/weapon/gun/projectile/automatic/proc/empty_alarm()
/obj/item/weapon/gun/ballistic/automatic/proc/empty_alarm()
if(!chambered && !get_ammo() && !alarmed)
playsound(src.loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
update_icon()
alarmed = 1
return
/obj/item/weapon/gun/projectile/automatic/c20r
/obj/item/weapon/gun/ballistic/automatic/c20r
name = "\improper C-20r SMG"
desc = "A bullpup two-round burst .45 SMG, designated 'C-20r'. Has a 'Scarborough Arms - Per falcis, per pravitas' buttstamp."
icon_state = "c20r"
@@ -92,24 +93,24 @@
burst_size = 2
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/automatic/c20r/unrestricted
/obj/item/weapon/gun/ballistic/automatic/c20r/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/c20r/New()
/obj/item/weapon/gun/ballistic/automatic/c20r/New()
..()
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/c20r/afterattack()
/obj/item/weapon/gun/ballistic/automatic/c20r/afterattack()
..()
empty_alarm()
return
/obj/item/weapon/gun/projectile/automatic/c20r/update_icon()
/obj/item/weapon/gun/ballistic/automatic/c20r/update_icon()
..()
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
/obj/item/weapon/gun/projectile/automatic/wt550
/obj/item/weapon/gun/ballistic/automatic/wt550
name = "security auto rifle"
desc = "An outdated personal defence weapon. Uses 4.6x30mm rounds and is designated the WT-550 Automatic Rifle."
icon_state = "wt550"
@@ -120,11 +121,11 @@
burst_size = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/wt550/update_icon()
/obj/item/weapon/gun/ballistic/automatic/wt550/update_icon()
..()
icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
/obj/item/weapon/gun/projectile/automatic/mini_uzi
/obj/item/weapon/gun/ballistic/automatic/mini_uzi
name = "\improper 'Type U3' Uzi"
desc = "A lightweight, burst-fire submachine gun, for when you really want someone dead. Uses 9mm rounds."
icon_state = "mini-uzi"
@@ -132,7 +133,7 @@
mag_type = /obj/item/ammo_box/magazine/uzim9mm
burst_size = 2
/obj/item/weapon/gun/projectile/automatic/m90
/obj/item/weapon/gun/ballistic/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"
@@ -141,40 +142,40 @@
mag_type = /obj/item/ammo_box/magazine/m556
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
can_suppress = 0
var/obj/item/weapon/gun/projectile/revolver/grenadelauncher/underbarrel
var/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/underbarrel
burst_size = 3
fire_delay = 2
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/automatic/m90/New()
/obj/item/weapon/gun/ballistic/automatic/m90/New()
..()
underbarrel = new /obj/item/weapon/gun/projectile/revolver/grenadelauncher(src)
underbarrel = new /obj/item/weapon/gun/ballistic/revolver/grenadelauncher(src)
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/m90/unrestricted
/obj/item/weapon/gun/ballistic/automatic/m90/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/m90/unrestricted/New()
/obj/item/weapon/gun/ballistic/automatic/m90/unrestricted/New()
..()
underbarrel = new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/unrestricted(src)
underbarrel = new /obj/item/weapon/gun/ballistic/revolver/grenadelauncher/unrestricted(src)
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
/obj/item/weapon/gun/ballistic/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
if(select == 2)
underbarrel.afterattack(target, user, flag, params)
else
..()
return
/obj/item/weapon/gun/projectile/automatic/m90/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/automatic/m90/attackby(obj/item/A, mob/user, params)
if(istype(A, /obj/item/ammo_casing))
if(istype(A, underbarrel.magazine.ammo_type))
underbarrel.attack_self()
underbarrel.attackby(A, user, params)
else
..()
/obj/item/weapon/gun/projectile/automatic/m90/update_icon()
/obj/item/weapon/gun/ballistic/automatic/m90/update_icon()
..()
cut_overlays()
switch(select)
@@ -186,7 +187,7 @@
add_overlay("[initial(icon_state)]gren")
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
return
/obj/item/weapon/gun/projectile/automatic/m90/burst_select()
/obj/item/weapon/gun/ballistic/automatic/m90/burst_select()
var/mob/living/carbon/human/user = usr
switch(select)
if(0)
@@ -206,12 +207,12 @@
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/tommygun
/obj/item/weapon/gun/ballistic/automatic/tommygun
name = "\improper Thompson SMG"
desc = "Based on the classic 'Chicago Typewriter'."
icon_state = "tommygun"
item_state = "shotgun"
w_class = 5
w_class = WEIGHT_CLASS_HUGE
slot_flags = 0
origin_tech = "combat=5;materials=1;syndicate=3"
mag_type = /obj/item/ammo_box/magazine/tommygunm45
@@ -220,7 +221,7 @@
burst_size = 4
fire_delay = 1
/obj/item/weapon/gun/projectile/automatic/ar
/obj/item/weapon/gun/ballistic/automatic/ar
name = "\improper NT-ARG 'Boarder'"
desc = "A robust assault rile used by Nanotrasen fighting forces."
icon_state = "arg"
@@ -237,12 +238,12 @@
// Bulldog shotgun //
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog
name = "\improper 'Bulldog' Shotgun"
desc = "A semi-auto, mag-fed shotgun for combat in narrow corridors, nicknamed 'Bulldog' by boarding parties. Compatible only with specialized 8-round drum magazines."
icon_state = "bulldog"
item_state = "bulldog"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
origin_tech = "combat=6;materials=4;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/m12g
fire_sound = 'sound/weapons/Gunshot.ogg'
@@ -252,26 +253,26 @@
pin = /obj/item/device/firing_pin/implant/pindicate
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/unrestricted
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/New()
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/New()
..()
update_icon()
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/proc/update_magazine()
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/proc/update_magazine()
if(magazine)
src.overlays = 0
add_overlay("[magazine.icon_state]")
return
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/update_icon()
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/update_icon()
src.overlays = 0
update_magazine()
icon_state = "bulldog[chambered ? "" : "-e"]"
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/afterattack()
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/afterattack()
..()
empty_alarm()
return
@@ -280,16 +281,16 @@
// L6 SAW //
/obj/item/weapon/gun/projectile/automatic/l6_saw
/obj/item/weapon/gun/ballistic/automatic/l6_saw
name = "\improper L6 SAW"
desc = "A heavily modified 5.56x45mm light machine gun, designated 'L6 SAW'. Has 'Aussec Armoury - 2531' engraved on the receiver below the designation."
icon_state = "l6closed100"
item_state = "l6closedmag"
w_class = 5
w_class = WEIGHT_CLASS_HUGE
slot_flags = 0
origin_tech = "combat=6;engineering=3;syndicate=6"
mag_type = /obj/item/ammo_box/magazine/mm556x45
weapon_weight = WEAPON_MEDIUM
weapon_weight = WEAPON_HEAVY
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
var/cover_open = 0
can_suppress = 0
@@ -297,22 +298,22 @@
fire_delay = 1
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/automatic/l6_saw/unrestricted
/obj/item/weapon/gun/ballistic/automatic/l6_saw/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_self(mob/user)
/obj/item/weapon/gun/ballistic/automatic/l6_saw/attack_self(mob/user)
cover_open = !cover_open
user << "<span class='notice'>You [cover_open ? "open" : "close"] [src]'s cover.</span>"
update_icon()
/obj/item/weapon/gun/projectile/automatic/l6_saw/update_icon()
/obj/item/weapon/gun/ballistic/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
/obj/item/weapon/gun/ballistic/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params) //what I tried to do here is just add a check to see if the cover is open or not and add an icon_state change because I can't figure out how c-20rs do it with overlays
if(cover_open)
user << "<span class='warning'>[src]'s cover is open! Close it before firing!</span>"
else
@@ -320,7 +321,7 @@
update_icon()
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_hand(mob/user)
/obj/item/weapon/gun/ballistic/automatic/l6_saw/attack_hand(mob/user)
if(loc != user)
..()
return //let them pick it up
@@ -336,7 +337,7 @@
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)
/obj/item/weapon/gun/ballistic/automatic/l6_saw/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
@@ -349,36 +350,36 @@
// SNIPER //
/obj/item/weapon/gun/projectile/automatic/sniper_rifle
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle
name = "sniper rifle"
desc = "The kind of gun that will leave you crying for mummy before you even realise your leg's missing"
desc = "A long ranged weapon that does significant damage. No, you can't quickscope."
icon_state = "sniper"
item_state = "sniper"
recoil = 2
weapon_weight = WEAPON_MEDIUM
weapon_weight = WEAPON_HEAVY
mag_type = /obj/item/ammo_box/magazine/sniper_rounds
fire_delay = 40
burst_size = 1
origin_tech = "combat=7"
can_unsuppress = 1
can_suppress = 1
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
slot_flags = SLOT_BACK
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/sniper_rifle/update_icon()
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle/update_icon()
if(magazine)
icon_state = "sniper-mag"
else
icon_state = "sniper"
/obj/item/weapon/gun/projectile/automatic/sniper_rifle/syndicate
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle/syndicate
name = "syndicate sniper rifle"
desc = "Syndicate flavoured sniper rifle, it packs quite a punch, a punch to your face"
desc = "An illegally modified .50 cal sniper rifle with supression compatibility. Quickscoping still doesn't work."
pin = /obj/item/device/firing_pin/implant/pindicate
origin_tech = "combat=7;syndicate=6"
@@ -387,7 +388,7 @@
// Laser rifle (rechargeable magazine) //
/obj/item/weapon/gun/projectile/automatic/laser
/obj/item/weapon/gun/ballistic/automatic/laser
name = "laser rifle"
desc = "Though sometimes mocked for the relatively weak firepower of their energy weapons, the logistic miracle of rechargable ammunition has given Nanotrasen a decisive edge over many a foe."
icon_state = "oldrifle"
@@ -398,12 +399,9 @@
burst_size = 0
actions_types = list()
fire_sound = 'sound/weapons/Laser.ogg'
casing_ejector = 0
/obj/item/weapon/gun/projectile/automatic/laser/process_chamber(eject_casing = 0, empty_chamber = 1)
..() //we changed the default value of the first argument
/obj/item/weapon/gun/projectile/automatic/laser/update_icon()
/obj/item/weapon/gun/ballistic/automatic/laser/update_icon()
..()
icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
return
@@ -0,0 +1,106 @@
/obj/item/weapon/gun/ballistic/bow
name = "bow"
desc = "A sturdy bow made out of wood and reinforced with iron."
icon_state = "bow_unloaded"
item_state = "bow"
var/icon_state_loaded = "bow_loaded"
var/icon_state_firing = "bow_firing"
var/item_state_loaded = "bow"
var/item_state_firing = "bow"
fire_sound = 'sound/weapons/grenadelaunch.ogg'
mag_type = /obj/item/ammo_box/magazine/internal/bow
flags = HANDSLOW
weapon_weight = WEAPON_HEAVY
var/draw_sound = 'sound/weapons/draw_bow.ogg'
var/ready_to_fire = 0
var/slowdown_when_ready = 2
/obj/item/weapon/gun/ballistic/bow/update_icon()
if(ready_to_fire)
icon_state = icon_state_firing
item_state = item_state_firing
slowdown = slowdown_when_ready
else if(magazine.ammo_count() && !ready_to_fire)
icon_state = icon_state_loaded
item_state = item_state_loaded
slowdown = initial(slowdown)
else
icon_state = initial(icon_state)
item_state = initial(item_state)
slowdown = initial(slowdown)
/obj/item/weapon/gun/ballistic/bow/dropped(mob/user)
if(magazine && magazine.ammo_count())
magazine.empty_magazine()
ready_to_fire = FALSE
update_icon()
/obj/item/weapon/gun/ballistic/bow/attack_self(mob/living/user)
if(!ready_to_fire && magazine.ammo_count())
ready_to_fire = TRUE
playsound(user, draw_sound, 100, 1)
update_icon()
else
ready_to_fire = FALSE
update_icon()
/obj/item/weapon/gun/ballistic/bow/attackby(obj/item/A, mob/user, params)
var/num_loaded = magazine.attackby(A, user, params, 1)
if(num_loaded)
user << "<span class='notice'>You ready \the [A] into \the [src].</span>"
update_icon()
chamber_round()
/obj/item/weapon/gun/ballistic/bow/can_shoot()
. = ..()
if(!ready_to_fire)
return FALSE
/obj/item/weapon/gun/ballistic/bow/shoot_with_empty_chamber(mob/living/user as mob|obj)
return
/obj/item/weapon/gun/ballistic/bow/process_chamber(eject_casing = 0, empty_chamber = 1)
. = ..()
ready_to_fire = FALSE
update_icon()
// ammo
/obj/item/ammo_box/magazine/internal/bow
name = "bow internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/arrow
caliber = "arrow"
max_ammo = 1
/obj/item/projectile/bullet/reusable/arrow
name = "arrow"
icon_state = "arrow"
ammo_type = /obj/item/ammo_casing/caseless/arrow
range = 10
damage = 25
damage_type = BRUTE
/obj/item/ammo_casing/caseless/arrow
name = "arrow"
desc = "Stab, stab, stab."
icon_state = "arrow"
force = 10
sharpness = IS_SHARP
projectile_type = /obj/item/projectile/bullet/reusable/arrow
caliber = "arrow"
//quiver
/obj/item/weapon/storage/backpack/quiver
name = "quiver"
desc = "A quiver for holding arrows."
icon_state = "quiver"
item_state = "quiver"
storage_slots = 20
can_hold = list(
/obj/item/ammo_casing/caseless/arrow
)
/obj/item/weapon/storage/backpack/quiver/full/New()
..()
for(var/i in 1 to storage_slots)
new /obj/item/ammo_casing/caseless/arrow(src)
@@ -8,8 +8,8 @@
icon_state = "holstered"
item_state = "backpack"
slot_flags = SLOT_BACK
w_class = 5
var/obj/item/weapon/gun/projectile/minigun/gun = null
w_class = WEIGHT_CLASS_HUGE
var/obj/item/weapon/gun/ballistic/minigun/gun = null
var/armed = 0 //whether the gun is attached, 0 is attached, 1 is the gun is wielded.
var/overheat = 0
var/overheat_max = 40
@@ -69,11 +69,7 @@
var/obj/screen/inventory/hand/H = over_object
if(!M.unEquip(src))
return
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
if(slot_l_hand)
M.put_in_l_hand(src)
M.put_in_hand(src, H.held_index)
/obj/item/weapon/minigunpack/update_icon()
@@ -95,7 +91,7 @@
user.update_inv_back()
/obj/item/weapon/gun/projectile/minigun
/obj/item/weapon/gun/ballistic/minigun
name = "laser gatling gun"
desc = "An advanced laser cannon with an incredible rate of fire. Requires a bulky backpack power source to use."
icon = 'icons/obj/guns/minigun.dmi'
@@ -105,7 +101,7 @@
flags = CONDUCT | HANDSLOW
slowdown = 1
slot_flags = null
w_class = 5
w_class = WEIGHT_CLASS_HUGE
materials = list()
burst_size = 3
automatic = 0
@@ -113,41 +109,40 @@
weapon_weight = WEAPON_HEAVY
fire_sound = 'sound/weapons/Laser.ogg'
mag_type = /obj/item/ammo_box/magazine/internal/minigun
casing_ejector = 0
var/obj/item/weapon/minigunpack/ammo_pack
/obj/item/weapon/gun/projectile/minigun/attack_self(mob/living/user)
/obj/item/weapon/gun/ballistic/minigun/attack_self(mob/living/user)
return
/obj/item/weapon/gun/projectile/minigun/dropped(mob/user)
/obj/item/weapon/gun/ballistic/minigun/dropped(mob/user)
if(ammo_pack)
ammo_pack.attach_gun(user)
else
qdel(src)
/obj/item/weapon/gun/projectile/minigun/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
/obj/item/weapon/gun/ballistic/minigun/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
if(ammo_pack)
if(ammo_pack.overheat < ammo_pack.overheat_max)
. = ..()
ammo_pack.overheat++
ammo_pack.overheat += burst_size
..()
else
user << "The gun's heat sensor locked the trigger to prevent lens damage."
/obj/item/weapon/gun/projectile/minigun/afterattack(atom/target, mob/living/user, flag, params)
/obj/item/weapon/gun/ballistic/minigun/afterattack(atom/target, mob/living/user, flag, params)
if(!ammo_pack || ammo_pack.loc != user)
user << "You need the backpack power source to fire the gun!"
..()
/obj/item/weapon/gun/projectile/minigun/New()
/obj/item/weapon/gun/ballistic/minigun/New()
if(!ammo_pack)
if(istype(loc,/obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one.
ammo_pack = loc
..()
else
qdel(src)//No pack, no gun
..()
/obj/item/weapon/gun/projectile/minigun/dropped(mob/living/user)
/obj/item/weapon/gun/ballistic/minigun/dropped(mob/living/user)
ammo_pack.attach_gun(user)
/obj/item/weapon/gun/projectile/minigun/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
@@ -1,25 +1,25 @@
//KEEP IN MIND: These are different from gun/grenadelauncher. These are designed to shoot premade rocket and grenade projectiles, not flashbangs or chemistry casings etc.
//Put handheld rocket launchers here if someone ever decides to make something so hilarious ~Paprika
/obj/item/weapon/gun/projectile/revolver/grenadelauncher//this is only used for underbarrel grenade launchers at the moment, but admins can still spawn it if they feel like being assholes
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher//this is only used for underbarrel grenade launchers at the moment, but admins can still spawn it if they feel like being assholes
desc = "A break-operated grenade launcher."
name = "grenade launcher"
icon_state = "dshotgun-sawn"
item_state = "gun"
mag_type = /obj/item/ammo_box/magazine/internal/grenadelauncher
fire_sound = 'sound/weapons/grenadelaunch.ogg'
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
pin = /obj/item/device/firing_pin/implant/pindicate
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/unrestricted
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
chamber_round()
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/cyborg
desc = "A 6-shot grenade launcher."
name = "multi grenade launcher"
icon = 'icons/mecha/mecha_equipment.dmi'
@@ -27,10 +27,10 @@
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/grenademulti
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg/attack_self()
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/cyborg/attack_self()
return
/obj/item/weapon/gun/projectile/automatic/gyropistol
/obj/item/weapon/gun/ballistic/automatic/gyropistol
name = "gyrojet pistol"
desc = "A prototype pistol designed to fire self propelled rockets."
icon_state = "gyropistol"
@@ -40,20 +40,18 @@
burst_size = 1
fire_delay = 0
actions_types = list()
casing_ejector = 0
/obj/item/weapon/gun/projectile/automatic/gyropistol/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/gyropistol/update_icon()
/obj/item/weapon/gun/ballistic/automatic/gyropistol/update_icon()
..()
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
/obj/item/weapon/gun/projectile/automatic/speargun
/obj/item/weapon/gun/ballistic/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
w_class = WEIGHT_CLASS_BULKY
origin_tech = "combat=4;engineering=4"
force = 10
can_suppress = 0
@@ -63,19 +61,40 @@
fire_delay = 0
select = 0
actions_types = list()
casing_ejector = 0
/obj/item/weapon/gun/projectile/automatic/speargun/update_icon()
/obj/item/weapon/gun/ballistic/automatic/speargun/update_icon()
return
/obj/item/weapon/gun/projectile/automatic/speargun/attack_self()
/obj/item/weapon/gun/ballistic/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)
/obj/item/weapon/gun/ballistic/automatic/speargun/attackby(obj/item/A, mob/user, params)
var/num_loaded = magazine.attackby(A, user, params, 1)
if(num_loaded)
user << "<span class='notice'>You load [num_loaded] spear\s into \the [src].</span>"
update_icon()
chamber_round()
chamber_round()
/obj/item/weapon/gun/ballistic/automatic/atlauncher
desc = "A pre-loaded, single shot anti-armour launcher."
name = "anti-armour grenade launcher"
icon_state = "rocketlauncher"
item_state = "rocketlauncher"
mag_type = /obj/item/ammo_box/magazine/internal/rocketlauncher
fire_sound = 'sound/weapons/rocketlaunch.ogg'
w_class = WEIGHT_CLASS_BULKY
can_suppress = 0
burst_size = 1
fire_delay = 0
select = 0
actions_types = list()
casing_ejector = 0
weapon_weight = WEAPON_HEAVY
/obj/item/weapon/gun/ballistic/automatic/atlauncher/attack_self()
return
/obj/item/weapon/gun/ballistic/automatic/atlauncher/update_icon()
..()
icon_state = "rocketlauncher[magazine ? "-[get_ammo(1)]" : ""]"
@@ -1,8 +1,8 @@
/obj/item/weapon/gun/projectile/automatic/pistol
/obj/item/weapon/gun/ballistic/automatic/pistol
name = "stechkin pistol"
desc = "A small, easily concealable 10mm handgun. Has a threaded barrel for suppressors."
icon_state = "pistol"
w_class = 2
w_class = WEIGHT_CLASS_SMALL
origin_tech = "combat=3;materials=2;syndicate=4"
mag_type = /obj/item/ammo_box/magazine/m10mm
can_suppress = 1
@@ -10,20 +10,20 @@
fire_delay = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/pistol/update_icon()
/obj/item/weapon/gun/ballistic/automatic/pistol/update_icon()
..()
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
return
/obj/item/weapon/gun/projectile/automatic/pistol/m1911
/obj/item/weapon/gun/ballistic/automatic/pistol/m1911
name = "\improper M1911"
desc = "A classic .45 handgun with a small magazine capacity."
icon_state = "m1911"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
mag_type = /obj/item/ammo_box/magazine/m45
can_suppress = 0
/obj/item/weapon/gun/projectile/automatic/pistol/deagle
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle
name = "desert eagle"
desc = "A robust .50 AE handgun."
icon_state = "deagle"
@@ -31,28 +31,46 @@
mag_type = /obj/item/ammo_box/magazine/m50
can_suppress = 0
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/update_icon()
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle/update_icon()
..()
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/gold
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle/gold
desc = "A gold plated desert eagle folded over a million times by superior martian gunsmiths. Uses .50 AE ammo."
icon_state = "deagleg"
item_state = "deagleg"
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/camo
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle/camo
desc = "A Deagle brand Deagle for operators operating operationally. Uses .50 AE ammo."
icon_state = "deaglecamo"
item_state = "deagleg"
/obj/item/weapon/gun/projectile/automatic/pistol/APS
/obj/item/weapon/gun/ballistic/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
w_class = WEIGHT_CLASS_NORMAL
origin_tech = "combat=3;materials=2;syndicate=3"
mag_type = /obj/item/ammo_box/magazine/pistolm9mm
can_suppress = 0
burst_size = 3
fire_delay = 2
actions_types = list(/datum/action/item_action/toggle_firemode)
/obj/item/weapon/gun/ballistic/automatic/pistol/stickman
name = "flat gun"
desc = "A 2 dimensional gun.. what?"
icon_state = "flatgun"
origin_tech = "combat=3;materials=2;abductor=3"
/obj/item/weapon/gun/ballistic/automatic/pistol/stickman/pickup(mob/living/user)
user << "<span class='notice'>As you try to pick up [src], it slips out of your grip..</span>"
if(prob(50))
user << "<span class='notice'>..and vanishes from your vision! Where the hell did it go?</span>"
user.unEquip(src)
qdel(src)
user.update_icons()
else
user << "<span class='notice'>..and falls into view. Whew, that was a close one.</span>"
user.unEquip(src)
@@ -1,30 +1,27 @@
/obj/item/weapon/gun/projectile/revolver
/obj/item/weapon/gun/ballistic/revolver
name = "\improper .357 revolver"
desc = "A suspicious revolver. Uses .357 ammo." //usually used by syndicates
icon_state = "revolver"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder
origin_tech = "combat=3;materials=2"
casing_ejector = 0
/obj/item/weapon/gun/projectile/revolver/New()
/obj/item/weapon/gun/ballistic/revolver/New()
..()
if(!istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder))
verbs -= /obj/item/weapon/gun/projectile/revolver/verb/spin
verbs -= /obj/item/weapon/gun/ballistic/revolver/verb/spin
/obj/item/weapon/gun/projectile/revolver/chamber_round(var/spin = 1)
/obj/item/weapon/gun/ballistic/revolver/chamber_round(spin = 1)
if(spin)
chambered = magazine.get_round(1)
else
chambered = magazine.stored_ammo[1]
return
/obj/item/weapon/gun/projectile/revolver/shoot_with_empty_chamber(mob/living/user as mob|obj)
/obj/item/weapon/gun/ballistic/revolver/shoot_with_empty_chamber(mob/living/user as mob|obj)
..()
chamber_round(1)
/obj/item/weapon/gun/projectile/revolver/process_chamber()
return ..(0, 1)
/obj/item/weapon/gun/projectile/revolver/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/revolver/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
@@ -35,11 +32,7 @@
update_icon()
chamber_round(0)
if(unique_rename)
if(istype(A, /obj/item/weapon/pen))
rename_gun(user)
/obj/item/weapon/gun/projectile/revolver/attack_self(mob/living/user)
/obj/item/weapon/gun/ballistic/revolver/attack_self(mob/living/user)
var/num_unloaded = 0
chambered = null
while (get_ammo() > 0)
@@ -55,7 +48,7 @@
else
user << "<span class='warning'>[src] is empty!</span>"
/obj/item/weapon/gun/projectile/revolver/verb/spin()
/obj/item/weapon/gun/ballistic/revolver/verb/spin()
set name = "Spin Chamber"
set category = "Object"
set desc = "Click to spin your revolver's chamber."
@@ -71,13 +64,13 @@
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
verbs -= /obj/item/weapon/gun/ballistic/revolver/verb/spin
/obj/item/weapon/gun/projectile/revolver/can_shoot()
/obj/item/weapon/gun/ballistic/revolver/can_shoot()
return get_ammo(0,0)
/obj/item/weapon/gun/projectile/revolver/get_ammo(countchambered = 0, countempties = 1)
/obj/item/weapon/gun/ballistic/revolver/get_ammo(countchambered = 0, countempties = 1)
var/boolets = 0 //mature var names for mature people
if (chambered && countchambered)
boolets++
@@ -85,11 +78,11 @@
boolets += magazine.ammo_count(countempties)
return boolets
/obj/item/weapon/gun/projectile/revolver/examine(mob/user)
/obj/item/weapon/gun/ballistic/revolver/examine(mob/user)
..()
user << "[get_ammo(0,0)] of those are live rounds."
/obj/item/weapon/gun/projectile/revolver/detective
/obj/item/weapon/gun/ballistic/revolver/detective
name = "\improper .38 Mars Special"
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
icon_state = "detective"
@@ -97,7 +90,7 @@
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/projectile/revolver/detective/New()
/obj/item/weapon/gun/ballistic/revolver/detective/New()
..()
options["Default"] = "detective"
options["Leopard Spots"] = "detective_leopard"
@@ -106,17 +99,17 @@
options["The Peacemaker"] = "detective_peacemaker"
options["Cancel"] = null
/obj/item/weapon/gun/projectile/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
/obj/item/weapon/gun/ballistic/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
if(magazine.caliber != initial(magazine.caliber))
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
playsound(user, fire_sound, 50, 1)
user << "<span class='userdanger'>[src] blows up in your face!</span>"
user.take_organ_damage(0,20)
user.take_bodypart_damage(0,20)
user.unEquip(src)
return 0
..()
/obj/item/weapon/gun/projectile/revolver/detective/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/revolver/detective/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/weapon/screwdriver))
if(magazine.caliber == "38")
@@ -125,7 +118,7 @@
afterattack(user, user) //you know the drill
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
return
if(do_after(user, 30/A.toolspeed, target = src))
if(do_after(user, 30*A.toolspeed, target = src))
if(magazine.ammo_count())
user << "<span class='warning'>You can't modify it!</span>"
return
@@ -138,7 +131,7 @@
afterattack(user, user) //and again
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
return
if(do_after(user, 30/A.toolspeed, target = src))
if(do_after(user, 30*A.toolspeed, target = src))
if(magazine.ammo_count())
user << "<span class='warning'>You can't modify it!</span>"
return
@@ -147,12 +140,12 @@
user << "<span class='notice'>You remove the modifications on [src]. Now it will fire .38 rounds.</span>"
/obj/item/weapon/gun/projectile/revolver/mateba
/obj/item/weapon/gun/ballistic/revolver/mateba
name = "\improper Unica 6 auto-revolver"
desc = "A retro high-powered autorevolver typically used by officers of the New Russia military. Uses .357 ammo."
icon_state = "mateba"
/obj/item/weapon/gun/projectile/revolver/golden
/obj/item/weapon/gun/ballistic/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"
@@ -160,7 +153,7 @@
recoil = 8
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/revolver/nagant
/obj/item/weapon/gun/ballistic/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"
@@ -172,59 +165,39 @@
// A gun to play Russian Roulette!
// You can spin the chamber to randomize the position of the bullet.
/obj/item/weapon/gun/projectile/revolver/russian
/obj/item/weapon/gun/ballistic/revolver/russian
name = "\improper russian revolver"
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism requiring you to spin the chamber before each trigger pull."
origin_tech = "combat=2;materials=2"
mag_type = /obj/item/ammo_box/magazine/internal/rus357
var/spun = 0
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357
var/spun = FALSE
/obj/item/weapon/gun/projectile/revolver/russian/New()
/obj/item/weapon/gun/ballistic/revolver/russian/New()
..()
Spin()
spin()
spun = TRUE
update_icon()
/obj/item/weapon/gun/projectile/revolver/russian/proc/Spin()
chambered = null
var/random = rand(1, magazine.max_ammo)
if(random <= get_ammo(0,0))
chamber_round()
spun = 1
/obj/item/weapon/gun/projectile/revolver/russian/attackby(obj/item/A, mob/user, params)
var/num_loaded = ..()
if(num_loaded)
user.visible_message("[user] loads a single bullet into the revolver and spins the chamber.", "<span class='notice'>You load a single bullet into the chamber and spin it.</span>")
else
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
/obj/item/weapon/gun/ballistic/revolver/russian/attackby(obj/item/A, mob/user, params)
..()
if(get_ammo() > 0)
Spin()
spin()
spun = TRUE
update_icon()
A.update_icon()
return
/obj/item/weapon/gun/projectile/revolver/russian/attack_self(mob/user)
/obj/item/weapon/gun/ballistic/revolver/russian/attack_self(mob/user)
if(!spun && can_shoot())
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
Spin()
else
var/num_unloaded = 0
while (get_ammo() > 0)
var/obj/item/ammo_casing/CB
CB = magazine.get_round()
chambered = null
CB.loc = get_turf(src.loc)
CB.update_icon()
num_unloaded++
if (num_unloaded)
user << "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>"
else
user << "<span class='notice'>[src] is empty.</span>"
spin()
spun = TRUE
return
..()
/obj/item/weapon/gun/projectile/revolver/russian/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)
/obj/item/weapon/gun/ballistic/revolver/russian/afterattack(atom/target, mob/living/user, flag, params)
if(flag)
if(!(target in user.contents) && ismob(target))
if(user.a_intent == "harm") // Flogging action
if(user.a_intent == INTENT_HARM) // Flogging action
return
if(isliving(user))
@@ -241,32 +214,33 @@
user << "<span class='warning'>You need to spin the revolver's chamber first!</span>"
return
spun = 0
spun = FALSE
if(chambered)
var/obj/item/ammo_casing/AC = chambered
if(AC.fire(user, user))
if(AC.fire_casing(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>")
user.visible_message("<span class='danger'>[user.name] cowardly fires [src] at [user.p_their()] [affecting.name]!</span>", "<span class='userdanger'>You cowardly fire [src] at your [affecting.name]!</span>", "<span class='italics'>You hear a gunshot!</span>")
chambered = null
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")
/obj/item/weapon/gun/ballistic/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>")
user.visible_message("<span class='danger'>[user.name] fires [src] at [user.p_their()] head!</span>", "<span class='userdanger'>You fire [src] at your head!</span>", "<span class='italics'>You hear a gunshot!</span>")
/obj/item/weapon/gun/projectile/revolver/russian/soul
/obj/item/weapon/gun/ballistic/revolver/russian/soul
name = "cursed russian revolver"
desc = "To play with this revolver requires wagering your very soul."
/obj/item/weapon/gun/projectile/revolver/russian/soul/shoot_self(mob/living/user)
/obj/item/weapon/gun/ballistic/revolver/russian/soul/shoot_self(mob/living/user)
..()
var/obj/item/device/soulstone/anybody/SS = new /obj/item/device/soulstone/anybody(get_turf(src))
if(!SS.transfer_soul("FORCE", user)) //Something went wrong
@@ -274,18 +248,16 @@
return
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfiet!</span>")
/////////////////////////////
// DOUBLE BARRELED SHOTGUN //
/////////////////////////////
/obj/item/weapon/gun/projectile/revolver/doublebarrel
/obj/item/weapon/gun/ballistic/revolver/doublebarrel
name = "double-barreled shotgun"
desc = "A true classic."
icon_state = "dshotgun"
item_state = "shotgun"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
@@ -294,7 +266,7 @@
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/projectile/revolver/doublebarrel/New()
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/New()
..()
options["Default"] = "dshotgun"
options["Dark Red Finish"] = "dshotgun-d"
@@ -304,7 +276,7 @@
options["Rosewood"] = "dshotgun-p"
options["Cancel"] = null
/obj/item/weapon/gun/projectile/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
chamber_round()
@@ -315,7 +287,7 @@
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)
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/attack_self(mob/living/user)
var/num_unloaded = 0
while (get_ammo() > 0)
var/obj/item/ammo_casing/CB
@@ -329,17 +301,14 @@
else
user << "<span class='warning'>[src] is empty!</span>"
// IMPROVISED SHOTGUN //
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised
name = "improvised shotgun"
desc = "Essentially a tube that aims shotgun shells."
icon_state = "ishotgun"
item_state = "shotgun"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
force = 10
slot_flags = null
mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised
@@ -348,7 +317,7 @@
unique_reskin = 0
var/slung = 0
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/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
@@ -360,12 +329,12 @@
else
user << "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>"
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/update_icon()
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/update_icon()
..()
if(slung)
icon_state += "sling"
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/sawoff(mob/user)
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/sawoff(mob/user)
. = ..()
if(. && slung) //sawing off the gun removes the sling
new /obj/item/stack/cable_coil(get_turf(src), 10)
@@ -1,17 +1,19 @@
/obj/item/weapon/gun/projectile/shotgun
/obj/item/weapon/gun/ballistic/shotgun
name = "shotgun"
desc = "A traditional shotgun with wood furniture and a four-shell capacity underneath."
icon_state = "shotgun"
item_state = "shotgun"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
origin_tech = "combat=4;materials=2"
mag_type = /obj/item/ammo_box/magazine/internal/shot
casing_ejector = 0
var/recentpump = 0 // to prevent spammage
weapon_weight = WEAPON_MEDIUM
/obj/item/weapon/gun/projectile/shotgun/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/shotgun/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
@@ -21,18 +23,18 @@
A.update_icon()
update_icon()
/obj/item/weapon/gun/projectile/shotgun/process_chamber()
return ..(0, 0)
/obj/item/weapon/gun/ballistic/shotgun/process_chamber(empty_chamber = 0)
return ..() //changed argument value
/obj/item/weapon/gun/projectile/shotgun/chamber_round()
/obj/item/weapon/gun/ballistic/shotgun/chamber_round()
return
/obj/item/weapon/gun/projectile/shotgun/can_shoot()
/obj/item/weapon/gun/ballistic/shotgun/can_shoot()
if(!chambered)
return 0
return (chambered.BB ? 1 : 0)
/obj/item/weapon/gun/projectile/shotgun/attack_self(mob/living/user)
/obj/item/weapon/gun/ballistic/shotgun/attack_self(mob/living/user)
if(recentpump)
return
pump(user)
@@ -41,50 +43,50 @@
recentpump = 0
return
/obj/item/weapon/gun/projectile/shotgun/blow_up(mob/user)
/obj/item/weapon/gun/ballistic/shotgun/blow_up(mob/user)
. = 0
if(chambered && chambered.BB)
process_fire(user, user,0)
. = 1
/obj/item/weapon/gun/projectile/shotgun/proc/pump(mob/M)
/obj/item/weapon/gun/ballistic/shotgun/proc/pump(mob/M)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
pump_unload(M)
pump_reload(M)
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/proc/pump_unload(mob/M)
/obj/item/weapon/gun/ballistic/shotgun/proc/pump_unload(mob/M)
if(chambered)//We have a shell in the chamber
chambered.loc = get_turf(src)//Eject casing
chambered.SpinAnimation(5, 1)
chambered = null
/obj/item/weapon/gun/projectile/shotgun/proc/pump_reload(mob/M)
/obj/item/weapon/gun/ballistic/shotgun/proc/pump_reload(mob/M)
if(!magazine.ammo_count())
return 0
var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing.
chambered = AC
/obj/item/weapon/gun/projectile/shotgun/examine(mob/user)
/obj/item/weapon/gun/ballistic/shotgun/examine(mob/user)
..()
if (chambered)
user << "A [chambered.BB ? "live" : "spent"] one is in the chamber."
/obj/item/weapon/gun/projectile/shotgun/lethal
/obj/item/weapon/gun/ballistic/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
/obj/item/weapon/gun/ballistic/shotgun/riot //for spawn in the armory
name = "riot shotgun"
desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control."
icon_state = "riotshotgun"
mag_type = /obj/item/ammo_box/magazine/internal/shot/riot
sawn_desc = "Come with me if you want to live."
/obj/item/weapon/gun/projectile/shotgun/riot/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/shotgun/riot/attackby(obj/item/A, mob/user, params)
..()
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
sawoff(user)
@@ -97,7 +99,7 @@
// BOLT ACTION RIFLE //
///////////////////////
/obj/item/weapon/gun/projectile/shotgun/boltaction
/obj/item/weapon/gun/ballistic/shotgun/boltaction
name = "\improper Mosin Nagant"
desc = "This piece of junk looks like something that could have been used 700 years ago. It feels slightly moist."
icon_state = "moistnugget"
@@ -106,7 +108,7 @@
mag_type = /obj/item/ammo_box/magazine/internal/boltaction
var/bolt_open = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/pump(mob/M)
/obj/item/weapon/gun/ballistic/shotgun/boltaction/pump(mob/M)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
if(bolt_open)
pump_reload(M)
@@ -116,83 +118,103 @@
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
/obj/item/weapon/gun/ballistic/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
if(!bolt_open)
user << "<span class='notice'>The bolt is closed!</span>"
return
. = ..()
/obj/item/weapon/gun/projectile/shotgun/boltaction/examine(mob/user)
/obj/item/weapon/gun/ballistic/shotgun/boltaction/examine(mob/user)
..()
user << "The bolt is [bolt_open ? "open" : "closed"]."
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted
name = "enchanted bolt action rifle"
desc = "Careful not to lose your head."
var/guns_left = 30
var/gun_type
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/New()
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/arcane_barrage
name = "arcane barrage"
desc = "Pew Pew Pew"
fire_sound = 'sound/weapons/emitter.ogg'
pin = /obj/item/device/firing_pin/magic
icon_state = "arcane_barrage"
item_state = "arcane_barrage"
flags = DROPDEL
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/New()
..()
bolt_open = 1
pump()
gun_type = type
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/dropped()
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/dropped()
..()
guns_left = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/proc/discard_gun(mob/user)
throw_at_fast(pick(oview(7,get_turf(user))),1,1)
user.visible_message("<span class='warning'>[user] tosses aside the spent rifle!</span>")
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/arcane_barrage/discard_gun(mob/user)
return
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
..()
if(guns_left)
var/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/GUN = new
GUN.guns_left = src.guns_left - 1
var/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/GUN = new gun_type
GUN.guns_left = guns_left - 1
user.drop_item()
user.swap_hand()
user.put_in_hands(GUN)
else
user.drop_item()
src.throw_at_fast(pick(oview(7,get_turf(user))),1,1)
user.visible_message("<span class='warning'>[user] tosses aside the spent rifle!</span>")
discard_gun(user)
// Automatic Shotguns//
/obj/item/weapon/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
/obj/item/weapon/gun/ballistic/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
..()
src.pump(user)
/obj/item/weapon/gun/projectile/shotgun/automatic/combat
/obj/item/weapon/gun/ballistic/shotgun/automatic/combat
name = "combat shotgun"
desc = "A semi automatic shotgun with tactical furniture and a six-shell capacity underneath."
icon_state = "cshotgun"
origin_tech = "combat=6"
mag_type = /obj/item/ammo_box/magazine/internal/shot/com
w_class = 5
w_class = WEIGHT_CLASS_HUGE
//Dual Feed Shotgun
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube
/obj/item/weapon/gun/ballistic/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
w_class = WEIGHT_CLASS_HUGE
var/toggled = 0
var/obj/item/ammo_box/magazine/internal/shot/alternate_magazine
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/New()
/obj/item/weapon/gun/ballistic/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)
/obj/item/weapon/gun/ballistic/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)
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/proc/toggle_tube(mob/living/user)
var/current_mag = magazine
var/alt_mag = alternate_magazine
magazine = alt_mag
@@ -203,7 +225,7 @@
else
user << "You switch to tube A."
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/AltClick(mob/living/user)
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/AltClick(mob/living/user)
if(user.incapacitated() || !Adjacent(user) || !istype(user))
return
pump()
@@ -1,4 +1,4 @@
/obj/item/weapon/gun/projectile/automatic/toy
/obj/item/weapon/gun/ballistic/automatic/toy
name = "foam force SMG"
desc = "A prototype three-round burst toy submachine gun. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
@@ -12,18 +12,16 @@
can_suppress = 0
clumsy_check = 0
needs_permit = 0
casing_ejector = 0
/obj/item/weapon/gun/projectile/automatic/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/toy/unrestricted
/obj/item/weapon/gun/ballistic/automatic/toy/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/toy/pistol
/obj/item/weapon/gun/ballistic/automatic/toy/pistol
name = "foam force pistol"
desc = "A small, easily concealable toy handgun. Ages 8 and up."
icon_state = "pistol"
w_class = 2
w_class = WEIGHT_CLASS_SMALL
mag_type = /obj/item/ammo_box/magazine/toy/pistol
fire_sound = 'sound/weapons/Gunshot.ogg'
can_suppress = 0
@@ -31,24 +29,24 @@
fire_delay = 0
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/toy/pistol/update_icon()
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/update_icon()
..()
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot
mag_type = /obj/item/ammo_box/magazine/toy/pistol/riot
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot/New()
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot/New()
magazine = new /obj/item/ammo_box/magazine/toy/pistol/riot(src)
..()
/obj/item/weapon/gun/projectile/automatic/toy/pistol/unrestricted
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot/unrestricted
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/shotgun/toy
/obj/item/weapon/gun/ballistic/shotgun/toy
name = "foam force shotgun"
desc = "A toy shotgun with wood furniture and a four-shell capacity underneath. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
@@ -58,16 +56,17 @@
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy
clumsy_check = 0
needs_permit = 0
casing_ejector = 0
/obj/item/weapon/gun/projectile/shotgun/toy/process_chamber()
/obj/item/weapon/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0)
..()
if(chambered && !chambered.BB)
qdel(chambered)
/obj/item/weapon/gun/projectile/shotgun/toy/unrestricted
/obj/item/weapon/gun/ballistic/shotgun/toy/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/shotgun/toy/crossbow
/obj/item/weapon/gun/ballistic/shotgun/toy/crossbow
name = "foam force crossbow"
desc = "A weapon favored by many overactive children. Ages 8 and up."
icon = 'icons/obj/toy.dmi'
@@ -76,33 +75,28 @@
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy/crossbow
fire_sound = 'sound/items/syringeproj.ogg'
slot_flags = SLOT_BELT
w_class = 2
w_class = WEIGHT_CLASS_SMALL
/obj/item/weapon/gun/projectile/automatic/c20r/toy
/obj/item/weapon/gun/ballistic/automatic/c20r/toy
name = "donksoft SMG"
desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
can_suppress = 0
needs_permit = 0
mag_type = /obj/item/ammo_box/magazine/toy/smgm45
casing_ejector = 0
/obj/item/weapon/gun/projectile/automatic/c20r/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/c20r/toy/unrestricted
/obj/item/weapon/gun/ballistic/automatic/c20r/toy/unrestricted
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy
/obj/item/weapon/gun/ballistic/automatic/l6_saw/toy
name = "donksoft LMG"
desc = "A heavily modified toy light machine gun, designated 'L6 SAW'. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi'
can_suppress = 0
needs_permit = 0
mag_type = /obj/item/ammo_box/magazine/toy/m762
casing_ejector = 0
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/unrestricted
/obj/item/weapon/gun/ballistic/automatic/l6_saw/toy/unrestricted
pin = /obj/item/device/firing_pin
+46 -39
View File
@@ -16,9 +16,12 @@
var/selfcharge = 0
var/charge_tick = 0
var/charge_delay = 4
var/use_cyborg_cell = 0 //whether the gun's cell drains the cyborg user's cell to recharge
/obj/item/weapon/gun/energy/emp_act(severity)
power_supply.use(round(power_supply.charge / severity))
chambered = null //we empty the chamber
recharge_newshot() //and try to charge a new shot
update_icon()
@@ -29,6 +32,13 @@
else
power_supply = new(src)
power_supply.give(power_supply.maxcharge)
update_ammo_types()
recharge_newshot(1)
if(selfcharge)
START_PROCESSING(SSobj, src)
update_icon()
/obj/item/weapon/gun/energy/proc/update_ammo_types()
var/obj/item/ammo_casing/energy/shot
for (var/i = 1, i <= ammo_type.len, i++)
var/shottype = ammo_type[i]
@@ -37,12 +47,11 @@
shot = ammo_type[select]
fire_sound = shot.fire_sound
fire_delay = shot.delay
if(selfcharge)
START_PROCESSING(SSobj, src)
update_icon()
return
/obj/item/weapon/gun/energy/Destroy()
if(power_supply)
qdel(power_supply)
power_supply = null
STOP_PROCESSING(SSobj, src)
return ..()
@@ -55,6 +64,8 @@
if(!power_supply)
return
power_supply.give(100)
if(!chambered) //if empty chamber we try to charge a new shot
recharge_newshot(1)
update_icon()
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
@@ -62,29 +73,33 @@
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()
/obj/item/weapon/gun/energy/recharge_newshot(no_cyborg_drain)
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
if(use_cyborg_cell && !no_cyborg_drain)
if(iscyborg(loc))
var/mob/living/silicon/robot/R = loc
if(R.cell)
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
if(R.cell.use(shot.e_cost)) //Take power from the borg...
power_supply.give(shot.e_cost) //... to recharge the shot
if(!chambered)
var/obj/item/ammo_casing/energy/AC = ammo_type[select]
if(power_supply.charge >= AC.e_cost) //if there's enough power in the power_supply cell...
chambered = AC //...prepare a new shot based on the current ammo type selected
if(!chambered.BB)
chambered.newshot()
/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
recharge_newshot() //try to charge a new shot
/obj/item/weapon/gun/energy/proc/select_fire(mob/living/user)
select++
@@ -95,6 +110,8 @@
fire_delay = shot.delay
if (shot.select_name)
user << "<span class='notice'>[src] is now set to [shot.select_name].</span>"
chambered = null
recharge_newshot(1)
update_icon()
return
@@ -119,9 +136,9 @@
add_overlay(image(icon = icon, icon_state = iconState, pixel_x = ammo_x_offset * (i -1)))
else
add_overlay(image(icon = icon, icon_state = "[icon_state]_charge[ratio]"))
if(F && can_flashlight)
if(gun_light && can_flashlight)
var/iconF = "flight"
if(F.on)
if(gun_light.on)
iconF = "flight_on"
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
if(itemState)
@@ -133,10 +150,10 @@
/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>")
user.visible_message("<span class='suicide'>[user] is putting the barrel of [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] 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>")
if(user.is_holding(src))
user.visible_message("<span class='suicide'>[user] melts [user.p_their()] face off with [src]!</span>")
playsound(loc, fire_sound, 50, 1, -1)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
power_supply.use(shot.e_cost)
@@ -146,27 +163,17 @@
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>")
user.visible_message("<span class='suicide'>[user] is pretending to blow [user.p_their()] brains out with [src]! It looks like [user.p_theyre()] trying to commit suicide!</b></span>")
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
return (OXYLOSS)
/obj/item/weapon/gun/energy/proc/robocharge()
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
if(R.cell.use(shot.e_cost)) //Take power from the borg...
power_supply.give(shot.e_cost) //... to recharge the shot
/obj/item/weapon/gun/energy/on_varedit(modified_var)
if(modified_var == "selfcharge")
if(selfcharge)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
..()
/obj/item/weapon/gun/energy/vv_edit_var(var_name, var_value)
switch(var_name)
if("selfcharge")
if(var_value)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/weapon/gun/energy/burn()
if(power_supply)
qdel(power_supply)
.=..()
@@ -1,37 +1,43 @@
/obj/item/weapon/gun/energy/gun
/obj/item/weapon/gun/energy/e_gun
name = "energy gun"
desc = "A basic hybrid energy gun with two settings: disable and kill."
icon_state = "energy"
item_state = null //so the human update icon uses the icon_state instead.
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser)
origin_tech = "combat=4;magnets=3"
modifystate = 2
modifystate = 1
can_flashlight = 1
ammo_x_offset = 3
flight_x_offset = 15
flight_y_offset = 10
/obj/item/weapon/gun/energy/gun/mini
/obj/item/weapon/gun/energy/e_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
w_class = WEIGHT_CLASS_SMALL
cell_type = /obj/item/weapon/stock_parts/cell{charge = 600; maxcharge = 600}
ammo_x_offset = 2
charge_sections = 3
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
/obj/item/weapon/gun/energy/gun/mini/New()
F = new /obj/item/device/flashlight/seclite(src)
/obj/item/weapon/gun/energy/e_gun/mini/New()
gun_light = new /obj/item/device/flashlight/seclite(src)
..()
/obj/item/weapon/gun/energy/gun/mini/update_icon()
/obj/item/weapon/gun/energy/e_gun/mini/update_icon()
..()
if(F && F.on)
if(gun_light && gun_light.on)
add_overlay("mini-light")
/obj/item/weapon/gun/energy/gun/hos
/obj/item/weapon/gun/energy/e_gun/mini/practice_phaser
name = "practice phaser"
desc = "A modified version of the basic phaser gun, this one fires less concentrated energy bolts designed for target practice."
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser/practice)
icon_state = "decloner"
/obj/item/weapon/gun/energy/e_gun/hos
name = "\improper X-01 MultiPhase Energy Gun"
desc = "This is an expensive, modern recreation of an antique laser gun. This gun has several unique firemodes, but lacks the ability to recharge over time."
icon_state = "hoslaser"
@@ -39,8 +45,9 @@
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
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/weapon/gun/energy/gun/dragnet
/obj/item/weapon/gun/energy/e_gun/dragnet
name = "\improper DRAGnet"
desc = "The \"Dynamic Rapid-Apprehension of the Guilty\" net is a revolution in law enforcement technology."
icon_state = "dragnet"
@@ -49,25 +56,25 @@
can_flashlight = 0
ammo_x_offset = 1
/obj/item/weapon/gun/energy/gun/dragnet/snare
/obj/item/weapon/gun/energy/e_gun/dragnet/snare
name = "Energy Snare Launcher"
desc = "Fires an energy snare that slows the target down"
ammo_type = list(/obj/item/ammo_casing/energy/trap)
/obj/item/weapon/gun/energy/gun/turret
/obj/item/weapon/gun/energy/e_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
w_class = WEIGHT_CLASS_HUGE
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
weapon_weight = WEAPON_MEDIUM
weapon_weight = WEAPON_HEAVY
can_flashlight = 0
trigger_guard = TRIGGER_GUARD_NONE
ammo_x_offset = 2
/obj/item/weapon/gun/energy/gun/nuclear
/obj/item/weapon/gun/energy/e_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"
@@ -79,3 +86,46 @@
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
var/fail_tick = 0
var/fail_chance = 0
/obj/item/weapon/gun/energy/e_gun/nuclear/process()
if(fail_tick > 0)
fail_tick--
..()
/obj/item/weapon/gun/energy/e_gun/nuclear/shoot_live_shot()
failcheck()
update_icon()
..()
/obj/item/weapon/gun/energy/e_gun/nuclear/proc/failcheck()
if(prob(fail_chance) && isliving(loc))
var/mob/living/M = loc
switch(fail_tick)
if(0 to 200)
fail_tick += (2*(fail_chance))
M.rad_act(40)
M << "<span class='userdanger'>Your [name] feels warmer.</span>"
if(201 to INFINITY)
SSobj.processing.Remove(src)
M.rad_act(80)
crit_fail = 1
M << "<span class='userdanger'>Your [name]'s reactor overloads!</span>"
/obj/item/weapon/gun/energy/e_gun/nuclear/emp_act(severity)
..()
fail_chance = min(fail_chance + round(15/severity), 100)
/obj/item/weapon/gun/energy/e_gun/nuclear/update_icon()
..()
if(crit_fail)
add_overlay("[icon_state]_fail_3")
else
switch(fail_tick)
if(0)
add_overlay("[icon_state]_fail_0")
if(1 to 150)
add_overlay("[icon_state]_fail_1")
if(151 to INFINITY)
add_overlay("[icon_state]_fail_2")
@@ -0,0 +1,413 @@
/obj/item/weapon/gun/energy/kinetic_accelerator
name = "proto-kinetic accelerator"
desc = "A self recharging, ranged mining tool that does increased damage in low pressure. Capable of holding up to six slots worth of mod kits."
icon_state = "kineticgun"
item_state = "kineticgun"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic)
cell_type = /obj/item/weapon/stock_parts/cell/emproof
needs_permit = 0
unique_rename = 1
origin_tech = "combat=3;powerstorage=3;engineering=3"
weapon_weight = WEAPON_LIGHT
can_flashlight = 1
flight_x_offset = 15
flight_y_offset = 9
var/overheat_time = 16
var/holds_charge = FALSE
var/unique_frequency = FALSE // modified by KA modkits
var/overheat = FALSE
var/max_mod_capacity = 100
var/list/modkits = list()
var/empty_state = "kineticgun_empty"
/obj/item/weapon/gun/energy/kinetic_accelerator/examine(mob/user)
..()
if(max_mod_capacity)
user << "<b>[get_remaining_mod_capacity()]%</b> mod capacity remaining."
for(var/A in get_modkits())
var/obj/item/borg/upgrade/modkit/M = A
user << "<span class='notice'>There is a [M.name] mod installed, using <b>[M.cost]%</b> capacity.</span>"
/obj/item/weapon/gun/energy/kinetic_accelerator/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/weapon/crowbar))
if(modkits.len)
user << "<span class='notice'>You pry the modifications out.</span>"
playsound(loc, A.usesound, 100, 1)
for(var/obj/item/borg/upgrade/modkit/M in modkits)
M.uninstall(src)
else
user << "<span class='notice'>There are no modifications currently installed.</span>"
else if(istype(A, /obj/item/borg/upgrade/modkit))
var/obj/item/borg/upgrade/modkit/MK = A
MK.install(src, user)
else
..()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/get_remaining_mod_capacity()
var/current_capacity_used = 0
for(var/A in get_modkits())
var/obj/item/borg/upgrade/modkit/M = A
current_capacity_used += M.cost
return max_mod_capacity - current_capacity_used
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/get_modkits()
. = list()
for(var/A in modkits)
. += A
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/modify_projectile(obj/item/projectile/kinetic/K)
for(var/A in get_modkits())
var/obj/item/borg/upgrade/modkit/M = A
M.modify_projectile(K)
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg
holds_charge = TRUE
unique_frequency = TRUE
max_mod_capacity = 80
/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().
addtimer(src, "empty_if_not_held", 2)
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty_if_not_held()
if(!ismob(loc))
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
power_supply.use(500)
update_icon()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload()
if(overheat)
return
overheat = TRUE
var/carried = 0
if(!unique_frequency)
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/K in \
loc.GetAllContents())
carried++
carried = max(carried, 1)
else
carried = 1
addtimer(src, "reload", overheat_time * carried)
/obj/item/weapon/gun/energy/kinetic_accelerator/emp_act(severity)
return
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(500)
recharge_newshot(1)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else
loc << "<span class='warning'>[src] silently charges up.<span>"
update_icon()
overheat = FALSE
/obj/item/weapon/gun/energy/kinetic_accelerator/update_icon()
cut_overlays()
if(empty_state && !can_shoot())
add_overlay(empty_state)
if(gun_light && can_flashlight)
var/iconF = "flight"
if(gun_light.on)
iconF = "flight_on"
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
//Casing
/obj/item/ammo_casing/energy/kinetic
projectile_type = /obj/item/projectile/kinetic
select_name = "kinetic"
e_cost = 500
fire_sound = 'sound/weapons/Kenetic_accel.ogg' // fine spelling there chap
/obj/item/ammo_casing/energy/kinetic/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
..()
if(loc && istype(loc, /obj/item/weapon/gun/energy/kinetic_accelerator))
var/obj/item/weapon/gun/energy/kinetic_accelerator/KA = loc
KA.modify_projectile(BB)
var/turf/proj_turf = get_turf(BB)
if(!isturf(proj_turf))
return
var/datum/gas_mixture/environment = proj_turf.return_air()
var/pressure = environment.return_pressure()
if(pressure > 50)
BB.name = "weakened [BB.name]"
var/obj/item/projectile/kinetic/K = BB
K.damage *= K.pressure_decrease
//Projectiles
/obj/item/projectile/kinetic
name = "kinetic force"
icon_state = null
damage = 40
damage_type = BRUTE
flag = "bomb"
range = 3
log_override = TRUE
var/pressure_decrease = 0.25
var/turf_aoe = FALSE
var/mob_aoe = 0
var/list/hit_overlays = list()
/obj/item/projectile/kinetic/on_range()
strike_thing()
..()
/obj/item/projectile/kinetic/on_hit(atom/target)
strike_thing(target)
. = ..()
/obj/item/projectile/kinetic/proc/strike_thing(atom/target)
var/turf/target_turf = get_turf(target)
if(!target_turf)
target_turf = get_turf(src)
if(ismineralturf(target_turf))
var/turf/closed/mineral/M = target_turf
M.gets_drilled(firer)
var/obj/effect/overlay/temp/kinetic_blast/K = PoolOrNew(/obj/effect/overlay/temp/kinetic_blast, target_turf)
K.color = color
for(var/type in hit_overlays)
PoolOrNew(type, target_turf)
if(turf_aoe)
for(var/T in RANGE_TURFS(1, target_turf) - target_turf)
if(ismineralturf(T))
var/turf/closed/mineral/M = T
M.gets_drilled(firer)
if(mob_aoe)
for(var/mob/living/L in range(1, target_turf) - firer - target)
var/armor = L.run_armor_check(def_zone, flag, "", "", armour_penetration)
L.apply_damage(damage*mob_aoe, damage_type, def_zone, armor)
L << "<span class='userdanger'>You're struck by a [name]!</span>"
//Modkits
/obj/item/borg/upgrade/modkit
name = "modification kit"
desc = "An upgrade for kinetic accelerators."
icon = 'icons/obj/objects.dmi'
icon_state = "modkit"
origin_tech = "programming=2;materials=2;magnets=4"
require_module = 1
module_type = /obj/item/weapon/robot_module/miner
var/denied_type = null
var/maximum_of_type = 1
var/cost = 30
var/modifier = 1 //For use in any mod kit that has numerical modifiers
/obj/item/borg/upgrade/modkit/examine(mob/user)
..()
user << "<span class='notice'>Occupies <b>[cost]%</b> of mod capacity.</span>"
/obj/item/borg/upgrade/modkit/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/weapon/gun/energy/kinetic_accelerator) && !issilicon(user))
install(A, user)
else
..()
/obj/item/borg/upgrade/modkit/action(mob/living/silicon/robot/R)
if(..())
return
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg/H in R.module.modules)
return install(H, usr)
/obj/item/borg/upgrade/modkit/proc/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
. = TRUE
if(denied_type)
var/number_of_denied = 0
for(var/A in KA.get_modkits())
var/obj/item/borg/upgrade/modkit/M = A
if(istype(M, denied_type))
number_of_denied++
if(number_of_denied >= maximum_of_type)
. = FALSE
break
if(KA.get_remaining_mod_capacity() >= cost)
if(.)
user << "<span class='notice'>You install the modkit.</span>"
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.unEquip(src)
forceMove(KA)
KA.modkits += src
else
user << "<span class='notice'>The modkit you're trying to install would conflict with an already installed modkit. Use a crowbar to remove existing modkits.</span>"
else
user << "<span class='notice'>You don't have room(<b>[KA.get_remaining_mod_capacity()]%</b> remaining, [cost]% needed) to install this modkit. Use a crowbar to remove existing modkits.</span>"
. = FALSE
/obj/item/borg/upgrade/modkit/proc/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
forceMove(get_turf(KA))
KA.modkits -= src
/obj/item/borg/upgrade/modkit/proc/modify_projectile(obj/item/projectile/kinetic/K)
//Range
/obj/item/borg/upgrade/modkit/range
name = "range increase"
desc = "Increases the range of a kinetic accelerator when installed."
modifier = 1
cost = 24 //so you can fit four plus a tracer cosmetic
/obj/item/borg/upgrade/modkit/range/modify_projectile(obj/item/projectile/kinetic/K)
K.range += modifier
//Damage
/obj/item/borg/upgrade/modkit/damage
name = "damage increase"
desc = "Increases the damage of kinetic accelerator when installed."
modifier = 10
/obj/item/borg/upgrade/modkit/damage/modify_projectile(obj/item/projectile/kinetic/K)
K.damage += modifier
//Cooldown
/obj/item/borg/upgrade/modkit/cooldown
name = "cooldown decrease"
desc = "Decreases the cooldown of a kinetic accelerator."
modifier = 2.5
/obj/item/borg/upgrade/modkit/cooldown/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
. = ..()
if(.)
KA.overheat_time -= modifier
/obj/item/borg/upgrade/modkit/cooldown/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
KA.overheat_time += modifier
..()
//AoE blasts
/obj/item/borg/upgrade/modkit/aoe
modifier = 0
/obj/item/borg/upgrade/modkit/aoe/modify_projectile(obj/item/projectile/kinetic/K)
K.name = "kinetic explosion"
if(!K.turf_aoe && !K.mob_aoe)
K.hit_overlays += /obj/effect/overlay/temp/explosion/fast
K.mob_aoe += modifier
/obj/item/borg/upgrade/modkit/aoe/turfs
name = "mining explosion"
desc = "Causes the kinetic accelerator to destroy rock in an AoE."
denied_type = /obj/item/borg/upgrade/modkit/aoe/turfs
/obj/item/borg/upgrade/modkit/aoe/turfs/modify_projectile(obj/item/projectile/kinetic/K)
..()
K.turf_aoe = TRUE
/obj/item/borg/upgrade/modkit/aoe/turfs/andmobs
name = "offensive mining explosion"
desc = "Causes the kinetic accelerator to destroy rock and damage mobs in an AoE."
maximum_of_type = 3
modifier = 0.25
/obj/item/borg/upgrade/modkit/aoe/mobs
name = "offensive explosion"
desc = "Causes the kinetic accelerator to damage mobs in an AoE."
modifier = 0.2
//Indoors
/obj/item/borg/upgrade/modkit/indoors
name = "decrease pressure penalty"
desc = "Increases the damage a kinetic accelerator does in a high pressure environment."
modifier = 2
denied_type = /obj/item/borg/upgrade/modkit/indoors
maximum_of_type = 2
cost = 40
/obj/item/borg/upgrade/modkit/indoors/modify_projectile(obj/item/projectile/kinetic/K)
K.pressure_decrease *= modifier
//Trigger Guard
/obj/item/borg/upgrade/modkit/trigger_guard
name = "modified trigger guard"
desc = "Allows creatures normally incapable of firing guns to operate the weapon when installed."
cost = 20
denied_type = /obj/item/borg/upgrade/modkit/trigger_guard
/obj/item/borg/upgrade/modkit/trigger_guard/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
. = ..()
if(.)
KA.trigger_guard = TRIGGER_GUARD_ALLOW_ALL
/obj/item/borg/upgrade/modkit/trigger_guard/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
KA.trigger_guard = TRIGGER_GUARD_NORMAL
..()
//Cosmetic
/obj/item/borg/upgrade/modkit/chassis_mod
name = "super chassis"
desc = "Makes your KA yellow. All the fun of having a more powerful KA without actually having a more powerful KA."
cost = 10
denied_type = /obj/item/borg/upgrade/modkit/chassis_mod
var/chassis_icon = "kineticgun_u"
/obj/item/borg/upgrade/modkit/chassis_mod/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
. = ..()
if(.)
KA.icon_state = chassis_icon
/obj/item/borg/upgrade/modkit/chassis_mod/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
KA.icon_state = initial(KA.icon_state)
..()
/obj/item/borg/upgrade/modkit/chassis_mod/orange
name = "hyper chassis"
desc = "Makes your KA orange. All the fun of having explosive blasts without actually having explosive blasts."
chassis_icon = "kineticgun_h"
/obj/item/borg/upgrade/modkit/tracer
name = "white tracer bolts"
desc = "Causes kinetic accelerator bolts to have a white tracer trail and explosion."
cost = 4
denied_type = /obj/item/borg/upgrade/modkit/tracer
var/bolt_color = "#FFFFFF"
/obj/item/borg/upgrade/modkit/tracer/modify_projectile(obj/item/projectile/kinetic/K)
K.icon_state = "ka_tracer"
K.color = bolt_color
/obj/item/borg/upgrade/modkit/tracer/adjustable
name = "adjustable tracer bolts"
desc = "Causes kinetic accelerator bolts to have a adjustably-colored tracer trail and explosion. Use in-hand to change color."
/obj/item/borg/upgrade/modkit/tracer/adjustable/attack_self(mob/user)
bolt_color = input(user,"Choose Color") as color
+14 -6
View File
@@ -3,7 +3,7 @@
desc = "A basic energy-based laser gun that fires concentrated beams of light which pass through glass and thin metal."
icon_state = "laser"
item_state = "laser"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=2000)
origin_tech = "combat=4;magnets=2"
ammo_type = list(/obj/item/ammo_casing/energy/lasergun)
@@ -33,6 +33,7 @@
origin_tech = null
ammo_x_offset = 3
selfcharge = 1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/weapon/gun/energy/laser/captain/scattershot
name = "scatter shot laser rifle"
@@ -46,10 +47,7 @@
can_charge = 0
desc = "An energy-based laser gun that draws power from the cyborg's internal energy cell directly. So this is what freedom looks like?"
origin_tech = null
/obj/item/weapon/gun/energy/laser/cyborg/newshot()
..()
robocharge()
use_cyborg_cell = 1
/obj/item/weapon/gun/energy/laser/cyborg/emp_act()
return
@@ -59,6 +57,16 @@
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)
/obj/item/weapon/gun/energy/laser/scatter/shotty
name = "energy shotgun"
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "cshotgun"
item_state = "shotgun"
desc = "A combat shotgun gutted and refitted with an internal laser system. Can switch between taser and scattered disabler shots."
shaded_charge = 0
pin = /obj/item/device/firing_pin/implant/mindshield
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter/disabler, /obj/item/ammo_casing/energy/electrode)
///Laser Cannon
/obj/item/weapon/gun/energy/lasercannon
@@ -66,7 +74,7 @@
desc = "An advanced laser cannon that does more damage the farther away the target is."
icon_state = "lasercannon"
item_state = "laser"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
@@ -3,7 +3,7 @@
desc = "A heavy-duty, multifaceted energy rifle with three modes. Preferred by front-line combat personnel."
icon_state = "pulse"
item_state = null
w_class = 4
w_class = WEIGHT_CLASS_BULKY
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
@@ -39,7 +39,7 @@
/obj/item/weapon/gun/energy/pulse/carbine
name = "pulse carbine"
desc = "A compact variant of the pulse rifle with less firepower but easier storage."
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
slot_flags = SLOT_BELT
icon_state = "pulse_carbine"
item_state = "pulse"
@@ -54,7 +54,7 @@
/obj/item/weapon/gun/energy/pulse/pistol
name = "pulse pistol"
desc = "A pulse rifle in an easily concealed handgun package with low capacity."
w_class = 2
w_class = WEIGHT_CLASS_SMALL
slot_flags = SLOT_BELT
icon_state = "pulse_pistol"
item_state = "gun"
+24 -160
View File
@@ -5,7 +5,7 @@
item_state = null //so the human update icon uses the icon_state instead.
origin_tech = "combat=4;magnets=4"
can_flashlight = 1
w_class = 5
w_class = WEIGHT_CLASS_HUGE
flags = CONDUCT
slot_flags = SLOT_BACK
ammo_type = list(/obj/item/ammo_casing/energy/ion)
@@ -20,7 +20,7 @@
name = "ion carbine"
desc = "The MK.II Prototype Ion Projector is a lightweight carbine version of the larger ion rifle, built to be ergonomic and efficient."
icon_state = "ioncarbine"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
slot_flags = SLOT_BELT
pin = null
ammo_x_offset = 2
@@ -58,7 +58,7 @@
desc = "For the love of god, make sure you're aiming this the right way!"
icon_state = "riotgun"
item_state = "c20r"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
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.
@@ -72,7 +72,7 @@
item_state = "pen"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
w_class = 1
w_class = WEIGHT_CLASS_TINY
/obj/item/weapon/gun/energy/mindflayer
name = "\improper Mind Flayer"
@@ -82,152 +82,12 @@
ammo_type = list(/obj/item/ammo_casing/energy/mindflayer)
ammo_x_offset = 2
/obj/item/weapon/gun/energy/kinetic_accelerator
name = "proto-kinetic accelerator"
desc = "In the year 2544, only a year after the discovery of a potentially \
world-changing substance, now colloquially referred to as plasma, the \
Nanotrasen-UEG mining conglomerate introduced a prototype of a gun-like \
device intended for quick, effective mining of plasma in the low \
pressures of the solar system. Included in this presentation were \
demonstrations of the gun being fired at collections of rocks contained \
in vacuumed environments, obliterating them instantly while maintaining \
the structure of the ores buried within them. Additionally, volunteers \
were called from the crowd to have the gun used on them, only proving that \
the gun caused little harm to objects in standard pressure. \n\
An official from an unnamed, now long dissipated company observed this \
presentation and offered to share their self-recharger cells, powered \
by the user's bioelectrical field, another new and unknown technology. \
They warned that the cells were incredibly experimental and several times \
had injured workers, but the scientists as Nanotrasen were unable to resist \
the money-saving potential of self recharging cells. Upon accepting this \
offer, it took only a matter of days to prove the volatility of these cells, \
as they exploded left and right whenever inserted into the prototype devices, \
only throwing more money in the bin. \n\
Whenever the Nanotrasen scientists were on the edge of giving up, a \
breakthrough was made by head researcher Miles Parks McCollum, who \
demonstrated that the cells could be stabilized when exposed to radium \
then cooled with cryostylane. After this discovery, the low pressure gun, \
now named the Kinetic Accelerator, was hastily completed and made compatible \
with the self-recharging cells. As a result of poor testing, the currently \
used guns lose their charge when not in use, and when two Kinetic Accelerators \
come in proximity of one another, they will interfere with each other. Despite \
this, the shoddy guns still see use in the mining of plasma to this day."
icon_state = "kineticgun"
item_state = "kineticgun"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic)
cell_type = /obj/item/weapon/stock_parts/cell/emproof
// Apparently these are safe to carry? I'm sure goliaths would disagree.
needs_permit = 0
unique_rename = 1
origin_tech = "combat=3;powerstorage=3;engineering=3"
weapon_weight = WEAPON_LIGHT
can_flashlight = 1
flight_x_offset = 15
flight_y_offset = 9
var/overheat_time = 16
var/holds_charge = FALSE
var/unique_frequency = FALSE // modified by KA modkits
var/overheat = FALSE
/obj/item/weapon/gun/energy/kinetic_accelerator/super
name = "super-kinetic accelerator"
desc = "An upgraded, superior version of the proto-kinetic accelerator."
icon_state = "kineticgun_u"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/super)
overheat_time = 15
origin_tech = "materials=5;powerstorage=3;engineering=4;magnets=3;combat=3"
/obj/item/weapon/gun/energy/kinetic_accelerator/hyper
name = "hyper-kinetic accelerator"
desc = "An upgraded, even more superior version of the proto-kinetic accelerator."
icon_state = "kineticgun_h"
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/hyper)
overheat_time = 14
origin_tech = "materials=6;powerstorage=4;engineering=4;magnets=4;combat=4"
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg
holds_charge = TRUE
unique_frequency = TRUE
/obj/item/weapon/gun/energy/kinetic_accelerator/hyper/cyborg
holds_charge = TRUE
unique_frequency = TRUE
/obj/item/weapon/gun/energy/kinetic_accelerator/New()
. = ..()
if(!holds_charge)
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/shoot_live_shot()
. = ..()
attempt_reload()
/obj/item/weapon/gun/energy/kinetic_accelerator/equipped(mob/user)
. = ..()
if(!can_shoot())
attempt_reload()
/obj/item/weapon/gun/energy/kinetic_accelerator/dropped()
. = ..()
if(!holds_charge)
// Put it on a delay because moving item from slot to hand
// calls dropped().
sleep(1)
if(!ismob(loc))
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
power_supply.use(500)
update_icon()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload()
if(overheat)
return
overheat = TRUE
var/carried = 0
if(!unique_frequency)
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/K in \
loc.GetAllContents())
carried++
carried = max(carried, 1)
else
carried = 1
addtimer(src, "reload", overheat_time * carried)
/obj/item/weapon/gun/energy/kinetic_accelerator/emp_act(severity)
return
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(500)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else
loc << "<span class='warning'>[src] silently charges up.<span>"
update_icon()
overheat = FALSE
/obj/item/weapon/gun/energy/kinetic_accelerator/update_icon()
cut_overlays()
if(!can_shoot())
add_overlay("kineticgun_empty")
if(F && can_flashlight)
var/iconF = "flight"
if(F.on)
iconF = "flight_on"
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
name = "mini energy crossbow"
desc = "A weapon favored by syndicate stealth specialists."
icon_state = "crossbow"
item_state = "crossbow"
w_class = 2
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=2000)
origin_tech = "combat=4;magnets=4;syndicate=5"
suppressed = 1
@@ -238,31 +98,32 @@
holds_charge = TRUE
unique_frequency = TRUE
can_flashlight = 0
max_mod_capacity = 0
empty_state = null
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/halloween
name = "candy corn crossbow"
desc = "A weapon favored by Syndicate trick-or-treaters."
icon_state = "crossbow_halloween"
item_state = "crossbow"
ammo_type = list(/obj/item/ammo_casing/energy/bolt/halloween)
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large
name = "energy crossbow"
desc = "A reverse engineered weapon using syndicate technology."
icon_state = "crossbowlarge"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=4000)
origin_tech = "combat=4;magnets=4;syndicate=2"
suppressed = 0
ammo_type = list(/obj/item/ammo_casing/energy/bolt/large)
pin = null
/obj/item/weapon/gun/energy/kinetic_accelerator/suicide_act(mob/user)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
user.visible_message("<span class='suicide'>[user] cocks the [src.name] and pretends to blow \his brains out! It looks like \he's trying to commit suicide!</b></span>")
shoot_live_shot()
return (OXYLOSS)
/obj/item/weapon/gun/energy/plasmacutter
name = "plasma cutter"
desc = "A mining tool capable of expelling concentrated plasma bursts. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
icon_state = "plasmacutter"
item_state = "plasmacutter"
modifystate = -1
origin_tech = "combat=1;materials=3;magnets=2;plasmatech=3;engineering=1"
ammo_type = list(/obj/item/ammo_casing/energy/plasma)
flags = CONDUCT | OPENCONTAINER
@@ -282,10 +143,12 @@
var/obj/item/stack/sheet/S = A
S.use(1)
power_supply.give(1000)
recharge_newshot(1)
user << "<span class='notice'>You insert [A] in [src], recharging it.</span>"
else if(istype(A, /obj/item/weapon/ore/plasma))
qdel(A)
power_supply.give(500)
recharge_newshot(1)
user << "<span class='notice'>You insert [A] in [src], recharging it.</span>"
else
..()
@@ -354,6 +217,7 @@
cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
ammo_type = list(/obj/item/ammo_casing/energy/c3dbullet)
can_charge = 0
use_cyborg_cell = 1
/obj/item/weapon/gun/energy/printer/update_icon()
return
@@ -361,10 +225,6 @@
/obj/item/weapon/gun/energy/printer/emp_act()
return
/obj/item/weapon/gun/energy/printer/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/temperature
name = "temperature gun"
icon_state = "freezegun"
@@ -374,6 +234,12 @@
cell_type = "/obj/item/weapon/stock_parts/cell/high"
pin = null
/obj/item/weapon/gun/energy/temperature/security
name = "security temperature gun"
desc = "A weapon that can only be used to its full potential by the truly robust."
origin_tech = "combat=2;materials=2;powerstorage=1;magnets=1"
pin = /obj/item/device/firing_pin
/obj/item/weapon/gun/energy/laser/instakill
name = "instakill rifle"
icon_state = "instagib"
@@ -400,8 +266,6 @@
/obj/item/weapon/gun/energy/gravity_gun
name = "one-point bluespace-gravitational manipulator"
icon_state = "gravity_gun"
item_state = "gravity_gun"
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity"
ammo_type = list(/obj/item/ammo_casing/energy/gravityrepulse, /obj/item/ammo_casing/energy/gravityattract, /obj/item/ammo_casing/energy/gravitychaos)
origin_tech = "combat=4;magnets=4;materials=6;powerstorage=4;bluespace=4"
+7 -12
View File
@@ -7,18 +7,18 @@
origin_tech = "combat=3"
ammo_x_offset = 3
/obj/item/weapon/gun/energy/shock_revolver
/obj/item/weapon/gun/energy/tesla_revolver
name = "tesla gun"
desc = "An experimental gun based on an experimental engine, it's about as likely to kill it's operator as it is the target."
desc = "An experimental gun based on an experimental engine, it's about as likely to kill its operator as it is the target."
icon_state = "tesla"
item_state = "tesla"
ammo_type = list(/obj/item/ammo_casing/energy/shock_revolver)
ammo_type = list(/obj/item/ammo_casing/energy/tesla_revolver)
origin_tech = "combat=4;materials=4;powerstorage=4"
can_flashlight = 0
pin = null
shaded_charge = 1
/obj/item/weapon/gun/energy/gun/advtaser
/obj/item/weapon/gun/energy/e_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"
@@ -26,15 +26,12 @@
origin_tech = "combat=4"
ammo_x_offset = 2
/obj/item/weapon/gun/energy/gun/advtaser/cyborg
/obj/item/weapon/gun/energy/e_gun/advtaser/cyborg
name = "cyborg taser"
desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating."
can_flashlight = 0
can_charge = 0
/obj/item/weapon/gun/energy/gun/advtaser/cyborg/newshot()
..()
robocharge()
use_cyborg_cell = 1
/obj/item/weapon/gun/energy/disabler
name = "disabler"
@@ -48,7 +45,5 @@
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
use_cyborg_cell = 1
/obj/item/weapon/gun/energy/disabler/cyborg/newshot()
..()
robocharge()
@@ -4,7 +4,7 @@
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "riotgun"
item_state = "riotgun"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
throw_speed = 2
throw_range = 7
force = 5
@@ -36,18 +36,18 @@
if(grenades.len)
fire_grenade(target,user)
else
usr << "<span class='danger'>The grenade launcher is empty.</span>"
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!
var/obj/item/weapon/grenade/F = grenades[1] //Now with less copypasta!
grenades -= F
F.loc = user.loc
F.throw_at_fast(target, 30, 2,user)
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
F.active = 1
F.icon_state = initial(icon_state) + "_active"
F.icon_state = initial(F.icon_state) + "_active"
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
addtimer(F, "prime", 15)
+14 -9
View File
@@ -6,7 +6,7 @@
item_state = "staff"
fire_sound = 'sound/weapons/emitter.ogg'
flags = CONDUCT
w_class = 5
w_class = WEIGHT_CLASS_HUGE
var/max_charges = 6
var/charges = 0
var/recharge_rate = 4
@@ -23,7 +23,6 @@
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
/obj/item/weapon/gun/magic/afterattack(atom/target, mob/living/user, flag)
newshot()
if(no_den_usage)
var/area/A = get_area(user)
if(istype(A, /area/wizard_station))
@@ -36,15 +35,14 @@
/obj/item/weapon/gun/magic/can_shoot()
return charges
/obj/item/weapon/gun/magic/newshot()
if (charges && chambered)
/obj/item/weapon/gun/magic/recharge_newshot()
if (charges && chambered && !chambered.BB)
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
recharge_newshot()
/obj/item/weapon/gun/magic/New()
..()
@@ -66,6 +64,8 @@
return 0
charge_tick = 0
charges++
if(charges == 1)
recharge_newshot()
return 1
/obj/item/weapon/gun/magic/update_icon()
@@ -73,9 +73,14 @@
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
user << "<span class='warning'>The [name] whizzles quietly.<span>"
return
/obj/item/weapon/gun/magic/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is twisting the [src.name] above \his head, releasing a magical blast! It looks like \he's trying to commit suicide.</span>")
user.visible_message("<span class='suicide'>[user] is twisting [src] above [user.p_their()] head, releasing a magical blast! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, fire_sound, 50, 1, -1)
return (FIRELOSS)
return (FIRELOSS)
/obj/item/weapon/gun/magic/vv_edit_var(var_name, var_value)
. = ..()
switch (var_name)
if ("charges")
recharge_newshot()
+20 -1
View File
@@ -1,4 +1,4 @@
/obj/item/weapon/gun/magic/staff/
/obj/item/weapon/gun/magic/staff
slot_flags = SLOT_BACK
/obj/item/weapon/gun/magic/staff/change
@@ -59,3 +59,22 @@
item_state = "honker"
max_charges = 4
recharge_rate = 8
/obj/item/weapon/gun/magic/staff/spellblade
name = "spellblade"
desc = "A deadly combination of laziness and boodlust, this blade allows the user to dismember their enemies without all the hard work of actually swinging the sword."
fire_sound = "sound/magic/Fireball.ogg"
ammo_type = /obj/item/ammo_casing/magic/spellblade
icon_state = "spellblade"
item_state = "spellblade"
hitsound = 'sound/weapons/rapierhit.ogg'
force = 20
armour_penetration = 75
block_chance = 50
sharpness = IS_SHARP
max_charges = 4
/obj/item/weapon/gun/magic/staff/spellblade/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type)
if(attack_type == PROJECTILE_ATTACK)
final_block_chance = 0
return ..()
+11 -10
View File
@@ -1,10 +1,10 @@
/obj/item/weapon/gun/magic/wand/
/obj/item/weapon/gun/magic/wand
name = "wand of nothing"
desc = "It's not just a stick, it's a MAGIC stick!"
ammo_type = /obj/item/ammo_casing/magic
icon_state = "nothingwand"
item_state = "wand"
w_class = 2
w_class = WEIGHT_CLASS_SMALL
can_charge = 0
max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths)
var/variable_charges = 1
@@ -48,9 +48,9 @@
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user)
user.visible_message("<span class='danger'>[user] zaps \himself with [src].</span>")
user.visible_message("<span class='danger'>[user] zaps [user.p_them()]self 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>"
user.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> zapped [user.p_them()]self with a <b>[src]</b>"
/////////////////////////////////////
@@ -66,12 +66,13 @@
max_charges = 3 //3, 2, 2, 1
/obj/item/weapon/gun/magic/wand/death/zap_self(mob/living/user)
var/message ="<span class='warning'>You irradiate yourself with pure energy! "
message += pick("Do not pass go. Do not collect 200 zorkmids.</span>","You feel more confident in your spell casting skills.</span>","You Die...</span>","Do you want your possessions identified?</span>")
user << message
..()
user << "<span class='warning'>You irradiate yourself with pure energy! \
[pick("Do not pass go. Do not collect 200 zorkmids.","You feel more confident in your spell casting skills.","You Die...","Do you want your possessions identified?")]\
</span>"
user.adjustOxyLoss(500)
charges--
..()
/////////////////////////////////////
//WAND OF HEALING
@@ -163,6 +164,6 @@
max_charges = 8 //8, 4, 4, 3
/obj/item/weapon/gun/magic/wand/fireball/zap_self(mob/living/user)
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
charges--
..()
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
charges--
+4 -4
View File
@@ -1,10 +1,10 @@
/obj/item/weapon/gun/medbeam
name = "Medical Beamgun"
desc = "Delivers medical nanites in a focused beam."
desc = "Don't cross the streams!"
icon = 'icons/obj/chronos.dmi'
icon_state = "chronogun"
item_state = "chronogun"
w_class = 3.0
w_class = WEIGHT_CLASS_NORMAL
var/mob/living/current_target
var/last_check = 0
@@ -54,7 +54,7 @@
/obj/item/weapon/gun/medbeam/process()
var/source = loc
if(!mounted && !ishuman(source))
if(!mounted && !isliving(source))
LoseTarget()
return
@@ -69,7 +69,7 @@
if(get_dist(source, current_target)>max_range || !los_check(source, current_target))
LoseTarget()
if(ishuman(source))
if(isliving(source))
source << "<span class='warning'>You lose control of the beam!</span>"
return
+2 -2
View File
@@ -1,4 +1,4 @@
/obj/item/weapon/gun/energy/gun/advtaser/mounted
/obj/item/weapon/gun/energy/e_gun/advtaser/mounted
name = "mounted taser"
desc = "An arm mounted dual-mode weapon that fires electrodes and disabler shots."
icon = 'icons/obj/items_cyborg.dmi'
@@ -9,7 +9,7 @@
can_flashlight = 0
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead
/obj/item/weapon/gun/energy/gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
/obj/item/weapon/gun/energy/e_gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
..()
src.loc = null//send it to nullspace to get retrieved by the implant later on. gotta cover those edge cases.
+12 -24
View File
@@ -3,7 +3,7 @@
desc = "A spring loaded rifle designed to fit syringes, used to incapacitate unruly patients from a distance."
icon_state = "syringegun"
item_state = "syringegun"
w_class = 3
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 7
force = 4
@@ -18,30 +18,17 @@
..()
chambered = new /obj/item/ammo_casing/syringegun(src)
/obj/item/weapon/gun/syringe/newshot()
if(!syringes.len) return
/obj/item/weapon/gun/syringe/recharge_newshot()
if(!syringes.len)
return
chambered.newshot()
var/obj/item/weapon/reagent_containers/syringe/S = syringes[1]
if(!S) return
chambered.BB = new S.projectile_type (src)
S.reagents.trans_to(chambered.BB, S.reagents.total_volume)
chambered.BB.name = S.name
syringes.Remove(S)
qdel(S)
return
/obj/item/weapon/gun/syringe/can_shoot()
return syringes.len
/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()
..()
if(chambered && !chambered.BB) //we just fired
recharge_newshot()
/obj/item/weapon/gun/syringe/examine(mob/user)
..()
@@ -69,7 +56,8 @@
return
user << "<span class='notice'>You load [A] into \the [src].</span>"
syringes.Add(A)
A.loc = src
A.forceMove(src)
recharge_newshot()
return 1
else
usr << "<span class='warning'>[src] cannot hold more syringes!</span>"
@@ -86,7 +74,7 @@
desc = "A small spring-loaded sidearm that functions identically to a syringe gun."
icon_state = "syringe_pistol"
item_state = "gun" //Smaller inhand
w_class = 2
w_class = WEIGHT_CLASS_SMALL
origin_tech = "combat=2;syndicate=2;biotech=3"
force = 2 //Also very weak because it's smaller
suppressed = 1 //Softer fire sound
+7 -12
View File
@@ -6,7 +6,7 @@
item_state = "pen"
origin_tech = "materials=2;combat=4"
flags = CONDUCT
w_class = 1
w_class = WEIGHT_CLASS_TINY
attack_verb = list("poked")
var/emagged = 0
var/fail_message = "<span class='warning'>INVALID USER.</span>"
@@ -95,9 +95,11 @@
var/obj/item/weapon/implant/req_implant = null
/obj/item/device/firing_pin/implant/pin_auth(mob/living/user)
for(var/obj/item/weapon/implant/I in user)
if(req_implant && I.imp_in == user && I.type == req_implant)
return 1
if(iscarbon(user))
var/mob/living/carbon/C = user
for(var/obj/item/weapon/implant/I in C.implants)
if(req_implant && I.type == req_implant)
return 1
return 0
/obj/item/device/firing_pin/implant/mindshield
@@ -111,21 +113,14 @@
icon_state = "firing_pin_pindi"
req_implant = /obj/item/weapon/implant/weapons_auth
/obj/item/device/firing_pin/trick
name = "self-destruct firing pin"
desc = "This pin will detonate the weapon it is put into upon trying to use it"
selfdestruct = 1
force_replace = 1
/obj/item/device/firing_pin/trick/pin_auth(mob/living/user)
return 0
// Honk pin, clown's joke item.
// Can replace other pins. Replace a pin in cap's laser for extra fun!
/obj/item/device/firing_pin/clown
name = "hilarious firing pin"
desc = "Advanced clowntech that can convert any firearm into a far more useful object."
color = "yellow"
color = "#FFFF00"
fail_message = "<span class='warning'>HONK!</span>"
force_replace = 1
+143 -62
View File
@@ -5,16 +5,14 @@
density = 0
anchored = 1
flags = ABSTRACT
unacidable = 1
pass_flags = PASSTABLE
mouse_opacity = 0
hitsound = 'sound/weapons/pierce.ogg'
var/hitsound_wall = ""
pressure_resistance = INFINITY
burn_state = LAVA_PROOF
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/def_zone = "" //Aiming at
var/mob/firer = null//Who shot it
var/obj/item/ammo_casing/ammo_casing = null
var/suppressed = 0 //Attack message
var/yo = null
var/xo = null
@@ -25,7 +23,7 @@
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 = 0.1 //Amount of deciseconds it takes for projectile to travel
var/speed = 0.8 //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
@@ -35,7 +33,7 @@
var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here
var/nodamage = 0 //Determines if the projectile will skip any damage inflictions
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb
var/projectile_type = "/obj/item/projectile"
var/projectile_type = /obj/item/projectile
var/range = 50 //This will de-increment every step. When 0, it will delete the projectile.
//Effects
var/stun = 0
@@ -49,6 +47,9 @@
var/stamina = 0
var/jitter = 0
var/forcedodge = 0 //to pass through everything
var/dismemberment = 0 //The higher the number, the greater the bonus to dismembering. 0 will not dismember at all.
var/impact_effect_type //what type of impact effect to show when hitting something
var/log_override = FALSE //is this type spammed enough to not log? (KAs)
/obj/item/projectile/New()
permutated = list()
@@ -62,14 +63,42 @@
/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
qdel(src)
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0, hit_zone)
//to get the correct limb (if any) for the projectile hit message
/mob/living/proc/check_limb_hit(hit_zone)
if(has_limbs)
return hit_zone
/mob/living/carbon/check_limb_hit(hit_zone)
if(get_bodypart(hit_zone))
return hit_zone
else //when a limb is missing the damage is actually passed to the chest
return "chest"
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0)
var/turf/target_loca = get_turf(target)
if(!isliving(target))
if(impact_effect_type)
PoolOrNew(impact_effect_type, list(target_loca, target, src))
return 0
var/mob/living/L = target
if(blocked != 100) // not completely blocked
if(damage && L.blood_volume && damage_type == BRUTE)
var/splatter_dir = dir
if(starting)
splatter_dir = get_dir(starting, target_loca)
if(isalien(L))
PoolOrNew(/obj/effect/overlay/temp/dir_setting/bloodsplatter/xenosplatter, list(target_loca, splatter_dir))
else
PoolOrNew(/obj/effect/overlay/temp/dir_setting/bloodsplatter, list(target_loca, splatter_dir))
if(prob(33))
L.add_splatter_floor(target_loca)
else if(impact_effect_type)
PoolOrNew(impact_effect_type, list(target_loca, target, src))
var/organ_hit_text = ""
if(L.has_limbs)
organ_hit_text = " in \the [parse_zone(def_zone)]"
var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info.
if(limb_hit)
organ_hit_text = " in \the [parse_zone(limb_hit)]"
if(suppressed)
playsound(loc, hitsound, 5, 1, -1)
L << "<span class='userdanger'>You're shot by \a [src][organ_hit_text]!</span>"
@@ -78,8 +107,8 @@
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)
"<span class='userdanger'>[L] is hit by \a [src][organ_hit_text]!</span>", null, COMBAT_MESSAGE_RANGE)
L.on_hit(src)
var/reagent_note
if(reagents && reagents.reagent_list)
@@ -135,63 +164,77 @@
/obj/item/projectile/Process_Spacemove(var/movement_dir = 0)
return 1 //Bullets don't drift in space
/obj/item/projectile/proc/fire(var/setAngle)
/obj/item/projectile/proc/fire(setAngle, atom/direct_target)
if(!log_override && firer && original)
add_logs(firer, original, "fired at", src, " [get_area(src)]")
if(direct_target)
direct_target.bullet_act(src, def_zone)
qdel(src)
return
if(setAngle)
Angle = setAngle
if(!legacy) //new projectiles
set waitfor = 0
var/next_run = world.time
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
if(paused)
next_run = world.time
sleep(1)
continue
if(!Angle)
Angle=round(Get_Angle(src,current))
if(spread)
Angle += (rand() - 0.5) * spread
var/matrix/M = new
M.Turn(Angle)
transform = M
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
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
if(!Angle)
Angle=round(Get_Angle(src,current))
if(spread)
Angle += (rand() - 0.5) * spread
var/matrix/M = new
M.Turn(Angle)
transform = M
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--
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_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--
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--
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)))
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--
step_towards(src, locate(new_x, new_y, z))
next_run += max(world.tick_lag, speed)
var/delay = next_run - world.time
if(delay <= world.tick_lag*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, (delay <= 3 ? delay - 1 : delay)), flags = ANIMATION_END_NOW)
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
if (delay > 0)
sleep(delay)
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)
@@ -204,7 +247,47 @@
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(1)
sleep(config.run_speed * 0.9)
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
var/turf/curloc = get_turf(user)
src.loc = get_turf(user)
src.starting = get_turf(user)
src.current = curloc
src.yo = targloc.y - curloc.y
src.xo = targloc.x - curloc.x
if(params)
var/list/mouse_control = params2list(params)
if(mouse_control["icon-x"])
src.p_x = text2num(mouse_control["icon-x"])
if(mouse_control["icon-y"])
src.p_y = text2num(mouse_control["icon-y"])
if(mouse_control["screen-loc"])
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
// world << "X: [screen_loc_X[1]] PixelX: [screen_loc_X[2]] / Y: [screen_loc_Y[1]] PixelY: [screen_loc_Y[2]]"
var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32
var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32
//Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average.
var/screenview = (user.client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
var/ox = round(screenview/2) //"origin" x
var/oy = round(screenview/2) //"origin" y
// world << "Pixel position: [x] [y]"
var/angle = Atan2(y - oy, x - ox)
// world << "Angle: [angle]"
src.Angle = angle
if(spread)
src.Angle += spread
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
@@ -213,9 +296,7 @@
Bump(AM, 1)
/obj/item/projectile/Destroy()
ammo_casing = null
return ..()
/obj/item/projectile/proc/dumbfire(var/dir)
current = get_ranged_target_turf(src, dir, world.maxx)
fire()
/obj/item/projectile/experience_pressure_difference()
return
+12 -2
View File
@@ -9,6 +9,7 @@
hitsound_wall = 'sound/weapons/effects/searwall.ogg'
flag = "laser"
eyeblur = 2
impact_effect_type = /obj/effect/overlay/temp/impact_effect/red_laser
/obj/item/projectile/beam/laser
@@ -44,6 +45,7 @@
irradiate = 30
range = 15
forcedodge = 1
impact_effect_type = /obj/effect/overlay/temp/impact_effect/green_laser
/obj/item/projectile/beam/disabler
name = "disabler beam"
@@ -53,16 +55,18 @@
flag = "energy"
hitsound = 'sound/weapons/tap.ogg'
eyeblur = 0
impact_effect_type = /obj/effect/overlay/temp/impact_effect/blue_laser
/obj/item/projectile/beam/pulse
name = "pulse"
icon_state = "u_laser"
damage = 50
luminosity = 2
impact_effect_type = /obj/effect/overlay/temp/impact_effect/blue_laser
/obj/item/projectile/beam/pulse/on_hit(atom/target, blocked = 0)
. = ..()
if(istype(target,/turf/)||istype(target,/obj/structure/))
if(isturf(target) || istype(target,/obj/structure/))
target.ex_act(2)
/obj/item/projectile/beam/pulse/shot
@@ -73,7 +77,7 @@
icon_state = "pulse1_bl"
var/life = 20
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0, hit_zone)
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0)
life -= 10
if(life > 0)
. = -1
@@ -86,6 +90,7 @@
legacy = 1
luminosity = 2
animate_movement = SLIDE_STEPS
impact_effect_type = /obj/effect/overlay/temp/impact_effect/green_laser
/obj/item/projectile/beam/emitter/singularity_pull()
return //don't want the emitters to miss
@@ -102,6 +107,7 @@
damage_type = STAMINA
flag = "laser"
var/suit_types = list(/obj/item/clothing/suit/redtag, /obj/item/clothing/suit/bluetag)
impact_effect_type = /obj/effect/overlay/temp/impact_effect/blue_laser
/obj/item/projectile/beam/lasertag/on_hit(atom/target, blocked = 0)
. = ..()
@@ -114,6 +120,7 @@
/obj/item/projectile/beam/lasertag/redtag
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
impact_effect_type = /obj/effect/overlay/temp/impact_effect/red_laser
/obj/item/projectile/beam/lasertag/bluetag
icon_state = "bluelaser"
@@ -124,12 +131,15 @@
icon_state = "purple_laser"
damage = 200
damage_type = BURN
impact_effect_type = /obj/effect/overlay/temp/impact_effect/purple_laser
/obj/item/projectile/beam/instakill/blue
icon_state = "blue_laser"
impact_effect_type = /obj/effect/overlay/temp/impact_effect/blue_laser
/obj/item/projectile/beam/instakill/red
icon_state = "red_laser"
impact_effect_type = /obj/effect/overlay/temp/impact_effect/red_laser
/obj/item/projectile/beam/instakill/on_hit(atom/target)
. = ..()
+29 -14
View File
@@ -6,6 +6,7 @@
nodamage = 0
flag = "bullet"
hitsound_wall = "ricochet"
impact_effect_type = /obj/effect/overlay/temp/impact_effect
/obj/item/projectile/bullet/weakbullet //beanbag, heavy stamina damage
damage = 5
@@ -70,6 +71,20 @@
/obj/item/projectile/bullet/midbullet3
damage = 30
/obj/item/projectile/bullet/midbullet3/hp
damage = 40
armour_penetration = -50
/obj/item/projectile/bullet/midbullet3/ap
damage = 27
armour_penetration = 40
/obj/item/projectile/bullet/midbullet3/fire/on_hit(atom/target, blocked = 0)
if(..(target, blocked))
var/mob/living/M = target
M.adjust_fire_stacks(1)
M.IgniteMob()
/obj/item/projectile/bullet/heavybullet
damage = 35
@@ -174,11 +189,11 @@
create_reagents(50)
reagents.set_reacting(FALSE)
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0, hit_zone)
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0)
if(iscarbon(target))
var/mob/living/carbon/M = target
if(blocked != 100) // not completely blocked
if(M.can_inject(null,0,hit_zone,piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
if(M.can_inject(null, 0, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
@@ -188,7 +203,7 @@
target.visible_message("<span class='danger'>The [name] was deflected!</span>", \
"<span class='userdanger'>You were protected against the [name]!</span>")
..(target, blocked, hit_zone)
..(target, blocked)
reagents.set_reacting(TRUE)
reagents.handle_reactions()
return 1
@@ -202,13 +217,8 @@
//This one is for future syringe guns update
/obj/item/projectile/bullet/dart/syringe
name = "syringe"
icon = 'icons/obj/chemical.dmi'
icon_state = "syringeproj"
//Piercing Syringe
/obj/item/projectile/bullet/dart/syringe/piercing
piercing = 1
/obj/item/projectile/bullet/neurotoxin
name = "neurotoxin spit"
icon_state = "neurotoxin"
@@ -227,13 +237,15 @@
//// SNIPER BULLETS
/obj/item/projectile/bullet/sniper
speed = 0 //360 alwaysscope.
damage = 70
stun = 5
weaken = 5
dismemberment = 50
armour_penetration = 50
var/breakthings = TRUE
/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0, hit_zone)
/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0)
if((blocked != 100) && (!ismob(target) && breakthings))
target.ex_act(rand(1,2))
return ..()
@@ -243,11 +255,12 @@
armour_penetration = 0
nodamage = 1
stun = 0
dismemberment = 0
weaken = 0
breakthings = FALSE
/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone)
if((blocked != 100) && istype(target, /mob/living))
/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0)
if((blocked != 100) && isliving(target))
var/mob/living/L = target
L.Sleeping(20)
return ..()
@@ -257,10 +270,11 @@
armour_penetration = 15
damage = 15
stun = 0
dismemberment = 0
weaken = 0
breakthings = FALSE
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone)
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0)
if((blocked != 100) && iscarbon(target))
var/mob/living/carbon/C = target
C.bleed(100)
@@ -272,6 +286,7 @@
name = "penetrator round"
damage = 60
forcedodge = 1
dismemberment = 0 //It goes through you cleanly.
stun = 0
weaken = 0
breakthings = FALSE
@@ -289,7 +304,7 @@
damage = 20
armour_penetration = 0
/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0, hit_zone)
/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0)
. = ..()
if((blocked != 100) && iscarbon(target))
var/mob/living/carbon/C = target
@@ -307,7 +322,7 @@
damage = 7
armour_penetration = 0
obj/item/projectile/bullet/saw/incen/Move()
/obj/item/projectile/bullet/saw/incen/Move()
..()
var/turf/location = get_turf(src)
if(location)
+19 -19
View File
@@ -29,7 +29,7 @@
if(C.dna && C.dna.check_mutation(HULK))
C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
else if(C.status_flags & CANWEAKEN)
addtimer(C, "do_jitter_animation", 5, FALSE, jitter)
addtimer(C, "do_jitter_animation", 5, TIMER_NORMAL, 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
@@ -68,11 +68,10 @@
icon = 'icons/effects/effects.dmi'
icon_state = "dragnetfield"
anchored = 1
unacidable = 1
/obj/effect/nettingportal/New()
..()
set_light(3)
SetLuminosity(3)
var/obj/item/device/radio/beacon/teletarget = null
for(var/obj/machinery/computer/teleporter/com in machines)
if(com.target)
@@ -143,6 +142,7 @@
damage = 20
damage_type = CLONE
irradiate = 10
impact_effect_type = /obj/effect/overlay/temp/impact_effect/green_laser
/obj/item/projectile/energy/dart //ninja throwing dart
name = "dart"
@@ -161,30 +161,30 @@
weaken = 5
stutter = 5
/obj/item/projectile/energy/bolt/halloween
name = "candy corn"
icon_state = "candy_corn"
/obj/item/projectile/energy/bolt/large
damage = 20
/obj/item/ammo_casing/energy/plasma
projectile_type = /obj/item/projectile/plasma
select_name = "plasma burst"
fire_sound = 'sound/weapons/pulse.ogg'
/obj/item/ammo_casing/energy/plasma/adv
projectile_type = /obj/item/projectile/plasma/adv
/obj/item/projectile/energy/shock_revolver
name = "shock bolt"
icon_state = "purple_laser"
/obj/item/projectile/energy/tesla_revolver
name = "tesla bolt"
icon_state = "tesla_projectile"
impact_effect_type = /obj/effect/overlay/temp/impact_effect/blue_laser
var/chain
/obj/item/ammo_casing/energy/shock_revolver/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
/obj/item/projectile/energy/tesla_revolver/fire(setAngle)
if(firer)
chain = firer.Beam(src, icon_state = "lightning[rand(1, 12)]", time = INFINITY, maxdistance = INFINITY)
..()
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)
/obj/item/projectile/energy/tesla_revolver/on_hit(atom/target)
. = ..()
if(isliving(target))
tesla_zap(src, 3, 10000)
qdel(src)
/obj/item/projectile/energy/tesla_revolver/Destroy()
qdel(chain)
return ..()
+77 -24
View File
@@ -24,27 +24,46 @@
damage_type = BRUTE
nodamage = 0
//explosion values
var/exp_heavy = 0
var/exp_light = 2
var/exp_flash = 3
var/exp_fire = 2
/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/turf/T3 = get_step(src,dir)
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
Bump(L,1) //Magic Bullet #teachthecontroversy
return
L = locate(/mob/living) in T2
if(L && L.stat != DEAD)
Bump(L)
Bump(L,1)
return
L = locate(/mob/living) in T3
if(L && L.stat != DEAD)
Bump(L,1)
return
..()
/obj/item/projectile/magic/fireball/on_hit(target)
. = ..()
var/turf/T = get_turf(target)
explosion(T, -1, 0, 2, 3, 0, flame_range = 2)
explosion(T, -1, exp_heavy, exp_light, exp_flash, 0, flame_range = exp_fire)
if(ismob(target)) //multiple flavors of pain
var/mob/living/M = target
M.take_overall_damage(0,10) //between this 10 burn, the 10 brute, the explosion brute, and the onfire burn, your at about 65 damage if you stop drop and roll immediately
/obj/item/projectile/magic/fireball/infernal
name = "infernal fireball"
exp_heavy = -1
exp_light = -1
exp_flash = 4
exp_fire= 5
/obj/item/projectile/magic/resurrection
name = "bolt of resurrection"
icon_state = "ion"
@@ -107,7 +126,7 @@
OpenDoor(target)
else
var/turf/T = get_turf(target)
if(istype(T,/turf/closed) && !istype(T, /turf/closed/indestructible))
if(isclosedturf(T) && !istype(T, /turf/closed/indestructible))
CreateDoor(T)
/obj/item/projectile/magic/door/proc/CreateDoor(turf/T)
@@ -132,6 +151,7 @@
/obj/item/projectile/magic/change/on_hit(atom/change)
. = ..()
wabbajack(change)
qdel(src)
/proc/wabbajack(mob/living/M)
if(!istype(M) || M.stat == DEAD || M.notransform || (GODMODE & M.status_flags))
@@ -145,7 +165,7 @@
var/list/contents = M.contents.Copy()
if(istype(M, /mob/living/silicon/robot))
if(iscyborg(M))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi)
qdel(Robot.mmi)
@@ -192,7 +212,7 @@
if("animal")
var/path
if(prob(50))
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat","killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp")
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat","killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp", "watcher", "goliath", "headcrab", "morph", "stickman", "stickdog", "lesserdragon")
switch(beast)
if("carp")
path = /mob/living/simple_animal/hostile/carp
@@ -218,6 +238,20 @@
path = /mob/living/simple_animal/hostile/carp/ranged
if("chaosmagicarp")
path = /mob/living/simple_animal/hostile/carp/ranged/chaos
if("watcher")
path = /mob/living/simple_animal/hostile/asteroid/basilisk/watcher
if("goliath")
path = /mob/living/simple_animal/hostile/asteroid/goliath/beast
if("headcrab")
path = /mob/living/simple_animal/hostile/headcrab
if("morph")
path = /mob/living/simple_animal/hostile/morph
if("stickman")
path = /mob/living/simple_animal/hostile/stickman
if("stickdog")
path = /mob/living/simple_animal/hostile/stickman/dog
if("lesserdragon")
path = /mob/living/simple_animal/hostile/megafauna/dragon/lesser
else
var/animal = pick("parrot","corgi","crab","pug","cat","mouse","chicken","cow","lizard","chick","fox","butterfly","cak")
switch(animal)
@@ -282,7 +316,7 @@
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>[M.real_name] ([M.ckey]) became [new_mob.real_name].</font>")
new_mob.a_intent = "harm"
new_mob.a_intent = INTENT_HARM
M.wabbajack_act(new_mob)
@@ -299,34 +333,53 @@
damage_type = BURN
nodamage = 1
/obj/item/projectile/magic/animate/Bump(atom/change)
/obj/item/projectile/magic/animate/on_hit(atom/target, blocked = 0)
..()
if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects))
if(istype(change, /obj/structure/closet/statue))
for(var/mob/living/carbon/human/H in change.contents)
var/mob/living/simple_animal/hostile/statue/S = new /mob/living/simple_animal/hostile/statue(change.loc, firer)
S.name = "statue of [H.name]"
if((istype(target, /obj/item) || istype(target, /obj/structure)) && !is_type_in_list(target, protected_objects))
if(istype(target, /obj/structure/statue/petrified))
var/obj/structure/statue/petrified/P = target
if(P.petrified_mob)
var/mob/living/L = P.petrified_mob
var/mob/living/simple_animal/hostile/statue/S = new (P.loc, firer)
S.name = "statue of [L.name]"
S.faction = list("\ref[firer]")
S.icon = change.icon
S.icon_state = change.icon_state
S.overlays = change.overlays
S.color = change.color
if(H.mind)
H.mind.transfer_to(S)
S.icon = P.icon
S.icon_state = P.icon_state
S.overlays = P.overlays
S.color = P.color
S.atom_colours = P.atom_colours.Copy()
if(L.mind)
L.mind.transfer_to(S)
S << "<span class='userdanger'>You are an animate statue. You cannot move when monitored, but are nearly invincible and deadly when unobserved! Do not harm [firer.name], your creator.</span>"
H = change
H.loc = S
P.loc = S
qdel(src)
return
else
var/obj/O = change
var/obj/O = target
if(istype(O, /obj/item/weapon/gun))
new /mob/living/simple_animal/hostile/mimic/copy/ranged(O.loc, O, firer)
else
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
else if(istype(change, /mob/living/simple_animal/hostile/mimic/copy))
else if(istype(target, /mob/living/simple_animal/hostile/mimic/copy))
// Change our allegiance!
var/mob/living/simple_animal/hostile/mimic/copy/C = change
var/mob/living/simple_animal/hostile/mimic/copy/C = target
C.ChangeOwner(firer)
/obj/item/projectile/magic/spellblade
name = "blade energy"
icon_state = "lavastaff"
damage = 15
damage_type = BURN
flag = "magic"
dismemberment = 50
nodamage = 0
/obj/item/projectile/magic/arcane_barrage
name = "arcane bolt"
icon_state = "arcane_barrage"
damage = 20
damage_type = BURN
nodamage = 0
armour_penetration = 0
flag = "magic"
+26 -13
View File
@@ -1,8 +1,9 @@
/obj/item/projectile/bullet/reusable
name = "reusable bullet"
desc = "How do you even reuse a bullet?"
var/ammo_type = /obj/item/ammo_casing/caseless/
var/ammo_type = /obj/item/ammo_casing/caseless
var/dropped = 0
impact_effect_type = null
/obj/item/projectile/bullet/reusable/on_hit(atom/target, blocked = 0)
. = ..()
@@ -14,7 +15,8 @@
/obj/item/projectile/bullet/reusable/proc/handle_drop()
if(!dropped)
new ammo_type(src.loc)
var/turf/T = get_turf(src)
new ammo_type(T)
dropped = 1
/obj/item/projectile/bullet/reusable/magspear
@@ -31,34 +33,45 @@
damage_type = OXY
nodamage = 1
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
icon_state = "foamdart_proj"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
range = 10
var/modified = 0
var/obj/item/weapon/pen/pen = null
/obj/item/projectile/bullet/reusable/foam_dart/handle_drop()
if(dropped)
return
var/turf/T = get_turf(src)
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
var/obj/item/ammo_casing/caseless/foam_dart/newcasing = new ammo_type(T)
newcasing.modified = modified
var/obj/item/projectile/bullet/reusable/foam_dart/newdart = newcasing.BB
newdart.modified = modified
newdart.damage = damage
newdart.nodamage = nodamage
newdart.damage_type = damage_type
if(pen)
var/obj/item/projectile/bullet/reusable/foam_dart/newdart_FD = newdart.BB
newdart_FD.pen = pen
pen.loc = newdart_FD
newdart.pen = pen
pen.forceMove(newdart)
pen = null
newdart.BB.damage = damage
newdart.BB.nodamage = nodamage
newdart.BB.damage_type = damage_type
newdart.update_icon()
/obj/item/projectile/bullet/reusable/foam_dart/Destroy()
pen = null
return ..()
/obj/item/projectile/bullet/reusable/foam_dart/riot
name = "riot foam dart"
icon_state = "foamdart_riot"
icon_state = "foamdart_riot_proj"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
stamina = 25
/obj/item/projectile/bullet/reusable/arrow
name = "arrow"
icon_state = "arrow"
ammo_type = /obj/item/ammo_casing/caseless/arrow
range = 10
damage = 25
damage_type = BRUTE
+33 -65
View File
@@ -5,6 +5,7 @@
damage_type = BURN
nodamage = 1
flag = "energy"
impact_effect_type = /obj/effect/overlay/temp/impact_effect/ion
/obj/item/projectile/ion/on_hit(atom/target, blocked = 0)
@@ -42,6 +43,27 @@
explosion(target, -1, 0, 2, 1, 0, flame_range = 3)
return 1
/obj/item/projectile/bullet/a84mm
name ="anti-armour rocket"
desc = "USE A WEEL GUN"
icon_state= "atrocket"
damage = 80
var/anti_armour_damage = 200
armour_penetration = 100
dismemberment = 100
/obj/item/projectile/bullet/a84mm/on_hit(atom/target, blocked = 0)
..()
explosion(target, -1, 1, 3, 1, 0, flame_range = 4)
if(istype(target, /obj/mecha))
var/obj/mecha/M = target
M.take_damage(anti_armour_damage)
if(istype(target, /mob/living/silicon))
var/mob/living/silicon/S = target
S.take_overall_damage(anti_armour_damage*0.75, anti_armour_damage*0.25)
return 1
/obj/item/projectile/temp
name = "freeze beam"
icon_state = "ice_2"
@@ -98,8 +120,8 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.dna.species.id == "pod")
randmuti(C)
randmut(C)
C.randmuti()
C.randmut()
C.updateappearance()
C.domutcheck()
@@ -121,63 +143,6 @@
M.adjustBrainLoss(20)
M.hallucination += 20
/obj/item/projectile/kinetic
name = "kinetic force"
icon_state = null
damage = 10
damage_type = BRUTE
flag = "bomb"
range = 3
var/splash = 0
/obj/item/projectile/kinetic/super
damage = 11
range = 4
/obj/item/projectile/kinetic/hyper
damage = 12
range = 5
splash = 1
/obj/item/projectile/kinetic/New()
var/turf/proj_turf = get_turf(src)
if(!istype(proj_turf, /turf))
return
var/datum/gas_mixture/environment = proj_turf.return_air()
var/pressure = environment.return_pressure()
if(pressure < 50)
name = "full strength kinetic force"
damage *= 4
..()
/obj/item/projectile/kinetic/on_range()
new /obj/effect/kinetic_blast(src.loc)
..()
/obj/item/projectile/kinetic/on_hit(atom/target)
. = ..()
var/turf/target_turf= get_turf(target)
if(istype(target_turf, /turf/closed/mineral))
var/turf/closed/mineral/M = target_turf
M.gets_drilled(firer)
new /obj/effect/kinetic_blast(target_turf)
if(src.splash)
for(var/turf/T in range(splash, target_turf))
if(istype(T, /turf/closed/mineral))
var/turf/closed/mineral/M = T
M.gets_drilled(firer)
/obj/effect/kinetic_blast
name = "kinetic explosion"
icon = 'icons/obj/projectiles.dmi'
icon_state = "kinetic_blast"
layer = ABOVE_ALL_MOB_LAYER
/obj/effect/kinetic_blast/New()
spawn(4)
qdel(src)
/obj/item/projectile/beam/wormhole
name = "bluespace beam"
icon_state = "spark"
@@ -221,23 +186,26 @@
icon_state = "plasmacutter"
damage_type = BRUTE
damage = 5
range = 5
range = 3.5 //works as 4, but doubles to 7
dismemberment = 20
impact_effect_type = /obj/effect/overlay/temp/impact_effect/purple_laser
/obj/item/projectile/plasma/New()
var/turf/proj_turf = get_turf(src)
if(!istype(proj_turf, /turf))
if(!isturf(proj_turf))
return
var/datum/gas_mixture/environment = proj_turf.return_air()
if(environment)
var/pressure = environment.return_pressure()
if(pressure < 60)
name = "full strength plasma blast"
name = "full strength [name]"
damage *= 4
range *= 2
..()
/obj/item/projectile/plasma/on_hit(atom/target)
. = ..()
if(istype(target, /turf/closed/mineral))
if(ismineralturf(target))
var/turf/closed/mineral/M = target
M.gets_drilled(firer)
Range()
@@ -246,11 +214,11 @@
/obj/item/projectile/plasma/adv
damage = 7
range = 7
range = 5
/obj/item/projectile/plasma/adv/mech
damage = 10
range = 8
range = 6
/obj/item/projectile/gravityrepulse