public static void InitSkills(XmlNode SkillSettings, XmlNode ExtSkillSettings)
        {
            foreach (XmlNode igClass in SkillSettings.ChildNodes)
            {
                string currentClassId = igClass.Attributes.GetNamedItem("id").InnerText;
                foreach (XmlNode igSkill in igClass.ChildNodes)
                {
                    string        currentSkillId = igSkill.Attributes.GetNamedItem("id").InnerText;
                    string        name           = Resources.Strings.ResourceManager.GetString(currentSkillId);
                    var           icon           = (Image)Resources.SkillIcons.ResourceManager.GetObject(currentClassId + "_" + currentSkillId);
                    int           slot           = int.Parse(igSkill.Attributes.GetNamedItem("slot").InnerText);
                    int           key            = int.Parse(igSkill.Attributes.GetNamedItem("key").InnerText);
                    bool          active         = bool.Parse(igSkill.Attributes.GetNamedItem("active").InnerText);
                    AvailableType available      = ParseType(igSkill.Attributes.GetNamedItem("func").InnerText);

                    Skills.Add(currentClassId + "_" + currentSkillId, new Skill(name, icon, new Key((Keys)key), slot, active, available));
                }
            }

            PotionSkill = new PotionSkill(new Key(Keys.None), false);

            foreach (XmlNode extSkill in ExtSkillSettings)
            {
                if (extSkill.Attributes.GetNamedItem("id").InnerText == "potion")
                {
                    var key    = new Key((Keys)int.Parse(extSkill.Attributes.GetNamedItem("key").InnerText));
                    var active = bool.Parse(extSkill.Attributes.GetNamedItem("active").InnerText);

                    PotionSkill.SetKey(key);
                    PotionSkill.SetActive(active);
                }
            }
        }
Esempio n. 2
0
 public Skill(string name, Image icon, Key key, int slot, bool active, AvailableType type)
 {
     this.name   = name;
     this.Key    = key;
     this.icon   = icon;
     this.Type   = type;
     Slot        = slot;
     this.active = active;
     CanPress    = GetFunction(type);
 }
Esempio n. 3
0
        public void addOptSchedule(DateTime startTimeUTC, int durationHours)
        {
            AvailableType availableType = new AvailableType();

            availableType.properties = new properties();

            availableType.properties.dtstart          = new dtstart();
            availableType.properties.dtstart.datetime = startTimeUTC;

            availableType.properties.duration          = new DurationPropType();
            availableType.properties.duration.duration = "PT" + durationHours.ToString() + "H";

            _schedule.Add(availableType);
        }
Esempio n. 4
0
        public static String StringifyType(AvailableType type)
        {
            switch (type)
            {
            case AvailableType.Trigger: return("trigger");

            case AvailableType.InActive: return("inactive");

            case AvailableType.Potion: return("potion");

            case AvailableType.FullEssence: return("fullessence");

            case AvailableType.SkeletalMage: return("skeletalmage");
            }
            return("error");
        }
Esempio n. 5
0
 public static AvailableFunction GetFunction(AvailableType type)
 {
     if (type == AvailableType.Trigger)
     {
         return(Trigger);
     }
     if (type == AvailableType.InActive)
     {
         return(ByColor);
     }
     if (type == AvailableType.Potion)
     {
         return(Potion);
     }
     if (type == AvailableType.FullEssence)
     {
         return(FullEssence);
     }
     if (type == AvailableType.SkeletalMage)
     {
         return(SkeletalMage);
     }
     return(Error);
 }