Phase2.1 添加武器tag配置和数据表定义
This commit is contained in:
@@ -18,9 +18,7 @@ public sealed partial class GoodsConfig : Luban.BeanBase
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
GoodsType = (GoodsType)_buf.ReadInt();
|
||||
PropId = _buf.ReadInt();
|
||||
PropId_Ref = null;
|
||||
WeaponType = (WeaponType)_buf.ReadInt();
|
||||
RefId = _buf.ReadInt();
|
||||
}
|
||||
|
||||
public static GoodsConfig DeserializeGoodsConfig(ByteBuf _buf)
|
||||
@@ -37,14 +35,9 @@ public sealed partial class GoodsConfig : Luban.BeanBase
|
||||
/// </summary>
|
||||
public readonly GoodsType GoodsType;
|
||||
/// <summary>
|
||||
/// 道具商品Id
|
||||
/// 引用Id
|
||||
/// </summary>
|
||||
public readonly int PropId;
|
||||
public PropConfig PropId_Ref;
|
||||
/// <summary>
|
||||
/// 武器商品类型
|
||||
/// </summary>
|
||||
public readonly WeaponType WeaponType;
|
||||
public readonly int RefId;
|
||||
|
||||
public const int __ID__ = 1358452248;
|
||||
public override int GetTypeId() => __ID__;
|
||||
@@ -53,7 +46,6 @@ public sealed partial class GoodsConfig : Luban.BeanBase
|
||||
{
|
||||
|
||||
|
||||
PropId_Ref = tables.TbPropConfig.GetOrDefault(PropId);
|
||||
|
||||
}
|
||||
|
||||
@@ -62,8 +54,7 @@ public sealed partial class GoodsConfig : Luban.BeanBase
|
||||
return "{ "
|
||||
+ "id:" + Id + ","
|
||||
+ "goodsType:" + GoodsType + ","
|
||||
+ "propId:" + PropId + ","
|
||||
+ "weaponType:" + WeaponType + ","
|
||||
+ "refId:" + RefId + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ public sealed partial class LevelDropConfig : Luban.BeanBase
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
WhiteWeight = _buf.ReadFloat();
|
||||
GreenWeight = _buf.ReadFloat();
|
||||
BlueWeight = _buf.ReadFloat();
|
||||
PurpleWeight = _buf.ReadFloat();
|
||||
RedWeight = _buf.ReadFloat();
|
||||
@@ -38,10 +37,6 @@ public sealed partial class LevelDropConfig : Luban.BeanBase
|
||||
/// </summary>
|
||||
public readonly float WhiteWeight;
|
||||
/// <summary>
|
||||
/// 绿色掉落率
|
||||
/// </summary>
|
||||
public readonly float GreenWeight;
|
||||
/// <summary>
|
||||
/// 蓝色掉落率
|
||||
/// </summary>
|
||||
public readonly float BlueWeight;
|
||||
@@ -64,7 +59,6 @@ public sealed partial class LevelDropConfig : Luban.BeanBase
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
@@ -72,7 +66,6 @@ public sealed partial class LevelDropConfig : Luban.BeanBase
|
||||
return "{ "
|
||||
+ "Id:" + Id + ","
|
||||
+ "WhiteWeight:" + WhiteWeight + ","
|
||||
+ "GreenWeight:" + GreenWeight + ","
|
||||
+ "BlueWeight:" + BlueWeight + ","
|
||||
+ "PurpleWeight:" + PurpleWeight + ","
|
||||
+ "RedWeight:" + RedWeight + ","
|
||||
|
||||
@@ -25,21 +25,17 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
White = 1,
|
||||
/// <summary>
|
||||
/// 绿
|
||||
/// </summary>
|
||||
Green = 2,
|
||||
/// <summary>
|
||||
/// 蓝
|
||||
/// </summary>
|
||||
Blue = 3,
|
||||
Blue = 2,
|
||||
/// <summary>
|
||||
/// 紫
|
||||
/// </summary>
|
||||
Purple = 4,
|
||||
Purple = 3,
|
||||
/// <summary>
|
||||
/// 红
|
||||
/// </summary>
|
||||
Red = 5,
|
||||
Red = 4,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public partial class Tables
|
||||
/// 角色属性配置
|
||||
/// </summary>
|
||||
public TbStatConfig TbStatConfig {get; }
|
||||
public TbWeaponTagConfig TbWeaponTagConfig {get; }
|
||||
|
||||
public Tables(System.Func<string, ByteBuf> loader)
|
||||
{
|
||||
@@ -87,6 +88,7 @@ public partial class Tables
|
||||
TbUISoundConfig = new TbUISoundConfig(loader("tbuisoundconfig"));
|
||||
TbWeaponConfig = new TbWeaponConfig(loader("tbweaponconfig"));
|
||||
TbStatConfig = new TbStatConfig(loader("tbstatconfig"));
|
||||
TbWeaponTagConfig = new TbWeaponTagConfig(loader("tbweapontagconfig"));
|
||||
ResolveRef();
|
||||
}
|
||||
|
||||
@@ -111,6 +113,7 @@ public partial class Tables
|
||||
TbUISoundConfig.ResolveRef(this);
|
||||
TbWeaponConfig.ResolveRef(this);
|
||||
TbStatConfig.ResolveRef(this);
|
||||
TbWeaponTagConfig.ResolveRef(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
public partial class TbWeaponConfig
|
||||
{
|
||||
private readonly System.Collections.Generic.Dictionary<WeaponType, WeaponConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.Dictionary<int, WeaponConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.List<WeaponConfig> _dataList;
|
||||
|
||||
public TbWeaponConfig(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new System.Collections.Generic.Dictionary<WeaponType, WeaponConfig>();
|
||||
_dataMap = new System.Collections.Generic.Dictionary<int, WeaponConfig>();
|
||||
_dataList = new System.Collections.Generic.List<WeaponConfig>();
|
||||
|
||||
for(int n = _buf.ReadSize() ; n > 0 ; --n)
|
||||
@@ -30,16 +30,16 @@ public partial class TbWeaponConfig
|
||||
WeaponConfig _v;
|
||||
_v = WeaponConfig.DeserializeWeaponConfig(_buf);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.WeaponType, _v);
|
||||
_dataMap.Add(_v.Id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<WeaponType, WeaponConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.Dictionary<int, WeaponConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.List<WeaponConfig> DataList => _dataList;
|
||||
|
||||
public WeaponConfig GetOrDefault(WeaponType key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public WeaponConfig Get(WeaponType key) => _dataMap[key];
|
||||
public WeaponConfig this[WeaponType key] => _dataMap[key];
|
||||
public WeaponConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public WeaponConfig Get(int key) => _dataMap[key];
|
||||
public WeaponConfig this[int key] => _dataMap[key];
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using Luban;
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public partial class TbWeaponTagConfig
|
||||
{
|
||||
private readonly System.Collections.Generic.Dictionary<int, WeaponTagConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.List<WeaponTagConfig> _dataList;
|
||||
|
||||
public TbWeaponTagConfig(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new System.Collections.Generic.Dictionary<int, WeaponTagConfig>();
|
||||
_dataList = new System.Collections.Generic.List<WeaponTagConfig>();
|
||||
|
||||
for(int n = _buf.ReadSize() ; n > 0 ; --n)
|
||||
{
|
||||
WeaponTagConfig _v;
|
||||
_v = WeaponTagConfig.DeserializeWeaponTagConfig(_buf);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.Id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<int, WeaponTagConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.List<WeaponTagConfig> DataList => _dataList;
|
||||
|
||||
public WeaponTagConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public WeaponTagConfig Get(int key) => _dataMap[key];
|
||||
public WeaponTagConfig this[int key] => _dataMap[key];
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
foreach(var _v in _dataList)
|
||||
{
|
||||
_v.ResolveRef(tables);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2628c2be656a6c348a98ca6e01db6dde
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,8 +16,13 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
{
|
||||
public WeaponConfig(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
WeaponType = (WeaponType)_buf.ReadInt();
|
||||
WeaponName = _buf.ReadString();
|
||||
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Tags = new System.Collections.Generic.List<WeaponTag>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { WeaponTag _e0; _e0 = (WeaponTag)_buf.ReadInt(); Tags.Add(_e0);}}
|
||||
LogicType = _buf.ReadString();
|
||||
ScalingStat = (StatType)_buf.ReadInt();
|
||||
ScalingRatio = _buf.ReadFloat();
|
||||
Rarity = (Rarity)_buf.ReadInt();
|
||||
Price = _buf.ReadInt();
|
||||
Attack = _buf.ReadInt();
|
||||
@@ -38,15 +43,35 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
return new WeaponConfig(_buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 武器编号
|
||||
/// </summary>
|
||||
public readonly int Id;
|
||||
/// <summary>
|
||||
/// 武器类型
|
||||
/// </summary>
|
||||
public readonly WeaponType WeaponType;
|
||||
/// <summary>
|
||||
/// 武器名
|
||||
/// </summary>
|
||||
public readonly string WeaponName;
|
||||
/// <summary>
|
||||
/// 武器标签列表
|
||||
/// </summary>
|
||||
public readonly System.Collections.Generic.List<WeaponTag> Tags;
|
||||
/// <summary>
|
||||
/// 逻辑类型
|
||||
/// </summary>
|
||||
public readonly string LogicType;
|
||||
/// <summary>
|
||||
/// 加成主属性
|
||||
/// </summary>
|
||||
public readonly StatType ScalingStat;
|
||||
/// <summary>
|
||||
/// 主属性加成系数
|
||||
/// </summary>
|
||||
public readonly float ScalingRatio;
|
||||
/// <summary>
|
||||
/// 道具品质
|
||||
/// </summary>
|
||||
public readonly Rarity Rarity;
|
||||
@@ -105,6 +130,11 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
foreach (var _e in StatModifierConfigs) { _e?.ResolveRef(tables); }
|
||||
Prefab_Ref = tables.TbEntityConfig.GetOrDefault(Prefab);
|
||||
Sprite_Ref = tables.TbSpriteConfig.GetOrDefault(Sprite);
|
||||
@@ -113,8 +143,13 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "id:" + Id + ","
|
||||
+ "weaponType:" + WeaponType + ","
|
||||
+ "weaponName:" + WeaponName + ","
|
||||
+ "tags:" + Luban.StringUtil.CollectionToString(Tags) + ","
|
||||
+ "logicType:" + LogicType + ","
|
||||
+ "scalingStat:" + ScalingStat + ","
|
||||
+ "scalingRatio:" + ScalingRatio + ","
|
||||
+ "rarity:" + Rarity + ","
|
||||
+ "price:" + Price + ","
|
||||
+ "attack:" + Attack + ","
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 武器tag
|
||||
/// </summary>
|
||||
public enum WeaponTag : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 无
|
||||
/// </summary>
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// 刀剑
|
||||
/// </summary>
|
||||
Blade = 1,
|
||||
/// <summary>
|
||||
/// 精准
|
||||
/// </summary>
|
||||
Precise = 2,
|
||||
/// <summary>
|
||||
/// 枪械
|
||||
/// </summary>
|
||||
Gun = 3,
|
||||
/// <summary>
|
||||
/// 工程
|
||||
/// </summary>
|
||||
Engineering = 4,
|
||||
/// <summary>
|
||||
/// 钝器
|
||||
/// </summary>
|
||||
Blunt = 5,
|
||||
/// <summary>
|
||||
/// 原始
|
||||
/// </summary>
|
||||
Primitive = 6,
|
||||
/// <summary>
|
||||
/// 元素
|
||||
/// </summary>
|
||||
Elemental = 7,
|
||||
/// <summary>
|
||||
/// 徒手
|
||||
/// </summary>
|
||||
Unarmed = 8,
|
||||
/// <summary>
|
||||
/// 医疗
|
||||
/// </summary>
|
||||
Medical = 9,
|
||||
/// <summary>
|
||||
/// 重型
|
||||
/// </summary>
|
||||
Heavy = 10,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67a3eb7a61baa114c936b306b55c6b7a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using Luban;
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class WeaponTagConfig : Luban.BeanBase
|
||||
{
|
||||
public WeaponTagConfig(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
Tag = (WeaponTag)_buf.ReadInt();
|
||||
RequiredCount = _buf.ReadInt();
|
||||
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);StatModifierConfigs = new System.Collections.Generic.List<StatModifierConfig>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { StatModifierConfig _e0; _e0 = StatModifierConfig.DeserializeStatModifierConfig(_buf); StatModifierConfigs.Add(_e0);}}
|
||||
}
|
||||
|
||||
public static WeaponTagConfig DeserializeWeaponTagConfig(ByteBuf _buf)
|
||||
{
|
||||
return new WeaponTagConfig(_buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 效果编号
|
||||
/// </summary>
|
||||
public readonly int Id;
|
||||
/// <summary>
|
||||
/// 标签
|
||||
/// </summary>
|
||||
public readonly WeaponTag Tag;
|
||||
/// <summary>
|
||||
/// 触发所需条件数
|
||||
/// </summary>
|
||||
public readonly int RequiredCount;
|
||||
public readonly System.Collections.Generic.List<StatModifierConfig> StatModifierConfigs;
|
||||
|
||||
public const int __ID__ = -1372305248;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
|
||||
|
||||
|
||||
foreach (var _e in StatModifierConfigs) { _e?.ResolveRef(tables); }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "id:" + Id + ","
|
||||
+ "tag:" + Tag + ","
|
||||
+ "requiredCount:" + RequiredCount + ","
|
||||
+ "statModifierConfigs:" + Luban.StringUtil.CollectionToString(StatModifierConfigs) + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be6aa68432437fb49ac08b59f65b8c6b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user