Exemple #1
0
 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;
 }
Exemple #2
0
        public int BuffType(string name)
        {
            ModBuff buff = GetBuff(name);

            if (buff == null)
            {
                return(0);
            }
            return(buff.Type);
        }
Exemple #3
0
        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;
        }
Exemple #4
0
        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);
            }
        }