diff --git a/data/itemRegs/magics.yaml b/data/itemRegs/magics.yaml index c2c25eb..4170a9b 100644 --- a/data/itemRegs/magics.yaml +++ b/data/itemRegs/magics.yaml @@ -11,4 +11,8 @@ - id: x3 scene_path: res://prefab/magics/x3.tscn icon_path: res://sprites/projectile/x3.png + max_stack_value: 1 +- id: curse + scene_path: res://prefab/magics/curse.tscn + icon_path: res://sprites/projectile/x3.png max_stack_value: 1 \ No newline at end of file diff --git a/locals/Item.csv b/locals/Item.csv index 8e4b9f3..ae5e524 100644 --- a/locals/Item.csv +++ b/locals/Item.csv @@ -10,4 +10,6 @@ item_x3_desc,使发射器一次射出三颗弹丸。,Make the launcher shoot thr item_resignation_certificate,离职证明,Resignation certificate,退職証明書です item_resignation_certificate_desc,冷薄荷,感谢您在职时为公司做出的贡献。,"Cold Mint, thank you for your service to the company.",コールドミント、現役時代のご貢献ありがとうございました。 item_iron_axe,铁斧子,Iron axe,鉄の斧です -item_iron_axe_desc,铁斧子,Iron axe,鉄の斧です \ No newline at end of file +item_iron_axe_desc,铁斧子,Iron axe,鉄の斧です +item_curse,死灵诅咒法术,The curse of the Dead,死霊呪いの術 +item_curse_desc,杀死敌人后在生成死灵敌人。,Spawn Undead enemies after killing them.,敵を殺すと死霊敵が発生します。 \ No newline at end of file diff --git a/prefab/entitys/BlackenedAboriginalWarrior.tscn b/prefab/entitys/BlackenedAboriginalWarrior.tscn index 67ceb30..ef209c7 100644 --- a/prefab/entitys/BlackenedAboriginalWarrior.tscn +++ b/prefab/entitys/BlackenedAboriginalWarrior.tscn @@ -33,10 +33,13 @@ radius = 172.29 collision_layer = 64 collision_mask = 38 script = ExtResource("1_ubaid") +InitWeaponRes = null CharacterName = "character_evil_crow" CanMutateAfterDeath = false +_initialHp = null MaxHp = 50 CampId = "Mazoku" +LootListId = null [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(2, 10) diff --git a/prefab/entitys/Character.tscn b/prefab/entitys/Character.tscn index 0ab5716..f61d783 100644 --- a/prefab/entitys/Character.tscn +++ b/prefab/entitys/Character.tscn @@ -29,8 +29,12 @@ collision_mask = 162 platform_floor_layers = 4294967042 platform_wall_layers = 128 script = ExtResource("1_1dlls") +CharacterName = null +CanMutateAfterDeath = null +_initialHp = null MaxHp = 32 CampId = "Default" +LootListId = null [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("CapsuleShape2D_bb8wt") diff --git a/prefab/entitys/DelivererOfDarkMagic.tscn b/prefab/entitys/DelivererOfDarkMagic.tscn index e550bad..ab3d4a4 100644 --- a/prefab/entitys/DelivererOfDarkMagic.tscn +++ b/prefab/entitys/DelivererOfDarkMagic.tscn @@ -34,7 +34,10 @@ radius = 172.29 collision_layer = 64 collision_mask = 38 script = ExtResource("1_ubaid") +InitWeaponRes = null CharacterName = "character_necromancer" +CanMutateAfterDeath = false +_initialHp = null MaxHp = 50 CampId = "Mazoku" LootListId = "test" diff --git a/prefab/items/resignationCertificate.tscn b/prefab/items/resignationCertificate.tscn index 99a037a..dbb80e8 100644 --- a/prefab/items/resignationCertificate.tscn +++ b/prefab/items/resignationCertificate.tscn @@ -18,6 +18,9 @@ collision_mask = 34 angular_damp = -1.0 script = ExtResource("1_nydte") FiringIntervalAsMillisecond = 1000 +_recoilStrength = null +_minContactInjury = null +_maxContactInjury = null [node name="DamageArea2D" type="Area2D" parent="."] collision_layer = 8 diff --git a/prefab/magics/curse.tscn b/prefab/magics/curse.tscn new file mode 100644 index 0000000..e81c103 --- /dev/null +++ b/prefab/magics/curse.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=6 format=3 uid="uid://m3tkjcbrrhfj"] + +[ext_resource type="Script" path="res://scripts/spell/NodeSpawnOnKillCharacterSpell.cs" id="1_gg5rs"] +[ext_resource type="AudioStream" uid="uid://cak6chjjsu7wo" path="res://sounds/fire.wav" id="2_83n3c"] +[ext_resource type="Texture2D" uid="uid://mb5yijtw7sw5" path="res://sprites/projectile/x3.png" id="3_thtsv"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_3eq4k"] +size = Vector2(30, 30) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_i3lbq"] +size = Vector2(30, 31) + +[node name="curse" type="RigidBody2D"] +collision_layer = 8 +collision_mask = 34 +angular_damp = -1.0 +script = ExtResource("1_gg5rs") +_packedScenePath = "res://prefab/entitys/BlackenedAboriginalWarrior.tscn" +_projectilePath = null +_minContactInjury = null +_maxContactInjury = null + +[node name="DamageArea2D" type="Area2D" parent="."] +collision_layer = 8 +collision_mask = 102 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageArea2D"] +shape = SubResource("RectangleShape2D_3eq4k") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -0.5) +shape = SubResource("RectangleShape2D_i3lbq") + +[node name="Marker2D" type="Marker2D" parent="."] +position = Vector2(65, 0) + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="Marker2D"] +stream = ExtResource("2_83n3c") +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_thtsv") diff --git a/prefab/packsacks/PortableBackpacks.tscn b/prefab/packsacks/PortableBackpacks.tscn index 0e0dff1..5e54ca6 100644 --- a/prefab/packsacks/PortableBackpacks.tscn +++ b/prefab/packsacks/PortableBackpacks.tscn @@ -14,6 +14,8 @@ collision_layer = 8 collision_mask = 38 script = ExtResource("1_slakl") NumberSlots = 30 +_minContactInjury = null +_maxContactInjury = null [node name="DamageArea2D" type="Area2D" parent="."] collision_layer = 8 diff --git a/prefab/roomTemplates/dungeon/chest.tscn b/prefab/roomTemplates/dungeon/chest.tscn index aef0f91..216e2fc 100644 --- a/prefab/roomTemplates/dungeon/chest.tscn +++ b/prefab/roomTemplates/dungeon/chest.tscn @@ -89,3 +89,5 @@ texture = ExtResource("3_r2p3x") [node name="RigidBody2D" parent="." instance=ExtResource("4_rean8")] position = Vector2(239, 101) +_initialDurability = null +_maxDurability = null diff --git a/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn b/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn index 99600f1..b81de89 100644 --- a/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn +++ b/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn @@ -55,6 +55,7 @@ shape = SubResource("RectangleShape2D_131jn") [node name="Marker2D" type="Marker2D" parent="."] position = Vector2(237, 69) script = ExtResource("2_7q101") +ResPath = null metadata/ResPath = "res://prefab/entitys/DelivererOfDarkMagic.tscn" [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] diff --git a/prefab/roomTemplates/dungeon/initialRoom.tscn b/prefab/roomTemplates/dungeon/initialRoom.tscn index 8b471e0..323a7a1 100644 --- a/prefab/roomTemplates/dungeon/initialRoom.tscn +++ b/prefab/roomTemplates/dungeon/initialRoom.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=8 format=4 uid="uid://du5ldsp613fei"] +[gd_scene load_steps=9 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_5u8y1"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_kiih8"] size = Vector2(507, 251) @@ -64,6 +65,11 @@ position = Vector2(381, 136) script = ExtResource("3_v1tlc") ItemId = "iron_axe" +[node name="ItemMarker2D6" type="Marker2D" parent="."] +position = Vector2(438, 79) +script = ExtResource("3_v1tlc") +ItemId = "curse" + [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] navigation_polygon = SubResource("NavigationPolygon_064c7") @@ -95,3 +101,6 @@ 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_5u8y1")] +position = Vector2(106, 147) diff --git a/prefab/weapons/IronAxe.tscn b/prefab/weapons/IronAxe.tscn index f17afba..b6d8f34 100644 --- a/prefab/weapons/IronAxe.tscn +++ b/prefab/weapons/IronAxe.tscn @@ -18,6 +18,12 @@ collision_layer = 8 collision_mask = 34 angular_damp = -1.0 script = ExtResource("1_snmy1") +_maxDamage = null +_minDamage = null +FiringIntervalAsMillisecond = null +_recoilStrength = null +_minContactInjury = null +_maxContactInjury = null [node name="DamageArea2D" type="Area2D" parent="."] collision_layer = 8 diff --git a/prefab/weapons/StaffNecromancy.tscn b/prefab/weapons/StaffNecromancy.tscn index 1397579..edb87d5 100644 --- a/prefab/weapons/StaffNecromancy.tscn +++ b/prefab/weapons/StaffNecromancy.tscn @@ -21,6 +21,8 @@ _fireSequentially = true FiringIntervalAsMillisecond = 300 _recoilStrength = 5 UniqueIcon = ExtResource("3_31iau") +_minContactInjury = null +_maxContactInjury = null [node name="DamageArea2D" type="Area2D" parent="."] collision_layer = 8 diff --git a/scripts/spell/NodeSpawnOnKillCharacterSpell.cs b/scripts/spell/NodeSpawnOnKillCharacterSpell.cs new file mode 100644 index 0000000..089fdf2 --- /dev/null +++ b/scripts/spell/NodeSpawnOnKillCharacterSpell.cs @@ -0,0 +1,40 @@ +using ColdMint.scripts.debug; +using ColdMint.scripts.projectile; +using ColdMint.scripts.projectile.decorator; +using Godot; + +namespace ColdMint.scripts.spell; + +/// +/// Generate a set node spell after killing the character +/// 杀死角色后生成制定节点法术 +/// +public partial class NodeSpawnOnKillCharacterSpell : SpellPickAble +{ + [Export] + private string? _packedScenePath; + private NodeSpawnOnKillCharacterDecorator? _nodeSpawnOnKillCharacterDecorator; + public override void _Ready() + { + base._Ready(); + if (!string.IsNullOrEmpty(_packedScenePath)) + { + _nodeSpawnOnKillCharacterDecorator = new NodeSpawnOnKillCharacterDecorator + { + PackedScenePath = _packedScenePath, + DefaultParentNode = this + }; + } + } + + public override void ModifyProjectile(int index, Projectile projectile, ref Vector2 velocity) + { + if (_nodeSpawnOnKillCharacterDecorator == null) + { + LogCat.Log("添加失败"); + return; + } + LogCat.Log("添加成功"); + projectile.AddProjectileDecorator(_nodeSpawnOnKillCharacterDecorator); + } +} \ No newline at end of file