重命名buff表

This commit is contained in:
小李xl 2024-03-15 21:17:01 +08:00
parent 9c88de3834
commit ec64cb6d7c
6 changed files with 56 additions and 77 deletions

Binary file not shown.

View File

@ -3,7 +3,6 @@
"Id": "0001",
"Remark": "\u978B\u5B50",
"__Activity": "prop0001",
"IsActivity": false,
"Buff": {
"MoveSpeed": [
30
@ -14,7 +13,6 @@
"Id": "0002",
"Remark": "\u5FC3\u4E4B\u5BB9\u5668",
"__Activity": "prop0002",
"IsActivity": false,
"Buff": {
"MaxHp": [
2
@ -25,7 +23,6 @@
"Id": "0003",
"Remark": "\u62A4\u76FE",
"__Activity": "prop0003",
"IsActivity": false,
"Buff": {
"MaxShield": [
1
@ -36,7 +33,6 @@
"Id": "0004",
"Remark": "\u62A4\u76FE\u8BA1\u65F6\u5668",
"__Activity": "prop0004",
"IsActivity": false,
"Buff": {
"ShieldRecoveryTime": [
2.5
@ -47,7 +43,6 @@
"Id": "0005",
"Remark": "\u6740\u4F24\u5F39",
"__Activity": "prop0005",
"IsActivity": false,
"Buff": {
"Damage": [
2,
@ -59,7 +54,6 @@
"Id": "0006",
"Remark": "\u7EA2\u5B9D\u77F3\u6212\u6307",
"__Activity": "prop0006",
"IsActivity": false,
"Buff": {
"WoundedInvincibleTime": [
2
@ -70,7 +64,6 @@
"Id": "0007",
"Remark": "\u5907\u7528\u62A4\u76FE",
"__Activity": "prop0007",
"IsActivity": false,
"Buff": {
"OffsetInjury": [
0.15
@ -81,7 +74,6 @@
"Id": "0008",
"Remark": "\u773C\u955C",
"__Activity": "prop0008",
"IsActivity": false,
"Buff": {
"Scattering": [
0.5
@ -92,7 +84,6 @@
"Id": "0009",
"Remark": "\u9AD8\u901F\u5B50\u5F39",
"__Activity": "prop0009",
"IsActivity": false,
"Buff": {
"BulletSpeed": [
2,
@ -108,7 +99,6 @@
"Id": "0010",
"Remark": "\u5206\u88C2\u5B50\u5F39",
"__Activity": "prop0010",
"IsActivity": false,
"Buff": {
"BulletCount": [
2,
@ -136,7 +126,6 @@
"Id": "0011",
"Remark": "\u5F39\u5C04\u5B50\u5F39",
"__Activity": "prop0011",
"IsActivity": false,
"Buff": {
"BulletBounceCount": [
2
@ -147,7 +136,6 @@
"Id": "0012",
"Remark": "\u7A7F\u900F\u5B50\u5F39",
"__Activity": "prop0012",
"IsActivity": false,
"Buff": {
"BulletPenetration": [
1
@ -158,7 +146,6 @@
"Id": "0013",
"Remark": "\u6B66\u5668\u80CC\u5305",
"__Activity": "prop0013",
"IsActivity": false,
"Buff": {
"WeaponCapacity": [
1
@ -169,7 +156,6 @@
"Id": "0014",
"Remark": "\u9053\u5177\u80CC\u5305",
"__Activity": "prop0014",
"IsActivity": false,
"Buff": {
"ActivePropsCapacity": [
1

View File

@ -34,6 +34,15 @@ 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,15 +70,6 @@ public static partial class ExcelConfig
/// </summary>
public static Dictionary<string, LiquidMaterial> LiquidMaterial_Map { get; private set; }
/// <summary>
/// PropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
public static List<PropBase> PropBase_List { get; private set; }
/// <summary>
/// PropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
/// </summary>
public static Dictionary<string, PropBase> PropBase_Map { get; private set; }
/// <summary>
/// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
/// </summary>
@ -101,16 +101,16 @@ public static partial class ExcelConfig
_InitActivityBaseConfig();
_InitActivityMaterialConfig();
_InitAiAttackAttrConfig();
_InitBuffPropBaseConfig();
_InitBulletBaseConfig();
_InitEnemyBaseConfig();
_InitLiquidMaterialConfig();
_InitPropBaseConfig();
_InitSoundConfig();
_InitWeaponBaseConfig();
_InitActivityBaseRef();
_InitBuffPropBaseRef();
_InitEnemyBaseRef();
_InitPropBaseRef();
_InitWeaponBaseRef();
}
private static void _InitActivityBaseConfig()
@ -167,6 +167,24 @@ public static partial class ExcelConfig
throw new Exception("初始化表'AiAttackAttr'失败!");
}
}
private static void _InitBuffPropBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/BuffPropBase.json");
BuffPropBase_List = new List<BuffPropBase>(JsonSerializer.Deserialize<List<Ref_BuffPropBase>>(text));
BuffPropBase_Map = new Dictionary<string, BuffPropBase>();
foreach (var item in BuffPropBase_List)
{
BuffPropBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'BuffPropBase'失败!");
}
}
private static void _InitBulletBaseConfig()
{
try
@ -221,24 +239,6 @@ public static partial class ExcelConfig
throw new Exception("初始化表'LiquidMaterial'失败!");
}
}
private static void _InitPropBaseConfig()
{
try
{
var text = _ReadConfigAsText("res://resource/config/PropBase.json");
PropBase_List = new List<PropBase>(JsonSerializer.Deserialize<List<Ref_PropBase>>(text));
PropBase_Map = new Dictionary<string, PropBase>();
foreach (var item in PropBase_List)
{
PropBase_Map.Add(item.Id, item);
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化表'PropBase'失败!");
}
}
private static void _InitSoundConfig()
{
try
@ -295,6 +295,25 @@ public static partial class ExcelConfig
}
}
}
private static void _InitBuffPropBaseRef()
{
foreach (Ref_BuffPropBase item in BuffPropBase_List)
{
try
{
if (!string.IsNullOrEmpty(item.__Activity))
{
item.Activity = ActivityBase_Map[item.__Activity];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'BuffPropBase'引用其他表数据失败, 当前行id: " + item.Id);
}
}
}
private static void _InitEnemyBaseRef()
{
foreach (Ref_EnemyBase item in EnemyBase_List)
@ -314,25 +333,6 @@ public static partial class ExcelConfig
}
}
}
private static void _InitPropBaseRef()
{
foreach (Ref_PropBase item in PropBase_List)
{
try
{
if (!string.IsNullOrEmpty(item.__Activity))
{
item.Activity = ActivityBase_Map[item.__Activity];
}
}
catch (Exception e)
{
GD.PrintErr(e.ToString());
throw new Exception("初始化'PropBase'引用其他表数据失败, 当前行id: " + item.Id);
}
}
}
private static void _InitWeaponBaseRef()
{
foreach (Ref_WeaponBase item in WeaponBase_List)

View File

@ -5,7 +5,7 @@ namespace Config;
public static partial class ExcelConfig
{
public class PropBase
public class BuffPropBase
{
/// <summary>
/// Buff Id
@ -24,12 +24,6 @@ public static partial class ExcelConfig
/// </summary>
public ActivityBase Activity;
/// <summary>
/// 是否是主动道具, 默认false
/// </summary>
[JsonInclude]
public bool IsActivity;
/// <summary>
/// 被动Buff效果 <br/>
/// 也就是当前buff道具所有挂载的被动属性集合, 具体属性名称请参阅buff属性表 <br/>
@ -42,18 +36,17 @@ public static partial class ExcelConfig
/// <summary>
/// 返回浅拷贝出的新对象
/// </summary>
public PropBase Clone()
public BuffPropBase Clone()
{
var inst = new PropBase();
var inst = new BuffPropBase();
inst.Id = Id;
inst.Remark = Remark;
inst.Activity = Activity;
inst.IsActivity = IsActivity;
inst.Buff = Buff;
return inst;
}
}
private class Ref_PropBase : PropBase
private class Ref_BuffPropBase : BuffPropBase
{
[JsonInclude]
public string __Activity;

View File

@ -175,8 +175,8 @@ public partial class BuffActivity : PropActivity
private static bool _init = false;
private static Dictionary<string, ExcelConfig.PropBase> _buffAttributeMap =
new Dictionary<string, ExcelConfig.PropBase>();
private static Dictionary<string, ExcelConfig.BuffPropBase> _buffAttributeMap =
new Dictionary<string, ExcelConfig.BuffPropBase>();
/// <summary>
/// 初始化 buff 属性数据
@ -189,7 +189,7 @@ public partial class BuffActivity : PropActivity
}
_init = true;
foreach (var buffAttr in ExcelConfig.PropBase_List)
foreach (var buffAttr in ExcelConfig.BuffPropBase_List)
{
if (buffAttr.Activity != null)
{
@ -204,7 +204,7 @@ public partial class BuffActivity : PropActivity
/// <summary>
/// 根据 ActivityBase.Id 获取对应 buff 的属性数据
/// </summary>
public static ExcelConfig.PropBase GetBuffAttribute(string itemId)
public static ExcelConfig.BuffPropBase GetBuffAttribute(string itemId)
{
if (itemId == null)
{