I want to make a verb where it sends a ki blast at everyone in the same z level as the usr, and only drain energy once without tons of pop ups for each target, how do I do that? this is my current code...
obj
geno
verb
Genocide()
set name = "Genocide"
set category = "Fighting"
for(var/mob/monsters/M in oview(usr,50))
if(M.npp == 1)
usr << "There are a newbie."
if(M.npp == 0||M.npp == null)
if(usr.kame == 1)
usr << "You are currently charging something."
if(usr.kame == 0||usr.kame == null)
var/dam = input("How much do you want to put into this?(Note, this is going to attack: [M])") as num
if(dam >= usr.maxpowerlevel)
usr << "Thats too strong."
if(dam < usr.maxpowerlevel)
usr.icon_state = "des"
sleep(rand(10,20))
var/snart = new /obj/geno(locate(usr.x,usr.y+1,usr.z))
sleep(rand(10,30))
del(snart)
M.powerlevel -= dam
usr.powerlevel -= dam
s_missile(/obj/geno2,usr,M)
usr.icon_state = ""
M.Die()
usr.KO()
if(M.field == 1)
view(6)<<"[M]'s forcefield absorbs the blast..."
ID:148709
Oct 31 2002, 6:05 pm
|
|
Oct 31 2002, 6:34 pm
|
|
By putting the things outside of the for() loop.
|