diff --git a/DungeonShooting_Godot/prefab/role/Enemy0001.tscn b/DungeonShooting_Godot/prefab/role/Enemy0001.tscn index 7eac0c4..815c72f 100644 --- a/DungeonShooting_Godot/prefab/role/Enemy0001.tscn +++ b/DungeonShooting_Godot/prefab/role/Enemy0001.tscn @@ -1,11 +1,9 @@ -[gd_scene load_steps=13 format=3 uid="uid://b8s1dgu63fddf"] +[gd_scene load_steps=12 format=3 uid="uid://b8s1dgu63fddf"] [ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AdvancedEnemyTemplate.tscn" id="1_2vqwe"] [ext_resource type="Script" path="res://src/game/activity/role/enemy/AdvancedEnemy.cs" id="2_thbey"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="3_x8agd"] [ext_resource type="SpriteFrames" uid="uid://cnctpyrn02rhd" path="res://resource/spriteFrames/role/Enemy0001.tres" id="4_qv8w5"] -[ext_resource type="Texture2D" uid="uid://b75k7hefqy3tm" path="res://resource/sprite/role/common/Role_astonished.png" id="5_0p4q8"] -[ext_resource type="Texture2D" uid="uid://6jka6itu76x7" path="res://resource/sprite/role/common/Role_notify.png" id="6_70bey"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_f7y56"] resource_local_to_scene = true @@ -29,125 +27,60 @@ shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true -[sub_resource type="Animation" id="Animation_nb4pe"] -resource_name = "astonished" -length = 0.6 -step = 0.05 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("TipSprite:visible") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.6), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, false] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("TipSprite:texture") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [ExtResource("5_0p4q8")] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("AnimatedSprite:scale") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 0.05, 0.15, 0.25, 0.35, 0.45), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1.2, 1.2), Vector2(0.9, 0.9), Vector2(1.1, 1.1), Vector2(1, 1)] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("TipSprite:modulate") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0, 0.1, 0.5, 0.6), -"transitions": PackedFloat32Array(1, 1, 1, 1), -"update": 0, -"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] -} -tracks/4/type = "value" -tracks/4/imported = false -tracks/4/enabled = true -tracks/4/path = NodePath("TipSprite:position") -tracks/4/interp = 1 -tracks/4/loop_wrap = true -tracks/4/keys = { -"times": PackedFloat32Array(0, 0.2, 0.45, 0.6), -"transitions": PackedFloat32Array(1, 1, 1, 1), -"update": 0, -"values": [Vector2(0, -22), Vector2(0, -28), Vector2(0, -28), Vector2(0, -35)] -} - [sub_resource type="Animation" id="Animation_0l5k0"] length = 0.001 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("TipSprite:visible") +tracks/0/path = NodePath("AnimatedSprite:scale") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), -"update": 1, -"values": [false] +"update": 0, +"values": [Vector2(1, 1)] } tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("TipSprite:texture") +tracks/1/path = NodePath("TipRoot/TipSprite:modulate") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), -"update": 1, -"values": [ExtResource("5_0p4q8")] +"update": 0, +"values": [Color(1, 1, 1, 1)] } tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("AnimatedSprite:scale") +tracks/2/path = NodePath("TipRoot/TipSprite:visible") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector2(1, 1)] +"update": 1, +"values": [false] } tracks/3/type = "value" tracks/3/imported = false tracks/3/enabled = true -tracks/3/path = NodePath("TipSprite:modulate") +tracks/3/path = NodePath("TipRoot/TipSprite:animation") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(1, 1, 1, 0)] +"update": 1, +"values": [&"default"] } tracks/4/type = "value" tracks/4/imported = false tracks/4/enabled = true -tracks/4/path = NodePath("TipSprite:position") +tracks/4/path = NodePath("TipRoot/TipSprite:position") tracks/4/interp = 1 tracks/4/loop_wrap = true tracks/4/keys = { @@ -157,47 +90,190 @@ "values": [Vector2(0, -22)] } -[sub_resource type="Animation" id="Animation_5mflw"] -resource_name = "notify" +[sub_resource type="Animation" id="Animation_nb4pe"] +resource_name = "astonished" length = 0.6 +step = 0.05 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("TipSprite:texture") +tracks/0/path = NodePath("AnimatedSprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.05, 0.15, 0.25, 0.35, 0.45), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(1, 1), Vector2(1.2, 0.8), Vector2(0.8, 1.2), Vector2(1.1, 0.9), Vector2(0.9, 1.1), Vector2(1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("TipRoot/TipSprite:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.1, 0.5, 0.6), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("TipRoot/TipSprite:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("TipRoot/TipSprite:animation") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"astonished"] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("TipRoot/TipSprite:position") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0, 0.15, 0.45, 0.6), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Vector2(0, -20), Vector2(0, -25), Vector2(0, -25), Vector2(0, -30)] +} + +[sub_resource type="Animation" id="Animation_5mflw"] +resource_name = "notify" +length = 0.6 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TipRoot/TipSprite:animation") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 1, -"values": [ExtResource("6_70bey")] +"values": [&"notify"] } tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("TipSprite:visible") +tracks/1/path = NodePath("TipRoot/TipSprite:modulate") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { -"times": PackedFloat32Array(0, 0.6), -"transitions": PackedFloat32Array(1, 1), +"times": PackedFloat32Array(0, 0.1, 0.5, 0.6), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("TipRoot/TipSprite:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), "update": 1, -"values": [true, false] +"values": [true] +} + +[sub_resource type="Animation" id="Animation_usfrh"] +resource_name = "query" +length = 0.45 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("AnimatedSprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.05, 0.15, 0.25, 0.35, 0.45), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Vector2(1, 1), Vector2(1.2, 0.8), Vector2(0.8, 1.2), Vector2(1.1, 0.9), Vector2(0.9, 1.1), Vector2(1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("TipRoot/TipSprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("TipRoot/TipSprite:modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("TipRoot/TipSprite:position") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 0.1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(0, -20), Vector2(0, -25)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("TipRoot/TipSprite:animation") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"query"] } [sub_resource type="AnimationLibrary" id="AnimationLibrary_ur1ug"] _data = { "RESET": SubResource("Animation_0l5k0"), "astonished": SubResource("Animation_nb4pe"), -"notify": SubResource("Animation_5mflw") +"notify": SubResource("Animation_5mflw"), +"query": SubResource("Animation_usfrh") } -[node name="Enemy0001" node_paths=PackedStringArray("ViewRay", "NavigationAgent2D", "NavigationPoint", "TipSprite", "MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_2vqwe")] +[node name="Enemy0001" node_paths=PackedStringArray("ViewRay", "NavigationAgent2D", "NavigationPoint", "MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "TipRoot", "TipSprite", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_2vqwe")] script = ExtResource("2_thbey") ViewRay = NodePath("ViewRay") NavigationAgent2D = NodePath("NavigationPoint/NavigationAgent2D") NavigationPoint = NodePath("NavigationPoint") -TipSprite = NodePath("TipSprite") MountPoint = NodePath("MountPoint") BackMountPoint = NodePath("BackMountPoint") MeleeAttackArea = NodePath("MountPoint/MeleeAttackArea") @@ -206,6 +282,8 @@ HurtCollision = NodePath("HurtArea/HurtCollision") InteractiveArea = NodePath("InteractiveArea") InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision") +TipRoot = NodePath("TipRoot") +TipSprite = NodePath("TipRoot/TipSprite") AnimationPlayer = NodePath("AnimationPlayer") ShadowSprite = NodePath("ShadowSprite") AnimatedSprite = NodePath("AnimatedSprite") @@ -218,10 +296,6 @@ material = SubResource("ShaderMaterial_2kup1") sprite_frames = ExtResource("4_qv8w5") -[node name="TipSprite" parent="." index="9"] -modulate = Color(1, 1, 1, 0) -position = Vector2(0, -22) - [node name="AnimationPlayer" parent="." index="10"] libraries = { "": SubResource("AnimationLibrary_ur1ug") diff --git a/DungeonShooting_Godot/prefab/role/Enemy0002.tscn b/DungeonShooting_Godot/prefab/role/Enemy0002.tscn index 25fefed..b7b5558 100644 --- a/DungeonShooting_Godot/prefab/role/Enemy0002.tscn +++ b/DungeonShooting_Godot/prefab/role/Enemy0002.tscn @@ -27,7 +27,7 @@ shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true -[node name="Enemy0002" node_paths=PackedStringArray("ViewRay", "NavigationAgent2D", "NavigationPoint", "FirePoint", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_rikvp")] +[node name="Enemy0002" node_paths=PackedStringArray("ViewRay", "NavigationAgent2D", "NavigationPoint", "FirePoint", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "TipRoot", "TipSprite", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_rikvp")] script = ExtResource("2_wjtfl") ViewRay = NodePath("ViewRay") NavigationAgent2D = NodePath("NavigationPoint/NavigationAgent2D") @@ -37,6 +37,8 @@ HurtCollision = NodePath("HurtArea/HurtCollision") InteractiveArea = NodePath("InteractiveArea") InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision") +TipRoot = NodePath("TipRoot") +TipSprite = NodePath("TipRoot/TipSprite") AnimationPlayer = NodePath("AnimationPlayer") ShadowSprite = NodePath("ShadowSprite") AnimatedSprite = NodePath("AnimatedSprite") diff --git a/DungeonShooting_Godot/prefab/role/Role0001.tscn b/DungeonShooting_Godot/prefab/role/Role0001.tscn index 97d017d..24c63b1 100644 --- a/DungeonShooting_Godot/prefab/role/Role0001.tscn +++ b/DungeonShooting_Godot/prefab/role/Role0001.tscn @@ -27,7 +27,7 @@ shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true -[node name="Role0001" node_paths=PackedStringArray("MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_10c2n")] +[node name="Role0001" node_paths=PackedStringArray("MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "TipRoot", "TipSprite", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_10c2n")] collision_layer = 8 script = ExtResource("2_6xwnt") MountPoint = NodePath("MountPoint") @@ -38,6 +38,9 @@ HurtCollision = NodePath("HurtArea/HurtCollision") InteractiveArea = NodePath("InteractiveArea") InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision") +TipRoot = NodePath("TipRoot") +TipSprite = NodePath("TipRoot/TipSprite") +AnimationPlayer = NodePath("AnimationPlayer") ShadowSprite = NodePath("ShadowSprite") AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") diff --git a/DungeonShooting_Godot/prefab/role/template/AdvancedEnemyTemplate.tscn b/DungeonShooting_Godot/prefab/role/template/AdvancedEnemyTemplate.tscn index 58209e0..b02e44a 100644 --- a/DungeonShooting_Godot/prefab/role/template/AdvancedEnemyTemplate.tscn +++ b/DungeonShooting_Godot/prefab/role/template/AdvancedEnemyTemplate.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=6 format=3 uid="uid://dbrig6dq441wo"] +[gd_scene load_steps=5 format=3 uid="uid://dbrig6dq441wo"] [ext_resource type="PackedScene" uid="uid://cyrcv2jdgr8cf" path="res://prefab/role/template/AdvancedRoleTemplate.tscn" id="1_5po38"] -[ext_resource type="Texture2D" uid="uid://b75k7hefqy3tm" path="res://resource/sprite/role/common/Role_astonished.png" id="3_6re6j"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="3_x8agd"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_8vxx6"] @@ -35,8 +34,6 @@ [node name="AnimatedSprite" parent="." index="2"] material = SubResource("ShaderMaterial_k8mt5") -position = Vector2(0, 0) -offset = Vector2(0, -12) [node name="ViewRay" type="RayCast2D" parent="." index="6"] position = Vector2(0, -8) @@ -49,8 +46,3 @@ path_desired_distance = 3.0 target_desired_distance = 3.0 radius = 20.0 - -[node name="TipSprite" type="Sprite2D" parent="." index="9"] -visible = false -position = Vector2(0, -26) -texture = ExtResource("3_6re6j") diff --git a/DungeonShooting_Godot/prefab/role/template/AdvancedRoleTemplate.tscn b/DungeonShooting_Godot/prefab/role/template/AdvancedRoleTemplate.tscn index 3874d8b..7b79ea0 100644 --- a/DungeonShooting_Godot/prefab/role/template/AdvancedRoleTemplate.tscn +++ b/DungeonShooting_Godot/prefab/role/template/AdvancedRoleTemplate.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=8 format=3 uid="uid://cyrcv2jdgr8cf"] +[gd_scene load_steps=9 format=3 uid="uid://cyrcv2jdgr8cf"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_xk5yk"] [ext_resource type="Script" path="res://src/game/activity/role/MountRotation.cs" id="2_5ddpw"] +[ext_resource type="SpriteFrames" uid="uid://c8h5svp76h3kw" path="res://resource/spriteFrames/role/Role_tip.tres" id="3_bo78w"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_v2kfw"] resource_local_to_scene = true @@ -82,4 +83,11 @@ [node name="MeleeAttackCollision" type="CollisionPolygon2D" parent="MountPoint/MeleeAttackArea"] +[node name="TipRoot" type="Node2D" parent="."] + +[node name="TipSprite" type="AnimatedSprite2D" parent="TipRoot"] +visible = false +position = Vector2(0, -22) +sprite_frames = ExtResource("3_bo78w") + [node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn b/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn index b001cfc..b8cb5a0 100644 --- a/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn +++ b/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=7 format=3 uid="uid://0uc4naitjprl"] +[gd_scene load_steps=8 format=3 uid="uid://0uc4naitjprl"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_xk5yk"] +[ext_resource type="SpriteFrames" uid="uid://c8h5svp76h3kw" path="res://resource/spriteFrames/role/Role_tip.tres" id="2_1udon"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_v2kfw"] resource_local_to_scene = true @@ -68,3 +69,8 @@ shape = SubResource("RectangleShape2D_n68nu") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] + +[node name="TipRoot" type="Node2D" parent="."] + +[node name="TipSprite" type="AnimatedSprite2D" parent="TipRoot"] +sprite_frames = ExtResource("2_1udon") diff --git a/DungeonShooting_Godot/resource/sprite/role/common/Role_query.png b/DungeonShooting_Godot/resource/sprite/role/common/Role_query.png new file mode 100644 index 0000000..6e3c961 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/common/Role_query.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/common/Role_query.png.import b/DungeonShooting_Godot/resource/sprite/role/common/Role_query.png.import new file mode 100644 index 0000000..ec5e582 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/common/Role_query.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bda63puujv425" +path="res://.godot/imported/Role_query.png-99c4efcb33f8ce117e8e1704e40b8b3e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/common/Role_query.png" +dest_files=["res://.godot/imported/Role_query.png-99c4efcb33f8ce117e8e1704e40b8b3e.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 diff --git a/DungeonShooting_Godot/resource/spriteFrames/role/Role_tip.tres b/DungeonShooting_Godot/resource/spriteFrames/role/Role_tip.tres new file mode 100644 index 0000000..f47c45e --- /dev/null +++ b/DungeonShooting_Godot/resource/spriteFrames/role/Role_tip.tres @@ -0,0 +1,37 @@ +[gd_resource type="SpriteFrames" load_steps=4 format=3 uid="uid://c8h5svp76h3kw"] + +[ext_resource type="Texture2D" uid="uid://b75k7hefqy3tm" path="res://resource/sprite/role/common/Role_astonished.png" id="1_tbb6m"] +[ext_resource type="Texture2D" uid="uid://6jka6itu76x7" path="res://resource/sprite/role/common/Role_notify.png" id="2_0e3tg"] +[ext_resource type="Texture2D" uid="uid://bda63puujv425" path="res://resource/sprite/role/common/Role_query.png" id="2_70ucj"] + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_tbb6m") +}], +"loop": false, +"name": &"astonished", +"speed": 5.0 +}, { +"frames": [], +"loop": true, +"name": &"default", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_0e3tg") +}], +"loop": true, +"name": &"notify", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_70ucj") +}], +"loop": false, +"name": &"query", +"speed": 5.0 +}] diff --git a/DungeonShooting_Godot/src/game/AnimatorNames.cs b/DungeonShooting_Godot/src/game/AnimatorNames.cs index c78fd7f..56e3289 100644 --- a/DungeonShooting_Godot/src/game/AnimatorNames.cs +++ b/DungeonShooting_Godot/src/game/AnimatorNames.cs @@ -82,4 +82,12 @@ /// 通知动作 /// public const string Notify = "notify"; + /// + /// 疑惑动作 + /// + public const string Query = "query"; + /// + /// 重置动画 + /// + public const string Reset = "RESET"; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs index 79b1d58..fcea8b0 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs @@ -73,6 +73,18 @@ public CollisionShape2D InteractiveCollision { get; set; } /// + /// 用于提示状态的根节点 + /// + [Export, ExportFillNode] + public Node2D TipRoot { get; set; } + + /// + /// 用于提示当前敌人状态 + /// + [Export, ExportFillNode] + public AnimatedSprite2D TipSprite { get; set; } + + /// /// 动画播放器 /// [Export, ExportFillNode] @@ -242,6 +254,16 @@ //护盾恢复计时器 private float _shieldRecoveryTimer = 0; + protected override void OnExamineExportFillNode(string propertyName, Node node, bool isJustCreated) + { + base.OnExamineExportFillNode(propertyName, node, isJustCreated); + if (propertyName == nameof(TipSprite)) + { + var sprite = (AnimatedSprite2D)node; + sprite.SpriteFrames = + ResourceManager.Load(ResourcePath.resource_spriteFrames_role_Role_tip_tres); + } + } /// /// 当血量改变时调用 @@ -486,6 +508,14 @@ } } + if (Face == FaceDirection.Right) + { + TipRoot.Scale = Vector2.One; + } + else + { + TipRoot.Scale = new Vector2(-1, 1); + } } /// diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/AdvancedEnemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/AdvancedEnemy.cs index 97dc009..b2d184d 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/AdvancedEnemy.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/AdvancedEnemy.cs @@ -65,12 +65,6 @@ public Marker2D NavigationPoint { get; private set; } /// - /// 用于提示当前敌人状态 - /// - [Export, ExportFillNode] - public Sprite2D TipSprite { get; set; } - - /// /// 当前敌人所看向的对象, 也就是枪口指向的对象 /// public ActivityObject LookTarget { get; set; } @@ -79,7 +73,7 @@ /// 锁定目标已经走过的时间 /// public float LockTargetTime { get; set; } = 0; - + public override void OnInit() { base.OnInit(); diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/advancedState/AiLeaveForState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/advancedState/AiLeaveForState.cs index 058b053..030736f 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/advancedState/AiLeaveForState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/advancedState/AiLeaveForState.cs @@ -13,6 +13,8 @@ private float _navigationUpdateTimer = 0; private float _navigationInterval = 0.3f; + private float _idleTimer = 0; + //目标 private ActivityObject _target; //目标点 @@ -30,8 +32,6 @@ } _target = (ActivityObject)args[0]; - _targetPosition = _target.GetCenterPosition(); - Master.LookTargetPosition(_targetPosition); //先检查弹药是否打光 if (Master.IsAllWeaponTotalAmmoEmpty()) @@ -42,12 +42,28 @@ { Master.LookTarget = _target; ChangeState(AIAdvancedStateEnum.AiFindAmmo, targetWeapon); + return; } } + + _idleTimer = 1; + _targetPosition = _target.GetCenterPosition(); + Master.LookTargetPosition(_targetPosition); + Master.AnimationPlayer.Play(AnimatorNames.Query); + } + + public override void Exit(AIAdvancedStateEnum next) + { + Master.AnimationPlayer.Play(AnimatorNames.Reset); } public override void Process(float delta) { + if (_idleTimer > 0) + { + _idleTimer -= delta; + return; + } //这个状态下不会有攻击事件, 所以没必要每一帧检查是否弹药耗尽 //更新玩家位置 diff --git a/DungeonShooting_Godot/src/game/activity/role/player/Player.cs b/DungeonShooting_Godot/src/game/activity/role/player/Player.cs index 8dee618..9c1e3b1 100644 --- a/DungeonShooting_Godot/src/game/activity/role/player/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/player/Player.cs @@ -206,6 +206,15 @@ // freezeSprite.ActivityObject.MoveController.AddForce(temp.Normalized() * 300 * (25f - temp.Length()) / 25f); // } // } + + if (Face == FaceDirection.Right) + { + TipRoot.Scale = Vector2.One; + } + else + { + TipRoot.Scale = new Vector2(-1, 1); + } } protected override void OnPickUpWeapon(Weapon weapon) diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 8ad701a..6914429 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -15,6 +15,7 @@ public const string prefab_bullet_normal_Bullet0002_tscn = "res://prefab/bullet/normal/Bullet0002.tscn"; public const string prefab_bullet_normal_Bullet0003_tscn = "res://prefab/bullet/normal/Bullet0003.tscn"; public const string prefab_bullet_normal_Bullet0004_tscn = "res://prefab/bullet/normal/Bullet0004.tscn"; + public const string prefab_bullet_normal_Bullet0005_tscn = "res://prefab/bullet/normal/Bullet0005.tscn"; public const string prefab_effect_Blood_tscn = "res://prefab/effect/Blood.tscn"; public const string prefab_effect_common_Effect1_tscn = "res://prefab/effect/common/Effect1.tscn"; public const string prefab_effect_enemy_Effect0001_tscn = "res://prefab/effect/enemy/Effect0001.tscn"; @@ -43,9 +44,16 @@ public const string prefab_prop_buff_BuffProp0009_tscn = "res://prefab/prop/buff/BuffProp0009.tscn"; public const string prefab_prop_buff_BuffProp0010_tscn = "res://prefab/prop/buff/BuffProp0010.tscn"; public const string prefab_prop_buff_BuffProp0011_tscn = "res://prefab/prop/buff/BuffProp0011.tscn"; + public const string prefab_prop_buff_BuffProp0012_tscn = "res://prefab/prop/buff/BuffProp0012.tscn"; + public const string prefab_prop_buff_BuffProp0013_tscn = "res://prefab/prop/buff/BuffProp0013.tscn"; + public const string prefab_prop_buff_BuffProp0014_tscn = "res://prefab/prop/buff/BuffProp0014.tscn"; public const string prefab_role_Enemy0001_tscn = "res://prefab/role/Enemy0001.tscn"; + public const string prefab_role_Enemy0002_tscn = "res://prefab/role/Enemy0002.tscn"; public const string prefab_role_Role0001_tscn = "res://prefab/role/Role0001.tscn"; - public const string prefab_role_RoleTemplate_tscn = "res://prefab/role/RoleTemplate.tscn"; + public const string prefab_role_template_AdvancedEnemyTemplate_tscn = "res://prefab/role/template/AdvancedEnemyTemplate.tscn"; + public const string prefab_role_template_AdvancedRoleTemplate_tscn = "res://prefab/role/template/AdvancedRoleTemplate.tscn"; + public const string prefab_role_template_EnemyTemplate_tscn = "res://prefab/role/template/EnemyTemplate.tscn"; + public const string prefab_role_template_RoleTemplate_tscn = "res://prefab/role/template/RoleTemplate.tscn"; public const string prefab_shell_Shell0001_tscn = "res://prefab/shell/Shell0001.tscn"; public const string prefab_shell_Shell0002_tscn = "res://prefab/shell/Shell0002.tscn"; public const string prefab_shell_Shell0003_tscn = "res://prefab/shell/Shell0003.tscn"; @@ -101,6 +109,7 @@ public const string resource_map_tileSprite_map1_16x16dungeoniiwallreconfigv04spritesheet_png = "res://resource/map/tileSprite/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png"; public const string resource_material_Blend_gdshader = "res://resource/material/Blend.gdshader"; public const string resource_material_Blend_tres = "res://resource/material/Blend.tres"; + public const string resource_material_OffsetVertex_gdshader = "res://resource/material/OffsetVertex.gdshader"; public const string resource_material_SmokeParticleMaterial_tres = "res://resource/material/SmokeParticleMaterial.tres"; public const string resource_sound_bgm_Intro_ogg = "res://resource/sound/bgm/Intro.ogg"; public const string resource_sound_sfx_beLoaded_BeLoaded0001_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0001.ogg"; @@ -196,6 +205,9 @@ public const string resource_sprite_prop_buff_BuffProp0009_png = "res://resource/sprite/prop/buff/BuffProp0009.png"; public const string resource_sprite_prop_buff_BuffProp0010_png = "res://resource/sprite/prop/buff/BuffProp0010.png"; public const string resource_sprite_prop_buff_BuffProp0011_png = "res://resource/sprite/prop/buff/BuffProp0011.png"; + public const string resource_sprite_prop_buff_BuffProp0012_png = "res://resource/sprite/prop/buff/BuffProp0012.png"; + public const string resource_sprite_prop_buff_BuffProp0013_png = "res://resource/sprite/prop/buff/BuffProp0013.png"; + public const string resource_sprite_prop_buff_BuffProp0014_png = "res://resource/sprite/prop/buff/BuffProp0014.png"; public const string resource_sprite_role_role10_png = "res://resource/sprite/role/role10.png"; public const string resource_sprite_role_role3_png = "res://resource/sprite/role/role3.png"; public const string resource_sprite_role_role4_png = "res://resource/sprite/role/role4.png"; @@ -204,10 +216,17 @@ public const string resource_sprite_role_role7_png = "res://resource/sprite/role/role7.png"; public const string resource_sprite_role_role8_png = "res://resource/sprite/role/role8.png"; public const string resource_sprite_role_role9_png = "res://resource/sprite/role/role9.png"; + public const string resource_sprite_role_common_Role_astonished_png = "res://resource/sprite/role/common/Role_astonished.png"; + public const string resource_sprite_role_common_Role_notify_png = "res://resource/sprite/role/common/Role_notify.png"; + public const string resource_sprite_role_common_Role_query_png = "res://resource/sprite/role/common/Role_query.png"; public const string resource_sprite_role_enemy0001_enemy0001_png = "res://resource/sprite/role/enemy0001/enemy0001.png"; public const string resource_sprite_role_enemy0001_enemy0001_Debris_png = "res://resource/sprite/role/enemy0001/enemy0001_Debris.png"; public const string resource_sprite_role_enemy0001_enemy0001_Icon_png = "res://resource/sprite/role/enemy0001/enemy0001_Icon.png"; public const string resource_sprite_role_enemy0002_Enemy0002_png = "res://resource/sprite/role/enemy0002/Enemy0002.png"; + public const string resource_sprite_role_enemy0002_Enemy0002_attack_png = "res://resource/sprite/role/enemy0002/Enemy0002_attack.png"; + public const string resource_sprite_role_enemy0002_Enemy0002_dead_png = "res://resource/sprite/role/enemy0002/Enemy0002_dead.png"; + public const string resource_sprite_role_enemy0002_Enemy0002_idle_png = "res://resource/sprite/role/enemy0002/Enemy0002_idle.png"; + public const string resource_sprite_role_enemy0002_Enemy0002_run_png = "res://resource/sprite/role/enemy0002/Enemy0002_run.png"; public const string resource_sprite_role_role0001_Role0001_png = "res://resource/sprite/role/role0001/Role0001.png"; public const string resource_sprite_role_role0001_Role0001_Icon_png = "res://resource/sprite/role/role0001/Role0001_Icon.png"; public const string resource_sprite_role_role0001_idle_Sprite0002_png = "res://resource/sprite/role/role0001/idle/Sprite-0002.png"; @@ -315,6 +334,7 @@ public const string resource_spriteFrames_bullet_Bullet0003_tres = "res://resource/spriteFrames/bullet/Bullet0003.tres"; public const string resource_spriteFrames_bullet_Bullet0004_tres = "res://resource/spriteFrames/bullet/Bullet0004.tres"; public const string resource_spriteFrames_effect_KnifeHit1_tres = "res://resource/spriteFrames/effect/KnifeHit1.tres"; + public const string resource_spriteFrames_effect_weapon_Collision1_tres = "res://resource/spriteFrames/effect/weapon/Collision1.tres"; public const string resource_spriteFrames_other_RoomDoor_E_Down_tres = "res://resource/spriteFrames/other/RoomDoor_E_Down.tres"; public const string resource_spriteFrames_other_RoomDoor_E_Up_tres = "res://resource/spriteFrames/other/RoomDoor_E_Up.tres"; public const string resource_spriteFrames_other_RoomDoor_N_tres = "res://resource/spriteFrames/other/RoomDoor_N.tres"; @@ -334,9 +354,13 @@ public const string resource_spriteFrames_prop_buff_BuffProp0009_tres = "res://resource/spriteFrames/prop/buff/BuffProp0009.tres"; public const string resource_spriteFrames_prop_buff_BuffProp0010_tres = "res://resource/spriteFrames/prop/buff/BuffProp0010.tres"; public const string resource_spriteFrames_prop_buff_BuffProp0011_tres = "res://resource/spriteFrames/prop/buff/BuffProp0011.tres"; + public const string resource_spriteFrames_prop_buff_BuffProp0012_tres = "res://resource/spriteFrames/prop/buff/BuffProp0012.tres"; + public const string resource_spriteFrames_prop_buff_BuffProp0013_tres = "res://resource/spriteFrames/prop/buff/BuffProp0013.tres"; + public const string resource_spriteFrames_prop_buff_BuffProp0014_tres = "res://resource/spriteFrames/prop/buff/BuffProp0014.tres"; public const string resource_spriteFrames_role_Enemy0001_tres = "res://resource/spriteFrames/role/Enemy0001.tres"; public const string resource_spriteFrames_role_Enemy0002_tres = "res://resource/spriteFrames/role/Enemy0002.tres"; public const string resource_spriteFrames_role_Role0001_tres = "res://resource/spriteFrames/role/Role0001.tres"; + public const string resource_spriteFrames_role_Role_tip_tres = "res://resource/spriteFrames/role/Role_tip.tres"; public const string resource_spriteFrames_shell_Shell0001_tres = "res://resource/spriteFrames/shell/Shell0001.tres"; public const string resource_spriteFrames_shell_Shell0002_tres = "res://resource/spriteFrames/shell/Shell0002.tres"; public const string resource_spriteFrames_shell_Shell0003_tres = "res://resource/spriteFrames/shell/Shell0003.tres"; @@ -362,6 +386,8 @@ public const string scene_test_TestNewTileMap_tscn = "res://scene/test/TestNewTileMap.tscn"; public const string scene_test_TestOptimizeSprite_tscn = "res://scene/test/TestOptimizeSprite.tscn"; public const string scene_test_TestOutline_tscn = "res://scene/test/TestOutline.tscn"; + public const string scene_test_TestPerfectPixel_tscn = "res://scene/test/TestPerfectPixel.tscn"; + public const string scene_test_TestPerfectPixelScene_tscn = "res://scene/test/TestPerfectPixelScene.tscn"; public const string scene_test_TestRoomFog_tscn = "res://scene/test/TestRoomFog.tscn"; public const string scene_test_TestTileLayer_tscn = "res://scene/test/TestTileLayer.tscn"; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/World.cs b/DungeonShooting_Godot/src/game/room/World.cs index 7c4c23d..1ed2eab 100644 --- a/DungeonShooting_Godot/src/game/room/World.cs +++ b/DungeonShooting_Godot/src/game/room/World.cs @@ -119,7 +119,7 @@ var controller = advancedEnemy.StateController; if (controller.CurrState == AIAdvancedStateEnum.AiNormal) { - controller.ChangeState(AIAdvancedStateEnum.AiAstonished, AIAdvancedStateEnum.AiLeaveFor, target); + controller.ChangeState(AIAdvancedStateEnum.AiLeaveFor, target); } } }