diff --git a/data/itemRegs/items.yaml b/data/itemRegs/items.yaml new file mode 100644 index 0000000..499790a --- /dev/null +++ b/data/itemRegs/items.yaml @@ -0,0 +1,10 @@ +#Register spells used by the projectile here. +#在这里注册抛射体使用的法术。 +#Note: The id must be the same as the item id in the scene. Otherwise, an ArgumentException will be thrown. +#备注:id必须和场景内的物品id保持一致。否则会抛出ArgumentException。 +#After you declare the id of the item, add the corresponding localized text to the csv file in the locals' folder. For example, if the id is a corresponding name is item_a and the corresponding description is item_a_desc. +#当您声明物品的id后,请在locals文件夹中的csv文件中添加相应的本地化文本。例如:id为a,则对应的名称为item_a,对应的描述为item_a_desc。 +- id: resignation_certificate + scene_path: res://prefab/items/resignationCertificate.tscn + icon_path: res://sprites/projectile/resignationCertificate.png + max_stack_value: 1 \ No newline at end of file diff --git a/data/levelGraphs/test.yaml b/data/levelGraphs/test.yaml index b3b1f4f..1945392 100644 --- a/data/levelGraphs/test.yaml +++ b/data/levelGraphs/test.yaml @@ -19,39 +19,297 @@ connection_data_list: to_id: 7e3ae680-3d7e-4ae9-b82f-5bfbe1c2f613 from_port: 0 to_port: 0 + - from_id: c0255eb6-2c75-44f7-9058-0921fe8fb0d8 + to_id: 46d8c16d-66fb-409e-b02a-7825dcf59796 + from_port: 0 + to_port: 0 + - from_id: 7e3ae680-3d7e-4ae9-b82f-5bfbe1c2f613 + to_id: 20b486d3-3558-4d4a-b67b-d6df08e66a6a + from_port: 0 + to_port: 0 + - from_id: 7e3ae680-3d7e-4ae9-b82f-5bfbe1c2f613 + to_id: 012795b2-297c-404a-b96f-dff8a6b6a720 + from_port: 0 + to_port: 0 + - from_id: 012795b2-297c-404a-b96f-dff8a6b6a720 + to_id: 7eba7a72-88c9-4018-82db-100c9521938b + from_port: 0 + to_port: 0 + - from_id: 46d8c16d-66fb-409e-b02a-7825dcf59796 + to_id: 5e27b3cd-7de8-4476-b96f-199ffce9b10c + from_port: 0 + to_port: 0 + - from_id: 46d8c16d-66fb-409e-b02a-7825dcf59796 + to_id: 43d7c799-3db5-4b13-b160-f9133f15a970 + from_port: 0 + to_port: 0 + - from_id: 7eba7a72-88c9-4018-82db-100c9521938b + to_id: a54cf238-a368-4979-abb2-3a435b726d29 + from_port: 0 + to_port: 0 + - from_id: 20b486d3-3558-4d4a-b67b-d6df08e66a6a + to_id: e69c3d51-11d3-408f-bfc8-b955183e2abe + from_port: 0 + to_port: 0 + - from_id: e69c3d51-11d3-408f-bfc8-b955183e2abe + to_id: 27111bc7-cbbd-4a4f-9fe6-cf3948f74efd + from_port: 0 + to_port: 0 + - from_id: 27111bc7-cbbd-4a4f-9fe6-cf3948f74efd + to_id: 7e5d5fd3-1255-4523-8057-377a4fbd50d8 + from_port: 0 + to_port: 0 + - from_id: 5e27b3cd-7de8-4476-b96f-199ffce9b10c + to_id: 4129b4a0-a02e-4751-9ca8-b2bc1c679b02 + from_port: 0 + to_port: 0 + - from_id: 4129b4a0-a02e-4751-9ca8-b2bc1c679b02 + to_id: fb77ea9a-fd4d-4fc8-92a4-1e5d4d1219a8 + from_port: 0 + to_port: 0 + - from_id: fb77ea9a-fd4d-4fc8-92a4-1e5d4d1219a8 + to_id: 0aa908bd-b5fe-4a80-8e74-9a862d7c9af0 + from_port: 0 + to_port: 0 + - from_id: 43d7c799-3db5-4b13-b160-f9133f15a970 + to_id: dff8a1e6-a5ae-41b4-b136-95729bf3a8d3 + from_port: 0 + to_port: 0 + - from_id: dff8a1e6-a5ae-41b4-b136-95729bf3a8d3 + to_id: 676ba8a3-9ac8-4606-858e-5aa3b3e5101c + from_port: 0 + to_port: 0 + - from_id: 676ba8a3-9ac8-4606-858e-5aa3b3e5101c + to_id: 80c69468-6558-4c12-86cd-7ba6533d3758 + from_port: 0 + to_port: 0 + - from_id: 0aa908bd-b5fe-4a80-8e74-9a862d7c9af0 + to_id: c6f9bd56-5025-40f6-97b9-1e73eac1c5f6 + from_port: 0 + to_port: 0 + - from_id: 7e5d5fd3-1255-4523-8057-377a4fbd50d8 + to_id: 03896855-9956-4442-909c-7d633fa97ed9 + from_port: 0 + to_port: 0 + - from_id: 80c69468-6558-4c12-86cd-7ba6533d3758 + to_id: d43494e4-0ec3-4e29-a617-6a3ff7727a11 + from_port: 0 + to_port: 0 room_node_data_list: - - id: c0255eb6-2c75-44f7-9058-0921fe8fb0d8 - title: 起点房间 - description: 测试的起点房间。 - room_template_set: - - 'res://prefab/roomTemplates/dungeon/initialRoom.tscn' - tags: - - StartingRoom - room_injection_processor_data: null - - id: ba32e05c-0c80-4a79-b5ce-5b8150400e05 - title: 房间3 - description: '' - room_template_set: - - 'res://prefab/roomTemplates/dungeon/' - tags: null - - id: 4ae948ea-82b7-4b2d-bec2-19ed8a9d4c03 - title: 大厅 - description: 比普通房间要大一些的房间,有多个门,用于连接到其他房间。 - room_template_set: - - 'res://prefab/roomTemplates/dungeon/utilityRoom.tscn' - tags: null - room_injection_processor_data: null - id: 8b3d645a-96c0-407e-871d-6f4a0b69557b title: 房间4 description: '' room_template_set: - - 'res://prefab/roomTemplates/dungeon/' - tags: null + - res://prefab/roomTemplates/dungeon/ + tags: room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: ba32e05c-0c80-4a79-b5ce-5b8150400e05 + title: 房间3 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: + enter_room_event_handler_id: + exit_room_event_handler_id: - id: 7e3ae680-3d7e-4ae9-b82f-5bfbe1c2f613 title: 房间5 description: '' room_template_set: - - 'res://prefab/roomTemplates/dungeon/' - tags: null + - res://prefab/roomTemplates/dungeon/ + tags: room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 20b486d3-3558-4d4a-b67b-d6df08e66a6a + title: 房间7 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 012795b2-297c-404a-b96f-dff8a6b6a720 + title: 房间8 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 46d8c16d-66fb-409e-b02a-7825dcf59796 + title: 房间6 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 7eba7a72-88c9-4018-82db-100c9521938b + title: 房间9 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 5e27b3cd-7de8-4476-b96f-199ffce9b10c + title: 房间10 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: a54cf238-a368-4979-abb2-3a435b726d29 + title: 房间12 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: e69c3d51-11d3-408f-bfc8-b955183e2abe + title: 房间13 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 4ae948ea-82b7-4b2d-bec2-19ed8a9d4c03 + title: 大厅 + description: 比普通房间要大一些的房间,有多个门,用于连接到其他房间。 + room_template_set: + - res://prefab/roomTemplates/dungeon/utilityRoom.tscn + tags: + room_injection_processor_data: + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: c0255eb6-2c75-44f7-9058-0921fe8fb0d8 + title: 起点房间 + description: 测试的起点房间。 + room_template_set: + - res://prefab/roomTemplates/dungeon/initialRoom.tscn + tags: + - StartingRoom + room_injection_processor_data: + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 27111bc7-cbbd-4a4f-9fe6-cf3948f74efd + title: 房间15 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 7e5d5fd3-1255-4523-8057-377a4fbd50d8 + title: 房间14 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 4129b4a0-a02e-4751-9ca8-b2bc1c679b02 + title: 房间17 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: fb77ea9a-fd4d-4fc8-92a4-1e5d4d1219a8 + title: 房间18 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 0aa908bd-b5fe-4a80-8e74-9a862d7c9af0 + title: 房间19 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 43d7c799-3db5-4b13-b160-f9133f15a970 + title: 房间11 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 676ba8a3-9ac8-4606-858e-5aa3b3e5101c + title: 房间23 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: dff8a1e6-a5ae-41b4-b136-95729bf3a8d3 + title: 房间20 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 80c69468-6558-4c12-86cd-7ba6533d3758 + title: 房间24 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: c6f9bd56-5025-40f6-97b9-1e73eac1c5f6 + title: 房间22 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: 03896855-9956-4442-909c-7d633fa97ed9 + title: 房间21 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: + - id: d43494e4-0ec3-4e29-a617-6a3ff7727a11 + title: 房间16 + description: '' + room_template_set: + - res://prefab/roomTemplates/dungeon/ + tags: + room_injection_processor_data: '' + enter_room_event_handler_id: + exit_room_event_handler_id: \ No newline at end of file diff --git a/locals/DeathInfo.csv b/locals/DeathInfo.csv index f54fa09..a03fb71 100644 --- a/locals/DeathInfo.csv +++ b/locals/DeathInfo.csv @@ -3,6 +3,9 @@ id,zh,en,ja #自杀 death_info_self_1,{0}误伤了自己。,{0} accidentally shot themself.,{0}誤って自分を傷つけました。 death_info_self_2,{0}忘记了瞄准。,{0} forgot to aim.,{0}照準を忘れました。 +#Died reading a separation certificate. +#死于阅读离职证明。 +death_info_resignation_certificate,{0}阅读冷薄荷的离职证明被毒害了!(你知道的太多了),{0} Read Cold Mint's separation certificate was poisoned!(You know too much),{0}コールドミントの離職証明書を読んで毒されました!(あなたは知りすぎです) #Default death message #默认死亡信息 death_info_default,{0}被{1}杀死了。,{0} is killed by {1}.,{0}は{1}に殺されました。 \ No newline at end of file diff --git a/locals/Item.csv b/locals/Item.csv index 2edbad0..4d2ca1c 100644 --- a/locals/Item.csv +++ b/locals/Item.csv @@ -6,4 +6,6 @@ item_portable_backpacks_desc,为玩家提供9个物品槽。,Provides 9 item slo item_necromancy,死灵法术,necromancy,ネクロマンシー item_necromancy_desc,法术的实体化弹丸。,The materialized projectile of a spell.,術の実体化した弾丸です。 item_x3,三重射击法术,Triple shot spell,三重射撃術です -item_x3_desc,使发射器一次射出三颗弹丸。,Make the launcher shoot three pellets at a time.,発射機から一度に三つの弾丸を発射させます。 \ No newline at end of file +item_x3_desc,使发射器一次射出三颗弹丸。,Make the launcher shoot three pellets at a time.,発射機から一度に三つの弾丸を発射させます。 +item_resignation_certificate,离职证明,Resignation certificate,退職証明書です +item_resignation_certificate_desc,冷薄荷,感谢您在职时为公司做出的贡献。,"Cold Mint, thank you for your service to the company.",コールドミント、現役時代のご貢献ありがとうございました。 \ No newline at end of file diff --git a/prefab/items/resignationCertificate.tscn b/prefab/items/resignationCertificate.tscn new file mode 100644 index 0000000..a5c5197 --- /dev/null +++ b/prefab/items/resignationCertificate.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=6 format=3 uid="uid://cj36fjtrlo03t"] + +[ext_resource type="Script" path="res://scripts/inventory/ResignationCertificate.cs" id="1_nydte"] +[ext_resource type="AudioStream" uid="uid://cak6chjjsu7wo" path="res://sounds/fire.wav" id="2_ei0j2"] +[ext_resource type="Texture2D" uid="uid://dyfqdpdlq286h" path="res://sprites/projectile/resignationCertificate.png" id="3_jwff2"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ujexv"] +radius = 6.0 +height = 21.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xnc20"] +radius = 6.0 +height = 21.0 + +[node name="Resignation certificate" type="RigidBody2D"] +collision_layer = 8 +collision_mask = 34 +angular_damp = -1.0 +script = ExtResource("1_nydte") + +[node name="DamageArea2D" type="Area2D" parent="."] +collision_layer = 8 +collision_mask = 102 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageArea2D"] +position = Vector2(1, 0.5) +shape = SubResource("CapsuleShape2D_ujexv") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(1, 0.5) +shape = SubResource("CapsuleShape2D_xnc20") + +[node name="Marker2D" type="Marker2D" parent="."] +position = Vector2(65, 0) + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="Marker2D"] +stream = ExtResource("2_ei0j2") +bus = &"SoundEffect" + +[node name="TipLabel" type="Label" parent="."] +offset_left = -19.0 +offset_top = 23.0 +offset_right = 21.0 +offset_bottom = 48.0 + +[node name="CurseOfTheUndead" type="Sprite2D" parent="."] + +[node name="X3" type="Sprite2D" parent="."] +texture = ExtResource("3_jwff2") diff --git a/prefab/roomTemplates/dungeon/chest.tscn b/prefab/roomTemplates/dungeon/chest.tscn index bdbf478..aef0f91 100644 --- a/prefab/roomTemplates/dungeon/chest.tscn +++ b/prefab/roomTemplates/dungeon/chest.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=9 format=4 uid="uid://br778i2b0skil"] +[gd_scene load_steps=10 format=4 uid="uid://br778i2b0skil"] [ext_resource type="Script" path="res://scripts/map/AiCharacterSpawn.cs" id="1_y2vgj"] [ext_resource type="TileSet" uid="uid://c4wpp12rr44hi" path="res://tileSets/dungeon.tres" id="2_ngfnn"] [ext_resource type="Texture2D" uid="uid://drw45jlmfo0su" path="res://sprites/light/White_100.png" id="3_r2p3x"] +[ext_resource type="PackedScene" uid="uid://djsh4unystlf0" path="res://prefab/furnitures/SpellEditor.tscn" id="4_rean8"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_kiih8"] size = Vector2(505, 186) @@ -85,3 +86,6 @@ visible = false position = Vector2(256, 96.5) scale = Vector2(15.875, 5.96875) texture = ExtResource("3_r2p3x") + +[node name="RigidBody2D" parent="." instance=ExtResource("4_rean8")] +position = Vector2(239, 101) diff --git a/prefab/roomTemplates/dungeon/initialRoom.tscn b/prefab/roomTemplates/dungeon/initialRoom.tscn index c809ed2..96e74bc 100644 --- a/prefab/roomTemplates/dungeon/initialRoom.tscn +++ b/prefab/roomTemplates/dungeon/initialRoom.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=9 format=4 uid="uid://du5ldsp613fei"] +[gd_scene load_steps=8 format=4 uid="uid://du5ldsp613fei"] [ext_resource type="TileSet" uid="uid://c4wpp12rr44hi" path="res://tileSets/dungeon.tres" id="1_rn2om"] [ext_resource type="Script" path="res://scripts/map/PlayerSpawn.cs" id="2_6p8mv"] [ext_resource type="Script" path="res://scripts/map/ItemSpawn.cs" id="3_v1tlc"] [ext_resource type="Texture2D" uid="uid://drw45jlmfo0su" path="res://sprites/light/White_100.png" id="5_4pssd"] -[ext_resource type="PackedScene" uid="uid://djsh4unystlf0" path="res://prefab/furnitures/SpellEditor.tscn" id="5_7c8bh"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_kiih8"] size = Vector2(507, 251) @@ -60,6 +59,11 @@ position = Vector2(321, 118) script = ExtResource("3_v1tlc") ItemId = "necromancy" +[node name="ItemMarker2D5" type="Marker2D" parent="."] +position = Vector2(381, 136) +script = ExtResource("3_v1tlc") +ItemId = "resignation_certificate" + [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] navigation_polygon = SubResource("NavigationPolygon_064c7") @@ -91,7 +95,3 @@ visible = false position = Vector2(259.5, 128.5) scale = Vector2(16.0312, 7.96875) texture = ExtResource("5_4pssd") - -[node name="RigidBody2D" parent="." instance=ExtResource("5_7c8bh")] -position = Vector2(149, 109) -collision_mask = 0 diff --git a/scenes/game.tscn b/scenes/game.tscn index 3ac7420..164bdf7 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -120,6 +120,8 @@ visible = false [node name="SpellContainer" type="Node2D" parent="."] +[node name="PickAbleContainer" type="Node2D" parent="."] + [node name="PlayerContainer" type="Node2D" parent="."] [node name="AICharacterContainer" type="Node2D" parent="."] diff --git a/scripts/Config.cs b/scripts/Config.cs index dc1ae4f..47d1e3b 100644 --- a/scripts/Config.cs +++ b/scripts/Config.cs @@ -176,6 +176,12 @@ public static class Config /// 空变量 /// public static readonly Variant EmptyVariant = new(); + + /// + /// Blank string + /// 空白字符串 + /// + public static readonly string? EmptyString = null; /// @@ -197,7 +203,7 @@ public static class Config { return OS.HasFeature("editor"); } - + /// /// ItemType /// 物品类型 @@ -235,6 +241,12 @@ public static class Config ///用于远程武器内的特殊物品类型 /// public const int Spell = 4; + + /// + /// Common item types + /// 普通的物品类型 + /// + public const int Item = 5; } /// @@ -255,7 +267,7 @@ public static class Config /// public const string TimeInterval = "TimeInterval"; } - + public class ZIndexManager { /// diff --git a/scripts/GameSceneDepend.cs b/scripts/GameSceneDepend.cs index e791f30..17f4c30 100644 --- a/scripts/GameSceneDepend.cs +++ b/scripts/GameSceneDepend.cs @@ -72,6 +72,12 @@ public static class GameSceneDepend /// 玩家容器 /// public static Node2D? PlayerContainer { get; set; } + + /// + /// PickAbleContainer + /// 可拾捡物容器 + /// + public static Node2D? PickAbleContainer { get; set; } /// /// AICharacterContainer diff --git a/scripts/deathInfo/ResignationCertificateDeathInfoHandler.cs b/scripts/deathInfo/ResignationCertificateDeathInfoHandler.cs new file mode 100644 index 0000000..df81dc7 --- /dev/null +++ b/scripts/deathInfo/ResignationCertificateDeathInfoHandler.cs @@ -0,0 +1,20 @@ +using System.Threading.Tasks; +using ColdMint.scripts.character; +using ColdMint.scripts.inventory; +using ColdMint.scripts.utils; +using Godot; + +namespace ColdMint.scripts.deathInfo; + +public class ResignationCertificateDeathInfoHandler: IDeathInfoHandler +{ + public Task GenerateDeathInfo(string victimName, string killerName, Player victim, Node killer) + { + if (killer is ResignationCertificate) + { + return Task.FromResult( + TranslationServerUtils.TranslateWithFormat("death_info_resignation_certificate", victimName)); + } + return Task.FromResult(Config.EmptyString); + } +} \ No newline at end of file diff --git a/scripts/inventory/ResignationCertificate.cs b/scripts/inventory/ResignationCertificate.cs new file mode 100644 index 0000000..95566c6 --- /dev/null +++ b/scripts/inventory/ResignationCertificate.cs @@ -0,0 +1,41 @@ +using ColdMint.scripts.character; +using ColdMint.scripts.damage; +using ColdMint.scripts.pickable; +using Godot; + +namespace ColdMint.scripts.inventory; + +/// +/// ResignationCertificate +/// 离职证明 +/// +public partial class ResignationCertificate : PickAbleTemplate +{ + private readonly Damage _damage = new() + { + MaxDamage = 1, + MinDamage = 1, + CriticalStrikeProbability = 100, + Type = Config.DamageType.Magic + }; + + public override void _Ready() + { + base._Ready(); + _damage.CreateDamage(); + _damage.Attacker = this; + } + + public override int ItemType + { + get => Config.ItemType.Item; + } + public override bool Use(Node2D? owner, Vector2 targetGlobalPosition) + { + if (Owner is CharacterTemplate characterTemplate) + { + return characterTemplate.Damage(_damage); + } + return false; + } +} \ No newline at end of file diff --git a/scripts/loader/sceneLoader/GameSceneLoader.cs b/scripts/loader/sceneLoader/GameSceneLoader.cs index e85e6fe..eeede9b 100644 --- a/scripts/loader/sceneLoader/GameSceneLoader.cs +++ b/scripts/loader/sceneLoader/GameSceneLoader.cs @@ -61,6 +61,10 @@ public partial class GameSceneLoader : SceneLoaderTemplate //加载玩家容器 var playerContainer = GetNode("PlayerContainer"); GameSceneDepend.PlayerContainer = playerContainer; + //Load the pickable container + //加载可拾捡物容器 + var pickAbleContainer = GetNode("PickAbleContainer"); + GameSceneDepend.PickAbleContainer = pickAbleContainer; //Setting up the mini map //设置迷你地图 var miniMap = GetNode("CanvasLayer/Control/MapContainer/MiniMap"); diff --git a/scripts/loader/uiLoader/SplashScreenLoader.cs b/scripts/loader/uiLoader/SplashScreenLoader.cs index cfd7384..263fd58 100644 --- a/scripts/loader/uiLoader/SplashScreenLoader.cs +++ b/scripts/loader/uiLoader/SplashScreenLoader.cs @@ -84,6 +84,7 @@ public partial class SplashScreenLoader : UiLoaderTemplate LogCat.MinLogLevel = Config.IsDebug() ? LogCat.InfoLogLevel : LogCat.DisableAllLogLevel; AssetHolder.LoadStaticAsset(); ContributorDataManager.RegisterAllContributorData(); + DeathInfoGenerator.RegisterDeathInfoHandler(new ResignationCertificateDeathInfoHandler()); DeathInfoGenerator.RegisterDeathInfoHandler(new SelfDeathInfoHandler()); MapGenerator.RegisterRoomInjectionProcessor(new ChanceRoomInjectionProcessor()); MapGenerator.RegisterRoomInjectionProcessor(new TimeIntervalRoomInjectorProcessor()); diff --git a/scripts/utils/NodeUtils.cs b/scripts/utils/NodeUtils.cs index bdccc12..0e65f7a 100644 --- a/scripts/utils/NodeUtils.cs +++ b/scripts/utils/NodeUtils.cs @@ -1,6 +1,7 @@ using System; using ColdMint.scripts.character; using ColdMint.scripts.debug; +using ColdMint.scripts.pickable; using ColdMint.scripts.projectile; using Godot; using Packsack = ColdMint.scripts.inventory.Packsack; @@ -234,12 +235,12 @@ public static class NodeUtils { return GameSceneDepend.ProjectileContainer; } - + if (GameSceneDepend.SpellContainer != null && childNode is ISpell) { return GameSceneDepend.SpellContainer; } - + if (GameSceneDepend.WeaponContainer != null && childNode is WeaponTemplate) { return GameSceneDepend.WeaponContainer; @@ -255,6 +256,11 @@ public static class NodeUtils return GameSceneDepend.DynamicUiGroup; } + if (GameSceneDepend.PickAbleContainer != null && childNode is PickAbleTemplate) + { + return GameSceneDepend.PickAbleContainer; + } + return defaultParentNode; } diff --git a/sprites/projectile/resignationCertificate.png b/sprites/projectile/resignationCertificate.png new file mode 100644 index 0000000..041ce61 Binary files /dev/null and b/sprites/projectile/resignationCertificate.png differ diff --git a/sprites/projectile/resignationCertificate.png.import b/sprites/projectile/resignationCertificate.png.import new file mode 100644 index 0000000..ce80b81 --- /dev/null +++ b/sprites/projectile/resignationCertificate.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dyfqdpdlq286h" +path="res://.godot/imported/resignationCertificate.png-d4ed8de640c5efbee6aa9a04be31f8ba.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/projectile/resignationCertificate.png" +dest_files=["res://.godot/imported/resignationCertificate.png-d4ed8de640c5efbee6aa9a04be31f8ba.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1