diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index 8b0e0b8..2a2202a 100644 --- a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx index 603d0e4..0ace668 100644 --- a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index 27f6dfd..d977df6 100644 --- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/prefab/FanCollisionShape.tscn b/DungeonShooting_Godot/prefab/FanCollisionShape.tscn deleted file mode 100644 index cf26c3a..0000000 --- a/DungeonShooting_Godot/prefab/FanCollisionShape.tscn +++ /dev/null @@ -1,4 +0,0 @@ -[gd_scene format=2] - -[node name="FanCollisionShape" type="CollisionPolygon2D"] -polygon = PackedVector2Array( 0, -10, 5, -9, 9, -5, 10, 0, 9, 5, 5, 9, 0, 10 ) diff --git a/DungeonShooting_Godot/prefab/effect/weapon/MeleeAttack2.tscn b/DungeonShooting_Godot/prefab/effect/weapon/MeleeAttack2.tscn new file mode 100644 index 0000000..3796f4a --- /dev/null +++ b/DungeonShooting_Godot/prefab/effect/weapon/MeleeAttack2.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://cxq8wfeda4huc"] + +[ext_resource type="SpriteFrames" uid="uid://dj8o7ws03bik4" path="res://resource/spriteFrames/effect/KnifeHit1.tres" id="1_ds7pw"] +[ext_resource type="Script" path="res://src/game/effects/AutoDestroySprite.cs" id="2_hl3gp"] + +[node name="MeleeAttack2" type="AnimatedSprite2D"] +sprite_frames = ExtResource("1_ds7pw") +autoplay = "default" +script = ExtResource("2_hl3gp") +DelayTime = 0.12 diff --git a/DungeonShooting_Godot/prefab/role/Enemy0001.tscn b/DungeonShooting_Godot/prefab/role/Enemy0001.tscn index 6d6eeaf..46e01b2 100644 --- a/DungeonShooting_Godot/prefab/role/Enemy0001.tscn +++ b/DungeonShooting_Godot/prefab/role/Enemy0001.tscn @@ -25,7 +25,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[node name="Enemy0001" node_paths=PackedStringArray("HurtArea", "HurtCollision", "MountPoint", "BackMountPoint", "InteractiveArea", "InteractiveCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_5po38")] +[node name="Enemy0001" node_paths=PackedStringArray("HurtArea", "HurtCollision", "MountPoint", "BackMountPoint", "InteractiveArea", "InteractiveCollision", "MeleeAttackArea", "MeleeAttackCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_5po38")] collision_layer = 16 collision_mask = 25 script = ExtResource("2_1plrq") @@ -35,6 +35,8 @@ BackMountPoint = NodePath("BackMountPoint") InteractiveArea = NodePath("InteractiveArea") InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision") +MeleeAttackArea = NodePath("MountPoint/MeleeAttackArea") +MeleeAttackCollision = NodePath("MountPoint/MeleeAttackArea/MeleeAttackCollision") ShadowSprite = NodePath("ShadowSprite") AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") diff --git a/DungeonShooting_Godot/prefab/role/Role0001.tscn b/DungeonShooting_Godot/prefab/role/Role0001.tscn index b8e436d..3da3053 100644 --- a/DungeonShooting_Godot/prefab/role/Role0001.tscn +++ b/DungeonShooting_Godot/prefab/role/Role0001.tscn @@ -25,7 +25,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[node name="Role0001" node_paths=PackedStringArray("HurtArea", "HurtCollision", "MountPoint", "BackMountPoint", "InteractiveArea", "InteractiveCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_10c2n")] +[node name="Role0001" node_paths=PackedStringArray("HurtArea", "HurtCollision", "MountPoint", "BackMountPoint", "InteractiveArea", "InteractiveCollision", "MeleeAttackArea", "MeleeAttackCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_10c2n")] collision_layer = 8 script = ExtResource("2_6xwnt") HurtArea = NodePath("HurtArea") @@ -34,6 +34,8 @@ BackMountPoint = NodePath("BackMountPoint") InteractiveArea = NodePath("InteractiveArea") InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision") +MeleeAttackArea = NodePath("MountPoint/MeleeAttackArea") +MeleeAttackCollision = NodePath("MountPoint/MeleeAttackArea/MeleeAttackCollision") ShadowSprite = NodePath("ShadowSprite") AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") diff --git a/DungeonShooting_Godot/prefab/role/RoleTemplate.tscn b/DungeonShooting_Godot/prefab/role/RoleTemplate.tscn index 2217fee..559a842 100644 --- a/DungeonShooting_Godot/prefab/role/RoleTemplate.tscn +++ b/DungeonShooting_Godot/prefab/role/RoleTemplate.tscn @@ -71,3 +71,10 @@ [node name="MountPoint" type="Marker2D" parent="."] position = Vector2(2, -8) script = ExtResource("2_5ddpw") + +[node name="MeleeAttackArea" type="Area2D" parent="MountPoint"] +collision_layer = 0 +collision_mask = 0 +monitorable = false + +[node name="MeleeAttackCollision" type="CollisionPolygon2D" parent="MountPoint/MeleeAttackArea"] diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn index 2a88133..05a83fb 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://c6etppq4v63xw"] +[gd_scene load_steps=8 format=3 uid="uid://c6etppq4v63xw"] [ext_resource type="PackedScene" uid="uid://cxltmhhp4rbyk" path="res://prefab/weapon/WeaponTemplate.tscn" id="1_ykl0r"] [ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="2_t56pk"] @@ -25,6 +25,9 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false +[sub_resource type="RectangleShape2D" id="RectangleShape2D_7i6da"] +size = Vector2(22, 8.25) + [node name="Weapon0001" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_ykl0r")] script = ExtResource("2_t56pk") FirePoint = NodePath("AnimatedSprite/FirePoint") @@ -50,3 +53,7 @@ [node name="GripPoint" parent="." index="2"] position = Vector2(-5, -1) + +[node name="Collision" parent="." index="3"] +position = Vector2(0, -0.875) +shape = SubResource("RectangleShape2D_7i6da") diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0002.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0002.tscn index e13a152..0d01b8d 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0002.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0002.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=10 format=3 uid="uid://doj2eilx1xtxf"] +[gd_scene load_steps=8 format=3 uid="uid://xutp8hlrwuxd"] [ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_hgtyo"] +[ext_resource type="PackedScene" uid="uid://cxltmhhp4rbyk" path="res://prefab/weapon/WeaponTemplate.tscn" id="1_r50xc"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_8nvny"] [ext_resource type="SpriteFrames" uid="uid://domhmo4flmlt0" path="res://resource/spriteFrames/weapon/Weapon0002.tres" id="3_4h3je"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_bywvu"] resource_local_to_scene = true shader = ExtResource("2_8nvny") shader_parameter/blend = Color(0, 0, 0, 0.470588) @@ -14,7 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_llqbm"] resource_local_to_scene = true shader = ExtResource("2_8nvny") shader_parameter/blend = Color(1, 1, 1, 1) @@ -24,49 +25,10 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] -size = Vector2(19.5, 8.75) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_aymlx"] +size = Vector2(18, 6) -[sub_resource type="Animation" id="Animation_x136i"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [0] -} - -[sub_resource type="Animation" id="Animation_3piau"] -resource_name = "floodlight" -length = 3.0 -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1), -"update": 0, -"values": [0, 0, 0.5, 0.5, 0] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] -_data = { -"RESET": SubResource("Animation_x136i"), -"floodlight": SubResource("Animation_3piau") -} - -[node name="Weapon0002" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 4 +[node name="Weapon0002" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_r50xc")] script = ExtResource("1_hgtyo") FirePoint = NodePath("AnimatedSprite/FirePoint") ShellPoint = NodePath("AnimatedSprite/ShellPoint") @@ -76,28 +38,22 @@ AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_cbiyh") +[node name="ShadowSprite" parent="." index="0"] +material = SubResource("ShaderMaterial_bywvu") -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -material = SubResource("ShaderMaterial_o36tv") +[node name="AnimatedSprite" parent="." index="1"] +material = SubResource("ShaderMaterial_llqbm") sprite_frames = ExtResource("3_4h3je") -animation = &"beLoaded" -[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] +[node name="ShellPoint" parent="AnimatedSprite" index="0"] position = Vector2(-3, -2) -[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] -position = Vector2(12, -2) +[node name="FirePoint" parent="AnimatedSprite" index="1"] +position = Vector2(11.5, -2) -[node name="GripPoint" type="Marker2D" parent="."] +[node name="GripPoint" parent="." index="2"] position = Vector2(-10, 1) -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_3p5jk") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_trkjd") -} +[node name="Collision" parent="." index="3"] +position = Vector2(0, 1) +shape = SubResource("RectangleShape2D_aymlx") diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0003.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0003.tscn index 6e9552e..8575621 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0003.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0003.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=10 format=3 uid="uid://dqy4trli5wcms"] +[gd_scene load_steps=8 format=3 uid="uid://bqp56e0f7kqn0"] [ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_aeolk"] +[ext_resource type="PackedScene" uid="uid://cxltmhhp4rbyk" path="res://prefab/weapon/WeaponTemplate.tscn" id="1_c17wt"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_4yjnk"] [ext_resource type="SpriteFrames" uid="uid://c7dt1uwdybn5" path="res://resource/spriteFrames/weapon/Weapon0003.tres" id="3_upkjt"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_c6pgc"] resource_local_to_scene = true shader = ExtResource("2_4yjnk") shader_parameter/blend = Color(0, 0, 0, 0.470588) @@ -14,7 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_kp0pp"] resource_local_to_scene = true shader = ExtResource("2_4yjnk") shader_parameter/blend = Color(1, 1, 1, 1) @@ -24,49 +25,10 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] -size = Vector2(14, 8) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_tlu5a"] +size = Vector2(12, 7) -[sub_resource type="Animation" id="Animation_x136i"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [0] -} - -[sub_resource type="Animation" id="Animation_3piau"] -resource_name = "floodlight" -length = 3.0 -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1), -"update": 0, -"values": [0, 0, 0.5, 0.5, 0] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] -_data = { -"RESET": SubResource("Animation_x136i"), -"floodlight": SubResource("Animation_3piau") -} - -[node name="Weapon0003" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 4 +[node name="Weapon0003" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_c17wt")] script = ExtResource("1_aeolk") FirePoint = NodePath("AnimatedSprite/FirePoint") ShellPoint = NodePath("AnimatedSprite/ShellPoint") @@ -76,27 +38,22 @@ AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_cbiyh") +[node name="ShadowSprite" parent="." index="0"] +material = SubResource("ShaderMaterial_c6pgc") -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -material = SubResource("ShaderMaterial_o36tv") +[node name="AnimatedSprite" parent="." index="1"] +material = SubResource("ShaderMaterial_kp0pp") sprite_frames = ExtResource("3_upkjt") -[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] +[node name="ShellPoint" parent="AnimatedSprite" index="0"] position = Vector2(0, -3) -[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] -position = Vector2(9, -2) +[node name="FirePoint" parent="AnimatedSprite" index="1"] +position = Vector2(8, -2) -[node name="GripPoint" type="Marker2D" parent="."] +[node name="GripPoint" parent="." index="2"] position = Vector2(-4, 0) -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_3p5jk") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_trkjd") -} +[node name="Collision" parent="." index="3"] +position = Vector2(-1, 0) +shape = SubResource("RectangleShape2D_tlu5a") diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0004.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0004.tscn index fde40cb..cbedbe7 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0004.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0004.tscn @@ -4,7 +4,6 @@ [ext_resource type="Script" path="res://src/game/activity/weapon/knife/Knife.cs" id="2_v1wer"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="3_63s5g"] [ext_resource type="SpriteFrames" uid="uid://k2tktysa7j86" path="res://resource/spriteFrames/weapon/Weapon0004.tres" id="4_uymcs"] -[ext_resource type="PackedScene" path="res://prefab/FanCollisionShape.tscn" id="5_nr15b"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_o5ytq"] resource_local_to_scene = true @@ -26,6 +25,9 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false +[sub_resource type="RectangleShape2D" id="RectangleShape2D_yks6x"] +size = Vector2(26, 2) + [node name="Weapon0004" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_kg172")] script = ExtResource("2_v1wer") FirePoint = NodePath("AnimatedSprite/FirePoint") @@ -43,13 +45,19 @@ material = SubResource("ShaderMaterial_rtliw") sprite_frames = ExtResource("4_uymcs") +[node name="ShellPoint" parent="AnimatedSprite" index="0"] +position = Vector2(0, -1) + +[node name="FirePoint" parent="AnimatedSprite" index="1"] +position = Vector2(12, -1) + [node name="GripPoint" parent="." index="2"] position = Vector2(-12, -1) +[node name="Collision" parent="." index="3"] +position = Vector2(-1, -1) +shape = SubResource("RectangleShape2D_yks6x") + [node name="HitArea" type="Area2D" parent="." index="4"] monitoring = false monitorable = false - -[node name="FanCollisionShape" parent="HitArea" index="0" instance=ExtResource("5_nr15b")] -rotation = -1.5708 -scale = Vector2(3, 3) diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn index 506fd5c..1fbae52 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=10 format=3 uid="uid://cisivapjn5rq2"] +[gd_scene load_steps=8 format=3 uid="uid://bwhi5e52wiiay"] [ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_3lu3r"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_466gw"] +[ext_resource type="PackedScene" uid="uid://cxltmhhp4rbyk" path="res://prefab/weapon/WeaponTemplate.tscn" id="1_lyhyf"] [ext_resource type="SpriteFrames" uid="uid://djdvlmqsn8bie" path="res://resource/spriteFrames/weapon/Weapon0005.tres" id="2_m3plc"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_uftuv"] resource_local_to_scene = true shader = ExtResource("1_466gw") shader_parameter/blend = Color(0, 0, 0, 0.470588) @@ -14,7 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_irvr4"] resource_local_to_scene = true shader = ExtResource("1_466gw") shader_parameter/blend = Color(1, 1, 1, 1) @@ -24,49 +25,10 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] -size = Vector2(26, 8) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_opiwr"] +size = Vector2(28, 8) -[sub_resource type="Animation" id="Animation_x136i"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [0] -} - -[sub_resource type="Animation" id="Animation_3piau"] -resource_name = "floodlight" -length = 3.0 -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1), -"update": 0, -"values": [0, 0, 0.5, 0.5, 0] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] -_data = { -"RESET": SubResource("Animation_x136i"), -"floodlight": SubResource("Animation_3piau") -} - -[node name="Weapon0005" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 4 +[node name="Weapon0005" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_lyhyf")] script = ExtResource("1_3lu3r") FirePoint = NodePath("AnimatedSprite/FirePoint") ShellPoint = NodePath("AnimatedSprite/ShellPoint") @@ -76,27 +38,22 @@ AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_cbiyh") +[node name="ShadowSprite" parent="." index="0"] +material = SubResource("ShaderMaterial_uftuv") -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -material = SubResource("ShaderMaterial_o36tv") +[node name="AnimatedSprite" parent="." index="1"] +material = SubResource("ShaderMaterial_irvr4") sprite_frames = ExtResource("2_m3plc") -[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] +[node name="ShellPoint" parent="AnimatedSprite" index="0"] position = Vector2(-1, -3.5) -[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] +[node name="FirePoint" parent="AnimatedSprite" index="1"] position = Vector2(20, -3.5) -[node name="GripPoint" type="Marker2D" parent="."] +[node name="GripPoint" parent="." index="2"] position = Vector2(-9, 0) -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_3p5jk") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_trkjd") -} +[node name="Collision" parent="." index="3"] +position = Vector2(-1, 0) +shape = SubResource("RectangleShape2D_opiwr") diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0006.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0006.tscn index 2a5a07b..2b9639a 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0006.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0006.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=10 format=3 uid="uid://uydtgdanj0kx"] +[gd_scene load_steps=8 format=3 uid="uid://bg7ggha8wqys6"] [ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_5nx8j"] +[ext_resource type="PackedScene" uid="uid://cxltmhhp4rbyk" path="res://prefab/weapon/WeaponTemplate.tscn" id="1_kx4jd"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_rp1bw"] [ext_resource type="SpriteFrames" uid="uid://dx1mjbx4acs3q" path="res://resource/spriteFrames/weapon/Weapon0006.tres" id="2_j3sji"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_m6bme"] resource_local_to_scene = true shader = ExtResource("1_rp1bw") shader_parameter/blend = Color(0, 0, 0, 0.470588) @@ -14,7 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_fqjj0"] resource_local_to_scene = true shader = ExtResource("1_rp1bw") shader_parameter/blend = Color(1, 1, 1, 1) @@ -24,49 +25,10 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] -size = Vector2(12, 10) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_iq77m"] +size = Vector2(12, 8) -[sub_resource type="Animation" id="Animation_x136i"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [0] -} - -[sub_resource type="Animation" id="Animation_3piau"] -resource_name = "floodlight" -length = 3.0 -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1), -"update": 0, -"values": [0, 0, 0.5, 0.5, 0] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] -_data = { -"RESET": SubResource("Animation_x136i"), -"floodlight": SubResource("Animation_3piau") -} - -[node name="Weapon0006" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 4 +[node name="Weapon0006" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_kx4jd")] script = ExtResource("1_5nx8j") FirePoint = NodePath("AnimatedSprite/FirePoint") ShellPoint = NodePath("AnimatedSprite/ShellPoint") @@ -76,27 +38,22 @@ AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_cbiyh") +[node name="ShadowSprite" parent="." index="0"] +material = SubResource("ShaderMaterial_m6bme") -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -material = SubResource("ShaderMaterial_o36tv") +[node name="AnimatedSprite" parent="." index="1"] +material = SubResource("ShaderMaterial_fqjj0") sprite_frames = ExtResource("2_j3sji") -[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] +[node name="ShellPoint" parent="AnimatedSprite" index="0"] position = Vector2(-3, -2.5) -[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] +[node name="FirePoint" parent="AnimatedSprite" index="1"] position = Vector2(8, -2.5) -[node name="GripPoint" type="Marker2D" parent="."] +[node name="GripPoint" parent="." index="2"] position = Vector2(-4, 1) -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_3p5jk") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_trkjd") -} +[node name="Collision" parent="." index="3"] +position = Vector2(-1, 0) +shape = SubResource("RectangleShape2D_iq77m") diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn index 4277b9a..0467857 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=10 format=3 uid="uid://btd0wc11ajcuo"] +[gd_scene load_steps=8 format=3 uid="uid://cgbggnmxoi251"] +[ext_resource type="PackedScene" uid="uid://cxltmhhp4rbyk" path="res://prefab/weapon/WeaponTemplate.tscn" id="1_5xnlm"] [ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_exwbu"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_7rywx"] [ext_resource type="SpriteFrames" uid="uid://xxyokrbt10xm" path="res://resource/spriteFrames/weapon/Weapon0007.tres" id="3_ms2gs"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_sy2aq"] resource_local_to_scene = true shader = ExtResource("2_7rywx") shader_parameter/blend = Color(0, 0, 0, 0.470588) @@ -14,7 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_277ni"] resource_local_to_scene = true shader = ExtResource("2_7rywx") shader_parameter/blend = Color(1, 1, 1, 1) @@ -24,49 +25,10 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] -size = Vector2(12, 10) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_4pn1i"] +size = Vector2(20, 6) -[sub_resource type="Animation" id="Animation_x136i"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [0] -} - -[sub_resource type="Animation" id="Animation_3piau"] -resource_name = "floodlight" -length = 3.0 -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1), -"update": 0, -"values": [0, 0, 0.5, 0.5, 0] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] -_data = { -"RESET": SubResource("Animation_x136i"), -"floodlight": SubResource("Animation_3piau") -} - -[node name="Weapon0007" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 4 +[node name="Weapon0007" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_5xnlm")] script = ExtResource("1_exwbu") FirePoint = NodePath("AnimatedSprite/FirePoint") ShellPoint = NodePath("AnimatedSprite/ShellPoint") @@ -76,27 +38,21 @@ AnimatedSprite = NodePath("AnimatedSprite") Collision = NodePath("Collision") -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_cbiyh") +[node name="ShadowSprite" parent="." index="0"] +material = SubResource("ShaderMaterial_sy2aq") -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -material = SubResource("ShaderMaterial_o36tv") +[node name="AnimatedSprite" parent="." index="1"] +material = SubResource("ShaderMaterial_277ni") sprite_frames = ExtResource("3_ms2gs") -[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] -position = Vector2(-1, -3) +[node name="ShellPoint" parent="AnimatedSprite" index="0"] +position = Vector2(-2, -3) -[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] +[node name="FirePoint" parent="AnimatedSprite" index="1"] position = Vector2(13, -3) -[node name="GripPoint" type="Marker2D" parent="."] +[node name="GripPoint" parent="." index="2"] position = Vector2(-6, 0) -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_3p5jk") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_trkjd") -} +[node name="Collision" parent="." index="3"] +shape = SubResource("RectangleShape2D_4pn1i") diff --git a/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn b/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn index 25e1d6a..81179a1 100644 --- a/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn +++ b/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://cxltmhhp4rbyk"] +[gd_scene load_steps=7 format=3 uid="uid://cxltmhhp4rbyk"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_3p8rg"] @@ -22,9 +22,6 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false -[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] -size = Vector2(19.5, 8.75) - [sub_resource type="Animation" id="Animation_x136i"] length = 0.001 tracks/0/type = "value" @@ -82,16 +79,8 @@ [node name="GripPoint" type="Marker2D" parent="."] [node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_3p5jk") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = { "": SubResource("AnimationLibrary_trkjd") } - -[node name="MeleeAttackArea" type="Area2D" parent="."] -collision_layer = 0 -collision_mask = 0 -monitorable = false - -[node name="MeleeAttackCollision" type="CollisionPolygon2D" parent="MeleeAttackArea"] diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json index 1bf292c..62e82f2 100644 --- a/DungeonShooting_Godot/resource/config/Weapon.json +++ b/DungeonShooting_Godot/resource/config/Weapon.json @@ -46,7 +46,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 4 ], "BulletDeviationAngleRange": [ @@ -68,8 +68,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0005", "__BeginReloadSound": "reloadBegin0004", @@ -133,7 +132,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 4 ], "BulletDeviationAngleRange": [ @@ -155,8 +154,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0005", "__BeginReloadSound": "reloadBegin0004", @@ -220,7 +218,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "BulletHarmRange": [ + "HarmRange": [ 4 ], "BulletDeviationAngleRange": [ @@ -243,8 +241,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0003", "__BeginReloadSound": "reloadBegin0002", @@ -308,7 +305,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "BulletHarmRange": [ + "HarmRange": [ 4 ], "BulletDeviationAngleRange": [ @@ -331,8 +328,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0003", "__BeginReloadSound": "reloadBegin0002", @@ -396,7 +392,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 4 ], "BulletDeviationAngleRange": [ @@ -418,8 +414,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0004", "__BeginReloadSound": "reloading0001", @@ -483,7 +478,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 4 ], "BulletDeviationAngleRange": [ @@ -505,8 +500,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0004", "__BeginReloadSound": "reloading0001", @@ -569,7 +563,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 25 ], "BulletDeviationAngleRange": [ @@ -589,8 +583,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "", "__BeginReloadSound": "", @@ -653,7 +646,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 25 ], "BulletDeviationAngleRange": [ @@ -673,8 +666,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "", "__BeginReloadSound": "", @@ -738,7 +730,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 30 ], "BulletDeviationAngleRange": [ @@ -760,8 +752,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0008", "__BeginReloadSound": "reloadBegin0009", @@ -825,7 +816,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "BulletHarmRange": [ + "HarmRange": [ 30 ], "BulletDeviationAngleRange": [ @@ -847,8 +838,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0008", "__BeginReloadSound": "reloadBegin0009", @@ -912,7 +902,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "BulletHarmRange": [ + "HarmRange": [ 3 ], "BulletDeviationAngleRange": [ @@ -934,8 +924,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0002", "__BeginReloadSound": "reloadBegin0005", @@ -999,7 +988,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "BulletHarmRange": [ + "HarmRange": [ 3 ], "BulletDeviationAngleRange": [ @@ -1021,8 +1010,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0002", "__BeginReloadSound": "reloadBegin0005", @@ -1086,7 +1074,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0003", - "BulletHarmRange": [ + "HarmRange": [ 3 ], "BulletDeviationAngleRange": [ @@ -1108,8 +1096,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0007", "__BeginReloadSound": "reloadBegin0006", @@ -1173,7 +1160,7 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0003", - "BulletHarmRange": [ + "HarmRange": [ 3 ], "BulletDeviationAngleRange": [ @@ -1195,8 +1182,7 @@ }, "CanMeleeAttack": true, "MeleeAttackHarmRange": [ - 5, - 8 + 10 ], "__ShootSound": "shooting0007", "__BeginReloadSound": "reloadBegin0006", diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json index 1c55d41..7feefd0 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json @@ -1 +1 @@ -[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":10,"Y":22},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":11,"Y":38},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-15,"Y":31},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":36,"Y":36},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":35,"Y":2},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-12,"Y":3},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":2,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-36,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":10,"Y":22},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":0,"Y":16},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":23,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":11,"Y":38},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-15,"Y":31},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":36,"Y":36},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":35,"Y":2},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-12,"Y":3},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":2,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-36,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png index 3f0900c..b31f92e 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/spriteFrames/effect/KnifeHit1.tres b/DungeonShooting_Godot/resource/spriteFrames/effect/KnifeHit1.tres index e519ec9..69b6d5a 100644 --- a/DungeonShooting_Godot/resource/spriteFrames/effect/KnifeHit1.tres +++ b/DungeonShooting_Godot/resource/spriteFrames/effect/KnifeHit1.tres @@ -47,7 +47,7 @@ "duration": 1.0, "texture": SubResource("6") }], -"loop": true, +"loop": false, "name": &"default", "speed": 30.0 }] diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs index 8f2f8ec..d83dda9 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs @@ -131,7 +131,7 @@ public float BeLoadedTime; /// - /// 连续发射次数范围, 仅当 'ContinuousShoot' 为 false 时生效
+ /// 连续发射次数区间, 仅当 'ContinuousShoot' 为 false 时生效
/// 格式为[value]或者[min,max] ///
[JsonInclude] @@ -168,7 +168,7 @@ public float FiringSpeedBackSpeed; /// - /// 单次开火发射子弹数量范围
+ /// 单次开火发射子弹数量区间
/// 格式为[value]或者[min,max] ///
[JsonInclude] @@ -211,7 +211,7 @@ public float ScatteringRangeBackDelayTime; /// - /// 后坐力范围 (仅用于开火后武器身抖动)
+ /// 后坐力区间 (仅用于开火后武器身抖动)
/// 格式为[value]或者[min,max] ///
[JsonInclude] @@ -248,14 +248,14 @@ public string BulletId; /// - /// 子弹造成的伤害范围
+ /// 造成的伤害区间
/// 格式为[value]或者[min,max] ///
[JsonInclude] - public int[] BulletHarmRange; + public int[] HarmRange; /// - /// 子弹偏移角度范围
+ /// 子弹偏移角度区间
/// 用于设置子弹偏移朝向, 该属性和射半径效果类似, 但与其不同的是, 散射半径是用来控制枪口朝向的, 而该属性是控制子弹朝向的, 可用于制作霰弹枪子弹效果
/// 格式为[value]或者[min,max] ///
@@ -263,14 +263,14 @@ public float[] BulletDeviationAngleRange; /// - /// 子弹初速度范围
+ /// 子弹初速度区间
/// 格式为[value]或者[min,max] ///
[JsonInclude] public float[] BulletSpeedRange; /// - /// 子弹飞行距离范围
+ /// 子弹飞行距离区间
/// 格式为[value]或者[min,max] ///
[JsonInclude] @@ -302,7 +302,7 @@ public bool CanMeleeAttack; /// - /// 近战攻击伤害范围
+ /// 近战攻击伤害区间
/// 格式为格式为[value]或者[min,max] ///
[JsonInclude] @@ -436,7 +436,7 @@ inst.DefaultAngle = DefaultAngle; inst.UpliftAngleRestore = UpliftAngleRestore; inst.BulletId = BulletId; - inst.BulletHarmRange = BulletHarmRange; + inst.HarmRange = HarmRange; inst.BulletDeviationAngleRange = BulletDeviationAngleRange; inst.BulletSpeedRange = BulletSpeedRange; inst.BulletDistanceRange = BulletDistanceRange; diff --git a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs index 1448c50..0794389 100644 --- a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs +++ b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs @@ -125,7 +125,6 @@ var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm); if (Role != null) { - var d = damage; damage = Role.RoleState.CallCalcDamageEvent(damage); } diff --git a/DungeonShooting_Godot/src/game/activity/package/Package.cs b/DungeonShooting_Godot/src/game/activity/package/Package.cs index 98b5582..ca1ad16 100644 --- a/DungeonShooting_Godot/src/game/activity/package/Package.cs +++ b/DungeonShooting_Godot/src/game/activity/package/Package.cs @@ -6,6 +6,11 @@ /// public class Package : IDestroy where T : ActivityObject, IPackageItem { + /// + /// 当前使用对象改变时回调 + /// + public event Action ChangeActiveItemEvent; + public bool IsDestroyed { get; private set; } /// @@ -16,7 +21,23 @@ /// /// 当前使用的物体对象 /// - public T ActiveItem { get; private set; } + public T ActiveItem + { + get => _activeItem; + set + { + if (value != _activeItem) + { + _activeItem = value; + if (ChangeActiveItemEvent != null) + { + ChangeActiveItemEvent(value); + } + } + } + } + + private T _activeItem; /// /// 当前使用的物体的索引 diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs index e66a0d7..c37cd51 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs @@ -40,7 +40,7 @@ public CampEnum Camp; /// - /// 攻击目标的碰撞器所属层级, 数据源自于: PhysicsLayer + /// 攻击目标的碰撞器所属层级, 数据源自于: /// public uint AttackLayer { get; set; } = PhysicsLayer.Wall; @@ -81,6 +81,24 @@ /// [Export, ExportFillNode] public CollisionShape2D InteractiveCollision { get; set; } + + /// + /// 近战碰撞检测区域 + /// + [Export, ExportFillNode] + public Area2D MeleeAttackArea { get; set; } + + /// + /// 近战碰撞检测区域的碰撞器 + /// + [Export, ExportFillNode] + public CollisionPolygon2D MeleeAttackCollision { get; set; } + + /// + /// 近战攻击时挥动武器的角度 + /// + [Export] + public float MeleeAttackAngle { get; set; } = 120; /// /// 武器挂载点是否始终指向目标 @@ -398,6 +416,12 @@ //连接互动物体信号 InteractiveArea.BodyEntered += _OnPropsEnter; InteractiveArea.BodyExited += _OnPropsExit; + + MeleeAttackCollision.Disabled = true; + //切换武器回调 + WeaponPack.ChangeActiveItemEvent += OnChangeActiveItem; + //近战区域进入物体 + MeleeAttackArea.BodyEntered += OnMeleeAttackBodyEntered; } protected override void Process(float delta) @@ -1079,6 +1103,46 @@ } } + /// + /// 切换当前使用的武器的回调 + /// + private void OnChangeActiveItem(Weapon weapon) + { + //这里处理近战区域 + if (weapon != null) + { + MeleeAttackCollision.Polygon = Utils.CreateSectorPolygon( + Utils.ConvertAngle(-MeleeAttackAngle / 2f), + (weapon.GetLocalFirePosition() - weapon.GripPoint.Position).Length() * 1.2f, + MeleeAttackAngle, + 6 + ); + MeleeAttackArea.CollisionMask = AttackLayer; + } + } + + /// + /// 近战区域碰到敌人 + /// + private void OnMeleeAttackBodyEntered(Node2D body) + { + var activeWeapon = WeaponPack.ActiveItem; + if (activeWeapon == null) + { + return; + } + var activityObject = body.AsActivityObject(); + if (activityObject != null) + { + if (activityObject is Role role) + { + var damage = Utils.Random.RandomConfigRange(activeWeapon.Attribute.MeleeAttackHarmRange); + damage = RoleState.CallCalcDamageEvent(damage); + role.CallDeferred(nameof(Hurt), damage, (role.GetCenterPosition() - GlobalPosition).Angle()); + } + } + } + protected override void OnDestroy() { //销毁道具 diff --git a/DungeonShooting_Godot/src/game/activity/role/RoleState.cs b/DungeonShooting_Godot/src/game/activity/role/RoleState.cs index d195c75..c2c629b 100644 --- a/DungeonShooting_Godot/src/game/activity/role/RoleState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/RoleState.cs @@ -87,7 +87,6 @@ /// 武器初始散射值增量 /// public event Action> CalcStartScatteringEvent; - public float CallCalcStartScatteringEvent(Weapon weapon, float value) { if (CalcStartScatteringEvent != null) diff --git a/DungeonShooting_Godot/src/game/activity/role/Role_Animation.cs b/DungeonShooting_Godot/src/game/activity/role/Role_Animation.cs index dc22d51..977c5ef 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role_Animation.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role_Animation.cs @@ -13,20 +13,20 @@ var r = MountPoint.RotationDegrees; //var gp = MountPoint.GlobalPosition; var p1 = MountPoint.Position; - var p2 = p1 + new Vector2(6, 0).Rotated(Mathf.DegToRad(r - 60)); - var p3 = p1 + new Vector2(6, 0).Rotated(Mathf.DegToRad(r + 60)); + var p2 = p1 + new Vector2(6, 0).Rotated(Mathf.DegToRad(r - MeleeAttackAngle / 2f)); + var p3 = p1 + new Vector2(6, 0).Rotated(Mathf.DegToRad(r + MeleeAttackAngle / 2f)); var tween = CreateTween(); tween.SetParallel(); - tween.TweenProperty(MountPoint, "rotation_degrees", r - 60, 0.12); + tween.TweenProperty(MountPoint, "rotation_degrees", r - MeleeAttackAngle / 2f, 0.12); tween.TweenProperty(MountPoint, "position", p2, 0.12); tween.TweenProperty(MountPoint, "position", p2, 0.12); tween.Chain(); tween.TweenCallback(Callable.From(() => { - MountPoint.RotationDegrees = r + 60; + MountPoint.RotationDegrees = r + MeleeAttackAngle / 2f; MountPoint.Position = p3; //重新计算武器阴影位置 var activeItem = WeaponPack.ActiveItem; @@ -45,16 +45,24 @@ //播放特效 var sprite = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_effect_weapon_MeleeAttack1_tscn); var localFirePosition = activeItem.GetLocalFirePosition() - activeItem.GripPoint.Position; - localFirePosition.X *= 0.9f; + localFirePosition *= 0.9f; sprite.Position = p1 + localFirePosition.Rotated(Mathf.DegToRad(r)); sprite.RotationDegrees = r; AddChild(sprite); + + //启用近战碰撞区域 + MeleeAttackCollision.Disabled = false; })); tween.Chain(); - + tween.TweenInterval(0.1f); tween.Chain(); - + + tween.TweenCallback(Callable.From(() => + { + //关闭近战碰撞区域 + MeleeAttackCollision.Disabled = true; + })); tween.TweenProperty(MountPoint, "rotation_degrees", r, 0.2); tween.TweenProperty(MountPoint, "position", p1, 0.2); tween.Chain(); diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index ace9948..0cc4c41 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -1806,8 +1806,7 @@ { var speed = Utils.Random.RandomConfigRange(Attribute.BulletSpeedRange); var distance = Utils.Random.RandomConfigRange(Attribute.BulletDistanceRange); - var deviationAngle = - Utils.Random.RandomConfigRange(Attribute.BulletDeviationAngleRange); + var deviationAngle = Utils.Random.RandomConfigRange(Attribute.BulletDeviationAngleRange); if (Master != null) { speed = Master.RoleState.CallCalcBulletSpeedEvent(this, speed); @@ -1827,8 +1826,8 @@ fireRotation + Mathf.DegToRad(deviationAngle), attackLayer ); - bullet.MinHarm = Utils.GetConfigRangeStart(Attribute.BulletHarmRange); - bullet.MaxHarm = Utils.GetConfigRangeEnd(Attribute.BulletHarmRange); + bullet.MinHarm = Utils.GetConfigRangeStart(Attribute.HarmRange); + bullet.MaxHarm = Utils.GetConfigRangeEnd(Attribute.HarmRange); bullet.PutDown(RoomLayerEnum.YSortLayer); return bullet; } diff --git a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs index e9651c8..5c6f5ed 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs @@ -1,21 +1,43 @@ using Godot; +/// +/// 近战武器,刀 +/// [Tool] public partial class Knife : Weapon { + /// + /// 近战攻击范围 + /// + [Export] + public int AttackRange { get; set; } = 41; + + /// + /// 开始蓄力时武器抬起角度 + /// + [Export] + public int BeginChargeAngle { get; set; } = 120; private Area2D _hitArea; private int _attackIndex = 0; + private CollisionPolygon2D _collisionPolygon; public override void OnInit() { base.OnInit(); _hitArea = GetNode("HitArea"); + _collisionPolygon = new CollisionPolygon2D(); + var a = Mathf.Abs(-BeginChargeAngle + Attribute.UpliftAngle); + var ca = Utils.ConvertAngle(-a / 2f); + _collisionPolygon.Polygon = Utils.CreateSectorPolygon(ca, AttackRange, a, 6); + _hitArea.AddChild(_collisionPolygon); + _hitArea.Monitoring = false; _hitArea.Monitorable = false; _hitArea.BodyEntered += OnBodyEntered; + //禁用自动播放动画 IsAutoPlaySpriteFrames = false; } @@ -42,8 +64,8 @@ protected override void OnBeginCharge() { - //开始蓄力时武器角度上抬120度 - RotationDegrees = -120; + //开始蓄力时武器角度 + RotationDegrees = -BeginChargeAngle; } protected override void OnFire() @@ -59,8 +81,11 @@ { //播放挥刀特效 SpecialEffectManager.Play( + Master, ResourcePath.resource_spriteFrames_effect_KnifeHit1_tres, "default", - Master.MountPoint.GlobalPosition, GlobalRotation + Mathf.Pi * 0.5f, new Vector2((int)Master.Face, 1) * AnimatedSprite.Scale, + Master.MountPoint.Position, + Master.MountPoint.Rotation + Mathf.DegToRad(Attribute.UpliftAngle + 60), + AnimatedSprite.Scale, new Vector2(17, 4), 1 ); } @@ -68,8 +93,18 @@ if (Master == Player.Current) { - //创建抖动 - //GameCamera.Main.ProcessDirectionalShake(Vector2.Right.Rotated(GlobalRotation - Mathf.Pi * 0.5f) * 1.5f); + var r = Master.MountPoint.RotationDegrees; + //创建屏幕抖动 + if (Master.Face == FaceDirection.Right) + { + //GameCamera.Main.DirectionalShake(Vector2.FromAngle(Mathf.DegToRad(r - 90)) * 5); + GameCamera.Main.DirectionalShake(Vector2.FromAngle(Mathf.DegToRad(r - 180)) * 7); + } + else + { + //GameCamera.Main.DirectionalShake(Vector2.FromAngle(Mathf.DegToRad(270 - r)) * 5); + GameCamera.Main.DirectionalShake(Vector2.FromAngle(Mathf.DegToRad(-r)) * 7); + } } } @@ -86,14 +121,19 @@ private void OnBodyEntered(Node2D body) { - GD.Print("碰到物体: " + body.Name); + //GD.Print("碰到物体: " + body.Name); var activityObject = body.AsActivityObject(); if (activityObject != null) { if (activityObject is Role role) { - role.CallDeferred(nameof(Role.Hurt), - Utils.Random.RandomConfigRange(Attribute.BulletHarmRange), (role.GetCenterPosition() - GlobalPosition).Angle()); + var damage = Utils.Random.RandomConfigRange(Attribute.HarmRange); + if (Master != null) + { + damage = Master.RoleState.CallCalcDamageEvent(damage); + } + + role.CallDeferred(nameof(Role.Hurt), damage, (role.GetCenterPosition() - GlobalPosition).Angle()); } } } diff --git a/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs b/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs index c5e59bb..0d74206 100644 --- a/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs +++ b/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs @@ -41,6 +41,7 @@ /// /// 在场景指定位置播放一个特效, 特效必须是 SpriteFrames 类型 /// + /// 挂载的根节点 /// 特效SpriteFrames资源路径 /// 动画名称 /// 坐标 @@ -50,11 +51,11 @@ /// 层级 /// 播放速度 /// 循环次数, 到达该次数特效停止播放 - public static void Play(string path, string animName, Vector2 pos, float rotation, Vector2 scale, Vector2 offset, int zIndex = 0, float speed = 1, int loopCount = 1) + public static void Play(Node root, string path, string animName, Vector2 pos, float rotation, Vector2 scale, Vector2 offset, int zIndex = 0, float speed = 1, int loopCount = 1) { var spriteFrames = ResourceManager.Load(path); var specialEffect = new SpecialEffect(); - specialEffect.GlobalPosition = pos; + specialEffect.Position = pos; specialEffect.Rotation = rotation; specialEffect.Scale = scale; specialEffect.ZIndex = zIndex; @@ -63,6 +64,6 @@ specialEffect.LoopCount = loopCount; specialEffect.SpriteFrames = spriteFrames; specialEffect.Play(animName); - specialEffect.AddToActivityRoot(RoomLayerEnum.YSortLayer); + root.AddChild(specialEffect); } } \ No newline at end of file