mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Gun cleanup and rewrite
Rewrites gun.dm. Reorganizes the firing procedure into logical procs and cleans up some unnecessary variables or demotes them to the subtypes that actually care. Energy weapons that create their own projectiles no longer care about in_chamber. Launcher support is much more natural now. Cleans up duplicated cyborg energy weapon power supply code. Adds support for energy weapons to recharge from external power sources, unifying cyborg and hardsuit mounted weapons. Incorporates the cyborg taser recharging mechanism. Cleans up laser tag gun duplication Changes path strings to actual paths. Changes relative paths to absolute paths. Renamed several targeting vars to make their purposes more clear. Fixed targeting not handling firing correctly for certain subtypes.
This commit is contained in:
@@ -871,7 +871,6 @@
|
|||||||
#include "code\modules\clothing\spacesuits\rig\modules\computer.dm"
|
#include "code\modules\clothing\spacesuits\rig\modules\computer.dm"
|
||||||
#include "code\modules\clothing\spacesuits\rig\modules\modules.dm"
|
#include "code\modules\clothing\spacesuits\rig\modules\modules.dm"
|
||||||
#include "code\modules\clothing\spacesuits\rig\modules\ninja.dm"
|
#include "code\modules\clothing\spacesuits\rig\modules\ninja.dm"
|
||||||
#include "code\modules\clothing\spacesuits\rig\modules\rig_weapons.dm"
|
|
||||||
#include "code\modules\clothing\spacesuits\rig\modules\utility.dm"
|
#include "code\modules\clothing\spacesuits\rig\modules\utility.dm"
|
||||||
#include "code\modules\clothing\spacesuits\rig\modules\vision.dm"
|
#include "code\modules\clothing\spacesuits\rig\modules\vision.dm"
|
||||||
#include "code\modules\clothing\spacesuits\rig\suits\alien.dm"
|
#include "code\modules\clothing\spacesuits\rig\suits\alien.dm"
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||||
mymob.gun_setting_icon.set_dir(2)
|
mymob.gun_setting_icon.set_dir(2)
|
||||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||||
if (G.target)
|
if (G.aim_targets)
|
||||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||||
if (mymob.client.target_can_click)
|
if (mymob.client.target_can_click)
|
||||||
mymob.item_use_icon.set_dir(1)
|
mymob.item_use_icon.set_dir(1)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ var/obj/screen/robot_inventory
|
|||||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||||
mymob.gun_setting_icon.set_dir(2)
|
mymob.gun_setting_icon.set_dir(2)
|
||||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||||
if (G.target)
|
if (G.aim_targets)
|
||||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||||
if (mymob.client.target_can_click)
|
if (mymob.client.target_can_click)
|
||||||
mymob.item_use_icon.set_dir(1)
|
mymob.item_use_icon.set_dir(1)
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
var/obj/item/weapon/gun/energy/taser/G = new /obj/item/weapon/gun/energy/taser(Tsec)
|
var/obj/item/weapon/gun/energy/taser/G = new /obj/item/weapon/gun/energy/taser(Tsec)
|
||||||
G.power_supply.charge = 0
|
G.power_supply.charge = 0
|
||||||
else if(lasercolor == "b")
|
else if(lasercolor == "b")
|
||||||
var/obj/item/weapon/gun/energy/laser/bluetag/G = new /obj/item/weapon/gun/energy/laser/bluetag(Tsec)
|
var/obj/item/weapon/gun/energy/lasertag/blue/G = new (Tsec)
|
||||||
G.power_supply.charge = 0
|
G.power_supply.charge = 0
|
||||||
else if(lasercolor == "r")
|
else if(lasercolor == "r")
|
||||||
var/obj/item/weapon/gun/energy/laser/redtag/G = new /obj/item/weapon/gun/energy/laser/redtag(Tsec)
|
var/obj/item/weapon/gun/energy/lasertag/red/G = new (Tsec)
|
||||||
G.power_supply.charge = 0
|
G.power_supply.charge = 0
|
||||||
if (prob(50))
|
if (prob(50))
|
||||||
new /obj/item/robot_parts/l_leg(Tsec)
|
new /obj/item/robot_parts/l_leg(Tsec)
|
||||||
@@ -137,11 +137,11 @@
|
|||||||
if(7)
|
if(7)
|
||||||
switch(lasercolor)
|
switch(lasercolor)
|
||||||
if("b")
|
if("b")
|
||||||
if( !istype(W, /obj/item/weapon/gun/energy/laser/bluetag) )
|
if( !istype(W, /obj/item/weapon/gun/energy/lasertag/blue) )
|
||||||
return
|
return
|
||||||
name = "bluetag ED-209 assembly"
|
name = "bluetag ED-209 assembly"
|
||||||
if("r")
|
if("r")
|
||||||
if( !istype(W, /obj/item/weapon/gun/energy/laser/redtag) )
|
if( !istype(W, /obj/item/weapon/gun/energy/lasertag/red) )
|
||||||
return
|
return
|
||||||
name = "redtag ED-209 assembly"
|
name = "redtag ED-209 assembly"
|
||||||
if("")
|
if("")
|
||||||
|
|||||||
@@ -702,10 +702,10 @@ Auto Patrol: []"},
|
|||||||
switch(lasercolor)
|
switch(lasercolor)
|
||||||
if("b")
|
if("b")
|
||||||
target_suit = /obj/item/clothing/suit/redtag
|
target_suit = /obj/item/clothing/suit/redtag
|
||||||
target_weapon = /obj/item/weapon/gun/energy/laser/redtag
|
target_weapon = /obj/item/weapon/gun/energy/lasertag/red
|
||||||
if("r")
|
if("r")
|
||||||
target_suit = /obj/item/clothing/suit/bluetag
|
target_suit = /obj/item/clothing/suit/bluetag
|
||||||
target_weapon = /obj/item/weapon/gun/energy/laser/bluetag
|
target_weapon = /obj/item/weapon/gun/energy/lasertag/blue
|
||||||
|
|
||||||
if((istype(perp.r_hand, target_weapon)) || (istype(perp.l_hand, target_weapon)))
|
if((istype(perp.r_hand, target_weapon)) || (istype(perp.l_hand, target_weapon)))
|
||||||
threat += 4
|
threat += 4
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
/obj/machinery/porta_turret/tag
|
/obj/machinery/porta_turret/tag
|
||||||
// Reasonable defaults, in case someone manually spawns us
|
// Reasonable defaults, in case someone manually spawns us
|
||||||
var/lasercolor = "r" //Something to do with lasertag turrets, blame Sieve for not adding a comment.
|
var/lasercolor = "r" //Something to do with lasertag turrets, blame Sieve for not adding a comment.
|
||||||
installation = /obj/item/weapon/gun/energy/laser/redtag
|
installation = /obj/item/weapon/gun/energy/lasertag/red
|
||||||
|
|
||||||
/obj/machinery/porta_turret/tag/red
|
/obj/machinery/porta_turret/tag/red
|
||||||
|
|
||||||
/obj/machinery/porta_turret/tag/blue
|
/obj/machinery/porta_turret/tag/blue
|
||||||
lasercolor = "b"
|
lasercolor = "b"
|
||||||
installation = /obj/item/weapon/gun/energy/laser/bluetag
|
installation = /obj/item/weapon/gun/energy/lasertag/blue
|
||||||
|
|
||||||
/obj/machinery/porta_turret/tag/New()
|
/obj/machinery/porta_turret/tag/New()
|
||||||
..()
|
..()
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
/obj/machinery/porta_turret/tag/weapon_setup(var/obj/item/weapon/gun/energy/E)
|
/obj/machinery/porta_turret/tag/weapon_setup(var/obj/item/weapon/gun/energy/E)
|
||||||
switch(E.type)
|
switch(E.type)
|
||||||
if(/obj/item/weapon/gun/energy/laser/bluetag)
|
if(/obj/item/weapon/gun/energy/lasertag/blue)
|
||||||
eprojectile = /obj/item/weapon/gun/energy/laser/bluetag
|
eprojectile = /obj/item/weapon/gun/energy/lasertag/blue
|
||||||
lasercolor = "b"
|
lasercolor = "b"
|
||||||
req_access = list(access_maint_tunnels, access_theatre)
|
req_access = list(access_maint_tunnels, access_theatre)
|
||||||
check_arrest = 0
|
check_arrest = 0
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
check_anomalies = 0
|
check_anomalies = 0
|
||||||
shot_delay = 30
|
shot_delay = 30
|
||||||
|
|
||||||
if(/obj/item/weapon/gun/energy/laser/redtag)
|
if(/obj/item/weapon/gun/energy/lasertag/red)
|
||||||
eprojectile = /obj/item/weapon/gun/energy/laser/redtag
|
eprojectile = /obj/item/weapon/gun/energy/lasertag/red
|
||||||
lasercolor = "r"
|
lasercolor = "r"
|
||||||
req_access = list(access_maint_tunnels, access_theatre)
|
req_access = list(access_maint_tunnels, access_theatre)
|
||||||
check_arrest = 0
|
check_arrest = 0
|
||||||
@@ -86,13 +86,13 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
if(lasercolor == "b" && disabled == 0)
|
if(lasercolor == "b" && disabled == 0)
|
||||||
if(istype(Proj, /obj/item/weapon/gun/energy/laser/redtag))
|
if(istype(Proj, /obj/item/weapon/gun/energy/lasertag/red))
|
||||||
disabled = 1
|
disabled = 1
|
||||||
del(Proj) // qdel
|
del(Proj) // qdel
|
||||||
sleep(100)
|
sleep(100)
|
||||||
disabled = 0
|
disabled = 0
|
||||||
if(lasercolor == "r" && disabled == 0)
|
if(lasercolor == "r" && disabled == 0)
|
||||||
if(istype(Proj, /obj/item/weapon/gun/energy/laser/bluetag))
|
if(istype(Proj, /obj/item/weapon/gun/energy/lasertag/blue))
|
||||||
disabled = 1
|
disabled = 1
|
||||||
del(Proj) // qdel
|
del(Proj) // qdel
|
||||||
sleep(100)
|
sleep(100)
|
||||||
@@ -110,10 +110,10 @@
|
|||||||
switch(lasercolor)
|
switch(lasercolor)
|
||||||
if("b")
|
if("b")
|
||||||
target_suit = /obj/item/clothing/suit/redtag
|
target_suit = /obj/item/clothing/suit/redtag
|
||||||
target_weapon = /obj/item/weapon/gun/energy/laser/redtag
|
target_weapon = /obj/item/weapon/gun/energy/lasertag/red
|
||||||
if("r")
|
if("r")
|
||||||
target_suit = /obj/item/clothing/suit/bluetag
|
target_suit = /obj/item/clothing/suit/bluetag
|
||||||
target_weapon = /obj/item/weapon/gun/energy/laser/bluetag
|
target_weapon = /obj/item/weapon/gun/energy/lasertag/blue
|
||||||
|
|
||||||
|
|
||||||
if(target_suit)//Lasertag turrets target the opposing team, how great is that? -Sieve
|
if(target_suit)//Lasertag turrets target the opposing team, how great is that? -Sieve
|
||||||
|
|||||||
@@ -733,7 +733,7 @@
|
|||||||
gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge
|
gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge
|
||||||
user << "<span class='notice'>You add [I] to the turret.</span>"
|
user << "<span class='notice'>You add [I] to the turret.</span>"
|
||||||
|
|
||||||
if(istype(installation, /obj/item/weapon/gun/energy/laser/bluetag) || istype(installation, /obj/item/weapon/gun/energy/laser/redtag))
|
if(istype(installation, /obj/item/weapon/gun/energy/lasertag/blue) || istype(installation, /obj/item/weapon/gun/energy/lasertag/red))
|
||||||
target_type = /obj/machinery/porta_turret/tag
|
target_type = /obj/machinery/porta_turret/tag
|
||||||
else
|
else
|
||||||
target_type = /obj/machinery/porta_turret
|
target_type = /obj/machinery/porta_turret
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
usr << "There's no mounting point for the module!"
|
usr << "There's no mounting point for the module!"
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/obj/item/weapon/gun/energy/taser/cyborg/T = locate() in R.module
|
var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module
|
||||||
if(!T)
|
if(!T)
|
||||||
T = locate() in R.module.contents
|
T = locate() in R.module.contents
|
||||||
if(!T)
|
if(!T)
|
||||||
|
|||||||
@@ -54,8 +54,8 @@
|
|||||||
|
|
||||||
/obj/structure/closet/lasertag/red/New()
|
/obj/structure/closet/lasertag/red/New()
|
||||||
..()
|
..()
|
||||||
new /obj/item/weapon/gun/energy/laser/redtag(src)
|
new /obj/item/weapon/gun/energy/lasertag/red(src)
|
||||||
new /obj/item/weapon/gun/energy/laser/redtag(src)
|
new /obj/item/weapon/gun/energy/lasertag/red(src)
|
||||||
new /obj/item/clothing/suit/redtag(src)
|
new /obj/item/clothing/suit/redtag(src)
|
||||||
new /obj/item/clothing/suit/redtag(src)
|
new /obj/item/clothing/suit/redtag(src)
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
/obj/structure/closet/lasertag/blue/New()
|
/obj/structure/closet/lasertag/blue/New()
|
||||||
..()
|
..()
|
||||||
new /obj/item/weapon/gun/energy/laser/bluetag(src)
|
new /obj/item/weapon/gun/energy/lasertag/blue(src)
|
||||||
new /obj/item/weapon/gun/energy/laser/bluetag(src)
|
new /obj/item/weapon/gun/energy/lasertag/blue(src)
|
||||||
new /obj/item/clothing/suit/bluetag(src)
|
new /obj/item/clothing/suit/bluetag(src)
|
||||||
new /obj/item/clothing/suit/bluetag(src)
|
new /obj/item/clothing/suit/bluetag(src)
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
//Weapon types intended to be used with rig modules
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/lasercannon/mounted/load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
var/obj/item/rig_module/module = loc
|
|
||||||
if(!istype(module))
|
|
||||||
return 0
|
|
||||||
if(module.holder && module.holder.wearer)
|
|
||||||
var/mob/living/carbon/human/H = module.holder.wearer
|
|
||||||
if(istype(H) && H.back)
|
|
||||||
var/obj/item/weapon/rig/suit = H.back
|
|
||||||
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
|
|
||||||
suit.cell.use(250)
|
|
||||||
in_chamber = new /obj/item/projectile/beam/heavylaser(src)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/gun/mounted/load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
var/obj/item/rig_module/module = loc
|
|
||||||
if(!istype(module))
|
|
||||||
return 0
|
|
||||||
if(module.holder && module.holder.wearer)
|
|
||||||
var/mob/living/carbon/human/H = module.holder.wearer
|
|
||||||
if(istype(H) && H.back)
|
|
||||||
var/obj/item/weapon/rig/suit = H.back
|
|
||||||
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
|
|
||||||
suit.cell.use(250)
|
|
||||||
var/prog_path = projectile_type
|
|
||||||
in_chamber = new prog_path(src)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/taser/mounted/load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
var/obj/item/rig_module/module = loc
|
|
||||||
if(!istype(module))
|
|
||||||
return 0
|
|
||||||
if(module.holder && module.holder.wearer)
|
|
||||||
var/mob/living/carbon/human/H = module.holder.wearer
|
|
||||||
if(istype(H) && H.back)
|
|
||||||
var/obj/item/weapon/rig/suit = H.back
|
|
||||||
if(istype(suit) && suit.cell && suit.cell.charge >= 250)
|
|
||||||
suit.cell.use(250)
|
|
||||||
var/prog_path = projectile_type
|
|
||||||
in_chamber = new prog_path(src)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
@@ -208,10 +208,6 @@
|
|||||||
if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
|
if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
|
||||||
usr << "\blue You need your gun equiped to holster it."
|
usr << "\blue You need your gun equiped to holster it."
|
||||||
return
|
return
|
||||||
var/obj/item/weapon/gun/W = usr.get_active_hand()
|
|
||||||
if (!W.isHandgun())
|
|
||||||
usr << "\red This gun won't fit in \the belt!"
|
|
||||||
return
|
|
||||||
holstered = usr.get_active_hand()
|
holstered = usr.get_active_hand()
|
||||||
usr.drop_item()
|
usr.drop_item()
|
||||||
holstered.loc = src
|
holstered.loc = src
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
item_state = "bluetag"
|
item_state = "bluetag"
|
||||||
blood_overlay_type = "armor"
|
blood_overlay_type = "armor"
|
||||||
body_parts_covered = UPPER_TORSO
|
body_parts_covered = UPPER_TORSO
|
||||||
allowed = list (/obj/item/weapon/gun/energy/laser/bluetag)
|
allowed = list (/obj/item/weapon/gun/energy/lasertag/blue)
|
||||||
siemens_coefficient = 3.0
|
siemens_coefficient = 3.0
|
||||||
|
|
||||||
/obj/item/clothing/suit/redtag
|
/obj/item/clothing/suit/redtag
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
item_state = "redtag"
|
item_state = "redtag"
|
||||||
blood_overlay_type = "armor"
|
blood_overlay_type = "armor"
|
||||||
body_parts_covered = UPPER_TORSO
|
body_parts_covered = UPPER_TORSO
|
||||||
allowed = list (/obj/item/weapon/gun/energy/laser/redtag)
|
allowed = list (/obj/item/weapon/gun/energy/lasertag/red)
|
||||||
siemens_coefficient = 3.0
|
siemens_coefficient = 3.0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -199,10 +199,6 @@
|
|||||||
item_color = "holster"
|
item_color = "holster"
|
||||||
var/obj/item/weapon/gun/holstered = null
|
var/obj/item/weapon/gun/holstered = null
|
||||||
|
|
||||||
//subtypes can override this to specify what can be holstered
|
|
||||||
/obj/item/clothing/tie/holster/proc/can_holster(obj/item/weapon/gun/W)
|
|
||||||
return W.isHandgun()
|
|
||||||
|
|
||||||
/obj/item/clothing/tie/holster/proc/holster(obj/item/I, mob/user as mob)
|
/obj/item/clothing/tie/holster/proc/holster(obj/item/I, mob/user as mob)
|
||||||
if(holstered)
|
if(holstered)
|
||||||
user << "\red There is already a [holstered] holstered here!"
|
user << "\red There is already a [holstered] holstered here!"
|
||||||
@@ -213,9 +209,6 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
var/obj/item/weapon/gun/W = I
|
var/obj/item/weapon/gun/W = I
|
||||||
if (!can_holster(W))
|
|
||||||
user << "\red This [W] won't fit in the [src]!"
|
|
||||||
return
|
|
||||||
|
|
||||||
holstered = W
|
holstered = W
|
||||||
user.drop_from_inventory(holstered)
|
user.drop_from_inventory(holstered)
|
||||||
|
|||||||
@@ -223,9 +223,9 @@
|
|||||||
src.modules += new /obj/item/borg/sight/hud/sec(src)
|
src.modules += new /obj/item/borg/sight/hud/sec(src)
|
||||||
src.modules += new /obj/item/weapon/handcuffs/cyborg(src)
|
src.modules += new /obj/item/weapon/handcuffs/cyborg(src)
|
||||||
src.modules += new /obj/item/weapon/melee/baton/robot(src)
|
src.modules += new /obj/item/weapon/melee/baton/robot(src)
|
||||||
src.modules += new /obj/item/weapon/gun/energy/taser/cyborg(src)
|
src.modules += new /obj/item/weapon/gun/energy/taser/mounted/cyborg(src)
|
||||||
src.modules += new /obj/item/taperoll/police(src)
|
src.modules += new /obj/item/taperoll/police(src)
|
||||||
src.emag = new /obj/item/weapon/gun/energy/laser/cyborg(src)
|
src.emag = new /obj/item/weapon/gun/energy/laser/mounted(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/robot_module/security/respawn_consumable(var/mob/living/silicon/robot/R)
|
/obj/item/weapon/robot_module/security/respawn_consumable(var/mob/living/silicon/robot/R)
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
F.icon_state = "flash"
|
F.icon_state = "flash"
|
||||||
else if(F.times_used)
|
else if(F.times_used)
|
||||||
F.times_used--
|
F.times_used--
|
||||||
var/obj/item/weapon/gun/energy/taser/cyborg/T = locate() in src.modules
|
var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in src.modules
|
||||||
if(T.power_supply.charge < T.power_supply.maxcharge)
|
if(T.power_supply.charge < T.power_supply.maxcharge)
|
||||||
T.power_supply.give(T.charge_cost)
|
T.power_supply.give(T.charge_cost)
|
||||||
T.update_icon()
|
T.update_icon()
|
||||||
@@ -383,11 +383,11 @@
|
|||||||
..()
|
..()
|
||||||
src.modules += new /obj/item/device/flash(src)
|
src.modules += new /obj/item/device/flash(src)
|
||||||
src.modules += new /obj/item/borg/sight/thermal(src)
|
src.modules += new /obj/item/borg/sight/thermal(src)
|
||||||
src.modules += new /obj/item/weapon/gun/energy/laser/cyborg(src)
|
src.modules += new /obj/item/weapon/gun/energy/laser/mounted(src)
|
||||||
src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src)
|
src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src)
|
||||||
src.modules += new /obj/item/borg/combat/shield(src)
|
src.modules += new /obj/item/borg/combat/shield(src)
|
||||||
src.modules += new /obj/item/borg/combat/mobility(src)
|
src.modules += new /obj/item/borg/combat/mobility(src)
|
||||||
src.emag = new /obj/item/weapon/gun/energy/lasercannon/cyborg(src)
|
src.emag = new /obj/item/weapon/gun/energy/lasercannon/mounted(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/robot_module/drone
|
/obj/item/weapon/robot_module/drone
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
usr << "There's no mounting point for the module!"
|
usr << "There's no mounting point for the module!"
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/obj/item/weapon/gun/energy/taser/cyborg/T = locate() in R.module
|
var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module
|
||||||
if(!T)
|
if(!T)
|
||||||
T = locate() in R.module.contents
|
T = locate() in R.module.contents
|
||||||
if(!T)
|
if(!T)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//Parent gun type. Guns are weapons that can be aimed at mobs and act over a distance
|
||||||
/obj/item/weapon/gun
|
/obj/item/weapon/gun
|
||||||
name = "gun"
|
name = "gun"
|
||||||
desc = "Its a gun. It's pretty terrible, though."
|
desc = "Its a gun. It's pretty terrible, though."
|
||||||
@@ -7,57 +8,74 @@
|
|||||||
flags = CONDUCT
|
flags = CONDUCT
|
||||||
slot_flags = SLOT_BELT
|
slot_flags = SLOT_BELT
|
||||||
matter = list("metal" = 2000)
|
matter = list("metal" = 2000)
|
||||||
w_class = 3.0
|
w_class = 3
|
||||||
throwforce = 5
|
throwforce = 5
|
||||||
throw_speed = 4
|
throw_speed = 4
|
||||||
throw_range = 5
|
throw_range = 5
|
||||||
force = 5.0
|
force = 5
|
||||||
origin_tech = "combat=1"
|
origin_tech = "combat=1"
|
||||||
attack_verb = list("struck", "hit", "bashed")
|
attack_verb = list("struck", "hit", "bashed")
|
||||||
|
|
||||||
var/fire_sound = 'sound/weapons/Gunshot.ogg'
|
|
||||||
var/obj/item/projectile/in_chamber = null
|
|
||||||
var/caliber = ""
|
|
||||||
var/silenced = 0
|
|
||||||
var/recoil = 0
|
|
||||||
var/ejectshell = 1
|
|
||||||
var/clumsy_check = 1
|
|
||||||
var/tmp/list/mob/living/target //List of who yer targeting.
|
|
||||||
var/tmp/lock_time = -100
|
|
||||||
var/tmp/mouthshoot = 0 ///To stop people from suiciding twice... >.>
|
|
||||||
var/automatic = 0 //Used to determine if you can target multiple people.
|
|
||||||
var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
|
|
||||||
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
|
|
||||||
var/firerate = 0 //0 for keep shooting until aim is lowered
|
|
||||||
// 1 for one bullet after tarrget moves and aim is lowered
|
|
||||||
var/fire_delay = 6
|
var/fire_delay = 6
|
||||||
|
var/fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||||
|
var/fire_sound_text = "gunshot"
|
||||||
|
var/recoil = 0 //screen shake
|
||||||
|
var/silenced = 0
|
||||||
|
|
||||||
var/last_fired = 0
|
var/last_fired = 0
|
||||||
|
|
||||||
proc/ready_to_fire()
|
//aiming system stuff
|
||||||
if(world.time >= last_fired + fire_delay)
|
var/keep_aim = 1 //1 for keep shooting until aim is lowered
|
||||||
last_fired = world.time
|
//0 for one bullet after tarrget moves and aim is lowered
|
||||||
return 1
|
var/multi_aim = 0 //Used to determine if you can target multiple people.
|
||||||
else
|
var/tmp/list/mob/living/aim_targets //List of who yer targeting.
|
||||||
return 0
|
var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
|
||||||
|
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
|
||||||
|
var/tmp/lock_time = -100
|
||||||
|
|
||||||
proc/load_into_chamber()
|
//Returns 1 if the gun is able to be fired
|
||||||
|
/obj/item/weapon/gun/proc/ready_to_fire()
|
||||||
|
if(world.time >= last_fired + fire_delay)
|
||||||
|
last_fired = world.time
|
||||||
|
return 1
|
||||||
|
else
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
proc/special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
|
//Checks whether a given mob can use the gun
|
||||||
return 1
|
/obj/item/weapon/gun/proc/special_check(var/mob/user)
|
||||||
|
if(!istype(user, /mob/living))
|
||||||
|
return 0
|
||||||
|
if(!user.IsAdvancedToolUser())
|
||||||
|
return 0
|
||||||
|
|
||||||
|
var/mob/living/M = user
|
||||||
|
|
||||||
|
if(HULK in M.mutations)
|
||||||
|
M << "<span class='danger'>Your fingers are much too large for the trigger guard!</span>"
|
||||||
|
return 0
|
||||||
|
if((CLUMSY in M.mutations) && prob(40) && can_fire()) //Clumsy handling
|
||||||
|
var/obj/in_chamber = get_next_projectile()
|
||||||
|
if(in_chamber)
|
||||||
|
if(process_projectile(in_chamber, user, user, pick("l_foot", "r_foot")))
|
||||||
|
handle_post_fire(user, user)
|
||||||
|
user.visible_message(
|
||||||
|
"<span class='danger'>[user] shoots \himself in the foot with \the [src]!</span>",
|
||||||
|
"<span class='danger'>You shoot yourself in the foot with \the [src]!</span>"
|
||||||
|
)
|
||||||
|
M.drop_item()
|
||||||
|
return 0
|
||||||
|
return 1
|
||||||
|
|
||||||
emp_act(severity)
|
/obj/item/weapon/gun/emp_act(severity)
|
||||||
for(var/obj/O in contents)
|
for(var/obj/O in contents)
|
||||||
O.emp_act(severity)
|
O.emp_act(severity)
|
||||||
|
|
||||||
/obj/item/weapon/gun/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
|
|
||||||
if(flag) return //It's adjacent, is the user, or is on the user's person
|
|
||||||
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/afterattack(atom/A, mob/living/user, adjacent, params)
|
||||||
|
if(adjacent) return //A is adjacent, is the user, or is on the user's person
|
||||||
|
|
||||||
//decide whether to aim or shoot normally
|
//decide whether to aim or shoot normally
|
||||||
var/aiming = 0
|
var/aiming = 0
|
||||||
if(user && user.client && !(A in target))
|
if(user && user.client && !(A in aim_targets))
|
||||||
var/client/C = user.client
|
var/client/C = user.client
|
||||||
//If help intent is on and we have clicked on an eligible target, switch to aim mode automatically
|
//If help intent is on and we have clicked on an eligible target, switch to aim mode automatically
|
||||||
if(user.a_intent == "help" && isliving(A) && !C.gun_mode)
|
if(user.a_intent == "help" && isliving(A) && !C.gun_mode)
|
||||||
@@ -72,30 +90,16 @@
|
|||||||
else
|
else
|
||||||
Fire(A,user,params) //Otherwise, fire normally.
|
Fire(A,user,params) //Otherwise, fire normally.
|
||||||
|
|
||||||
/obj/item/weapon/gun/proc/isHandgun()
|
/obj/item/weapon/gun/attack(atom/A, mob/living/user, def_zone)
|
||||||
return 1
|
if (A == user && user.zone_sel.selecting == "mouth" && !mouthshoot)
|
||||||
|
handle_suicide(user)
|
||||||
|
else if(user.a_intent == "hurt") //point blank shooting
|
||||||
|
Fire(A, user, pointblank=1)
|
||||||
|
else
|
||||||
|
return ..() //Pistolwhippin'
|
||||||
|
|
||||||
/obj/item/weapon/gun/proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this
|
/obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, params, pointblank=0, reflex=0)
|
||||||
//Exclude lasertag guns from the CLUMSY check.
|
if(!user || !target) return
|
||||||
if(!user) return
|
|
||||||
|
|
||||||
if(clumsy_check)
|
|
||||||
if(istype(user, /mob/living))
|
|
||||||
var/mob/living/M = user
|
|
||||||
if ((CLUMSY in M.mutations) && prob(50))
|
|
||||||
M << "<span class='danger'>[src] blows up in your face.</span>"
|
|
||||||
M.take_organ_damage(0,20)
|
|
||||||
M.drop_item()
|
|
||||||
del(src)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (!user.IsAdvancedToolUser())
|
|
||||||
return
|
|
||||||
if(istype(user, /mob/living))
|
|
||||||
var/mob/living/M = user
|
|
||||||
if (HULK in M.mutations)
|
|
||||||
M << "<span class='danger'>Your fingers are much too large for the trigger guard!</span>"
|
|
||||||
return
|
|
||||||
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
|
|
||||||
@@ -107,22 +111,70 @@
|
|||||||
user << "<span class='warning'>[src] is not ready to fire again!"
|
user << "<span class='warning'>[src] is not ready to fire again!"
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!load_into_chamber()) //CHECK
|
var/obj/in_chamber = get_next_projectile()
|
||||||
return click_empty(user)
|
|
||||||
|
|
||||||
if(!in_chamber)
|
if(!in_chamber)
|
||||||
|
handle_click_empty(user)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
user.next_move = world.time + 4
|
||||||
|
|
||||||
|
if(process_projectile(in_chamber, user, target, user.zone_sel.selecting, params, pointblank, reflex))
|
||||||
|
handle_post_fire(user, target, pointblank, reflex)
|
||||||
|
|
||||||
|
update_icon()
|
||||||
|
if(user.hand)
|
||||||
|
user.update_inv_l_hand()
|
||||||
|
else
|
||||||
|
user.update_inv_r_hand()
|
||||||
|
|
||||||
|
|
||||||
|
//returns the next projectile to fire
|
||||||
|
/obj/item/weapon/gun/proc/get_next_projectile()
|
||||||
|
return null
|
||||||
|
|
||||||
|
//TODO integrate this with gun code better.
|
||||||
|
//TODO maybe provide user so that subtypes can emit messages if they want?
|
||||||
|
/obj/item/weapon/gun/proc/can_fire()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
//used by aiming code
|
||||||
|
/obj/item/weapon/gun/proc/can_hit(atom/target as mob, var/mob/living/user as mob)
|
||||||
|
if(!special_check(user))
|
||||||
|
return 2
|
||||||
|
return 0 //in_chamber.check_fire(target,user)
|
||||||
|
|
||||||
|
//called if there was no projectile to shoot
|
||||||
|
/obj/item/weapon/gun/proc/handle_click_empty(mob/user)
|
||||||
|
if (user)
|
||||||
|
user.visible_message("*click click*", "<span class='danger'>*click*</span>")
|
||||||
|
else
|
||||||
|
src.visible_message("*click click*")
|
||||||
|
playsound(src.loc, 'sound/weapons/empty.ogg', 100, 1)
|
||||||
|
|
||||||
|
//called after successfully firing
|
||||||
|
/obj/item/weapon/gun/proc/handle_post_fire(mob/user, atom/target, var/pointblank=0, var/reflex=0)
|
||||||
if(silenced)
|
if(silenced)
|
||||||
playsound(user, fire_sound, 10, 1)
|
playsound(user, fire_sound, 10, 1)
|
||||||
else
|
else
|
||||||
playsound(user, fire_sound, 50, 1)
|
playsound(user, fire_sound, 50, 1)
|
||||||
user.visible_message("<span class='warning'>[user] fires [src][reflex ? " by reflex":""]!</span>", \
|
user.visible_message(
|
||||||
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>", \
|
"<span class='danger'>[user] fires [src][pointblank ? " point blank at [target]":""][reflex ? " by reflex":""]!</span>",
|
||||||
"You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>",
|
||||||
|
"You hear a [fire_sound_text]!"
|
||||||
user.next_move = world.time + 4
|
)
|
||||||
|
|
||||||
|
if(recoil)
|
||||||
|
spawn()
|
||||||
|
shake_camera(user, recoil + 1, recoil)
|
||||||
|
|
||||||
|
//does the actual shooting
|
||||||
|
/obj/item/weapon/gun/proc/process_projectile(obj/projectile, mob/user, atom/target, var/target_zone, var/params=null, var/pointblank=0, var/reflex=0)
|
||||||
|
if(!istype(projectile, /obj/item/projectile))
|
||||||
|
return 0 //default behaviour only applies to true projectiles
|
||||||
|
|
||||||
|
var/obj/item/projectile/P = projectile
|
||||||
|
|
||||||
|
//shooting while in shock
|
||||||
var/x_offset = 0
|
var/x_offset = 0
|
||||||
var/y_offset = 0
|
var/y_offset = 0
|
||||||
if(istype(user, /mob/living/carbon))
|
if(istype(user, /mob/living/carbon))
|
||||||
@@ -134,101 +186,52 @@
|
|||||||
y_offset = rand(-1,1)
|
y_offset = rand(-1,1)
|
||||||
x_offset = rand(-1,1)
|
x_offset = rand(-1,1)
|
||||||
|
|
||||||
var/p_x
|
//Point blank bonus
|
||||||
var/p_y
|
if(pointblank) P.damage *= 1.3
|
||||||
|
|
||||||
|
//TODO: accuracy modifiers
|
||||||
|
|
||||||
if(params)
|
if(params)
|
||||||
var/list/mouse_control = params2list(params)
|
P.set_clickpoint(params)
|
||||||
if(mouse_control["icon-x"])
|
|
||||||
p_x = text2num(mouse_control["icon-x"])
|
return !P.launch(target, user, src, target_zone, x_offset, y_offset)
|
||||||
if(mouse_control["icon-y"])
|
|
||||||
p_y = text2num(mouse_control["icon-y"])
|
//Suicide handling.
|
||||||
|
/obj/item/weapon/gun/var/mouthshoot = 0 //To stop people from suiciding twice... >.>
|
||||||
|
/obj/item/weapon/gun/proc/handle_suicide(mob/living/user)
|
||||||
|
if(!ishuman(user))
|
||||||
|
return
|
||||||
|
var/mob/living/carbon/human/M = user
|
||||||
|
|
||||||
if(in_chamber)
|
mouthshoot = 1
|
||||||
var/fail = in_chamber.launch(
|
M.visible_message("\red [user] sticks their gun in their mouth, ready to pull the trigger...")
|
||||||
target = target,
|
if(!do_after(user, 40))
|
||||||
user = user,
|
M.visible_message("\blue [user] decided life was worth living")
|
||||||
launcher = src,
|
mouthshoot = 0
|
||||||
target_zone = user.zone_sel.selecting,
|
return
|
||||||
x_offset = x_offset,
|
var/obj/item/projectile/in_chamber = get_next_projectile()
|
||||||
y_offset = y_offset,
|
if (istype(in_chamber))
|
||||||
px = p_x,
|
user.visible_message("<span class = 'warning'>[user] pulls the trigger.</span>")
|
||||||
py = p_y
|
if(silenced)
|
||||||
)
|
playsound(user, fire_sound, 10, 1)
|
||||||
|
|
||||||
if(fail) return
|
|
||||||
|
|
||||||
if(recoil)
|
|
||||||
spawn()
|
|
||||||
shake_camera(user, recoil + 1, recoil)
|
|
||||||
|
|
||||||
sleep(1)
|
|
||||||
in_chamber = null
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
|
|
||||||
if(user.hand)
|
|
||||||
user.update_inv_l_hand()
|
|
||||||
else
|
|
||||||
user.update_inv_r_hand()
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/proc/can_fire()
|
|
||||||
return load_into_chamber()
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/proc/can_hit(var/mob/living/target as mob, var/mob/living/user as mob)
|
|
||||||
return in_chamber.check_fire(target,user)
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/proc/click_empty(mob/user = null)
|
|
||||||
if (user)
|
|
||||||
user.visible_message("*click click*", "\red <b>*click*</b>")
|
|
||||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
|
||||||
else
|
|
||||||
src.visible_message("*click click*")
|
|
||||||
playsound(src.loc, 'sound/weapons/empty.ogg', 100, 1)
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
|
|
||||||
//Suicide handling.
|
|
||||||
if (M == user && user.zone_sel.selecting == "mouth" && !mouthshoot)
|
|
||||||
mouthshoot = 1
|
|
||||||
M.visible_message("\red [user] sticks their gun in their mouth, ready to pull the trigger...")
|
|
||||||
if(!do_after(user, 40))
|
|
||||||
M.visible_message("\blue [user] decided life was worth living")
|
|
||||||
mouthshoot = 0
|
|
||||||
return
|
|
||||||
if (load_into_chamber())
|
|
||||||
user.visible_message("<span class = 'warning'>[user] pulls the trigger.</span>")
|
|
||||||
if(silenced)
|
|
||||||
playsound(user, fire_sound, 10, 1)
|
|
||||||
else
|
|
||||||
playsound(user, fire_sound, 50, 1)
|
|
||||||
if(istype(in_chamber, /obj/item/projectile/beam/lastertag))
|
|
||||||
user.show_message("<span class = 'warning'>You feel rather silly, trying to commit suicide with a toy.</span>")
|
|
||||||
mouthshoot = 0
|
|
||||||
return
|
|
||||||
|
|
||||||
in_chamber.on_hit(M)
|
|
||||||
if (in_chamber.damage_type != HALLOSS)
|
|
||||||
user.apply_damage(in_chamber.damage*2.5, in_chamber.damage_type, "head", used_weapon = "Point blank shot in the mouth with \a [in_chamber]", sharp=1)
|
|
||||||
user.death()
|
|
||||||
else
|
|
||||||
user << "<span class = 'notice'>Ow...</span>"
|
|
||||||
user.apply_effect(110,AGONY,0)
|
|
||||||
del(in_chamber)
|
|
||||||
mouthshoot = 0
|
|
||||||
return
|
|
||||||
else
|
else
|
||||||
click_empty(user)
|
playsound(user, fire_sound, 50, 1)
|
||||||
|
if(istype(in_chamber, /obj/item/projectile/beam/lastertag))
|
||||||
|
user.show_message("<span class = 'warning'>You feel rather silly, trying to commit suicide with a toy.</span>")
|
||||||
mouthshoot = 0
|
mouthshoot = 0
|
||||||
return
|
return
|
||||||
|
|
||||||
if (load_into_chamber())
|
in_chamber.on_hit(M)
|
||||||
//Point blank shooting if on harm intent or target we were targeting.
|
if (in_chamber.damage_type != HALLOSS)
|
||||||
if(user.a_intent == "hurt")
|
user.apply_damage(in_chamber.damage*2.5, in_chamber.damage_type, "head", used_weapon = "Point blank shot in the mouth with \a [in_chamber]", sharp=1)
|
||||||
user.visible_message("\red <b> \The [user] fires \the [src] point blank at [M]!</b>")
|
user.death()
|
||||||
if(istype(in_chamber)) in_chamber.damage *= 1.3
|
else
|
||||||
Fire(M,user)
|
user << "<span class = 'notice'>Ow...</span>"
|
||||||
return
|
user.apply_effect(110,AGONY,0)
|
||||||
else if(target && M in target)
|
del(in_chamber)
|
||||||
Fire(M,user) ///Otherwise, shoot!
|
mouthshoot = 0
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
return ..() //Pistolwhippin'
|
handle_click_empty(user)
|
||||||
|
mouthshoot = 0
|
||||||
|
return
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/spikethrower/process()
|
/obj/item/weapon/gun/launcher/spikethrower/process()
|
||||||
|
|
||||||
if(spikes < max_spikes && world.time > last_regen + spike_gen_time)
|
if(spikes < max_spikes && world.time > last_regen + spike_gen_time)
|
||||||
spikes++
|
spikes++
|
||||||
last_regen = world.time
|
last_regen = world.time
|
||||||
@@ -32,7 +31,7 @@
|
|||||||
|
|
||||||
/obj/item/weapon/gun/launcher/spikethrower/examine(mob/user)
|
/obj/item/weapon/gun/launcher/spikethrower/examine(mob/user)
|
||||||
..(user)
|
..(user)
|
||||||
user << "It has [spikes] [spikes == 1 ? "spike" : "spikes"] remaining."
|
user << "It has [spikes] spike\s remaining."
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/spikethrower/update_icon()
|
/obj/item/weapon/gun/launcher/spikethrower/update_icon()
|
||||||
icon_state = "spikethrower[spikes]"
|
icon_state = "spikethrower[spikes]"
|
||||||
@@ -46,21 +45,18 @@
|
|||||||
if(H.species && H.species.name != "Vox" && H.species.name != "Vox Armalis")
|
if(H.species && H.species.name != "Vox" && H.species.name != "Vox Armalis")
|
||||||
user << "\red \The [src] does not respond to you!"
|
user << "\red \The [src] does not respond to you!"
|
||||||
return 0
|
return 0
|
||||||
return 1
|
return ..()
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/spikethrower/update_release_force()
|
/obj/item/weapon/gun/launcher/spikethrower/update_release_force()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/spikethrower/load_into_chamber()
|
/obj/item/weapon/gun/launcher/spikethrower/can_fire()
|
||||||
if(in_chamber) return 1
|
return (spikes >= 1)
|
||||||
if(spikes < 1) return 0
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/launcher/spikethrower/get_next_projectile()
|
||||||
|
if(spikes < 1) return null
|
||||||
spikes--
|
spikes--
|
||||||
in_chamber = new /obj/item/weapon/spike(src)
|
return new /obj/item/weapon/spike(src)
|
||||||
return 1
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/spikethrower/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
|
|
||||||
if(..()) update_icon()
|
|
||||||
|
|
||||||
//This gun only functions for armalis. The on-sprite is too huge to render properly on other sprites.
|
//This gun only functions for armalis. The on-sprite is too huge to render properly on other sprites.
|
||||||
/obj/item/weapon/gun/energy/noisecannon
|
/obj/item/weapon/gun/energy/noisecannon
|
||||||
@@ -74,7 +70,7 @@
|
|||||||
|
|
||||||
force = 10
|
force = 10
|
||||||
projectile_type = /obj/item/projectile/energy/sonic
|
projectile_type = /obj/item/projectile/energy/sonic
|
||||||
cell_type = "/obj/item/weapon/cell/super"
|
cell_type = /obj/item/weapon/cell/super
|
||||||
fire_delay = 40
|
fire_delay = 40
|
||||||
fire_sound = 'sound/effects/basscannon.ogg'
|
fire_sound = 'sound/effects/basscannon.ogg'
|
||||||
|
|
||||||
@@ -94,10 +90,6 @@
|
|||||||
user << "\red \The [src] is far too large for you to pick up."
|
user << "\red \The [src] is far too large for you to pick up."
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/noisecannon/load_into_chamber() //Does not have ammo.
|
|
||||||
in_chamber = new projectile_type(src)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/noisecannon/update_icon()
|
/obj/item/weapon/gun/energy/noisecannon/update_icon()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,79 @@
|
|||||||
desc = "A basic energy-based gun."
|
desc = "A basic energy-based gun."
|
||||||
icon_state = "energy"
|
icon_state = "energy"
|
||||||
fire_sound = 'sound/weapons/Taser.ogg'
|
fire_sound = 'sound/weapons/Taser.ogg'
|
||||||
|
fire_sound_text = "laser blast"
|
||||||
|
|
||||||
var/obj/item/weapon/cell/power_supply //What type of power cell this uses
|
var/obj/item/weapon/cell/power_supply //What type of power cell this uses
|
||||||
var/charge_cost = 100 //How much energy is needed to fire.
|
var/charge_cost = 100 //How much energy is needed to fire.
|
||||||
var/cell_type = "/obj/item/weapon/cell"
|
var/cell_type = /obj/item/weapon/cell
|
||||||
var/projectile_type = /obj/item/projectile/beam/practice
|
var/projectile_type = /obj/item/projectile/beam/practice
|
||||||
var/modifystate
|
var/modifystate
|
||||||
|
var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge
|
||||||
|
|
||||||
|
//self-recharging
|
||||||
|
var/self_recharge = 0 //if set, the weapon will recharge itself
|
||||||
|
var/use_external_power = 0 //if set, the weapon will look for an external power source to draw from, otherwise it recharges magically
|
||||||
|
var/recharge_time = 4
|
||||||
|
var/charge_tick = 0
|
||||||
|
|
||||||
emp_act(severity)
|
/obj/item/weapon/gun/energy/emp_act(severity)
|
||||||
power_supply.use(round(power_supply.maxcharge / severity))
|
power_supply.use(round(power_supply.maxcharge / severity))
|
||||||
update_icon()
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
if(cell_type)
|
|
||||||
power_supply = new cell_type(src)
|
|
||||||
else
|
|
||||||
power_supply = new(src)
|
|
||||||
power_supply.give(power_supply.maxcharge)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
load_into_chamber()
|
|
||||||
if(in_chamber) return 1
|
|
||||||
if(!power_supply) return 0
|
|
||||||
if(!power_supply.use(charge_cost)) return 0
|
|
||||||
if(!ispath(projectile_type)) return 0
|
|
||||||
in_chamber = new projectile_type(src)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
..()
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/New()
|
||||||
|
..()
|
||||||
|
if(cell_type)
|
||||||
|
power_supply = new cell_type(src)
|
||||||
|
power_supply.give(power_supply.maxcharge)
|
||||||
|
if(self_recharge)
|
||||||
|
processing_objects.Add(src)
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/Del()
|
||||||
|
if(self_recharge)
|
||||||
|
processing_objects.Remove(src)
|
||||||
|
..()
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/process()
|
||||||
|
if(self_recharge) //Every [recharge_time] ticks, recharge a shot for the cyborg
|
||||||
|
charge_tick++
|
||||||
|
if(charge_tick < recharge_time) return 0
|
||||||
|
charge_tick = 0
|
||||||
|
|
||||||
|
if(!power_supply || power_supply.charge >= power_supply.maxcharge)
|
||||||
|
return 0 // check if we actually need to recharge
|
||||||
|
|
||||||
|
if(use_external_power)
|
||||||
|
var/obj/item/weapon/cell/external = get_external_power_supply()
|
||||||
|
if(!external || !external.use(charge_cost)) //Take power from the borg...
|
||||||
|
return 0
|
||||||
|
|
||||||
|
power_supply.give(charge_cost) //... to recharge the shot
|
||||||
|
update_icon()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/get_next_projectile()
|
||||||
|
if(!power_supply) return null
|
||||||
|
if(!ispath(projectile_type)) return null
|
||||||
|
if(!power_supply.use(charge_cost)) return null
|
||||||
|
return new projectile_type(src)
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
|
||||||
|
if(isrobot(src.loc))
|
||||||
|
var/mob/living/silicon/robot/R = src.loc
|
||||||
|
return R.cell
|
||||||
|
if(istype(src.loc, /obj/item/rig_module))
|
||||||
|
var/obj/item/rig_module/module = src.loc
|
||||||
|
if(module.holder && module.holder.wearer)
|
||||||
|
var/mob/living/carbon/human/H = module.holder.wearer
|
||||||
|
if(istype(H) && H.back)
|
||||||
|
var/obj/item/weapon/rig/suit = H.back
|
||||||
|
if(istype(suit))
|
||||||
|
return suit.cell
|
||||||
|
return null
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/update_icon()
|
||||||
|
if(charge_meter)
|
||||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||||
ratio = round(ratio, 0.25) * 100
|
ratio = round(ratio, 0.25) * 100
|
||||||
if(modifystate)
|
if(modifystate)
|
||||||
|
|||||||
@@ -9,84 +9,43 @@
|
|||||||
origin_tech = "combat=3;magnets=2"
|
origin_tech = "combat=3;magnets=2"
|
||||||
projectile_type = /obj/item/projectile/beam
|
projectile_type = /obj/item/projectile/beam
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/laser/mounted
|
||||||
|
self_recharge = 1
|
||||||
|
use_external_power = 1
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/laser/practice
|
/obj/item/weapon/gun/energy/laser/practice
|
||||||
name = "practice laser gun"
|
name = "practice laser gun"
|
||||||
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
|
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
|
||||||
projectile_type = /obj/item/projectile/beam/practice
|
projectile_type = /obj/item/projectile/beam/practice
|
||||||
clumsy_check = 0
|
|
||||||
|
|
||||||
obj/item/weapon/gun/energy/laser/retro
|
obj/item/weapon/gun/energy/laser/retro
|
||||||
name = "retro laser"
|
name = "retro laser"
|
||||||
icon_state = "retro"
|
icon_state = "retro"
|
||||||
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/laser/captain
|
/obj/item/weapon/gun/energy/laser/captain
|
||||||
name = "antique laser gun"
|
name = "antique laser gun"
|
||||||
icon_state = "caplaser"
|
icon_state = "caplaser"
|
||||||
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
|
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
|
||||||
force = 10
|
force = 10
|
||||||
origin_tech = null
|
origin_tech = null
|
||||||
var/charge_tick = 0
|
self_recharge = 1
|
||||||
|
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
processing_objects.Add(src)
|
|
||||||
|
|
||||||
|
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < 4) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(100)
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/laser/cyborg/load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
if(isrobot(src.loc))
|
|
||||||
var/mob/living/silicon/robot/R = src.loc
|
|
||||||
if(R && R.cell)
|
|
||||||
R.cell.use(100)
|
|
||||||
in_chamber = new/obj/item/projectile/beam(src)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/lasercannon
|
/obj/item/weapon/gun/energy/lasercannon
|
||||||
name = "laser cannon"
|
name = "laser cannon"
|
||||||
desc = "With the L.A.S.E.R. cannon, the lasing medium is enclosed in a tube lined with uranium-235 and subjected to high neutron flux in a nuclear reactor core. This incredible technology may help YOU achieve high excitation rates with small laser volumes!"
|
desc = "With the laser cannon, the lasing medium is enclosed in a tube lined with uranium-235 and subjected to high neutron flux in a nuclear reactor core. This incredible technology may help YOU achieve high excitation rates with small laser volumes!"
|
||||||
icon_state = "lasercannon"
|
icon_state = "lasercannon"
|
||||||
fire_sound = 'sound/weapons/lasercannonfire.ogg'
|
fire_sound = 'sound/weapons/lasercannonfire.ogg'
|
||||||
origin_tech = "combat=4;materials=3;powerstorage=3"
|
origin_tech = "combat=4;materials=3;powerstorage=3"
|
||||||
projectile_type = "/obj/item/projectile/beam/heavylaser"
|
projectile_type = /obj/item/projectile/beam/heavylaser
|
||||||
|
charge_cost = 250
|
||||||
fire_delay = 20
|
fire_delay = 20
|
||||||
|
|
||||||
isHandgun()
|
/obj/item/weapon/gun/energy/lasercannon/mounted
|
||||||
return 0
|
self_recharge = 1
|
||||||
|
use_external_power = 1
|
||||||
/obj/item/weapon/gun/energy/lasercannon/cyborg/load_into_chamber()
|
recharge_time = 25
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
if(isrobot(src.loc))
|
|
||||||
var/mob/living/silicon/robot/R = src.loc
|
|
||||||
if(R && R.cell)
|
|
||||||
R.cell.use(250)
|
|
||||||
in_chamber = new/obj/item/projectile/beam/heavylaser(src)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/xray
|
/obj/item/weapon/gun/energy/xray
|
||||||
name = "xray laser gun"
|
name = "xray laser gun"
|
||||||
@@ -94,80 +53,32 @@ obj/item/weapon/gun/energy/laser/retro
|
|||||||
icon_state = "xray"
|
icon_state = "xray"
|
||||||
fire_sound = 'sound/weapons/laser3.ogg'
|
fire_sound = 'sound/weapons/laser3.ogg'
|
||||||
origin_tech = "combat=5;materials=3;magnets=2;syndicate=2"
|
origin_tech = "combat=5;materials=3;magnets=2;syndicate=2"
|
||||||
projectile_type = "/obj/item/projectile/beam/xray"
|
projectile_type = /obj/item/projectile/beam/xray
|
||||||
charge_cost = 50
|
charge_cost = 50
|
||||||
|
|
||||||
|
|
||||||
////////Laser Tag////////////////////
|
////////Laser Tag////////////////////
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/laser/bluetag
|
/obj/item/weapon/gun/energy/lasertag
|
||||||
name = "laser tag gun"
|
name = "laser tag gun"
|
||||||
|
desc = "Standard issue weapon of the Imperial Guard"
|
||||||
|
origin_tech = "combat=1;magnets=2"
|
||||||
|
self_recharge = 1
|
||||||
|
var/required_vest
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/lasertag/special_check(var/mob/living/carbon/human/M)
|
||||||
|
if(ishuman(M))
|
||||||
|
if(!istype(M.wear_suit, required_vest))
|
||||||
|
M << "\red You need to be wearing your laser tag vest!"
|
||||||
|
return 0
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/lasertag/blue
|
||||||
icon_state = "bluetag"
|
icon_state = "bluetag"
|
||||||
desc = "Standard issue weapon of the Imperial Guard"
|
projectile_type = /obj/item/projectile/beam/lastertag/blue
|
||||||
projectile_type = "/obj/item/projectile/beam/lastertag/blue"
|
required_vest = /obj/item/clothing/suit/bluetag
|
||||||
origin_tech = "combat=1;magnets=2"
|
|
||||||
clumsy_check = 0
|
|
||||||
var/charge_tick = 0
|
|
||||||
|
|
||||||
special_check(var/mob/living/carbon/human/M)
|
/obj/item/weapon/gun/energy/lasertag/red
|
||||||
if(ishuman(M))
|
|
||||||
if(istype(M.wear_suit, /obj/item/clothing/suit/bluetag))
|
|
||||||
return 1
|
|
||||||
M << "\red You need to be wearing your laser tag vest!"
|
|
||||||
return 0
|
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
processing_objects.Add(src)
|
|
||||||
|
|
||||||
|
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < 4) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(100)
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/laser/redtag
|
|
||||||
name = "laser tag gun"
|
|
||||||
icon_state = "redtag"
|
icon_state = "redtag"
|
||||||
desc = "Standard issue weapon of the Imperial Guard"
|
projectile_type = /obj/item/projectile/beam/lastertag/red
|
||||||
projectile_type = "/obj/item/projectile/beam/lastertag/red"
|
required_vest = /obj/item/clothing/suit/redtag
|
||||||
origin_tech = "combat=1;magnets=2"
|
|
||||||
clumsy_check = 0
|
|
||||||
var/charge_tick = 0
|
|
||||||
|
|
||||||
special_check(var/mob/living/carbon/human/M)
|
|
||||||
if(ishuman(M))
|
|
||||||
if(istype(M.wear_suit, /obj/item/clothing/suit/redtag))
|
|
||||||
return 1
|
|
||||||
M << "\red You need to be wearing your laser tag vest!"
|
|
||||||
return 0
|
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
processing_objects.Add(src)
|
|
||||||
|
|
||||||
|
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < 4) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(100)
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/obj/item/weapon/gun/energy/gun
|
/obj/item/weapon/gun/energy/gun
|
||||||
name = "energy gun"
|
name = "energy gun"
|
||||||
desc = "A basic energy-based gun with two settings: Stun and kill."
|
desc = "An energy-based gun with two settings: Stun and kill."
|
||||||
icon_state = "energystun100"
|
icon_state = "energystun100"
|
||||||
item_state = null //so the human update icon uses the icon_state instead.
|
item_state = null //so the human update icon uses the icon_state instead.
|
||||||
fire_sound = 'sound/weapons/Taser.ogg'
|
fire_sound = 'sound/weapons/Taser.ogg'
|
||||||
@@ -12,118 +12,106 @@
|
|||||||
|
|
||||||
var/mode = 0 //0 = stun, 1 = kill
|
var/mode = 0 //0 = stun, 1 = kill
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/gun/attack_self(mob/living/user as mob)
|
||||||
|
switch(mode)
|
||||||
|
if(0)
|
||||||
|
mode = 1
|
||||||
|
charge_cost = 100
|
||||||
|
fire_sound = 'sound/weapons/Laser.ogg'
|
||||||
|
user << "\red [src.name] is now set to kill."
|
||||||
|
projectile_type = /obj/item/projectile/beam
|
||||||
|
modifystate = "energykill"
|
||||||
|
if(1)
|
||||||
|
mode = 0
|
||||||
|
charge_cost = 100
|
||||||
|
fire_sound = 'sound/weapons/Taser.ogg'
|
||||||
|
user << "\red [src.name] is now set to stun."
|
||||||
|
projectile_type = /obj/item/projectile/beam/stun
|
||||||
|
modifystate = "energystun"
|
||||||
|
update_icon()
|
||||||
|
if(user.l_hand == src)
|
||||||
|
user.update_inv_l_hand()
|
||||||
|
else
|
||||||
|
user.update_inv_r_hand()
|
||||||
|
|
||||||
attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/energy/gun/mounted
|
||||||
switch(mode)
|
self_recharge = 1
|
||||||
if(0)
|
use_external_power = 1
|
||||||
mode = 1
|
|
||||||
charge_cost = 100
|
|
||||||
fire_sound = 'sound/weapons/Laser.ogg'
|
|
||||||
user << "\red [src.name] is now set to kill."
|
|
||||||
projectile_type = /obj/item/projectile/beam
|
|
||||||
modifystate = "energykill"
|
|
||||||
if(1)
|
|
||||||
mode = 0
|
|
||||||
charge_cost = 100
|
|
||||||
fire_sound = 'sound/weapons/Taser.ogg'
|
|
||||||
user << "\red [src.name] is now set to stun."
|
|
||||||
projectile_type = /obj/item/projectile/beam/stun
|
|
||||||
modifystate = "energystun"
|
|
||||||
update_icon()
|
|
||||||
if(user.l_hand == src)
|
|
||||||
user.update_inv_l_hand()
|
|
||||||
else
|
|
||||||
user.update_inv_r_hand()
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/gun/nuclear
|
/obj/item/weapon/gun/energy/gun/nuclear
|
||||||
name = "advanced energy gun"
|
name = "advanced energy gun"
|
||||||
desc = "An energy gun with an experimental miniaturized reactor."
|
desc = "An energy gun with an experimental miniaturized reactor."
|
||||||
icon_state = "nucgun"
|
icon_state = "nucgun"
|
||||||
origin_tech = "combat=3;materials=5;powerstorage=3"
|
origin_tech = "combat=3;materials=5;powerstorage=3"
|
||||||
|
self_recharge = 1
|
||||||
var/lightfail = 0
|
var/lightfail = 0
|
||||||
var/charge_tick = 0
|
|
||||||
|
|
||||||
New()
|
//override for failcheck behaviour
|
||||||
..()
|
/obj/item/weapon/gun/energy/gun/nuclear/process()
|
||||||
processing_objects.Add(src)
|
charge_tick++
|
||||||
|
if(charge_tick < 4) return 0
|
||||||
|
charge_tick = 0
|
||||||
|
if(!power_supply) return 0
|
||||||
|
if((power_supply.charge / power_supply.maxcharge) != 1)
|
||||||
|
if(!failcheck()) return 0
|
||||||
|
power_supply.give(charge_cost)
|
||||||
|
update_icon()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/gun/nuclear/proc/failcheck()
|
||||||
Del()
|
lightfail = 0
|
||||||
|
if (prob(src.reliability)) return 1 //No failure
|
||||||
|
if (prob(src.reliability))
|
||||||
|
for (var/mob/living/M in range(0,src)) //Only a minor failure, enjoy your radiation if you're in the same tile or carrying it
|
||||||
|
if (src in M.contents)
|
||||||
|
M << "\red Your gun feels pleasantly warm for a moment."
|
||||||
|
else
|
||||||
|
M << "\red You feel a warm sensation."
|
||||||
|
M.apply_effect(rand(3,120), IRRADIATE)
|
||||||
|
lightfail = 1
|
||||||
|
else
|
||||||
|
for (var/mob/living/M in range(rand(1,4),src)) //Big failure, TIME FOR RADIATION BITCHES
|
||||||
|
if (src in M.contents)
|
||||||
|
M << "\red Your gun's reactor overloads!"
|
||||||
|
M << "\red You feel a wave of heat wash over you."
|
||||||
|
M.apply_effect(300, IRRADIATE)
|
||||||
|
crit_fail = 1 //break the gun so it stops recharging
|
||||||
processing_objects.Remove(src)
|
processing_objects.Remove(src)
|
||||||
..()
|
update_icon()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
process()
|
/obj/item/weapon/gun/energy/gun/nuclear/proc/update_charge()
|
||||||
charge_tick++
|
if (crit_fail)
|
||||||
if(charge_tick < 4) return 0
|
overlays += "nucgun-whee"
|
||||||
charge_tick = 0
|
return
|
||||||
if(!power_supply) return 0
|
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||||
if((power_supply.charge / power_supply.maxcharge) != 1)
|
ratio = round(ratio, 0.25) * 100
|
||||||
if(!failcheck()) return 0
|
overlays += "nucgun-[ratio]"
|
||||||
power_supply.give(100)
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/gun/nuclear/proc/update_reactor()
|
||||||
|
if(crit_fail)
|
||||||
|
overlays += "nucgun-crit"
|
||||||
|
return
|
||||||
|
if(lightfail)
|
||||||
|
overlays += "nucgun-medium"
|
||||||
|
else if ((power_supply.charge/power_supply.maxcharge) <= 0.5)
|
||||||
|
overlays += "nucgun-light"
|
||||||
|
else
|
||||||
|
overlays += "nucgun-clean"
|
||||||
|
|
||||||
proc
|
/obj/item/weapon/gun/energy/gun/nuclear/proc/update_mode()
|
||||||
failcheck()
|
if (mode == 0)
|
||||||
lightfail = 0
|
overlays += "nucgun-stun"
|
||||||
if (prob(src.reliability)) return 1 //No failure
|
else if (mode == 1)
|
||||||
if (prob(src.reliability))
|
overlays += "nucgun-kill"
|
||||||
for (var/mob/living/M in range(0,src)) //Only a minor failure, enjoy your radiation if you're in the same tile or carrying it
|
|
||||||
if (src in M.contents)
|
|
||||||
M << "\red Your gun feels pleasantly warm for a moment."
|
|
||||||
else
|
|
||||||
M << "\red You feel a warm sensation."
|
|
||||||
M.apply_effect(rand(3,120), IRRADIATE)
|
|
||||||
lightfail = 1
|
|
||||||
else
|
|
||||||
for (var/mob/living/M in range(rand(1,4),src)) //Big failure, TIME FOR RADIATION BITCHES
|
|
||||||
if (src in M.contents)
|
|
||||||
M << "\red Your gun's reactor overloads!"
|
|
||||||
M << "\red You feel a wave of heat wash over you."
|
|
||||||
M.apply_effect(300, IRRADIATE)
|
|
||||||
crit_fail = 1 //break the gun so it stops recharging
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
update_icon()
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/gun/nuclear/emp_act(severity)
|
||||||
|
..()
|
||||||
|
reliability -= round(15/severity)
|
||||||
|
|
||||||
update_charge()
|
/obj/item/weapon/gun/energy/gun/nuclear/update_icon()
|
||||||
if (crit_fail)
|
overlays.Cut()
|
||||||
overlays += "nucgun-whee"
|
update_charge()
|
||||||
return
|
update_reactor()
|
||||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
update_mode()
|
||||||
ratio = round(ratio, 0.25) * 100
|
|
||||||
overlays += "nucgun-[ratio]"
|
|
||||||
|
|
||||||
|
|
||||||
update_reactor()
|
|
||||||
if(crit_fail)
|
|
||||||
overlays += "nucgun-crit"
|
|
||||||
return
|
|
||||||
if(lightfail)
|
|
||||||
overlays += "nucgun-medium"
|
|
||||||
else if ((power_supply.charge/power_supply.maxcharge) <= 0.5)
|
|
||||||
overlays += "nucgun-light"
|
|
||||||
else
|
|
||||||
overlays += "nucgun-clean"
|
|
||||||
|
|
||||||
|
|
||||||
update_mode()
|
|
||||||
if (mode == 0)
|
|
||||||
overlays += "nucgun-stun"
|
|
||||||
else if (mode == 1)
|
|
||||||
overlays += "nucgun-kill"
|
|
||||||
|
|
||||||
|
|
||||||
emp_act(severity)
|
|
||||||
..()
|
|
||||||
reliability -= round(15/severity)
|
|
||||||
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
overlays.Cut()
|
|
||||||
update_charge()
|
|
||||||
update_reactor()
|
|
||||||
update_mode()
|
|
||||||
|
|||||||
@@ -1,70 +1,55 @@
|
|||||||
/obj/item/weapon/gun/energy/pulse_rifle
|
/obj/item/weapon/gun/energy/pulse_rifle
|
||||||
name = "pulse rifle"
|
name = "pulse rifle"
|
||||||
desc = "A heavy-duty, pulse-based energy weapon, preferred by front-line combat personnel."
|
desc = "A weapon that uses advanced pulse-based beam generation technology to emit powerful laser blasts. Because of its complexity and cost, it is rarely seen in use except by specialists."
|
||||||
icon_state = "pulse"
|
icon_state = "pulse"
|
||||||
item_state = null //so the human update icon uses the icon_state instead.
|
item_state = null //so the human update icon uses the icon_state instead.
|
||||||
force = 10
|
force = 10
|
||||||
fire_sound = 'sound/weapons/pulse.ogg'
|
fire_sound = 'sound/weapons/pulse.ogg'
|
||||||
charge_cost = 200
|
charge_cost = 200
|
||||||
projectile_type = /obj/item/projectile/beam/pulse
|
projectile_type = /obj/item/projectile/beam/pulse
|
||||||
cell_type = "/obj/item/weapon/cell/super"
|
cell_type = /obj/item/weapon/cell/super
|
||||||
var/mode = 2
|
var/mode = 2
|
||||||
fire_delay = 25
|
fire_delay = 25
|
||||||
|
|
||||||
attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/energy/pulse_rifle/attack_self(mob/living/user as mob)
|
||||||
switch(mode)
|
switch(mode)
|
||||||
if(2)
|
if(2)
|
||||||
mode = 0
|
mode = 0
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
fire_sound = 'sound/weapons/Taser.ogg'
|
fire_sound = 'sound/weapons/Taser.ogg'
|
||||||
user << "\red [src.name] is now set to stun."
|
user << "\red [src.name] is now set to stun."
|
||||||
projectile_type = /obj/item/projectile/beam/stun
|
projectile_type = /obj/item/projectile/beam/stun
|
||||||
if(0)
|
if(0)
|
||||||
mode = 1
|
mode = 1
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
fire_sound = 'sound/weapons/Laser.ogg'
|
fire_sound = 'sound/weapons/Laser.ogg'
|
||||||
user << "\red [src.name] is now set to kill."
|
user << "\red [src.name] is now set to kill."
|
||||||
projectile_type = /obj/item/projectile/beam
|
projectile_type = /obj/item/projectile/beam
|
||||||
if(1)
|
if(1)
|
||||||
mode = 2
|
mode = 2
|
||||||
charge_cost = 200
|
charge_cost = 200
|
||||||
fire_sound = 'sound/weapons/pulse.ogg'
|
fire_sound = 'sound/weapons/pulse.ogg'
|
||||||
user << "\red [src.name] is now set to DESTROY."
|
user << "\red [src.name] is now set to DESTROY."
|
||||||
projectile_type = /obj/item/projectile/beam/pulse
|
projectile_type = /obj/item/projectile/beam/pulse
|
||||||
return
|
|
||||||
|
|
||||||
isHandgun()
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/pulse_rifle/cyborg/load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
if(isrobot(src.loc))
|
|
||||||
var/mob/living/silicon/robot/R = src.loc
|
|
||||||
if(R && R.cell)
|
|
||||||
R.cell.use(charge_cost)
|
|
||||||
in_chamber = new/obj/item/projectile/beam(src)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/pulse_rifle/mounted
|
||||||
|
self_recharge = 1
|
||||||
|
use_external_power = 1
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
|
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
|
||||||
name = "pulse destroyer"
|
name = "pulse destroyer"
|
||||||
desc = "A heavy-duty, pulse-based energy weapon."
|
desc = "A heavy-duty, pulse-based energy weapon. Because of its complexity and cost, it is rarely seen in use except by specialists."
|
||||||
cell_type = "/obj/item/weapon/cell/infinite"
|
cell_type = "/obj/item/weapon/cell/infinite"
|
||||||
fire_delay = 10
|
fire_delay = 10
|
||||||
|
|
||||||
attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/energy/pulse_rifle/destroyer/attack_self(mob/living/user as mob)
|
||||||
user << "\red [src.name] has three settings, and they are all DESTROY."
|
user << "\red [src.name] has three settings, and they are all DESTROY."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//WHY?
|
||||||
/obj/item/weapon/gun/energy/pulse_rifle/M1911
|
/obj/item/weapon/gun/energy/pulse_rifle/M1911
|
||||||
name = "\improper M1911-P"
|
name = "\improper M1911-P"
|
||||||
desc = "It's not the size of the gun, it's the size of the hole it puts through people."
|
desc = "It's not the size of the gun, it's the size of the hole it puts through people."
|
||||||
icon_state = "m1911-p"
|
icon_state = "m1911-p"
|
||||||
cell_type = "/obj/item/weapon/cell/infinite"
|
cell_type = "/obj/item/weapon/cell/infinite"
|
||||||
fire_delay = 10
|
fire_delay = 10
|
||||||
|
|
||||||
isHandgun()
|
|
||||||
return 1
|
|
||||||
|
|||||||
@@ -8,14 +8,12 @@
|
|||||||
flags = CONDUCT
|
flags = CONDUCT
|
||||||
slot_flags = SLOT_BACK
|
slot_flags = SLOT_BACK
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
projectile_type = "/obj/item/projectile/ion"
|
projectile_type = /obj/item/projectile/ion
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
|
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
|
||||||
if(severity <= 2)
|
if(severity > 2)
|
||||||
power_supply.use(round(power_supply.maxcharge / severity))
|
return //so it doesn't EMP itself, I guess
|
||||||
update_icon()
|
..()
|
||||||
else
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/decloner
|
/obj/item/weapon/gun/energy/decloner
|
||||||
name = "biological demolecularisor"
|
name = "biological demolecularisor"
|
||||||
@@ -24,9 +22,9 @@
|
|||||||
fire_sound = 'sound/weapons/pulse3.ogg'
|
fire_sound = 'sound/weapons/pulse3.ogg'
|
||||||
origin_tech = "combat=5;materials=4;powerstorage=3"
|
origin_tech = "combat=5;materials=4;powerstorage=3"
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
projectile_type = "/obj/item/projectile/energy/declone"
|
projectile_type = /obj/item/projectile/energy/declone
|
||||||
|
|
||||||
obj/item/weapon/gun/energy/staff
|
/obj/item/weapon/gun/energy/staff
|
||||||
name = "staff of change"
|
name = "staff of change"
|
||||||
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
||||||
icon = 'icons/obj/gun.dmi'
|
icon = 'icons/obj/gun.dmi'
|
||||||
@@ -37,45 +35,22 @@ obj/item/weapon/gun/energy/staff
|
|||||||
slot_flags = SLOT_BACK
|
slot_flags = SLOT_BACK
|
||||||
w_class = 4.0
|
w_class = 4.0
|
||||||
charge_cost = 200
|
charge_cost = 200
|
||||||
projectile_type = "/obj/item/projectile/change"
|
projectile_type = /obj/item/projectile/change
|
||||||
origin_tech = null
|
origin_tech = null
|
||||||
clumsy_check = 0
|
self_recharge = 1
|
||||||
var/charge_tick = 0
|
charge_meter = 0
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/staff/handle_click_empty(mob/user = null)
|
||||||
New()
|
if (user)
|
||||||
..()
|
user.visible_message("*fizzle*", "\red <b>*fizzle*</b>")
|
||||||
processing_objects.Add(src)
|
else
|
||||||
|
src.visible_message("*fizzle*")
|
||||||
|
playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 1)
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < 4) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(200)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
click_empty(mob/user = null)
|
|
||||||
if (user)
|
|
||||||
user.visible_message("*fizzle*", "\red <b>*fizzle*</b>")
|
|
||||||
else
|
|
||||||
src.visible_message("*fizzle*")
|
|
||||||
playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 1)
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/staff/animate
|
/obj/item/weapon/gun/energy/staff/animate
|
||||||
name = "staff of animation"
|
name = "staff of animation"
|
||||||
desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
|
desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
|
||||||
projectile_type = "/obj/item/projectile/animate"
|
projectile_type = /obj/item/projectile/animate
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun
|
/obj/item/weapon/gun/energy/floragun
|
||||||
@@ -85,55 +60,35 @@ obj/item/weapon/gun/energy/staff
|
|||||||
item_state = "obj/item/gun.dmi"
|
item_state = "obj/item/gun.dmi"
|
||||||
fire_sound = 'sound/effects/stealthoff.ogg'
|
fire_sound = 'sound/effects/stealthoff.ogg'
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
projectile_type = "/obj/item/projectile/energy/floramut"
|
projectile_type = /obj/item/projectile/energy/floramut
|
||||||
origin_tech = "materials=2;biotech=3;powerstorage=3"
|
origin_tech = "materials=2;biotech=3;powerstorage=3"
|
||||||
modifystate = "floramut"
|
modifystate = "floramut"
|
||||||
var/charge_tick = 0
|
self_recharge = 1
|
||||||
var/mode = 0 //0 = mutate, 1 = yield boost
|
var/mode = 0 //0 = mutate, 1 = yield boost
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun/New()
|
|
||||||
..()
|
|
||||||
processing_objects.Add(src)
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun/Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun/process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < 4) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(100)
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun/attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/energy/floragun/attack_self(mob/living/user as mob)
|
||||||
switch(mode)
|
switch(mode)
|
||||||
if(0)
|
if(0)
|
||||||
mode = 1
|
mode = 1
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
user << "\red The [src.name] is now set to increase yield."
|
user << "\red The [src.name] is now set to increase yield."
|
||||||
projectile_type = "/obj/item/projectile/energy/florayield"
|
projectile_type = /obj/item/projectile/energy/florayield
|
||||||
modifystate = "florayield"
|
modifystate = "florayield"
|
||||||
if(1)
|
if(1)
|
||||||
mode = 0
|
mode = 0
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
user << "\red The [src.name] is now set to induce mutations."
|
user << "\red The [src.name] is now set to induce mutations."
|
||||||
projectile_type = "/obj/item/projectile/energy/floramut"
|
projectile_type = /obj/item/projectile/energy/floramut
|
||||||
modifystate = "floramut"
|
modifystate = "floramut"
|
||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, flag)
|
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, adjacent_flag)
|
||||||
|
//allow shooting into adjacent hydrotrays regardless of intent
|
||||||
if(flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
|
if(adjacent_flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
|
||||||
var/obj/machinery/portable_atmospherics/hydroponics/tray = target
|
user.visible_message("\red <b> \The [user] fires \the [src] into \the [target]!</b>")
|
||||||
if(load_into_chamber())
|
Fire(target,user)
|
||||||
user.visible_message("\red <b> \The [user] fires \the [src] into \the [tray]!</b>")
|
|
||||||
Fire(target,user)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/meteorgun
|
/obj/item/weapon/gun/energy/meteorgun
|
||||||
@@ -142,32 +97,12 @@ obj/item/weapon/gun/energy/staff
|
|||||||
icon_state = "riotgun"
|
icon_state = "riotgun"
|
||||||
item_state = "c20r"
|
item_state = "c20r"
|
||||||
w_class = 4
|
w_class = 4
|
||||||
projectile_type = "/obj/item/projectile/meteor"
|
projectile_type = /obj/item/projectile/meteor
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
cell_type = "/obj/item/weapon/cell/potato"
|
cell_type = "/obj/item/weapon/cell/potato"
|
||||||
clumsy_check = 0 //Admin spawn only, might as well let clowns use it.
|
self_recharge = 1
|
||||||
var/charge_tick = 0
|
recharge_time = 5 //Time it takes for shots to recharge (in ticks)
|
||||||
var/recharge_time = 5 //Time it takes for shots to recharge (in ticks)
|
charge_meter = 0
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
processing_objects.Add(src)
|
|
||||||
|
|
||||||
|
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < recharge_time) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(100)
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/meteorgun/pen
|
/obj/item/weapon/gun/energy/meteorgun/pen
|
||||||
name = "meteor pen"
|
name = "meteor pen"
|
||||||
@@ -182,7 +117,7 @@ obj/item/weapon/gun/energy/staff
|
|||||||
name = "mind flayer"
|
name = "mind flayer"
|
||||||
desc = "A prototype weapon recovered from the ruins of Research-Station Epsilon."
|
desc = "A prototype weapon recovered from the ruins of Research-Station Epsilon."
|
||||||
icon_state = "xray"
|
icon_state = "xray"
|
||||||
projectile_type = "/obj/item/projectile/beam/mindflayer"
|
projectile_type = /obj/item/projectile/beam/mindflayer
|
||||||
fire_sound = 'sound/weapons/Laser.ogg'
|
fire_sound = 'sound/weapons/Laser.ogg'
|
||||||
|
|
||||||
obj/item/weapon/gun/energy/staff/focus
|
obj/item/weapon/gun/energy/staff/focus
|
||||||
@@ -191,7 +126,7 @@ obj/item/weapon/gun/energy/staff/focus
|
|||||||
icon = 'icons/obj/wizard.dmi'
|
icon = 'icons/obj/wizard.dmi'
|
||||||
icon_state = "focus"
|
icon_state = "focus"
|
||||||
item_state = "focus"
|
item_state = "focus"
|
||||||
projectile_type = "/obj/item/projectile/forcebolt"
|
projectile_type = /obj/item/projectile/forcebolt
|
||||||
/*
|
/*
|
||||||
attack_self(mob/living/user as mob)
|
attack_self(mob/living/user as mob)
|
||||||
if(projectile_type == "/obj/item/projectile/forcebolt")
|
if(projectile_type == "/obj/item/projectile/forcebolt")
|
||||||
@@ -211,7 +146,7 @@ obj/item/weapon/gun/energy/staff/focus
|
|||||||
fire_sound = 'sound/effects/stealthoff.ogg'
|
fire_sound = 'sound/effects/stealthoff.ogg'
|
||||||
w_class = 3.0
|
w_class = 3.0
|
||||||
origin_tech = "combat=5;phorontech=4"
|
origin_tech = "combat=5;phorontech=4"
|
||||||
projectile_type = "/obj/item/projectile/energy/phoron"
|
projectile_type = /obj/item/projectile/energy/phoron
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/sniperrifle
|
/obj/item/weapon/gun/energy/sniperrifle
|
||||||
name = "\improper L.W.A.P. sniper rifle"
|
name = "\improper L.W.A.P. sniper rifle"
|
||||||
@@ -220,7 +155,7 @@ obj/item/weapon/gun/energy/staff/focus
|
|||||||
icon_state = "sniper"
|
icon_state = "sniper"
|
||||||
fire_sound = 'sound/weapons/marauder.ogg'
|
fire_sound = 'sound/weapons/marauder.ogg'
|
||||||
origin_tech = "combat=6;materials=5;powerstorage=4"
|
origin_tech = "combat=6;materials=5;powerstorage=4"
|
||||||
projectile_type = "/obj/item/projectile/beam/sniper"
|
projectile_type = /obj/item/projectile/beam/sniper
|
||||||
slot_flags = SLOT_BACK
|
slot_flags = SLOT_BACK
|
||||||
charge_cost = 250
|
charge_cost = 250
|
||||||
fire_delay = 35
|
fire_delay = 35
|
||||||
|
|||||||
@@ -6,38 +6,15 @@
|
|||||||
fire_sound = 'sound/weapons/Taser.ogg'
|
fire_sound = 'sound/weapons/Taser.ogg'
|
||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
projectile_type = /obj/item/projectile/beam/stun
|
projectile_type = /obj/item/projectile/beam/stun
|
||||||
cell_type = "/obj/item/weapon/cell/crap"
|
cell_type = /obj/item/weapon/cell/crap
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/taser/cyborg
|
/obj/item/weapon/gun/energy/taser/mounted
|
||||||
cell_type = "/obj/item/weapon/cell/secborg"
|
self_recharge = 1
|
||||||
var/charge_tick = 0
|
use_external_power = 1
|
||||||
var/recharge_time = 10 //Time it takes for shots to recharge (in ticks)
|
|
||||||
|
|
||||||
New()
|
/obj/item/weapon/gun/energy/taser/mounted/cyborg
|
||||||
..()
|
cell_type = /obj/item/weapon/cell/secborg
|
||||||
processing_objects.Add(src)
|
recharge_time = 10 //Time it takes for shots to recharge (in ticks)
|
||||||
|
|
||||||
|
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
process() //Every [recharge_time] ticks, recharge a shot for the cyborg
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < recharge_time) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
|
|
||||||
if(!power_supply) return 0 //sanity
|
|
||||||
if(power_supply.charge >= power_supply.maxcharge) return 0 // check if we actually need to recharge
|
|
||||||
|
|
||||||
if(isrobot(src.loc))
|
|
||||||
var/mob/living/silicon/robot/R = src.loc
|
|
||||||
if(R && R.cell)
|
|
||||||
R.cell.use(charge_cost) //Take power from the borg...
|
|
||||||
power_supply.give(charge_cost) //... to recharge the shot
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/stunrevolver
|
/obj/item/weapon/gun/energy/stunrevolver
|
||||||
@@ -48,8 +25,7 @@
|
|||||||
origin_tech = "combat=3;materials=3;powerstorage=2"
|
origin_tech = "combat=3;materials=3;powerstorage=2"
|
||||||
charge_cost = 125
|
charge_cost = 125
|
||||||
projectile_type = /obj/item/projectile/beam/stun
|
projectile_type = /obj/item/projectile/beam/stun
|
||||||
cell_type = "/obj/item/weapon/cell"
|
cell_type = /obj/item/weapon/cell
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/crossbow
|
/obj/item/weapon/gun/energy/crossbow
|
||||||
@@ -63,31 +39,9 @@
|
|||||||
silenced = 1
|
silenced = 1
|
||||||
fire_sound = 'sound/weapons/Genhit.ogg'
|
fire_sound = 'sound/weapons/Genhit.ogg'
|
||||||
projectile_type = /obj/item/projectile/energy/bolt
|
projectile_type = /obj/item/projectile/energy/bolt
|
||||||
cell_type = "/obj/item/weapon/cell/crap"
|
cell_type = /obj/item/weapon/cell/crap
|
||||||
var/charge_tick = 0
|
self_recharge = 1
|
||||||
|
charge_meter = 0
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
processing_objects.Add(src)
|
|
||||||
|
|
||||||
|
|
||||||
Del()
|
|
||||||
processing_objects.Remove(src)
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
process()
|
|
||||||
charge_tick++
|
|
||||||
if(charge_tick < 4) return 0
|
|
||||||
charge_tick = 0
|
|
||||||
if(!power_supply) return 0
|
|
||||||
power_supply.give(100)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/crossbow/ninja
|
/obj/item/weapon/gun/energy/crossbow/ninja
|
||||||
name = "energy dart thrower"
|
name = "energy dart thrower"
|
||||||
|
|||||||
@@ -8,73 +8,71 @@
|
|||||||
charge_cost = 100
|
charge_cost = 100
|
||||||
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
|
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
|
||||||
|
|
||||||
projectile_type = "/obj/item/projectile/temp"
|
projectile_type = /obj/item/projectile/temp
|
||||||
cell_type = "/obj/item/weapon/cell/crap"
|
cell_type = /obj/item/weapon/cell/crap
|
||||||
|
|
||||||
|
|
||||||
New()
|
/obj/item/weapon/gun/energy/temperature/New()
|
||||||
..()
|
..()
|
||||||
processing_objects.Add(src)
|
processing_objects.Add(src)
|
||||||
|
|
||||||
|
|
||||||
Del()
|
/obj/item/weapon/gun/energy/temperature/Del()
|
||||||
processing_objects.Remove(src)
|
processing_objects.Remove(src)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|
||||||
attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/energy/temperature/attack_self(mob/living/user as mob)
|
||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
var/temp_text = ""
|
var/temp_text = ""
|
||||||
if(temperature > (T0C - 50))
|
if(temperature > (T0C - 50))
|
||||||
temp_text = "<FONT color=black>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
temp_text = "<FONT color=black>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||||
|
else
|
||||||
|
temp_text = "<FONT color=blue>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||||
|
|
||||||
|
var/dat = {"<B>Freeze Gun Configuration: </B><BR>
|
||||||
|
Current output temperature: [temp_text]<BR>
|
||||||
|
Target output temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||||
|
"}
|
||||||
|
|
||||||
|
user << browse(dat, "window=freezegun;size=450x300;can_resize=1;can_close=1;can_minimize=1")
|
||||||
|
onclose(user, "window=freezegun", src)
|
||||||
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/temperature/Topic(href, href_list)
|
||||||
|
if (..())
|
||||||
|
return
|
||||||
|
usr.set_machine(src)
|
||||||
|
src.add_fingerprint(usr)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(href_list["temp"])
|
||||||
|
var/amount = text2num(href_list["temp"])
|
||||||
|
if(amount > 0)
|
||||||
|
src.current_temperature = min(500, src.current_temperature+amount)
|
||||||
else
|
else
|
||||||
temp_text = "<FONT color=blue>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
src.current_temperature = max(0, src.current_temperature+amount)
|
||||||
|
if (istype(src.loc, /mob))
|
||||||
var/dat = {"<B>Freeze Gun Configuration: </B><BR>
|
attack_self(src.loc)
|
||||||
Current output temperature: [temp_text]<BR>
|
src.add_fingerprint(usr)
|
||||||
Target output temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
return
|
||||||
"}
|
|
||||||
|
|
||||||
|
|
||||||
user << browse(dat, "window=freezegun;size=450x300;can_resize=1;can_close=1;can_minimize=1")
|
/obj/item/weapon/gun/energy/temperature/process()
|
||||||
onclose(user, "window=freezegun", src)
|
switch(temperature)
|
||||||
|
if(0 to 100) charge_cost = 1000
|
||||||
|
if(100 to 250) charge_cost = 500
|
||||||
|
if(251 to 300) charge_cost = 100
|
||||||
|
if(301 to 400) charge_cost = 500
|
||||||
|
if(401 to 500) charge_cost = 1000
|
||||||
|
|
||||||
|
if(current_temperature != temperature)
|
||||||
Topic(href, href_list)
|
var/difference = abs(current_temperature - temperature)
|
||||||
if (..())
|
if(difference >= 10)
|
||||||
return
|
if(current_temperature < temperature)
|
||||||
usr.set_machine(src)
|
temperature -= 10
|
||||||
src.add_fingerprint(usr)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(href_list["temp"])
|
|
||||||
var/amount = text2num(href_list["temp"])
|
|
||||||
if(amount > 0)
|
|
||||||
src.current_temperature = min(500, src.current_temperature+amount)
|
|
||||||
else
|
else
|
||||||
src.current_temperature = max(0, src.current_temperature+amount)
|
temperature += 10
|
||||||
if (istype(src.loc, /mob))
|
else
|
||||||
attack_self(src.loc)
|
temperature = current_temperature
|
||||||
src.add_fingerprint(usr)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
process()
|
|
||||||
switch(temperature)
|
|
||||||
if(0 to 100) charge_cost = 1000
|
|
||||||
if(100 to 250) charge_cost = 500
|
|
||||||
if(251 to 300) charge_cost = 100
|
|
||||||
if(301 to 400) charge_cost = 500
|
|
||||||
if(401 to 500) charge_cost = 1000
|
|
||||||
|
|
||||||
if(current_temperature != temperature)
|
|
||||||
var/difference = abs(current_temperature - temperature)
|
|
||||||
if(difference >= 10)
|
|
||||||
if(current_temperature < temperature)
|
|
||||||
temperature -= 10
|
|
||||||
else
|
|
||||||
temperature += 10
|
|
||||||
else
|
|
||||||
temperature = current_temperature
|
|
||||||
return
|
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
name = "revolver"
|
name = "revolver"
|
||||||
desc = "A classic revolver. Uses .357 ammo"
|
desc = "A classic revolver. Uses .357 ammo"
|
||||||
icon_state = "revolver"
|
icon_state = "revolver"
|
||||||
caliber = "357"
|
|
||||||
origin_tech = "combat=2;materials=2"
|
origin_tech = "combat=2;materials=2"
|
||||||
w_class = 3.0
|
w_class = 3.0
|
||||||
matter = list("metal" = 1000)
|
matter = list("metal" = 1000)
|
||||||
recoil = 1
|
recoil = 1
|
||||||
|
var/caliber = "357"
|
||||||
var/ammo_type = "/obj/item/ammo_casing/a357"
|
var/ammo_type = "/obj/item/ammo_casing/a357"
|
||||||
var/list/loaded = list()
|
var/list/loaded = list()
|
||||||
var/max_shells = 7
|
var/max_shells = 7
|
||||||
@@ -27,24 +27,28 @@
|
|||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/projectile/can_fire()
|
||||||
/obj/item/weapon/gun/projectile/load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1 //{R}
|
|
||||||
|
|
||||||
if(!loaded.len)
|
if(!loaded.len)
|
||||||
return 0
|
return 0
|
||||||
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
return 1
|
||||||
loaded -= AC //Remove casing from loaded list.
|
|
||||||
if(isnull(AC) || !istype(AC))
|
|
||||||
return 0
|
|
||||||
AC.loc = get_turf(src) //Eject casing onto ground.
|
|
||||||
if(AC.BB)
|
|
||||||
in_chamber = AC.BB //Load projectile into chamber.
|
|
||||||
AC.BB.loc = src //Set projectile loc to gun.
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/projectile/get_next_projectile()
|
||||||
|
if(!loaded.len)
|
||||||
|
return null
|
||||||
|
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
||||||
|
if(isnull(AC) || !istype(AC))
|
||||||
|
return null
|
||||||
|
if(AC.BB)
|
||||||
|
AC.BB.loc = src //Set projectile loc to gun.
|
||||||
|
return AC.BB //Load projectile into chamber.
|
||||||
|
return null
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/projectile/handle_post_fire()
|
||||||
|
..()
|
||||||
|
if(loaded.len)
|
||||||
|
var/obj/item/ammo_casing/AC = loaded[1]
|
||||||
|
loaded -= AC
|
||||||
|
AC.loc = get_turf(src) //Eject casing onto ground.
|
||||||
|
|
||||||
/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob)
|
/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob)
|
||||||
|
|
||||||
@@ -81,7 +85,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gun/projectile/attack_self(mob/user as mob)
|
/obj/item/weapon/gun/projectile/attack_self(mob/user as mob)
|
||||||
if (target)
|
if (aim_targets)
|
||||||
return ..()
|
return ..()
|
||||||
if (loaded.len)
|
if (loaded.len)
|
||||||
if (load_method == SPEEDLOADER)
|
if (load_method == SPEEDLOADER)
|
||||||
|
|||||||
@@ -7,13 +7,10 @@
|
|||||||
caliber = "9mm"
|
caliber = "9mm"
|
||||||
origin_tech = "combat=4;materials=2"
|
origin_tech = "combat=4;materials=2"
|
||||||
ammo_type = "/obj/item/ammo_casing/c9mm"
|
ammo_type = "/obj/item/ammo_casing/c9mm"
|
||||||
automatic = 1
|
multi_aim = 1
|
||||||
|
|
||||||
fire_delay = 0
|
fire_delay = 0
|
||||||
|
|
||||||
isHandgun()
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/projectile/automatic/test
|
/obj/item/weapon/gun/projectile/automatic/test
|
||||||
name = "test gun"
|
name = "test gun"
|
||||||
ammo_type = "/obj/item/ammo_casing/a145"
|
ammo_type = "/obj/item/ammo_casing/a145"
|
||||||
@@ -28,9 +25,6 @@
|
|||||||
origin_tech = "combat=5;materials=2;syndicate=8"
|
origin_tech = "combat=5;materials=2;syndicate=8"
|
||||||
ammo_type = "/obj/item/ammo_casing/c45"
|
ammo_type = "/obj/item/ammo_casing/c45"
|
||||||
|
|
||||||
isHandgun()
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/projectile/automatic/c20r
|
/obj/item/weapon/gun/projectile/automatic/c20r
|
||||||
name = "\improper C-20r SMG"
|
name = "\improper C-20r SMG"
|
||||||
|
|||||||
@@ -51,11 +51,10 @@
|
|||||||
icon_state = "crossbow"
|
icon_state = "crossbow"
|
||||||
item_state = "crossbow-solid"
|
item_state = "crossbow-solid"
|
||||||
fire_sound = 'sound/weapons/punchmiss.ogg' // TODO: Decent THWOK noise.
|
fire_sound = 'sound/weapons/punchmiss.ogg' // TODO: Decent THWOK noise.
|
||||||
ejectshell = 0 // No spent shells.
|
|
||||||
mouthshoot = 1 // No suiciding with this weapon, causes runtimes.
|
|
||||||
fire_sound_text = "a solid thunk"
|
fire_sound_text = "a solid thunk"
|
||||||
fire_delay = 25
|
fire_delay = 25
|
||||||
|
|
||||||
|
var/obj/item/bolt
|
||||||
var/tension = 0 // Current draw on the bow.
|
var/tension = 0 // Current draw on the bow.
|
||||||
var/max_tension = 5 // Highest possible tension.
|
var/max_tension = 5 // Highest possible tension.
|
||||||
var/release_speed = 5 // Speed per unit of tension.
|
var/release_speed = 5 // Speed per unit of tension.
|
||||||
@@ -75,19 +74,25 @@
|
|||||||
/obj/item/weapon/gun/launcher/crossbow/update_release_force()
|
/obj/item/weapon/gun/launcher/crossbow/update_release_force()
|
||||||
release_force = tension*release_speed
|
release_force = tension*release_speed
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/crossbow/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
|
/obj/item/weapon/gun/launcher/crossbow/can_fire()
|
||||||
|
return (tension && bolt)
|
||||||
|
|
||||||
if(!..()) return //Only do this on a successful shot.
|
/obj/item/weapon/gun/launcher/crossbow/get_next_projectile()
|
||||||
|
return bolt
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/launcher/crossbow/handle_post_fire(mob/user, atom/target)
|
||||||
|
bolt = null
|
||||||
icon_state = "crossbow"
|
icon_state = "crossbow"
|
||||||
tension = 0
|
tension = 0
|
||||||
|
..()
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/crossbow/attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/launcher/crossbow/attack_self(mob/living/user as mob)
|
||||||
if(tension)
|
if(tension)
|
||||||
if(in_chamber && in_chamber.loc == src) //Just in case they click it the tick after firing.
|
if(bolt)
|
||||||
user.visible_message("[user] relaxes the tension on [src]'s string and removes [in_chamber].","You relax the tension on [src]'s string and remove [in_chamber].")
|
user.visible_message("[user] relaxes the tension on [src]'s string and removes [bolt].","You relax the tension on [src]'s string and remove [bolt].")
|
||||||
in_chamber.loc = get_turf(src)
|
bolt.loc = get_turf(src)
|
||||||
var/obj/item/weapon/arrow/A = in_chamber
|
var/obj/item/weapon/arrow/A = bolt
|
||||||
in_chamber = null
|
bolt = null
|
||||||
A.removed(user)
|
A.removed(user)
|
||||||
else
|
else
|
||||||
user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.")
|
user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.")
|
||||||
@@ -98,7 +103,7 @@
|
|||||||
|
|
||||||
/obj/item/weapon/gun/launcher/crossbow/proc/draw(var/mob/user as mob)
|
/obj/item/weapon/gun/launcher/crossbow/proc/draw(var/mob/user as mob)
|
||||||
|
|
||||||
if(!in_chamber)
|
if(!bolt)
|
||||||
user << "You don't have anything nocked to [src]."
|
user << "You don't have anything nocked to [src]."
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -112,7 +117,7 @@
|
|||||||
|
|
||||||
/obj/item/weapon/gun/launcher/crossbow/proc/increase_tension(var/mob/user as mob)
|
/obj/item/weapon/gun/launcher/crossbow/proc/increase_tension(var/mob/user as mob)
|
||||||
|
|
||||||
if(!in_chamber || !tension || current_user != user) //Arrow has been fired, bow has been relaxed or user has changed.
|
if(!bolt || !tension || current_user != user) //Arrow has been fired, bow has been relaxed or user has changed.
|
||||||
return
|
return
|
||||||
|
|
||||||
tension++
|
tension++
|
||||||
@@ -126,22 +131,22 @@
|
|||||||
spawn(25) increase_tension(user)
|
spawn(25) increase_tension(user)
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob)
|
/obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob)
|
||||||
if(!in_chamber)
|
if(!bolt)
|
||||||
if (istype(W,/obj/item/weapon/arrow))
|
if (istype(W,/obj/item/weapon/arrow))
|
||||||
user.drop_item()
|
user.drop_item()
|
||||||
in_chamber = W
|
bolt = W
|
||||||
in_chamber.loc = src
|
bolt.loc = src
|
||||||
user.visible_message("[user] slides [in_chamber] into [src].","You slide [in_chamber] into [src].")
|
user.visible_message("[user] slides [bolt] into [src].","You slide [bolt] into [src].")
|
||||||
icon_state = "crossbow-nocked"
|
icon_state = "crossbow-nocked"
|
||||||
return
|
return
|
||||||
else if(istype(W,/obj/item/stack/rods))
|
else if(istype(W,/obj/item/stack/rods))
|
||||||
var/obj/item/stack/rods/R = W
|
var/obj/item/stack/rods/R = W
|
||||||
if (R.use(1))
|
if (R.use(1))
|
||||||
in_chamber = new /obj/item/weapon/arrow/rod(src)
|
bolt = new /obj/item/weapon/arrow/rod(src)
|
||||||
in_chamber.fingerprintslast = src.fingerprintslast
|
bolt.fingerprintslast = src.fingerprintslast
|
||||||
in_chamber.loc = src
|
bolt.loc = src
|
||||||
icon_state = "crossbow-nocked"
|
icon_state = "crossbow-nocked"
|
||||||
user.visible_message("[user] jams [in_chamber] into [src].","You jam [in_chamber] into [src].")
|
user.visible_message("[user] jams [bolt] into [src].","You jam [bolt] into [src].")
|
||||||
superheat_rod(user)
|
superheat_rod(user)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -168,14 +173,14 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/crossbow/proc/superheat_rod(var/mob/user)
|
/obj/item/weapon/gun/launcher/crossbow/proc/superheat_rod(var/mob/user)
|
||||||
if(!user || !cell || !in_chamber) return
|
if(!user || !cell || !bolt) return
|
||||||
if(cell.charge < 500) return
|
if(cell.charge < 500) return
|
||||||
if(in_chamber.throwforce >= 15) return
|
if(bolt.throwforce >= 15) return
|
||||||
if(!istype(in_chamber,/obj/item/weapon/arrow/rod)) return
|
if(!istype(bolt,/obj/item/weapon/arrow/rod)) return
|
||||||
|
|
||||||
user << "<span class='notice'>[in_chamber] plinks and crackles as it begins to glow red-hot.</span>"
|
user << "<span class='notice'>[bolt] plinks and crackles as it begins to glow red-hot.</span>"
|
||||||
in_chamber.throwforce = 15
|
bolt.throwforce = 15
|
||||||
in_chamber.icon_state = "metal-rod-superheated"
|
bolt.icon_state = "metal-rod-superheated"
|
||||||
cell.use(500)
|
cell.use(500)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,82 +7,29 @@
|
|||||||
slot_flags = SLOT_BACK
|
slot_flags = SLOT_BACK
|
||||||
|
|
||||||
var/release_force = 0
|
var/release_force = 0
|
||||||
var/fire_sound_text = "a launcher firing"
|
var/throw_distance = 10
|
||||||
|
fire_sound_text = "a launcher firing"
|
||||||
//Check if we're drawing and if the bow is loaded.
|
|
||||||
/obj/item/weapon/gun/launcher/load_into_chamber()
|
|
||||||
return (!isnull(in_chamber))
|
|
||||||
|
|
||||||
//This should not fit in a combat belt or holster.
|
|
||||||
/obj/item/weapon/gun/launcher/isHandgun()
|
|
||||||
return 0
|
|
||||||
|
|
||||||
//Launchers are mechanical, no other impact.
|
|
||||||
/obj/item/weapon/gun/launcher/emp_act(severity)
|
|
||||||
return
|
|
||||||
|
|
||||||
//This normally uses a proc on projectiles and our ammo is not strictly speaking a projectile.
|
//This normally uses a proc on projectiles and our ammo is not strictly speaking a projectile.
|
||||||
/obj/item/weapon/gun/launcher/can_hit(var/mob/living/target as mob, var/mob/living/user as mob)
|
/obj/item/weapon/gun/launcher/can_hit(var/mob/living/target as mob, var/mob/living/user as mob)
|
||||||
return
|
return 1
|
||||||
|
|
||||||
//Override this to avoid a runtime with suicide handling.
|
//Override this to avoid a runtime with suicide handling.
|
||||||
/obj/item/weapon/gun/launcher/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
|
/obj/item/weapon/gun/launcher/handle_suicide(mob/living/user)
|
||||||
if (M == user && user.zone_sel.selecting == "mouth")
|
user << "\red Shooting yourself with \a [src] is pretty tricky. You can't seem to manage it."
|
||||||
user << "\red Shooting yourself with \a [src] is pretty tricky. You can't seem to manage it."
|
return
|
||||||
return
|
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/proc/update_release_force()
|
/obj/item/weapon/gun/launcher/proc/update_release_force(obj/item/projectile)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
|
/obj/item/weapon/gun/launcher/process_projectile(obj/projectile, mob/user, atom/target, var/target_zone, var/params=null, var/pointblank=0, var/reflex=0)
|
||||||
|
if(!istype(projectile, /obj/item)) return 0
|
||||||
if (!user.IsAdvancedToolUser())
|
|
||||||
return 0
|
var/obj/item/I = projectile
|
||||||
|
|
||||||
add_fingerprint(user)
|
update_release_force(I)
|
||||||
|
I.loc = get_turf(user)
|
||||||
//Make sure target turfs both exist.
|
I.throw_at(target, throw_distance, release_force, user)
|
||||||
var/turf/curloc = get_turf(user)
|
|
||||||
var/turf/targloc = get_turf(target)
|
|
||||||
if (!istype(targloc) || !istype(curloc))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if(!special_check(user))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if (!ready_to_fire())
|
|
||||||
if (world.time % 3) //to prevent spam
|
|
||||||
user << "<span class='warning'>[src] is not ready to fire again!"
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if(!load_into_chamber()) //CHECK
|
|
||||||
return click_empty(user)
|
|
||||||
|
|
||||||
if(!in_chamber)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
update_release_force()
|
|
||||||
|
|
||||||
playsound(user, fire_sound, 50, 1)
|
|
||||||
user.visible_message("<span class='warning'>[user] fires [src][reflex ? " by reflex":""]!</span>", \
|
|
||||||
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>", \
|
|
||||||
"You hear [fire_sound_text]!")
|
|
||||||
|
|
||||||
in_chamber.loc = get_turf(user)
|
|
||||||
in_chamber.throw_at(target,10,release_force)
|
|
||||||
|
|
||||||
sleep(1)
|
|
||||||
|
|
||||||
in_chamber = null
|
|
||||||
|
|
||||||
update_icon()
|
|
||||||
|
|
||||||
if(user.hand)
|
|
||||||
user.update_inv_l_hand()
|
|
||||||
else
|
|
||||||
user.update_inv_r_hand()
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/attack_self(mob/living/user as mob)
|
/obj/item/weapon/gun/launcher/attack_self(mob/living/user as mob)
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
item_state = "pneumatic-tank"
|
item_state = "pneumatic-tank"
|
||||||
user.update_icons()
|
user.update_icons()
|
||||||
else if(W.w_class <= max_w_class)
|
else if(W.w_class <= max_w_class)
|
||||||
|
|
||||||
var/total_stored = 0
|
var/total_stored = 0
|
||||||
for(var/obj/item/O in src.contents)
|
for(var/obj/item/O in src.contents)
|
||||||
total_stored += O.w_class
|
total_stored += O.w_class
|
||||||
@@ -79,9 +78,6 @@
|
|||||||
/obj/item/weapon/gun/launcher/pneumatic/attack_self(mob/user as mob)
|
/obj/item/weapon/gun/launcher/pneumatic/attack_self(mob/user as mob)
|
||||||
if(contents.len > 0)
|
if(contents.len > 0)
|
||||||
var/obj/item/removing = contents[contents.len]
|
var/obj/item/removing = contents[contents.len]
|
||||||
if(removing == in_chamber)
|
|
||||||
in_chamber = null
|
|
||||||
|
|
||||||
removing.loc = get_turf(src)
|
removing.loc = get_turf(src)
|
||||||
user.put_in_hands(removing)
|
user.put_in_hands(removing)
|
||||||
user << "You remove [removing] from the hopper."
|
user << "You remove [removing] from the hopper."
|
||||||
@@ -89,12 +85,16 @@
|
|||||||
user << "There is nothing to remove in \the [src]."
|
user << "There is nothing to remove in \the [src]."
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/pneumatic/load_into_chamber()
|
/obj/item/weapon/gun/launcher/pneumatic/get_next_projectile()
|
||||||
|
if(!contents.len)
|
||||||
|
return null
|
||||||
|
return contents[1]
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/launcher/pneumatic/can_fire()
|
||||||
if(!contents.len)
|
if(!contents.len)
|
||||||
return 0
|
return 0
|
||||||
|
var/fire_pressure = (tank.air_contents.return_pressure()/100)*pressure_setting
|
||||||
in_chamber = contents[1]
|
return (fire_pressure >= minimum_tank_pressure)
|
||||||
return !isnull(in_chamber)
|
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/pneumatic/examine(mob/user)
|
/obj/item/weapon/gun/launcher/pneumatic/examine(mob/user)
|
||||||
if(!..(user, 2))
|
if(!..(user, 2))
|
||||||
@@ -106,7 +106,6 @@
|
|||||||
user << "Nothing is attached to the tank valve!"
|
user << "Nothing is attached to the tank valve!"
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/pneumatic/special_check(user)
|
/obj/item/weapon/gun/launcher/pneumatic/special_check(user)
|
||||||
|
|
||||||
if (!tank)
|
if (!tank)
|
||||||
user << "There is no gas tank in [src]!"
|
user << "There is no gas tank in [src]!"
|
||||||
return 0
|
return 0
|
||||||
@@ -116,20 +115,23 @@
|
|||||||
user << "There isn't enough gas in the tank to fire [src]."
|
user << "There isn't enough gas in the tank to fire [src]."
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
return 1
|
return ..()
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/pneumatic/update_release_force()
|
/obj/item/weapon/gun/launcher/pneumatic/update_release_force(obj/item/projectile)
|
||||||
if(!in_chamber) return
|
if(tank)
|
||||||
release_force = ((fire_pressure*tank.volume)/in_chamber.w_class)/force_divisor //projectile speed.
|
release_force = ((fire_pressure*tank.volume)/projectile.w_class)/force_divisor //projectile speed.
|
||||||
if(release_force >80) release_force = 80 //damage cap.
|
if(release_force > 80) release_force = 80 //damage cap.
|
||||||
|
else
|
||||||
|
release_force = 0
|
||||||
|
|
||||||
/obj/item/weapon/gun/launcher/pneumatic/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
|
/obj/item/weapon/gun/launcher/pneumatic/handle_post_fire()
|
||||||
|
if(tank)
|
||||||
if(!tank || !..()) return //Only do this on a successful shot.
|
var/lost_gas_amount = tank.air_contents.total_moles*(pressure_setting/100)
|
||||||
|
var/datum/gas_mixture/removed = tank.air_contents.remove(lost_gas_amount)
|
||||||
var/lost_gas_amount = tank.air_contents.total_moles*(pressure_setting/100)
|
|
||||||
var/datum/gas_mixture/removed = tank.air_contents.remove(lost_gas_amount)
|
var/turf/T = get_turf(src.loc)
|
||||||
user.loc.assume_air(removed)
|
if(T) T.assume_air(removed)
|
||||||
|
..()
|
||||||
|
|
||||||
//Constructable pneumatic cannon.
|
//Constructable pneumatic cannon.
|
||||||
|
|
||||||
|
|||||||
@@ -8,15 +8,13 @@
|
|||||||
ammo_type = "/obj/item/ammo_casing/c38"
|
ammo_type = "/obj/item/ammo_casing/c38"
|
||||||
|
|
||||||
special_check(var/mob/living/carbon/human/M)
|
special_check(var/mob/living/carbon/human/M)
|
||||||
if(caliber == initial(caliber))
|
if(caliber == initial(caliber) && prob(70 - (loaded.len * 10))) //minimum probability of 10, maximum of 60
|
||||||
return 1
|
|
||||||
if(prob(70 - (loaded.len * 10))) //minimum probability of 10, maximum of 60
|
|
||||||
M << "<span class='danger'>[src] blows up in your face.</span>"
|
M << "<span class='danger'>[src] blows up in your face.</span>"
|
||||||
M.take_organ_damage(0,20)
|
M.take_organ_damage(0,20)
|
||||||
M.drop_item()
|
M.drop_item()
|
||||||
del(src)
|
del(src)
|
||||||
return 0
|
return 0
|
||||||
return 1
|
return ..()
|
||||||
|
|
||||||
verb/rename_gun()
|
verb/rename_gun()
|
||||||
set name = "Name Gun"
|
set name = "Name Gun"
|
||||||
@@ -101,6 +99,7 @@
|
|||||||
icon_state = "mateba"
|
icon_state = "mateba"
|
||||||
origin_tech = "combat=2;materials=2"
|
origin_tech = "combat=2;materials=2"
|
||||||
|
|
||||||
|
/*
|
||||||
// A gun to play Russian Roulette!
|
// A gun to play Russian Roulette!
|
||||||
// You can spin the chamber to randomize the position of the bullet.
|
// You can spin the chamber to randomize the position of the bullet.
|
||||||
|
|
||||||
@@ -184,3 +183,4 @@
|
|||||||
user.apply_damage(300, BRUTE, affecting, sharp=1) // You are dead, dead, dead.
|
user.apply_damage(300, BRUTE, affecting, sharp=1) // You are dead, dead, dead.
|
||||||
return
|
return
|
||||||
..()
|
..()
|
||||||
|
*/
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/obj/item/weapon/gun/rocketlauncher
|
/obj/item/weapon/gun/launcher/rocket
|
||||||
name = "rocket launcher"
|
name = "rocket launcher"
|
||||||
desc = "MAGGOT."
|
desc = "MAGGOT."
|
||||||
icon_state = "rocket"
|
icon_state = "rocket"
|
||||||
@@ -10,18 +10,19 @@
|
|||||||
flags = CONDUCT | USEDELAY
|
flags = CONDUCT | USEDELAY
|
||||||
slot_flags = 0
|
slot_flags = 0
|
||||||
origin_tech = "combat=8;materials=5"
|
origin_tech = "combat=8;materials=5"
|
||||||
var/projectile = /obj/item/missile
|
fire_sound = 'sound/effects/bang.ogg'
|
||||||
var/missile_speed = 2
|
|
||||||
var/missile_range = 30
|
release_force = 15
|
||||||
|
throw_distance = 30
|
||||||
var/max_rockets = 1
|
var/max_rockets = 1
|
||||||
var/list/rockets = new/list()
|
var/list/rockets = new/list()
|
||||||
|
|
||||||
/obj/item/weapon/gun/rocketlauncher/examine(mob/user)
|
/obj/item/weapon/gun/launcher/rocket/examine(mob/user)
|
||||||
if(!..(user, 2))
|
if(!..(user, 2))
|
||||||
return
|
return
|
||||||
user << "\blue [rockets.len] / [max_rockets] rockets."
|
user << "\blue [rockets.len] / [max_rockets] rockets."
|
||||||
|
|
||||||
/obj/item/weapon/gun/rocketlauncher/attackby(obj/item/I as obj, mob/user as mob)
|
/obj/item/weapon/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
|
||||||
if(istype(I, /obj/item/ammo_casing/rocket))
|
if(istype(I, /obj/item/ammo_casing/rocket))
|
||||||
if(rockets.len < max_rockets)
|
if(rockets.len < max_rockets)
|
||||||
user.drop_item()
|
user.drop_item()
|
||||||
@@ -32,20 +33,19 @@
|
|||||||
else
|
else
|
||||||
usr << "\red [src] cannot hold more rockets."
|
usr << "\red [src] cannot hold more rockets."
|
||||||
|
|
||||||
/obj/item/weapon/gun/rocketlauncher/can_fire()
|
/obj/item/weapon/gun/launcher/rocket/can_fire()
|
||||||
return rockets.len
|
return rockets.len
|
||||||
|
|
||||||
/obj/item/weapon/gun/rocketlauncher/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
|
/obj/item/weapon/gun/launcher/rocket/get_next_projectile()
|
||||||
if(rockets.len)
|
if(rockets.len)
|
||||||
var/obj/item/ammo_casing/rocket/I = rockets[1]
|
var/obj/item/ammo_casing/rocket/I = rockets[1]
|
||||||
var/obj/item/missile/M = new projectile(user.loc)
|
var/obj/item/missile/M = new (src)
|
||||||
playsound(user.loc, 'sound/effects/bang.ogg', 50, 1)
|
|
||||||
M.primed = 1
|
M.primed = 1
|
||||||
M.throw_at(target, missile_range, missile_speed,user)
|
|
||||||
message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([src.name]).")
|
|
||||||
log_game("[key_name_admin(user)] used a rocket launcher ([src.name]).")
|
|
||||||
rockets -= I
|
rockets -= I
|
||||||
del(I)
|
return M
|
||||||
return
|
return null
|
||||||
else
|
|
||||||
usr << "\red [src] is empty."
|
/obj/item/weapon/gun/launcher/rocket/handle_post_fire(mob/user, atom/target)
|
||||||
|
message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([src.name]) at [target].")
|
||||||
|
log_game("[key_name_admin(user)] used a rocket launcher ([src.name]) at [target].")
|
||||||
|
..()
|
||||||
|
|||||||
@@ -15,14 +15,8 @@
|
|||||||
var/pumped = 0
|
var/pumped = 0
|
||||||
var/obj/item/ammo_casing/current_shell = null
|
var/obj/item/ammo_casing/current_shell = null
|
||||||
|
|
||||||
isHandgun()
|
get_next_projectile()
|
||||||
return 0
|
return current_shell.BB
|
||||||
|
|
||||||
load_into_chamber()
|
|
||||||
if(in_chamber)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
attack_self(mob/living/user as mob)
|
attack_self(mob/living/user as mob)
|
||||||
if(recentpump) return
|
if(recentpump) return
|
||||||
@@ -39,14 +33,10 @@
|
|||||||
if(current_shell)//We have a shell in the chamber
|
if(current_shell)//We have a shell in the chamber
|
||||||
current_shell.loc = get_turf(src)//Eject casing
|
current_shell.loc = get_turf(src)//Eject casing
|
||||||
current_shell = null
|
current_shell = null
|
||||||
if(in_chamber)
|
|
||||||
in_chamber = null
|
|
||||||
if(!loaded.len) return 0
|
if(!loaded.len) return 0
|
||||||
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
||||||
loaded -= AC //Remove casing from loaded list.
|
loaded -= AC //Remove casing from loaded list.
|
||||||
current_shell = AC
|
current_shell = AC
|
||||||
if(AC.BB)
|
|
||||||
in_chamber = AC.BB //Load projectile into chamber.
|
|
||||||
update_icon() //I.E. fix the desc
|
update_icon() //I.E. fix the desc
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@@ -79,21 +69,6 @@
|
|||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
|
|
||||||
load_into_chamber()
|
|
||||||
// if(in_chamber)
|
|
||||||
// return 1 {R}
|
|
||||||
if(!loaded.len)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
|
||||||
loaded -= AC //Remove casing from loaded list.
|
|
||||||
AC.desc += " This one is spent."
|
|
||||||
|
|
||||||
if(AC.BB)
|
|
||||||
in_chamber = AC.BB //Load projectile into chamber.
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
attack_self(mob/living/user as mob)
|
attack_self(mob/living/user as mob)
|
||||||
if(!(locate(/obj/item/ammo_casing/shotgun) in src) && !loaded.len)
|
if(!(locate(/obj/item/ammo_casing/shotgun) in src) && !loaded.len)
|
||||||
user << "<span class='notice'>\The [src] is empty.</span>"
|
user << "<span class='notice'>\The [src] is empty.</span>"
|
||||||
|
|||||||
@@ -69,20 +69,28 @@
|
|||||||
/obj/item/projectile/proc/on_penetrate(var/atom/A)
|
/obj/item/projectile/proc/on_penetrate(var/atom/A)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/obj/item/projectile/proc/check_fire(var/mob/living/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not.
|
/obj/item/projectile/proc/check_fire(atom/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not.
|
||||||
if(!istype(target) || !istype(user))
|
if(!istype(target) || !istype(user))
|
||||||
return 0
|
return 0
|
||||||
var/obj/item/projectile/test/in_chamber = new /obj/item/projectile/test(get_step_to(user,target)) //Making the test....
|
var/obj/item/projectile/test/trace = new /obj/item/projectile/test(get_step_to(user,target)) //Making the test....
|
||||||
in_chamber.target = target
|
trace.target = target
|
||||||
in_chamber.flags = flags //Set the flags...
|
trace.flags = flags //Set the flags...
|
||||||
in_chamber.pass_flags = pass_flags //And the pass flags to that of the real projectile...
|
trace.pass_flags = pass_flags //And the pass flags to that of the real projectile...
|
||||||
in_chamber.firer = user
|
trace.firer = user
|
||||||
var/output = in_chamber.process() //Test it!
|
var/output = trace.process() //Test it!
|
||||||
del(in_chamber) //No need for it anymore
|
del(trace) //No need for it anymore
|
||||||
return output //Send it back to the gun!
|
return output //Send it back to the gun!
|
||||||
|
|
||||||
|
//sets the click point of the projectile using mouse input params
|
||||||
|
/obj/item/projectile/proc/set_clickpoint(var/params)
|
||||||
|
var/list/mouse_control = params2list(params)
|
||||||
|
if(mouse_control["icon-x"])
|
||||||
|
p_x = text2num(mouse_control["icon-x"])
|
||||||
|
if(mouse_control["icon-y"])
|
||||||
|
p_y = text2num(mouse_control["icon-y"])
|
||||||
|
|
||||||
//called to launch a projectile from a gun
|
//called to launch a projectile from a gun
|
||||||
/obj/item/projectile/proc/launch(atom/target, mob/user, obj/item/weapon/gun/launcher, var/target_zone, var/x_offset=0, var/y_offset=0, var/px=null, var/py=null)
|
/obj/item/projectile/proc/launch(atom/target, mob/user, obj/item/weapon/gun/launcher, var/target_zone, var/x_offset=0, var/y_offset=0)
|
||||||
var/turf/curloc = get_turf(user)
|
var/turf/curloc = get_turf(user)
|
||||||
var/turf/targloc = get_turf(target)
|
var/turf/targloc = get_turf(target)
|
||||||
if (!istype(targloc) || !istype(curloc))
|
if (!istype(targloc) || !istype(curloc))
|
||||||
@@ -106,8 +114,6 @@
|
|||||||
current = curloc
|
current = curloc
|
||||||
yo = targloc.y - curloc.y + y_offset
|
yo = targloc.y - curloc.y + y_offset
|
||||||
xo = targloc.x - curloc.x + x_offset
|
xo = targloc.x - curloc.x + x_offset
|
||||||
if(!isnull(py)) p_y = py
|
|
||||||
if(!isnull(px)) p_x = px
|
|
||||||
|
|
||||||
shot_from = launcher
|
shot_from = launcher
|
||||||
silenced = launcher.silenced
|
silenced = launcher.silenced
|
||||||
@@ -133,7 +139,7 @@
|
|||||||
//accuracy bonus from aiming
|
//accuracy bonus from aiming
|
||||||
if (istype(shot_from, /obj/item/weapon/gun)) //If you aim at someone beforehead, it'll hit more often.
|
if (istype(shot_from, /obj/item/weapon/gun)) //If you aim at someone beforehead, it'll hit more often.
|
||||||
var/obj/item/weapon/gun/daddy = shot_from //Kinda balanced by fact you need like 2 seconds to aim
|
var/obj/item/weapon/gun/daddy = shot_from //Kinda balanced by fact you need like 2 seconds to aim
|
||||||
if (daddy.target && original in daddy.target) //As opposed to no-delay pew pew
|
if (daddy.aim_targets && original in daddy.aim_targets) //As opposed to no-delay pew pew
|
||||||
miss_modifier += -30
|
miss_modifier += -30
|
||||||
|
|
||||||
//roll to-hit
|
//roll to-hit
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/obj/item/weapon/gun/verb/toggle_firerate()
|
/obj/item/weapon/gun/verb/toggle_firerate()
|
||||||
set name = "Toggle Firerate"
|
set name = "Toggle Continue Aiming"
|
||||||
set category = "Object"
|
set category = "Object"
|
||||||
|
|
||||||
firerate = !firerate
|
keep_aim = !keep_aim
|
||||||
|
|
||||||
if (firerate)
|
if (keep_aim)
|
||||||
loc << "You will now continue firing when your target moves."
|
loc << "You will now continue firing when your target moves."
|
||||||
else
|
else
|
||||||
loc << "You will now only fire once, then lower your aim, when your target moves."
|
loc << "You will now only fire once, then lower your aim, when your target moves."
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
/obj/item/weapon/gun/verb/lower_aim()
|
/obj/item/weapon/gun/verb/lower_aim()
|
||||||
set name = "Lower Aim"
|
set name = "Lower Aim"
|
||||||
set category = "Object"
|
set category = "Object"
|
||||||
if(target)
|
if(aim_targets)
|
||||||
stop_aim()
|
stop_aim()
|
||||||
usr.visible_message("\blue \The [usr] lowers \the [src]...")
|
usr.visible_message("\blue \The [usr] lowers \the [src]...")
|
||||||
|
|
||||||
@@ -36,11 +36,11 @@
|
|||||||
|
|
||||||
//Removes lock fro mall targets
|
//Removes lock fro mall targets
|
||||||
/obj/item/weapon/gun/proc/stop_aim()
|
/obj/item/weapon/gun/proc/stop_aim()
|
||||||
if(target)
|
if(aim_targets)
|
||||||
for(var/mob/living/M in target)
|
for(var/mob/living/M in aim_targets)
|
||||||
if(M)
|
if(M)
|
||||||
M.NotTargeted(src) //Untargeting people.
|
M.NotTargeted(src) //Untargeting people.
|
||||||
del(target)
|
del(aim_targets)
|
||||||
|
|
||||||
//Compute how to fire.....
|
//Compute how to fire.....
|
||||||
//Return 1 if a target was found, 0 otherwise.
|
//Return 1 if a target was found, 0 otherwise.
|
||||||
@@ -49,13 +49,13 @@
|
|||||||
if(lock_time > world.time - 2) return
|
if(lock_time > world.time - 2) return
|
||||||
|
|
||||||
user.set_dir(get_cardinal_dir(src, A))
|
user.set_dir(get_cardinal_dir(src, A))
|
||||||
if(isliving(A) && !(A in target))
|
if(isliving(A) && !(A in aim_targets))
|
||||||
Aim(A) //Clicked a mob, aim at them
|
Aim(A) //Clicked a mob, aim at them
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
//Didn't click someone, check if there is anyone along that guntrace
|
//Didn't click someone, check if there is anyone along that guntrace
|
||||||
var/mob/living/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) //Find dat mob.
|
var/mob/living/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) //Find dat mob.
|
||||||
if(isliving(M) && (M in view(user)) && !(M in target))
|
if(isliving(M) && (M in view(user)) && !(M in aim_targets))
|
||||||
Aim(M) //Aha! Aim at them!
|
Aim(M) //Aha! Aim at them!
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@@ -63,13 +63,13 @@
|
|||||||
|
|
||||||
//Aiming at the target mob.
|
//Aiming at the target mob.
|
||||||
/obj/item/weapon/gun/proc/Aim(var/mob/living/M)
|
/obj/item/weapon/gun/proc/Aim(var/mob/living/M)
|
||||||
if(!target || !(M in target))
|
if(!aim_targets || !(M in aim_targets))
|
||||||
lock_time = world.time
|
lock_time = world.time
|
||||||
if(target && !automatic) //If they're targeting someone and they have a non automatic weapon.
|
if(aim_targets && !multi_aim) //If they're targeting someone and they have a non multi_aim weapon.
|
||||||
for(var/mob/living/L in target)
|
for(var/mob/living/L in aim_targets)
|
||||||
if(L)
|
if(L)
|
||||||
L.NotTargeted(src)
|
L.NotTargeted(src)
|
||||||
del(target)
|
del(aim_targets)
|
||||||
usr.visible_message("\red <b>[usr] turns \the [src] on [M]!</b>")
|
usr.visible_message("\red <b>[usr] turns \the [src] on [M]!</b>")
|
||||||
else
|
else
|
||||||
usr.visible_message("\red <b>[usr] aims \a [src] at [M]!</b>")
|
usr.visible_message("\red <b>[usr] aims \a [src] at [M]!</b>")
|
||||||
@@ -90,29 +90,26 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
M.last_move_intent = world.time
|
M.last_move_intent = world.time
|
||||||
if(can_fire())
|
var/firing_check = can_hit(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
|
||||||
var/firing_check = can_hit(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
|
if(firing_check > 0)
|
||||||
if(firing_check > 0)
|
if(firing_check == 1)
|
||||||
if(firing_check == 1)
|
Fire(T,usr, reflex = 1)
|
||||||
Fire(T,usr, reflex = 1)
|
else if(!told_cant_shoot)
|
||||||
else if(!told_cant_shoot)
|
M << "\red They can't be hit from here!"
|
||||||
M << "\red They can't be hit from here!"
|
told_cant_shoot = 1
|
||||||
told_cant_shoot = 1
|
spawn(30)
|
||||||
spawn(30)
|
told_cant_shoot = 0
|
||||||
told_cant_shoot = 0
|
|
||||||
else
|
|
||||||
click_empty(M)
|
|
||||||
|
|
||||||
usr.set_dir(get_cardinal_dir(src, T))
|
usr.set_dir(get_cardinal_dir(src, T))
|
||||||
|
|
||||||
if (!firerate) // If firerate is set to lower aim after one shot, untarget the target
|
if (!keep_aim) // If keep_aim is set to lower aim after one shot, untarget the target
|
||||||
T.NotTargeted(src)
|
T.NotTargeted(src)
|
||||||
|
|
||||||
//Yay, math!
|
//Yay, math!
|
||||||
|
|
||||||
#define SIGN(X) ((X<0)?-1:1)
|
#define SIGN(X) ((X<0)?-1:1)
|
||||||
|
|
||||||
proc/GunTrace(X1,Y1,X2,Y2,Z=1,exc_obj,PX1=16,PY1=16,PX2=16,PY2=16)
|
/proc/GunTrace(X1,Y1,X2,Y2,Z=1,exc_obj,PX1=16,PY1=16,PX2=16,PY2=16)
|
||||||
//bluh << "Tracin' [X1],[Y1] to [X2],[Y2] on floor [Z]."
|
//bluh << "Tracin' [X1],[Y1] to [X2],[Y2] on floor [Z]."
|
||||||
var/turf/T
|
var/turf/T
|
||||||
var/mob/living/M
|
var/mob/living/M
|
||||||
@@ -150,19 +147,19 @@ proc/GunTrace(X1,Y1,X2,Y2,Z=1,exc_obj,PX1=16,PY1=16,PX2=16,PY2=16)
|
|||||||
|
|
||||||
|
|
||||||
//Targeting management procs
|
//Targeting management procs
|
||||||
mob/var
|
/mob/var
|
||||||
list/targeted_by
|
list/targeted_by
|
||||||
target_time = -100
|
target_time = -100
|
||||||
last_move_intent = -100
|
last_move_intent = -100
|
||||||
last_target_click = -5
|
last_target_click = -5
|
||||||
target_locked = null
|
target_locked = null
|
||||||
|
|
||||||
mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
|
/mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
|
||||||
if(!I.target)
|
if(!I.aim_targets)
|
||||||
I.target = list(src)
|
I.aim_targets = list(src)
|
||||||
else if(I.automatic && I.target.len < 5) //Automatic weapon, they can hold down a room.
|
else if(I.multi_aim && I.aim_targets.len < 5) //multi_aim weapon, they can hold down a room.
|
||||||
I.target += src
|
I.aim_targets += src
|
||||||
else if(I.target.len >= 5)
|
else if(I.aim_targets.len >= 5)
|
||||||
if(ismob(I.loc))
|
if(ismob(I.loc))
|
||||||
I.loc << "You can only target 5 people at once!"
|
I.loc << "You can only target 5 people at once!"
|
||||||
return
|
return
|
||||||
@@ -223,43 +220,43 @@ mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
|
|||||||
I.last_moved_mob = src
|
I.last_moved_mob = src
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I)
|
/mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I)
|
||||||
if(!I.silenced)
|
if(!I.silenced)
|
||||||
for(var/mob/living/M in viewers(src))
|
for(var/mob/living/M in viewers(src))
|
||||||
M << 'sound/weapons/TargetOff.ogg'
|
M << 'sound/weapons/TargetOff.ogg'
|
||||||
targeted_by -= I
|
targeted_by -= I
|
||||||
I.target.Remove(src) //De-target them
|
I.aim_targets.Remove(src) //De-target them
|
||||||
if(!I.target.len)
|
if(!I.aim_targets.len)
|
||||||
del(I.target)
|
del(I.aim_targets)
|
||||||
var/mob/living/T = I.loc //Remove the targeting icons
|
var/mob/living/T = I.loc //Remove the targeting icons
|
||||||
if(T && ismob(T) && !I.target)
|
if(T && ismob(T) && !I.aim_targets)
|
||||||
T.client.remove_gun_icons()
|
T.client.remove_gun_icons()
|
||||||
if(!targeted_by.len)
|
if(!targeted_by.len)
|
||||||
del target_locked //Remove the overlay
|
del target_locked //Remove the overlay
|
||||||
del targeted_by
|
del targeted_by
|
||||||
spawn(1) update_targeted()
|
spawn(1) update_targeted()
|
||||||
|
|
||||||
mob/living/Move()
|
/mob/living/Move()
|
||||||
. = ..()
|
. = ..()
|
||||||
for(var/obj/item/weapon/gun/G in targeted_by) //Handle moving out of the gunner's view.
|
for(var/obj/item/weapon/gun/G in targeted_by) //Handle moving out of the gunner's view.
|
||||||
var/mob/living/M = G.loc
|
var/mob/living/M = G.loc
|
||||||
if(!(M in view(src)))
|
if(!(M in view(src)))
|
||||||
NotTargeted(G)
|
NotTargeted(G)
|
||||||
for(var/obj/item/weapon/gun/G in src) //Handle the gunner loosing sight of their target/s
|
for(var/obj/item/weapon/gun/G in src) //Handle the gunner loosing sight of their target/s
|
||||||
if(G.target)
|
if(G.aim_targets)
|
||||||
for(var/mob/living/M in G.target)
|
for(var/mob/living/M in G.aim_targets)
|
||||||
if(M && !(M in view(src)))
|
if(M && !(M in view(src)))
|
||||||
M.NotTargeted(G)
|
M.NotTargeted(G)
|
||||||
|
|
||||||
//If you move out of range, it isn't going to still stay locked on you any more.
|
//If you move out of range, it isn't going to still stay locked on you any more.
|
||||||
client/var
|
/client/var
|
||||||
target_can_move = 0
|
target_can_move = 0
|
||||||
target_can_run = 0
|
target_can_run = 0
|
||||||
target_can_click = 0
|
target_can_click = 0
|
||||||
gun_mode = 0
|
gun_mode = 0
|
||||||
|
|
||||||
//These are called by the on-screen buttons, adjusting what the victim can and cannot do.
|
//These are called by the on-screen buttons, adjusting what the victim can and cannot do.
|
||||||
client/proc/add_gun_icons()
|
/client/proc/add_gun_icons()
|
||||||
screen += usr.item_use_icon
|
screen += usr.item_use_icon
|
||||||
screen += usr.gun_move_icon
|
screen += usr.gun_move_icon
|
||||||
if (target_can_move)
|
if (target_can_move)
|
||||||
@@ -267,14 +264,14 @@ client/proc/add_gun_icons()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
client/proc/remove_gun_icons()
|
/client/proc/remove_gun_icons()
|
||||||
if(!usr) return 1 // Runtime prevention on N00k agents spawning with SMG
|
if(!usr) return 1 // Runtime prevention on N00k agents spawning with SMG
|
||||||
screen -= usr.item_use_icon
|
screen -= usr.item_use_icon
|
||||||
screen -= usr.gun_move_icon
|
screen -= usr.gun_move_icon
|
||||||
if (target_can_move)
|
if (target_can_move)
|
||||||
screen -= usr.gun_run_icon
|
screen -= usr.gun_run_icon
|
||||||
|
|
||||||
client/verb/ToggleGunMode()
|
/client/verb/ToggleGunMode()
|
||||||
set hidden = 1
|
set hidden = 1
|
||||||
gun_mode = !gun_mode
|
gun_mode = !gun_mode
|
||||||
if(gun_mode)
|
if(gun_mode)
|
||||||
@@ -288,7 +285,7 @@ client/verb/ToggleGunMode()
|
|||||||
usr.gun_setting_icon.icon_state = "gun[gun_mode]"
|
usr.gun_setting_icon.icon_state = "gun[gun_mode]"
|
||||||
|
|
||||||
|
|
||||||
client/verb/AllowTargetMove()
|
/client/verb/AllowTargetMove()
|
||||||
set hidden=1
|
set hidden=1
|
||||||
|
|
||||||
//Changing client's permissions
|
//Changing client's permissions
|
||||||
@@ -310,8 +307,8 @@ client/verb/AllowTargetMove()
|
|||||||
//Handling change for all the guns on client
|
//Handling change for all the guns on client
|
||||||
for(var/obj/item/weapon/gun/G in usr)
|
for(var/obj/item/weapon/gun/G in usr)
|
||||||
G.lock_time = world.time + 5
|
G.lock_time = world.time + 5
|
||||||
if(G.target)
|
if(G.aim_targets)
|
||||||
for(var/mob/living/M in G.target)
|
for(var/mob/living/M in G.aim_targets)
|
||||||
if(target_can_move)
|
if(target_can_move)
|
||||||
M << "Your character may now <b>walk</b> at the discretion of their targeter."
|
M << "Your character may now <b>walk</b> at the discretion of their targeter."
|
||||||
if(!target_can_run)
|
if(!target_can_run)
|
||||||
@@ -320,7 +317,7 @@ client/verb/AllowTargetMove()
|
|||||||
else
|
else
|
||||||
M << "\red <b>Your character will now be shot if they move.</b>"
|
M << "\red <b>Your character will now be shot if they move.</b>"
|
||||||
|
|
||||||
mob/living/proc/set_m_intent(var/intent)
|
/mob/living/proc/set_m_intent(var/intent)
|
||||||
if (intent != "walk" && intent != "run")
|
if (intent != "walk" && intent != "run")
|
||||||
return 0
|
return 0
|
||||||
m_intent = intent
|
m_intent = intent
|
||||||
@@ -346,14 +343,14 @@ client/verb/AllowTargetRun()
|
|||||||
//Handling change for all the guns on client
|
//Handling change for all the guns on client
|
||||||
for(var/obj/item/weapon/gun/G in src)
|
for(var/obj/item/weapon/gun/G in src)
|
||||||
G.lock_time = world.time + 5
|
G.lock_time = world.time + 5
|
||||||
if(G.target)
|
if(G.aim_targets)
|
||||||
for(var/mob/living/M in G.target)
|
for(var/mob/living/M in G.aim_targets)
|
||||||
if(target_can_run)
|
if(target_can_run)
|
||||||
M << "Your character may now <b>run</b> at the discretion of their targeter."
|
M << "Your character may now <b>run</b> at the discretion of their targeter."
|
||||||
else
|
else
|
||||||
M << "\red <b>Your character will now be shot if they run.</b>"
|
M << "\red <b>Your character will now be shot if they run.</b>"
|
||||||
|
|
||||||
client/verb/AllowTargetClick()
|
/client/verb/AllowTargetClick()
|
||||||
set hidden=1
|
set hidden=1
|
||||||
|
|
||||||
//Changing client's permissions
|
//Changing client's permissions
|
||||||
@@ -370,8 +367,8 @@ client/verb/AllowTargetClick()
|
|||||||
//Handling change for all the guns on client
|
//Handling change for all the guns on client
|
||||||
for(var/obj/item/weapon/gun/G in src)
|
for(var/obj/item/weapon/gun/G in src)
|
||||||
G.lock_time = world.time + 5
|
G.lock_time = world.time + 5
|
||||||
if(G.target)
|
if(G.aim_targets)
|
||||||
for(var/mob/living/M in G.target)
|
for(var/mob/living/M in G.aim_targets)
|
||||||
if(target_can_click)
|
if(target_can_click)
|
||||||
M << "Your character may now <b>use items</b> at the discretion of their targeter."
|
M << "Your character may now <b>use items</b> at the discretion of their targeter."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user