diff --git a/DungeonShooting_Godot/excel/ActivityBase.xlsx b/DungeonShooting_Godot/excel/ActivityBase.xlsx index 9ec1b0bd..9b520071 100644 Binary files a/DungeonShooting_Godot/excel/ActivityBase.xlsx and b/DungeonShooting_Godot/excel/ActivityBase.xlsx differ diff --git a/DungeonShooting_Godot/prefab/role/Enemy0001.tscn b/DungeonShooting_Godot/prefab/role/enemy/Enemy0001.tscn similarity index 98% rename from DungeonShooting_Godot/prefab/role/Enemy0001.tscn rename to DungeonShooting_Godot/prefab/role/enemy/Enemy0001.tscn index 95d8d9f0..723e2f1a 100644 --- a/DungeonShooting_Godot/prefab/role/Enemy0001.tscn +++ b/DungeonShooting_Godot/prefab/role/enemy/Enemy0001.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=13 format=3 uid="uid://b8s1dgu63fddf"] -[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/EnemyTemplate.tscn" id="1_2vqwe"] +[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AiTemplate.tscn" id="1_2vqwe"] [ext_resource type="Script" path="res://src/game/activity/role/enemy/Enemy.cs" id="2_0pcq3"] [ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="3_x8agd"] [ext_resource type="SpriteFrames" uid="uid://cnctpyrn02rhd" path="res://resource/spriteFrames/role/Enemy0001.tres" id="4_qv8w5"] diff --git a/DungeonShooting_Godot/prefab/role/Enemy0002.tscn b/DungeonShooting_Godot/prefab/role/enemy/Enemy0002.tscn similarity index 98% rename from DungeonShooting_Godot/prefab/role/Enemy0002.tscn rename to DungeonShooting_Godot/prefab/role/enemy/Enemy0002.tscn index 08c2957d..6829646b 100644 --- a/DungeonShooting_Godot/prefab/role/Enemy0002.tscn +++ b/DungeonShooting_Godot/prefab/role/enemy/Enemy0002.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=13 format=3 uid="uid://daqsdld5gnwwr"] -[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/EnemyTemplate.tscn" id="1_fanet"] +[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AiTemplate.tscn" id="1_fanet"] [ext_resource type="Script" path="res://src/game/activity/role/enemy/NoWeaponEnemy.cs" id="2_3an4s"] [ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="2_yunbp"] [ext_resource type="SpriteFrames" uid="uid://ctpkpxgcwb583" path="res://resource/spriteFrames/role/Enemy0002.tres" id="3_hbsqi"] diff --git a/DungeonShooting_Godot/prefab/role/shopBoss/ShopBoss0001.tscn b/DungeonShooting_Godot/prefab/role/shopBoss/ShopBoss0001.tscn new file mode 100644 index 00000000..8a18747d --- /dev/null +++ b/DungeonShooting_Godot/prefab/role/shopBoss/ShopBoss0001.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=7 format=3 uid="uid://dyl1dhtlxbcb3"] + +[ext_resource type="PackedScene" uid="uid://dbrig6dq441wo" path="res://prefab/role/template/AiTemplate.tscn" id="1_25fpq"] +[ext_resource type="Script" path="res://src/game/activity/role/shop/ShopBoss.cs" id="2_2ng7e"] +[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="2_7m501"] +[ext_resource type="SpriteFrames" uid="uid://bxn63xs3f87jy" path="res://resource/spriteFrames/role/ShopBoss0001.tres" id="3_b0a5c"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_0nvxl"] +resource_local_to_scene = true +shader = ExtResource("2_7m501") +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 +shader_parameter/grey = 0.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_x86iq"] +resource_local_to_scene = true +shader = ExtResource("2_7m501") +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 +shader_parameter/grey = 0.0 + +[node name="ShopBoss0001" node_paths=PackedStringArray("ViewRay", "NavigationAgent2D", "NavigationPoint", "FirePoint", "HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "TipRoot", "TipSprite", "AnimationPlayer", "MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_25fpq")] +script = ExtResource("2_2ng7e") +ViewRay = NodePath("ViewRay") +NavigationAgent2D = NodePath("NavigationPoint/NavigationAgent2D") +NavigationPoint = NodePath("NavigationPoint") +FirePoint = NodePath("FirePoint") +HurtArea = NodePath("HurtArea") +HurtCollision = NodePath("HurtArea/HurtCollision") +InteractiveArea = NodePath("InteractiveArea") +InteractiveCollision = NodePath("InteractiveArea/InteractiveCollision") +TipRoot = NodePath("TipRoot") +TipSprite = NodePath("TipRoot/TipSprite") +AnimationPlayer = NodePath("AnimationPlayer") +MountPoint = NodePath("MountPoint") +BackMountPoint = NodePath("BackMountPoint") +MeleeAttackArea = NodePath("MountPoint/MeleeAttackArea") +MeleeAttackCollision = NodePath("MountPoint/MeleeAttackArea/MeleeAttackCollision") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" parent="." index="0"] +material = SubResource("ShaderMaterial_0nvxl") + +[node name="AnimatedSprite" parent="." index="2"] +material = SubResource("ShaderMaterial_x86iq") +sprite_frames = ExtResource("3_b0a5c") diff --git a/DungeonShooting_Godot/prefab/role/template/EnemyTemplate.tscn b/DungeonShooting_Godot/prefab/role/template/AiTemplate.tscn similarity index 88% rename from DungeonShooting_Godot/prefab/role/template/EnemyTemplate.tscn rename to DungeonShooting_Godot/prefab/role/template/AiTemplate.tscn index 1f91bec9..23667b39 100644 --- a/DungeonShooting_Godot/prefab/role/template/EnemyTemplate.tscn +++ b/DungeonShooting_Godot/prefab/role/template/AiTemplate.tscn @@ -1,12 +1,11 @@ [gd_scene load_steps=5 format=3 uid="uid://dbrig6dq441wo"] -[ext_resource type="PackedScene" uid="uid://cyrcv2jdgr8cf" path="res://prefab/role/template/RoleTemplate.tscn" id="1_5po38"] -[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="3_x8agd"] - +[ext_resource type="PackedScene" uid="uid://cyrcv2jdgr8cf" path="res://prefab/role/template/RoleTemplate.tscn" id="1_dbfvf"] +[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="1_xedx7"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_k8mt5"] resource_local_to_scene = true -shader = ExtResource("3_x8agd") +shader = ExtResource("1_xedx7") shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/schedule = 0.0 shader_parameter/modulate = Color(1, 1, 1, 1) @@ -19,7 +18,7 @@ shader_parameter/grey = 0.0 [sub_resource type="CircleShape2D" id="CircleShape2D_wu0xv"] radius = 8.06226 -[node name="EnemyTemplate" instance=ExtResource("1_5po38")] +[node name="AiTemplate" instance=ExtResource("1_dbfvf")] collision_layer = 16 collision_mask = 25 floor_stop_on_slope = false diff --git a/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn b/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn index e098e510..102bf011 100644 --- a/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn +++ b/DungeonShooting_Godot/prefab/role/template/RoleTemplate.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=9 format=3 uid="uid://cyrcv2jdgr8cf"] -[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="1_xk5yk"] -[ext_resource type="Script" path="res://src/game/activity/role/MountRotation.cs" id="2_5ddpw"] -[ext_resource type="Script" path="res://src/framework/activity/hurt/HurtArea.cs" id="2_8jnvr"] -[ext_resource type="SpriteFrames" uid="uid://c8h5svp76h3kw" path="res://resource/spriteFrames/role/Role_tip.tres" id="3_bo78w"] +[ext_resource type="Shader" path="res://resource/shader/Blend.gdshader" id="1_xedx7"] +[ext_resource type="Script" path="res://src/framework/activity/hurt/HurtArea.cs" id="2_2eey0"] +[ext_resource type="Script" path="res://src/game/activity/role/MountRotation.cs" id="3_1jj1i"] +[ext_resource type="SpriteFrames" uid="uid://c8h5svp76h3kw" path="res://resource/spriteFrames/role/Role_tip.tres" id="4_kn7in"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_yif6x"] resource_local_to_scene = true -shader = ExtResource("1_xk5yk") +shader = ExtResource("1_xedx7") shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/schedule = 0.0 shader_parameter/modulate = Color(1, 1, 1, 1) @@ -49,7 +49,7 @@ shape = SubResource("CircleShape2D_5pj80") collision_layer = 0 collision_mask = 0 monitoring = false -script = ExtResource("2_8jnvr") +script = ExtResource("2_2eey0") [node name="HurtCollision" type="CollisionShape2D" parent="HurtArea"] position = Vector2(0, -9) @@ -66,7 +66,7 @@ shape = SubResource("CapsuleShape2D_843d5") [node name="MountPoint" type="Marker2D" parent="."] position = Vector2(2, -8) -script = ExtResource("2_5ddpw") +script = ExtResource("3_1jj1i") [node name="MeleeAttackArea" type="Area2D" parent="MountPoint"] visible = false @@ -81,6 +81,6 @@ monitorable = false [node name="TipSprite" type="AnimatedSprite2D" parent="TipRoot"] visible = false position = Vector2(0, -22) -sprite_frames = ExtResource("3_bo78w") +sprite_frames = ExtResource("4_kn7in") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/DungeonShooting_Godot/project.godot b/DungeonShooting_Godot/project.godot index 2f7682ed..7c6559c6 100644 --- a/DungeonShooting_Godot/project.godot +++ b/DungeonShooting_Godot/project.godot @@ -31,7 +31,7 @@ project/assembly_name="DungeonShooting" [editor_plugins] -enabled=PackedStringArray() +enabled=PackedStringArray("res://addons/dungeonShooting_plugin/plugin.cfg") [file_customization] diff --git a/DungeonShooting_Godot/resource/config/ActivityBase.json b/DungeonShooting_Godot/resource/config/ActivityBase.json index b1466f38..8a65df5e 100644 --- a/DungeonShooting_Godot/resource/config/ActivityBase.json +++ b/DungeonShooting_Godot/resource/config/ActivityBase.json @@ -23,7 +23,7 @@ "Details": "", "IsStatic": false, "__Material": "", - "Prefab": "res://prefab/role/Enemy0001.tscn", + "Prefab": "res://prefab/role/enemy/Enemy0001.tscn", "Icon": "res://resource/sprite/role/enemy0001/enemy0001_Icon.png", "ShowInMapEditor": true }, @@ -37,10 +37,24 @@ "Details": "", "IsStatic": false, "__Material": "", - "Prefab": "res://prefab/role/Enemy0002.tscn", + "Prefab": "res://prefab/role/enemy/Enemy0002.tscn", "Icon": "res://resource/sprite/role/enemy0002/Enemy0002.png", "ShowInMapEditor": true }, + { + "Id": "shopBoss0001", + "Name": "\u5546\u5E97\u8001\u677F", + "Type": 4, + "Quality": 0, + "Price": 0, + "Intro": "\u5546\u5E97\u8001\u677F", + "Details": "", + "IsStatic": false, + "__Material": "", + "Prefab": "res://prefab/role/shopBoss/ShopBoss0001.tscn", + "Icon": "res://resource/sprite/role/shopBoss0001/ShopBoss0001.png", + "ShowInMapEditor": true + }, { "Id": "weapon0001", "Name": "\u6B65\u67AA", diff --git a/DungeonShooting_Godot/resource/spriteFrames/role/ShopBoss0001.tres b/DungeonShooting_Godot/resource/spriteFrames/role/ShopBoss0001.tres new file mode 100644 index 00000000..0b118c90 --- /dev/null +++ b/DungeonShooting_Godot/resource/spriteFrames/role/ShopBoss0001.tres @@ -0,0 +1,14 @@ +[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://bxn63xs3f87jy"] + +[ext_resource type="Texture2D" uid="uid://cfgdtj2quumhy" path="res://resource/sprite/role/shopBoss0001/ShopBoss0001.png" id="1_k2gly"] + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_k2gly") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] diff --git a/DungeonShooting_Godot/scene/Hall.tscn b/DungeonShooting_Godot/scene/Hall.tscn index fbd74e82..e6c5fbd0 100644 --- a/DungeonShooting_Godot/scene/Hall.tscn +++ b/DungeonShooting_Godot/scene/Hall.tscn @@ -121,7 +121,7 @@ DefaultLayer = 1 ShowOffset = Vector2(2.08165e-12, 2) CollisionVisible = false -[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0006" index="1"] +[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0006" index="0"] position = Vector2(-11, -3) texture = ExtResource("7_30qwa") @@ -133,7 +133,7 @@ DefaultLayer = 1 ShowOffset = Vector2(2.08165e-12, 2) CollisionVisible = false -[node name="ActivityInstance" type="Node2D" parent="ItemRoot/Item0008" index="1"] +[node name="ActivityInstance" type="Node2D" parent="ItemRoot/Item0008" index="0"] position = Vector2(2.5, -12) script = ExtResource("5_lowqi") Id = "item_0031" @@ -149,7 +149,7 @@ DefaultLayer = 1 ShowOffset = Vector2(2.08165e-12, 2) CollisionVisible = false -[node name="Item26" type="Sprite2D" parent="ItemRoot/Item0013" index="1"] +[node name="Item26" type="Sprite2D" parent="ItemRoot/Item0013" index="0"] position = Vector2(18, -2) texture = ExtResource("8_61dkg") @@ -161,19 +161,19 @@ DefaultLayer = 1 ShowOffset = Vector2(2.08165e-12, 2) CollisionVisible = false -[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0017" index="1"] +[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0017" index="0"] position = Vector2(-2, -13) texture = ExtResource("8_u3vry") -[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0017" index="2"] +[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0017" index="1"] position = Vector2(18, -11) texture = ExtResource("9_lhdr8") -[node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0017" index="3"] +[node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0017" index="2"] position = Vector2(-16, -2) texture = ExtResource("10_4eqn0") -[node name="Sprite2D4" type="Sprite2D" parent="ItemRoot/Item0017" index="4"] +[node name="Sprite2D4" type="Sprite2D" parent="ItemRoot/Item0017" index="3"] position = Vector2(10, -1) texture = ExtResource("11_tg3jo") @@ -201,12 +201,12 @@ Id = "item_0002" DefaultLayer = 1 CollisionVisible = false -[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0002" index="1"] +[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0002" index="0"] position = Vector2(133, 114) rotation = 1.5708 texture = ExtResource("12_agfji") -[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0002" index="2"] +[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0002" index="1"] material = SubResource("ShaderMaterial_i7git") position = Vector2(0, -18) scale = Vector2(1, -1) @@ -227,7 +227,7 @@ ShadowZIndex = 0 VerticalMotion = false CollisionVisible = false -[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0004" index="1"] +[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0004" index="0"] position = Vector2(71, -37) texture = ExtResource("13_unnpl") @@ -263,15 +263,15 @@ script = ExtResource("5_lowqi") Id = "item_0009" DefaultLayer = 1 -[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0009" index="1"] +[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0009" index="0"] position = Vector2(-24, -10) texture = ExtResource("15_h7524") -[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0009" index="2"] +[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0009" index="1"] position = Vector2(1, -10) texture = ExtResource("15_h7524") -[node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0009" index="3"] +[node name="Sprite2D3" type="Sprite2D" parent="ItemRoot/Item0009" index="2"] position = Vector2(37, -10) texture = ExtResource("15_h7524") @@ -305,7 +305,7 @@ script = ExtResource("5_lowqi") Id = "item_0015" DefaultLayer = 1 -[node name="Slice04" type="Sprite2D" parent="ItemRoot/Item0015" index="1"] +[node name="Slice04" type="Sprite2D" parent="ItemRoot/Item0015" index="0"] position = Vector2(16, -9) texture = ExtResource("15_h7524") @@ -328,11 +328,11 @@ script = ExtResource("5_lowqi") Id = "item_0019" DefaultLayer = 1 -[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0019" index="1"] +[node name="Sprite2D" type="Sprite2D" parent="ItemRoot/Item0019" index="0"] position = Vector2(-20, -9) texture = ExtResource("16_xj0e1") -[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0019" index="2"] +[node name="Sprite2D2" type="Sprite2D" parent="ItemRoot/Item0019" index="1"] position = Vector2(17, -8) texture = ExtResource("17_gwwce") diff --git a/DungeonShooting_Godot/src/config/ExcelConfig.cs b/DungeonShooting_Godot/src/config/ExcelConfig.cs index df8bd8dd..42d5e0a2 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig.cs @@ -8,22 +8,31 @@ namespace Config; public static partial class ExcelConfig { /// - /// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// - public static List ActivePropBase_List { get; private set; } + public static List BuffPropBase_List { get; private set; } /// - /// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id /// - public static Dictionary ActivePropBase_Map { get; private set; } + public static Dictionary BuffPropBase_Map { get; private set; } /// - /// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// - public static List ActivityBase_List { get; private set; } + public static List Sound_List { get; private set; } /// - /// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id /// - public static Dictionary ActivityBase_Map { get; private set; } + public static Dictionary Sound_Map { get; private set; } + + /// + /// WeaponBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// + public static List WeaponBase_List { get; private set; } + /// + /// WeaponBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// + public static Dictionary WeaponBase_Map { get; private set; } /// /// ActivityMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 @@ -43,15 +52,6 @@ public static partial class ExcelConfig /// public static Dictionary AiAttackAttr_Map { get; private set; } - /// - /// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 - /// - public static List BuffPropBase_List { get; private set; } - /// - /// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id - /// - public static Dictionary BuffPropBase_Map { get; private set; } - /// /// BulletBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// @@ -61,6 +61,15 @@ public static partial class ExcelConfig /// public static Dictionary BulletBase_Map { get; private set; } + /// + /// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// + public static List ActivePropBase_List { get; private set; } + /// + /// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// + public static Dictionary ActivePropBase_Map { get; private set; } + /// /// EnemyBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// @@ -70,6 +79,15 @@ public static partial class ExcelConfig /// public static Dictionary EnemyBase_Map { get; private set; } + /// + /// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 + /// + public static List ActivityBase_List { get; private set; } + /// + /// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id + /// + public static Dictionary ActivityBase_Map { get; private set; } + /// /// LiquidMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 /// @@ -79,24 +97,6 @@ public static partial class ExcelConfig /// public static Dictionary LiquidMaterial_Map { get; private set; } - /// - /// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 - /// - public static List Sound_List { get; private set; } - /// - /// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id - /// - public static Dictionary Sound_Map { get; private set; } - - /// - /// WeaponBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同 - /// - public static List WeaponBase_List { get; private set; } - /// - /// WeaponBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id - /// - public static Dictionary WeaponBase_Map { get; private set; } - private static bool _init = false; /// @@ -107,94 +107,22 @@ public static partial class ExcelConfig if (_init) return; _init = true; - _InitActivePropBaseConfig(); - _InitActivityBaseConfig(); - _InitActivityMaterialConfig(); - _InitAiAttackAttrConfig(); _InitBuffPropBaseConfig(); - _InitBulletBaseConfig(); - _InitEnemyBaseConfig(); - _InitLiquidMaterialConfig(); _InitSoundConfig(); _InitWeaponBaseConfig(); + _InitActivityMaterialConfig(); + _InitAiAttackAttrConfig(); + _InitBulletBaseConfig(); + _InitActivePropBaseConfig(); + _InitEnemyBaseConfig(); + _InitActivityBaseConfig(); + _InitLiquidMaterialConfig(); - _InitActivePropBaseRef(); - _InitActivityBaseRef(); _InitBuffPropBaseRef(); - _InitEnemyBaseRef(); _InitWeaponBaseRef(); - } - private static void _InitActivePropBaseConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/ActivePropBase.json"); - ActivePropBase_List = new List(JsonSerializer.Deserialize>(text)); - ActivePropBase_Map = new Dictionary(); - foreach (var item in ActivePropBase_List) - { - ActivePropBase_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'ActivePropBase'失败!"); - } - } - private static void _InitActivityBaseConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/ActivityBase.json"); - ActivityBase_List = new List(JsonSerializer.Deserialize>(text)); - ActivityBase_Map = new Dictionary(); - foreach (var item in ActivityBase_List) - { - ActivityBase_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'ActivityBase'失败!"); - } - } - private static void _InitActivityMaterialConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/ActivityMaterial.json"); - ActivityMaterial_List = JsonSerializer.Deserialize>(text); - ActivityMaterial_Map = new Dictionary(); - foreach (var item in ActivityMaterial_List) - { - ActivityMaterial_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'ActivityMaterial'失败!"); - } - } - private static void _InitAiAttackAttrConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/AiAttackAttr.json"); - AiAttackAttr_List = JsonSerializer.Deserialize>(text); - AiAttackAttr_Map = new Dictionary(); - foreach (var item in AiAttackAttr_List) - { - AiAttackAttr_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'AiAttackAttr'失败!"); - } + _InitActivePropBaseRef(); + _InitEnemyBaseRef(); + _InitActivityBaseRef(); } private static void _InitBuffPropBaseConfig() { @@ -214,60 +142,6 @@ public static partial class ExcelConfig throw new Exception("初始化表'BuffPropBase'失败!"); } } - private static void _InitBulletBaseConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/BulletBase.json"); - BulletBase_List = JsonSerializer.Deserialize>(text); - BulletBase_Map = new Dictionary(); - foreach (var item in BulletBase_List) - { - BulletBase_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'BulletBase'失败!"); - } - } - private static void _InitEnemyBaseConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/EnemyBase.json"); - EnemyBase_List = new List(JsonSerializer.Deserialize>(text)); - EnemyBase_Map = new Dictionary(); - foreach (var item in EnemyBase_List) - { - EnemyBase_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'EnemyBase'失败!"); - } - } - private static void _InitLiquidMaterialConfig() - { - try - { - var text = _ReadConfigAsText("res://resource/config/LiquidMaterial.json"); - LiquidMaterial_List = JsonSerializer.Deserialize>(text); - LiquidMaterial_Map = new Dictionary(); - foreach (var item in LiquidMaterial_List) - { - LiquidMaterial_Map.Add(item.Id, item); - } - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化表'LiquidMaterial'失败!"); - } - } private static void _InitSoundConfig() { try @@ -304,45 +178,133 @@ public static partial class ExcelConfig throw new Exception("初始化表'WeaponBase'失败!"); } } - - private static void _InitActivePropBaseRef() + private static void _InitActivityMaterialConfig() { - foreach (Ref_ActivePropBase item in ActivePropBase_List) + try { - try + var text = _ReadConfigAsText("res://resource/config/ActivityMaterial.json"); + ActivityMaterial_List = JsonSerializer.Deserialize>(text); + ActivityMaterial_Map = new Dictionary(); + foreach (var item in ActivityMaterial_List) { - if (!string.IsNullOrEmpty(item.__Activity)) - { - item.Activity = ActivityBase_Map[item.__Activity]; - } - - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化'ActivePropBase'引用其他表数据失败, 当前行id: " + item.Id); + ActivityMaterial_Map.Add(item.Id, item); } } - } - private static void _InitActivityBaseRef() - { - foreach (Ref_ActivityBase item in ActivityBase_List) + catch (Exception e) { - try - { - if (!string.IsNullOrEmpty(item.__Material)) - { - item.Material = ActivityMaterial_Map[item.__Material]; - } - - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化'ActivityBase'引用其他表数据失败, 当前行id: " + item.Id); - } + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'ActivityMaterial'失败!"); } } + private static void _InitAiAttackAttrConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/AiAttackAttr.json"); + AiAttackAttr_List = JsonSerializer.Deserialize>(text); + AiAttackAttr_Map = new Dictionary(); + foreach (var item in AiAttackAttr_List) + { + AiAttackAttr_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'AiAttackAttr'失败!"); + } + } + private static void _InitBulletBaseConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/BulletBase.json"); + BulletBase_List = JsonSerializer.Deserialize>(text); + BulletBase_Map = new Dictionary(); + foreach (var item in BulletBase_List) + { + BulletBase_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'BulletBase'失败!"); + } + } + private static void _InitActivePropBaseConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/ActivePropBase.json"); + ActivePropBase_List = new List(JsonSerializer.Deserialize>(text)); + ActivePropBase_Map = new Dictionary(); + foreach (var item in ActivePropBase_List) + { + ActivePropBase_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'ActivePropBase'失败!"); + } + } + private static void _InitEnemyBaseConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/EnemyBase.json"); + EnemyBase_List = new List(JsonSerializer.Deserialize>(text)); + EnemyBase_Map = new Dictionary(); + foreach (var item in EnemyBase_List) + { + EnemyBase_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'EnemyBase'失败!"); + } + } + private static void _InitActivityBaseConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/ActivityBase.json"); + ActivityBase_List = new List(JsonSerializer.Deserialize>(text)); + ActivityBase_Map = new Dictionary(); + foreach (var item in ActivityBase_List) + { + ActivityBase_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'ActivityBase'失败!"); + } + } + private static void _InitLiquidMaterialConfig() + { + try + { + var text = _ReadConfigAsText("res://resource/config/LiquidMaterial.json"); + LiquidMaterial_List = JsonSerializer.Deserialize>(text); + LiquidMaterial_Map = new Dictionary(); + foreach (var item in LiquidMaterial_List) + { + LiquidMaterial_Map.Add(item.Id, item); + } + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化表'LiquidMaterial'失败!"); + } + } + private static void _InitBuffPropBaseRef() { foreach (Ref_BuffPropBase item in BuffPropBase_List) @@ -362,25 +324,6 @@ public static partial class ExcelConfig } } } - private static void _InitEnemyBaseRef() - { - foreach (Ref_EnemyBase item in EnemyBase_List) - { - try - { - if (!string.IsNullOrEmpty(item.__Activity)) - { - item.Activity = ActivityBase_Map[item.__Activity]; - } - - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - throw new Exception("初始化'EnemyBase'引用其他表数据失败, 当前行id: " + item.Id); - } - } - } private static void _InitWeaponBaseRef() { foreach (Ref_WeaponBase item in WeaponBase_List) @@ -449,6 +392,63 @@ public static partial class ExcelConfig } } } + private static void _InitActivePropBaseRef() + { + foreach (Ref_ActivePropBase item in ActivePropBase_List) + { + try + { + if (!string.IsNullOrEmpty(item.__Activity)) + { + item.Activity = ActivityBase_Map[item.__Activity]; + } + + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化'ActivePropBase'引用其他表数据失败, 当前行id: " + item.Id); + } + } + } + private static void _InitEnemyBaseRef() + { + foreach (Ref_EnemyBase item in EnemyBase_List) + { + try + { + if (!string.IsNullOrEmpty(item.__Activity)) + { + item.Activity = ActivityBase_Map[item.__Activity]; + } + + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化'EnemyBase'引用其他表数据失败, 当前行id: " + item.Id); + } + } + } + private static void _InitActivityBaseRef() + { + foreach (Ref_ActivityBase item in ActivityBase_List) + { + try + { + if (!string.IsNullOrEmpty(item.__Material)) + { + item.Material = ActivityMaterial_Map[item.__Material]; + } + + } + catch (Exception e) + { + GD.PrintErr(e.ToString()); + throw new Exception("初始化'ActivityBase'引用其他表数据失败, 当前行id: " + item.Id); + } + } + } private static string _ReadConfigAsText(string path) { var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Create.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Create.cs index 3805d0f7..f8d9e049 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Create.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Create.cs @@ -14,9 +14,18 @@ public partial class ActivityObject { throw new Exception("实例化 ActivityObject 前请先调用 'GameApplication.Instance.DungeonManager.CreateNewWorld()' 初始化 World 对象"); } - var instance = ResourceManager.LoadAndInstantiate(config.Prefab); - instance._InitNode(config, world); - return instance; + + try + { + var instance = ResourceManager.LoadAndInstantiate(config.Prefab); + instance._InitNode(config, world); + return instance; + } + catch (Exception e) + { + Debug.LogError($"创建实例'{config.Id}'失败, 错误信息: {e.Message}\n{e.StackTrace}"); + throw; + } } /// diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs index fd0e5d5a..1e93b25c 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs @@ -24,6 +24,11 @@ public partial class ActivityObject /// public const string Id_enemy0002 = "enemy0002"; /// + /// 名称: 商店老板
+ /// 简介: 商店老板 + ///
+ public const string Id_shopBoss0001 = "shopBoss0001"; + /// /// 名称: 步枪
/// 简介: ///
diff --git a/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs b/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs index d9425d2c..97f2e5a8 100644 --- a/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs +++ b/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs @@ -229,6 +229,9 @@ public class RoomPreinstall : IDestroy mark.Id = ActivityObject.Ids.Id_treasure_box0001; mark.ActivityType = ActivityType.Treasure; mark.Altitude = 0; + + // mark.Id = ActivityObject.Ids.Id_shopBoss0001; + // mark.ActivityType = ActivityType.Enemy; } private void HandlerTreasureMark(World world, MarkInfo markInfo, ActivityMark mark)