更新
This commit is contained in:
8
Assets/Mods/Basic/Cards/Scripts/Knight/Attack.meta
Normal file
8
Assets/Mods/Basic/Cards/Scripts/Knight/Attack.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ce195eeec97d4e4fad7f9aa9c6c376c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
131
Assets/Mods/Basic/Cards/Scripts/Knight/Attack/DivineSmite.cs
Normal file
131
Assets/Mods/Basic/Cards/Scripts/Knight/Attack/DivineSmite.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 至圣斩(DivineSmite):
|
||||
/// 造成物理伤害和多段光属性魔法伤害,光伤害段数等于连续打出该牌的次数,最后施加致盲Buff。
|
||||
/// </summary>
|
||||
public class DivineSmite : CardLogicBase
|
||||
{
|
||||
// 游戏字典里定义的伤害及Buff参数键值点
|
||||
private const string DAMAGE_PHYSICS = "Damage_Physics";
|
||||
private const string DAMAGE_LIGHT = "Damage_Light";
|
||||
private const string BUFF_BLIND_COUNT = "Buff_Blind_Count";
|
||||
|
||||
/// <summary>
|
||||
/// 物理伤害的上下文属性通道
|
||||
/// </summary>
|
||||
private AttackContext PhysicsCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Physics")
|
||||
.WithBaseDamageAttribute(DAMAGE_PHYSICS);
|
||||
|
||||
/// <summary>
|
||||
/// 光属性魔法伤害的上下文属性通道
|
||||
/// </summary>
|
||||
private AttackContext LightCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Light")
|
||||
.WithBaseDamageAttribute(DAMAGE_LIGHT);
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选中目标时,预览最终会造成的伤害数值和攻击段数
|
||||
/// </summary>
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
card.SetAttribute("Display_Damage_Physics", GetTargetedFinalDamage(target, PhysicsCtx));
|
||||
card.SetAttribute("Display_Damage_Light", GetTargetedFinalDamage(target, LightCtx));
|
||||
|
||||
// 为界面显示专门设定一个动态的“光属性连击次数”属性
|
||||
int lightTimes = GetConsecutiveDivineSmiteCount();
|
||||
card.SetAttribute("Hit_Count_Light", lightTimes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 没有目标、或者取消选中时的默认面板预期伤害
|
||||
/// </summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute("Display_Damage_Physics", GetNoTargetFinalDamage(PhysicsCtx));
|
||||
card.SetAttribute("Display_Damage_Light", GetNoTargetFinalDamage(LightCtx));
|
||||
|
||||
int lightTimes = GetConsecutiveDivineSmiteCount();
|
||||
card.SetAttribute("Hit_Count_Light", lightTimes);
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
// 通过过往卡牌出牌记录找到需要触发多少次光属性攻击
|
||||
int lightTimes = GetConsecutiveDivineSmiteCount();
|
||||
|
||||
return ForEachTarget(targetList, target => Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
// 1. 触发一段基础物理伤害
|
||||
AttackContext physCtx = PhysicsCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, physCtx), physCtx);
|
||||
|
||||
// 2. 根据连续使用的次数,循环触发光属性魔法追击
|
||||
AttackContext lightCtx = LightCtx;
|
||||
for (int i = 0; i < lightTimes; i++)
|
||||
{
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, lightCtx), lightCtx);
|
||||
}
|
||||
|
||||
// 3. 结算后对目标挂载致盲 (Blind) 状态
|
||||
int blindStacks = GetAttribute(BUFF_BLIND_COUNT);
|
||||
CreateCharacterBuff<Blind>(blindStacks).Apply(target, user, this);
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
// 在卡牌数据更新层对物理伤害与默认(光属性)伤害渠道做双重初始化
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics(DAMAGE_PHYSICS);
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Default(DAMAGE_LIGHT);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从历史行动记录中寻找过往连续出过的本牌数量,用于充能和统计光爆次数。
|
||||
/// </summary>
|
||||
private int GetConsecutiveDivineSmiteCount()
|
||||
{
|
||||
if (user.recordSubmodule == null || user.recordSubmodule.actionRecords == null) return 1;
|
||||
|
||||
int count = 1; // 包含当前准备打出的这一张本身
|
||||
int cardsSeen = 0;
|
||||
for (int i = user.recordSubmodule.actionRecords.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var record = user.recordSubmodule.actionRecords[i];
|
||||
for (int j = record.cardsPlayed.Count - 1; j >= 0; j--)
|
||||
{
|
||||
if (cardsSeen > 0)
|
||||
{
|
||||
if (record.cardsPlayed[j].cardLogic is DivineSmite)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return count;
|
||||
}
|
||||
}
|
||||
cardsSeen++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 挑衅打击:对单体敌人造成物理伤害并挑衅目标。
|
||||
/// 挑衅使自身获得嘲讽状态,迫使非全体攻击的敌方只能选择自己作为目标。
|
||||
/// </summary>
|
||||
public class ProvokeStrike : CardLogicBase
|
||||
{
|
||||
private const string BUFF_PROVOKING_COUNT = "Buff_Provoking_Count";
|
||||
|
||||
private AttackContext PhysicsCtx => AttackContext.Default(card).WithDamageKeywords(CardKeywords.Physics);
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
AddLogicComponent<CardLogicComponent_Provoke>();
|
||||
}
|
||||
|
||||
/// <summary>选中目标时更新伤害预览。</summary>
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, PhysicsCtx));
|
||||
}
|
||||
|
||||
/// <summary>取消选中时以无目标模式刷新预览。</summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(PhysicsCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
AttackContext ctx = PhysicsCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
||||
|
||||
LogicComponent<CardLogicComponent_Provoke>().GenerateProvocation(user, target, GetAttribute(BUFF_PROVOKING_COUNT));
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54d80de644c3c024bbeb2e13190298ad
|
||||
75
Assets/Mods/Basic/Cards/Scripts/Knight/Attack/ShieldSlam.cs
Normal file
75
Assets/Mods/Basic/Cards/Scripts/Knight/Attack/ShieldSlam.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 盾牌猛击(ShieldSlam):
|
||||
/// 对单体造成等同于当前格挡值的物理伤害,并消耗自身一半的格挡。
|
||||
/// </summary>
|
||||
public class ShieldSlam : CardLogicBase
|
||||
{
|
||||
private AttackContext PhysicsCtx => AttackContext.Default(card).WithDamageKeywords("Physics");
|
||||
private float Block => user?.GetAttribute("Block") ?? 0;
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
if (user != null) card.SetAttribute("Damage", Block);
|
||||
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, PhysicsCtx));
|
||||
}
|
||||
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
if (user != null) card.SetAttribute("Damage", Block);
|
||||
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(PhysicsCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = new CommandGroup();
|
||||
|
||||
mainGroup.AddCommand(ForEachTarget(targetList, target => Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
// 在造成伤害前,强制按当前的 Block 更新一下基础伤害,避免状态延迟带来的数值偏差
|
||||
if (user != null) card.SetAttribute("Damage", Block);
|
||||
|
||||
AttackContext physCtx = PhysicsCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, physCtx), physCtx);
|
||||
})
|
||||
)));
|
||||
|
||||
// 格挡削减放置于 ForEachTarget 循环之外,保证无论造成几次伤害、目标有几个,消耗仅仅执行一次
|
||||
mainGroup.AddCommand(Cmd.Do(() =>
|
||||
{
|
||||
if (user != null && Block > 0)
|
||||
{
|
||||
int blockToConsume = Mathf.FloorToInt(Block / 2f);
|
||||
user.ModifyAndClampAttribute(CharacterAttributes.Block, -blockToConsume);
|
||||
}
|
||||
}));
|
||||
|
||||
return mainGroup;
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
if (user != null)
|
||||
{
|
||||
card.SetAttribute("Damage", Block);
|
||||
}
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb463a52ff07ba04e9894a7ca62d7e3f
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
public class DivineSmite : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
AddLogicComponent<CardLogicComponent_Protect>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
|
||||
));
|
||||
|
||||
List<CharacterBase> allies = CombatMainManager.Instance.characterController.GetAllAllies(user);
|
||||
foreach (CharacterBase ally in allies)
|
||||
{
|
||||
CharacterBase captured = ally;
|
||||
mainGroup.AddCommand(Cmd.Do(() =>
|
||||
LogicComponent<CardLogicComponent_Protect>()
|
||||
.GenerateProtection(user, captured, GetAttribute("BuffCount_Protecting"))
|
||||
));
|
||||
}
|
||||
|
||||
return mainGroup;
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Assets/Mods/Basic/Cards/Scripts/Knight/Obsolete.meta
Normal file
8
Assets/Mods/Basic/Cards/Scripts/Knight/Obsolete.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a38b2210e4dfa74ba65ecbb5c0a779c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
@@ -3,7 +3,7 @@ using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
8
Assets/Mods/Basic/Cards/Scripts/Knight/Power.meta
Normal file
8
Assets/Mods/Basic/Cards/Scripts/Knight/Power.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fafa19127a69bd34188713a0969d4e03
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 筑城(Fortification):
|
||||
/// 能力牌,为使用者提供一个同名的Buff。
|
||||
/// </summary>
|
||||
public class Fortification : CardLogicBase
|
||||
{
|
||||
private const string BUFF_FORTIFICATION_STACK = "Buff_Fortification_Stack";
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return SingleCommandGroup(
|
||||
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
int stacks = GetAttribute(BUFF_FORTIFICATION_STACK);
|
||||
CreateCharacterBuff<Buffs.Fortification>(stacks).Apply(user, user, this);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83732e4ebc1f6ec478d386e5dcb18e27
|
||||
8
Assets/Mods/Basic/Cards/Scripts/Knight/Skill.meta
Normal file
8
Assets/Mods/Basic/Cards/Scripts/Knight/Skill.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bc7ec905a3b0f946a11456bae40011d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 鲜血代偿(Blood Compensation):
|
||||
/// 保护一个队友数个回合,但为自己施加易伤Buff
|
||||
/// </summary>
|
||||
public class BloodCompensation : CardLogicBase
|
||||
{
|
||||
private const string BUFF_PROTECTING_COUNT = "Buff_Protecting_Count";
|
||||
private const string BUFF_VULNERABLE_COUNT = "Buff_Vulnerable_Count";
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Protect>().GenerateProtection(user, target, GetAttribute(BUFF_PROTECTING_COUNT));
|
||||
CreateCharacterBuff<Vulnerable>(GetAttribute(BUFF_VULNERABLE_COUNT)).Apply(user, user, this);
|
||||
})
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec007a8103b23584fbead2375da011c8
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 添砖加瓦(Bricks And Tiles):
|
||||
/// 获得一定数量的格挡,并且给自身施加一层稳固(Consolidate)Buff。
|
||||
/// </summary>
|
||||
public class BricksAndTiles : CardLogicBase
|
||||
{
|
||||
private const string BUFF_CONSOLIDATE_COUNT = "Buff_Consolidate_Count";
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Defense>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return SingleCommandGroup(
|
||||
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
user.AddBlock(GetAttribute("Block"));
|
||||
int consolidateStacks = GetAttribute(BUFF_CONSOLIDATE_COUNT);
|
||||
CreateCharacterBuff<Consolidate>(consolidateStacks).Apply(user, user, this);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Defense>().SetBlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bfe01dab0dbb32440bd49ce506850c97
|
||||
76
Assets/Mods/Basic/Cards/Scripts/Knight/Skill/Unyielding.cs
Normal file
76
Assets/Mods/Basic/Cards/Scripts/Knight/Skill/Unyielding.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 不屈(Unyielding):
|
||||
/// 骑士技能牌。获得指定量的格挡和 1 层坚守(Firm)Buff。
|
||||
/// 如果使用者本回合已被攻击过,格挡翻倍。
|
||||
/// </summary>
|
||||
public class Unyielding : CardLogicBase
|
||||
{
|
||||
// 卡牌数据中配置的格挡基础值属性键
|
||||
private const string BUFF_FIRM_COUNT = "Buff_Firm_Count";
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Defense>();
|
||||
}
|
||||
|
||||
// ── 伤害预览 ──────────────────────────────────────────────────────────
|
||||
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
// TargetingEffect 无目标意义(己方技能),复用 Untargeting 逻辑即可
|
||||
RefreshBlockPreview();
|
||||
}
|
||||
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
RefreshBlockPreview();
|
||||
}
|
||||
|
||||
// ── 出牌效果 ──────────────────────────────────────────────────────────
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return SingleCommandGroup(
|
||||
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
int baseBlock = GetAttribute("Block");
|
||||
// 如果本回合已被攻击过,格挡翻倍
|
||||
bool isCounterReaction = user.recordSubmodule.WasAttackedThisRound;
|
||||
int finalBlock = isCounterReaction ? baseBlock * 2 : baseBlock;
|
||||
|
||||
user.AddBlock(finalBlock);
|
||||
|
||||
int firmStacks = GetAttribute(BUFF_FIRM_COUNT);
|
||||
CreateCharacterBuff<Firm>(firmStacks).Apply(user, user, this);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Defense>().SetBlock();
|
||||
}
|
||||
|
||||
// ── 私有辅助 ──────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前是否被攻击过刷新格挡预览属性。
|
||||
/// </summary>
|
||||
private void RefreshBlockPreview()
|
||||
{
|
||||
int baseBlock = GetAttribute("Block");
|
||||
bool isCounterReaction = user != null && user.recordSubmodule.WasAttackedThisRound;
|
||||
card.SetAttribute("Display_Block", isCounterReaction ? baseBlock * 2 : baseBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c51160c78806a654ea5432ab5f2571ea
|
||||
@@ -1,46 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
public class UtmostStrike : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
new Cmd_PlaySFX("SFX_Basic_GeneralMeleeImpact").SetDelay(0.2f),
|
||||
new Cmd_SpawnVFX("VFX_Basic_DefaultAttack").SetDelay(0.2f),
|
||||
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
|
||||
));
|
||||
|
||||
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
|
||||
|
||||
return mainGroup;
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
||||
}
|
||||
|
||||
private bool SelectCondition(CardInstance card)
|
||||
{
|
||||
return card.contentSubmodule.cardType is not CardType.Attack;
|
||||
}
|
||||
|
||||
private void SelectEffect(CardInstance card)
|
||||
{
|
||||
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true, 0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9299438b564ba4a4aa59e98ea7d83c9d
|
||||
Reference in New Issue
Block a user