Parcourir la source

增加monster配置表

johnclot69 il y a 1 an
Parent
commit
b114ff0366

BIN
Config/Excel/Monster.xlsx


BIN
Config/GenFromExcel/c/MonsterCategory.bytes


BIN
Config/GenFromExcel/s/MonsterCategory.bytes


+ 4 - 0
Config/GenJson/c/Monster.txt

@@ -0,0 +1,4 @@
+{"list":[
+{"_t":"Monster","_id":72000,"Name":"剑痴","Title":"","Level":50,"FightType":1,"LvRepress":0,"Qcolor":0,"Type":0,"MPValue":0,"SkillType":0,"FightCount":0,"AliveTime":0,"KillPlayerTime":0,"MaxHP":-1,"MaxAttack":-1,"MaxDefence":-1,"CritRate":-1,"CritDamage":-1,"IgnoreDefencePer":0,"Prob1":0,"ReviveID1":0,"Prob2":0,"ReviveID2":0,"Prob3":0,"ReviveID3":0,"Prob4":0,"ReviveID4":0,"DialogChance":0,"DialogWords":"","DeadDialogChance":0,"DeadDialogWords":"","IdleSpeakChance":0,"IdleSpeakWords":"","IdleSpeakCoolDown":"","FightSpeakChance":0,"FightSpeakWords":"","FightSpeakCoolDown":"","DeadSpeakWords":"","isAttack":1,"Ability":"","CallAbilityPerHP":"","AbilityPar":"","ShareType":0,"Icon":"","MonsterDes":"","MonsterRaid":"","Sex":0,"Atype":0,"FirstTc":"","Tc":"","TeamTc":"","PersonTc":"","AssistTC":"","BaseExp":0,"GoldBase":0,"ExpRatio":0},
+{"_t":"Monster","_id":1009601,"Name":"羊","Title":"","Level":80,"FightType":1,"LvRepress":0,"Qcolor":0,"Type":0,"MPValue":0,"SkillType":0,"FightCount":0,"AliveTime":0,"KillPlayerTime":0,"MaxHP":0,"MaxAttack":0,"MaxDefence":0,"CritRate":-1,"CritDamage":-1,"IgnoreDefencePer":0,"Prob1":0,"ReviveID1":0,"Prob2":0,"ReviveID2":0,"Prob3":0,"ReviveID3":0,"Prob4":0,"ReviveID4":0,"DialogChance":100,"DialogWords":"咩~~咩~~","DeadDialogChance":0,"DeadDialogWords":"","IdleSpeakChance":0,"IdleSpeakWords":"","IdleSpeakCoolDown":"","FightSpeakChance":0,"FightSpeakWords":"","FightSpeakCoolDown":"","DeadSpeakWords":"","isAttack":0,"Ability":"","CallAbilityPerHP":"","AbilityPar":"","ShareType":0,"Icon":"","MonsterDes":"","MonsterRaid":"","Sex":0,"Atype":0,"FirstTc":"","Tc":"Meat-yang","TeamTc":"","PersonTc":"","AssistTC":"","BaseExp":0,"GoldBase":0,"ExpRatio":0},
+]}

+ 4 - 0
Config/GenJson/s/Monster.txt

@@ -0,0 +1,4 @@
+{"list":[
+{"_t":"Monster","_id":72000,"Name":"剑痴","Title":"","Level":50,"FightType":1,"LvRepress":0,"Qcolor":0,"Type":0,"MPValue":0,"SkillType":0,"FightCount":0,"AliveTime":0,"KillPlayerTime":0,"MaxHP":-1,"MaxAttack":-1,"MaxDefence":-1,"CritRate":-1,"CritDamage":-1,"IgnoreDefencePer":0,"Prob1":0,"ReviveID1":0,"Prob2":0,"ReviveID2":0,"Prob3":0,"ReviveID3":0,"Prob4":0,"ReviveID4":0,"DialogChance":0,"DialogWords":"","DeadDialogChance":0,"DeadDialogWords":"","IdleSpeakChance":0,"IdleSpeakWords":"","FightSpeakChance":0,"FightSpeakWords":"","FightSpeakCoolDown":"","DeadSpeakWords":"","isAttack":1,"Ability":"","CallAbilityPerHP":"","AbilityPar":"","ShareType":0,"Icon":"","MonsterDes":"","MonsterRaid":"","Sex":0,"Atype":0,"FirstTc":"","Tc":"","TeamTc":"","PersonTc":"","AssistTC":"","BaseExp":0,"GoldBase":0,"ExpRatio":0},
+{"_t":"Monster","_id":1009601,"Name":"羊","Title":"","Level":80,"FightType":1,"LvRepress":0,"Qcolor":0,"Type":0,"MPValue":0,"SkillType":0,"FightCount":0,"AliveTime":0,"KillPlayerTime":0,"MaxHP":0,"MaxAttack":0,"MaxDefence":0,"CritRate":-1,"CritDamage":-1,"IgnoreDefencePer":0,"Prob1":0,"ReviveID1":0,"Prob2":0,"ReviveID2":0,"Prob3":0,"ReviveID3":0,"Prob4":0,"ReviveID4":0,"DialogChance":100,"DialogWords":"咩~~咩~~","DeadDialogChance":0,"DeadDialogWords":"","IdleSpeakChance":0,"IdleSpeakWords":"","FightSpeakChance":0,"FightSpeakWords":"","FightSpeakCoolDown":"","DeadSpeakWords":"","isAttack":0,"Ability":"","CallAbilityPerHP":"","AbilityPar":"","ShareType":0,"Icon":"","MonsterDes":"","MonsterRaid":"","Sex":0,"Atype":0,"FirstTc":"","Tc":"Meat-yang","TeamTc":"","PersonTc":"","AssistTC":"","BaseExp":0,"GoldBase":0,"ExpRatio":0},
+]}

+ 241 - 0
DotNet/Model/Generate/Config/Monster.cs

@@ -0,0 +1,241 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using ProtoBuf;
+
+namespace ET
+{
+    [ProtoContract]
+    [Config]
+    public partial class MonsterCategory : ConfigSingleton<MonsterCategory>, IMerge
+    {
+        [ProtoIgnore]
+        [BsonIgnore]
+        private Dictionary<int, Monster> dict = new Dictionary<int, Monster>();
+		
+        [BsonElement]
+        [ProtoMember(1)]
+        private List<Monster> list = new List<Monster>();
+		
+        public void Merge(object o)
+        {
+            MonsterCategory s = o as MonsterCategory;
+            this.list.AddRange(s.list);
+        }
+		
+		[ProtoAfterDeserialization]        
+        public void ProtoEndInit()
+        {
+            foreach (Monster config in list)
+            {
+                config.AfterEndInit();
+                this.dict.Add(config.Id, config);
+            }
+            this.list.Clear();
+            
+            this.AfterEndInit();
+        }
+		
+        public Monster Get(int id)
+        {
+            this.dict.TryGetValue(id, out Monster item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (Monster)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, Monster> GetAll()
+        {
+            return this.dict;
+        }
+
+        public Monster GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+    [ProtoContract]
+	public partial class Monster: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		[ProtoMember(1)]
+		public int Id { get; set; }
+		/// <summary>怪物名字</summary>
+		[ProtoMember(2)]
+		public string Name { get; set; }
+		/// <summary>副名字/称号</summary>
+		[ProtoMember(3)]
+		public string Title { get; set; }
+		/// <summary>等级</summary>
+		[ProtoMember(4)]
+		public int Level { get; set; }
+		/// <summary>战斗规模</summary>
+		[ProtoMember(5)]
+		public int FightType { get; set; }
+		/// <summary>1等级压制 0或空不压制</summary>
+		[ProtoMember(6)]
+		public int LvRepress { get; set; }
+		/// <summary>名字颜色</summary>
+		[ProtoMember(7)]
+		public int Qcolor { get; set; }
+		/// <summary>怪物类型</summary>
+		[ProtoMember(8)]
+		public int Type { get; set; }
+		/// <summary>定力值</summary>
+		[ProtoMember(9)]
+		public int MPValue { get; set; }
+		/// <summary>怪物可获取的技能类型</summary>
+		[ProtoMember(10)]
+		public int SkillType { get; set; }
+		/// <summary>玩家围攻数量</summary>
+		[ProtoMember(11)]
+		public float FightCount { get; set; }
+		/// <summary>存活时间</summary>
+		[ProtoMember(12)]
+		public float AliveTime { get; set; }
+		/// <summary>致死玩家时间</summary>
+		[ProtoMember(13)]
+		public float KillPlayerTime { get; set; }
+		/// <summary>生命</summary>
+		[ProtoMember(14)]
+		public int MaxHP { get; set; }
+		/// <summary>攻击</summary>
+		[ProtoMember(15)]
+		public int MaxAttack { get; set; }
+		/// <summary>防御</summary>
+		[ProtoMember(16)]
+		public int MaxDefence { get; set; }
+		/// <summary>暴击率</summary>
+		[ProtoMember(17)]
+		public int CritRate { get; set; }
+		/// <summary>暴击伤害</summary>
+		[ProtoMember(18)]
+		public int CritDamage { get; set; }
+		/// <summary>穿透</summary>
+		[ProtoMember(19)]
+		public int IgnoreDefencePer { get; set; }
+		/// <summary>变成普通怪的概率</summary>
+		[ProtoMember(20)]
+		public int Prob1 { get; set; }
+		/// <summary>普通怪ID</summary>
+		[ProtoMember(21)]
+		public int ReviveID1 { get; set; }
+		/// <summary>变成稀有怪的概率</summary>
+		[ProtoMember(22)]
+		public int Prob2 { get; set; }
+		/// <summary>稀有怪ID</summary>
+		[ProtoMember(23)]
+		public int ReviveID2 { get; set; }
+		/// <summary>变成首脑怪的概率</summary>
+		[ProtoMember(24)]
+		public int Prob3 { get; set; }
+		/// <summary>首脑怪ID</summary>
+		[ProtoMember(25)]
+		public int ReviveID3 { get; set; }
+		/// <summary>变成精英怪的概率</summary>
+		[ProtoMember(26)]
+		public int Prob4 { get; set; }
+		/// <summary>精英怪ID</summary>
+		[ProtoMember(27)]
+		public int ReviveID4 { get; set; }
+		/// <summary>显示个性语言概率</summary>
+		[ProtoMember(28)]
+		public int DialogChance { get; set; }
+		/// <summary>个性语言</summary>
+		[ProtoMember(29)]
+		public string DialogWords { get; set; }
+		/// <summary>战死时语言概率</summary>
+		[ProtoMember(30)]
+		public int DeadDialogChance { get; set; }
+		/// <summary>战死时语言内容</summary>
+		[ProtoMember(31)]
+		public string DeadDialogWords { get; set; }
+		/// <summary>非战斗状态时语音概率</summary>
+		[ProtoMember(32)]
+		public int IdleSpeakChance { get; set; }
+		/// <summary>非战斗状态时语音内容</summary>
+		[ProtoMember(33)]
+		public string IdleSpeakWords { get; set; }
+		/// <summary>战斗状态时语音概率</summary>
+		[ProtoMember(35)]
+		public int FightSpeakChance { get; set; }
+		/// <summary>战斗状态时语音内容</summary>
+		[ProtoMember(36)]
+		public string FightSpeakWords { get; set; }
+		/// <summary>非战斗状态时语音播放间隔4</summary>
+		[ProtoMember(37)]
+		public string FightSpeakCoolDown { get; set; }
+		/// <summary>死亡时播放的语音</summary>
+		[ProtoMember(38)]
+		public string DeadSpeakWords { get; set; }
+		/// <summary>是否主动攻击</summary>
+		[ProtoMember(39)]
+		public int isAttack { get; set; }
+		/// <summary>身负特殊技能</summary>
+		[ProtoMember(40)]
+		public string Ability { get; set; }
+		/// <summary>触发特殊技能血量万分比</summary>
+		[ProtoMember(41)]
+		public string CallAbilityPerHP { get; set; }
+		/// <summary>特殊技能参数</summary>
+		[ProtoMember(42)]
+		public string AbilityPar { get; set; }
+		/// <summary>是否任务共享</summary>
+		[ProtoMember(43)]
+		public int ShareType { get; set; }
+		/// <summary>图标文件</summary>
+		[ProtoMember(44)]
+		public string Icon { get; set; }
+		/// <summary>怪物描述</summary>
+		[ProtoMember(45)]
+		public string MonsterDes { get; set; }
+		/// <summary>怪物攻略</summary>
+		[ProtoMember(46)]
+		public string MonsterRaid { get; set; }
+		/// <summary>性别</summary>
+		[ProtoMember(47)]
+		public int Sex { get; set; }
+		/// <summary>生物类型</summary>
+		[ProtoMember(48)]
+		public int Atype { get; set; }
+		/// <summary>首杀TC</summary>
+		[ProtoMember(49)]
+		public string FirstTc { get; set; }
+		/// <summary>常规TC</summary>
+		[ProtoMember(50)]
+		public string Tc { get; set; }
+		/// <summary>队伍模式TC</summary>
+		[ProtoMember(51)]
+		public string TeamTc { get; set; }
+		/// <summary>个人TC</summary>
+		[ProtoMember(52)]
+		public string PersonTc { get; set; }
+		/// <summary>助攻tc</summary>
+		[ProtoMember(53)]
+		public string AssistTC { get; set; }
+		/// <summary>基础经验</summary>
+		[ProtoMember(54)]
+		public int BaseExp { get; set; }
+		/// <summary>基础灵石</summary>
+		[ProtoMember(55)]
+		public int GoldBase { get; set; }
+		/// <summary>经验万分比</summary>
+		[ProtoMember(56)]
+		public int ExpRatio { get; set; }
+
+	}
+}

BIN
Unity/Assets/Res/Config/GenFromExcel/MonsterCategory.bytes


+ 244 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/Monster.cs

@@ -0,0 +1,244 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using ProtoBuf;
+
+namespace ET
+{
+    [ProtoContract]
+    [Config]
+    public partial class MonsterCategory : ConfigSingleton<MonsterCategory>, IMerge
+    {
+        [ProtoIgnore]
+        [BsonIgnore]
+        private Dictionary<int, Monster> dict = new Dictionary<int, Monster>();
+		
+        [BsonElement]
+        [ProtoMember(1)]
+        private List<Monster> list = new List<Monster>();
+		
+        public void Merge(object o)
+        {
+            MonsterCategory s = o as MonsterCategory;
+            this.list.AddRange(s.list);
+        }
+		
+		[ProtoAfterDeserialization]        
+        public void ProtoEndInit()
+        {
+            foreach (Monster config in list)
+            {
+                config.AfterEndInit();
+                this.dict.Add(config.Id, config);
+            }
+            this.list.Clear();
+            
+            this.AfterEndInit();
+        }
+		
+        public Monster Get(int id)
+        {
+            this.dict.TryGetValue(id, out Monster item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (Monster)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, Monster> GetAll()
+        {
+            return this.dict;
+        }
+
+        public Monster GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+    [ProtoContract]
+	public partial class Monster: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		[ProtoMember(1)]
+		public int Id { get; set; }
+		/// <summary>怪物名字</summary>
+		[ProtoMember(2)]
+		public string Name { get; set; }
+		/// <summary>副名字/称号</summary>
+		[ProtoMember(3)]
+		public string Title { get; set; }
+		/// <summary>等级</summary>
+		[ProtoMember(4)]
+		public int Level { get; set; }
+		/// <summary>战斗规模</summary>
+		[ProtoMember(5)]
+		public int FightType { get; set; }
+		/// <summary>1等级压制 0或空不压制</summary>
+		[ProtoMember(6)]
+		public int LvRepress { get; set; }
+		/// <summary>名字颜色</summary>
+		[ProtoMember(7)]
+		public int Qcolor { get; set; }
+		/// <summary>怪物类型</summary>
+		[ProtoMember(8)]
+		public int Type { get; set; }
+		/// <summary>定力值</summary>
+		[ProtoMember(9)]
+		public int MPValue { get; set; }
+		/// <summary>怪物可获取的技能类型</summary>
+		[ProtoMember(10)]
+		public int SkillType { get; set; }
+		/// <summary>玩家围攻数量</summary>
+		[ProtoMember(11)]
+		public float FightCount { get; set; }
+		/// <summary>存活时间</summary>
+		[ProtoMember(12)]
+		public float AliveTime { get; set; }
+		/// <summary>致死玩家时间</summary>
+		[ProtoMember(13)]
+		public float KillPlayerTime { get; set; }
+		/// <summary>生命</summary>
+		[ProtoMember(14)]
+		public int MaxHP { get; set; }
+		/// <summary>攻击</summary>
+		[ProtoMember(15)]
+		public int MaxAttack { get; set; }
+		/// <summary>防御</summary>
+		[ProtoMember(16)]
+		public int MaxDefence { get; set; }
+		/// <summary>暴击率</summary>
+		[ProtoMember(17)]
+		public int CritRate { get; set; }
+		/// <summary>暴击伤害</summary>
+		[ProtoMember(18)]
+		public int CritDamage { get; set; }
+		/// <summary>穿透</summary>
+		[ProtoMember(19)]
+		public int IgnoreDefencePer { get; set; }
+		/// <summary>变成普通怪的概率</summary>
+		[ProtoMember(20)]
+		public int Prob1 { get; set; }
+		/// <summary>普通怪ID</summary>
+		[ProtoMember(21)]
+		public int ReviveID1 { get; set; }
+		/// <summary>变成稀有怪的概率</summary>
+		[ProtoMember(22)]
+		public int Prob2 { get; set; }
+		/// <summary>稀有怪ID</summary>
+		[ProtoMember(23)]
+		public int ReviveID2 { get; set; }
+		/// <summary>变成首脑怪的概率</summary>
+		[ProtoMember(24)]
+		public int Prob3 { get; set; }
+		/// <summary>首脑怪ID</summary>
+		[ProtoMember(25)]
+		public int ReviveID3 { get; set; }
+		/// <summary>变成精英怪的概率</summary>
+		[ProtoMember(26)]
+		public int Prob4 { get; set; }
+		/// <summary>精英怪ID</summary>
+		[ProtoMember(27)]
+		public int ReviveID4 { get; set; }
+		/// <summary>显示个性语言概率</summary>
+		[ProtoMember(28)]
+		public int DialogChance { get; set; }
+		/// <summary>个性语言</summary>
+		[ProtoMember(29)]
+		public string DialogWords { get; set; }
+		/// <summary>战死时语言概率</summary>
+		[ProtoMember(30)]
+		public int DeadDialogChance { get; set; }
+		/// <summary>战死时语言内容</summary>
+		[ProtoMember(31)]
+		public string DeadDialogWords { get; set; }
+		/// <summary>非战斗状态时语音概率</summary>
+		[ProtoMember(32)]
+		public int IdleSpeakChance { get; set; }
+		/// <summary>非战斗状态时语音内容</summary>
+		[ProtoMember(33)]
+		public string IdleSpeakWords { get; set; }
+		/// <summary>非战斗状态时语音播放间隔</summary>
+		[ProtoMember(34)]
+		public string IdleSpeakCoolDown { get; set; }
+		/// <summary>战斗状态时语音概率</summary>
+		[ProtoMember(35)]
+		public int FightSpeakChance { get; set; }
+		/// <summary>战斗状态时语音内容</summary>
+		[ProtoMember(36)]
+		public string FightSpeakWords { get; set; }
+		/// <summary>非战斗状态时语音播放间隔4</summary>
+		[ProtoMember(37)]
+		public string FightSpeakCoolDown { get; set; }
+		/// <summary>死亡时播放的语音</summary>
+		[ProtoMember(38)]
+		public string DeadSpeakWords { get; set; }
+		/// <summary>是否主动攻击</summary>
+		[ProtoMember(39)]
+		public int isAttack { get; set; }
+		/// <summary>身负特殊技能</summary>
+		[ProtoMember(40)]
+		public string Ability { get; set; }
+		/// <summary>触发特殊技能血量万分比</summary>
+		[ProtoMember(41)]
+		public string CallAbilityPerHP { get; set; }
+		/// <summary>特殊技能参数</summary>
+		[ProtoMember(42)]
+		public string AbilityPar { get; set; }
+		/// <summary>是否任务共享</summary>
+		[ProtoMember(43)]
+		public int ShareType { get; set; }
+		/// <summary>图标文件</summary>
+		[ProtoMember(44)]
+		public string Icon { get; set; }
+		/// <summary>怪物描述</summary>
+		[ProtoMember(45)]
+		public string MonsterDes { get; set; }
+		/// <summary>怪物攻略</summary>
+		[ProtoMember(46)]
+		public string MonsterRaid { get; set; }
+		/// <summary>性别</summary>
+		[ProtoMember(47)]
+		public int Sex { get; set; }
+		/// <summary>生物类型</summary>
+		[ProtoMember(48)]
+		public int Atype { get; set; }
+		/// <summary>首杀TC</summary>
+		[ProtoMember(49)]
+		public string FirstTc { get; set; }
+		/// <summary>常规TC</summary>
+		[ProtoMember(50)]
+		public string Tc { get; set; }
+		/// <summary>队伍模式TC</summary>
+		[ProtoMember(51)]
+		public string TeamTc { get; set; }
+		/// <summary>个人TC</summary>
+		[ProtoMember(52)]
+		public string PersonTc { get; set; }
+		/// <summary>助攻tc</summary>
+		[ProtoMember(53)]
+		public string AssistTC { get; set; }
+		/// <summary>基础经验</summary>
+		[ProtoMember(54)]
+		public int BaseExp { get; set; }
+		/// <summary>基础灵石</summary>
+		[ProtoMember(55)]
+		public int GoldBase { get; set; }
+		/// <summary>经验万分比</summary>
+		[ProtoMember(56)]
+		public int ExpRatio { get; set; }
+
+	}
+}