Files
Polaris/code/modules/projectiles/guns/energy.dm
mport2004@gmail.com 46a7143e3a Energy projectiles work again.
Rewrote the job selection system to use bitflags and the jobs are now objects.
Fixed a path conflict with effect which caused a few things to be unable to be clicked on.
Commented out the job.txt, Urist if you still want it to load from the .txt give me a yell and I can update it to work with the job objects.
Fixed up the bits that were missing the slightly updated mob organ attack code.
Moved the traps file into unused.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2340 316c924e-a436-60f5-8080-3fe189b3f50e
2011-10-11 07:52:30 +00:00

45 lines
1.0 KiB
Plaintext

/obj/item/weapon/gun/energy
icon_state = "energy"
name = "energy gun"
desc = "A basic energy-based gun with two settings: Stun and kill."
fire_sound = 'Taser.ogg'
var
obj/item/weapon/cell/power_supply //What type of power cell this uses
charge_cost = 100 //How much energy is needed to fire.
cell_type = "/obj/item/weapon/cell"
projectile_type = "/obj/item/projectile/energy"
emp_act(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(!projectile_type) return 0
in_chamber = new projectile_type(src)
return 1
update_icon()
var/ratio = power_supply.charge / power_supply.maxcharge
ratio = round(ratio, 0.25) * 100
icon_state = text("[][]", initial(icon_state), ratio)