Compare commits
2 Commits
865eb964de
...
30f37a0d9a
Author | SHA1 | Date | |
---|---|---|---|
30f37a0d9a | |||
70af4f69e6 |
Binary file not shown.
|
@ -49,6 +49,10 @@ public enum ActivityType
|
|||
/// </summary>
|
||||
Treasure,
|
||||
/// <summary>
|
||||
/// Npc
|
||||
/// </summary>
|
||||
Npc,
|
||||
/// <summary>
|
||||
/// 其它类型
|
||||
/// </summary>
|
||||
Other = 99,
|
||||
|
|
|
@ -1 +1 @@
|
|||
7
|
||||
8
|
|
@ -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"]
|
||||
|
@ -9,7 +9,6 @@
|
|||
[ext_resource type="Animation" uid="uid://16rxpnsgj5tl" path="res://resource/animation/enemy/Enemy_notify.res" id="6_x8gmo"]
|
||||
[ext_resource type="Animation" uid="uid://cmje7jsgrhgmx" path="res://resource/animation/enemy/Enemy_query.res" id="7_e37p2"]
|
||||
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_3nkur"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("3_x8agd")
|
|
@ -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"]
|
60
DungeonShooting_Godot/prefab/role/shopBoss/ShopBoss0001.tscn
Normal file
60
DungeonShooting_Godot/prefab/role/shopBoss/ShopBoss0001.tscn
Normal file
|
@ -0,0 +1,60 @@
|
|||
[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")]
|
||||
collision_layer = 1024
|
||||
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")
|
||||
animation = &"idle"
|
|
@ -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
|
|
@ -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="."]
|
||||
|
|
|
@ -31,7 +31,7 @@ project/assembly_name="DungeonShooting"
|
|||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray()
|
||||
enabled=PackedStringArray("res://addons/dungeonShooting_plugin/plugin.cfg")
|
||||
|
||||
[file_customization]
|
||||
|
||||
|
@ -252,6 +252,7 @@ roulette={
|
|||
2d_physics/layer_8="debris"
|
||||
2d_physics/layer_9="throwing"
|
||||
2d_physics/layer_10="obstacle"
|
||||
2d_physics/layer_11="npc"
|
||||
2d_physics/layer_14="ui_mouse"
|
||||
|
||||
[mono]
|
||||
|
|
|
@ -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": 11,
|
||||
"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",
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
[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
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_k2gly")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_k2gly")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"reverseRun",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_k2gly")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"run",
|
||||
"speed": 5.0
|
||||
}]
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -8,22 +8,31 @@ namespace Config;
|
|||
public static partial class ExcelConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<ActivePropBase> ActivePropBase_List { get; private set; }
|
||||
public static List<BuffPropBase> BuffPropBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, ActivePropBase> ActivePropBase_Map { get; private set; }
|
||||
public static Dictionary<string, BuffPropBase> BuffPropBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<ActivityBase> ActivityBase_List { get; private set; }
|
||||
public static List<Sound> Sound_List { get; private set; }
|
||||
/// <summary>
|
||||
/// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, ActivityBase> ActivityBase_Map { get; private set; }
|
||||
public static Dictionary<string, Sound> Sound_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// WeaponBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<WeaponBase> WeaponBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// WeaponBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, WeaponBase> WeaponBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ActivityMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
|
@ -43,15 +52,6 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public static Dictionary<string, AiAttackAttr> AiAttackAttr_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<BuffPropBase> BuffPropBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, BuffPropBase> BuffPropBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// BulletBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
|
@ -61,6 +61,15 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public static Dictionary<string, BulletBase> BulletBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<ActivePropBase> ActivePropBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, ActivePropBase> ActivePropBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// EnemyBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
|
@ -70,6 +79,15 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public static Dictionary<string, EnemyBase> EnemyBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<ActivityBase> ActivityBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, ActivityBase> ActivityBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// LiquidMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
|
@ -79,24 +97,6 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public static Dictionary<string, LiquidMaterial> LiquidMaterial_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<Sound> Sound_List { get; private set; }
|
||||
/// <summary>
|
||||
/// Sound.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, Sound> Sound_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// WeaponBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<WeaponBase> WeaponBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// WeaponBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, WeaponBase> WeaponBase_Map { get; private set; }
|
||||
|
||||
|
||||
private static bool _init = false;
|
||||
/// <summary>
|
||||
|
@ -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<ActivePropBase>(JsonSerializer.Deserialize<List<Ref_ActivePropBase>>(text));
|
||||
ActivePropBase_Map = new Dictionary<string, ActivePropBase>();
|
||||
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<ActivityBase>(JsonSerializer.Deserialize<List<Ref_ActivityBase>>(text));
|
||||
ActivityBase_Map = new Dictionary<string, ActivityBase>();
|
||||
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<List<ActivityMaterial>>(text);
|
||||
ActivityMaterial_Map = new Dictionary<string, ActivityMaterial>();
|
||||
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<List<AiAttackAttr>>(text);
|
||||
AiAttackAttr_Map = new Dictionary<string, AiAttackAttr>();
|
||||
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<List<BulletBase>>(text);
|
||||
BulletBase_Map = new Dictionary<string, BulletBase>();
|
||||
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<EnemyBase>(JsonSerializer.Deserialize<List<Ref_EnemyBase>>(text));
|
||||
EnemyBase_Map = new Dictionary<string, EnemyBase>();
|
||||
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<List<LiquidMaterial>>(text);
|
||||
LiquidMaterial_Map = new Dictionary<string, LiquidMaterial>();
|
||||
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()
|
||||
{
|
||||
foreach (Ref_ActivePropBase item in ActivePropBase_List)
|
||||
private static void _InitActivityMaterialConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.__Activity))
|
||||
var text = _ReadConfigAsText("res://resource/config/ActivityMaterial.json");
|
||||
ActivityMaterial_List = JsonSerializer.Deserialize<List<ActivityMaterial>>(text);
|
||||
ActivityMaterial_Map = new Dictionary<string, ActivityMaterial>();
|
||||
foreach (var item in ActivityMaterial_List)
|
||||
{
|
||||
item.Activity = ActivityBase_Map[item.__Activity];
|
||||
ActivityMaterial_Map.Add(item.Id, item);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化'ActivePropBase'引用其他表数据失败, 当前行id: " + item.Id);
|
||||
throw new Exception("初始化表'ActivityMaterial'失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void _InitActivityBaseRef()
|
||||
{
|
||||
foreach (Ref_ActivityBase item in ActivityBase_List)
|
||||
private static void _InitAiAttackAttrConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.__Material))
|
||||
var text = _ReadConfigAsText("res://resource/config/AiAttackAttr.json");
|
||||
AiAttackAttr_List = JsonSerializer.Deserialize<List<AiAttackAttr>>(text);
|
||||
AiAttackAttr_Map = new Dictionary<string, AiAttackAttr>();
|
||||
foreach (var item in AiAttackAttr_List)
|
||||
{
|
||||
item.Material = ActivityMaterial_Map[item.__Material];
|
||||
AiAttackAttr_Map.Add(item.Id, item);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化'ActivityBase'引用其他表数据失败, 当前行id: " + item.Id);
|
||||
throw new Exception("初始化表'AiAttackAttr'失败!");
|
||||
}
|
||||
}
|
||||
private static void _InitBulletBaseConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = _ReadConfigAsText("res://resource/config/BulletBase.json");
|
||||
BulletBase_List = JsonSerializer.Deserialize<List<BulletBase>>(text);
|
||||
BulletBase_Map = new Dictionary<string, BulletBase>();
|
||||
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<ActivePropBase>(JsonSerializer.Deserialize<List<Ref_ActivePropBase>>(text));
|
||||
ActivePropBase_Map = new Dictionary<string, ActivePropBase>();
|
||||
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<EnemyBase>(JsonSerializer.Deserialize<List<Ref_EnemyBase>>(text));
|
||||
EnemyBase_Map = new Dictionary<string, EnemyBase>();
|
||||
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<ActivityBase>(JsonSerializer.Deserialize<List<Ref_ActivityBase>>(text));
|
||||
ActivityBase_Map = new Dictionary<string, ActivityBase>();
|
||||
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<List<LiquidMaterial>>(text);
|
||||
LiquidMaterial_Map = new Dictionary<string, LiquidMaterial>();
|
||||
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);
|
||||
|
|
|
@ -30,6 +30,7 @@ public static partial class ExcelConfig
|
|||
/// Effect(特效): 8 <br/>
|
||||
/// Prop(道具): 9 <br/>
|
||||
/// Treasure(宝箱): 10 <br/>
|
||||
/// Npc: 11 <br/>
|
||||
/// Other(其它类型): 99
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
|
|
|
@ -14,10 +14,19 @@ public partial class ActivityObject
|
|||
{
|
||||
throw new Exception("实例化 ActivityObject 前请先调用 'GameApplication.Instance.DungeonManager.CreateNewWorld()' 初始化 World 对象");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var instance = ResourceManager.LoadAndInstantiate<ActivityObject>(config.Prefab);
|
||||
instance._InitNode(config, world);
|
||||
return instance;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"创建实例'{config.Id}'失败, 错误信息: {e.Message}\n{e.StackTrace}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过 ActivityBase 实例化 ActivityObject 对象
|
||||
|
|
|
@ -24,6 +24,11 @@ public partial class ActivityObject
|
|||
/// </summary>
|
||||
public const string Id_enemy0002 = "enemy0002";
|
||||
/// <summary>
|
||||
/// 名称: 商店老板 <br/>
|
||||
/// 简介: 商店老板
|
||||
/// </summary>
|
||||
public const string Id_shopBoss0001 = "shopBoss0001";
|
||||
/// <summary>
|
||||
/// 名称: 步枪 <br/>
|
||||
/// 简介:
|
||||
/// </summary>
|
||||
|
|
|
@ -49,6 +49,10 @@ public enum ActivityType
|
|||
/// </summary>
|
||||
Treasure,
|
||||
/// <summary>
|
||||
/// Npc
|
||||
/// </summary>
|
||||
Npc,
|
||||
/// <summary>
|
||||
/// 其它类型
|
||||
/// </summary>
|
||||
Other = 99,
|
||||
|
|
|
@ -226,8 +226,8 @@ public class RoomPreinstall : IDestroy
|
|||
|
||||
private void HandlerShopBossMark(World world, MarkInfo markInfo, ActivityMark mark)
|
||||
{
|
||||
mark.Id = ActivityObject.Ids.Id_treasure_box0001;
|
||||
mark.ActivityType = ActivityType.Treasure;
|
||||
mark.Id = ActivityObject.Ids.Id_shopBoss0001;
|
||||
mark.ActivityType = ActivityType.Npc;
|
||||
mark.Altitude = 0;
|
||||
}
|
||||
|
||||
|
@ -466,13 +466,17 @@ public class RoomPreinstall : IDestroy
|
|||
//获取物体默认所在层级
|
||||
private RoomLayerEnum GetDefaultLayer(ActivityMark activityMark)
|
||||
{
|
||||
if (activityMark.ActivityType == ActivityType.Player || activityMark.ActivityType == ActivityType.Enemy || activityMark.ActivityType == ActivityType.Treasure)
|
||||
switch (activityMark.ActivityType)
|
||||
{
|
||||
case ActivityType.Player:
|
||||
case ActivityType.Enemy:
|
||||
case ActivityType.Npc:
|
||||
case ActivityType.Treasure:
|
||||
return RoomLayerEnum.YSortLayer;
|
||||
}
|
||||
|
||||
default:
|
||||
return RoomLayerEnum.NormalLayer;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取房间内的特殊标记
|
||||
|
|
|
@ -76,6 +76,11 @@ public abstract partial class AiRole : Role
|
|||
/// </summary>
|
||||
public float AttackInterval { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 当前Ai是否有攻击欲望
|
||||
/// </summary>
|
||||
public bool HasAttackDesire { get; private set; } = true;
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
|
@ -101,7 +106,7 @@ public abstract partial class AiRole : Role
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取攻击的目标对象, 该函数不能返回 null
|
||||
/// 获取攻击的目标对象, 当 HasAttackDesire 为 true 时才会调用
|
||||
/// </summary>
|
||||
public virtual Role GetAttackTarget()
|
||||
{
|
||||
|
@ -388,6 +393,18 @@ public abstract partial class AiRole : Role
|
|||
Destroy();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置Ai是否有攻击欲望
|
||||
/// </summary>
|
||||
public void SetAttackDesire(bool v)
|
||||
{
|
||||
if (v != HasAttackDesire)
|
||||
{
|
||||
HasAttackDesire = v;
|
||||
StateController.ChangeState(AIStateEnum.AiNormal);
|
||||
}
|
||||
}
|
||||
|
||||
// private void OnVelocityComputed(Vector2 velocity)
|
||||
// {
|
||||
// if (Mathf.Abs(velocity.X) >= 0.01f && Mathf.Abs(velocity.Y) >= 0.01f)
|
||||
|
|
|
@ -34,8 +34,11 @@ public class AiAstonishedState : StateBase<AiRole, AIStateEnum>
|
|||
_timer = 0.6f;
|
||||
|
||||
//播放惊讶表情
|
||||
if (Master.AnimationPlayer.HasAnimation(AnimatorNames.Astonished))
|
||||
{
|
||||
Master.AnimationPlayer.Play(AnimatorNames.Astonished);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
|
|
|
@ -53,10 +53,13 @@ public class AiFindAmmoState : StateBase<AiRole, AIStateEnum>
|
|||
|
||||
_playAnimFlag = prev == AIStateEnum.AiLeaveFor;
|
||||
if (_playAnimFlag)
|
||||
{
|
||||
if (Master.AnimationPlayer.HasAnimation(AnimatorNames.Query))
|
||||
{
|
||||
Master.AnimationPlayer.Play(AnimatorNames.Query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
|
@ -74,8 +77,10 @@ public class AiFindAmmoState : StateBase<AiRole, AIStateEnum>
|
|||
|
||||
if (Master.LookTarget == null) //没有目标
|
||||
{
|
||||
//临时处理
|
||||
//攻击目标
|
||||
var attackTarget = Master.GetAttackTarget();
|
||||
if (attackTarget != null)
|
||||
{
|
||||
var targetPos = attackTarget.GetCenterPosition();
|
||||
if (Master.IsInViewRange(targetPos) && !Master.TestViewRayCast(targetPos)) //发现玩家
|
||||
{
|
||||
|
@ -88,6 +93,7 @@ public class AiFindAmmoState : StateBase<AiRole, AIStateEnum>
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//更新目标位置
|
||||
if (_navigationUpdateTimer <= 0)
|
||||
|
|
|
@ -52,9 +52,12 @@ public class AiLeaveForState : StateBase<AiRole, AIStateEnum>
|
|||
|
||||
_playAnimFlag = prev != AIStateEnum.AiFindAmmo;
|
||||
if (_playAnimFlag)
|
||||
{
|
||||
if (Master.AnimationPlayer.HasAnimation(AnimatorNames.Query))
|
||||
{
|
||||
Master.AnimationPlayer.Play(AnimatorNames.Query);
|
||||
}
|
||||
}
|
||||
|
||||
//看向目标位置
|
||||
Master.LookTargetPosition(_target.GetCenterPosition());
|
||||
|
@ -101,8 +104,10 @@ public class AiLeaveForState : StateBase<AiRole, AIStateEnum>
|
|||
//站立
|
||||
Master.DoIdle();
|
||||
}
|
||||
|
||||
//攻击目标
|
||||
var attackTarget = Master.GetAttackTarget();
|
||||
if (attackTarget != null)
|
||||
{
|
||||
var targetPos = attackTarget.GetCenterPosition();
|
||||
//检测玩家是否在视野内, 如果在, 则切换到 AiTargetInView 状态
|
||||
if (Master.IsInTailAfterViewRange(targetPos))
|
||||
|
@ -122,6 +127,8 @@ public class AiLeaveForState : StateBase<AiRole, AIStateEnum>
|
|||
Master.TestViewRayCastOver();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//移动到目标掉了, 还没发现目标
|
||||
if (Master.NavigationAgent2D.IsNavigationFinished())
|
||||
|
|
|
@ -45,9 +45,13 @@ public class AiNormalState : StateBase<AiRole, AIStateEnum>
|
|||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
if (Master.HasAttackDesire) //有攻击欲望
|
||||
{
|
||||
//获取攻击目标
|
||||
var attackTarget = Master.GetAttackTarget();
|
||||
if (attackTarget != null)
|
||||
{
|
||||
//玩家中心点坐标
|
||||
var targetPos = attackTarget.GetCenterPosition();
|
||||
|
||||
|
@ -72,7 +76,10 @@ public class AiNormalState : StateBase<AiRole, AIStateEnum>
|
|||
}
|
||||
return;
|
||||
}
|
||||
else if (_pauseTimer >= 0)
|
||||
}
|
||||
}
|
||||
|
||||
if (_pauseTimer >= 0)
|
||||
{
|
||||
Master.AnimatedSprite.Play(AnimatorNames.Idle);
|
||||
_pauseTimer -= delta;
|
||||
|
|
|
@ -22,8 +22,11 @@ public class AiNotifyState : StateBase<AiRole, AIStateEnum>
|
|||
_timer = 1.2f;
|
||||
//通知其它角色
|
||||
Master.World.NotifyEnemyTarget(Master, Master.LookTarget);
|
||||
if (Master.AnimationPlayer.HasAnimation(AnimatorNames.Notify))
|
||||
{
|
||||
Master.AnimationPlayer.Play(AnimatorNames.Notify);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
|
|
|
@ -7,6 +7,19 @@ using Godot;
|
|||
[Tool]
|
||||
public partial class ShopBoss : AiRole
|
||||
{
|
||||
public override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
SetAttackDesire(false);
|
||||
}
|
||||
|
||||
protected override RoleState OnCreateRoleState()
|
||||
{
|
||||
var roleState = new RoleState();
|
||||
roleState.MoveSpeed = 50;
|
||||
return roleState;
|
||||
}
|
||||
|
||||
public override void OnCreateWithMark(RoomPreinstall roomPreinstall, ActivityMark activityMark)
|
||||
{
|
||||
|
||||
|
|
|
@ -47,4 +47,8 @@ public class PhysicsLayer
|
|||
/// 障碍物
|
||||
/// </summary>
|
||||
public const uint Obstacle = 0b1000000000;
|
||||
/// <summary>
|
||||
/// npc
|
||||
/// </summary>
|
||||
public const uint Npc = 0b10000000000;
|
||||
}
|
Loading…
Reference in New Issue
Block a user