卡牌更新
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 流血:受到攻击时,额外受到等同于层数的伤害(响应式,不会递归触发)。
|
||||
/// 每次行动开始时层数减半(至少减 1)。
|
||||
/// </summary>
|
||||
public sealed class Bleed : CharacterCombatBuffBase
|
||||
{
|
||||
public Bleed(int stack)
|
||||
@@ -27,8 +29,13 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
private void OnGetAttacked(AttackResult result)
|
||||
{
|
||||
// 响应式 / 生命移除 / 反弹伤害不触发流血
|
||||
if (result.context.HasAnyTag(AttackTags.Reactive, AttackTags.HpRemoval, AttackTags.Reflected))
|
||||
return;
|
||||
|
||||
int stackAmount = unitedStackSubmodule.stackAmount;
|
||||
result.attacker.Attack(attachedCharacter, stackAmount, null, false, true);
|
||||
var ctx = new AttackContext().WithTag(AttackTags.Reactive).WithTag(AttackTags.GuaranteedHit);
|
||||
attachedCharacter.Attack(attachedCharacter, stackAmount, ctx);
|
||||
}
|
||||
|
||||
private void OnActionStart()
|
||||
@@ -40,8 +47,14 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
//TODO
|
||||
existingBuff = this;
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Bleed", attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
this.actionCountSubmodule = new CountSubmodule(this, initialCount);
|
||||
actionCountSubmodule.onCountChanged = OnCountChanged;
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
generalAttributeSubmodule.numericChange.Add("Speed", -initialCount);
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 祈雨(专注):每回合开始时对全体友方(包括自身)回复少量生命值,持续若干回合。
|
||||
/// 属于专注类 Buff,个数上限由 MaximumFocusingBuffAmount 决定;
|
||||
/// 若已有相同 Buff 存在则直接替换,不叠加持续时间。
|
||||
/// </summary>
|
||||
public class PrayingForRain : CharacterCombatBuffBase
|
||||
{
|
||||
private readonly int healAmount;
|
||||
|
||||
public PrayingForRain(int healAmount, int duration)
|
||||
{
|
||||
this.healAmount = healAmount;
|
||||
|
||||
Initialize(BuffType.Focusing, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("HealAmount", () => this.healAmount.ToString())
|
||||
.AddParameterGetter("Count", () => roundCountSubmodule.remainingCount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
// 回合计数:框架每回合开始时自动 Update(),归零时移除 Buff
|
||||
this.roundCountSubmodule = new CountSubmodule(this, duration);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onRoundStart.Add("PrayingForRain_HealAllies", new PrioritizedAction(() =>
|
||||
{
|
||||
List<CharacterBase> allies = CombatMainManager.Instance.characterController
|
||||
.GetAllAllies(attachedCharacter, includeSelf: true);
|
||||
|
||||
foreach (CharacterBase ally in allies)
|
||||
{
|
||||
ally.Heal(this.healAmount);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 已有相同 Buff:直接替换(重置持续时间),不进行层数处理
|
||||
if (FocusingCheck(out existingBuff))
|
||||
{
|
||||
existingBuff.roundCountSubmodule.Refresh(
|
||||
roundCountSubmodule.maximumCount, keepMaximal: false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c17e1ecf2b40374882e32a068ba9e8b
|
||||
@@ -6,9 +6,9 @@ using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public sealed class Prowess : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
public sealed class Strength : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
public Prowess(int stack)
|
||||
public Strength(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Prowess", attachedCharacter.characterView);
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Strength", attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
@@ -43,14 +43,14 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
public void OnBecomePositive()
|
||||
{
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Prowess_FunctionTextPos".Localize();
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Strength_FunctionTextPos".Localize();
|
||||
buffType = BuffType.Positive;
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public void OnBecomeNegative()
|
||||
{
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Prowess_FunctionTextNeg".Localize();
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Strength_FunctionTextNeg".Localize();
|
||||
buffType = BuffType.Negative;
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
Reference in New Issue
Block a user