Files
CHOMPStation2/code/modules/projectiles/guns/energy.dm
Ren Erthilo 1b5e0b5588 TG: (Paperwork overhaul, not actually added until we decide what to do with it.)
Large bureaucracy overhaul.
This affects clipboards, hand labelers, paper, paper bins, pens, photocopiers,
and stamps.
Everything (that I've changed significantly) should be BETTER.

NO paths have been changed.
All of the above have been added to the paperwork module (pending rename to
bureaucracy, which is COOLER).
SPRITES for most of the above (except photocopiers) are now in bureaucracy.dmi.

Clipboards in particular are MASSIVELY IMPROVED.
Hand labelers can now be turned ON AND OFF, to make it simpler to avoid
labelling tables.
This includes work in progress FOLDERS, which currently do NOTHING.
Revision: r3253
Author: 	 petethegoat
2012-04-25 23:17:21 +01:00

53 lines
1.2 KiB
Plaintext

/obj/item/weapon/gun/energy
icon_state = "energy"
name = "energy gun"
desc = "A basic energy-based gun."
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"
modifystate
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)
if(!istype(in_chamber, projectile_type))
del(in_chamber)
in_chamber = new projectile_type(src)
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
if(modifystate)
icon_state = text("[][]", modifystate, ratio)
else
icon_state = text("[][]", initial(icon_state), ratio)