更新
This commit is contained in:
48
Assets/Mods/Basic/Characters/CombatBuffs/General/Blessing.cs
Normal file
48
Assets/Mods/Basic/Characters/CombatBuffs/General/Blessing.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class Blessing : CharacterCombatBuffBase
|
||||
{
|
||||
public Blessing (int stack, int duration)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Basic);
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString())
|
||||
.AddParameterGetter("Duration", () => roundFirstActionCountSubmodule.remainingCount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
this.generalAttributeSubmodule.numericChange[CharacterAttributes.UniversalOffset] = 1;
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
this.roundFirstActionCountSubmodule = new CountSubmodule(this, duration);
|
||||
|
||||
this.eventSubmodule.onAfterPlayCard.Add("OnAfterPlayCard",
|
||||
new PrioritizedAction<CardInstance, List<CharacterBase>>(OnAfterPlayCard));
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Buff_Basic_Blessing_DisplayName".Localize(), attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
existingBuff.roundFirstActionCountSubmodule.PickHigherCount(this.roundFirstActionCountSubmodule);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnAfterPlayCard(CardInstance card, List<CharacterBase> targetList)
|
||||
{
|
||||
unitedStackSubmodule.ModifyStack(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d4439cb60b400d845a3dfbc4d9237d09
|
||||
@@ -5,7 +5,12 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public sealed class Blind : CharacterCombatBuffBase
|
||||
{
|
||||
public Blind(int initialCount, int stack = 25)
|
||||
public Blind(int initialCount) : this(initialCount, 25)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Blind(int initialCount, int stack)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
@@ -17,6 +22,8 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
actionCountSubmodule = new CountSubmodule(this, initialCount);
|
||||
|
||||
unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
generalAttributeSubmodule.numericChange.Add("DodgeCheckStartDamageMultiplier", -0.01f * stack);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,13 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onGetAttacked.Add(this.GetType().FullName, new PrioritizedAction<AttackResult>(atkResult =>
|
||||
{
|
||||
attachedCharacter.Attack(atkResult.attacker, unitedStackSubmodule.stackAmount, null, false, true);
|
||||
// 将反击入队到 Reaction Lane,确保反击动画/特效与主流程不穿插
|
||||
int counterDamage = unitedStackSubmodule.stackAmount;
|
||||
CharacterBase attacker = atkResult.attacker;
|
||||
EnqueueReaction(Cmd.Do(() =>
|
||||
{
|
||||
attachedCharacter.Attack(attacker, counterDamage, null, false, true);
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 光耀印记:使目标的物理攻击卡每段伤害额外造成 {Stack} 点伤害。
|
||||
/// 本回合结束时移除。
|
||||
/// </summary>
|
||||
public sealed class MarkOfRadiance : CharacterCombatBuffBase
|
||||
{
|
||||
public MarkOfRadiance(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Basic);
|
||||
|
||||
contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString())
|
||||
.AddParameterGetter("Count", () => roundCountSubmodule.remainingCount.ToString());
|
||||
|
||||
iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
// 行动结束时移除(本回合 Buff)
|
||||
roundCountSubmodule = new CountSubmodule(this, 1);
|
||||
|
||||
eventSubmodule = new EventSubmodule(this);
|
||||
eventSubmodule.onDealAttack.Add("MarkOfRadiance", new PrioritizedAction<AttackResult>(OnDealAttack));
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(unitedStackSubmodule.stackAmount);
|
||||
existingBuff.roundCountSubmodule.PickHigherCount(roundCountSubmodule);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnDealAttack(AttackResult atkRes)
|
||||
{
|
||||
// 响应式/生命移除/反弹伤害不触发
|
||||
if (atkRes.context.HasAnyTag(AttackTags.Reactive, AttackTags.HpRemoval, AttackTags.Reflected))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 仅对物理攻击卡生效
|
||||
if (atkRes.attackCard == null) return;
|
||||
if (atkRes.attackCard.contentSubmodule.cardType != CardType.Attack) return;
|
||||
if (!atkRes.attackCard.HasKeyword("Physics")) return;
|
||||
|
||||
int bonusDamage = unitedStackSubmodule.stackAmount;
|
||||
var ctx = AttackContext.Default(atkRes.attackCard).WithTag(AttackTags.Reactive);
|
||||
|
||||
EnqueueReaction(Cmd.Do(() => {
|
||||
attachedCharacter.Attack(atkRes.target, bonusDamage, ctx);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f7351be716c5f442bb2263857e57ff7
|
||||
Reference in New Issue
Block a user