@@ -113,7 +113,9 @@ public class TestCharacter : PlaceholderCharacterModel
113113 public override Color NameColor => new (0 . 5 f , 0 . 5 f , 1 f );
114114 // 能量图标轮廓颜色
115115 public override Color EnergyLabelOutlineColor => new (0 . 1 f , 0 . 1 f , 1 f );
116-
116+ // 地图绘制颜色
117+ public override Color MapDrawingColor => new (0 . 5 f , 0 . 5 f , 1 f );
118+
117119 // 人物性别(男女中立)
118120 public override CharacterGender Gender => CharacterGender .Masculine ;
119121
@@ -224,6 +226,8 @@ TestCharacter (Node2D)
224226
225227![ alt text] ( ../../images/image18.png )
226228
229+ * 附赠资源提供了一个单图尽可能覆盖全屏的场景,只要把图片换成你的人物背景图即可。
230+
227231### 人物动画
228232
229233* 其中` Visuals ` 可以更改成任意继承了` Node2D ` 的类型,例如` SpineSprite ` ,` Sprite2D ` ,` AnimatedSprite2D ` 或是` AnimationPlayer ` ,或者在它之下新建节点都可。
@@ -241,6 +245,7 @@ TestCharacter (Node2D)
241245` public override string CustomEnergyCounterPath => "res://test/scenes/test_energy_counter.tscn"; `
242246
243247* 建议从原版或者下面的附赠资源处复制一份tscn快速开始。
248+
244249创建一个` Control ` 类型的新场景,设定以下结构:
245250
246251```
@@ -272,9 +277,7 @@ TestCharacterMerchant (Node2D)
272277
273278* 如果你使用Spine模型,第一个子节点放置` SpineSprite ` ,且动画名是` relaxed_loop ` 。
274279
275- * 如果你使用其他动画,创建一个继承了` NMerchantCharacter ` 的节点,并在` _ready ` 函数里播放你自己的动画。
276-
277- * 静态图就不需要了。
280+ * 如果你使用其他动画,创建一个继承了` NMerchantCharacter ` 的节点,并在` _Ready ` 函数里播放你自己的动画。静态图就不需要了。
278281
279282``` csharp
280283using MegaCrit .Sts2 .Core .Nodes .Screens .Shops ;
@@ -287,6 +290,35 @@ public partial class TestCharacterMerchant : NMerchantCharacter
287290}
288291```
289292
293+ ## 自定义火堆模型
294+
295+ 修改` AssetProfile ` 里的:
296+
297+ ``` csharp
298+ Scenes : new (
299+ RestSiteAnimPath : " res://RitsuTest/scenes/test_character_rest_site.tscn"
300+ )
301+ ```
302+ * 建议从原版或者下面的附赠资源处复制一份tscn快速开始。
303+
304+ 创建一个` Node2D ` 类型的新场景,设定以下结构:
305+
306+ ```
307+ TestCharacterRestSite (Node2D)
308+ ├── Node (任意)
309+ └── ControlRoot (Control) %
310+ ├── SelectionReticle (Control) %
311+ ├── Hitbox (Control) %
312+ ├── ThoughtBubbleRight (Control) %
313+ └── ThoughtBubbleLeft (Control) %
314+ ```
315+
316+ * 自行更换` Node ` 的类型制作动画,也可以添加更多节点。人物朝向右边。
317+
318+ * 如果你使用spine模型,代码会找到所有是SpineSprite类型的节点,根据当前幕数播放` overgrowth_loop ` 、` hive_loop ` 或者` glory_loop ` 动画。这些动画的区别只是光照颜色不同。
319+
320+ * 如果你使用其他动画,只要把Node换成你的类型就行了。可以创建一个自定义脚本(继承` NRestSiteCharacter ` )然后自行播放动画。
321+
290322## 本地化文件
291323
292324创建` {modId}/localization/{Language}/characters.json ` ,填写以下内容:
@@ -447,11 +479,12 @@ public partial class TestCharacterMerchant : NMerchantCharacter
447479 <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;" />
448480</div >
449481
450- ` test_bg.tscn ` :
482+ ### test_bg.tscn
483+
451484``` tscn
452485[gd_scene load_steps=2 format=3 uid="uid://cejqjeipgqe0n"]
453486
454- [ext_resource type="Texture2D" uid="uid://ddxmxgyyfy8mn " path="res://icon.svg" id="1_c8lhi"]
487+ [ext_resource type="Texture2D" uid="uid://hn2nofekpwrp " path="res://icon.svg" id="1_c8lhi"]
455488
456489[node name="TestBg" type="Control"]
457490layout_mode = 3
@@ -460,36 +493,51 @@ anchor_left = 0.5
460493anchor_top = 0.5
461494anchor_right = 0.5
462495anchor_bottom = 0.5
463- offset_left = -1790 .0
464- offset_top = -1043 .0
465- offset_right = 1790 .0
466- offset_bottom = 1043 .0
496+ offset_left = -960 .0
497+ offset_top = -540 .0
498+ offset_right = 1600 .0
499+ offset_bottom = 660 .0
467500grow_horizontal = 2
468501grow_vertical = 2
469- metadata/_edit_lock_ = true
502+ pivot_offset = Vector2(1280, 600)
470503
471- [node name="ColorRect" type="ColorRect" parent="."]
504+ [node name="Control" type="Control" parent="."]
505+ layout_mode = 1
506+ anchors_preset = 8
507+ anchor_left = 0.5
508+ anchor_top = 0.5
509+ anchor_right = 0.5
510+ anchor_bottom = 0.5
511+ offset_left = -1280.0
512+ offset_top = -600.0
513+ offset_right = 640.0
514+ offset_bottom = 478.0
515+ grow_horizontal = 2
516+ grow_vertical = 2
517+
518+ [node name="ColorRect" type="ColorRect" parent="Control"]
472519layout_mode = 1
473520anchors_preset = 15
474521anchor_right = 1.0
475522anchor_bottom = 1.0
476523grow_horizontal = 2
477524grow_vertical = 2
478525color = Color(0.44705883, 0.49803922, 1, 1)
479- metadata/_edit_lock_ = true
480526
481- [node name="Icon" type="TextureRect" parent=". "]
527+ [node name="Icon" type="TextureRect" parent="Control "]
482528layout_mode = 1
483- anchors_preset = -1
529+ anchors_preset = 15
484530anchor_right = 1.0
485531anchor_bottom = 1.0
486- offset_left = 1774 .0
487- offset_top = 792 .0
488- offset_right = -1259 .0
489- offset_bottom = -747 .0
532+ offset_left = -28 .0
533+ offset_top = 67 .0
534+ offset_right = 612 .0
535+ offset_bottom = 189 .0
490536grow_horizontal = 2
491537grow_vertical = 2
538+ scale = Vector2(0.82, 0.82)
492539texture = ExtResource("1_c8lhi")
540+ expand_mode = 1
493541
494542[node name="ash1" type="CPUParticles2D" parent="."]
495543position = Vector2(1832, -17)
@@ -523,7 +571,8 @@ scale_amount_max = 10.0
523571color = Color(0.121879734, 0.15283081, 0.33476263, 1)
524572```
525573
526- ` test_character.tscn ` :
574+ ### test_character.tscn
575+
527576``` tscn
528577[gd_scene load_steps=2 format=3 uid="uid://c4dnpxxd6ldei"]
529578
@@ -553,7 +602,7 @@ unique_name_in_owner = true
553602position = Vector2(0, -72)
554603```
555604
556- ` test_energy_counter.tscn ` :
605+ ### test_energy_counter.tscn
557606
558607``` tscn
559608[gd_scene load_steps=2 format=3 uid="uid://cs3a5onikvhi4"]
@@ -622,4 +671,68 @@ theme_override_font_sizes/font_size = 36
622671text = "3/3"
623672horizontal_alignment = 1
624673vertical_alignment = 1
674+ ```
675+ ### test_character_merchant.tscn
676+ ``` tscn
677+ [gd_scene load_steps=2 format=3 uid="uid://pdy0teckf4i"]
678+
679+ [ext_resource type="Texture2D" uid="uid://hn2nofekpwrp" path="res://icon.svg" id="1_diepv"]
680+
681+ [node name="IroncladMerchant" type="Node2D"]
682+
683+ [node name="Icon" type="Sprite2D" parent="."]
684+ texture = ExtResource("1_diepv")
685+ ```
686+
687+ ### test_character_rest_site.tscn
688+ ``` tscn
689+ [gd_scene load_steps=2 format=3 uid="uid://bkft7e41sjfud"]
690+
691+ [ext_resource type="Texture2D" uid="uid://hn2nofekpwrp" path="res://icon.svg" id="1_74iws"]
692+
693+ [node name="TestCharacterRestSite" type="Node2D"]
694+
695+ [node name="Sprite" type="Sprite2D" parent="."]
696+ texture = ExtResource("1_74iws")
697+
698+ [node name="Sprite2" type="Sprite2D" parent="."]
699+ position = Vector2(75, -58)
700+ texture = ExtResource("1_74iws")
701+
702+ [node name="ControlRoot" type="Control" parent="."]
703+ layout_mode = 3
704+ anchors_preset = 0
705+
706+ [node name="SelectionReticle" type="Control" parent="ControlRoot"]
707+ unique_name_in_owner = true
708+ anchors_preset = 0
709+ offset_left = -153.0
710+ offset_top = -350.0
711+ offset_right = 267.0
712+ offset_bottom = 320.0
713+
714+ [node name="Hitbox" type="Control" parent="ControlRoot"]
715+ unique_name_in_owner = true
716+ anchors_preset = 0
717+ offset_left = -155.0
718+ offset_top = -165.0
719+ offset_right = 154.0
720+ offset_bottom = 166.0
721+
722+ [node name="ThoughtBubbleRight" type="Control" parent="ControlRoot"]
723+ unique_name_in_owner = true
724+ anchors_preset = 0
725+ offset_left = 121.0
726+ offset_top = -125.0
727+ offset_right = 121.0
728+ offset_bottom = -125.0
729+
730+ [node name="ThoughtBubbleLeft" type="Control" parent="ControlRoot"]
731+ unique_name_in_owner = true
732+ anchors_preset = 0
733+ offset_left = -113.0
734+ offset_top = -95.0
735+ offset_right = -113.0
736+ offset_bottom = -95.0
737+
625738```
0 commit comments