163 lines
3.3 KiB
C#
163 lines
3.3 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace G
|
|
{
|
|
using System.Collections.Generic;
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
|
|
|
/// <summary>
|
|
/// Generated from: kungfu.xlsx
|
|
/// </summary>
|
|
public partial class ItemKungfu
|
|
{
|
|
#region Field
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private ObscuredInt _grade = 0;
|
|
|
|
/// <summary>
|
|
/// 当前等级
|
|
/// </summary>
|
|
public int grade
|
|
{
|
|
get => _grade;
|
|
set
|
|
{
|
|
if (value > 0 && value <= maxLevel)
|
|
{
|
|
_grade = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 等级上限
|
|
/// </summary>
|
|
public int gradeMax => maxLevel;
|
|
|
|
public bool isMaxGrade
|
|
{
|
|
get { return _grade >= maxLevel; }
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public Item.ItemInfo upgradePrice
|
|
{
|
|
get
|
|
{
|
|
return new Item.ItemInfo
|
|
{
|
|
id = cost[0],
|
|
count = cost[1] + (_grade - 1) * cost[2],
|
|
};
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="results"></param>
|
|
public void GetAttributes(List<CombatAttribute> results)
|
|
{
|
|
int count = initValue.Length / 3;
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
int index = i * 3;
|
|
results.Add(new CombatAttribute
|
|
{
|
|
id = (CombatAttributeId)initValue[index],
|
|
value = _grade > 0 ? initValue[index + 1] + (_grade - 1) * initValue[index + 2] : initValue[index + 1]
|
|
});
|
|
}
|
|
}
|
|
|
|
public void GetNextAttributes(List<CombatAttribute> results)
|
|
{
|
|
int count = initValue.Length / 3;
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
int index = i * 3;
|
|
results.Add(new CombatAttribute
|
|
{
|
|
id = (CombatAttributeId)initValue[index],
|
|
value = _grade > 0 ? initValue[index + 1] + _grade * initValue[index + 2] : initValue[index + 1]
|
|
});
|
|
}
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = this.description;
|
|
var results = F.ListPool<CombatAttribute>.Get();
|
|
GetAttributes(results);
|
|
if (results.Count == 1)
|
|
{
|
|
result = results[0].ToString();
|
|
}
|
|
else if (results.Count == 2)
|
|
{
|
|
result = results[0].ToString() + "\n" + results[1].ToString();
|
|
}
|
|
F.ListPool<CombatAttribute>.Release(results);
|
|
return result;
|
|
}
|
|
|
|
public string ToString2()
|
|
{
|
|
string result = this.description;
|
|
var results = F.ListPool<CombatAttribute>.Get();
|
|
GetAttributes(results);
|
|
if (results.Count == 1)
|
|
{
|
|
var text = results[0].ToString();
|
|
results.Clear();
|
|
GetNextAttributes(results);
|
|
result = text + $"<color=#349652>+{results[0].value}</color>";
|
|
}
|
|
else if (results.Count == 2)
|
|
{
|
|
var text = results[0].ToString();
|
|
var text2 = results[1].ToString();
|
|
results.Clear();
|
|
GetNextAttributes(results);
|
|
result = text + $"<color=#349652>+{results[0].value}</color>" + "\n" +
|
|
text2 + $"<color=#349652>+{results[1].value}";
|
|
}
|
|
F.ListPool<CombatAttribute>.Release(results);
|
|
return result;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
public bool AddGrade()
|
|
{
|
|
if (_grade < maxLevel)
|
|
{
|
|
_grade++;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void Reset()
|
|
{
|
|
_grade = 0;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|