Improves energy gun charge icon handling, adds ion rifle in-hand sprite.

This commit is contained in:
mwerezak
2015-02-22 21:46:18 -05:00
parent f7c65b4358
commit dfec1fcb5c
4 changed files with 16 additions and 3 deletions

View File

@@ -76,7 +76,13 @@
/obj/item/weapon/gun/energy/update_icon()
if(charge_meter)
var/ratio = power_supply.charge / power_supply.maxcharge
ratio = round(ratio, 0.25) * 100
//make sure that rounding down will not give us the empty state even if we have charge for a shot left.
if(power_supply.charge < charge_cost)
ratio = 0
else
ratio = max(round(ratio, 0.25) * 100, 25)
if(modifystate)
icon_state = "[modifystate][ratio]"
else

View File

@@ -2,10 +2,10 @@
name = "ion rifle"
desc = "A man portable anti-armor weapon designed to disable mechanical threats"
icon_state = "ionrifle"
item_state = "laser"
item_state = "ionrifle"
fire_sound = 'sound/weapons/Laser.ogg'
origin_tech = "combat=2;magnets=4"
w_class = 4.0
w_class = 4
force = 10
flags = CONDUCT
slot_flags = SLOT_BACK
@@ -17,6 +17,13 @@
return //so it doesn't EMP itself, I guess
..()
/obj/item/weapon/gun/energy/ionrifle/update_icon()
..()
if(power_supply.charge < charge_cost)
item_state = "ionrifle-empty"
else
item_state = initial(item_state)
/obj/item/weapon/gun/energy/decloner
name = "biological demolecularisor"
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."