示例#1
0
    /// <summary>
    /// This method gets all the attribute value from the WearableItem.
    /// </summary>
    /// <returns>All the attribute value, of type string</returns>
    public override string GetAttributeDescription()
    {
        _description = ""; // Removing previous values

        // Loop for adding all the stat description
        for (int i = 0; i < Stats.Length; i++)
        {
            // Condition to add attack stat
            if (Stats[i].Stat == StatType.Attack)
            {
                _description += Stats[i].GetStatName() + ": "
                                + (Stats[i].StatAmount + GetAttack()).ToString()
                                + " (+" + AttackOffset.ToString() + ")";
            }
            // Condition to add defense stat
            else if (Stats[i].Stat == StatType.Defense)
            {
                _description += Stats[i].GetStatName() + ": "
                                + (Stats[i].StatAmount + GetDefense()).ToString()
                                + " (+" + DefenseOffset.ToString() + ")";
            }
            // Condition to add health stat
            else if (Stats[i].Stat == StatType.Health)
            {
                _description += Stats[i].GetStatName() + ": "
                                + (Stats[i].StatAmount + GetHealth()).ToString()
                                + " (+" + HealthOffset.ToString() + ")";
            }

            // Checking if the stat is not the last stat
            // and adding a next line to it
            if (i != Stats.Length - 1)
            {
                _description += "\n";
            }
        }

        return(_description);
    }
示例#2
0
 /// <summary>
 /// This method gets the attack attribute value from the WeaponItem
 /// </summary>
 /// <returns>The attack attribute value, of type string</returns>
 public override string GetAttributeDescription()
 {
     return("Damage: +" + (DamageMax + GetAttack()).ToString()
            + " (+" + AttackOffset.ToString() + ")");
 }