重构主动道具中

This commit is contained in:
小李xl 2024-03-16 10:16:45 +08:00
parent b736a60bd1
commit 645fbac190
8 changed files with 350 additions and 196 deletions

View File

@ -0,0 +1 @@
[]

View File

@ -457,7 +457,7 @@
"Details": "\u63D0\u9AD8\u89D2\u8272\u7684\u57FA\u7840\u79FB\u52A8\u901F\u5EA6",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0001.png",
"ShowInMapEditor": true
},
@ -471,7 +471,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0002.png",
"ShowInMapEditor": true
},
@ -485,7 +485,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0003.png",
"ShowInMapEditor": true
},
@ -499,7 +499,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0004.png",
"ShowInMapEditor": true
},
@ -513,7 +513,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0005.png",
"ShowInMapEditor": true
},
@ -527,7 +527,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0006.png",
"ShowInMapEditor": true
},
@ -541,7 +541,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0007.png",
"ShowInMapEditor": true
},
@ -555,7 +555,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0008.png",
"ShowInMapEditor": true
},
@ -569,7 +569,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0009.png",
"ShowInMapEditor": true
},
@ -583,7 +583,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0010.png",
"ShowInMapEditor": true
},
@ -597,7 +597,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0011.png",
"ShowInMapEditor": true
},
@ -611,7 +611,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0012.png",
"ShowInMapEditor": true
},
@ -625,7 +625,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0013.png",
"ShowInMapEditor": true
},
@ -639,7 +639,7 @@
"Details": "",
"IsStatic": false,
"__Material": "",
"Prefab": "res://prefab/prop/BuffActivity.tscn",
"Prefab": "res://prefab/prop/BuffProp.tscn",
"Icon": "res://resource/sprite/prop/buff/BuffProp0014.png",
"ShowInMapEditor": true
},

View File

@ -1 +1 @@
[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":false,"WaveList":[[{"Position":{"X":39,"Y":8},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-16,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":6},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0009","Weight":100,"Attr":{"CurrAmmon":"1","ResidueAmmo":"25"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0010","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":47,"Y":-32},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0008","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":23,"Y":37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0010","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0005","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":24,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":40,"Y":-10},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":-37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-2,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":29,"Y":63},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0013","Weight":100,"Attr":{"CurrAmmon":"50","ResidueAmmo":"250"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-30,"Y":39},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-19,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":48,"Y":29},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":20,"Y":94},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0014","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-14,"Y":97},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0011","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":9,"Y":-7},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0011","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-41,"Y":61},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0016","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":73,"Y":-19},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-72,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]}]]}]
[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":false,"WaveList":[[{"Position":{"X":39,"Y":8},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-16,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":6},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0009","Weight":100,"Attr":{"CurrAmmon":"1","ResidueAmmo":"25"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0010","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":47,"Y":-32},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0008","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":23,"Y":37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0010","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0005","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":24,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":40,"Y":-10},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":-37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-2,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":29,"Y":63},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0013","Weight":100,"Attr":{"CurrAmmon":"50","ResidueAmmo":"250"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-30,"Y":39},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-19,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":48,"Y":29},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":20,"Y":94},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0014","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-14,"Y":97},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0011","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":9,"Y":-7},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0011","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-41,"Y":61},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0016","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":73,"Y":-19},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-72,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-67,"Y":50},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-91,"Y":46},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-92,"Y":74},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]}]]}]

View File

@ -8,13 +8,31 @@ namespace Config;
public static partial class ExcelConfig
{
/// <summary>
/// ActivityBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<ActivityBase> ActivityBase_List { get; private set; }
public static List<BuffPropBase> BuffPropBase_List { get; private set; }
/// <summary>
/// ActivityBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, ActivityBase> ActivityBase_Map { get; private set; }
public static Dictionary<string, BuffPropBase> BuffPropBase_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; }
/// <summary>
/// ActivityMaterial.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
@ -34,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>
@ -52,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>
@ -61,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>
@ -70,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>
@ -98,74 +107,22 @@ public static partial class ExcelConfig
if (_init) return;
_init = true;
_InitActivityBaseConfig();
_InitActivityMaterialConfig();
_InitAiAttackAttrConfig();
_InitBuffPropBaseConfig();
_InitBulletBaseConfig();
_InitEnemyBaseConfig();
_InitLiquidMaterialConfig();
_InitSoundConfig();
_InitWeaponBaseConfig();
_InitActivityMaterialConfig();
_InitAiAttackAttrConfig();
_InitBulletBaseConfig();
_InitActivePropBaseConfig();
_InitEnemyBaseConfig();
_InitActivityBaseConfig();
_InitLiquidMaterialConfig();
_InitActivityBaseRef();
_InitBuffPropBaseRef();
_InitEnemyBaseRef();
_InitWeaponBaseRef();
}
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()
{
@ -185,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
@ -275,26 +178,133 @@ public static partial class ExcelConfig
throw new Exception("初始化表'WeaponBase'失败!");
}
}
private static void _InitActivityBaseRef()
private static void _InitActivityMaterialConfig()
{
foreach (Ref_ActivityBase item in ActivityBase_List)
try
{
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)
{
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);
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'失败!");
}
}
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)
@ -314,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)
@ -401,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);

View File

@ -0,0 +1,69 @@
using System.Text.Json.Serialization;
using System.Collections.Generic;
namespace Config;
public static partial class ExcelConfig
{
public class ActivePropBase
{
/// <summary>
/// Buff Id
/// </summary>
[JsonInclude]
public string Id;
/// <summary>
/// 备注
/// </summary>
[JsonInclude]
public string Remark;
/// <summary>
/// 属性绑定Buff实体的Id这个id时ActivityBase表Id
/// </summary>
public ActivityBase Activity;
/// <summary>
/// 被动Buff效果 <br/>
/// 也就是当前buff道具所有挂载的被动属性集合, 具体属性名称请参阅buff属性表 <br/>
/// key为buff属性名称 <br/>
/// value为buff初始化参数
/// </summary>
[JsonInclude]
public Dictionary<string, float[]> Buff;
/// <summary>
/// 使用完成后是否自动销毁
/// </summary>
[JsonInclude]
public bool AutoDestroy;
/// <summary>
/// 最大叠加次数
/// </summary>
[JsonInclude]
public uint MaxCount;
/// <summary>
/// 返回浅拷贝出的新对象
/// </summary>
public ActivePropBase Clone()
{
var inst = new ActivePropBase();
inst.Id = Id;
inst.Remark = Remark;
inst.Activity = Activity;
inst.Buff = Buff;
inst.AutoDestroy = AutoDestroy;
inst.MaxCount = MaxCount;
return inst;
}
}
private class Ref_ActivePropBase : ActivePropBase
{
[JsonInclude]
public string __Activity;
}
}

View File

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -75,6 +76,11 @@ public partial class World : CanvasModulate, ICoroutine
/// 随机对象池
/// </summary>
public RandomPool RandomPool { get; private set; }
/// <summary>
/// 角色死亡事件
/// </summary>
public event Action<Role> OnRoleDieEvent;
private bool _pause = false;
private List<CoroutineData> _coroutineList;
@ -166,4 +172,15 @@ public partial class World : CanvasModulate, ICoroutine
Random = random;
RandomPool = new RandomPool(this);
}
/// <summary>
/// 角色死亡
/// </summary>
public void OnRoleDie(Role role)
{
if (OnRoleDieEvent != null)
{
OnRoleDieEvent(role);
}
}
}

View File

@ -1,4 +1,5 @@

using System;
using System.Collections;
using System.Collections.Generic;
using Config;
@ -9,6 +10,13 @@ using Godot;
/// </summary>
public abstract partial class Role : ActivityObject
{
/// <summary>
/// 当前角色对其他角色造成伤害时对回调
/// 参数1为目标角色
/// 参数2为造成对伤害值
/// </summary>
public event Action<Role, int> OnDamageEvent;
/// <summary>
/// 是否是 Ai
/// </summary>
@ -839,7 +847,16 @@ public abstract partial class Role : ActivityObject
// GameApplication.Instance.Node3D.GetRoot().AddChild(blood);
}
OnHit(target, damage, angle, !flag);
if (target is Role targetRole && !targetRole.IsDestroyed)
{
//造成伤害回调
if (targetRole.OnDamageEvent != null)
{
targetRole.OnDamageEvent(this, damage);
}
}
//受伤特效
PlayHitAnimation();
@ -851,6 +868,8 @@ public abstract partial class Role : ActivityObject
{
IsDie = true;
OnDie();
//死亡事件
World.OnRoleDie(this);
}
}
}