mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix #907
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Intrinsic.Format;
|
||||
using Snap.Hutao.Model.Metadata.Converter;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using Snap.Hutao.ViewModel.AvatarProperty;
|
||||
@@ -150,8 +151,7 @@ internal sealed class SummaryAvatarFactory
|
||||
}
|
||||
else
|
||||
{
|
||||
// 是否为整数
|
||||
float statValue = subStat.StatValue == MathF.Truncate(subStat.StatValue)
|
||||
float statValue = subStat.AppendPropId.GetFormatMethod() is FormatMethod.Percent
|
||||
? subStat.StatValue / 100F
|
||||
: subStat.StatValue;
|
||||
subProperty = FightPropertyFormat.ToNameDescription(subStat.AppendPropId, statValue);
|
||||
|
||||
@@ -36,8 +36,7 @@ internal sealed class GameRecordCharacterAvatarInfoTransformer : IAvatarInfoTran
|
||||
Flat = new() { ItemType = ItemType.ITEM_RELIQUARY, EquipType = r.Position, },
|
||||
});
|
||||
|
||||
Equip? equipTest = avatarInfo.EquipList.LastOrDefault();
|
||||
if (equipTest?.Weapon is null)
|
||||
if (avatarInfo.EquipList.LastOrDefault() is null or { Weapon: null })
|
||||
{
|
||||
// 不存在武器则添加
|
||||
avatarInfo.EquipList.Add(new());
|
||||
@@ -45,17 +44,21 @@ internal sealed class GameRecordCharacterAvatarInfoTransformer : IAvatarInfoTran
|
||||
|
||||
Equip equip = avatarInfo.EquipList.Last();
|
||||
|
||||
equip.ItemId = source.Weapon.Id;
|
||||
equip.Weapon = new()
|
||||
if (equip.ItemId != source.Weapon.Id)
|
||||
{
|
||||
Level = source.Weapon.Level,
|
||||
AffixMap = new()
|
||||
// 切换了武器
|
||||
equip.ItemId = source.Weapon.Id;
|
||||
equip.Weapon = new()
|
||||
{
|
||||
[100000 + source.Weapon.Id] = source.Weapon.AffixLevel - 1,
|
||||
},
|
||||
};
|
||||
Level = source.Weapon.Level,
|
||||
AffixMap = new()
|
||||
{
|
||||
[100000 + source.Weapon.Id] = source.Weapon.AffixLevel - 1,
|
||||
},
|
||||
};
|
||||
|
||||
// Special case here, don't set EQUIP_WEAPON
|
||||
equip.Flat = new() { ItemType = ItemType.ITEM_WEAPON, };
|
||||
// Special case here, don't set EQUIP_WEAPON
|
||||
equip.Flat = new() { ItemType = ItemType.ITEM_WEAPON, };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user