Cell.use checks instead of just minuses. Yay for code!

This commit is contained in:
Erthilo
2013-09-01 00:16:11 +01:00
parent f31185e052
commit 5d1c4548fa
9 changed files with 18 additions and 14 deletions

View File

@@ -109,7 +109,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
playsound(U.loc, 'sound/effects/EMPulse.ogg', 60, 2)
empulse(U, 2, 3) //Procs sure are nice. Slightly weaker than wizard's disable tch.
s_coold = 2
cell.charge-=(C*10)
cell.use(C*10)
return
//=======//ENERGY BLADE//=======//
@@ -129,7 +129,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
spark_system.start()
playsound(U.loc, "sparks", 50, 1)
U.put_in_hands(W)
cell.charge-=(C*10)
cell.use(C*10)
else
U << "\red You can only summon one blade. Try dropping an item first."
else//Else you can run around with TWO energy blades. I don't know why you'd want to but cool factor remains.
@@ -173,7 +173,7 @@ This could be a lot better but I'm too tired atm.*/
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
cell.charge-=(C*100)// Ninja stars now cost 100 energy, stil la fair chunk to avoid spamming, will run out of power quickly if used 3 or more times
cell.use(C*100)// Ninja stars now cost 100 energy, stil la fair chunk to avoid spamming, will run out of power quickly if used 3 or more times
A.process()
else
U << "\red There are no targets in view."
@@ -210,7 +210,7 @@ Must right click on a mob to activate.*/
E.master = U
spawn(0)//Parallel processing.
E.process(M)
cell.charge-=(C*100) // Nets now cost what should be most of a standard battery, since your taking someone out of the round
cell.use(C*100) // Nets now cost what should be most of a standard battery, since your taking someone out of the round
else
U << "They are already trapped inside an energy net."
else

View File

@@ -520,7 +520,10 @@ ________________________________________________________________________________
if(damage>1)//So they don't spam it when energy is a factor.
spark_system.start()//SPARKS THERE SHALL BE SPARKS
U.electrocute_act(damage, src,0.1,1)//The last argument is a safety for the human proc that checks for gloves.
cell.charge -= damage
if(cell.charge < damage)
cell.use(cell.charge)
else
cell.use(damage)
else
A << "\red <b>ERROR</b>: \black Not enough energy remaining."

View File

@@ -21,8 +21,9 @@
/obj/machinery/floodlight/process()
if(on)
cell.charge -= use
if(cell.charge <= 0)
if(cell.charge >= use)
cell.use(use)
else
on = 0
updateicon()
SetLuminosity(0)

View File

@@ -268,7 +268,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
Weaken(5)
if (stuttering < 5)

View File

@@ -248,7 +248,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
Weaken(5)
if (stuttering < 5)

View File

@@ -22,7 +22,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [M.name] ([M.ckey])</font>")

View File

@@ -440,7 +440,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall.", 2)

View File

@@ -229,7 +229,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
Weaken(5)
if (stuttering < 5)
stuttering = 5

View File

@@ -77,7 +77,7 @@
user << "<span class='notice'>[arrow] plinks and crackles as it begins to glow red-hot.</span>"
arrow.throwforce = 15
arrow.icon_state = "metal-rod-superheated"
cell.charge -= 500
cell.use(500)
return
if(istype(W, /obj/item/weapon/cell))
@@ -91,7 +91,7 @@
user << "<span class='notice'>[arrow] plinks and crackles as it begins to glow red-hot.</span>"
arrow.throwforce = 15
arrow.icon_state = "metal-rod-superheated"
cell.charge -= 500
cell.use(500)
else
user << "<span class='notice'>[src] already has a cell installed.</span>"