ID:264212
 
Code:
global/var/blastdamage = 0

proc


DarkBlast()
blastdamage = input("How much of your lifeforce to inflict damage?") as num
usr.hp -= blastdamage
var/obj/blast = new /obj/darkblast(usr.loc)
blast.dir = usr.dir
blast.loc = usr.loc
blast.density = 0
walk(blast,blast.dir)




obj
darkblast
icon='skills.dmi'
icon_state="blast"
density=1
opacity=0
Bump(mob/M)
if(istype(M, /mob/Shadow))
del(src)
return
else
M.hp -= (blastdamage - M.def)
if(usr.battletext ==1)
usr << "You used Dark Blast on [M] for [blastdamage] damage"
if(M.battletext ==1)
M << "[src] used Dark Blast on you for [blastdamage] damage"
M.Deathcheck()
del(src)


Problem description:

it asks how much lifeforce and takes it from the user. then cretes the blast and it goes forward, however does not bump/stop on anything and doesnt do anything after that. what am i doing wrong?
You set its density to 0 so it goes through everything, and this code looks ripped so I suggest you look at a beginners tutorial or the DM Guide.
In response to Bakasensei
ah....the density didnt even think of that...



and PLEASE dont say its ripped because its not...but whatever

anyways thanks for the help, ill see if i can get it to work now
In response to Chase_Hammer
k so i just removed the blast density on the create part...now the blast stops but it just continues to take the Hp away so in seconds the mobs hp goes into the negitive thousands and it apparently never goes to the M.Deathcheck() because it doesnt die. and the blast never deletes itself.

getting this also

usr = 0
src = darkblast

error says it cant read O.battletext and O.Deathcheck() which i have no idea how user is now 0.


i took out the usr referances and it now deletes the blast but the mob never dies, just keeps the negitive hp

checked errors. now it keeps referencing the user which apparently once it goes to the obj it doesnt remember who the usr is. any ideas how to fix