117 lines
4.4 KiB
C#
117 lines
4.4 KiB
C#
using GeometryTD.Definition;
|
|
|
|
namespace GeometryTD.UI
|
|
{
|
|
public class RepoFormUseCase : IUIUseCase
|
|
{
|
|
public RepoFormRawData CreateInitialModel()
|
|
{
|
|
BackpackInventoryData sample = GameEntry.PlayerInventory != null
|
|
? GameEntry.PlayerInventory.GetInventorySnapshot()
|
|
: SampleInventory();
|
|
return new RepoFormRawData
|
|
{
|
|
Inventory = sample
|
|
};
|
|
}
|
|
|
|
public static BackpackInventoryData SampleInventory()
|
|
{
|
|
BackpackInventoryData inventory = new BackpackInventoryData
|
|
{
|
|
Gold = 500
|
|
};
|
|
|
|
MuzzleCompItemData muzzle = new MuzzleCompItemData
|
|
{
|
|
InstanceId = 10001,
|
|
ConfigId = 1,
|
|
Name = "元素枪口",
|
|
Rarity = RarityType.Green,
|
|
Endurance = 90f,
|
|
AttackDamage = new[] { 20, 30, 40, 50, 80 },
|
|
DamageRandomRate = 0.05f,
|
|
AttackMethodType = AttackMethodType.NormalBullet,
|
|
Constraint = string.Empty,
|
|
Tags = new[] { TagType.Fire }
|
|
};
|
|
inventory.MuzzleComponents.Add(muzzle);
|
|
|
|
BearingCompItemData bearing = new BearingCompItemData
|
|
{
|
|
InstanceId = 20001,
|
|
ConfigId = 1,
|
|
Name = "元素轴承",
|
|
Rarity = RarityType.Green,
|
|
Endurance = 95f,
|
|
RotateSpeed = new[] { 10f, 12f, 13f, 14f, 15f },
|
|
AttackRange = new[] { 2f, 2f, 2f, 2f, 2f },
|
|
Constraint = string.Empty,
|
|
Tags = new[] { TagType.Fire }
|
|
};
|
|
inventory.BearingComponents.Add(bearing);
|
|
|
|
BaseCompItemData baseComp = new BaseCompItemData
|
|
{
|
|
InstanceId = 30001,
|
|
ConfigId = 1,
|
|
Name = "元素底座",
|
|
Rarity = RarityType.Green,
|
|
Endurance = 88f,
|
|
AttackSpeed = new[] { 2f, 1.5f, 1f, 0.8f, 0.7f },
|
|
AttackPropertyType = AttackPropertyType.Fire,
|
|
Constraint = string.Empty,
|
|
Tags = new[] { TagType.Fire }
|
|
};
|
|
inventory.BaseComponents.Add(baseComp);
|
|
|
|
DefenseTowerItemData tower = new DefenseTowerItemData
|
|
{
|
|
InstanceId = 90001,
|
|
Name = "测试防御塔-A",
|
|
Rarity = RarityType.Green,
|
|
Endurance = 92f,
|
|
MuzzleComponentInstanceId = muzzle.InstanceId,
|
|
BearingComponentInstanceId = bearing.InstanceId,
|
|
BaseComponentInstanceId = baseComp.InstanceId,
|
|
Stats = new DefenseTowerStatsData
|
|
{
|
|
AttackDamage = new[] { 200, 220, 240, 260, 300 },
|
|
DamageRandomRate = new[] { 0f, 0f, 0f, 0f, 0f },
|
|
RotateSpeed = new[] { 200f, 210f, 220f, 230f, 240f },
|
|
AttackRange = new[] { 4.5f, 4.7f, 4.9f, 5.1f, 5.3f },
|
|
AttackSpeed = new[] { 1.5f, 1.2f, 1.1f, 1.0f, 0.8f },
|
|
AttackMethodType = AttackMethodType.NormalBullet,
|
|
AttackPropertyType = AttackPropertyType.Fire,
|
|
Tags = new[] { TagType.Fire, TagType.BurnSpread }
|
|
}
|
|
};
|
|
inventory.Towers.Add(tower);
|
|
|
|
inventory.Towers.Add(new DefenseTowerItemData
|
|
{
|
|
InstanceId = 90002,
|
|
Name = "测试防御塔-B",
|
|
Rarity = RarityType.Blue,
|
|
Endurance = 100f,
|
|
MuzzleComponentInstanceId = 0,
|
|
BearingComponentInstanceId = 0,
|
|
BaseComponentInstanceId = 0,
|
|
Stats = new DefenseTowerStatsData
|
|
{
|
|
AttackDamage = new[] { 200, 220, 240, 260, 300 },
|
|
DamageRandomRate = new[] { 0f, 0f, 0f, 0f, 0f },
|
|
RotateSpeed = new[] { 200f, 210f, 220f, 230f, 240f },
|
|
AttackRange = new[] { 4.5f, 4.7f, 4.9f, 5.1f, 5.3f },
|
|
AttackSpeed = new[] { 1.5f, 1.2f, 1.1f, 1.0f, 0.8f },
|
|
AttackMethodType = AttackMethodType.NormalBullet,
|
|
AttackPropertyType = AttackPropertyType.Physics,
|
|
Tags = new[] { TagType.Pierce }
|
|
}
|
|
});
|
|
|
|
return inventory;
|
|
}
|
|
}
|
|
}
|