Adds device powercells

Adds a type of smaller power cell for powering devices. Not used by much
at the moment, but it's one step closer to a more coherent picture of
power cells.
This commit is contained in:
mwerezak
2015-05-06 23:41:57 -04:00
parent 7389ec379f
commit 3e1e137cec
4 changed files with 38 additions and 14 deletions
@@ -594,6 +594,8 @@
user << "Close the panel first."
else if(cell)
user << "There is a power cell already installed."
else if(W.w_class != 3)
user << "\The [W] is too [W.w_class < 3? "small" : "large"] to fit here."
else
user.drop_item()
W.loc = src
+15 -12
View File
@@ -442,18 +442,21 @@
if(cell)
user << "There is a power cell already installed."
return
else
if (stat & MAINT)
user << "<span class='warning'>There is no connector for your power cell.</span>"
return
user.drop_item()
W.loc = src
cell = W
user.visible_message(\
"<span class='warning'>[user.name] has inserted the power cell to [src.name]!</span>",\
"<span class='notice'>You insert the power cell.</span>")
chargecount = 0
update_icon()
if (stat & MAINT)
user << "<span class='warning'>There is no connector for your power cell.</span>"
return
if(W.w_class != 3)
user << "\The [W] is too [W.w_class < 3? "small" : "large"] to fit here."
return
user.drop_item()
W.loc = src
cell = W
user.visible_message(\
"<span class='warning'>[user.name] has inserted the power cell to [src.name]!</span>",\
"<span class='notice'>You insert the power cell.</span>")
chargecount = 0
update_icon()
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
if(opened)
if (cell)
+4 -2
View File
@@ -14,7 +14,8 @@
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/cell_type = /obj/item/weapon/cell
var/maxcharge = 1000 //the capacity of the weapon's power cell. Specifying a cell_type overrides this value.
var/cell_type = null
var/projectile_type = /obj/item/projectile/beam/practice
var/modifystate
var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge
@@ -45,7 +46,8 @@
..()
if(cell_type)
power_supply = new cell_type(src)
power_supply.give(power_supply.maxcharge)
else
power_supply = new /obj/item/weapon/cell/device/variable(src, maxcharge)
if(self_recharge)
processing_objects.Add(src)
update_icon()