Browse Source

【优化】主播单位的初始战斗属性和技能等,调整为从配置表读取

johnclot69 1 year ago
parent
commit
5de0531e3d

BIN
Config/Excel/Character@s.xlsx


BIN
Config/Excel/CharacterConfig@s.xlsx


BIN
Config/GenFromExcel/s/CharacterCategory.bytes


+ 6 - 0
Config/GenFromExcel/s/CharacterConfigCategory.bytes

@@ -0,0 +1,6 @@
+
+)è‹�刃 ¾(0¸E8@�NH�NR5Z510200:1
+)御剑 ¾(0¸E8@�NH�NR5Z510200:1
+)剑仙 ¾(0¸E8@�NH�NR5Z510200:1
+)神箭 ¾(0¸E8@�NH�NR5Z510200:1
+)é�“ç�µ ¾(0¸E8@�NH�NR5Z510200:1

+ 0 - 8
Config/GenJson/s/Character.txt

@@ -1,8 +0,0 @@
-{"list":[
-{"_t":"Character","_id":1,"ProName":"苍刃","pro":1,"initLevel":1,"initCritRata":0,"CritDamage":15000,"Piercethrough":0,"baseHPRegen":0,"HealEffect":0,"HealedEffect":0,"baseAtkSpeed":10000,"baseMoveSpeed":10000,"model":"chr_nanzhanshi_01,chr_nvzhanshi_01","weaponmodel":"chr_nanzhanshi_wuqi_01,chr_nvzhanshi_wuqi_01","initFashion":"fclot1-1-0,fclot1-1-1","initEquip":"","initItem":"","initSkill":"110000:1|110100:1|110200:1|110300:1|110400:1|110500:1|110600:1|110601:1","count":"6","finalLevel":190,"inspeed":"4.45"},
-{"_t":"Character","_id":2,"ProName":"御剑","pro":2,"initLevel":1,"initCritRata":0,"CritDamage":15000,"Piercethrough":0,"baseHPRegen":0,"HealEffect":0,"HealedEffect":0,"baseAtkSpeed":10000,"baseMoveSpeed":10000,"model":"chr_Langzu_01","weaponmodel":"wp_langzu_01","initFashion":"chr_Langzu_01","initEquip":"","initItem":"","initSkill":"200010:1|200020:1|200030:1|200040:1|202020:1|200060:1|200050:1|201020:1|202040:1","count":"9","finalLevel":190,"inspeed":"4.4"},
-{"_t":"Character","_id":3,"ProName":"剑仙","pro":3,"initLevel":1,"initCritRata":0,"CritDamage":15000,"Piercethrough":0,"baseHPRegen":0,"HealEffect":0,"HealedEffect":0,"baseAtkSpeed":10000,"baseMoveSpeed":10000,"model":"chr_nanfashi_01,chr_nvfashi_01","weaponmodel":"chr_nanfashi_wuqi_01,chr_nvfashi_wuqi_01","initFashion":"fclot1-3-0,fclot1-3-1","initEquip":"","initItem":"","initSkill":"310000:1|310100:1|310200:1|310300:1|310400:1|310500:1|310600:1|310601:1","count":"6","finalLevel":190,"inspeed":"4.3"},
-{"_t":"Character","_id":4,"ProName":"神箭","pro":4,"initLevel":1,"initCritRata":0,"CritDamage":15000,"Piercethrough":0,"baseHPRegen":0,"HealEffect":0,"HealedEffect":0,"baseAtkSpeed":10000,"baseMoveSpeed":10000,"model":"chr_Langzu_01","weaponmodel":"wp_langzu_01","initFashion":"chr_Langzu_01","initEquip":"","initItem":"","initSkill":"400010:1|400020:1|400030:1|401030:1|400040:1|400060:1|400050:1|402060:1","count":"10","finalLevel":190,"inspeed":"4.4"},
-{"_t":"Character","_id":5,"ProName":"道灵","pro":5,"initLevel":1,"initCritRata":0,"CritDamage":15000,"Piercethrough":0,"baseHPRegen":0,"HealEffect":0,"HealedEffect":0,"baseAtkSpeed":10000,"baseMoveSpeed":10000,"model":"chr_nannaima_01,chr_nvnaima_01","weaponmodel":"chr_nannaima_wuqi_01,
-chr_nvnaima_wuqi_01","initFashion":"fclot1-5-0,fclot1-5-1","initEquip":"","initItem":"","initSkill":"510000:1|510100:1|510200:1|510300:1|510400:1|510500:1|510600:1|510601:1","count":"6","finalLevel":190,"inspeed":"4.35"},
-]}

+ 7 - 0
Config/GenJson/s/CharacterConfig.txt

@@ -0,0 +1,7 @@
+{"list":[
+{"_t":"CharacterConfig","_id":1,"ProName":"苍刃","Pro":1,"FinalLevel":190,"InitLevel":1,"InitMaxHP":8888,"InitAttack":20,"BaseAtkSpeed":10000,"BaseMoveSpeed":10000,"InitSpeed":"5","InitSkill":"510200:1"},
+{"_t":"CharacterConfig","_id":2,"ProName":"御剑","Pro":2,"FinalLevel":190,"InitLevel":1,"InitMaxHP":8888,"InitAttack":20,"BaseAtkSpeed":10000,"BaseMoveSpeed":10000,"InitSpeed":"5","InitSkill":"510200:1"},
+{"_t":"CharacterConfig","_id":3,"ProName":"剑仙","Pro":3,"FinalLevel":190,"InitLevel":1,"InitMaxHP":8888,"InitAttack":20,"BaseAtkSpeed":10000,"BaseMoveSpeed":10000,"InitSpeed":"5","InitSkill":"510200:1"},
+{"_t":"CharacterConfig","_id":4,"ProName":"神箭","Pro":4,"FinalLevel":190,"InitLevel":1,"InitMaxHP":8888,"InitAttack":20,"BaseAtkSpeed":10000,"BaseMoveSpeed":10000,"InitSpeed":"5","InitSkill":"510200:1"},
+{"_t":"CharacterConfig","_id":5,"ProName":"道灵","Pro":5,"FinalLevel":190,"InitLevel":1,"InitMaxHP":8888,"InitAttack":20,"BaseAtkSpeed":10000,"BaseMoveSpeed":10000,"InitSpeed":"5","InitSkill":"510200:1"},
+]}

+ 38 - 0
DotNet/Hotfix/Helper/AttributeHelper.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+
+namespace ET.Server
+{
+    /// <summary>
+    /// 玩家属性工具类
+    /// </summary>
+    public static class AttributeHelper
+    {
+        /// <summary>
+        /// 将两个属性集合合并到一个集合里面
+        /// </summary>
+        /// <param name="src"></param>
+        /// <param name="dest"></param>
+        public static void AddData2AllData(Dictionary<PlayerBtlData,int> src, Dictionary<PlayerBtlData,int> dest)
+        {
+            if (src is not { Count: > 0 })
+            {
+                Log.Warning($"AddData2AllData src == null");
+                return;
+            }
+
+            foreach (var keyValue in src)
+            {
+                try
+                {
+                    int value = (dest.TryGetValue(keyValue.Key, out int v)? dest[keyValue.Key] : 0) + keyValue.Value;
+                    dest[keyValue.Key] = value;
+                }
+                catch (Exception e)
+                {
+                    Log.Error($"AttributeHelper AddData2AllData: key={keyValue.Key}, e={e}");
+                }
+            }
+        }
+    }
+}

+ 3 - 1
DotNet/Hotfix/Helper/PlayerFactory.cs

@@ -16,7 +16,7 @@
             // 绑定sessionId
             player.GameSessionActorId = session.InstanceId;
             player.Session = session;
-            player.BasicProp = CharacterCategory.Instance.Get(playerInfo.Pro);
+            player.BasicProp = CharacterConfigCategory.Instance.Get(playerInfo.Pro);
             player.BornType = (int)BORN_TYPE.NORMAL;
             player.EnterState = (int)ENTER_STATE.online;
 
@@ -28,6 +28,8 @@
             await player.AddComponent<PlayerSkillComponent, WNPlayer>(player).Init();
             // 玩家货币组件
             await player.AddComponent<PlayerMoneyComponent, WNPlayer>(player).Init();
+            // 玩家属性组件
+            await player.AddComponent<PlayerBtlComponent, WNPlayer>(player).Init();
 
             return player;
         }

+ 1 - 1
DotNet/Hotfix/Scenes/EntryEvent2_InitServer.cs

@@ -4,7 +4,7 @@ using ET;
 
 namespace ET.Server
 {
-    [Event]
+    [Event(SceneType.Process)]
     public class EntryEvent2_InitServer: BEvent<ET.EventType.EntryEvent2>
     {
         protected override async ETTask OnEvent(ET.EventType.EntryEvent2 args)

+ 1 - 1
DotNet/Hotfix/Scenes/EntryLoadCfg_Server.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    [Event]
+    [Event(SceneType.Process)]
     public class EntryLoadCfg_Server : BEvent<ET.EventType.EntryLoadCfg>
     {
         protected override async ETTask OnEvent(EntryLoadCfg a)

+ 2 - 2
DotNet/Hotfix/Scenes/Game/Handler/C2G_CreatePlayerHandler.cs

@@ -57,7 +57,7 @@ namespace ET.Server
             // todo 服务器是否已达上限
 
             // 是否有配置
-            Character prop = CharacterCategory.Instance.Get(request.Pro);
+            CharacterConfig prop = CharacterConfigCategory.Instance.Get(request.Pro);
 
             if (prop == null)
             {
@@ -82,7 +82,7 @@ namespace ET.Server
                 playerInfo.Name = request.Name;
                 playerInfo.Sex = request.Sex;
                 playerInfo.Pro = request.Pro;
-                playerInfo.Level = prop.initLevel;
+                playerInfo.Level = prop.InitLevel;
                 playerInfo.Exp = 0;
 
                 await DBManagerComponent.Instance.GetZoneDB(session.DomainZone()).Save(playerInfo);

+ 3 - 1
DotNet/Hotfix/Scenes/Game/Map/MapSystem.cs

@@ -125,7 +125,9 @@ namespace ET.Server
 
             try
             {
-                self.GetZoneManager().playerEnterRequest(player.GetId().ToString().Trim(), self.Id.ToString().Trim(), player.ToJSON4EnterScene(self));
+                string enterData = player.ToJSON4EnterScene(self);
+                Log.Debug($"{player.GetName()}, enterSceneData:{enterData}");
+                self.GetZoneManager().playerEnterRequest(player.GetId().ToString().Trim(), self.Id.ToString().Trim(), enterData);
             }
             catch (Exception e)
             {

+ 103 - 0
DotNet/Hotfix/Scenes/Game/Player/PlayerBtlComponentSystem.cs

@@ -0,0 +1,103 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace ET.Server
+{
+    [FriendOf(typeof (PlayerBtlComponent))]
+    public static class PlayerBtlComponentSystem
+    {
+        public class PlayerBtlComponentAwakeSystem: AwakeSystem<PlayerBtlComponent, WNPlayer>
+        {
+            protected override void Awake(PlayerBtlComponent self, WNPlayer player)
+            {
+                Log.Info($"创建玩家属性组件...");
+                self.Player = player;
+                self.CharacterProp = player.BasicProp;
+                if (self.CharacterProp == null)
+                {
+                    Log.Warning($"PlayerBtlComponentSystem 玩家职业信息为空: playerId={player.GetId()}, 职业={player.GetPro()}");
+                }
+
+            }
+        }
+
+        public class PlayerBtlComponentDestroySystem: DestroySystem<PlayerBtlComponent>
+        {
+            protected override void Destroy(PlayerBtlComponent self)
+            {
+            }
+        }
+
+        /// <summary>
+        /// 初始化
+        /// </summary>
+        /// <param name="self"></param>
+        public static async ETTask Init(this PlayerBtlComponent self)
+        {
+            self.CalProLvlData();
+
+            self.CalFinalData();
+            await ETTask.CompletedTask;
+        }
+
+        /// <summary>
+        /// 计算角色的职业和等级带来的属性
+        /// </summary>
+        /// <param name="self"></param>
+        public static void CalProLvlData(this PlayerBtlComponent self)
+        {
+            self.Data_Pro_Lv.Clear();
+            // 角色初始属性
+            Dictionary<PlayerBtlData, int> iniProp = new Dictionary<PlayerBtlData, int>();
+            iniProp.TryAdd(PlayerBtlData.MaxHP, self.CharacterProp.InitMaxHP);
+            iniProp.TryAdd(PlayerBtlData.Attack, self.CharacterProp.InitAttack);
+            iniProp.TryAdd(PlayerBtlData.RunSpeed, self.CharacterProp.BaseMoveSpeed);
+            iniProp.TryAdd(PlayerBtlData.AttackSpeed, self.CharacterProp.BaseAtkSpeed);
+            AttributeHelper.AddData2AllData(iniProp, self.Data_Pro_Lv);
+        }
+
+        /// <summary>
+        /// 计算所有属性
+        /// </summary>
+        /// <param name="self"></param>
+        public static void CalFinalData(this PlayerBtlComponent self)
+        {
+            // 各模块带来的属性
+            self.CalModuleData();
+        }
+
+        /// <summary>
+        /// 各模块带来的属性
+        /// </summary>
+        /// <param name="self"></param>
+        public static void CalModuleData(this PlayerBtlComponent self)
+        {
+            self.AllInflus.Clear();
+            // 角色初始化属性
+            AttributeHelper.AddData2AllData(self.Data_Pro_Lv, self.AllInflus);
+        }
+
+        /// <summary>
+        /// 发送给场景服的人物数据(战斗属性)
+        /// </summary>
+        /// <returns></returns>
+        public static Dictionary<string, float> GetBattleServerEffects(this PlayerBtlComponent self)
+        {
+            Dictionary<string, float> data = new Dictionary<string, float>();
+            foreach (var keyValue in self.AllInflus.Where(keyValue => keyValue.Value > 0))
+            {
+                data.Add(keyValue.Key.ToString(), keyValue.Value);
+            }
+
+            // 移动速度
+            float runSpeed = data.TryGetValue(PlayerBtlData.RunSpeed.ToString(), out float value) ? value : 0;
+            float moveSpeed = self.CharacterProp._InitSpeed * (runSpeed / self.Tenthousand);
+            data.Add("MoveSpeed", moveSpeed);
+
+            return data;
+        }
+    }
+}

+ 14 - 10
DotNet/Hotfix/Scenes/Game/Player/PlayerSkillComponentSystem.cs

@@ -55,7 +55,7 @@ namespace ET.Server
             self.Data = new PlayerSkillInfo();
             self.Data.Skills = new List<Struct.PlayerSkillBaseData>();
 
-            Character config = CharacterCategory.Instance.Get(self.Player.GetPro());
+            CharacterConfig config = CharacterConfigCategory.Instance.Get(self.Player.GetPro());
             if (config != null && config.InitSkillList.Count > 0)
             {
                 foreach (Struct.IntIntData intIntData in config.InitSkillList.Where(intIntData => intIntData != null))
@@ -64,9 +64,9 @@ namespace ET.Server
                 }
             }
 
-            // self?.Save();
+            self.ToJson4BattleServerSkills = self.GetBattleServerSkills();
 
-            self.Player.ToJson4BattleServerSkillInfos = self.ToJson4BattleServer();
+            // self?.Save();
         }
 
         /// <summary>
@@ -108,6 +108,8 @@ namespace ET.Server
                 info.level = 1;
                 info.skillTime = 0L;
                 info.cdTime = 0;
+                info.flag = 0;
+                info.autoLaunch = false;
 
                 list.Add(info);
             }
@@ -120,18 +122,20 @@ namespace ET.Server
         /// </summary>
         /// <param name="self"></param>
         /// <returns></returns>
-        public static List<Struct.SkillInfo> ToJson4BattleServer(this PlayerSkillComponent self)
+        public static List<Struct.SkillInfo> GetBattleServerSkills(this PlayerSkillComponent self)
         {
             List<Struct.SkillInfo> skills = new List<Struct.SkillInfo>();
             foreach (Struct.PlayerSkillBaseData skill in self.Data.Skills.Where(skill => skill != null))
             {
-                if (skill.isUnlock())
+                if (!skill.unlock)
+                {
+                    continue;
+                }
+
+                SkillConfig prop = SkillConfigCategory.Instance.Get(skill.id);
+                if (prop != null && !SkillHelper.IsPassive(prop))
                 {
-                    SkillConfig prop = SkillConfigCategory.Instance.Get(skill.id);
-                    if (prop != null && !SkillHelper.IsPassive(prop))
-                    {
-                        skills.Add(SkillHelper.NewSkillInfo(skill));
-                    }
+                    skills.Add(SkillHelper.NewSkillInfo(skill));
                 }
             }
 

+ 29 - 52
DotNet/Hotfix/Scenes/Game/Player/PlayerSystem.cs

@@ -1,6 +1,9 @@
 using System.Collections.Generic;
 using System.Text.Json;
 using BattleIce;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using JsonSerializer = System.Text.Json.JsonSerializer;
 
 namespace ET.Server
 {
@@ -210,65 +213,40 @@ namespace ET.Server
             self.GetXmdsManager().autoBattle(self.Map.Id.ToString().Trim(), self.GetId().ToString().Trim(), true);
         }
 
+        public static Dictionary<string, object> GetBattlerServerBasic(this WNPlayer self)
+        {
+            Dictionary<string, object> data = new Dictionary<string, object>();
+            data.Add("name", self.GetName());
+            data.Add("alliesForce", 0);
+            data.Add("force", 1);
+            data.Add("pro", self.GetPro());
+            data.Add("serverId", ConstGame.GameServerId);
+            data.Add("titleId", 0);
+            data.Add("level", self.GetLevel());
+            data.Add("vip", 0);
+            data.Add("upLevel", 1);
+            // 无悬赏
+            data.Add("beReward", 0);
+            data.Add("logicServerId", ConstGame.GameServerId);
+            data.Add("sex", self.GetSex());
+            data.Add("uuid", self.GetId().ToString());
+            data.Add("potionAddition", 0);
+            return data;
+        }
+
         /** 场景中角色需求数据 **/
         public static string ToJSON4EnterScene(this WNPlayer self, Map map)
         {
             var json = new
             {
-                effects = new
-                {
-                    MaxHP = 8888,
-                    HPPer = 0.6,
-                    Attack = 20,
-                    AttackPer = 100,
-                    MoveSpeed = 5,
-                },
+                effects = self.GetComponent<PlayerBtlComponent>().GetBattleServerEffects(),
                 effectsExt = new { },
-                // skills = self.ToJson4BattleServerSkillInfos,
-                skills = new List<SkillInfo>()
-                {
-                    new SkillInfo
-                    {
-                        id = 510200,
-                        level = 1,
-                        type = 1,
-                        skillTime = 0,
-                        cdTime = 0,
-                        flag = 0,
-                        autoLaunch = false,
-                    },
-                    /*new SkillInfo
-                    {
-                        id = 90203,
-                        level = 1,
-                        type = 3,
-                        skillTime = 0,
-                        cdTime = 0,
-                        flag = 0
-                    },*/
-                },
+                skills = self.GetComponent<PlayerSkillComponent>().ToJson4BattleServerSkills,
                 tasks = new { },
                 flags = new { },
                 playerEntered = false,
                 avatars = new { },
-                basic = new
-                {
-                    name = self.GetName(),
-                    alliesForce = 0,
-                    force = 1,
-                    pro = self.GetPro(),
-                    serverId = ConstGame.GameServerId,
-                    titleId = 0,
-                    level = self.GetLevel(),
-                    vip = 0,
-                    upLevel = 1,
-                    // 无悬赏
-                    beReward = 0,
-                    logicServerId = ConstGame.GameServerId,
-                    sex = self.GetSex(),
-                    uuid = self.GetId().ToString(),
-                    potionAddition = 0
-                },
+                basic = self.GetBattlerServerBasic(),
                 connectServerId = "bs-" + ConstGame.GameServerId,
                 uid = self.GetId().ToString(),
                 unitTemplateID = 1,
@@ -288,9 +266,8 @@ namespace ET.Server
                 addTestPetData = 0,
                 sceneData = new { allowAutoGuard = 3, },
             };
-            string retjson = JsonSerializer.Serialize(json, new JsonSerializerOptions { IncludeFields = true });
-            Log.Debug($"{self.GetName()}, enterSceneData:{retjson.ToString()}");
-            return retjson;
+
+            return JsonSerializer.Serialize(json, new JsonSerializerOptions { IncludeFields = true });
         }
     }
 }

+ 1 - 1
DotNet/Hotfix/Session/NetInnerComponentOnReadEvent.cs

@@ -2,7 +2,7 @@
 
 namespace ET.Server
 {
-    [Event]
+    [Event(SceneType.Process)]
     public class NetInnerComponentOnReadEvent: BEvent<NetInnerComponentOnRead>
     {
         [EnableAccessEntiyChild]

+ 3 - 3
DotNet/Hotfix/Session/NetServerComponentOnReadEvent.cs

@@ -1,6 +1,6 @@
 namespace ET.Server
 {
-    [Event]
+    [Event(SceneType.Process)]
     public class NetServerComponentOnReadEvent: BEvent<NetServerComponentOnRead>
     {
         protected override async ETTask OnEvent(NetServerComponentOnRead args)
@@ -13,7 +13,7 @@
                 session.OnResponse(response);
                 return;
             }
-			
+
             // 根据消息接口判断是不是Actor消息,不同的接口做不同的处理,比如需要转发给Chat Scene,可以做一个IChatMessage接口
             switch (message)
             {
@@ -45,7 +45,7 @@
                 {
                     break;
                 }
-				
+
                 default:
                 {
                     // 非Actor消息

+ 10 - 6
DotNet/Model/ConfigPartial/Character.cs → DotNet/Model/ConfigPartial/CharacterConfig.cs

@@ -5,23 +5,25 @@ using ET.Server;
 
 namespace ET
 {
-    public partial class Character
+    public partial class CharacterConfig
     {
         /** 初始化技能列表 **/
         public List<Struct.IntIntData> InitSkillList = new List<Struct.IntIntData>();
+        /** 初始移速 **/
+        public float _InitSpeed = 5F;
 
         public override void AfterEndInit()
         {
-            if (string.IsNullOrEmpty(this.initSkill))
+            if (string.IsNullOrEmpty(this.InitSkill))
             {
-                Log.Warning($"配置表 Character 字段 initSkill 为空...Id={this.Id}, initSkill={this.initSkill}");
+                Log.Warning($"配置表 CharacterConfig 字段 InitSkill 为空...Id={this.Id}, initSkill={this.InitSkill}");
                 return;
             }
 
-            string[] strings = this.initSkill.Split("|");
+            string[] strings = this.InitSkill.Split("|");
             if (strings.Length <= 0)
             {
-                Log.Error($"配置表 Character 字段 initSkill 格式错误...Id={this.Id}, initSkill={this.initSkill}");
+                Log.Error($"配置表 CharacterConfig 字段 InitSkill 格式错误...Id={this.Id}, initSkill={this.InitSkill}");
                 return;
             }
 
@@ -29,7 +31,7 @@ namespace ET
             {
                 if (string.IsNullOrEmpty(sss))
                 {
-                    Log.Error($"配置表 Character 字段 initSkill 格式错误...Id={this.Id}, initSkill={this.initSkill}");
+                    Log.Error($"配置表 CharacterConfig 字段 InitSkill 格式错误...Id={this.Id}, initSkill={this.InitSkill}");
                     continue;
                 }
 
@@ -39,6 +41,8 @@ namespace ET
                     this.InitSkillList.Add(new Struct.IntIntData(int.Parse(strs[0]), int.Parse(strs[1])));
                 }
             }
+
+            this._InitSpeed = float.Parse(this.InitSpeed);
         }
     }
 }

+ 0 - 139
DotNet/Model/Generate/Config/Character.cs

@@ -1,139 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class CharacterCategory : ConfigSingleton<CharacterCategory>, IMerge
-    {
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, Character> dict = new Dictionary<int, Character>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<Character> list = new List<Character>();
-		
-        public void Merge(object o)
-        {
-            CharacterCategory s = o as CharacterCategory;
-            this.list.AddRange(s.list);
-        }
-		
-		[ProtoAfterDeserialization]        
-        public void ProtoEndInit()
-        {
-            foreach (Character config in list)
-            {
-                config.AfterEndInit();
-                this.dict.Add(config.Id, config);
-            }
-            this.list.Clear();
-            
-            this.AfterEndInit();
-        }
-		
-        public Character Get(int id)
-        {
-            this.dict.TryGetValue(id, out Character item);
-
-            if (item == null)
-            {
-                throw new Exception($"配置找不到,配置表名: {nameof (Character)},配置id: {id}");
-            }
-
-            return item;
-        }
-		
-        public bool Contain(int id)
-        {
-            return this.dict.ContainsKey(id);
-        }
-
-        public Dictionary<int, Character> GetAll()
-        {
-            return this.dict;
-        }
-
-        public Character GetOne()
-        {
-            if (this.dict == null || this.dict.Count <= 0)
-            {
-                return null;
-            }
-            return this.dict.Values.GetEnumerator().Current;
-        }
-    }
-
-    [ProtoContract]
-	public partial class Character: ProtoObject, IConfig
-	{
-		/// <summary>Id</summary>
-		[ProtoMember(1)]
-		public int Id { get; set; }
-		/// <summary>职业名称</summary>
-		[ProtoMember(2)]
-		public string ProName { get; set; }
-		/// <summary>职业ID</summary>
-		[ProtoMember(3)]
-		public int pro { get; set; }
-		/// <summary>初始等级</summary>
-		[ProtoMember(4)]
-		public int initLevel { get; set; }
-		/// <summary>初始暴击率</summary>
-		[ProtoMember(5)]
-		public int initCritRata { get; set; }
-		/// <summary>初始暴伤%</summary>
-		[ProtoMember(6)]
-		public int CritDamage { get; set; }
-		/// <summary>初始穿透</summary>
-		[ProtoMember(7)]
-		public int Piercethrough { get; set; }
-		/// <summary>生命恢复</summary>
-		[ProtoMember(8)]
-		public int baseHPRegen { get; set; }
-		/// <summary>治疗效果</summary>
-		[ProtoMember(9)]
-		public int HealEffect { get; set; }
-		/// <summary>被治疗效果</summary>
-		[ProtoMember(10)]
-		public int HealedEffect { get; set; }
-		/// <summary>基础攻速</summary>
-		[ProtoMember(11)]
-		public int baseAtkSpeed { get; set; }
-		/// <summary>基础移动速度</summary>
-		[ProtoMember(12)]
-		public int baseMoveSpeed { get; set; }
-		/// <summary>初始模型</summary>
-		[ProtoMember(13)]
-		public string model { get; set; }
-		/// <summary>初始武器模型</summary>
-		[ProtoMember(14)]
-		public string weaponmodel { get; set; }
-		/// <summary>初始时装</summary>
-		[ProtoMember(15)]
-		public string initFashion { get; set; }
-		/// <summary>初始装备</summary>
-		[ProtoMember(16)]
-		public string initEquip { get; set; }
-		/// <summary>初始携带道具</summary>
-		[ProtoMember(17)]
-		public string initItem { get; set; }
-		/// <summary>初始技能列表</summary>
-		[ProtoMember(18)]
-		public string initSkill { get; set; }
-		/// <summary>总数</summary>
-		[ProtoMember(19)]
-		public string count { get; set; }
-		/// <summary>等级上限</summary>
-		[ProtoMember(21)]
-		public int finalLevel { get; set; }
-		/// <summary>基础移速值</summary>
-		[ProtoMember(22)]
-		public string inspeed { get; set; }
-
-	}
-}

+ 109 - 0
DotNet/Model/Generate/Config/CharacterConfig.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using ProtoBuf;
+
+namespace ET
+{
+    [ProtoContract]
+    [Config]
+    public partial class CharacterConfigCategory : ConfigSingleton<CharacterConfigCategory>, IMerge
+    {
+        [ProtoIgnore]
+        [BsonIgnore]
+        private Dictionary<int, CharacterConfig> dict = new Dictionary<int, CharacterConfig>();
+		
+        [BsonElement]
+        [ProtoMember(1)]
+        private List<CharacterConfig> list = new List<CharacterConfig>();
+		
+        public void Merge(object o)
+        {
+            CharacterConfigCategory s = o as CharacterConfigCategory;
+            this.list.AddRange(s.list);
+        }
+		
+		[ProtoAfterDeserialization]        
+        public void ProtoEndInit()
+        {
+            foreach (CharacterConfig config in list)
+            {
+                config.AfterEndInit();
+                this.dict.Add(config.Id, config);
+            }
+            this.list.Clear();
+            
+            this.AfterEndInit();
+        }
+		
+        public CharacterConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out CharacterConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (CharacterConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, CharacterConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public CharacterConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+    [ProtoContract]
+	public partial class CharacterConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		[ProtoMember(1)]
+		public int Id { get; set; }
+		/// <summary>职业名称</summary>
+		[ProtoMember(2)]
+		public string ProName { get; set; }
+		/// <summary>职业ID</summary>
+		[ProtoMember(3)]
+		public int Pro { get; set; }
+		/// <summary>等级上限</summary>
+		[ProtoMember(4)]
+		public int FinalLevel { get; set; }
+		/// <summary>初始等级</summary>
+		[ProtoMember(5)]
+		public int InitLevel { get; set; }
+		/// <summary>初始生命</summary>
+		[ProtoMember(6)]
+		public int InitMaxHP { get; set; }
+		/// <summary>初始攻击</summary>
+		[ProtoMember(7)]
+		public int InitAttack { get; set; }
+		/// <summary>基础攻速</summary>
+		[ProtoMember(8)]
+		public int BaseAtkSpeed { get; set; }
+		/// <summary>基础移动速度</summary>
+		[ProtoMember(9)]
+		public int BaseMoveSpeed { get; set; }
+		/// <summary>基础移速值</summary>
+		[ProtoMember(10)]
+		public string InitSpeed { get; set; }
+		/// <summary>初始技能列表</summary>
+		[ProtoMember(11)]
+		public string InitSkill { get; set; }
+
+	}
+}

+ 21 - 0
DotNet/Model/Scenes/Game/Player/PlayerBtlComponent.cs

@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+
+namespace ET.Server
+{
+    [ComponentOf(typeof (WNPlayer))]
+    public class PlayerBtlComponent: Entity, IAwake<WNPlayer>, IDestroy
+    {
+        [StaticField]
+        public int Tenthousand = 10000;
+        /** 职业等级属性 **/
+        [StaticField]
+        public Dictionary<PlayerBtlData, int> Data_Pro_Lv = new Dictionary<PlayerBtlData, int>();
+
+        [StaticField]
+        public Dictionary<PlayerBtlData, int> AllInflus = new Dictionary<PlayerBtlData, int>();
+        /** 职业初始信息配置 **/
+        public CharacterConfig CharacterProp { get; set; }
+        /** 缓存的玩家对象 **/
+        public WNPlayer Player { get; set; }
+    }
+}

+ 6 - 2
DotNet/Model/Scenes/Game/Player/PlayerSkillComponent.cs

@@ -1,10 +1,14 @@
-namespace ET.Server
+using System.Collections.Generic;
+
+namespace ET.Server
 {
     [ComponentOf(typeof (WNPlayer))]
     public class PlayerSkillComponent: Entity, IAwake<WNPlayer>, IDestroy
     {
-        /** 技能数据 **/
+        /** 玩家技能数据 **/
         public PlayerSkillInfo Data { get; set; }
+        /** 战斗服技能数据 **/
+        public List<Struct.SkillInfo> ToJson4BattleServerSkills { get; set; }
         /** 玩家实体 **/
         public WNPlayer Player { get; set; }
     }

+ 1 - 3
DotNet/Model/Scenes/Game/Player/WNPlayer.cs

@@ -14,7 +14,7 @@ namespace ET.Server
         public Session Session { get; set; }
 
         /** 职业初始信息配置 **/
-        public Character BasicProp { get; set; }
+        public CharacterConfig BasicProp { get; set; }
 
         /** 玩家场景信息 **/
         public Map Map { get; set; }
@@ -33,7 +33,5 @@ namespace ET.Server
         /** 在线状态 **/
         public bool IsOnline { get; set; }
 
-        /** 战斗服技能数据 **/
-        public List<Struct.SkillInfo> ToJson4BattleServerSkillInfos { get; set; }
     }
 }

+ 1 - 1
Unity/Assets/Scripts/Codes/Hotfix/Share/Init/EntryEvent1_InitShare.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    [Event]
+    [Event(SceneType.Process)]
     public class EntryEvent1_InitShare: BEvent<EventType.EntryEvent1>
     {
         protected override async ETTask OnEvent(EventType.EntryEvent1 args)

+ 143 - 1
Unity/Assets/Scripts/Codes/Model/Share/Const/ConstGame.cs

@@ -1,4 +1,8 @@
-namespace ET.Server
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.Reflection;
+
+namespace ET.Server
 {
     public static class ConstGame
     {
@@ -153,4 +157,142 @@
         /** 随机点复活 */
         RANDOM = 5,
     }
+
+    public enum PlayerBtlData
+        {
+            [Display(Name = "生命")]
+		    MaxHP = 1,
+            [Display(Name = "生命%")]
+            HPPer = 2,
+            [Display(Name = "攻击")]
+            Attack = 3,
+            [Display(Name = "攻击%")]
+            AttackPer = 4,
+            [Display(Name = "防御")]
+            Def = 5,
+            [Display(Name = "防御%")]
+            DefPer  = 6,
+            [Display(Name = "穿透")]
+            IgnoreDefense = 7,
+            [Display(Name = "穿透%")]
+            IgnoreDefensePer = 8,
+            [Display(Name = "暴击率")]
+            CritRate = 9,
+            [Display(Name = "抗暴")]
+		    ResCrit = 10,
+            [Display(Name = "抗暴% ")]
+            ResCritPer = 11,
+            [Display(Name = "抗暴率")]
+            ResCritRate = 12,
+            [Display(Name = "暴击伤害%")]
+            CritDamage = 13,
+            [Display(Name = "暴伤抵御%")]
+            CritDamageRes = 14,
+            [Display(Name = "玩家间伤害增加%")]
+            IncAllDamage = 15,      // 玩家之间
+            [Display(Name = "玩家间伤害减免%")]
+            AllDamageReduce = 16,       // 玩家之间
+            [Display(Name = "韧性%")]
+            CtrlTimeReduce = 17,
+            [Display(Name = "冷却缩减%")]
+            SkillCD = 18,
+            [Display(Name = "生命恢复")]
+            HPRegen = 19,
+            [Display(Name = "银两掉落")]
+		    ExdGold = 20,       //--
+            [Display(Name = "杀怪经验")]
+            ExdExp = 21,        //--
+            [Display(Name = "恢复生命")]
+            HPRecover = 22,     //--废弃了,用HPRegen
+            [Display(Name = "恢复生命%")]
+            HPRecoverPer = 23,	//--
+            [Display(Name = "治疗效果")]
+            HealEffect = 24,
+            [Display(Name = "被治疗效果")]
+		    HealedEffect = 25,
+            [Display(Name = "移动速度")]
+            RunSpeed = 26,      // 移动速度加成百分比, moveSpeed基础移速
+            [Display(Name = "技能加成%")]
+            SkillDamage = 27,
+            [Display(Name = "攻击速度")]
+		    AttackSpeed = 28,
+            [Display(Name = "控制增幅%")]
+		    ControlUp = 29,
+            [Display(Name = "金属性攻击")]
+		    GoldAttack = 30,
+            [Display(Name = "金属性防御")]
+		    GoldDefense = 31,
+            [Display(Name = "木属性攻击")]
+		    WoodAttack = 32,
+            [Display(Name = "木属性防御")]
+		    WoodDefense = 33,
+            [Display(Name = "水属性攻击")]
+		    WaterAttack = 34,
+            [Display(Name = "水属性防御")]
+		    WaterDefense = 35,
+            [Display(Name = "火属性攻击")]
+		    FireAttack = 36,
+            [Display(Name = "火属性防御")]
+		    FireDefense = 37,
+            [Display(Name = "土属性攻击")]
+		    SoilAttack = 38,
+            [Display(Name = "土属性防御")]
+		    SoilDefense = 39,
+            [Display(Name = "对boss额外暴击率")]
+		    ToBossCritRate = 40,
+            [Display(Name = "对boss额外暴击伤害")]
+		    ToBossCritDamage = 41,
+            [Display(Name = "金克制")]
+		    GoldRestraint = 42,
+            [Display(Name = "木克制")]
+		    WoodRestraint = 43,
+            [Display(Name = "水克制")]
+		    WaterRestraint = 44,
+            [Display(Name = "火克制")]
+		    FireRestraint = 45,
+            [Display(Name = "土克制")]
+		    SoilRestraint = 46,
+            [Display(Name = "金抵御")]
+		    GoldResist = 47,
+            [Display(Name = "木抵御")]
+		    WoodResist = 48,
+            [Display(Name = "水抵御")]
+		    WaterResist = 49,
+            [Display(Name = "火抵御")]
+		    FireResist = 50,
+            [Display(Name = "土抵御")]
+		    SoilResist = 51,
+            [Display(Name = "杀意值")]
+		    PvpKillValue = 52,
+            [Display(Name = "妖气等级")]
+		    YaoQiLevel = 53,
+            [Display(Name = "普攻吸血")]
+		    NormalAtkLeech = 54,
+            [Display(Name = "技能吸血")]
+		    ActiveAtkLeech = 55,
+            [Display(Name = "神器主属性伤害加成")]
+		    ArtifactMainPer = 56,
+            [Display(Name = "怪物伤害增益%")]
+		    FieldBossDamageAdd = 57,        // Map表有areaType,副本,野外地图类型区分
+            [Display(Name = "怪物伤害减免%")]
+		    DungeonMonsterDamageAdd = 58,       // 2021.3.30修改,含义以备注为准
+            [Display(Name = "杀意等级")]
+		    PvpKillLevel = 59,
+            [Display(Name = "七杀克制")]
+		    MonsterRestraint1 = 60,
+            [Display(Name = "离明克制")]
+		    MonsterRestraint2 = 61,
+            [Display(Name = "夜耀克制")]
+		    MonsterRestraint3 = 62,
+            [Display(Name = "昌曲克制")]
+		    MonsterRestraint4 = 63,
+            [Display(Name = "沧海克制")]
+		    MonsterRestraint5 = 64,
+
+            [Display(Name = "所有伤害加成")]
+		    AllAtak = 65,
+            [Display(Name = "所有伤害抵御")]
+		    AllDef = 66,
+	    }
+
 }