public void AddBuff(string name, ModBuff buff, string texture) { int id = BuffLoader.ReserveBuffID(); buff.Name = name; buff.Type = id; buffs[name] = buff; BuffLoader.buffs[id] = buff; buff.texture = texture; buff.mod = this; }
public int BuffType(string name) { ModBuff buff = GetBuff(name); if (buff == null) { return(0); } return(buff.Type); }
private void AutoloadBuff(Type type) { ModBuff buff = (ModBuff)Activator.CreateInstance(type); buff.mod = this; string name = type.Name; string texture = (type.Namespace + "." + type.Name).Replace('.', '/'); if (buff.Autoload(ref name, ref texture)) { AddBuff(name, buff, texture); } }