Refactors Cell Energy Values

This commit is contained in:
Fox-McCloud
2017-04-01 20:14:29 -04:00
parent d0d61755bc
commit 35ab7ada94
17 changed files with 156 additions and 152 deletions
+4 -4
View File
@@ -34,7 +34,7 @@
if(selfcharge)
processing_objects.Add(src)
update_icon()
/obj/item/weapon/gun/energy/proc/update_ammo_types()
var/obj/item/ammo_casing/energy/shot
for(var/i = 1, i <= ammo_type.len, i++)
@@ -61,9 +61,9 @@
var/obj/item/ammo_casing/energy/E = ammo_type[select]
if(use_external_power)
var/obj/item/weapon/stock_parts/cell/external = get_external_power_supply()
if(!external || !external.use((E.e_cost)/10)) //Take power from the borg...
if(!external || !external.use(E.e_cost)) //Take power from the borg...
return //Note, uses /10 because of shitty mods to the cell system
power_supply.give(1000) //... to recharge the shot
power_supply.give(100) //... to recharge the shot
update_icon()
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
@@ -176,7 +176,7 @@
var/mob/living/silicon/robot/R = loc
if(R && R.cell)
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
if(R.cell.use(shot.e_cost/10)) //Take power from the borg... //Divided by 10 because cells and charge costs are fucked.
if(R.cell.use(shot.e_cost)) //Take power from the borg...
power_supply.give(shot.e_cost) //... to recharge the shot
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
@@ -94,7 +94,7 @@
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
power_supply.use(5000)
power_supply.use(500)
update_icon()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload()
@@ -120,7 +120,7 @@
return
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(5000)
power_supply.give(500)
if(!suppressed)
playsound(loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else if(isliving(loc))
@@ -181,7 +181,7 @@
/obj/item/projectile/kinetic/pod
range = 4
/obj/item/projectile/kinetic/pod/regular
damage = 50
pressure_decrease = 0.5
@@ -157,11 +157,11 @@
if(istype(A, /obj/item/stack/sheet/mineral/plasma))
var/obj/item/stack/sheet/S = A
S.use(1)
power_supply.give(10000)
power_supply.give(1000)
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
else if(istype(A, /obj/item/weapon/ore/plasma))
qdel(A)
power_supply.give(5000)
power_supply.give(500)
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
else
..()