condition(time, damage, obj/type)
spawn()
src.add_overlay(type)
while(time > 1 && src.HP > 1)
src.HP -= damage
damage_numbers(src, damage)
if(istype(type, /obj/spells/poison))
if (istype(src, /mob/players))
var/mob/players/P = src
if(P.poisoned < 1)
break
sleep(10)
src.remove_overlay(type, 1)
if (src.HP <= 0)
switch(src.type)
if(/mob/players)
var/mob/players/P = src
world << output("<font color = purple><b>[src] died to [type.name].", GI)
var/G = round((P.gold / 4), 1)
P << output("<font color = red>You lost [G] gold", GI)
P.gold -= G
P.loc = respawn_locaion
P.location = "t1"
P.HP = P.MAXHP
if(/mob/enemies)
usr.death(src)
Problem description:
It does not check to make sure player is dead, and if poison = 0 it does not break.
If it is the usr.death(src) then you may want to move that up to the /mob/players and do:
That way if it is a player passed into the statement than it will do a death check.
As to the posion, do you have a timer proc within poison that handles the time or if the poision = 0?
From what I see you have something to check if the player is poisioned is < 1, but I do not see any for or while statement that decrements the time.
It appears the time should be determined when the condition proc is originally called. Thus, you could try:
Which brings me back up to before as to if the decrement is handled within P.poisoned.