Skip to content

Commit aac2eb5

Browse files
committed
2026-04-25 sync
1 parent 80f852f commit aac2eb5

11 files changed

Lines changed: 523 additions & 45 deletions

_config.kira.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ docsTree:
7777
title: 08 添加充能球,
7878
path: /docs/04-ritsulib/04-08-add-orb/,
7979
},
80+
{
81+
title: 09 添加时间线,
82+
path: /docs/04-ritsulib/04-09-add-timeline/,
83+
},
8084
{
8185
title: 11 添加新怪物,
8286
path: /docs/04-ritsulib/04-11-add-monster/,

source/_posts/01-env-setup.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ https://github.com/freude916/sts2-quickRestart/blob/main/README.md
4242

4343
选择一个文本编辑器。可以使用[Visual Studio Code](https://code.visualstudio.com/)或者[Rider](https://www.jetbrains.com/zh-cn/rider/download/?section=windows)(<b>强烈推荐</b>新手使用Rider)。另外也可以使用Visual Studio等其他 IDE。以下只介绍 VS Code 的配置方法。
4444

45+
<b>强烈推荐</b>新手使用Rider
46+
47+
<b>强烈推荐</b>新手使用Rider
48+
49+
<b>强烈推荐</b>新手使用Rider
50+
4551
## 安装VS Code插件(可选)
4652

4753
安装[C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)。你还可以安装[Godot Tools](https://marketplace.visualstudio.com/items?itemName=geequlim.godot-tools)等插件。

source/_posts/03-baselib/03-04-card-properties.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public class MyKeywords
8484

8585
和塔1不同,关键词提示是通过描述染色(`[gold]易伤[/gold]`)然后添加卡牌提示文本实现的。
8686

87+
例如,你给卡牌加上`消耗`就会自动给你加它的提示文本。但是如果你的卡牌没有`消耗`但是描述中是`“消耗一张牌”`,就通过这种方式添加提示文本。
88+
8789
仅需在卡牌类中重载`ExtraHoverTips`即可:
8890

8991
```csharp

source/_posts/03-choose-base-library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ categories:
2727
| 血条覆盖层(中毒灾厄) ||| - |
2828
| 不挂载脚本场景转换 ||| - |
2929
| 人物非spine动画兼容 ||| - |
30-
| customenum ||| baselib支持对任意enum扩展;ritsulib不支持,但统一管理(例如关键词) |
30+
| customenum ||| baselib支持对任意enum扩展;<br>ritsulib不支持,但统一管理(例如关键词) |
3131
| 一代本地化符号 ||| * |
3232
| FMOD音频 | 🚧 || - |
3333
| 缺少资源时占位警告 ||| - |
@@ -39,7 +39,7 @@ categories:
3939
| 卡牌支持AnyPlayer ||| - |
4040
| 快捷键绑定 ||| - |
4141
| 新牌堆 ||| - |
42-
| 内容物ID | 命名空间第一段大写,例如`TEST-TEST_CARD` | modid与分类,例如`TEST_CARD_TEST_CARD` | - |
42+
| 内容物ID | 命名空间第一段大写,<br>例如`TEST-TEST_CARD` | modid与分类,<br>例如`TEST_CARD_TEST_CARD` | - |
4343
| patch | 原始`harmony` | 原始`harmony`以及封装patch系统 | - |
4444
| 非原生玩法内容 ||| 避免重复造轮子。但是会带来臃肿不兼容、抢占patch、抢占你的命名的问题。 |
4545

source/_posts/04-add-new-character.md

Lines changed: 134 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ public class TestCharacter : PlaceholderCharacterModel
120120
public override Color NameColor => new(0.5f, 0.5f, 1f);
121121
// 能量图标轮廓颜色
122122
public override Color EnergyLabelOutlineColor => new(0.1f, 0.1f, 1f);
123-
123+
// 地图绘制颜色
124+
public override Color MapDrawingColor => new(0.5f, 0.5f, 1f);
125+
124126
// 人物性别(男女中立)
125127
public override CharacterGender Gender => CharacterGender.Masculine;
126128

@@ -231,6 +233,8 @@ TestCharacter (Node2D)
231233

232234
![alt text](../../images/image18.png)
233235

236+
* 附赠资源提供了一个单图尽可能覆盖全屏的场景,只要把图片换成你的人物背景图即可。
237+
234238
### 人物动画
235239

236240
* 其中`Visuals`可以更改成任意继承了`Node2D`的类型,例如`SpineSprite``Sprite2D``AnimatedSprite2D`或是`AnimationPlayer`,或者在它之下新建节点都可。
@@ -248,6 +252,7 @@ TestCharacter (Node2D)
248252
`public override string CustomEnergyCounterPath => "res://test/scenes/test_energy_counter.tscn";`
249253

250254
* 建议从原版或者下面的附赠资源处复制一份tscn快速开始。
255+
251256
创建一个`Control`类型的新场景,设定以下结构:
252257

253258
```
@@ -279,9 +284,7 @@ TestCharacterMerchant (Node2D)
279284

280285
* 如果你使用Spine模型,第一个子节点放置`SpineSprite`,且动画名是`relaxed_loop`
281286

282-
* 如果你使用其他动画,创建一个继承了`NMerchantCharacter`的节点,并在`_ready`函数里播放你自己的动画。
283-
284-
* 静态图就不需要了。
287+
* 如果你使用其他动画,创建一个继承了`NMerchantCharacter`的节点,并在`_Ready`函数里播放你自己的动画。静态图就不需要了。
285288

286289
```csharp
287290
using MegaCrit.Sts2.Core.Nodes.Screens.Shops;
@@ -294,6 +297,35 @@ public partial class TestCharacterMerchant : NMerchantCharacter
294297
}
295298
```
296299

300+
## 自定义火堆模型
301+
302+
修改`AssetProfile`里的:
303+
304+
```csharp
305+
Scenes: new(
306+
RestSiteAnimPath: "res://RitsuTest/scenes/test_character_rest_site.tscn"
307+
)
308+
```
309+
* 建议从原版或者下面的附赠资源处复制一份tscn快速开始。
310+
311+
创建一个`Node2D`类型的新场景,设定以下结构:
312+
313+
```
314+
TestCharacterRestSite (Node2D)
315+
├── Node (任意)
316+
└── ControlRoot (Control) %
317+
├── SelectionReticle (Control) %
318+
├── Hitbox (Control) %
319+
├── ThoughtBubbleRight (Control) %
320+
└── ThoughtBubbleLeft (Control) %
321+
```
322+
323+
* 自行更换`Node`的类型制作动画,也可以添加更多节点。人物朝向右边。
324+
325+
* 如果你使用spine模型,代码会找到所有是SpineSprite类型的节点,根据当前幕数播放`overgrowth_loop``hive_loop`或者`glory_loop`动画。这些动画的区别只是光照颜色不同。
326+
327+
* 如果你使用其他动画,只要把Node换成你的类型就行了。可以创建一个自定义脚本(继承`NRestSiteCharacter`)然后自行播放动画。
328+
297329
## 本地化文件
298330

299331
创建`{modId}/localization/{Language}/characters.json`,填写以下内容:
@@ -454,11 +486,12 @@ public partial class TestCharacterMerchant : NMerchantCharacter
454486
<img src="../../images/energy_test_big.png" alt="energy_test_big" style="width:74px; height:74px; object-fit:contain; max-width:none; flex:0 0 auto;" />
455487
</div>
456488

457-
`test_bg.tscn`:
489+
### test_bg.tscn
490+
458491
```tscn
459492
[gd_scene load_steps=2 format=3 uid="uid://cejqjeipgqe0n"]
460493
461-
[ext_resource type="Texture2D" uid="uid://ddxmxgyyfy8mn" path="res://icon.svg" id="1_c8lhi"]
494+
[ext_resource type="Texture2D" uid="uid://hn2nofekpwrp" path="res://icon.svg" id="1_c8lhi"]
462495
463496
[node name="TestBg" type="Control"]
464497
layout_mode = 3
@@ -467,36 +500,51 @@ anchor_left = 0.5
467500
anchor_top = 0.5
468501
anchor_right = 0.5
469502
anchor_bottom = 0.5
470-
offset_left = -1790.0
471-
offset_top = -1043.0
472-
offset_right = 1790.0
473-
offset_bottom = 1043.0
503+
offset_left = -960.0
504+
offset_top = -540.0
505+
offset_right = 1600.0
506+
offset_bottom = 660.0
474507
grow_horizontal = 2
475508
grow_vertical = 2
476-
metadata/_edit_lock_ = true
509+
pivot_offset = Vector2(1280, 600)
477510
478-
[node name="ColorRect" type="ColorRect" parent="."]
511+
[node name="Control" type="Control" parent="."]
512+
layout_mode = 1
513+
anchors_preset = 8
514+
anchor_left = 0.5
515+
anchor_top = 0.5
516+
anchor_right = 0.5
517+
anchor_bottom = 0.5
518+
offset_left = -1280.0
519+
offset_top = -600.0
520+
offset_right = 640.0
521+
offset_bottom = 478.0
522+
grow_horizontal = 2
523+
grow_vertical = 2
524+
525+
[node name="ColorRect" type="ColorRect" parent="Control"]
479526
layout_mode = 1
480527
anchors_preset = 15
481528
anchor_right = 1.0
482529
anchor_bottom = 1.0
483530
grow_horizontal = 2
484531
grow_vertical = 2
485532
color = Color(0.44705883, 0.49803922, 1, 1)
486-
metadata/_edit_lock_ = true
487533
488-
[node name="Icon" type="TextureRect" parent="."]
534+
[node name="Icon" type="TextureRect" parent="Control"]
489535
layout_mode = 1
490-
anchors_preset = -1
536+
anchors_preset = 15
491537
anchor_right = 1.0
492538
anchor_bottom = 1.0
493-
offset_left = 1774.0
494-
offset_top = 792.0
495-
offset_right = -1259.0
496-
offset_bottom = -747.0
539+
offset_left = -28.0
540+
offset_top = 67.0
541+
offset_right = 612.0
542+
offset_bottom = 189.0
497543
grow_horizontal = 2
498544
grow_vertical = 2
545+
scale = Vector2(0.82, 0.82)
499546
texture = ExtResource("1_c8lhi")
547+
expand_mode = 1
500548
501549
[node name="ash1" type="CPUParticles2D" parent="."]
502550
position = Vector2(1832, -17)
@@ -530,7 +578,8 @@ scale_amount_max = 10.0
530578
color = Color(0.121879734, 0.15283081, 0.33476263, 1)
531579
```
532580

533-
`test_character.tscn`:
581+
### test_character.tscn
582+
534583
```tscn
535584
[gd_scene load_steps=2 format=3 uid="uid://c4dnpxxd6ldei"]
536585
@@ -560,7 +609,7 @@ unique_name_in_owner = true
560609
position = Vector2(0, -72)
561610
```
562611

563-
`test_energy_counter.tscn`:
612+
### test_energy_counter.tscn
564613

565614
```tscn
566615
[gd_scene load_steps=2 format=3 uid="uid://cs3a5onikvhi4"]
@@ -630,3 +679,67 @@ text = "3/3"
630679
horizontal_alignment = 1
631680
vertical_alignment = 1
632681
```
682+
### test_character_merchant.tscn
683+
```tscn
684+
[gd_scene load_steps=2 format=3 uid="uid://pdy0teckf4i"]
685+
686+
[ext_resource type="Texture2D" uid="uid://hn2nofekpwrp" path="res://icon.svg" id="1_diepv"]
687+
688+
[node name="IroncladMerchant" type="Node2D"]
689+
690+
[node name="Icon" type="Sprite2D" parent="."]
691+
texture = ExtResource("1_diepv")
692+
```
693+
694+
### test_character_rest_site.tscn
695+
```tscn
696+
[gd_scene load_steps=2 format=3 uid="uid://bkft7e41sjfud"]
697+
698+
[ext_resource type="Texture2D" uid="uid://hn2nofekpwrp" path="res://icon.svg" id="1_74iws"]
699+
700+
[node name="TestCharacterRestSite" type="Node2D"]
701+
702+
[node name="Sprite" type="Sprite2D" parent="."]
703+
texture = ExtResource("1_74iws")
704+
705+
[node name="Sprite2" type="Sprite2D" parent="."]
706+
position = Vector2(75, -58)
707+
texture = ExtResource("1_74iws")
708+
709+
[node name="ControlRoot" type="Control" parent="."]
710+
layout_mode = 3
711+
anchors_preset = 0
712+
713+
[node name="SelectionReticle" type="Control" parent="ControlRoot"]
714+
unique_name_in_owner = true
715+
anchors_preset = 0
716+
offset_left = -153.0
717+
offset_top = -350.0
718+
offset_right = 267.0
719+
offset_bottom = 320.0
720+
721+
[node name="Hitbox" type="Control" parent="ControlRoot"]
722+
unique_name_in_owner = true
723+
anchors_preset = 0
724+
offset_left = -155.0
725+
offset_top = -165.0
726+
offset_right = 154.0
727+
offset_bottom = 166.0
728+
729+
[node name="ThoughtBubbleRight" type="Control" parent="ControlRoot"]
730+
unique_name_in_owner = true
731+
anchors_preset = 0
732+
offset_left = 121.0
733+
offset_top = -125.0
734+
offset_right = 121.0
735+
offset_bottom = -125.0
736+
737+
[node name="ThoughtBubbleLeft" type="Control" parent="ControlRoot"]
738+
unique_name_in_owner = true
739+
anchors_preset = 0
740+
offset_left = -113.0
741+
offset_top = -95.0
742+
offset_right = -113.0
743+
offset_bottom = -95.0
744+
745+
```

source/_posts/04-ritsulib/04-01-add-card.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace Test.Scripts;
3434

3535
// 注册卡牌
3636
[RegisterCard(typeof(TestCardPool))]
37-
// 注册成人物起始卡。不需要删除即可。
37+
// 注册成人物起始卡,后面是数量。不需要删除即可。
3838
[RegisterCharacterStarterCard(typeof(TestCharacter), 5)]
3939
public class TestCard : ModCardTemplate
4040
{
@@ -122,6 +122,8 @@ using STS2RitsuLib.Scaffolding.Content;
122122

123123
namespace Test.Scripts;
124124

125+
// 设置Inherit为true允许自动注册该类的所有子类
126+
[RegisterCard(typeof(TestCardPool), Inherit = true)]
125127
public abstract class TestCardModel : ModCardTemplate
126128
{
127129
public override CardAssetProfile AssetProfile => new(

source/_posts/04-ritsulib/04-04-card-properties.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ public class MyKeywords
9090

9191
和塔1不同,关键词提示是通过描述染色(`[gold]易伤[/gold]`)然后添加卡牌提示文本实现的。
9292

93+
例如,你给卡牌加上`消耗`就会自动给你加它的提示文本。但是如果你的卡牌没有`消耗`但是描述中是`“消耗一张牌”`,就通过这种方式添加提示文本。
94+
9395
仅需在卡牌类中重载`AdditionalHoverTips`即可:
9496

9597
```csharp

0 commit comments

Comments
 (0)