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
2c14e7fdd2
commit
82d8f927fe
@ -5,7 +5,7 @@ namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 继承此类以表示勇气指令技能
|
/// 继承此类以表示勇气指令技能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CourageCommandSkill : Skill
|
public class CourageCommandSkill(long id, string name, Dictionary<string, object> args, Character? character = null) : OpenSkill(id, name, args, character)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 魔法卡包的基础实现
|
/// 魔法卡包的基础实现
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MagicCardPack : Item
|
public class MagicCardPack : OpenItem
|
||||||
{
|
{
|
||||||
public override ItemType ItemType => ItemType.MagicCardPack;
|
public override ItemType ItemType => ItemType.MagicCardPack;
|
||||||
|
|
||||||
@ -16,9 +16,14 @@ namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
|||||||
public HashSet<Skill> Magics => Skills.Magics;
|
public HashSet<Skill> Magics => Skills.Magics;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 属性增强:增加角色额外核心属性
|
/// 动态矩阵:增加角色额外核心属性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HashSet<AttributeBoost> AttributeBoosts { get; } = [];
|
public Dictionary<PrimaryAttribute, double> AttributeBoosts { get; } = new()
|
||||||
|
{
|
||||||
|
{ PrimaryAttribute.STR, 0 },
|
||||||
|
{ PrimaryAttribute.AGI, 0 },
|
||||||
|
{ PrimaryAttribute.INT, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同频共振:强制转换角色的核心属性为该属性 [ 优先级:仅在装备时改变,覆盖该时刻的核心属性,后续可被其他物品/技能覆盖 ]
|
/// 同频共振:强制转换角色的核心属性为该属性 [ 优先级:仅在装备时改变,覆盖该时刻的核心属性,后续可被其他物品/技能覆盖 ]
|
||||||
@ -45,23 +50,46 @@ namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private PrimaryAttribute _originalAttribute = PrimaryAttribute.None;
|
private PrimaryAttribute _originalAttribute = PrimaryAttribute.None;
|
||||||
|
|
||||||
|
public MagicCardPack(long id, string name, Dictionary<string, object> args) : base(id, name, args)
|
||||||
|
{
|
||||||
|
foreach (string key in args.Keys)
|
||||||
|
{
|
||||||
|
switch (key.ToLower())
|
||||||
|
{
|
||||||
|
case "exstr":
|
||||||
|
if (double.TryParse(args[key].ToString(), out double strValue))
|
||||||
|
{
|
||||||
|
AttributeBoosts[PrimaryAttribute.STR] = strValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "exagi":
|
||||||
|
if (double.TryParse(args[key].ToString(), out double agiValue))
|
||||||
|
{
|
||||||
|
AttributeBoosts[PrimaryAttribute.AGI] = agiValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "exint":
|
||||||
|
if (double.TryParse(args[key].ToString(), out double intValue))
|
||||||
|
{
|
||||||
|
AttributeBoosts[PrimaryAttribute.INT] = intValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "res":
|
||||||
|
case "resonance":
|
||||||
|
if (Enum.TryParse(args[key].ToString(), out PrimaryAttribute resonance))
|
||||||
|
{
|
||||||
|
Resonance = resonance;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnItemEquipped(Character character, EquipSlotType type)
|
protected override void OnItemEquipped(Character character, EquipSlotType type)
|
||||||
{
|
{
|
||||||
foreach (AttributeBoost ab in AttributeBoosts)
|
character.ExSTR += AttributeBoosts[PrimaryAttribute.STR];
|
||||||
{
|
character.ExAGI += AttributeBoosts[PrimaryAttribute.AGI];
|
||||||
switch (ab.PrimaryAttribute)
|
character.ExINT += AttributeBoosts[PrimaryAttribute.INT];
|
||||||
{
|
|
||||||
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)
|
if (Resonance != PrimaryAttribute.None)
|
||||||
{
|
{
|
||||||
_originalAttribute = character.PrimaryAttribute;
|
_originalAttribute = character.PrimaryAttribute;
|
||||||
@ -84,21 +112,9 @@ namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
|||||||
|
|
||||||
protected override void OnItemUnEquipped(Character character, EquipSlotType type)
|
protected override void OnItemUnEquipped(Character character, EquipSlotType type)
|
||||||
{
|
{
|
||||||
foreach (AttributeBoost ab in AttributeBoosts)
|
character.ExSTR -= AttributeBoosts[PrimaryAttribute.STR];
|
||||||
{
|
character.ExAGI -= AttributeBoosts[PrimaryAttribute.AGI];
|
||||||
switch (ab.PrimaryAttribute)
|
character.ExINT -= AttributeBoosts[PrimaryAttribute.INT];
|
||||||
{
|
|
||||||
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)
|
if (_originalAttribute != PrimaryAttribute.None)
|
||||||
{
|
{
|
||||||
character.PrimaryAttribute = _originalAttribute;
|
character.PrimaryAttribute = _originalAttribute;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace Milimoe.FunGame.Core.Model.PrefabricatedEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 继承此类以表示灵魂绑定技能
|
/// 继承此类以表示灵魂绑定技能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SoulboundSkill : Skill
|
public class SoulboundSkill(long id, string name, Dictionary<string, object> args, Character? character = null) : OpenSkill(id, name, args, character)
|
||||||
{
|
{
|
||||||
public override bool CostAllEP => true;
|
public override bool CostAllEP => true;
|
||||||
public override double MinCostEP => 100;
|
public override double MinCostEP => 100;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user