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; } }
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)); }
private void AddSpecial(SpecialDefenses id) { SpecialDefense s = GetSpecialDefense(id); if (s != null) { Specials.Add(s); } }
// 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); } } }
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); } }
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; }
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; }
private void AddSpecial( SpecialDefenses id ) { SpecialDefense s = GetSpecialDefense(id); if(s != null) Specials.Add(s); }
private static SpecialDefense GetSpecialDefense(SpecialDefenses id) { return((SpecialDefense)AllSpecials[id]); }
public XmlCustomDefenses(SpecialDefenses defense) { AddSpecial(defense); }
internal virtual bool HasSpecialDefense(SpecialDefenses specDef) { return false; // TODO: implement }
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); } }
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; }
private static SpecialDefense GetSpecialDefense( SpecialDefenses id ) { return((SpecialDefense)AllSpecials[id]); }
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) ); }
public ComboDefense( string name, ComboDefenses id, SpecialDefenses [] sequence) { Name = name; DefenseID = id; DefenseSequence = sequence; }
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; }
internal override bool HasSpecialDefense(SpecialDefenses specDef) { return _specialDefenses[(int)specDef]; }
private static void AddComboDefense( string name, ComboDefenses id, SpecialDefenses [] sequence) { AllCombos.Add(id, new ComboDefense( name, id,sequence) ); }