Status datums:
status
var
name
doesdecay=1
currentround=0
decayround=0
percenthealed=0
persistaftercombat=0
bleeding //same as poisoned but heals after fight.
name="bleeding"
bound //can't use any skills
name="bound"
cursed //can't regain health from spells. BUILT IN
name="cursed"
doesdecay=0
etc....
Verbs:
mob/player
verb/sufferailment(var/status/sa in typesof(/status/))
set category="Stats"
src.status+=new sa
verb/findailment()
set category="Stats"
src << src.status.Find(/status/stunned)
if(src.status.Find(status) != 0)
src << "status detected."
src << list2params(src.status)
Problem description:
I am trying to find a datum in a list that holds all the status ailments. I am trying to uselist.Find(), and since it only returns 0 if he item is not in the list, I use that to find if the mob has said status ailment or not. However for some reason it always returns me 0, even if the status is clearly seen in the list2params, possibly a problem with the syntax, since what is in the list is a datum, not a path.
So I'd like to know if any of you could help me with how I should write to check for a datum and not a path, please.
Also, is the use of Find() better than using a for loop that breaks after the very first item has been found performance-wise, or are they the same, since Find() only returns the first item aswell, and are there more performant ways?