diff --git a/DungeonShooting_Godot/excel/ActivityBase.xlsx b/DungeonShooting_Godot/excel/ActivityBase.xlsx index 4aca08f..7915919 100644 --- a/DungeonShooting_Godot/excel/ActivityBase.xlsx +++ b/DungeonShooting_Godot/excel/ActivityBase.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/BuffBase.xlsx b/DungeonShooting_Godot/excel/BuffBase.xlsx index 6ec3209..61042ea 100644 --- a/DungeonShooting_Godot/excel/BuffBase.xlsx +++ b/DungeonShooting_Godot/excel/BuffBase.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excelTool/ExcelGenerator.cs b/DungeonShooting_Godot/excelTool/ExcelGenerator.cs index 8a60a7c..baa592d 100644 --- a/DungeonShooting_Godot/excelTool/ExcelGenerator.cs +++ b/DungeonShooting_Godot/excelTool/ExcelGenerator.cs @@ -20,6 +20,7 @@ public string TypeStr; public string TypeName; public CollectionsType CollectionsType; + public bool AutoParentheses = false; public bool IsRefExcel; public string RefTypeStr; @@ -392,7 +393,15 @@ MappingData mappingData; try { + var autoParentheses = false; + if (typeString.EndsWith('*')) + { + autoParentheses = true; + typeString = typeString.TrimEnd('*'); + } + mappingData = ConvertToType(typeString.Replace(" ", "")); + mappingData.AutoParentheses = autoParentheses; } catch (Exception e) { @@ -545,6 +554,17 @@ } else { + if (mappingData.AutoParentheses) + { + if (mappingData.CollectionsType == CollectionsType.Array) + { + cellStringValue = "[" + cellStringValue.TrimEnd(',') + "]"; + } + if (mappingData.CollectionsType == CollectionsType.Map) + { + cellStringValue = "{" + cellStringValue.TrimEnd(',') + "}"; + } + } data.Add(field, JsonSerializer.Deserialize(cellStringValue, excelData.ColumnType[fieldName])); } } diff --git a/DungeonShooting_Godot/excelTool/version b/DungeonShooting_Godot/excelTool/version index 7813681..62f9457 100644 --- a/DungeonShooting_Godot/excelTool/version +++ b/DungeonShooting_Godot/excelTool/version @@ -1 +1 @@ -5 \ No newline at end of file +6 \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/config/ActivityBase.json b/DungeonShooting_Godot/resource/config/ActivityBase.json index 7fb29f0..5c54b5a 100644 --- a/DungeonShooting_Godot/resource/config/ActivityBase.json +++ b/DungeonShooting_Godot/resource/config/ActivityBase.json @@ -583,7 +583,7 @@ "Details": "", "IsStatic": false, "__Material": "", - "Prefab": "res://prefab/prop/buff/BuffProp0010.tscn", + "Prefab": "res://prefab/prop/BuffActivity.tscn", "Icon": "res://resource/sprite/prop/buff/BuffProp0010.png", "ShowInMapEditor": true }, diff --git a/DungeonShooting_Godot/resource/config/BuffBase.json b/DungeonShooting_Godot/resource/config/BuffBase.json index f0b8938..ef68898 100644 --- a/DungeonShooting_Godot/resource/config/BuffBase.json +++ b/DungeonShooting_Godot/resource/config/BuffBase.json @@ -31,6 +31,10 @@ "BulletRepel": [ 2, -0.35 + ], + "RandomBulletSpeed": [ + -0.05, + 0.05 ] } } diff --git a/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletCount.cs b/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletCount.cs index 3e3174c..71b3cfd 100644 --- a/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletCount.cs +++ b/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletCount.cs @@ -1,7 +1,10 @@ using Godot; -[Buff("BulletCount", "子弹数量 buff, 参数‘1’为子弹数量添加类型, 1: 具体数量, 2:百分比(小数), 参数‘2’为增加子弹的数量")] +[Buff("BulletCount", + "子弹数量 buff, " + + "参数‘1’为子弹数量添加类型, 1: 具体数量, 2:百分比(小数), " + + "参数‘2’为增加子弹的数量")] public class Buff_BulletCount : BuffFragment { private int _type; @@ -9,8 +12,8 @@ public override void InitParam(float arg1, float arg2) { - _type = (int)arg2; - _value = (int)arg1; + _type = (int)arg1; + _value = (int)arg2; } public override void OnPickUpItem() diff --git a/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletDeviationAngle.cs b/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletDeviationAngle.cs index cf53c3c..2a7ecf8 100644 --- a/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletDeviationAngle.cs +++ b/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletDeviationAngle.cs @@ -1,5 +1,8 @@ -[Buff("BulletDeviationAngle", "偏移角度 buff, 参数‘1’为增加子弹偏移角度下限, 参数‘2’为增加子弹偏移角度上限, 单位角度制, 会从上限和下限随机抽取值")] +[Buff("BulletDeviationAngle", + "子弹偏移角度 buff, " + + "参数‘1’为增加子弹偏移角度下限, " + + "参数‘2’为增加子弹偏移角度上限, 单位角度制, 会从上限和下限随机抽取值")] public class Buff_BulletDeviationAngle : BuffFragment { private float _min; diff --git a/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletRepel.cs b/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletRepel.cs index ec73c52..82ca434 100644 --- a/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletRepel.cs +++ b/DungeonShooting_Godot/src/game/buff/fragment/Buff_BulletRepel.cs @@ -1,7 +1,10 @@ using Godot; -[Buff("BulletRepel", "子弹击退 buff, 参数‘1’为击退增加类型: 1:具体击退值, 2:百分比击退值(小数), 参数‘2’为子弹增加的击退值")] +[Buff("BulletRepel", + "子弹击退 buff, " + + "参数‘1’为击退增加类型: 1:具体击退值, " + + "2:百分比击退值(小数), 参数‘2’为子弹增加的击退值")] public class Buff_BulletRepel : BuffFragment { private int _type; diff --git a/DungeonShooting_Godot/src/game/buff/fragment/Buff_RandomBulletSpeed.cs b/DungeonShooting_Godot/src/game/buff/fragment/Buff_RandomBulletSpeed.cs new file mode 100644 index 0000000..d70518d --- /dev/null +++ b/DungeonShooting_Godot/src/game/buff/fragment/Buff_RandomBulletSpeed.cs @@ -0,0 +1,31 @@ + +[Buff("RandomBulletSpeed", + "子弹增加随机速度 buff, " + + "参数‘1’为增加子弹速度下限, " + + "参数‘2’为增加子弹速度上限, 会从上限和下限随机抽取值")] +public class Buff_RandomBulletSpeed : BuffFragment +{ + private float _min; + private float _max; + + public override void InitParam(float arg1, float arg2) + { + _min = arg1; + _max = arg2; + } + + public override void OnPickUpItem() + { + Role.RoleState.CalcBulletSpeedEvent += CalcBulletSpeedEvent; + } + + public override void OnRemoveItem() + { + Role.RoleState.CalcBulletSpeedEvent -= CalcBulletSpeedEvent; + } + + private void CalcBulletSpeedEvent(float originSpeed, RefValue speed) + { + speed.Value += originSpeed * Utils.Random.RandomRangeFloat(_min, _max); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/BuffRegister.cs b/DungeonShooting_Godot/src/game/manager/BuffRegister.cs index 2180ab3..22bfa72 100644 --- a/DungeonShooting_Godot/src/game/manager/BuffRegister.cs +++ b/DungeonShooting_Godot/src/game/manager/BuffRegister.cs @@ -28,6 +28,7 @@ BuffInfos.Add("MaxShield", new BuffInfo("MaxShield", null, new List() { 1 }, typeof(Buff_MaxShield))); BuffInfos.Add("MoveSpeed", new BuffInfo("MoveSpeed", null, new List() { 1 }, typeof(Buff_MoveSpeed))); BuffInfos.Add("OffsetInjury", new BuffInfo("OffsetInjury", null, new List() { 1 }, typeof(Buff_OffsetInjury))); + BuffInfos.Add("RandomBulletSpeed", new BuffInfo("RandomBulletSpeed", null, new List() { 2 }, typeof(Buff_RandomBulletSpeed))); BuffInfos.Add("Scattering", new BuffInfo("Scattering", null, new List() { 1 }, typeof(Buff_Scattering))); BuffInfos.Add("ShieldRecoveryTime", new BuffInfo("ShieldRecoveryTime", null, new List() { 1 }, typeof(Buff_ShieldRecoveryTime))); BuffInfos.Add("WeaponCapacity", new BuffInfo("WeaponCapacity", null, new List() { 1 }, typeof(Buff_WeaponCapacity)));