添加新能力
新建类:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public class TestPower : CustomPowerModel { public override PowerType Type => PowerType.Buff; public override PowerStackType StackType => PowerStackType.Counter;
public override string? CustomPackedIconPath => "res://test/powers/test_power.png"; public override string? CustomBigIconPath => "res://test/powers/test_power.png";
public override async Task AfterCardDrawn(PlayerChoiceContext choiceContext, CardModel card, bool fromHandDraw) { await PowerCmd.Apply<StrengthPower>(Owner, Amount, Owner, null); } }
|
添加json,{modId}/localization/{Language}/powers.json。
1 2 3 4 5
| { "TEST-TEST_POWER.description": "每次抽牌时,获得一点[gold]力量[/gold]。", "TEST-TEST_POWER.smartDescription": "每次抽牌时,获得[blue]{Amount}[/blue]点[gold]力量[/gold]。", "TEST-TEST_POWER.title": "邪火" }
|
然后使用PowerCmd.Apply<TestPower>(...)给予即可。或者使用控制台power TEST-TEST_POWER 1 0。
![alt text]()