diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx index 26adfca..36be7ef 100644 --- a/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx b/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx index c96c509..6d09ac6 100644 --- a/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/AmmoBase.xlsx b/DungeonShooting_Godot/excel/excelFile/AmmoBase.xlsx deleted file mode 100644 index 737bb6e..0000000 --- a/DungeonShooting_Godot/excel/excelFile/AmmoBase.xlsx +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx b/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx new file mode 100644 index 0000000..c24bbbb --- /dev/null +++ b/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx index d98f2d6..11c8cf8 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/WeaponBase.xlsx b/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx index 9fa0147..0605bac 100644 --- a/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx Binary files differ diff --git a/DungeonShooting_Godot/prefab/ammo/Bullet0001.tscn b/DungeonShooting_Godot/prefab/ammo/Bullet0001.tscn deleted file mode 100644 index 69aa265..0000000 --- a/DungeonShooting_Godot/prefab/ammo/Bullet0001.tscn +++ /dev/null @@ -1,72 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://bj4kmvt8jg1cf"] - -[ext_resource type="Script" path="res://src/game/activity/ammo/Bullet.cs" id="1_82ma0"] -[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_6wvtu"] -[ext_resource type="Texture2D" uid="uid://bu0b11hiuecxy" path="res://resource/sprite/ammo/bullet0001.png" id="3_hjgpe"] - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_w5w0i"] -resource_local_to_scene = true -shader = ExtResource("2_6wvtu") -shader_parameter/blend = Color(0, 0, 0, 0.470588) -shader_parameter/schedule = 1.0 -shader_parameter/modulate = Color(1, 1, 1, 1) -shader_parameter/show_outline = false -shader_parameter/outline_color = Color(0, 0, 0, 1) -shader_parameter/outline_rainbow = false -shader_parameter/outline_use_blend = true - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_qhkgc"] -resource_local_to_scene = true -shader = ExtResource("2_6wvtu") -shader_parameter/blend = Color(1, 1, 1, 1) -shader_parameter/schedule = 0.0 -shader_parameter/modulate = Color(1, 1, 1, 1) -shader_parameter/show_outline = false -shader_parameter/outline_color = Color(0, 0, 0, 1) -shader_parameter/outline_rainbow = false -shader_parameter/outline_use_blend = true - -[sub_resource type="SpriteFrames" id="SpriteFrames_5wvmf"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": ExtResource("3_hjgpe") -}], -"loop": true, -"name": &"default", -"speed": 5.0 -}] - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_lcqb8"] -size = Vector2(9, 4) - -[node name="Bullet0001" type="CharacterBody2D" node_paths=PackedStringArray("CollisionArea", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 2 -script = ExtResource("1_82ma0") -CollisionArea = NodePath("CollisionArea") -ShadowSprite = NodePath("ShadowSprite") -AnimatedSprite = NodePath("AnimatedSprite") -Collision = NodePath("Collision") - -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_w5w0i") - -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -modulate = Color(1.6, 1.6, 1.6, 1) -material = SubResource("ShaderMaterial_qhkgc") -sprite_frames = SubResource("SpriteFrames_5wvmf") - -[node name="CollisionArea" type="Area2D" parent="."] -visible = false -collision_layer = 0 -collision_mask = 0 -monitorable = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="CollisionArea"] -position = Vector2(2.93353, 0) -shape = SubResource("RectangleShape2D_lcqb8") - -[node name="Collision" type="CollisionShape2D" parent="."] -position = Vector2(1.5, 0) -shape = SubResource("RectangleShape2D_lcqb8") diff --git a/DungeonShooting_Godot/prefab/ammo/Bullet0002.tscn b/DungeonShooting_Godot/prefab/ammo/Bullet0002.tscn deleted file mode 100644 index a8da285..0000000 --- a/DungeonShooting_Godot/prefab/ammo/Bullet0002.tscn +++ /dev/null @@ -1,63 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://bqkj0rn72ppge"] - -[ext_resource type="Script" path="res://src/game/activity/ammo/Bullet.cs" id="1_hga3h"] -[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_n44pd"] -[ext_resource type="SpriteFrames" uid="uid://bpeodjqiy3mil" path="res://resource/spriteFrames/bullet/Bullet0002.tres" id="3_uvuj8"] - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_v77gw"] -resource_local_to_scene = true -shader = ExtResource("2_n44pd") -shader_parameter/blend = Color(0, 0, 0, 0.470588) -shader_parameter/schedule = 1.0 -shader_parameter/modulate = Color(1, 1, 1, 1) -shader_parameter/show_outline = false -shader_parameter/outline_color = Color(0, 0, 0, 1) -shader_parameter/outline_rainbow = false -shader_parameter/outline_use_blend = true - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_p0wfd"] -resource_local_to_scene = true -shader = ExtResource("2_n44pd") -shader_parameter/blend = Color(1, 1, 1, 1) -shader_parameter/schedule = 0.0 -shader_parameter/modulate = Color(1, 1, 1, 1) -shader_parameter/show_outline = false -shader_parameter/outline_color = Color(0, 0, 0, 1) -shader_parameter/outline_rainbow = false -shader_parameter/outline_use_blend = true - -[sub_resource type="CircleShape2D" id="CircleShape2D_0vxfv"] -radius = 3.0 - -[sub_resource type="CircleShape2D" id="CircleShape2D_e2yn3"] -radius = 3.0 - -[node name="Bullet0002" type="CharacterBody2D" node_paths=PackedStringArray("CollisionArea", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 2 -script = ExtResource("1_hga3h") -CollisionArea = NodePath("CollisionArea") -ShadowSprite = NodePath("ShadowSprite") -AnimatedSprite = NodePath("AnimatedSprite") -Collision = NodePath("Collision") - -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_v77gw") - -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -modulate = Color(1.6, 1.6, 1.6, 1) -material = SubResource("ShaderMaterial_p0wfd") -sprite_frames = ExtResource("3_uvuj8") - -[node name="CollisionArea" type="Area2D" parent="."] -visible = false -collision_layer = 0 -collision_mask = 0 -monitorable = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="CollisionArea"] -position = Vector2(-2.38419e-07, 0) -shape = SubResource("CircleShape2D_0vxfv") - -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("CircleShape2D_e2yn3") diff --git a/DungeonShooting_Godot/prefab/ammo/Bullet0003.tscn b/DungeonShooting_Godot/prefab/ammo/Bullet0003.tscn deleted file mode 100644 index 6a3904f..0000000 --- a/DungeonShooting_Godot/prefab/ammo/Bullet0003.tscn +++ /dev/null @@ -1,59 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://ee24ocwk8snj"] - -[ext_resource type="Script" path="res://src/game/activity/ammo/Bullet.cs" id="1_h6lfm"] -[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_bteri"] -[ext_resource type="SpriteFrames" uid="uid://bcnhyin0aufl1" path="res://resource/spriteFrames/bullet/Bullet0003.tres" id="3_qvo0u"] - - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_v77gw"] -resource_local_to_scene = true -shader = ExtResource("2_bteri") -shader_parameter/blend = Color(0, 0, 0, 0.470588) -shader_parameter/schedule = 1.0 -shader_parameter/modulate = Color(1, 1, 1, 1) -shader_parameter/show_outline = false -shader_parameter/outline_color = Color(0, 0, 0, 1) -shader_parameter/outline_rainbow = false - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_p0wfd"] -resource_local_to_scene = true -shader = ExtResource("2_bteri") -shader_parameter/blend = Color(1, 1, 1, 1) -shader_parameter/schedule = 0.0 -shader_parameter/modulate = Color(1, 1, 1, 1) -shader_parameter/show_outline = false -shader_parameter/outline_color = Color(0, 0, 0, 1) -shader_parameter/outline_rainbow = false - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_c0onq"] -size = Vector2(6, 3.125) - -[node name="Bullet0003" type="CharacterBody2D" node_paths=PackedStringArray("CollisionArea", "ShadowSprite", "AnimatedSprite", "Collision")] -collision_layer = 2 -script = ExtResource("1_h6lfm") -CollisionArea = NodePath("CollisionArea") -ShadowSprite = NodePath("ShadowSprite") -AnimatedSprite = NodePath("AnimatedSprite") -Collision = NodePath("Collision") - -[node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_v77gw") - -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] -modulate = Color(1.6, 1.6, 1.6, 1) -material = SubResource("ShaderMaterial_p0wfd") -sprite_frames = ExtResource("3_qvo0u") - -[node name="CollisionArea" type="Area2D" parent="."] -visible = false -collision_layer = 0 -collision_mask = 0 -monitorable = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="CollisionArea"] -position = Vector2(1, 0) -shape = SubResource("RectangleShape2D_c0onq") - -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_c0onq") diff --git a/DungeonShooting_Godot/prefab/ammo/laser/Laser0001.tscn b/DungeonShooting_Godot/prefab/ammo/laser/Laser0001.tscn deleted file mode 100644 index 84ee658..0000000 --- a/DungeonShooting_Godot/prefab/ammo/laser/Laser0001.tscn +++ /dev/null @@ -1,22 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://d1q8jjtgi2wpu"] - -[ext_resource type="Script" path="res://src/game/activity/ammo/laser/Laser.cs" id="1_d486x"] -[ext_resource type="Texture2D" uid="uid://clfpbq1c1ilp1" path="res://resource/sprite/ammo/Laser0001.png" id="2_xd7mu"] - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_l4vuk"] -resource_local_to_scene = true - -[node name="Laser0001" type="Area2D"] -collision_layer = 2 -monitorable = false -script = ExtResource("1_d486x") - -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource("RectangleShape2D_l4vuk") - -[node name="LineSprite" type="Sprite2D" parent="."] -modulate = Color(1.4, 1.4, 1.4, 1) -position = Vector2(0, 1.19209e-07) -texture = ExtResource("2_xd7mu") -centered = false -offset = Vector2(0, -8) diff --git a/DungeonShooting_Godot/prefab/bullet/Bullet0001.tscn b/DungeonShooting_Godot/prefab/bullet/Bullet0001.tscn new file mode 100644 index 0000000..713d70f --- /dev/null +++ b/DungeonShooting_Godot/prefab/bullet/Bullet0001.tscn @@ -0,0 +1,72 @@ +[gd_scene load_steps=8 format=3 uid="uid://bj4kmvt8jg1cf"] + +[ext_resource type="Script" path="res://src/game/activity/bullet/Bullet.cs" id="1_3d3df"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_mxa72"] +[ext_resource type="Texture2D" uid="uid://bu0b11hiuecxy" path="res://resource/sprite/bullet/bullet0001.png" id="3_pm4pr"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_w5w0i"] +resource_local_to_scene = true +shader = ExtResource("2_mxa72") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = false +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_qhkgc"] +resource_local_to_scene = true +shader = ExtResource("2_mxa72") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = false +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true + +[sub_resource type="SpriteFrames" id="SpriteFrames_5wvmf"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3_pm4pr") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_lcqb8"] +size = Vector2(9, 4) + +[node name="Bullet0001" type="CharacterBody2D" node_paths=PackedStringArray("CollisionArea", "ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 2 +script = ExtResource("1_3d3df") +CollisionArea = NodePath("CollisionArea") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_w5w0i") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +modulate = Color(1.6, 1.6, 1.6, 1) +material = SubResource("ShaderMaterial_qhkgc") +sprite_frames = SubResource("SpriteFrames_5wvmf") + +[node name="CollisionArea" type="Area2D" parent="."] +visible = false +collision_layer = 0 +collision_mask = 0 +monitorable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="CollisionArea"] +position = Vector2(2.93353, 0) +shape = SubResource("RectangleShape2D_lcqb8") + +[node name="Collision" type="CollisionShape2D" parent="."] +position = Vector2(1.5, 0) +shape = SubResource("RectangleShape2D_lcqb8") diff --git a/DungeonShooting_Godot/prefab/bullet/Bullet0002.tscn b/DungeonShooting_Godot/prefab/bullet/Bullet0002.tscn new file mode 100644 index 0000000..27cfff5 --- /dev/null +++ b/DungeonShooting_Godot/prefab/bullet/Bullet0002.tscn @@ -0,0 +1,63 @@ +[gd_scene load_steps=8 format=3 uid="uid://bqkj0rn72ppge"] + +[ext_resource type="Script" path="res://src/game/activity/bullet/Bullet.cs" id="1_hepay"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_0n2yg"] +[ext_resource type="SpriteFrames" uid="uid://bpeodjqiy3mil" path="res://resource/spriteFrames/bullet/Bullet0002.tres" id="3_ldd0h"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_v77gw"] +resource_local_to_scene = true +shader = ExtResource("2_0n2yg") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = false +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_p0wfd"] +resource_local_to_scene = true +shader = ExtResource("2_0n2yg") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = false +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true + +[sub_resource type="CircleShape2D" id="CircleShape2D_0vxfv"] +radius = 3.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_e2yn3"] +radius = 3.0 + +[node name="Bullet0002" type="CharacterBody2D" node_paths=PackedStringArray("CollisionArea", "ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 2 +script = ExtResource("1_hepay") +CollisionArea = NodePath("CollisionArea") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_v77gw") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +modulate = Color(1.6, 1.6, 1.6, 1) +material = SubResource("ShaderMaterial_p0wfd") +sprite_frames = ExtResource("3_ldd0h") + +[node name="CollisionArea" type="Area2D" parent="."] +visible = false +collision_layer = 0 +collision_mask = 0 +monitorable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="CollisionArea"] +position = Vector2(-2.38419e-07, 0) +shape = SubResource("CircleShape2D_0vxfv") + +[node name="Collision" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_e2yn3") diff --git a/DungeonShooting_Godot/prefab/bullet/Bullet0003.tscn b/DungeonShooting_Godot/prefab/bullet/Bullet0003.tscn new file mode 100644 index 0000000..10ba78b --- /dev/null +++ b/DungeonShooting_Godot/prefab/bullet/Bullet0003.tscn @@ -0,0 +1,59 @@ +[gd_scene load_steps=7 format=3 uid="uid://ee24ocwk8snj"] + +[ext_resource type="Script" path="res://src/game/activity/bullet/Bullet.cs" id="1_h6lfm"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_bteri"] +[ext_resource type="SpriteFrames" uid="uid://bcnhyin0aufl1" path="res://resource/spriteFrames/bullet/Bullet0003.tres" id="3_qvo0u"] + + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_v77gw"] +resource_local_to_scene = true +shader = ExtResource("2_bteri") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = false +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_p0wfd"] +resource_local_to_scene = true +shader = ExtResource("2_bteri") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = false +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_c0onq"] +size = Vector2(6, 3.125) + +[node name="Bullet0003" type="CharacterBody2D" node_paths=PackedStringArray("CollisionArea", "ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 2 +script = ExtResource("1_h6lfm") +CollisionArea = NodePath("CollisionArea") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_v77gw") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +modulate = Color(1.6, 1.6, 1.6, 1) +material = SubResource("ShaderMaterial_p0wfd") +sprite_frames = ExtResource("3_qvo0u") + +[node name="CollisionArea" type="Area2D" parent="."] +visible = false +collision_layer = 0 +collision_mask = 0 +monitorable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="CollisionArea"] +position = Vector2(1, 0) +shape = SubResource("RectangleShape2D_c0onq") + +[node name="Collision" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_c0onq") diff --git a/DungeonShooting_Godot/prefab/bullet/laser/Laser0001.tscn b/DungeonShooting_Godot/prefab/bullet/laser/Laser0001.tscn new file mode 100644 index 0000000..3648437 --- /dev/null +++ b/DungeonShooting_Godot/prefab/bullet/laser/Laser0001.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://d1q8jjtgi2wpu"] + +[ext_resource type="Script" path="res://src/game/activity/bullet/laser/Laser.cs" id="1_3w0rp"] +[ext_resource type="Texture2D" uid="uid://clfpbq1c1ilp1" path="res://resource/sprite/bullet/Laser0001.png" id="2_uqalj"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_l4vuk"] +resource_local_to_scene = true + +[node name="Laser0001" type="Area2D"] +collision_layer = 2 +monitorable = false +script = ExtResource("1_3w0rp") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_l4vuk") + +[node name="LineSprite" type="Sprite2D" parent="."] +modulate = Color(1.5, 1.5, 1.5, 1) +position = Vector2(0, 1.19209e-07) +texture = ExtResource("2_uqalj") +centered = false +offset = Vector2(0, -8) diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn index 0467857..b4a5c1c 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0007.tscn @@ -14,6 +14,7 @@ shader_parameter/show_outline = true shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true [sub_resource type="ShaderMaterial" id="ShaderMaterial_277ni"] resource_local_to_scene = true @@ -24,6 +25,7 @@ shader_parameter/show_outline = true shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true [sub_resource type="RectangleShape2D" id="RectangleShape2D_4pn1i"] size = Vector2(20, 6) diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0008.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0008.tscn new file mode 100644 index 0000000..bbb5c5b --- /dev/null +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0008.tscn @@ -0,0 +1,106 @@ +[gd_scene load_steps=10 format=3 uid="uid://yt10i80hs3gt"] + +[ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_l63x2"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_mhoa7"] +[ext_resource type="SpriteFrames" uid="uid://b2wpy40adyjs6" path="res://resource/spriteFrames/weapon/Weapon0008.tres" id="2_s0xbw"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +resource_local_to_scene = true +shader = ExtResource("1_mhoa7") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = true +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +resource_local_to_scene = true +shader = ExtResource("1_mhoa7") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = true +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false +shader_parameter/outline_use_blend = true + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_evjpf"] +size = Vector2(12, 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="Weapon0008" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 4 +script = ExtResource("1_l63x2") +FirePoint = NodePath("AnimatedSprite/FirePoint") +ShellPoint = NodePath("AnimatedSprite/ShellPoint") +GripPoint = NodePath("GripPoint") +AnimationPlayer = NodePath("AnimationPlayer") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_cbiyh") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +modulate = Color(1.9, 1.9, 1.9, 1) +material = SubResource("ShaderMaterial_o36tv") +sprite_frames = ExtResource("2_s0xbw") + +[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] +position = Vector2(-2, -3) + +[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] +position = Vector2(7, -1.5) + +[node name="GripPoint" type="Marker2D" parent="."] +position = Vector2(-5, 0) + +[node name="Collision" type="CollisionShape2D" parent="."] +position = Vector2(1, 0) +shape = SubResource("RectangleShape2D_evjpf") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_trkjd") +} diff --git a/DungeonShooting_Godot/resource/config/ActivityBase.json b/DungeonShooting_Godot/resource/config/ActivityBase.json index 427d31b..023890f 100644 --- a/DungeonShooting_Godot/resource/config/ActivityBase.json +++ b/DungeonShooting_Godot/resource/config/ActivityBase.json @@ -90,12 +90,22 @@ "ShowInMapEditor": true }, { + "Id": "weapon0008", + "Type": 5, + "Name": "\u6FC0\u5149\u624B\u67AA", + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0008.tscn", + "Icon": "res://resource/sprite/weapon/weapon0008/Weapon0008.png", + "ShowInMapEditor": true + }, + { "Id": "bullet0001", "Type": 6, "Name": "", "Intro": "", "Details": "", - "Prefab": "res://prefab/ammo/Bullet0001.tscn", + "Prefab": "res://prefab/bullet/Bullet0001.tscn", "Icon": "", "ShowInMapEditor": false }, @@ -105,7 +115,7 @@ "Name": "", "Intro": "", "Details": "", - "Prefab": "res://prefab/ammo/Bullet0002.tscn", + "Prefab": "res://prefab/bullet/Bullet0002.tscn", "Icon": "", "ShowInMapEditor": false }, @@ -115,7 +125,7 @@ "Name": "", "Intro": "", "Details": "", - "Prefab": "res://prefab/ammo/Bullet0003.tscn", + "Prefab": "res://prefab/bullet/Bullet0003.tscn", "Icon": "", "ShowInMapEditor": false }, diff --git a/DungeonShooting_Godot/resource/config/AmmoBase.json b/DungeonShooting_Godot/resource/config/AmmoBase.json deleted file mode 100644 index 0637a08..0000000 --- a/DungeonShooting_Godot/resource/config/AmmoBase.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/config/BulletBase.json b/DungeonShooting_Godot/resource/config/BulletBase.json new file mode 100644 index 0000000..ce52c7f --- /dev/null +++ b/DungeonShooting_Godot/resource/config/BulletBase.json @@ -0,0 +1,26 @@ +[ + { + "Id": "0001", + "Name": "\u5B50\u5F391", + "Type": 1, + "Prefab": "bullet0001" + }, + { + "Id": "0002", + "Name": "\u5B50\u5F392", + "Type": 1, + "Prefab": "bullet0002" + }, + { + "Id": "0003", + "Name": "\u5B50\u5F393", + "Type": 1, + "Prefab": "bullet0003" + }, + { + "Id": "1001", + "Name": "\u6FC0\u51491", + "Type": 2, + "Prefab": "res://prefab/bullet/laser/Laser0001.tscn" + } +] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/config/WeaponBase.json b/DungeonShooting_Godot/resource/config/WeaponBase.json index 11a4daf..554c71d 100644 --- a/DungeonShooting_Godot/resource/config/WeaponBase.json +++ b/DungeonShooting_Godot/resource/config/WeaponBase.json @@ -1,7 +1,7 @@ [ { "Id": "0001", - "WeaponId": "weapon0001", + "ActivityId": "weapon0001", "Remark": "\u6B65\u67AA", "Weight": 40, "WeightType": 2, @@ -46,7 +46,8 @@ "UpliftAngle": 10, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 4 ], @@ -92,7 +93,7 @@ }, { "Id": "0002", - "WeaponId": "", + "ActivityId": "", "Remark": "\u6B65\u67AA", "Weight": 40, "WeightType": 2, @@ -137,7 +138,8 @@ "UpliftAngle": 10, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 4 ], @@ -183,7 +185,7 @@ }, { "Id": "0003", - "WeaponId": "weapon0002", + "ActivityId": "weapon0002", "Remark": "\u9730\u5F39\u67AA", "Weight": 40, "WeightType": 2, @@ -228,7 +230,8 @@ "UpliftAngle": 15, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0002", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0002", "HarmRange": [ 4 ], @@ -275,7 +278,7 @@ }, { "Id": "0004", - "WeaponId": "", + "ActivityId": "", "Remark": "\u9730\u5F39\u67AA", "Weight": 40, "WeightType": 2, @@ -320,7 +323,8 @@ "UpliftAngle": 15, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0002", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0002", "HarmRange": [ 4 ], @@ -367,7 +371,7 @@ }, { "Id": "0005", - "WeaponId": "weapon0003", + "ActivityId": "weapon0003", "Remark": "\u624B\u67AA", "Weight": 20, "WeightType": 1, @@ -412,7 +416,8 @@ "UpliftAngle": 20, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 4 ], @@ -458,7 +463,7 @@ }, { "Id": "0006", - "WeaponId": "", + "ActivityId": "", "Remark": "\u624B\u67AA", "Weight": 20, "WeightType": 1, @@ -503,7 +508,8 @@ "UpliftAngle": 20, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 4 ], @@ -549,7 +555,7 @@ }, { "Id": "0007", - "WeaponId": "weapon0004", + "ActivityId": "weapon0004", "Remark": "\u5200", "Weight": 40, "WeightType": 2, @@ -593,7 +599,8 @@ "UpliftAngle": -95, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 25 ], @@ -637,7 +644,7 @@ }, { "Id": "0008", - "WeaponId": "", + "ActivityId": "", "Remark": "\u5200", "Weight": 40, "WeightType": 2, @@ -681,7 +688,8 @@ "UpliftAngle": -95, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 25 ], @@ -725,7 +733,7 @@ }, { "Id": "0009", - "WeaponId": "weapon0005", + "ActivityId": "weapon0005", "Remark": "\u72D9\u51FB\u67AA", "Weight": 50, "WeightType": 2, @@ -770,7 +778,8 @@ "UpliftAngle": 15, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 30 ], @@ -816,7 +825,7 @@ }, { "Id": "0010", - "WeaponId": "", + "ActivityId": "", "Remark": "\u72D9\u51FB\u67AA", "Weight": 50, "WeightType": 2, @@ -861,7 +870,8 @@ "UpliftAngle": 15, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0001", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0001", "HarmRange": [ 30 ], @@ -907,7 +917,7 @@ }, { "Id": "0011", - "WeaponId": "weapon0006", + "ActivityId": "weapon0006", "Remark": "\u51B2\u950B\u67AA", "Weight": 30, "WeightType": 2, @@ -952,7 +962,8 @@ "UpliftAngle": 5, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0002", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0002", "HarmRange": [ 3 ], @@ -998,7 +1009,7 @@ }, { "Id": "0012", - "WeaponId": "", + "ActivityId": "", "Remark": "\u51B2\u950B\u67AA", "Weight": 30, "WeightType": 2, @@ -1043,7 +1054,8 @@ "UpliftAngle": 5, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0002", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0002", "HarmRange": [ 3 ], @@ -1089,7 +1101,7 @@ }, { "Id": "0013", - "WeaponId": "weapon0007", + "ActivityId": "weapon0007", "Remark": "\u6C64\u59C6\u900A\u51B2\u950B\u67AA", "Weight": 40, "WeightType": 2, @@ -1134,7 +1146,8 @@ "UpliftAngle": 5, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0003", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0003", "HarmRange": [ 3 ], @@ -1180,7 +1193,7 @@ }, { "Id": "0014", - "WeaponId": "", + "ActivityId": "", "Remark": "\u6C64\u59C6\u900A\u51B2\u950B\u67AA", "Weight": 40, "WeightType": 2, @@ -1225,7 +1238,8 @@ "UpliftAngle": 5, "DefaultAngle": 0, "UpliftAngleRestore": 1, - "BulletId": "bullet0003", + "FireEffect": "res://prefab/effect/weapon/ShotFire.tscn", + "BulletId": "0003", "HarmRange": [ 3 ], @@ -1268,5 +1282,97 @@ "__OtherSoundMap": null, "__AiUseAttribute": "", "__AiAttackAttr": "0006" + }, + { + "Id": "0015", + "ActivityId": "weapon0008", + "Remark": "\u6FC0\u5149\u624B\u67AA", + "Weight": 40, + "WeightType": 1, + "ContinuousShoot": false, + "AmmoCapacity": 10, + "MaxAmmoCapacity": 240, + "StandbyAmmoCapacity": 120, + "ReloadTime": 1.8, + "AloneReload": false, + "AloneReloadCount": 1, + "AloneReloadBeginIntervalTime": 0, + "AloneReloadFinishIntervalTime": 0, + "AloneReloadCanShoot": false, + "LooseShoot": false, + "MinChargeTime": 0, + "ManualBeLoaded": false, + "AutoManualBeLoaded": false, + "BeLoadedTime": 0, + "ContinuousCountRange": [ + 1 + ], + "TriggerInterval": 0, + "StartFiringSpeed": 300, + "FinalFiringSpeed": 300, + "FiringSpeedAddSpeed": 0, + "FiringSpeedBackSpeed": 0, + "FireBulletCountRange": [ + 1 + ], + "DelayedTime": 0, + "StartScatteringRange": 0, + "FinalScatteringRange": 20, + "ScatteringRangeAddValue": 4, + "ScatteringRangeBackSpeed": 40, + "ScatteringRangeBackDelayTime": 0.5, + "CameraShake": 2, + "BacklashRange": [ + 2, + 3 + ], + "BacklashRegressionSpeed": 25, + "UpliftAngle": 13, + "DefaultAngle": 0, + "UpliftAngleRestore": 1, + "FireEffect": "", + "BulletId": "1001", + "HarmRange": [ + 5 + ], + "RepelRnage": [ + 0 + ], + "BulletDeviationAngleRange": [ + 0 + ], + "BulletSpeedRange": [ + 300, + 330 + ], + "BulletDistanceRange": [ + 270, + 360 + ], + "ShellId": "", + "ThrowShellDelayTime": 0, + "ThrowCollisionSize": { + "X": 20, + "Y": 15 + }, + "CanMeleeAttack": true, + "MeleeAttackHarmRange": [ + 10 + ], + "MeleeAttackRepelRnage": [ + 100 + ], + "__ShootSound": "", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, + "__ReloadSound": "", + "ReloadSoundDelayTime": 0, + "__ReloadFinishSound": "", + "ReloadFinishSoundAdvanceTime": 0, + "__BeLoadedSound": "", + "BeLoadedSoundDelayTime": 0, + "__OtherSoundMap": null, + "__AiUseAttribute": "", + "__AiAttackAttr": "" } ] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/sprite/ammo/Laser0001.png b/DungeonShooting_Godot/resource/sprite/ammo/Laser0001.png deleted file mode 100644 index 9338ede..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/Laser0001.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/Laser0001.png.import b/DungeonShooting_Godot/resource/sprite/ammo/Laser0001.png.import deleted file mode 100644 index 25289ff..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/Laser0001.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://clfpbq1c1ilp1" -path="res://.godot/imported/Laser0001.png-e34334292fd2d2f0d3ac554eda0d8e22.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ammo/Laser0001.png" -dest_files=["res://.godot/imported/Laser0001.png-e34334292fd2d2f0d3ac554eda0d8e22.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/sprite/ammo/arrow.png b/DungeonShooting_Godot/resource/sprite/ammo/arrow.png deleted file mode 100644 index 4baebfb..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/arrow.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/arrow.png.import b/DungeonShooting_Godot/resource/sprite/ammo/arrow.png.import deleted file mode 100644 index 954d342..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/arrow.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cjb4rq1qavfm6" -path="res://.godot/imported/arrow.png-685bbc3ec5a4ba764677aa55699c56cb.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ammo/arrow.png" -dest_files=["res://.godot/imported/arrow.png-685bbc3ec5a4ba764677aa55699c56cb.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/sprite/ammo/bullet.aseprite b/DungeonShooting_Godot/resource/sprite/ammo/bullet.aseprite deleted file mode 100644 index 19447ed..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet.aseprite +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/bullet0001.png b/DungeonShooting_Godot/resource/sprite/ammo/bullet0001.png deleted file mode 100644 index 5b488de..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet0001.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/bullet0001.png.import b/DungeonShooting_Godot/resource/sprite/ammo/bullet0001.png.import deleted file mode 100644 index dc942c8..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet0001.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bu0b11hiuecxy" -path="res://.godot/imported/bullet0001.png-ca6896eff6569857ffd76487dba49e92.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ammo/bullet0001.png" -dest_files=["res://.godot/imported/bullet0001.png-ca6896eff6569857ffd76487dba49e92.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/sprite/ammo/bullet0002.png b/DungeonShooting_Godot/resource/sprite/ammo/bullet0002.png deleted file mode 100644 index a76c266..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet0002.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/bullet0002.png.import b/DungeonShooting_Godot/resource/sprite/ammo/bullet0002.png.import deleted file mode 100644 index c276f50..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet0002.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://ctsvj4y1t538u" -path="res://.godot/imported/bullet0002.png-3688e1e71f7a780e62df2f9fb3d93138.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ammo/bullet0002.png" -dest_files=["res://.godot/imported/bullet0002.png-3688e1e71f7a780e62df2f9fb3d93138.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/sprite/ammo/bullet0003.png b/DungeonShooting_Godot/resource/sprite/ammo/bullet0003.png deleted file mode 100644 index 14a69ff..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet0003.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/bullet0003.png.import b/DungeonShooting_Godot/resource/sprite/ammo/bullet0003.png.import deleted file mode 100644 index d914d5d..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet0003.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cs6pa7h8ffvy4" -path="res://.godot/imported/bullet0003.png-2bdc6735c7cbf9480f69071e13d5eafe.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ammo/bullet0003.png" -dest_files=["res://.godot/imported/bullet0003.png-2bdc6735c7cbf9480f69071e13d5eafe.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/sprite/ammo/bullet2.png b/DungeonShooting_Godot/resource/sprite/ammo/bullet2.png deleted file mode 100644 index 964f292..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet2.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ammo/bullet2.png.import b/DungeonShooting_Godot/resource/sprite/ammo/bullet2.png.import deleted file mode 100644 index c00565f..0000000 --- a/DungeonShooting_Godot/resource/sprite/ammo/bullet2.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://o3iq4myj72q0" -path="res://.godot/imported/bullet2.png-b5d9c0c003f30bd02d5b0eda057df7d6.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ammo/bullet2.png" -dest_files=["res://.godot/imported/bullet2.png-b5d9c0c003f30bd02d5b0eda057df7d6.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/sprite/bullet/Laser0001.png b/DungeonShooting_Godot/resource/sprite/bullet/Laser0001.png new file mode 100644 index 0000000..9338ede --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/Laser0001.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/Laser0001.png.import b/DungeonShooting_Godot/resource/sprite/bullet/Laser0001.png.import new file mode 100644 index 0000000..1e0f02f --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/Laser0001.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://clfpbq1c1ilp1" +path="res://.godot/imported/Laser0001.png-e2d7f2c04ceb942be096b5c64e04bad8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/bullet/Laser0001.png" +dest_files=["res://.godot/imported/Laser0001.png-e2d7f2c04ceb942be096b5c64e04bad8.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/sprite/bullet/arrow.png b/DungeonShooting_Godot/resource/sprite/bullet/arrow.png new file mode 100644 index 0000000..4baebfb --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/arrow.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/arrow.png.import b/DungeonShooting_Godot/resource/sprite/bullet/arrow.png.import new file mode 100644 index 0000000..18616dd --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/arrow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cjb4rq1qavfm6" +path="res://.godot/imported/arrow.png-5f9f0a3c4c243acf30e833eb04add206.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/bullet/arrow.png" +dest_files=["res://.godot/imported/arrow.png-5f9f0a3c4c243acf30e833eb04add206.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/sprite/bullet/bullet.aseprite b/DungeonShooting_Godot/resource/sprite/bullet/bullet.aseprite new file mode 100644 index 0000000..19447ed --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet.aseprite Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/bullet0001.png b/DungeonShooting_Godot/resource/sprite/bullet/bullet0001.png new file mode 100644 index 0000000..5b488de --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet0001.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/bullet0001.png.import b/DungeonShooting_Godot/resource/sprite/bullet/bullet0001.png.import new file mode 100644 index 0000000..fe2ba90 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet0001.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu0b11hiuecxy" +path="res://.godot/imported/bullet0001.png-09e29b083f51e2b282ac1fb1dd682734.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/bullet/bullet0001.png" +dest_files=["res://.godot/imported/bullet0001.png-09e29b083f51e2b282ac1fb1dd682734.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/sprite/bullet/bullet0002.png b/DungeonShooting_Godot/resource/sprite/bullet/bullet0002.png new file mode 100644 index 0000000..a76c266 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet0002.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/bullet0002.png.import b/DungeonShooting_Godot/resource/sprite/bullet/bullet0002.png.import new file mode 100644 index 0000000..90b0c71 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet0002.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ctsvj4y1t538u" +path="res://.godot/imported/bullet0002.png-5a53e3706ec2ef023e52e256612c2c94.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/bullet/bullet0002.png" +dest_files=["res://.godot/imported/bullet0002.png-5a53e3706ec2ef023e52e256612c2c94.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/sprite/bullet/bullet0003.png b/DungeonShooting_Godot/resource/sprite/bullet/bullet0003.png new file mode 100644 index 0000000..14a69ff --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet0003.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/bullet0003.png.import b/DungeonShooting_Godot/resource/sprite/bullet/bullet0003.png.import new file mode 100644 index 0000000..808d9f3 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet0003.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cs6pa7h8ffvy4" +path="res://.godot/imported/bullet0003.png-968c6a657388df80893fe68898e87dae.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/bullet/bullet0003.png" +dest_files=["res://.godot/imported/bullet0003.png-968c6a657388df80893fe68898e87dae.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/sprite/bullet/bullet2.png b/DungeonShooting_Godot/resource/sprite/bullet/bullet2.png new file mode 100644 index 0000000..964f292 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet2.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/bullet/bullet2.png.import b/DungeonShooting_Godot/resource/sprite/bullet/bullet2.png.import new file mode 100644 index 0000000..79038a8 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/bullet/bullet2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://o3iq4myj72q0" +path="res://.godot/imported/bullet2.png-6ca9527061677971732c8192cb1aa209.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/bullet/bullet2.png" +dest_files=["res://.godot/imported/bullet2.png-6ca9527061677971732c8192cb1aa209.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/sprite/weapon/weapon0008/Weapon0008.png b/DungeonShooting_Godot/resource/sprite/weapon/weapon0008/Weapon0008.png new file mode 100644 index 0000000..47a67d9 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/weapon/weapon0008/Weapon0008.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/weapon/weapon0008/Weapon0008.png.import b/DungeonShooting_Godot/resource/sprite/weapon/weapon0008/Weapon0008.png.import new file mode 100644 index 0000000..ca03629 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/weapon/weapon0008/Weapon0008.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cb0n1btxc6wl6" +path="res://.godot/imported/Weapon0008.png-1420c47ea7cc621ba17c45723577d760.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/weapon/weapon0008/Weapon0008.png" +dest_files=["res://.godot/imported/Weapon0008.png-1420c47ea7cc621ba17c45723577d760.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/bullet/Bullet0001.tres b/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0001.tres index 5b055e5..e12a271 100644 --- a/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0001.tres +++ b/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0001.tres @@ -1,6 +1,6 @@ [gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://baoxep7vami72"] -[ext_resource type="Texture2D" uid="uid://bu0b11hiuecxy" path="res://resource/sprite/ammo/bullet0001.png" id="1_ktu7r"] +[ext_resource type="Texture2D" uid="uid://bu0b11hiuecxy" path="res://resource/sprite/bullet/bullet0001.png" id="1_ktu7r"] diff --git a/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0002.tres b/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0002.tres index 52e62c5..f5cc160 100644 --- a/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0002.tres +++ b/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0002.tres @@ -1,6 +1,6 @@ [gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://bpeodjqiy3mil"] -[ext_resource type="Texture2D" uid="uid://ctsvj4y1t538u" path="res://resource/sprite/ammo/bullet0002.png" id="1_53f3g"] +[ext_resource type="Texture2D" uid="uid://ctsvj4y1t538u" path="res://resource/sprite/bullet/bullet0002.png" id="1_53f3g"] [resource] diff --git a/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0003.tres b/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0003.tres index 5fa6bd8..00f1cc6 100644 --- a/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0003.tres +++ b/DungeonShooting_Godot/resource/spriteFrames/bullet/Bullet0003.tres @@ -1,6 +1,6 @@ [gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://bcnhyin0aufl1"] -[ext_resource type="Texture2D" uid="uid://cs6pa7h8ffvy4" path="res://resource/sprite/ammo/bullet0003.png" id="1_sl01e"] +[ext_resource type="Texture2D" uid="uid://cs6pa7h8ffvy4" path="res://resource/sprite/bullet/bullet0003.png" id="1_sl01e"] [resource] diff --git a/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0008.tres b/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0008.tres new file mode 100644 index 0000000..4a30c7e --- /dev/null +++ b/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0008.tres @@ -0,0 +1,14 @@ +[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://b2wpy40adyjs6"] + +[ext_resource type="Texture2D" uid="uid://cb0n1btxc6wl6" path="res://resource/sprite/weapon/weapon0008/Weapon0008.png" id="1_bwp4b"] + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_bwp4b") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] diff --git a/DungeonShooting_Godot/src/config/ExcelConfig.cs b/DungeonShooting_Godot/src/config/ExcelConfig.cs index bd8077c..b0e7216 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig.cs @@ -26,13 +26,13 @@ public static Dictionary AiAttackAttr_Map { get; private set; } /// - /// AmmoBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// BulletBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// - public static List AmmoBase_List { get; private set; } + public static List BulletBase_List { get; private set; } /// - /// AmmoBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// BulletBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id /// - public static Dictionary AmmoBase_Map { get; private set; } + public static Dictionary BulletBase_Map { get; private set; } /// /// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 @@ -64,7 +64,7 @@ _InitActivityBaseConfig(); _InitAiAttackAttrConfig(); - _InitAmmoBaseConfig(); + _InitBulletBaseConfig(); _InitSoundConfig(); _InitWeaponBaseConfig(); @@ -106,22 +106,22 @@ throw new Exception("初始化表'AiAttackAttr'失败!"); } } - private static void _InitAmmoBaseConfig() + private static void _InitBulletBaseConfig() { try { - var text = _ReadConfigAsText("res://resource/config/AmmoBase.json"); - AmmoBase_List = JsonSerializer.Deserialize>(text); - AmmoBase_Map = new Dictionary(); - foreach (var item in AmmoBase_List) + var text = _ReadConfigAsText("res://resource/config/BulletBase.json"); + BulletBase_List = JsonSerializer.Deserialize>(text); + BulletBase_Map = new Dictionary(); + foreach (var item in BulletBase_List) { - AmmoBase_Map.Add(item.Id, item); + BulletBase_Map.Add(item.Id, item); } } catch (Exception e) { GD.PrintErr(e.ToString()); - throw new Exception("初始化表'AmmoBase'失败!"); + throw new Exception("初始化表'BulletBase'失败!"); } } private static void _InitSoundConfig() diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_AmmoBase.cs b/DungeonShooting_Godot/src/config/ExcelConfig_AmmoBase.cs deleted file mode 100644 index ce2fb9d..0000000 --- a/DungeonShooting_Godot/src/config/ExcelConfig_AmmoBase.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Text.Json.Serialization; -using System.Collections.Generic; - -namespace Config; - -public static partial class ExcelConfig -{ - public class AmmoBase - { - /// - /// 武器属性id - /// - [JsonInclude] - public string Id; - - /// - /// 返回浅拷贝出的新对象 - /// - public AmmoBase Clone() - { - var inst = new AmmoBase(); - inst.Id = Id; - return inst; - } - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_BulletBase.cs b/DungeonShooting_Godot/src/config/ExcelConfig_BulletBase.cs new file mode 100644 index 0000000..6d04907 --- /dev/null +++ b/DungeonShooting_Godot/src/config/ExcelConfig_BulletBase.cs @@ -0,0 +1,51 @@ +using System.Text.Json.Serialization; +using System.Collections.Generic; + +namespace Config; + +public static partial class ExcelConfig +{ + public class BulletBase + { + /// + /// 子弹id + /// + [JsonInclude] + public string Id; + + /// + /// 子弹名称 + /// + [JsonInclude] + public string Name; + + /// + /// 子弹类型:
+ /// 实体子弹:1
+ /// 激光子弹:2 + ///
+ [JsonInclude] + public int Type; + + /// + /// 绑定子弹预制体,根据Type填不同的参数
+ /// Type为1,填ActivityBase表Id
+ /// Type为2,填场景路径 + ///
+ [JsonInclude] + public string Prefab; + + /// + /// 返回浅拷贝出的新对象 + /// + public BulletBase Clone() + { + var inst = new BulletBase(); + inst.Id = Id; + inst.Name = Name; + inst.Type = Type; + inst.Prefab = Prefab; + return inst; + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_WeaponBase.cs b/DungeonShooting_Godot/src/config/ExcelConfig_WeaponBase.cs index bb7ce94..9f18e3c 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_WeaponBase.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_WeaponBase.cs @@ -14,10 +14,10 @@ public string Id; /// - /// 属性绑定武器的Id,如果是Ai使用的数据, 则填空字符串串 + /// 属性绑定武器的Id,这个id时ActivityBase表Id,如果是Ai使用的数据, 则填空字符串串 /// [JsonInclude] - public string WeaponId; + public string ActivityId; /// /// 备注 @@ -248,7 +248,13 @@ public float UpliftAngleRestore; /// - /// 默认射出的子弹id + /// 开火特效 + /// + [JsonInclude] + public string FireEffect; + + /// + /// 默认射出的子弹,BulletBase表Id /// [JsonInclude] public string BulletId; @@ -404,7 +410,7 @@ { var inst = new WeaponBase(); inst.Id = Id; - inst.WeaponId = WeaponId; + inst.ActivityId = ActivityId; inst.Remark = Remark; inst.Weight = Weight; inst.WeightType = WeightType; @@ -442,6 +448,7 @@ inst.UpliftAngle = UpliftAngle; inst.DefaultAngle = DefaultAngle; inst.UpliftAngleRestore = UpliftAngleRestore; + inst.FireEffect = FireEffect; inst.BulletId = BulletId; inst.HarmRange = HarmRange; inst.RepelRnage = RepelRnage; diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs index ac2a591..691c138 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs @@ -54,6 +54,11 @@ /// public const string Id_weapon0007 = "weapon0007"; /// + /// 名称: 激光手枪
+ /// 简介: + ///
+ public const string Id_weapon0008 = "weapon0008"; + /// /// 名称:
/// 简介: ///
@@ -180,9 +185,10 @@ _activityRegisterMap.Add("weapon0005", new RegisterActivityData("res://prefab/weapon/Weapon0005.tscn", ExcelConfig.ActivityBase_Map["weapon0005"])); _activityRegisterMap.Add("weapon0006", new RegisterActivityData("res://prefab/weapon/Weapon0006.tscn", ExcelConfig.ActivityBase_Map["weapon0006"])); _activityRegisterMap.Add("weapon0007", new RegisterActivityData("res://prefab/weapon/Weapon0007.tscn", ExcelConfig.ActivityBase_Map["weapon0007"])); - _activityRegisterMap.Add("bullet0001", new RegisterActivityData("res://prefab/ammo/Bullet0001.tscn", ExcelConfig.ActivityBase_Map["bullet0001"])); - _activityRegisterMap.Add("bullet0002", new RegisterActivityData("res://prefab/ammo/Bullet0002.tscn", ExcelConfig.ActivityBase_Map["bullet0002"])); - _activityRegisterMap.Add("bullet0003", new RegisterActivityData("res://prefab/ammo/Bullet0003.tscn", ExcelConfig.ActivityBase_Map["bullet0003"])); + _activityRegisterMap.Add("weapon0008", new RegisterActivityData("res://prefab/weapon/Weapon0008.tscn", ExcelConfig.ActivityBase_Map["weapon0008"])); + _activityRegisterMap.Add("bullet0001", new RegisterActivityData("res://prefab/bullet/Bullet0001.tscn", ExcelConfig.ActivityBase_Map["bullet0001"])); + _activityRegisterMap.Add("bullet0002", new RegisterActivityData("res://prefab/bullet/Bullet0002.tscn", ExcelConfig.ActivityBase_Map["bullet0002"])); + _activityRegisterMap.Add("bullet0003", new RegisterActivityData("res://prefab/bullet/Bullet0003.tscn", ExcelConfig.ActivityBase_Map["bullet0003"])); _activityRegisterMap.Add("shell0001", new RegisterActivityData("res://prefab/shell/Shell0001.tscn", ExcelConfig.ActivityBase_Map["shell0001"])); _activityRegisterMap.Add("shell0002", new RegisterActivityData("res://prefab/shell/Shell0002.tscn", ExcelConfig.ActivityBase_Map["shell0002"])); _activityRegisterMap.Add("shell0003", new RegisterActivityData("res://prefab/shell/Shell0003.tscn", ExcelConfig.ActivityBase_Map["shell0003"])); diff --git a/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs b/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs index d1d1b4f..f4ff446 100644 --- a/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs @@ -3,6 +3,7 @@ using System; using System.IO; using System.Text.Json; +using Config; using Godot; using Array = Godot.Collections.Array; @@ -36,7 +37,7 @@ //生成初始化 ActivityObject 代码 private static void GeneratorActivityObjectInit() { - var text = File.ReadAllText("resource/config/ActivityObject.json"); + var text = File.ReadAllText($"resource/config/{nameof(ExcelConfig.ActivityBase)}.json"); var array = JsonSerializer.Deserialize[]>(text); var code1 = ""; diff --git a/DungeonShooting_Godot/src/game/activity/ammo/Bullet.cs b/DungeonShooting_Godot/src/game/activity/ammo/Bullet.cs deleted file mode 100644 index 65278e5..0000000 --- a/DungeonShooting_Godot/src/game/activity/ammo/Bullet.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System.Collections; -using Godot; - -/// -/// 子弹类 -/// -[Tool] -public partial class Bullet : ActivityObject, IAmmo -{ - /// - /// 碰撞区域 - /// - [Export, ExportFillNode] - public Area2D CollisionArea { get; set; } - - /// - /// 攻击的层级 - /// - public uint AttackLayer - { - get => CollisionArea.CollisionMask; - set => CollisionArea.CollisionMask = value; - } - - /// - /// 发射该子弹的武器 - /// - public Weapon Weapon { get; private set; } - - /// - /// 最小伤害 - /// - public int MinHarm { get; set; } = 4; - - /// - /// 最大伤害 - /// - public int MaxHarm { get; set; } = 4; - - /// - /// 发射该子弹的角色 - /// - public Role TriggerRole { get; private set; } - - // 最大飞行距离 - private float MaxDistance; - - // 子弹飞行速度 - private float FlySpeed; - - //当前子弹已经飞行的距离 - private float CurrFlyDistance = 0; - - public void Init(Weapon weapon, uint targetLayer) - { - TriggerRole = weapon.TriggerRole; - Weapon = weapon; - AttackLayer = targetLayer; - } - - /// - /// 初始化子弹属性 - /// - /// 射出该子弹的武器 - /// 速度 - /// 最大飞行距离 - /// 位置 - /// 角度 - /// 攻击目标层级 - public void Init(Weapon weapon, float speed, float maxDistance, Vector2 position, float rotation, uint targetLayer) - { - Init(weapon, targetLayer); - CollisionArea.AreaEntered += OnArea2dEntered; - - if (TriggerRole == null || !TriggerRole.IsAi) //只有玩家使用该武器才能获得正常速度的子弹 - { - FlySpeed = speed; - } - else - { - FlySpeed = speed * weapon.AiUseAttribute.AiAttackAttr.BulletSpeedScale; - } - MaxDistance = maxDistance; - Position = position; - Rotation = rotation; - ShadowOffset = new Vector2(0, 5); - BasisVelocity = new Vector2(FlySpeed, 0).Rotated(Rotation); - - //如果子弹会对玩家造成伤害, 则显示红色描边 - if (Player.Current.CollisionWithMask(targetLayer)) - { - ShowOutline = true; - OutlineColor = new Color(1, 0, 0); - StartCoroutine(BorderFlashes()); - } - } - - private IEnumerator BorderFlashes() - { - while (true) - { - ShowOutline = !ShowOutline; - yield return new WaitForSeconds(0.12f); - } - } - - /// - /// 播放子弹消失的特效 - /// - public virtual void PlayDisappearEffect() - { - var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_BulletDisappear_tscn); - var node = packedScene.Instantiate(); - node.GlobalPosition = GlobalPosition; - node.AddToActivityRoot(RoomLayerEnum.YSortLayer); - } - - protected override void PhysicsProcessOver(float delta) - { - //移动 - var lastSlideCollision = GetLastSlideCollision(); - //撞到墙 - if (lastSlideCollision != null) - { - //创建粒子特效 - var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_BulletSmoke_tscn); - var smoke = packedScene.Instantiate(); - smoke.GlobalPosition = lastSlideCollision.GetPosition(); - smoke.GlobalRotation = lastSlideCollision.GetNormal().Angle(); - smoke.AddToActivityRoot(RoomLayerEnum.YSortLayer); - - Destroy(); - return; - } - //距离太大, 自动销毁 - CurrFlyDistance += FlySpeed * delta; - if (CurrFlyDistance >= MaxDistance) - { - PlayDisappearEffect(); - Destroy(); - } - } - - private void OnArea2dEntered(Area2D other) - { - var role = other.AsActivityObject(); - if (role != null) - { - var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_BulletDisappear_tscn); - var node = packedScene.Instantiate(); - node.GlobalPosition = GlobalPosition; - node.AddToActivityRoot(RoomLayerEnum.YSortLayer); - - //计算子弹造成的伤害 - var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm); - if (TriggerRole != null) - { - damage = TriggerRole.RoleState.CallCalcDamageEvent(damage); - } - - //击退 - if (role is not Player) //目标不是玩家才会触发击退 - { - var attr = Weapon.GetUseAttribute(TriggerRole); - var repel = Utils.Random.RandomConfigRange(attr.RepelRnage); - role.MoveController.AddForce(Vector2.FromAngle(BasisVelocity.Angle()) * repel, repel * 2); - } - - //造成伤害 - role.CallDeferred(nameof(Role.Hurt), damage, Rotation); - Destroy(); - } - } - - protected override void OnDestroy() - { - StopAllCoroutine(); - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/ammo/BulletAttribute.cs b/DungeonShooting_Godot/src/game/activity/ammo/BulletAttribute.cs deleted file mode 100644 index aa30af1..0000000 --- a/DungeonShooting_Godot/src/game/activity/ammo/BulletAttribute.cs +++ /dev/null @@ -1,5 +0,0 @@ - -public class BulletAttribute -{ - -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/ammo/IAmmo.cs b/DungeonShooting_Godot/src/game/activity/ammo/IAmmo.cs deleted file mode 100644 index 074b6e3..0000000 --- a/DungeonShooting_Godot/src/game/activity/ammo/IAmmo.cs +++ /dev/null @@ -1,25 +0,0 @@ - -public interface IAmmo : IDestroy, ICoroutine -{ - /// - /// 攻击的层级 - /// - uint AttackLayer { get; set; } - - /// - /// 发射该子弹的武器 - /// - Weapon Weapon { get; } - - /// - /// 发射该子弹的角色 - /// - Role TriggerRole { get; } - - /// - /// 初始化子弹数据 - /// - /// 发射该子弹的武器 - /// 攻击的层级 - void Init(Weapon weapon, uint attackLayer); -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/ammo/laser/Laser.cs b/DungeonShooting_Godot/src/game/activity/ammo/laser/Laser.cs deleted file mode 100644 index 84e289d..0000000 --- a/DungeonShooting_Godot/src/game/activity/ammo/laser/Laser.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Godot; - -/// -/// 激光子弹 -/// -public partial class Laser : Area2D, IAmmo -{ - public CollisionShape2D Collision { get; private set; } - public Sprite2D LineSprite { get; private set; } - public RectangleShape2D Shape { get; private set; } - - public uint AttackLayer - { - get => CollisionMask; - set => CollisionMask = value; - } - public Weapon Weapon { get; private set; } - public Role TriggerRole { get; private set; } - - public bool IsDestroyed { get; private set; } - //开启的协程 - private List _coroutineList; - private float _pixelScale; - private float _speed = 1200; - - public override void _Ready() - { - Collision = GetNodeOrNull("CollisionShape2D"); - Collision.Disabled = true; - Shape = Collision.Shape as RectangleShape2D; - LineSprite = GetNodeOrNull("LineSprite"); - _pixelScale = 1f / LineSprite.Texture.GetHeight(); - - AreaEntered += OnArea2dEntered; - } - - public void Init(Weapon weapon, uint targetLayer) - { - TriggerRole = weapon.TriggerRole; - Weapon = weapon; - AttackLayer = targetLayer; - } - - public void Init(Weapon weapon, uint targetLayer, Vector2 position, float rotation, float width, float distance) - { - Init(weapon, targetLayer); - Position = position; - Rotation = rotation; - - //计算射线最大距离, 也就是撞到墙壁的距离 - var targetPosition = position + Vector2.FromAngle(rotation) * distance; - var parameters = PhysicsRayQueryParameters2D.Create(position, targetPosition, PhysicsLayer.Wall); - var result = GetWorld2D().DirectSpaceState.IntersectRay(parameters); - if (result != null) - { - var point = (Vector2)result["position"]; - distance = position.DistanceTo(point); - } - - - Collision.SetDeferred(CollisionShape2D.PropertyName.Disabled, false); - Collision.Position = Vector2.Zero; - Shape.Size = Vector2.Zero;; - LineSprite.Scale = new Vector2(0, width * _pixelScale); - - //激光飞行时间 - var time = distance / _speed; - - var tween = CreateTween(); - tween.SetParallel(); - tween.TweenProperty(LineSprite, "scale", new Vector2(distance, width * _pixelScale), time); - tween.TweenProperty(Collision, "position", new Vector2(distance * 0.5f, 0), time); - tween.TweenProperty(Shape, "size", new Vector2(distance, width), time); - tween.Chain(); - tween.TweenInterval(0.2f); - tween.Chain(); - tween.TweenCallback(Callable.From(() => - { - Collision.SetDeferred(CollisionShape2D.PropertyName.Disabled, false); - })); - tween.Chain(); - tween.TweenProperty(LineSprite, "scale", new Vector2(distance, 0), 0.3f); - tween.Chain(); - tween.TweenCallback(Callable.From(() => - { - Destroy(); - })); - tween.Play(); - } - - public override void _Process(double delta) - { - ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, (float)delta); - } - - public void Destroy() - { - if (IsDestroyed) - { - return; - } - - QueueFree(); - } - - private void OnArea2dEntered(Area2D other) - { - var role = other.AsActivityObject(); - if (role != null) - { - //造成伤害 - role.CallDeferred(nameof(Role.Hurt), 4, Rotation); - } - } - - public long StartCoroutine(IEnumerator able) - { - return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); - } - - public void StopCoroutine(long coroutineId) - { - ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); - } - - public bool IsCoroutineOver(long coroutineId) - { - return ProxyCoroutineHandler.ProxyIsCoroutineOver(ref _coroutineList, coroutineId); - } - - public void StopAllCoroutine() - { - ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); - } -} diff --git a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs new file mode 100644 index 0000000..bc09905 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs @@ -0,0 +1,183 @@ +using System.Collections; +using Godot; + +/// +/// 子弹类 +/// +[Tool] +public partial class Bullet : ActivityObject, IBullet +{ + /// + /// 碰撞区域 + /// + [Export, ExportFillNode] + public Area2D CollisionArea { get; set; } + + /// + /// 攻击的层级 + /// + public uint AttackLayer + { + get => CollisionArea.CollisionMask; + set => CollisionArea.CollisionMask = value; + } + + /// + /// 发射该子弹的武器 + /// + public Weapon Weapon { get; private set; } + + /// + /// 最小伤害 + /// + public int MinHarm { get; set; } = 4; + + /// + /// 最大伤害 + /// + public int MaxHarm { get; set; } = 4; + + /// + /// 发射该子弹的角色 + /// + public Role TriggerRole { get; private set; } + + // 最大飞行距离 + private float MaxDistance; + + // 子弹飞行速度 + private float FlySpeed; + + //当前子弹已经飞行的距离 + private float CurrFlyDistance = 0; + + public void Init(Weapon weapon, uint targetLayer) + { + TriggerRole = weapon.TriggerRole; + Weapon = weapon; + AttackLayer = targetLayer; + } + + /// + /// 初始化子弹属性 + /// + /// 射出该子弹的武器 + /// 速度 + /// 最大飞行距离 + /// 位置 + /// 角度 + /// 攻击目标层级 + public void Init(Weapon weapon, float speed, float maxDistance, Vector2 position, float rotation, uint targetLayer) + { + Init(weapon, targetLayer); + CollisionArea.AreaEntered += OnArea2dEntered; + + if (TriggerRole == null || !TriggerRole.IsAi) //只有玩家使用该武器才能获得正常速度的子弹 + { + FlySpeed = speed; + } + else + { + FlySpeed = speed * weapon.AiUseAttribute.AiAttackAttr.BulletSpeedScale; + } + MaxDistance = maxDistance; + Position = position; + Rotation = rotation; + ShadowOffset = new Vector2(0, 5); + BasisVelocity = new Vector2(FlySpeed, 0).Rotated(Rotation); + + //如果子弹会对玩家造成伤害, 则显示红色描边 + if (Player.Current.CollisionWithMask(targetLayer)) + { + ShowOutline = true; + OutlineColor = new Color(1, 0, 0); + StartCoroutine(BorderFlashes()); + } + PutDown(RoomLayerEnum.YSortLayer); + } + + private IEnumerator BorderFlashes() + { + while (true) + { + ShowOutline = !ShowOutline; + yield return new WaitForSeconds(0.12f); + } + } + + /// + /// 播放子弹消失的特效 + /// + public virtual void PlayDisappearEffect() + { + var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_BulletDisappear_tscn); + var node = packedScene.Instantiate(); + node.GlobalPosition = GlobalPosition; + node.AddToActivityRoot(RoomLayerEnum.YSortLayer); + } + + protected override void PhysicsProcessOver(float delta) + { + //移动 + var lastSlideCollision = GetLastSlideCollision(); + //撞到墙 + if (lastSlideCollision != null) + { + //创建粒子特效 + var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_BulletSmoke_tscn); + var smoke = packedScene.Instantiate(); + smoke.GlobalPosition = lastSlideCollision.GetPosition(); + smoke.GlobalRotation = lastSlideCollision.GetNormal().Angle(); + smoke.AddToActivityRoot(RoomLayerEnum.YSortLayer); + + Destroy(); + return; + } + //距离太大, 自动销毁 + CurrFlyDistance += FlySpeed * delta; + if (CurrFlyDistance >= MaxDistance) + { + PlayDisappearEffect(); + Destroy(); + } + } + + private void OnArea2dEntered(Area2D other) + { + var role = other.AsActivityObject(); + if (role != null) + { + var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_BulletDisappear_tscn); + var node = packedScene.Instantiate(); + node.GlobalPosition = GlobalPosition; + node.AddToActivityRoot(RoomLayerEnum.YSortLayer); + + //计算子弹造成的伤害 + var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm); + if (TriggerRole != null) + { + damage = TriggerRole.RoleState.CallCalcDamageEvent(damage); + } + + //击退 + if (role is not Player) //目标不是玩家才会触发击退 + { + var attr = Weapon.GetUseAttribute(TriggerRole); + var repel = Utils.Random.RandomConfigRange(attr.RepelRnage); + if (repel != 0) + { + role.MoveController.AddForce(Vector2.FromAngle(BasisVelocity.Angle()) * repel, repel * 2); + } + } + + //造成伤害 + role.CallDeferred(nameof(Role.Hurt), damage, Rotation); + Destroy(); + } + } + + protected override void OnDestroy() + { + StopAllCoroutine(); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/bullet/BulletAttribute.cs b/DungeonShooting_Godot/src/game/activity/bullet/BulletAttribute.cs new file mode 100644 index 0000000..aa30af1 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/bullet/BulletAttribute.cs @@ -0,0 +1,5 @@ + +public class BulletAttribute +{ + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/bullet/IBullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/IBullet.cs new file mode 100644 index 0000000..d6c221a --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/bullet/IBullet.cs @@ -0,0 +1,35 @@ + +public interface IBullet : IDestroy, ICoroutine +{ + /// + /// 攻击的层级 + /// + uint AttackLayer { get; set; } + + /// + /// 发射该子弹的武器 + /// + Weapon Weapon { get; } + + /// + /// 发射该子弹的角色 + /// + Role TriggerRole { get; } + + /// + /// 最小伤害 + /// + int MinHarm { get; set; } + + /// + /// 最大伤害 + /// + int MaxHarm { get; set; } + + /// + /// 初始化子弹数据 + /// + /// 发射该子弹的武器 + /// 攻击的层级 + void Init(Weapon weapon, uint attackLayer); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs b/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs new file mode 100644 index 0000000..1be405a --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs @@ -0,0 +1,151 @@ +using System.Collections; +using System.Collections.Generic; +using Godot; + +/// +/// 激光子弹 +/// +public partial class Laser : Area2D, IBullet +{ + public CollisionShape2D Collision { get; private set; } + public Sprite2D LineSprite { get; private set; } + public RectangleShape2D Shape { get; private set; } + + public uint AttackLayer + { + get => CollisionMask; + set => CollisionMask = value; + } + public Weapon Weapon { get; private set; } + public Role TriggerRole { get; private set; } + + /// + /// 最小伤害 + /// + public int MinHarm { get; set; } = 4; + + /// + /// 最大伤害 + /// + public int MaxHarm { get; set; } = 4; + + public bool IsDestroyed { get; private set; } + //开启的协程 + private List _coroutineList; + private float _pixelScale; + private float _speed = 2000; + + public override void _Ready() + { + Collision = GetNodeOrNull("CollisionShape2D"); + Collision.Disabled = true; + Shape = Collision.Shape as RectangleShape2D; + LineSprite = GetNodeOrNull("LineSprite"); + _pixelScale = 1f / LineSprite.Texture.GetHeight(); + + AreaEntered += OnArea2dEntered; + } + + public void Init(Weapon weapon, uint targetLayer) + { + TriggerRole = weapon.TriggerRole; + Weapon = weapon; + AttackLayer = targetLayer; + } + + public void Init(Weapon weapon, uint targetLayer, Vector2 position, float rotation, float width, float distance) + { + Init(weapon, targetLayer); + Position = position; + Rotation = rotation; + + //计算射线最大距离, 也就是撞到墙壁的距离 + var targetPosition = position + Vector2.FromAngle(rotation) * distance; + var parameters = PhysicsRayQueryParameters2D.Create(position, targetPosition, PhysicsLayer.Wall); + var result = GetWorld2D().DirectSpaceState.IntersectRay(parameters); + if (result != null && result.TryGetValue("position", out var point)) + { + distance = position.DistanceTo((Vector2)point); + } + + Collision.SetDeferred(CollisionShape2D.PropertyName.Disabled, false); + Collision.Position = Vector2.Zero; + Shape.Size = Vector2.Zero;; + LineSprite.Scale = new Vector2(0, width * _pixelScale); + + //激光飞行时间 + var time = distance / _speed; + + var tween = CreateTween(); + tween.SetParallel(); + tween.TweenProperty(LineSprite, "scale", new Vector2(distance, width * _pixelScale), time); + tween.TweenProperty(Collision, "position", new Vector2(distance * 0.5f, 0), time); + tween.TweenProperty(Shape, "size", new Vector2(distance, width), time); + tween.Chain(); + tween.TweenInterval(0.2f); + tween.Chain(); + tween.TweenCallback(Callable.From(() => + { + Collision.SetDeferred(CollisionShape2D.PropertyName.Disabled, false); + })); + tween.Chain(); + tween.TweenProperty(LineSprite, "scale", new Vector2(distance, 0), 0.3f); + tween.Chain(); + tween.TweenCallback(Callable.From(() => + { + Destroy(); + })); + tween.Play(); + } + + public override void _Process(double delta) + { + ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, (float)delta); + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + QueueFree(); + } + + private void OnArea2dEntered(Area2D other) + { + var role = other.AsActivityObject(); + if (role != null) + { + //计算子弹造成的伤害 + var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm); + if (TriggerRole != null) + { + damage = TriggerRole.RoleState.CallCalcDamageEvent(damage); + } + //造成伤害 + role.CallDeferred(nameof(Role.Hurt), damage, Rotation); + } + } + + public long StartCoroutine(IEnumerator able) + { + return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); + } + + public void StopCoroutine(long coroutineId) + { + ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); + } + + public bool IsCoroutineOver(long coroutineId) + { + return ProxyCoroutineHandler.ProxyIsCoroutineOver(ref _coroutineList, coroutineId); + } + + public void StopAllCoroutine() + { + ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); + } +} diff --git a/DungeonShooting_Godot/src/game/activity/role/player/Player.cs b/DungeonShooting_Godot/src/game/activity/role/player/Player.cs index c0016b0..e05ad87 100644 --- a/DungeonShooting_Godot/src/game/activity/role/player/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/player/Player.cs @@ -56,6 +56,11 @@ // CollisionMask = 0; //GameCamera.Main.Zoom = new Vector2(0.2f, 0.2f); //GameCamera.Main.Zoom = new Vector2(0.5f, 0.5f); + this.CallDelay(0.5f, () => + { + var weapon = Create(Ids.Id_weapon0008); + PickUpWeapon(weapon); + }); //注册状态机 StateController.Register(new PlayerIdleState()); diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index f4bfd88..ae18681 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -252,9 +252,9 @@ _init = true; foreach (var weaponAttr in ExcelConfig.WeaponBase_List) { - if (!string.IsNullOrEmpty(weaponAttr.WeaponId)) + if (!string.IsNullOrEmpty(weaponAttr.ActivityId)) { - if (!_weaponAttributeMap.TryAdd(weaponAttr.WeaponId, weaponAttr)) + if (!_weaponAttributeMap.TryAdd(weaponAttr.ActivityId, weaponAttr)) { Debug.LogError("发现重复注册的武器属性: " + weaponAttr.Id); } @@ -1914,9 +1914,27 @@ } /// + /// 发射子弹 + /// + protected IBullet ShootBullet(float fireRotation, string bulletId) + { + var baseData = ExcelConfig.BulletBase_Map[bulletId]; + if (baseData.Type == 1) //实体子弹 + { + return ShootSolidBullet(fireRotation, baseData.Prefab); + } + else if (baseData.Type == 2) //激光子弹 + { + return ShootLaser(fireRotation, baseData.Prefab); + } + + return null; + } + + /// /// 发射子弹的默认实现方式, bulletId为子弹id /// - protected Bullet ShootBullet(float fireRotation, string bulletId) + private Bullet ShootSolidBullet(float fireRotation, string solidBulletId) { var speed = Utils.Random.RandomConfigRange(Attribute.BulletSpeedRange); var distance = Utils.Random.RandomConfigRange(Attribute.BulletDistanceRange); @@ -1930,7 +1948,7 @@ var attackLayer = GetAttackLayer(); //创建子弹 - var bullet = Create(bulletId); + var bullet = Create(solidBulletId); bullet.Init( this, speed, @@ -1941,13 +1959,15 @@ ); bullet.MinHarm = Utils.GetConfigRangeStart(Attribute.HarmRange); bullet.MaxHarm = Utils.GetConfigRangeEnd(Attribute.HarmRange); - bullet.PutDown(RoomLayerEnum.YSortLayer); return bullet; } - protected Laser ShootLaser(float fireRotation) + /// + /// 发射射线的默认实现方式 + /// + private Laser ShootLaser(float fireRotation, string prefab) { - var laser = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_ammo_laser_Laser0001_tscn); + var laser = ResourceManager.LoadAndInstantiate(prefab); laser.AddToActivityRoot(RoomLayerEnum.YSortLayer); var deviationAngle = Utils.Random.RandomConfigRange(Attribute.BulletDeviationAngleRange); @@ -1964,6 +1984,8 @@ 3, 600 ); + laser.MinHarm = Utils.GetConfigRangeStart(Attribute.HarmRange); + laser.MaxHarm = Utils.GetConfigRangeEnd(Attribute.HarmRange); return laser; } diff --git a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs index 968f1d4..cd51aba 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs @@ -15,19 +15,21 @@ } //创建开火特效 - var packedScene = ResourceManager.Load(ResourcePath.prefab_effect_weapon_ShotFire_tscn); - var sprite = packedScene.Instantiate(); - // sprite.GlobalPosition = FirePoint.GlobalPosition; - // sprite.GlobalRotation = FirePoint.GlobalRotation; - // sprite.AddToActivityRoot(RoomLayerEnum.YSortLayer); - sprite.Position = GetLocalFirePosition(); - AddChild(sprite); + if (!string.IsNullOrEmpty(Attribute.FireEffect)) + { + var packedScene = ResourceManager.Load(Attribute.FireEffect); + var sprite = packedScene.Instantiate(); + // sprite.GlobalPosition = FirePoint.GlobalPosition; + // sprite.GlobalRotation = FirePoint.GlobalRotation; + // sprite.AddToActivityRoot(RoomLayerEnum.YSortLayer); + sprite.Position = GetLocalFirePosition(); + AddChild(sprite); + } } protected override void OnShoot(float fireRotation) { ShootBullet(fireRotation, Attribute.BulletId); - //ShootLaser(fireRotation); } // //测试用, 敌人被消灭时触发手上武器开火 diff --git a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs index 462ebed..7b0950d 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs @@ -136,9 +136,12 @@ { var attr = Master.IsAi ? AiUseAttribute : PlayerUseAttribute; var repel = Utils.Random.RandomConfigRange(attr.RepelRnage); - var position = role.GlobalPosition - Master.MountPoint.GlobalPosition; - var v2 = position.Normalized() * repel; - role.MoveController.AddForce(v2, repel * 2); + if (repel != 0) + { + var position = role.GlobalPosition - Master.MountPoint.GlobalPosition; + var v2 = position.Normalized() * repel; + role.MoveController.AddForce(v2, repel * 2); + } } //造成伤害 diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs index 4665a2a..a25dbc5 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs @@ -218,7 +218,7 @@ numberBar.L_NumInput.Instance.MinValue = 0; numberBar2.L_NumInput.Instance.MinValue = 0; //武器配置数据 - var weapon = ExcelConfig.WeaponBase_List.Find(weapon => weapon.WeaponId == activityObject.Id); + var weapon = ExcelConfig.WeaponBase_List.Find(weapon => weapon.ActivityId == activityObject.Id); if (weapon != null) { numberBar.L_NumInput.Instance.MaxValue = weapon.AmmoCapacity; //弹夹上限 @@ -276,7 +276,7 @@ } if (markInfoItem.Attr.TryGetValue("Weapon", out var weaponId)) //武器 { - weaponBar.Instance.SelectWeapon(ExcelConfig.WeaponBase_List.Find(w => w.WeaponId == weaponId)); + weaponBar.Instance.SelectWeapon(ExcelConfig.WeaponBase_List.Find(w => w.ActivityId == weaponId)); } if (markInfoItem.Attr.TryGetValue("CurrAmmon", out var currAmmon)) //弹夹弹药量 { diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs index 7c7e837..7bc3343 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs @@ -33,7 +33,7 @@ { return null; } - return _selectWeapon.WeaponId; + return _selectWeapon.ActivityId; } //点击编辑按钮 @@ -50,7 +50,7 @@ private void OnSelectObject(ExcelConfig.ActivityBase activityObject) { - var weapon = ExcelConfig.WeaponBase_List.Find(weapon => weapon.WeaponId == activityObject.Id); + var weapon = ExcelConfig.WeaponBase_List.Find(weapon => weapon.ActivityId == activityObject.Id); if (weapon != null) { SelectWeapon(weapon); @@ -76,7 +76,7 @@ { _objectBar.L_HBoxContainer.L_DeleteButton.Instance.Visible = true; _selectWeapon = weapon; - var o = ExcelConfig.ActivityBase_Map[weapon.WeaponId]; + var o = ExcelConfig.ActivityBase_Map[weapon.ActivityId]; //显示关联属性 _currAmmonAttr.Instance.Visible = true; _residueAmmoAttr.Instance.Visible = true;