mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2026-01-19 14:08:22 +00:00
添加预制实体
This commit is contained in:
parent
b11db3364a
commit
7878b1ec60
@ -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;
|
||||
|
||||
13
Model/AttributeBoost.cs
Normal file
13
Model/AttributeBoost.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Milimoe.FunGame.Core.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 核心属性增强结构
|
||||
/// </summary>
|
||||
public readonly struct AttributeBoost(PrimaryAttribute pa, double value)
|
||||
{
|
||||
public PrimaryAttribute PrimaryAttribute => pa;
|
||||
public double Value => value;
|
||||
}
|
||||
}
|
||||
@ -882,7 +882,7 @@ namespace Milimoe.FunGame.Core.Model
|
||||
bool decided = false;
|
||||
// 最大取消次数
|
||||
int cancelTimes = 3;
|
||||
// 此变量控制角色移动后可以继续选择其他的行动
|
||||
// 此变量指示角色是否移动
|
||||
bool moved = false;
|
||||
|
||||
// AI 决策控制器,适用于启用战棋地图的情况
|
||||
|
||||
12
Model/PrefabricatedEntity/CourageCommandSkill.cs
Normal file
12
Model/PrefabricatedEntity/CourageCommandSkill.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
|
||||
namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 继承此类以表示勇气指令技能
|
||||
/// </summary>
|
||||
public class CourageCommandSkill : Skill
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
121
Model/PrefabricatedEntity/MagicCardPack.cs
Normal file
121
Model/PrefabricatedEntity/MagicCardPack.cs
Normal file
@ -0,0 +1,121 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 魔法卡包的基础实现
|
||||
/// </summary>
|
||||
public class MagicCardPack : Item
|
||||
{
|
||||
public override ItemType ItemType => ItemType.MagicCardPack;
|
||||
|
||||
/// <summary>
|
||||
/// 魔法技能组
|
||||
/// </summary>
|
||||
public HashSet<Skill> Magics => Skills.Magics;
|
||||
|
||||
/// <summary>
|
||||
/// 属性增强:增加角色额外核心属性
|
||||
/// </summary>
|
||||
public HashSet<AttributeBoost> AttributeBoosts { get; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 同频共振:强制转换角色的核心属性为该属性 [ 优先级:仅在装备时改变,覆盖该时刻的核心属性,后续可被其他物品/技能覆盖 ]
|
||||
/// </summary>
|
||||
public PrimaryAttribute Resonance { get; set; } = PrimaryAttribute.None;
|
||||
|
||||
/// <summary>
|
||||
/// 神经校准:角色在使用某种武器时获得额外特效
|
||||
/// </summary>
|
||||
public NeuralCalibrationEffect? NeuralCalibration { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// 勇气指令:行动回合内的附赠指令技能(使用后不会结束回合)
|
||||
/// </summary>
|
||||
public CourageCommandSkill? CourageCommand { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// 灵魂绑定:一个至少消耗 100 能量、每额外消耗 20 能量效果增强 10% 的爆发技
|
||||
/// </summary>
|
||||
public SoulboundSkill? Soulbound { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// 备份同频共振前的核心属性类型
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Model/PrefabricatedEntity/NeuralCalibrationEffect.cs
Normal file
13
Model/PrefabricatedEntity/NeuralCalibrationEffect.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 继承此类以表示神经校准特效
|
||||
/// </summary>
|
||||
public class NeuralCalibrationEffect : Effect
|
||||
{
|
||||
public WeaponType SupportedWeaponType { get; set; } = WeaponType.None;
|
||||
}
|
||||
}
|
||||
18
Model/PrefabricatedEntity/SoulboundSkill.cs
Normal file
18
Model/PrefabricatedEntity/SoulboundSkill.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
|
||||
namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 继承此类以表示灵魂绑定技能
|
||||
/// </summary>
|
||||
public class SoulboundSkill : Skill
|
||||
{
|
||||
public override bool CostAllEP => true;
|
||||
public override double MinCostEP => 100;
|
||||
|
||||
/// <summary>
|
||||
/// 每额外消耗 20 能量效果增强 10%
|
||||
/// </summary>
|
||||
public virtual double Improvement => (LastCostEP - MinCostEP) / 20 * 0.1;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user