Esempio n. 1
0
 public ThiefData(AttributeCode combatAttribute, AttributeCode[] mainAttributes, int[,] startSkillTable,
                  Dictionary <string, List <ThiefSkill> > thiefSkillCategories, List <ThiefManeuver> thiefManeuvers, List <string> guildPositions) : base(combatAttribute, mainAttributes, startSkillTable)
 {
     ThiefSkillCategories = thiefSkillCategories;
     ThiefManeuvers       = thiefManeuvers;
     GuildPositions       = guildPositions;
 }
Esempio n. 2
0
        public Property(Triangle tri)
        {
            m_attribCode = tri.AttributeCode;

            m_cameraBehavior = tri.CameraBehavior;

            m_camID = tri.CameraID;

            m_camMoveBg = tri.CamMoveBG;

            m_exitID = tri.ExitIndex;

            m_groundCode = tri.GroundCode;

            m_linkNo = tri.LinkNumber;

            m_polyColor = tri.PolyColor;

            m_roomCamID = tri.RoomCamID;

            m_roomPathID = tri.RoomPathID;

            m_roomPathPntNo = tri.RoomPathPointNo;

            m_soundID = tri.SoundID;

            m_specialCode = tri.SpecialCode;

            m_wallCode = tri.WallCode;
        }
Esempio n. 3
0
        public Property(EndianBinaryReader reader)
        {
            int bitField1 = reader.ReadInt32();

            m_camID     = (bitField1 & 0xFF);
            m_soundID   = (SoundID)((bitField1 & 0x1F00) >> 0x08);
            m_exitID    = (bitField1 & 0x7E000) >> 0x0D;
            m_polyColor = (bitField1 & 0x7F80000) >> 0x13;

            int bitField2 = reader.ReadInt32();

            m_linkNo      = (bitField2 & 0xFF);
            m_wallCode    = (WallCode)((bitField2 & 0xF00) >> 0x08);
            m_specialCode = (SpecialCode)((bitField2 & 0xF000) >> 0x0C);
            m_attribCode  = (AttributeCode)((bitField2 & 0x1F0000) >> 0x10);
            m_groundCode  = (GroundCode)((bitField2 & 0x3E00000) >> 0x15);

            int bitField3 = reader.ReadInt32();

            m_camMoveBg     = (bitField3 & 0xFF);
            m_roomCamID     = (bitField3 & 0xFF00) >> 0x08;
            m_roomPathID    = (bitField3 & 0xFF0000) >> 0x10;
            m_roomPathPntNo = (bitField3 & unchecked ((int)0xFF000000)) >> 0x18;

            m_cameraBehavior = reader.ReadInt32();
        }
Esempio n. 4
0
        public Triangle(Vector3 vert1, Vector3 vert2, Vector3 vert3, Property prop, int groupIndex)
        {
            m_vertex1 = vert1;

            m_vertex2 = vert2;

            m_vertex3 = vert3;

            GroupIndex = groupIndex;

            m_camID     = prop.CameraID;
            m_soundID   = prop.SoundID;
            m_exitID    = prop.ExitIndex;
            m_polyColor = prop.PolyColor;

            m_linkNo      = prop.LinkNumber;
            m_wallCode    = prop.WallCode;
            m_specialCode = prop.SpecialCode;
            m_attribCode  = prop.AttributeCode;
            m_groundCode  = prop.GroundCode;

            m_camMoveBg     = prop.CamMoveBG;
            m_roomCamID     = prop.RoomCamID;
            m_roomPathID    = prop.RoomPathID;
            m_roomPathPntNo = prop.RoomPathPointNo;

            m_cameraBehavior = prop.CameraBehavior;
        }
        public async Task <IActionResult> PutAttributeCode([FromRoute] int id, [FromBody] AttributeCode attributeCode)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != attributeCode.Id)
            {
                return(BadRequest());
            }

            _context.Entry(attributeCode).State = EntityState.Modified;

            try {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException) {
                if (!AttributeCodeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 6
0
 public void UpgradeElementEnhanceAttribute(int value)
 {
     if (WeaponElement != WeaponElementType.Null)
     {
         AttributeCode enhance = (AttributeCode)Enum.Parse(typeof(AttributeCode), "Enhance_" + WeaponElement);
         ElementAttributes.Value[enhance] = ElementAttributes.Value[enhance] + value;
     }
 }
Esempio n. 7
0
        public Attribute GetAttribute(AttributeCode attributeCode)
        {
            Attribute attribute = null;

            m_Attributes.TryGetValue(attributeCode, out attribute);

            return(attribute);
        }
Esempio n. 8
0
 public int GetGenderModifier(AttributeCode attribute)
 {
     if (GenderModifier.ContainsKey(attribute))
     {
         return(GenderModifier[attribute]);
     }
     return(0);
 }
Esempio n. 9
0
        private void CalculateSkillPointLimits(SkillType skillType, AttributeCode attribute1, AttributeCode attribute2, out int surePoints, out int variablePoints)
        {
            CalculateAttributePointLimits(attribute1, out int SP1, out int VP1);
            CalculateAttributePointLimits(attribute2, out int SP2, out int VP2);


            surePoints     = StartSkillPoints[skillType] + StartSkillPointsAdjusment[skillType] + SP1 + SP2;
            variablePoints = VP1 + VP2;
        }
Esempio n. 10
0
        private void CalculateAttributePointLimits(AttributeCode attribute, out int surePoints, out int variablePoints)
        {
            int MaxStart = IsMainAttribute(attribute) ? 3 : RuleTables.GetStartingMaxAttribute(Exceptionality);
            int MaxZv    = GetAttributeMax(attribute) - MaxStart;
            int Val      = BaseAttributes[attribute];

            surePoints     = Math.Max(Val - MaxStart, 0);
            variablePoints = Math.Min(MaxZv - surePoints, Val - (IsMainAttribute(attribute) ? 1 : 0));
        }
Esempio n. 11
0
 public bool IsMainAttribute(AttributeCode attribute)
 {
     foreach (AttributeCode item in Profession.MainAttributes)
     {
         if (item == attribute)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 12
0
 public Thief(AttributeCode combatAttribute, AttributeCode[] mainAttributes, List <ThiefSkill> thiefSkills,
              List <ThiefManeuver> thiefManeuvers, int profipoints,
              string guildName = "", string guildMentor = "", string guildPosition = "") : base(combatAttribute, mainAttributes)
 {
     ThiefSkills     = thiefSkills;
     _thiefManeuvers = thiefManeuvers;
     Profipoints     = profipoints;
     GuildName       = guildName;
     GuildMentor     = guildMentor;
     GuildPosition   = guildPosition;
 }
Esempio n. 13
0
 protected override void UpgradeForgingAttribute(AttributeCode attribute, ValueType value)
 {
     if (CurrentLevel < DataConstraint.EquipmentMaxLevel && !attribute.Equals(AttributeCode.Null) && value != null)
     {
         float f = Convert.ToSingle(value.ToString());
         if (f > 0)
         {
             ForgingAttributes[CurrentLevel + 1] = new KeyValuePair <AttributeCode, float>(attribute, f);
         }
     }
 }
        public async Task <IActionResult> PostAttributeCode([FromBody] AttributeCode attributeCode)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.AttributeCodes.Add(attributeCode);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAttributeCode", new { id = attributeCode.Id }, attributeCode));
        }
Esempio n. 15
0
 protected override void UpdateForgingAttribute(int level, AttributeCode attribute, ValueType value)
 {
     if (ForgingAttributes.ContainsKey(level) && !attribute.Equals(AttributeCode.Null) &&
         value != null)
     {
         float f = Convert.ToSingle(value.ToString());
         if (f > 0)
         {
             ForgingAttributes[level] = new KeyValuePair <AttributeCode, float>(attribute, f);
         }
     }
 }
Esempio n. 16
0
        public int GetAttributeStartingMin(AttributeCode attribute)
        {
            if (!BaseAttributes.ContainsKey(attribute))
            {
                throw new ArgumentOutOfRangeException("Tried to get nonexistent attribute.");
            }

            if (IsMainAttribute(attribute))
            {
                return(1);
            }

            return(0);
        }
Esempio n. 17
0
        public int GetAttributeMax(AttributeCode attribute)
        {
            if (!BaseAttributes.ContainsKey(attribute))
            {
                throw new ArgumentOutOfRangeException("Tried to get nonexistent attribute.");
            }

            if (IsMainAttribute(attribute))
            {
                return(3 + (Level - 1) - ((Level - 1) / 3));
            }

            return(RuleTables.GetStartingMaxAttribute(Exceptionality) + (Level - 1) - (Level - 1) / 2);
        }
Esempio n. 18
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateRandomAttribute
 /// 作者:taixihuase
 /// 作用:变更随机属性,含添加、更改及删除操作
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void UpdateRandomAttribute(AttributeCode attribute, float value)
 {
     if (attribute != AttributeCode.Null)
     {
         if (value > 0)
         {
             RandomAttribute = new KeyValuePair <AttributeCode, float>(attribute, value);
         }
     }
     else
     {
         RemoveRandomAttribute();
     }
 }
Esempio n. 19
0
 public void UpgradeElementExtraAttribute(float value, int order)
 {
     if (WeaponElement != WeaponElementType.Null)
     {
         int num = Convert.ToInt32(Enum.Parse(typeof(WeaponElementType), WeaponElement.ToString())) +
                   (order - 1) * DataConstraint.ElementMaxSize;
         if (num > 0 && num <= Enum.GetValues(typeof(ElementExtraAttribute)).Length)
         {
             string        extra = Enum.GetName(typeof(ElementExtraAttribute), num);
             AttributeCode attr  = (AttributeCode)Enum.Parse(typeof(AttributeCode), extra);
             ElementAttributes.Value[attr] = ElementAttributes.Value[attr] + value;
         }
     }
 }
Esempio n. 20
0
        public int GetAttribute(AttributeCode attribute, bool applyGender = false)
        {
            int tmp = 0;

            if (RacialAttributes.ContainsKey(attribute))
            {
                tmp = RacialAttributes[attribute];
            }

            if (applyGender && GenderModifier.ContainsKey(attribute))
            {
                tmp += GenderModifier[attribute];
            }

            return(tmp);
        }
Esempio n. 21
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateFixedAttribute
 /// 作者:taixihuase
 /// 作用:变更一条固定属性,含添加、更改及删除操作
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void UpdateFixedAttribute(AttributeCode attribute, float value)
 {
     if (Math.Abs(value) > 0)
     {
         if (FixedAttributes.ContainsKey(attribute))
         {
             FixedAttributes[attribute] = value;
         }
         else
         {
             FixedAttributes.Add(attribute, value);
         }
     }
     else
     {
         RemoveFixedAttribute(attribute);
     }
 }
Esempio n. 22
0
 public bool IncreaseAttribute(AttributeCode attribute)
 {
     if (Profession.MainAttributes.Contains(attribute))
     {
         if (FreeMainAttributePoints <= 0)
         {
             return(false);
         }
         if (LastMainAttributeIncrease == attribute)
         {
             if (MainAttributeIncreaseCount > 1)
             {
                 return(false);
             }
             else
             {
                 MainAttributeIncreaseCount++;
             }
         }
         else
         {
             LastMainAttributeIncrease  = attribute;
             MainAttributeIncreaseCount = 1;
         }
     }
     else
     {
         if (FreeMinorAttributePoints <= 0)
         {
             return(false);
         }
         if (LastMinorAttributeIncrease == attribute)
         {
             return(false);
         }
         else
         {
             LastMinorAttributeIncrease = attribute;
         }
     }
     BaseAttributes[attribute]++;
     UpdateDerivedValues();
     return(true);
 }
Esempio n. 23
0
        public int GetAttribute(AttributeCode attribute)
        {
            int baseValue = 0, raceValue, improvementsValue = 0;

            if (BaseAttributes.ContainsKey(attribute))
            {
                baseValue = BaseAttributes[attribute];
            }
            else if (DerivedAttributes.ContainsKey(attribute))
            {
                baseValue = DerivedAttributes[attribute];
            }
            else
            {
                throw new ArgumentOutOfRangeException("Tried to get nonexistent attribute.");
            }

            raceValue = Race.GetAttribute(attribute, Female && ApplyGender);

            return(baseValue + raceValue + improvementsValue);
        }
Esempio n. 24
0
        public string GetAttributeNote(AttributeCode attribute)
        {
            int baseValue = 0, raceValue = 0, improvementsValue = 0;

            if (BaseAttributes.ContainsKey(attribute))
            {
                baseValue = BaseAttributes[attribute];
            }
            else if (DerivedAttributes.ContainsKey(attribute))
            {
                baseValue = DerivedAttributes[attribute];
            }
            else
            {
                throw new ArgumentOutOfRangeException("Tried to get nonexistent attribute.");
            }

            raceValue = Race.GetAttribute(attribute, Female && ApplyGender);

            return("Rasa(" + raceValue + ") + Úrovně(" + baseValue + ") + Ostatní(" + improvementsValue + ")");
        }
Esempio n. 25
0
 public Profession(AttributeCode combatAttribute, AttributeCode[] mainAttributes)
 {
     _combatAttribute = combatAttribute;
     _mainAttributes  = mainAttributes;
 }
Esempio n. 26
0
 public void Upgrade(AttributeCode attribute = AttributeCode.Null, ValueType value = null)
 {
     UpgradeForgingAttribute(attribute, value);
     UpgradeCurrentLevel();
 }
Esempio n. 27
0
 public TheurgData(AttributeCode combatAttribute, AttributeCode[] mainAttributes, int[,] startSkillTable) : base(combatAttribute, mainAttributes, startSkillTable)
 {
 }
Esempio n. 28
0
 public Theurg(AttributeCode combatAttribute, AttributeCode[] mainAttributes) : base(combatAttribute, mainAttributes)
 {
 }
Esempio n. 29
0
 public IntModifier(ModifyMode mode, AttributeCode attribute, int value)
 {
     m_Attribute = attribute;
     m_Mode      = mode;
     m_Value     = value;
 }
Esempio n. 30
0
 internal IntAttribute(int value, AttributeCode attributeCode)
     : base(attributeCode)
 {
     m_Value = value;
 }
Esempio n. 31
0
 protected override void UpdateForgingAttribute(int level, AttributeCode attribute, ValueType value)
 {
     if (ForgingAttributes.ContainsKey(level) && !attribute.Equals(AttributeCode.Null) &&
                     value != null)
     {
         float f = Convert.ToSingle(value.ToString());
         if (f > 0)
         {
             ForgingAttributes[level] = new KeyValuePair<AttributeCode, float>(attribute, f);
         }
     }
 }
Esempio n. 32
0
 protected override void UpgradeForgingAttribute(AttributeCode attribute, ValueType value)
 {
     if (CurrentLevel < DataConstraint.EquipmentMaxLevel && !attribute.Equals(AttributeCode.Null) && value != null)
     {
         float f = Convert.ToSingle(value.ToString());
         if (f > 0)
         {
             ForgingAttributes[CurrentLevel + 1] = new KeyValuePair<AttributeCode, float>(attribute, f);
         }
     }
 }
Esempio n. 33
0
 public Wizard(AttributeCode combatAttribute, AttributeCode[] mainAttributes) : base(combatAttribute, mainAttributes)
 {
 }
Esempio n. 34
0
 /// <summary>
 /// 类型:方法
 /// 名称:RemoveFixedAttribute
 /// 作者:taixihuase
 /// 作用:移除一条固定属性
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="attribute"></param>
 public void RemoveFixedAttribute(AttributeCode attribute)
 {
     FixedAttributes.Remove(attribute);
 }
Esempio n. 35
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateFixedAttribute
 /// 作者:taixihuase
 /// 作用:变更一条固定属性,含添加、更改及删除操作
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void UpdateFixedAttribute(AttributeCode attribute, float value)
 {
     if (Math.Abs(value) > 0)
     {
         if (FixedAttributes.ContainsKey(attribute))
         {
             FixedAttributes[attribute] = value;
         }
         else
         {
             FixedAttributes.Add(attribute, value);
         }
     }
     else
     {
         RemoveFixedAttribute(attribute);
     }
 }
Esempio n. 36
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateRandomAttribute
 /// 作者:taixihuase
 /// 作用:变更随机属性,含添加、更改及删除操作
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void UpdateRandomAttribute(AttributeCode attribute, float value)
 {
     if (attribute != AttributeCode.Null)
     {
         if (value > 0)
         {
             RandomAttribute = new KeyValuePair<AttributeCode, float>(attribute, value);
         }
     }
     else
     {
         RemoveRandomAttribute();
     }
 }
Esempio n. 37
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateForgingAttribute
 /// 作者:taixihuase
 /// 作用:变更一条锻造属性
 /// 编写日期:2015/8/16
 /// </summary>
 /// <param name="level"></param>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 protected virtual void UpdateForgingAttribute(int level, AttributeCode attribute, ValueType value)
 {
 }
Esempio n. 38
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpgradeForgingAttribute
 /// 作者:taixihuase
 /// 作用:添加一条更高一级锻造等级的锻造属性,只能在调用 UpgradeCurrentLevel 前使用
 /// 编写日期:2015/8/16
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 protected virtual void UpgradeForgingAttribute(AttributeCode attribute, ValueType value)
 {
 }