Reme

手牌泛光

原版

如果你只想发黄光和红光,直接在你的卡牌类里重写以下属性即可:

1
2
3
4
5
// 何时发金色光
protected override bool ShouldGlowGoldInternal => Owner.Creature.GetPowerAmount<TestPower>() > 5;

// 何时发红色光
protected override bool ShouldGlowRedInternal => !Owner.Creature.HasPower<TestPower>();

任意发光

ritsulib提供发任意颜色光的能力。可以在初始化函数Entry.Init中注册。

1
2
3
4
5
6
7
8
9
10
11
public static void Init()
{
var ctx = RitsuLibFramework.CreateContentPack(ModId)
.CardHandOutline<TestCard>(new ModCardHandOutlineRule( // 特定种类卡牌。可以设置为你的卡牌基类,让所有子类发光。
card => card.Owner.Creature.CurrentHp <= 10, // 发光条件
Colors.Purple // 发光颜色
// 0, // (可选)优先级。更高的才会展示。
// false // 不可打出时隐藏边框
))
.Apply();
}
Author: Reme
Link:https://glitchedreme.github.io/SlayTheSpire2ModdingTutorials/docs/04-ritsulib/04-19-hand-outline/
版权声明:本文采用 CC BY-NC-SA 4.0 CN 协议进行许可