diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs index 7c0d299..2ba1f9f 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs @@ -54,6 +54,12 @@ "res://src/framework/map/mark/ActivityMark.cs", "res://addons/dungeonShooting_plugin/Mark.svg" ), + new CustomTypeInfo( + "EnemyMark", + "Node2D", + "res://src/framework/map/mark/EnemyMark.cs", + "res://addons/dungeonShooting_plugin/Mark.svg" + ), }; public override void _Process(double delta) diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn index 08c2130..f7ed625 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=4 format=3 uid="uid://da8uytgy0hroo"] +[gd_scene load_steps=5 format=3 uid="uid://da8uytgy0hroo"] [ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_n27nn"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_y6it6"] +[ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="4_5ha7k"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] [node name="Room8" type="TileMap"] @@ -12,7 +13,29 @@ [node name="EnemyMark" type="Node2D" parent="."] script = ExtResource("3_y6it6") -Weapon1Id = "0001" -Type = 3 +Weapon1Id = "0001(ResidueAmmo:30,CurrAmmon:10)" +Weapon2Id = "null; +0003(ResidueAmmo:12,CurrAmmon:12)" +Type = 4 +ItemExpression = "0001; +null" +Layer = 1 +Altitude = 0 + +[node name="ActivityMark" type="Node2D" parent="."] +position = Vector2(202, 95) +script = ExtResource("4_5ha7k") +Type = 5 +ItemExpression = "0002(ResidueAmmo:15,CurrAmmon:0)" +DelayTime = 3.0 +BirthRect = Vector2i(150, 150) + +[node name="EnemyMark2" type="Node2D" parent="."] +position = Vector2(56, 112) +script = ExtResource("3_y6it6") +Weapon1Id = "0003(ResidueAmmo:12,CurrAmmon:7)" +Type = 4 ItemExpression = "0001" Layer = 1 +WaveNumber = 2 +Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn index 0791d49..7376983 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn @@ -14,3 +14,4 @@ position = Vector2(80, 47) script = ExtResource("3_pf56w") Type = 1 +Altitude = 0 diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index d80988d..dfe91ae 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -352,7 +352,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_al7yt"] +[sub_resource type="Image" id="Image_22iyu"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -362,7 +362,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_al7yt") +image = SubResource("Image_22iyu") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -372,7 +372,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_aa1v5"] +[sub_resource type="Image" id="Image_yyxy4"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -382,7 +382,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_aa1v5") +image = SubResource("Image_yyxy4") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -392,7 +392,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_c6sif"] +[sub_resource type="Image" id="Image_r1mh8"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -402,7 +402,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_c6sif") +image = SubResource("Image_r1mh8") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -412,7 +412,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_vytak"] +[sub_resource type="Image" id="Image_o3bjv"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -422,7 +422,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_vytak") +image = SubResource("Image_o3bjv") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -446,7 +446,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_khjjs"] +[sub_resource type="Image" id="Image_pmr8x"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -456,7 +456,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_khjjs") +image = SubResource("Image_pmr8x") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs index 3977b54..506c75b 100644 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs +++ b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs @@ -61,7 +61,7 @@ /// [ExportGroup("Vertical")] [Export(PropertyHint.Range, "0, 128")] - public int Altitude = 0; + public int Altitude = 8; /// /// 物体初始纵轴速度 @@ -92,7 +92,7 @@ /// /// 对生成的物体执行后续操作 /// - public virtual void Doing(ActivityObject activityObject, ActivityExpressionData expressionData, RoomInfo roomInfo) + public virtual void Doing(ActivityObjectResult result, RoomInfo roomInfo) { } @@ -154,7 +154,7 @@ /// public void BeReady(RoomInfo roomInfo) { - if (_currentExpression == null) + if (_currentExpression == null || Type == ActivityIdPrefix.ActivityPrefixType.Player) { return; } @@ -183,51 +183,39 @@ private void Doing(RoomInfo roomInfo) { - var activityObject = CreateActivityObjectFromExpression(Type, nameof(ItemExpression)); + var result = CreateActivityObjectFromExpression(Type, nameof(ItemExpression)); - if (activityObject == null) + if (result == null || result.ActivityObject == null) { return; } - activityObject.VerticalSpeed = VerticalSpeed; - activityObject.Altitude = Altitude; + result.ActivityObject.VerticalSpeed = VerticalSpeed; + result.ActivityObject.Altitude = Altitude; var pos = Position; if (BirthRect != Vector2I.Zero) { - activityObject.Position = new Vector2( + result.ActivityObject.Position = new Vector2( Utils.RandomRangeInt((int)pos.X - BirthRect.X / 2, (int)pos.X + BirthRect.X / 2), Utils.RandomRangeInt((int)pos.Y - BirthRect.Y / 2, (int)pos.Y + BirthRect.Y / 2) ); } else { - activityObject.Position = pos; + result.ActivityObject.Position = pos; } - activityObject.StartCoroutine(OnActivityObjectBirth(activityObject)); - activityObject.PutDown(Layer); + result.ActivityObject.StartCoroutine(OnActivityObjectBirth(result.ActivityObject)); + result.ActivityObject.PutDown(Layer); - Doing(activityObject, _currentExpression[nameof(ItemExpression)], roomInfo); + var effect1 = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_effect_Effect1_tscn); + effect1.Position = result.ActivityObject.Position + new Vector2(0, -Altitude); + effect1.AddToActivityRoot(RoomLayerEnum.NormalLayer); + + Doing(result, roomInfo); } /// - /// 根据预制表达式创建物体并返回 - /// - /// 物体类型 - /// 预制表达式字段名称, 注意是字段名称, 而不是内容 - public ActivityObject CreateActivityObjectFromExpression(ActivityIdPrefix.ActivityPrefixType type, string expressionFieldName) - { - if (_currentExpression.TryGetValue(expressionFieldName, out var expressionData)) - { - var id = ActivityIdPrefix.GetNameByPrefixType(type) + expressionData.Id; - return ActivityObject.Create(id); - } - - return null; - } - - /// /// 生成 ActivityObject 时调用, 用于出生时的动画效果 /// private IEnumerator OnActivityObjectBirth(ActivityObject instance) @@ -348,6 +336,7 @@ var expressionStr = GetType().GetField(field)?.GetValue(this) as string; if (string.IsNullOrEmpty(expressionStr)) { + _currentExpression.Add(field, new ActivityExpressionData("")); return; } var activityExpression = Parse(expressionStr); @@ -372,6 +361,10 @@ var index = Utils.RandomWeight(list); _currentExpression.Add(field, activityExpression[index]); } + else + { + _currentExpression.Add(field, new ActivityExpressionData("")); + } } private List Parse(string str) diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark_HandlerExpression.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark_HandlerExpression.cs new file mode 100644 index 0000000..d8d4662 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark_HandlerExpression.cs @@ -0,0 +1,72 @@ + +using System; +using Godot; + +public partial class ActivityMark +{ + /// + /// 根据预制表达式创建物体并返回 + /// + /// 物体类型 + /// 预制表达式字段名称, 注意是字段名称, 而不是内容 + public ActivityObjectResult CreateActivityObjectFromExpression(ActivityIdPrefix.ActivityPrefixType type, string expressionFieldName) where T : ActivityObject + { + if (_currentExpression.TryGetValue(expressionFieldName, out var expressionData)) + { + if (expressionData.Id == "null") + { + return null; + } + var id = ActivityIdPrefix.GetNameByPrefixType(type) + expressionData.Id; + var activityObject = ActivityObject.Create(id); + if (activityObject == null) + { + return null; + } + + HandlerExpressionArgs(type, activityObject, expressionData); + return new ActivityObjectResult(activityObject, expressionData); + } + + GD.PrintErr("未找到表达式字段: " + expressionFieldName + ", 请检查是否有该字段或者该字段加上了[ActivityExpression]标记"); + return null; + } + + private void HandlerExpressionArgs(ActivityIdPrefix.ActivityPrefixType type, ActivityObject instance, ActivityExpressionData expressionData) + { + switch (type) + { + case ActivityIdPrefix.ActivityPrefixType.NonePrefix: + break; + case ActivityIdPrefix.ActivityPrefixType.Player: + break; + case ActivityIdPrefix.ActivityPrefixType.Test: + break; + case ActivityIdPrefix.ActivityPrefixType.Role: + break; + case ActivityIdPrefix.ActivityPrefixType.Enemy: + break; + case ActivityIdPrefix.ActivityPrefixType.Weapon: + { + var weapon = (Weapon)instance; + //当前弹夹弹药量 + if (expressionData.Args.TryGetValue("CurrAmmon", out var currAmmon)) + { + weapon.SetCurrAmmo(int.Parse(currAmmon)); + } + //备用弹药量 + if (expressionData.Args.TryGetValue("ResidueAmmo", out var residueAmmo)) + { + weapon.SetResidueAmmo(int.Parse(residueAmmo)); + } + } + break; + case ActivityIdPrefix.ActivityPrefixType.Bullet: + break; + case ActivityIdPrefix.ActivityPrefixType.Shell: + break; + case ActivityIdPrefix.ActivityPrefixType.Other: + break; + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityObjectResult.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityObjectResult.cs new file mode 100644 index 0000000..2127981 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/mark/ActivityObjectResult.cs @@ -0,0 +1,22 @@ + +/// +/// 通过表达式创建的 ActivityObject 对象结果集 +/// +public class ActivityObjectResult where T : ActivityObject +{ + /// + /// 实例 + /// + public T ActivityObject; + + /// + /// 创建该对象使用的表达式数据 + /// + public ActivityExpressionData ExpressionData; + + public ActivityObjectResult(T activityObject, ActivityExpressionData expressionData) + { + ActivityObject = activityObject; + ExpressionData = expressionData; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs b/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs index 19954cd..7d68aaf 100644 --- a/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs +++ b/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs @@ -37,16 +37,6 @@ [Export(PropertyHint.Expression), ActivityExpression] public string Weapon2Id; /// - /// 武器3 id, id会自动加上武器前缀 - /// - [Export(PropertyHint.Expression), ActivityExpression] - public string Weapon3Id; - /// - /// 武器4 id, id会自动加上武器前缀 - /// - [Export(PropertyHint.Expression), ActivityExpression] - public string Weapon4Id; - /// /// 脸默认的朝向 /// [Export] @@ -58,10 +48,10 @@ Layer = RoomLayerEnum.YSortLayer; } - public override void Doing(ActivityObject activityObject, ActivityExpressionData expressionData, RoomInfo roomInfo) + public override void Doing(ActivityObjectResult result, RoomInfo roomInfo) { //创建敌人 - var instance = (Enemy)activityObject; + var instance = (Enemy)result.ActivityObject; var pos = instance.Position; //脸的朝向 @@ -79,32 +69,22 @@ } if (!string.IsNullOrWhiteSpace(Weapon1Id)) - CreateWeapon(instance, pos, nameof(Weapon1Id), -1); + CreateWeapon(instance, pos, nameof(Weapon1Id)); if (!string.IsNullOrWhiteSpace(Weapon2Id)) - CreateWeapon(instance, pos, nameof(Weapon2Id), -1); - if (!string.IsNullOrWhiteSpace(Weapon3Id)) - CreateWeapon(instance, pos, nameof(Weapon3Id), -1); - if (!string.IsNullOrWhiteSpace(Weapon4Id)) - CreateWeapon(instance, pos, nameof(Weapon4Id), -1); - - var effect1 = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_effect_Effect1_tscn); - effect1.Position = instance.Position; - effect1.AddToActivityRoot(RoomLayerEnum.NormalLayer); + CreateWeapon(instance, pos, nameof(Weapon2Id)); } //生成武器 - private void CreateWeapon(Enemy instance, Vector2 pos, string fieldName, int ammon) + private void CreateWeapon(Enemy enemy, Vector2 pos, string fieldName) { - var weapon = (Weapon)CreateActivityObjectFromExpression(ActivityIdPrefix.ActivityPrefixType.Weapon, fieldName); - //设置弹药量 - if (ammon >= 0) + var result = CreateActivityObjectFromExpression(ActivityIdPrefix.ActivityPrefixType.Weapon, fieldName); + if (result != null) { - weapon.SetTotalAmmo(ammon); - } - //如果不能放下, 则直接扔地上 - if (!instance.PickUpWeapon(weapon)) - { - weapon.PutDown(pos, RoomLayerEnum.NormalLayer); + //如果不能放下, 则直接扔地上 + if (!enemy.PickUpWeapon(result.ActivityObject)) + { + result.ActivityObject.PutDown(pos, RoomLayerEnum.NormalLayer); + } } } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs b/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs deleted file mode 100644 index 01dd68a..0000000 --- a/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs +++ /dev/null @@ -1,47 +0,0 @@ - -using Godot; - -/// -/// 针对武器生成位置的标记 -/// -[Tool] -public partial class WeaponMark : ActivityMark -{ - /// - /// 当前弹夹弹药量, 如果值小于0, 则使用默认弹药量 - /// - [Export] - public int CurrAmmon = -1; - - /// - /// 备用弹药容量, 如果值小于0, 则使用默认弹药量 - /// - [Export] - public int ResidueAmmo = -1; - - public override void _Ready() - { - Type = ActivityIdPrefix.ActivityPrefixType.Weapon; - Layer = RoomLayerEnum.NormalLayer; - Altitude = 8; - } - - public override void Doing(ActivityObject activityObject, ActivityExpressionData expressionData, RoomInfo roomInfo) - { - var instance = (Weapon)activityObject; - //创建武器 - if (CurrAmmon >= 0) - { - instance.SetCurrAmmo(CurrAmmon); - } - - if (ResidueAmmo >= 0) - { - instance.SetResidueAmmo(ResidueAmmo); - } - - var effect1 = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_effect_Effect1_tscn); - effect1.Position = instance.Position + new Vector2(0, -Altitude); - effect1.AddToActivityRoot(RoomLayerEnum.NormalLayer); - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs b/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs index c97cfee..a37809a 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs @@ -243,7 +243,7 @@ /// /// 用于Ai, Ai使用该武器消耗弹药的概率, (0 - 1) /// - public float AiAmmoConsumptionProbability = 1f; + public float AiAmmoConsumptionProbability = 0f; /// /// Ai 使用该武器时的武器数据, 设置该字段, 可让同一把武器在敌人和玩家手上有不同属性