Пример #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
                // version 0
                int count = reader.ReadInt();

                for (int i = 0; i < count; i++)
                {
                    string sname = reader.ReadString();

                    try
                    {
                        SpecialDefenses stype = (SpecialDefenses)Enum.Parse(typeof(SpecialDefenses), sname);
                        this.tmpSpecialsList.Add(stype);
                    }
                    catch
                    {
                    }
                }
                break;
            }
        }
Пример #2
0
 private static void AddSpecialDefense(string name, string description, SpecialDefenses id, int icon, IconTypes itype, TimeSpan duration,
                                       int mana, int stam, int hits, int karma, int minstr, int mindex, int minint,
                                       SkillName [] skills, int [] minlevel, Type [] reagents, int [] quantity)
 {
     AllSpecials.Add(id, new SpecialDefense(name, description, id, icon, itype,
                                            duration, mana, stam, hits, karma,
                                            minstr, mindex, minint, skills, minlevel, reagents, quantity));
 }
Пример #3
0
        private void AddSpecial(SpecialDefenses id)
        {
            SpecialDefense s = GetSpecialDefense(id);

            if (s != null)
            {
                Specials.Add(s);
            }
        }
Пример #4
0
 // this constructor is intended to be called from within scripts that wish to define custom defense configurations
 // by passing it a list of SpecialDefenses
 public XmlCustomDefenses(SpecialDefenses[] defenselist)
 {
     if (defenselist != null)
     {
         foreach (SpecialDefenses sid in defenselist)
         {
             this.AddSpecial(sid);
         }
     }
 }
Пример #5
0
        public static void AddDefense(object target, SpecialDefenses defense)
        {
            // is there an existing custom attacks attachment to add to?
            XmlCustomDefenses a = (XmlCustomDefenses)XmlAttach.FindAttachment(target, typeof(XmlCustomDefenses));

            if (a == null)
            {
                // add a new custom attacks attachment
                XmlAttach.AttachTo(target, new XmlCustomDefenses(defense));
            }
            else
            {
                // add the new attack to existing attack list
                a.AddSpecial(defense);
            }
        }
Пример #6
0
 public int[] MinSkillLevel;       // minimum skill levels
 public SpecialDefense(string name, string description, SpecialDefenses id, int icon, IconTypes itype, TimeSpan duration,
                       int mana, int stam, int hits, int karma, int minstr, int mindex, int minint,
                       SkillName[] skills, int[] minlevel, Type[] reagents, int[] quantity)
 {
     this.Name          = name;
     this.Description   = description;
     this.DefenseID     = id;
     this.ChainTime     = duration;
     this.Icon          = icon;
     this.IconType      = itype;
     this.ManaReq       = mana;
     this.StamReq       = stam;
     this.HitsReq       = hits;
     this.KarmaReq      = karma;
     this.StrReq        = minstr;
     this.DexReq        = mindex;
     this.IntReq        = minint;
     this.Reagents      = reagents;
     this.Quantity      = quantity;
     this.Skills        = skills;
     this.MinSkillLevel = minlevel;
 }
Пример #7
0
            public int [] MinSkillLevel;      // minimum skill levels

            public SpecialDefense(string name, string description, SpecialDefenses id, int icon, IconTypes itype, TimeSpan duration,
                                  int mana, int stam, int hits, int karma, int minstr, int mindex, int minint,
                                  SkillName [] skills, int [] minlevel, Type [] reagents, int [] quantity)
            {
                Name          = name;
                Description   = description;
                DefenseID     = id;
                ChainTime     = duration;
                Icon          = icon;
                IconType      = itype;
                ManaReq       = mana;
                StamReq       = stam;
                HitsReq       = hits;
                KarmaReq      = karma;
                StrReq        = minstr;
                DexReq        = mindex;
                IntReq        = minint;
                Reagents      = reagents;
                Quantity      = quantity;
                Skills        = skills;
                MinSkillLevel = minlevel;
            }
Пример #8
0
        private void AddSpecial( SpecialDefenses id )
        {
            SpecialDefense s = GetSpecialDefense(id);

            if(s != null)
                Specials.Add(s);
        }
Пример #9
0
 private static SpecialDefense GetSpecialDefense(SpecialDefenses id)
 {
     return((SpecialDefense)AllSpecials[id]);
 }
Пример #10
0
 public XmlCustomDefenses(SpecialDefenses defense)
 {
     AddSpecial(defense);
 }
Пример #11
0
 internal virtual bool HasSpecialDefense(SpecialDefenses specDef)
 {
     return false;   // TODO: implement
 }
Пример #12
0
        public static void AddDefense(object target, SpecialDefenses defense)
        {
            // is there an existing custom attacks attachment to add to?
            XmlCustomDefenses a = (XmlCustomDefenses)XmlAttach.FindAttachment(target, typeof(XmlCustomDefenses));

            if(a == null)
            {
                // add a new custom attacks attachment
                XmlAttach.AttachTo(target, new XmlCustomDefenses(defense));
            } else
            {
                // add the new attack to existing attack list
                a.AddSpecial(defense);
            }
        }
Пример #13
0
 public int[] MinSkillLevel;// minimum skill levels
 public SpecialDefense(string name, string description, SpecialDefenses id, int icon, IconTypes itype, TimeSpan duration,
     int mana, int stam, int hits, int karma, int minstr, int mindex, int minint,
     SkillName[] skills, int[] minlevel, Type[] reagents, int[] quantity)
 {
     this.Name = name;
     this.Description = description;
     this.DefenseID = id;
     this.ChainTime = duration;
     this.Icon = icon;
     this.IconType = itype;
     this.ManaReq = mana;
     this.StamReq = stam;
     this.HitsReq = hits;
     this.KarmaReq = karma;
     this.StrReq = minstr;
     this.DexReq = mindex;
     this.IntReq = minint;
     this.Reagents = reagents;
     this.Quantity = quantity;
     this.Skills = skills;
     this.MinSkillLevel = minlevel;
 }
Пример #14
0
 private static SpecialDefense GetSpecialDefense( SpecialDefenses id )
 {
     return((SpecialDefense)AllSpecials[id]);
 }
Пример #15
0
		private static void AddSpecialDefense( string name, string description, SpecialDefenses id, int icon, IconTypes itype, TimeSpan duration,
        int mana, int stam, int hits, int karma, int minstr, int mindex, int minint,
        SkillName [] skills, int [] minlevel, Type [] reagents, int [] quantity)
        {
            AllSpecials.Add(id, new SpecialDefense( name, description, id, icon, itype,
            duration, mana, stam, hits, karma,
            minstr, mindex, minint, skills, minlevel, reagents, quantity) );
        }
Пример #16
0
 public ComboDefense( string name, ComboDefenses id, SpecialDefenses [] sequence)
 {
     Name = name;
     DefenseID = id;
     DefenseSequence = sequence;
 }
Пример #17
0
            public int [] MinSkillLevel;   // minimum skill levels

            public SpecialDefense( string name, string description, SpecialDefenses id, int icon, IconTypes itype, TimeSpan duration,
            int mana, int stam, int hits, int karma, int minstr, int mindex, int minint,
            SkillName [] skills, int [] minlevel, Type [] reagents, int [] quantity)
            {
                Name = name;
                Description = description;
                DefenseID = id;
                ChainTime = duration;
                Icon = icon;
                IconType = itype;
                ManaReq = mana;
                StamReq = stam;
                HitsReq = hits;
                KarmaReq = karma;
                StrReq = minstr;
                DexReq = mindex;
                IntReq = minint;
                Reagents = reagents;
                Quantity = quantity;
                Skills = skills;
                MinSkillLevel = minlevel;
            }
Пример #18
0
 public XmlCustomDefenses(SpecialDefenses defense)
 {
     AddSpecial(defense);
 }
Пример #19
0
 internal override bool HasSpecialDefense(SpecialDefenses specDef)
 {
     return _specialDefenses[(int)specDef];
 }
Пример #20
0
 private static void AddComboDefense( string name, ComboDefenses id, SpecialDefenses [] sequence)
 {
     AllCombos.Add(id, new ComboDefense( name, id,sequence) );
 }