Exemplo n.º 1
0
        public Class GetByID(Enums.Class classId)
        {
            var row = _data
                      .Elements("class")
                      .Where((x) => x.Attribute("id").Value == ((byte)classId).ToString())
                      .First();

            var displayName = GetDisplayName(row);
            var baseStats   = row.Elements("baseStats").First();
            var maxStats    = row.Elements("maxStats").First();

            return(new Class
            {
                ClassID = (Enums.Class)row.GetAttribute <byte>("id"),
                DisplayName = displayName,
                Base_HP = baseStats.GetAttribute <byte>("hp"),
                Base_Str = baseStats.GetAttribute <byte>("str"),
                Base_Mag = baseStats.GetAttribute <byte>("mag"),
                Base_Skl = baseStats.GetAttribute <byte>("skl"),
                Base_Spd = baseStats.GetAttribute <byte>("spd"),
                Base_Lck = baseStats.GetAttribute <byte>("lck"),
                Base_Def = baseStats.GetAttribute <byte>("def"),
                Base_Res = baseStats.GetAttribute <byte>("res"),
                Max_HP = maxStats.GetAttribute <byte>("hp"),
                Max_Str = maxStats.GetAttribute <byte>("str"),
                Max_Mag = maxStats.GetAttribute <byte>("mag"),
                Max_Skl = maxStats.GetAttribute <byte>("skl"),
                Max_Spd = maxStats.GetAttribute <byte>("spd"),
                Max_Lck = maxStats.GetAttribute <byte>("lck"),
                Max_Def = maxStats.GetAttribute <byte>("def"),
                Max_Res = maxStats.GetAttribute <byte>("res")
            });
        }
Exemplo n.º 2
0
        public Class GetByID(Enums.Class classId)
        {
            var row = _data
                      .Elements("class")
                      .Where((x) => x.Attribute("id").Value == ((byte)classId).ToString())
                      .FirstOrDefault();

            return(row != null?FromElement(row) : null);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Checks whether a class promotion is above the first promotion-
        /// </summary>
        /// <param name="_class">The class.</param>
        /// <returns>Returns true if the promotion is above the first.</returns>
        public static bool AboveFirstPromotion(Enums.Class _class)
        {
            byte classid = (byte)_class;

            if (classid > 145 || classid == 0)
            {
                return(true);
            }
            byte promoteclassid = (byte)(((byte)GetBaseClass(_class)) + 1);

            return(classid >= promoteclassid);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the base class based on the different class types.
        /// </summary>
        /// <param name="_class">The class type.</param>
        /// <returns>Returns the base class.</returns>
        public static Enums.Class GetBaseClass(Enums.Class _class)
        {
            byte classid = (byte)_class;

            if (classid > 145 || classid == 0)
            {
                return(Enums.Class.Unknown);
            }

            if (classid >= 100)
            {
                return((Enums.Class)((classid / 100) * 100));
            }
            else
            {
                return((Enums.Class)((classid / 10) * 10));
            }
        }
Exemplo n.º 5
0
 public void SetClass(Enums.Class c)
 {
     myClass = c;
 }