DeathCheck not executing? in Developer Help
|
|
Code:
obj radio icon = 'bomb.dmi' icon_state = "radio" verb Pick_up() set category = "Actions" set src in oview(1) src.loc = usr
obj/radio/verb/drop_bomb(varX as num, varY as num, varZ as num) set name = "radio" set category = "Actions" varX = min(world.maxx, max(1, varX)) varY = min(world.maxy, max(1, varY)) varZ = min(world.maxz, max(1, varZ)) var/obj/bigassbomb/B = new B.overlays += new/obj/Overlays/big_bomb for(var/i=3 to 1 step -1) if(!B) return B.Move(locate(varX, varY+i, varZ), SOUTH) sleep(5) if(!B) return B.Move(locate(varX, varY, varZ), SOUTH) Explode(new /Effect/BasicBoom(B.loc,1,4)) for(var/mob/M in view(B, 4)) M.hp -= (100 + M.defence) spawn() usr.deathcheck2(M) del(B) del(src)
|
mob proc deathcheck2(mob/M) if(M.hp<=0) world<<"[M] has been bombed by [src]" src.kills+=1 Ranking(src) M.loc = locate(0,0,0) M<<"wait 10 seconds.. you will be restored" sleep(100) if(M.team == "blue") M.loc = locate(5,5,1) M.hp = M.mhp scorered += 2 endgame() showscores() else M.loc = locate(143,143,1) M.hp = M.mhp scoreblue += 2 endgame() showscores()
|
Problem description:
Now i dont see why, but after the bomb is dropped and exploded the mobs... dont get affected 0.o
Any ideas why this is happening?
|
This is how it should be written:
Then, different types of mobs can have different deathchecks:
You should then be calling M.deathcheck(usr) rather than usr.deathcheck(M).
As for the problem you're having: it most likely is an issue with you Explode() proc, which you haven't shown.