@@ -120,7 +120,9 @@ public class TestCharacter : PlaceholderCharacterModel
120120 public override Color NameColor => new (0 . 5 f , 0 . 5 f , 1 f );
121121 // 能量图标轮廓颜色
122122 public override Color EnergyLabelOutlineColor => new (0 . 1 f , 0 . 1 f , 1 f );
123-
123+ // 地图绘制颜色
124+ public override Color MapDrawingColor => new (0 . 5 f , 0 . 5 f , 1 f );
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
287290using 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"]
464497layout_mode = 3
@@ -467,36 +500,51 @@ anchor_left = 0.5
467500anchor_top = 0.5
468501anchor_right = 0.5
469502anchor_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
474507grow_horizontal = 2
475508grow_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"]
479526layout_mode = 1
480527anchors_preset = 15
481528anchor_right = 1.0
482529anchor_bottom = 1.0
483530grow_horizontal = 2
484531grow_vertical = 2
485532color = 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 "]
489535layout_mode = 1
490- anchors_preset = -1
536+ anchors_preset = 15
491537anchor_right = 1.0
492538anchor_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
497543grow_horizontal = 2
498544grow_vertical = 2
545+ scale = Vector2(0.82, 0.82)
499546texture = ExtResource("1_c8lhi")
547+ expand_mode = 1
500548
501549[node name="ash1" type="CPUParticles2D" parent="."]
502550position = Vector2(1832, -17)
@@ -530,7 +578,8 @@ scale_amount_max = 10.0
530578color = 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
560609position = 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"
630679horizontal_alignment = 1
631680vertical_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+ ```
0 commit comments