加入武器 tag 的羁绊效果
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using SepCore.Event;
|
||||
using SepCore.Definition;
|
||||
@@ -192,10 +193,36 @@ namespace SepCore.UI
|
||||
ItemType = ItemType.Weapon,
|
||||
Price = _useCase.CalculateRecyclePrice(weapon.WeaponData.Price),
|
||||
OnRecycle = RecycleWeapon,
|
||||
LastWaveDamage = weapon.WeaponData.LastWaveDamage,
|
||||
CurrentTagCounts = GetEquippedTagCounts(),
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
private Dictionary<WeaponTag, int> GetEquippedTagCounts()
|
||||
{
|
||||
Dictionary<WeaponTag, int> counts = new Dictionary<WeaponTag, int>();
|
||||
if (_rawData?.WeaponItems != null)
|
||||
{
|
||||
for (int i = 0; i < _rawData.WeaponItems.Count; i++)
|
||||
{
|
||||
WeaponBase w = _rawData.WeaponItems[i];
|
||||
if (w?.WeaponData?.Tags != null)
|
||||
{
|
||||
for (int t = 0; t < w.WeaponData.Tags.Count; t++)
|
||||
{
|
||||
WeaponTag tag = w.WeaponData.Tags[t];
|
||||
if (tag != WeaponTag.None)
|
||||
{
|
||||
counts[tag] = counts.GetValueOrDefault(tag, 0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return counts;
|
||||
}
|
||||
|
||||
private bool TryGetPropInfoRawData(int index, Vector3 targetPos, out ItemTooltipRawData rawData)
|
||||
{
|
||||
rawData = null;
|
||||
|
||||
Reference in New Issue
Block a user