mob/var/list/PassiveSkills=list()
obj/Skills
Click()
if(usr.HasPassiveSkill("[src.name]"))
var/Skills/Passive/S=new
//S=usr.PassiveSkills.Find("[src.name]")
//or
//S=usr.PassiveSkills["[src.name]"]
S.Level+=1
world<<"Upgraded [src.name]!"
else
if(!usr.SkillsPoints) return
var/Skills/Passive/NS="/Skills/[src.name]"
NS=new NS
NS.Level=1
usr.PassiveSkills.Add(NS)
world<<"<b>Added new skill - [src.name]"
Problem description:
Hallo, I've got problem with define var. I need Find "skill" obj in user list, and define it to some var.
I have o idea, what i do wrong.
@Edit:
I've find alternative. But is can anyone show me another way?
for(var/Skills/Passive/P in usr.PassiveSkills) if("[P.name]"=="[src.name]")
S=P
Then checking for a passive is as simple as:
Food for thought: Something you want to avoid is list initialization when and where you do not need it. Currently you have all mobs setup to have a passive list, when a fraction of them will likely use it.