geometry-tower-defense/Assets/GameMain/Scripts/Utility/InventorySeedUtility.cs

179 lines
7.3 KiB
C#

using GeometryTD.Definition;
namespace GeometryTD.CustomUtility
{
public static class InventorySeedUtility
{
public static BackpackInventoryData CreateSampleInventory()
{
BackpackInventoryData inventory = new BackpackInventoryData
{
Gold = 500
};
MuzzleCompItemData muzzle = new MuzzleCompItemData
{
InstanceId = 10001,
ConfigId = 1,
Name = "元素枪口",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Green),
Endurance = 90f,
IsAssembledIntoTower = true,
AttackDamage = new[] { 200, 300, 400, 500, 800 },
DamageRandomRate = 0.05f,
AttackMethodType = AttackMethodType.NormalBullet,
Constraint = string.Empty,
Tags = new[] { TagType.Fire }
};
BearingCompItemData bearing = new BearingCompItemData
{
InstanceId = 20001,
ConfigId = 1,
Name = "元素轴承",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Green),
Endurance = 1f,
IsAssembledIntoTower = true,
RotateSpeed = new[] { 100f, 120f, 130f, 140f, 150f },
AttackRange = new[] { 3f, 4f, 5f, 6f, 8f },
Constraint = string.Empty,
Tags = new[] { TagType.Fire }
};
BaseCompItemData baseComp = new BaseCompItemData
{
InstanceId = 30001,
ConfigId = 1,
Name = "元素底座",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Green),
Endurance = 88f,
IsAssembledIntoTower = true,
AttackSpeed = new[] { 1f, 2f, 3f, 3.5f, 0.7f },
AttackPropertyType = AttackPropertyType.Fire,
Constraint = string.Empty,
Tags = new[] { TagType.Fire }
};
TowerItemData tower = new TowerItemData
{
InstanceId = 90001,
Name = "测试防御塔-A",
Rarity = InventoryRarityRuleService.ResolveTowerRarity(
muzzle.Rarity,
bearing.Rarity,
baseComp.Rarity),
IsParticipatingInCombat = true,
MuzzleComponentInstanceId = muzzle.InstanceId,
BearingComponentInstanceId = bearing.InstanceId,
BaseComponentInstanceId = baseComp.InstanceId,
Stats = new TowerStatsData
{
AttackDamage = new[] { 200, 220, 240, 260, 300 },
DamageRandomRate = 0f,
RotateSpeed = new[] { 200f, 210f, 220f, 230f, 240f },
AttackRange = new[] { 4.5f, 4.5f, 4.5f, 4.5f, 4.5f },
AttackSpeed = new[] { 1.0f, 1.2f, 1.3f, 1.4f, 0.5f },
AttackMethodType = AttackMethodType.NormalBullet,
AttackPropertyType = AttackPropertyType.Fire,
Tags = new[] { TagType.Fire, TagType.BurnSpread }
}
};
inventory.MuzzleComponents.Add(muzzle);
inventory.BaseComponents.Add(baseComp);
inventory.BearingComponents.Add(bearing);
inventory.Towers.Add(tower);
inventory.MuzzleComponents.Add(new MuzzleCompItemData
{
InstanceId = 10002,
ConfigId = 2,
Name = "控制枪口",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Blue),
Endurance = 80,
IsAssembledIntoTower = false,
AttackDamage = new[] { 200, 300, 400, 500, 600 },
DamageRandomRate = 0.01f,
AttackMethodType = AttackMethodType.NormalBullet,
Constraint = string.Empty,
Tags = new[] { TagType.Ice, TagType.FreezeMask }
});
inventory.MuzzleComponents.Add(new MuzzleCompItemData
{
InstanceId = 10003,
ConfigId = 3,
Name = "穿透枪口",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Purple),
Endurance = 97f,
IsAssembledIntoTower = false,
AttackDamage = new[] { 50, 55, 60, 80, 90 },
DamageRandomRate = 0.02f,
AttackMethodType = AttackMethodType.NormalBullet,
Constraint = string.Empty,
Tags = new[] { TagType.Pierce, TagType.Crit }
});
inventory.BearingComponents.Add(new BearingCompItemData
{
InstanceId = 20002,
ConfigId = 2,
Name = "控制轴承",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Blue),
Endurance = 20,
IsAssembledIntoTower = false,
RotateSpeed = new[] { 200f, 250f, 300f, 320f, 350f },
AttackRange = new[] { 6f, 6.5f, 7f, 8f, 8f },
Constraint = string.Empty,
Tags = new[] { TagType.Ice, TagType.Shatter }
});
inventory.BearingComponents.Add(new BearingCompItemData
{
InstanceId = 20003,
ConfigId = 3,
Name = "穿透轴承",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Purple),
Endurance = 96f,
IsAssembledIntoTower = false,
RotateSpeed = new[] { 60f, 70f, 80f, 90f, 100f },
AttackRange = new[] { 4f, 4.5f, 5f, 5.5f, 6f },
Constraint = string.Empty,
Tags = new[] { TagType.Pierce, TagType.Overpenetrate }
});
inventory.BaseComponents.Add(new BaseCompItemData
{
InstanceId = 30002,
ConfigId = 2,
Name = "控制底座",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Blue),
Endurance = 50f,
IsAssembledIntoTower = false,
AttackSpeed = new[] { 4f, 4.2f, 4.4f, 4.6f, 4.8f },
AttackPropertyType = AttackPropertyType.Ice,
Constraint = string.Empty,
Tags = new[] { TagType.Ice, TagType.AbsoluteZero }
});
inventory.BaseComponents.Add(new BaseCompItemData
{
InstanceId = 30003,
ConfigId = 3,
Name = "穿透底座",
Rarity = InventoryRarityRuleService.NormalizeComponentRarity(RarityType.Purple),
Endurance = 30f,
IsAssembledIntoTower = false,
AttackSpeed = new[] { 1f, 1f, 1f, 1f, 1f },
AttackPropertyType = AttackPropertyType.Physics,
Constraint = string.Empty,
Tags = new[] { TagType.Pierce, TagType.Execution }
});
inventory.ParticipantTowerInstanceIds.Add(90001);
return inventory;
}
}
}