diff --git a/Entity/Statistics/CharacterStatistics.cs b/Entity/Statistics/CharacterStatistics.cs index 2334b86..c23f67e 100644 --- a/Entity/Statistics/CharacterStatistics.cs +++ b/Entity/Statistics/CharacterStatistics.cs @@ -44,8 +44,8 @@ public int Wins { get; set; } = 0; public int Top3s { get; set; } = 0; public int Loses { get; set; } = 0; - public double Winrates { get; set; } = 0; - public double Top3rates { get; set; } = 0; + public double Winrate { get; set; } = 0; + public double Top3rate { get; set; } = 0; public int LastRank { get; set; } = 0; public double AvgRank { get; set; } = 0; public double Rating { get; set; } = 0; diff --git a/Model/AttributeBoost.cs b/Model/AttributeBoost.cs new file mode 100644 index 0000000..8df6ad2 --- /dev/null +++ b/Model/AttributeBoost.cs @@ -0,0 +1,13 @@ +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Core.Model +{ + /// + /// 核心属性增强结构 + /// + public readonly struct AttributeBoost(PrimaryAttribute pa, double value) + { + public PrimaryAttribute PrimaryAttribute => pa; + public double Value => value; + } +} diff --git a/Model/GamingQueue.cs b/Model/GamingQueue.cs index 8d78495..c401c98 100644 --- a/Model/GamingQueue.cs +++ b/Model/GamingQueue.cs @@ -882,7 +882,7 @@ namespace Milimoe.FunGame.Core.Model bool decided = false; // 最大取消次数 int cancelTimes = 3; - // 此变量控制角色移动后可以继续选择其他的行动 + // 此变量指示角色是否移动 bool moved = false; // AI 决策控制器,适用于启用战棋地图的情况 diff --git a/Model/PrefabricatedEntity/CourageCommandSkill.cs b/Model/PrefabricatedEntity/CourageCommandSkill.cs new file mode 100644 index 0000000..aa2bd95 --- /dev/null +++ b/Model/PrefabricatedEntity/CourageCommandSkill.cs @@ -0,0 +1,12 @@ +using Milimoe.FunGame.Core.Entity; + +namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity +{ + /// + /// 继承此类以表示勇气指令技能 + /// + public class CourageCommandSkill : Skill + { + + } +} diff --git a/Model/PrefabricatedEntity/MagicCardPack.cs b/Model/PrefabricatedEntity/MagicCardPack.cs new file mode 100644 index 0000000..b63ea2f --- /dev/null +++ b/Model/PrefabricatedEntity/MagicCardPack.cs @@ -0,0 +1,121 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity +{ + /// + /// 魔法卡包的基础实现 + /// + public class MagicCardPack : Item + { + public override ItemType ItemType => ItemType.MagicCardPack; + + /// + /// 魔法技能组 + /// + public HashSet Magics => Skills.Magics; + + /// + /// 属性增强:增加角色额外核心属性 + /// + public HashSet AttributeBoosts { get; } = []; + + /// + /// 同频共振:强制转换角色的核心属性为该属性 [ 优先级:仅在装备时改变,覆盖该时刻的核心属性,后续可被其他物品/技能覆盖 ] + /// + public PrimaryAttribute Resonance { get; set; } = PrimaryAttribute.None; + + /// + /// 神经校准:角色在使用某种武器时获得额外特效 + /// + public NeuralCalibrationEffect? NeuralCalibration { get; set; } = null; + + /// + /// 勇气指令:行动回合内的附赠指令技能(使用后不会结束回合) + /// + public CourageCommandSkill? CourageCommand { get; set; } = null; + + /// + /// 灵魂绑定:一个至少消耗 100 能量、每额外消耗 20 能量效果增强 10% 的爆发技 + /// + public SoulboundSkill? Soulbound { get; set; } = null; + + /// + /// 备份同频共振前的核心属性类型 + /// + private PrimaryAttribute _originalAttribute = PrimaryAttribute.None; + + protected override void OnItemEquipped(Character character, EquipSlotType type) + { + foreach (AttributeBoost ab in AttributeBoosts) + { + switch (ab.PrimaryAttribute) + { + case PrimaryAttribute.AGI: + character.ExAGI += ab.Value; + break; + case PrimaryAttribute.INT: + character.ExINT += ab.Value; + break; + default: + character.ExSTR += ab.Value; + break; + } + } + if (Resonance != PrimaryAttribute.None) + { + _originalAttribute = character.PrimaryAttribute; + character.PrimaryAttribute = Resonance; + } + if (NeuralCalibration != null) + { + character.Effects.Add(NeuralCalibration); + NeuralCalibration.OnEffectGained(character); + } + if (CourageCommand != null) + { + character.Skills.Add(CourageCommand); + } + if (Soulbound != null) + { + character.Skills.Add(Soulbound); + } + } + + protected override void OnItemUnEquipped(Character character, EquipSlotType type) + { + foreach (AttributeBoost ab in AttributeBoosts) + { + switch (ab.PrimaryAttribute) + { + case PrimaryAttribute.AGI: + character.ExAGI -= ab.Value; + break; + case PrimaryAttribute.INT: + character.ExINT -= ab.Value; + break; + default: + character.ExSTR -= ab.Value; + break; + } + } + if (_originalAttribute != PrimaryAttribute.None) + { + character.PrimaryAttribute = _originalAttribute; + } + if (NeuralCalibration != null) + { + character.Effects.Remove(NeuralCalibration); + NeuralCalibration.OnEffectLost(character); + } + if (CourageCommand != null) + { + character.Skills.Remove(CourageCommand); + } + if (Soulbound != null) + { + character.Skills.Remove(Soulbound); + } + } + } +} diff --git a/Model/PrefabricatedEntity/NeuralCalibrationEffect.cs b/Model/PrefabricatedEntity/NeuralCalibrationEffect.cs new file mode 100644 index 0000000..d238f12 --- /dev/null +++ b/Model/PrefabricatedEntity/NeuralCalibrationEffect.cs @@ -0,0 +1,13 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity +{ + /// + /// 继承此类以表示神经校准特效 + /// + public class NeuralCalibrationEffect : Effect + { + public WeaponType SupportedWeaponType { get; set; } = WeaponType.None; + } +} diff --git a/Model/PrefabricatedEntity/SoulboundSkill.cs b/Model/PrefabricatedEntity/SoulboundSkill.cs new file mode 100644 index 0000000..d5cc0dc --- /dev/null +++ b/Model/PrefabricatedEntity/SoulboundSkill.cs @@ -0,0 +1,18 @@ +using Milimoe.FunGame.Core.Entity; + +namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity +{ + /// + /// 继承此类以表示灵魂绑定技能 + /// + public class SoulboundSkill : Skill + { + public override bool CostAllEP => true; + public override double MinCostEP => 100; + + /// + /// 每额外消耗 20 能量效果增强 10% + /// + public virtual double Improvement => (LastCostEP - MinCostEP) / 20 * 0.1; + } +}