卡牌更新

This commit is contained in:
SoulliesOfficial
2026-04-08 04:48:35 -04:00
parent c3b1561375
commit dd2657573a
242 changed files with 1950 additions and 926 deletions

View File

@@ -29,7 +29,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -27,7 +27,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Strike();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -12,7 +12,7 @@ namespace Continentis.Mods.Basic.Cards
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CommandGroup applyProwess = Cmd.Sequential(
Cmd.Do(() => CreateCharacterBuff<Prowess>(2).Apply(user, user, this))
Cmd.Do(() => CreateCharacterBuff<Strength>(2).Apply(user, user, this))
);
CommandGroup applyWeak = ForEachTarget(targetList, target =>

View File

@@ -37,7 +37,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Sorcery();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,62 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Base;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 强酸箭矢:对单体目标先减少格挡,然后造成魔法伤害并施加腐蚀 Buff。
/// </summary>
public class AcidArrow : CardLogicBase
{
private const string BLOCK_REDUCTION = "Block_Reduction";
private const string BUFF_CORROSION_STACK = "Buff_Corrosion_Stack";
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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(() =>
{
// 第一步减少目标格挡Clamp 至 0
target.ModifyAndClampAttribute(CharacterAttributes.Block, -GetAttribute(BLOCK_REDUCTION));
// 第二步:造成伤害并施加腐蚀
AttackContext ctx = PhysicsCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
CreateCharacterBuff<Corrosion>(GetAttribute(BUFF_CORROSION_STACK)).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f308be721a026ed449e5dfe317b5ad28

View File

@@ -0,0 +1,63 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 魔法飞弹:对单体敌人造成多段魔法伤害。
/// </summary>
public class ArcaneMissiles : CardLogicBase
{
private const string ATTACK_COUNT = "Attack_Count";
private AttackContext MagicCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Magic);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <summary>选中目标时更新伤害预览。</summary>
public override void TargetingEffect(CharacterBase target)
{
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, MagicCtx));
}
/// <summary>取消选中时以无目标模式刷新预览。</summary>
public override void UntargetingEffect()
{
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(MagicCtx));
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target =>
{
CommandGroup perTargetGroup = Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"));
int attackCount = GetAttribute(ATTACK_COUNT);
for (int i = 0; i < attackCount; i++)
{
perTargetGroup.AddCommand(Cmd.After(0.4f, () =>
{
AttackContext ctx = MagicCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
}));
}
return perTargetGroup;
});
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,61 @@
using System.Collections.Generic;
using System.Linq;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 暴风雪:对全体敌人造成伤害并附加冻结 Buff同时对我方全体施加少量冻结 Buff。
/// 卡牌数据配置 targetCount = -1、TargetEnemiesLogic 层自行查找友方角色。
/// </summary>
public class Blizzard : CardLogicBase
{
private const string FREEZE_COUNT_ENEMY = "Freeze_Count_Enemy";
private const string FREEZE_COUNT_ALLY = "Freeze_Count_Ally";
private AttackContext IceCtx => AttackContext.Default(card).WithDamageKeywords(CardKeywords.Ice);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.Do(() =>
{
// 对全体敌人造成伤害 + 冻结
AttackContext ctx = IceCtx;
int freezeCountEnemy = GetAttribute(FREEZE_COUNT_ENEMY);
foreach (CharacterBase target in targetList)
{
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
CreateCharacterBuff<Freeze>(freezeCountEnemy).Apply(target, user, this);
}
// 对我方全体施加少量冻结(不造成伤害)
int freezeCountAlly = GetAttribute(FREEZE_COUNT_ALLY);
List<CharacterBase> allies = CombatMainManager.Instance.characterController.characters
.Where(c => user.IsAlly(c)).ToList();
foreach (CharacterBase ally in allies)
{
CreateCharacterBuff<Freeze>(freezeCountAlly).Apply(ally, user, this);
}
})
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f49c06988c3e6b741901925e81333585

View File

@@ -7,7 +7,7 @@ using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
public class HeavySlash : CardLogicBase
public class Bludgeon : CardLogicBase
{
public override void SetUpLogicComponents()
{
@@ -18,14 +18,12 @@ namespace Continentis.Mods.Basic.Cards
{
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Attack"),
new Cmd_PlaySFX("SFX_Basic_SwordStrike"),
new Cmd_SpawnVFX("VFX_Basic_RedImpact"),
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
));
mainGroup.AddCommand(Cmd.Do(() =>
{
CreateCharacterBuff<Heavy>(false, 1).Apply(user, user, this);
CreateCharacterBuff<Heavy>(false, GetAttribute("Buff_Heavy_Stack")).Apply(user, user, this);
}));
return mainGroup;
@@ -33,7 +31,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,78 @@
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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 余烬打击:消耗一张手牌,对单体目标造成火焰伤害并施加灼烧 Buff。
/// 若手牌中没有其他牌可消耗,跳过所有后续效果。
/// </summary>
public class CinderStrike : CardLogicBase
{
private const string BUFF_BURN_STACK = "Buff_Burn_Stack";
private AttackContext FireCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Fire);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
AddLogicComponent<CardLogicComponent_SelectHandCards>()
.SetCondition(c => c != card)
.SetEffect(c => CommandQueueManager.Instance.AddCommand(
user.deckSubmodule.DiscardCard(c, true, 0f)));
}
/// <summary>选中目标时更新伤害预览。</summary>
public override void TargetingEffect(CharacterBase target)
{
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, FireCtx));
}
/// <summary>取消选中时以无目标模式刷新预览。</summary>
public override void UntargetingEffect()
{
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(FireCtx));
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
// 手牌中(排除自身)没有可弃的牌,跳过所有后续效果
if (user.deckSubmodule.HandPile.Exclude(card).Count == 0)
{
return Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Attack"));
}
CommandGroup mainGroup = Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack")
);
// 弹出手牌选择 UI强制选择 1 张弃掉
LogicComponent<CardLogicComponent_SelectHandCards>()
.AddSelectionCommands(ref mainGroup, "Card_Basic_CinderStrike_SelectHandCards_Title".Localize(), 1, forceMax: true);
// 弃牌完成后再造成伤害和灼烧
mainGroup.AddCommand(Cmd.Do(() =>
{
foreach (CharacterBase target in targetList)
{
AttackContext ctx = FireCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
CreateCharacterBuff<Burn>(GetAttribute(BUFF_BURN_STACK)).Apply(target, user, this);
}
}));
return mainGroup;
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 64036b79902a63a478a1b8625393821e

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
@@ -7,11 +8,14 @@ using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 顺劈斩:对全体敌人造成物理斩击伤害,数值受到力量和敏捷增减影响
/// AOE范围由卡牌数据的目标配置决定Logic层无需额外处理
/// 顺劈斩:对全体敌人造成物理伤害
/// AOE 范围由卡牌数据的目标配置决定targetCount = -1
/// </summary>
public class Cleave : CardLogicBase
{
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
@@ -21,13 +25,17 @@ namespace Continentis.Mods.Basic.Cards
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
ForEachTarget(targetList, target => Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target))))
ForEachTarget(targetList, target => Cmd.Do(() =>
{
AttackContext ctx = PhysicsCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
}))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,57 @@
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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 切割:对单体目标造成物理伤害,并施加流血 Buff。
/// </summary>
public class Cutting : CardLogicBase
{
private const string BUFF_BLEED_STACK = "Buff_Bleed_Stack";
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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);
CreateCharacterBuff<Bleed>(GetAttribute(BUFF_BLEED_STACK)).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 56b6f69fd10dda2428fc2322c79ac20f

View File

@@ -15,9 +15,6 @@ namespace Continentis.Mods.Basic.Cards
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
// 对每个目标顺序执行两段攻击,每段各播一次动画
return ForEachTarget(
targetList,
target => Cmd.Sequential(
@@ -35,7 +32,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Strike();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,57 @@
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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 戳眼:对单体目标造成物理伤害,并施加目盲 Buff。
/// </summary>
public class EyePoking : CardLogicBase
{
private const string BUFF_BLIND_COUNT = "Buff_Blind_Count";
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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);
CreateCharacterBuff<Blind>(GetAttribute(BUFF_BLIND_COUNT)).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2d510045193a3f74eb0c6af551bf047a

View File

@@ -76,9 +76,9 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
// 主伤害:奥术加成写入 Damage_Main
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane(DAMAGE_MAIN);
// 溅射伤害:奥术加成写入 Damage_Others数值由卡牌数据配置
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane(DAMAGE_OTHERS);
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic(DAMAGE_MAIN);
// 溅射伤害:魔法加成写入 Damage_Others数值由卡牌数据配置
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic(DAMAGE_OTHERS);
}
}
}

View File

@@ -30,7 +30,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -27,13 +27,13 @@ namespace Continentis.Mods.Basic.Cards
/// <summary>选中目标时更新伤害预览。</summary>
public override void TargetingEffect(CharacterBase target)
{
card.SetAttribute("DisplayDamage", GetTargetedFinalDamage(target, FireCtx));
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, FireCtx));
}
/// <summary>取消选中时以无目标模式刷新预览。</summary>
public override void UntargetingEffect()
{
card.SetAttribute("DisplayDamage", GetNoTargetFinalDamage(FireCtx));
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(FireCtx));
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
@@ -47,14 +47,14 @@ namespace Continentis.Mods.Basic.Cards
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
int burnStacks = GetAttribute(BUFF_BURN_STACK);
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user);
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user, this);
}))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,69 @@
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 SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 炎枪术:先削减目标的格挡值,再对目标造成大量火焰伤害并施加灼烧 Buff。
/// 格挡削减不受伤害加成影响,直接扣减固定值。
/// </summary>
public class FlameSpear : CardLogicBase
{
private const string BLOCK_REDUCTION = "Block_Reduction";
private const string BUFF_BURN_STACK = "Buff_Burn_Stack";
private AttackContext FireCtx => AttackContext.Default(card)
.WithDamageKeywords("Fire");
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <summary>选中目标时更新伤害预览。</summary>
public override void TargetingEffect(CharacterBase target)
{
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, FireCtx));
}
/// <summary>取消选中时以无目标模式刷新预览。</summary>
public override void UntargetingEffect()
{
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(FireCtx));
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target => Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.Do(() =>
{
// 削减格挡(直接扣减,不受任何加成影响)
int blockReduce = GetAttribute(BLOCK_REDUCTION);
int actualReduce = target.ModifyAndClampAttribute("Block", -blockReduce);
target.characterView.hudContainer.UpdateAllHUD();
//Debug.Log($"[FlameSpear] 削减 {target.data.displayName} 的格挡 {actualReduce} 点。");
// 火焰伤害
AttackContext ctx = FireCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
// 灼烧
int burnStacks = GetAttribute(BUFF_BURN_STACK);
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 566eda7acc1416e4d98d1dc9cf854013

View File

@@ -0,0 +1,62 @@
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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 狂乱爪击:对随机多个敌人(可重复)各造成一次物理伤害,
/// 每次伤害同时施加流血 Buff。
/// 卡牌数据需配置 targetCount攻击次数关键词需包含 AllowDuplicateTargets 和 TargetEnemies。
/// </summary>
public class FrenziedClawSlashes : CardLogicBase
{
private const string BUFF_BLEED_STACK = "Buff_Bleed_Stack";
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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)
{
// targetList 由 SetRandomTargets + AllowDuplicateTargets 提供,可包含重复目标
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
ForEachTarget(targetList, target => Cmd.Sequential(
Cmd.After(0.3f, () =>
{
AttackContext ctx = PhysicsCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
CreateCharacterBuff<Bleed>(GetAttribute(BUFF_BLEED_STACK)).Apply(target, user, this);
})
))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0adba0210d9f6b54b92f8bf2ea31c2fe

View File

@@ -0,0 +1,59 @@
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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 冻伤:对单体目标造成冰属性伤害,并施加冻结和易伤 Buff。
/// </summary>
public class Frostbite : CardLogicBase
{
private const string BUFF_FREEZE_COUNT = "Buff_Freeze_Count";
private const string BUFF_VULNERABLE_COUNT = "Buff_Vulnerable_Count";
private AttackContext IceCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Ice);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <summary>选中目标时更新伤害预览。</summary>
public override void TargetingEffect(CharacterBase target)
{
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, IceCtx));
}
/// <summary>取消选中时以无目标模式刷新预览。</summary>
public override void UntargetingEffect()
{
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(IceCtx));
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target => Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.Do(() =>
{
AttackContext ctx = IceCtx;
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
CreateCharacterBuff<Freeze>(GetAttribute(BUFF_FREEZE_COUNT)).Apply(target, user, this);
CreateCharacterBuff<Vulnerable>(GetAttribute(BUFF_VULNERABLE_COUNT)).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5f3c8dc84db536941908d431278e16f6

View File

@@ -0,0 +1,69 @@
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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 裂伤:对单体目标造成物理伤害,施加易伤 Buff
/// 并额外对目标施加等同于其身上易伤剩余回合数的流血层数。
/// </summary>
public class Laceration : CardLogicBase
{
private const string BUFF_VULNERABLE_COUNT = "Buff_Vulnerable_Count";
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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);
// 施加易伤
CreateCharacterBuff<Vulnerable>(GetAttribute(BUFF_VULNERABLE_COUNT)).Apply(target, user, this);
// 读取目标身上易伤的剩余回合数,以此作为流血层数
if (target.combatBuffSubmodule.TryGetBuff<Vulnerable>(out Vulnerable vulnerable))
{
int bleedStack = vulnerable.actionCountSubmodule.remainingCount;
if (bleedStack > 0)
{
CreateCharacterBuff<Bleed>(bleedStack).Apply(target, user, this);
}
}
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 158926b330501464fbe683ef9658f302

View File

@@ -0,0 +1,52 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 强力射击:对单体目标造成物理伤害。
/// </summary>
public class PowerfulShot : CardLogicBase
{
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9bd02c9c4b934f74a88731bd08e0ba02

View File

@@ -0,0 +1,52 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 精准射击:对单体目标造成物理伤害。
/// </summary>
public class PreciseShot : CardLogicBase
{
private AttackContext PhysicsCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Physics);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
/// <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);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9018f86afc363b84f931bf84ee5ec705

View File

@@ -2,12 +2,15 @@ using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
public class RayOfFrost : CardLogicBase
{
private const string BUFF_FREEZE_STACK = "Buff_Freeze_Stack";
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
@@ -15,17 +18,20 @@ namespace Continentis.Mods.Basic.Cards
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
return ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.After(0.2f, () => AttackTarget(target, GetTargetedFinalDamage(target)))
Cmd.Do(() =>
{
AttackTarget(target, GetTargetedFinalDamage(target));
int freezeStacks = GetAttribute(BUFF_FREEZE_STACK);
CreateCharacterBuff<Freeze>(freezeStacks).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -9,12 +9,16 @@ using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 沙暴:对全体敌人造成多段伤害,并附加致盲 Buff。
/// 沙暴:对全体敌人造成多段土属性伤害,并施加目盲 Buff。
/// AOE 范围由卡牌数据的目标配置决定,动画只播放一次。
/// </summary>
public class SandStorm : CardLogicBase
{
private AttackContext EarthCtx => AttackContext.Default(card).WithDamageKeywords("Earth");
private const string ATTACK_COUNT = "Attack_Count";
private const string BUFF_BLIND_COUNT = "Buff_Blind_Count";
private AttackContext EarthCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Earth);
public override void SetUpLogicComponents()
{
@@ -23,39 +27,38 @@ namespace Continentis.Mods.Basic.Cards
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
int hitCount = GetAttribute("HitCount");
int hitCount = GetAttribute(ATTACK_COUNT);
CommandGroup hitsGroup = Cmd.Sequential();
for (int i = 0; i < hitCount; i++)
{
hitsGroup.AddCommand(Cmd.After(0.5f, () =>
{
AttackContext ctx = EarthCtx;
foreach (CharacterBase target in targetList)
{
AttackTarget(target, GetTargetedFinalDamage(target), EarthCtx);
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
}
}));
}
int blindCount = GetAttribute("Buff_Blind_Count");
CommandGroup debuffGroup = Cmd.Sequential(Cmd.Do(() =>
{
foreach (CharacterBase target in targetList)
{
CreateCharacterBuff<Blind>(blindCount).Apply(target, user);
}
}));
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
hitsGroup,
debuffGroup
Cmd.Do(() =>
{
int blindCount = GetAttribute(BUFF_BLIND_COUNT);
foreach (CharacterBase target in targetList)
{
CreateCharacterBuff<Blind>(blindCount).Apply(target, user, this);
}
})
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -62,14 +62,14 @@ namespace Continentis.Mods.Basic.Cards
AttackTarget(target, GetTargetedFinalDamage(target, fireCtx), fireCtx);
int burnStacks = GetAttribute(BUFF_BURN_STACK);
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user);
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user, this);
})
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash(DAMAGE_PHYSICS);
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics(DAMAGE_PHYSICS);
LogicComponent<CardLogicComponent_Attack>().SetDamage_Default(DAMAGE_FIRE);
}
}

View File

@@ -2,36 +2,34 @@ using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class Bludgeon : CardLogicBase
public class ShieldBash : CardLogicBase
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
AddLogicComponent<CardLogicComponent_Defense>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(
targetList,
target => Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.After(0.1f, () =>
{
AttackTarget(target, GetTargetedFinalDamage(target));
CreateCharacterBuff<Weak>().Apply(target, user, this);
})
),
ExecutionMode.Sequential);
var mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
));
mainGroup.AddCommand(Cmd.Do(() => user.AddBlock(GetAttribute("Block"))));
return mainGroup;
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Strike();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f863099274a14414b983c9bbdf54e480

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 356e1a6512dbf4648ae79f68e1ce0517
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -15,16 +15,14 @@ namespace Continentis.Mods.Basic.Cards
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
return Cmd.Parallel(new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.After(0.2f, () => user.AddBlock(GetAttribute("Block")))
Cmd.Do(() => user.AddBlock(GetAttribute("Block")))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock_Fortitude();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -0,0 +1,31 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class Evasion : CardLogicBase
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Defense>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
return Cmd.Parallel(new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.AddDodge(GetAttribute("Dodge")))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetDodge();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 57c0b91cd3a1e63489ca8b048df1415a

View File

@@ -18,17 +18,15 @@ namespace Continentis.Mods.Basic.Cards
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
return ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.After(0.1f, () => AttackTarget(target, GetTargetedFinalDamage(target)))
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Prick();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -26,7 +26,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -28,7 +28,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Strike();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class Meditation : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => CreateCharacterBuff<Buffs.Resonance>(GetAttribute("Buff_Resonance_Stack")).Apply(user, user, this))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d87b9c15198f97b4c8ebc8e0f45ccf25

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 治疗之雨:能力牌,给使用者施加"祈雨"专注 Buff。
/// 每回合开始时对全体友方回复 Heal_Amount 点生命,持续 Buff_Duration 回合。
/// </summary>
public class RainOfHealing : CardLogicBase
{
private const string HEAL_AMOUNT = "Heal_Amount";
private const string BUFF_PRAYINGFORRAIN_DURATION = "Buff_PrayingForRain_Count";
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() =>
{
CreateCharacterBuff<PrayingForRain>(
GetAttribute(HEAL_AMOUNT),
GetAttribute(BUFF_PRAYINGFORRAIN_DURATION)
).Apply(user, user, this);
})
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 73b083d8ec0bbad4dbb0c99786f86844

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 石肤术:对使用者施加坚韧 Buff行动结束后获得格挡
/// </summary>
public class Stoneskin : CardLogicBase
{
private const string BUFF_WITHSTAND_STACK = "Buff_Withstand_Stack";
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => CreateCharacterBuff<Withstand>(GetAttribute(BUFF_WITHSTAND_STACK)).Apply(user, user, this))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b6250880c19f25943ab087ca16993ac2

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class WarmUp : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => CreateCharacterBuff<Buffs.Strength>(GetAttribute("Buff_Strength_Stack")).Apply(user, user, this))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 02b6c4871a92a8643a2340a41bf762be

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class ActionSurge : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.ModifyStamina(GetAttribute("Stamina_Recover")))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6384a21b043ec0344a37b7ae4c10885e

View File

@@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Linq;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 预判:获得闪避值。
/// 若本回合内没有任何敌人在使用者之前行动,则额外获得 Bonus_Dodge 的闪避值。
/// </summary>
public class Anticipation : CardLogicBase
{
private const string BONUS_DODGE = "Bonus_Dodge";
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Defense>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
int baseDodge = GetAttribute("Dodge");
int finalDodge = IsBeforeAnyEnemy()
? Mathf.RoundToInt(baseDodge + GetAttribute(BONUS_DODGE))
: baseDodge;
return Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.AddDodge(finalDodge))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetDodge();
}
/// <summary>
/// 判断本回合内是否没有任何敌方角色在使用者之前行动过。
/// </summary>
private bool IsBeforeAnyEnemy()
{
int currentRound = CombatMainManager.Instance.currentRound;
int userActionIndex = user.recordSubmodule.currentAction;
return !CombatMainManager.Instance.characterController.characters
.Any(c => c.fraction == Fraction.Enemy
&& c.recordSubmodule.currentRound == currentRound
&& c.recordSubmodule.currentAction < userActionIndex);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1ebac59694a161148a829240aa9d8ec2

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class ArcaneRecovery : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.ModifyMana(GetAttribute("Mana_Recover")))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5609f31a692c7f847ada725274e17d5d

View File

@@ -11,12 +11,15 @@ using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 命令术:对目标执行一次感知检定
/// <para>对敌人:若感知低于{PerceptionThreshold_Remove},随机移除一个意图;若低于{PerceptionThreshold_Change}随机改变一个意图</para>
/// <para>对玩家英雄:若感知检定未通过,将一张"扼制"卡牌放入目标抽牌堆</para>
/// 命令术:根据使用者与目标的等级差产生不同效果
/// <para>对敌人:等级差达到 High 门槛时随机移除一个意图;达到 Low 门槛时随机改变一个意图</para>
/// <para>对玩家英雄:等级差达到 High 门槛时将"扼制"卡牌放入目标抽牌堆;达到 Low 门槛时将"干扰"卡牌放入目标抽牌堆。</para>
/// </summary>
public class Command : CardLogicBase
{
private const string LEVEL_GAP_LOW = "LevelGap_Low";
private const string LEVEL_GAP_HIGH = "LevelGap_High";
private static readonly Color HintGreen = new Color(0.2f, 0.85f, 0.3f);
private static readonly Color HintRed = new Color(0.9f, 0.2f, 0.2f);
@@ -48,7 +51,7 @@ namespace Continentis.Mods.Basic.Cards
}
/// <summary>
/// 检查场上是否存在感知低于阈值的可用目标。
/// 检查场上是否存在等级差达到 Low 门槛的可用目标。
/// 有可用目标时返回绿色,无可用目标时返回红色。
/// </summary>
public override Color? GetHintColor()
@@ -58,36 +61,43 @@ namespace Continentis.Mods.Basic.Cards
card.DetectTargetsValidity(out List<CharacterBase> valid, out _, out _);
if (valid.Count == 0) return HintRed;
int changeThreshold = GetAttribute("Perception_Threshold_High");
int userLevel = user.GetAttribute(CharacterAttributes.Level);
int gapLow = GetAttribute(LEVEL_GAP_LOW);
bool hasEffectiveTarget = valid.Any(t =>
t.GetAttribute(CharacterAttributes.Perception) < changeThreshold);
userLevel - t.GetAttribute(CharacterAttributes.Level) >= gapLow);
return hasEffectiveTarget ? HintGreen : HintRed;
}
/// <summary>对敌方目标:根据感知检定移除或改变意图。</summary>
/// <summary>计算使用者与目标的等级差。</summary>
private int GetLevelGap(CharacterBase target)
{
return user.GetAttribute(CharacterAttributes.Level) - target.GetAttribute(CharacterAttributes.Level);
}
/// <summary>对敌方目标:等级差达到 High 时移除意图,达到 Low 时改变意图。</summary>
private void PlayEffectOnEnemy(CharacterBase target)
{
int removeThreshold = GetAttribute("Perception_Threshold_Low");
int changeThreshold = GetAttribute("Perception_Threshold_High");
int perception = target.GetAttribute(CharacterAttributes.Perception);
int levelGap = GetLevelGap(target);
int gapHigh = GetAttribute(LEVEL_GAP_HIGH);
int gapLow = GetAttribute(LEVEL_GAP_LOW);
if (perception < removeThreshold)
if (levelGap >= gapHigh)
target.intentionSubmodule.RemoveRandomIntendedCard();
else if (perception < changeThreshold)
else if (levelGap >= gapLow)
target.intentionSubmodule.ChangeRandomIntendedCard();
}
/// <summary>对玩家英雄:感知检定未通过时,向目标抽牌堆塞入一张"扼制"卡牌。</summary>
/// <summary>对玩家英雄:等级差达到 High 时塞入扼制,达到 Low 时塞入干扰。</summary>
private void PlayEffectOnPlayer(CharacterBase target)
{
int stifleThreshold = GetAttribute("Perception_Threshold_Low");
int disruptionThreshold = GetAttribute("Perception_Threshold_High");
int perception = target.GetAttribute(CharacterAttributes.Perception);
int levelGap = GetLevelGap(target);
int gapHigh = GetAttribute(LEVEL_GAP_HIGH);
int gapLow = GetAttribute(LEVEL_GAP_LOW);
if (perception < stifleThreshold)
if (levelGap >= gapHigh)
CardInstance.GenerateCardInstance(GetDerivativeCardData(0), target, Piles.Draw);
else if (perception < disruptionThreshold)
else if (levelGap >= gapLow)
CardInstance.GenerateCardInstance(GetDerivativeCardData(1), target, Piles.Draw);
}
}

View File

@@ -19,13 +19,13 @@ namespace Continentis.Mods.Basic.Cards
return ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.AddBlock(GetAttribute("Block"))),
Cmd.Do(() => LogicComponent<CardLogicComponent_Protect>().GenerateProtection(user, target, GetAttribute("BuffCount_Protecting")))
Cmd.Do(() => LogicComponent<CardLogicComponent_Protect>().GenerateProtection(user, target, GetAttribute("Buff_Protecting_Count")))
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock_Fortitude();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -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 SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 冰封术:对目标施加冻结和虚弱 Buff。
/// </summary>
public class Icebound : CardLogicBase
{
private const string FREEZE_COUNT = "Buff_Freeze_Count";
private const string WEAK_COUNT = "Buff_Weak_Count";
public override void SetUpLogicComponents() { }
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Cast"),
Cmd.Do(() =>
{
CreateCharacterBuff<Freeze>(GetAttribute(FREEZE_COUNT)).Apply(target, user, this);
CreateCharacterBuff<Weak>(GetAttribute(WEAK_COUNT)).Apply(target, user, this);
})
));
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bd886cfe2c8877944b8e749f34849625

View File

@@ -10,22 +10,23 @@ namespace Continentis.Mods.Basic.Cards
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_SelectCustomCards>();
var select = AddLogicComponent<CardLogicComponent_SelectCustomCards>();
select.selectEffect = SelectEffect;
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
CommandGroup mainGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Skill"));
List<CardInstance> discardedCards = user.deckSubmodule.DiscardPile;
LogicComponent<CardLogicComponent_SelectCustomCards>()
.AddSelectionCommands(ref mainGroup, discardedCards, "Select a non-status or non-curse card.", 1);
.AddSelectionCommands(ref mainGroup, discardedCards,
"Card_Basic_Recollection_SelectCustomCards_Title".Localize(card), GetAttribute("Draw_Card_Count"));
return mainGroup;
}
public void SelectEffect(CardInstance card)
private void SelectEffect(CardInstance card)
{
CommandQueueManager.Instance.AddCommand(new Cmd_DrawCards(card.deck, new List<CardInstance>() { card }, 0.1f));
CommandQueueManager.Instance.AddCommand(new Cmd_DrawCards(card.deck, new List<CardInstance>() { card }));
}
}
}

View File

@@ -1,5 +1,3 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
@@ -7,16 +5,26 @@ using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards.Cleric
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 庇护所:对目标施加弱驱散,每次使用后法力消耗增加 1。
/// </summary>
public class Sanctuary : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target => Cmd.Parallel(
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => target.combatBuffSubmodule.Dispel(BuffDispelLevel.Basic, user))
));
mainGroup.AddCommand(Cmd.Do(() =>
{
ModifyAttribute(CardAttributes.ManaCost, 1);
}));
return mainGroup;
}
}
}

View File

@@ -19,9 +19,9 @@ namespace Continentis.Mods.Basic.Cards
CommandGroup mainGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Skill"));
LogicComponent<CardLogicComponent_SelectHandCards>()
.AddSelectionCommands(ref mainGroup, "Card_Basic_Tactic_SelectionCommandTitle".Localize(), 1, true);
.AddSelectionCommands(ref mainGroup, "Card_Basic_Tactic_SelectHandCards_Title".Localize(), GetAttribute("Discard_Card_Count"), true);
mainGroup.AddCommand(new Cmd_DrawCards(user.deckSubmodule, 1));
mainGroup.AddCommand(new Cmd_DrawCards(user.deckSubmodule, GetAttribute("Draw_Card_Count")));
return mainGroup;
}

View File

@@ -10,7 +10,7 @@ namespace Continentis.Mods.Basic.Cards
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return user.deckSubmodule.DrawCards(GetAttribute("DrawCardAmount"));
return user.deckSubmodule.DrawCards(GetAttribute("Draw_Card_Count"));
}
}
}

View File

@@ -0,0 +1,53 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 猛毒喷射:对主目标施加腐蚀 Buff
/// 并从剩余敌人中随机选取 Extra_Target_Count 个额外目标(不可重复)同样施加腐蚀 Buff。
/// targetCount = 1玩家手动指定主目标额外目标由 PlayEffect 内部随机决定。
/// </summary>
public class VenomSpray : CardLogicBase
{
private const string BUFF_CORROSION_STACK = "Buff_Corrosion_Stack";
private const string EXTRA_TARGET_COUNT = "Extra_Target_Count";
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CharacterBase mainTarget = targetList[0];
int corrosionStack = GetAttribute(BUFF_CORROSION_STACK);
// 从所有敌人中排除主目标,不放回随机抽取额外目标
List<CharacterBase> pool = CombatMainManager.Instance.characterController.GetAllEnemies(user);
pool.Remove(mainTarget);
int extraCount = Mathf.Min(GetAttribute(EXTRA_TARGET_COUNT), pool.Count);
List<CharacterBase> extraTargets = new List<CharacterBase>();
for (int i = 0; i < extraCount; i++)
{
int index = Random.Range(0, pool.Count);
extraTargets.Add(pool[index]);
pool.RemoveAt(index);
}
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() =>
{
CreateCharacterBuff<Corrosion>(corrosionStack).Apply(mainTarget, user, this);
foreach (CharacterBase extra in extraTargets)
{
CreateCharacterBuff<Corrosion>(corrosionStack).Apply(extra, user, this);
}
})
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a36b331b0e2b358438eed660fcf79847

View File

@@ -37,7 +37,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -31,7 +31,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock_Fortitude();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -31,7 +31,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock_Fortitude();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 7232a7d96ede60443b2641d668301d06

View File

@@ -28,7 +28,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock_Sorcery();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -30,7 +30,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
private bool SelectCondition(CardInstance card)

View File

@@ -1,57 +0,0 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class ArcaneMissiles : CardLogicBase
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
// 多段攻击先等1秒占位再对每个目标依次连续打多段
CommandGroup occupiedGroup = Cmd.Sequential(
Cmd.After(1f, () =>
CommandQueueManager.Instance.AddCommand(Cmd.Do(() =>
Debug.Log("插队指令,等待动画播放完毕")))
)
);
CommandGroup mainGroup = ForEachTarget(targetList, target =>
{
CommandGroup perTargetGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Attack"));
int attackCount = GetAttribute("AttackCount");
for (int i = 0; i < attackCount; i++)
{
perTargetGroup.AddCommand(Cmd.After(0.4f, () =>
{
AttackTarget(target, GetTargetedFinalDamage(target));
Debug.Log("攻击命令触发");
}));
}
return perTargetGroup;
});
CommandGroup finalGroup = Cmd.Sequential(Cmd.Do(() => Debug.Log("不插队指令")));
CommandGroup firstGroup = Cmd.Sequential(
Cmd.Do(() => Debug.Log("插队指令,抽牌")),
new Cmd_DrawCards(user.deckSubmodule, 1)
);
return Cmd.Sequential(occupiedGroup, mainGroup, finalGroup, firstGroup);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
}
}
}

View File

@@ -30,7 +30,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -23,7 +23,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -25,7 +25,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Prick();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

View File

@@ -25,7 +25,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock_Arcane();
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -30,7 +30,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}

View File

@@ -25,7 +25,7 @@ namespace Continentis.Mods.Basic.Cards
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Prick();
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
}
}

Some files were not shown because too many files have changed in this diff Show More