|
@@ -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
|
|
|
+ {
|
|
|
+
|
|
|
+ [ProtoMember(1)]
|
|
|
+ public int Id { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(2)]
|
|
|
+ public string Name { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(3)]
|
|
|
+ public string Title { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(4)]
|
|
|
+ public int Level { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(5)]
|
|
|
+ public int FightType { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(6)]
|
|
|
+ public int LvRepress { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(7)]
|
|
|
+ public int Qcolor { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(8)]
|
|
|
+ public int Type { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(9)]
|
|
|
+ public int MPValue { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(10)]
|
|
|
+ public int SkillType { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(11)]
|
|
|
+ public float FightCount { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(12)]
|
|
|
+ public float AliveTime { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(13)]
|
|
|
+ public float KillPlayerTime { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(14)]
|
|
|
+ public int MaxHP { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(15)]
|
|
|
+ public int MaxAttack { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(16)]
|
|
|
+ public int MaxDefence { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(17)]
|
|
|
+ public int CritRate { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(18)]
|
|
|
+ public int CritDamage { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(19)]
|
|
|
+ public int IgnoreDefencePer { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(20)]
|
|
|
+ public int Prob1 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(21)]
|
|
|
+ public int ReviveID1 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(22)]
|
|
|
+ public int Prob2 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(23)]
|
|
|
+ public int ReviveID2 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(24)]
|
|
|
+ public int Prob3 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(25)]
|
|
|
+ public int ReviveID3 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(26)]
|
|
|
+ public int Prob4 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(27)]
|
|
|
+ public int ReviveID4 { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(28)]
|
|
|
+ public int DialogChance { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(29)]
|
|
|
+ public string DialogWords { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(30)]
|
|
|
+ public int DeadDialogChance { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(31)]
|
|
|
+ public string DeadDialogWords { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(32)]
|
|
|
+ public int IdleSpeakChance { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(33)]
|
|
|
+ public string IdleSpeakWords { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(34)]
|
|
|
+ public string IdleSpeakCoolDown { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(35)]
|
|
|
+ public int FightSpeakChance { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(36)]
|
|
|
+ public string FightSpeakWords { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(37)]
|
|
|
+ public string FightSpeakCoolDown { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(38)]
|
|
|
+ public string DeadSpeakWords { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(39)]
|
|
|
+ public int isAttack { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(40)]
|
|
|
+ public string Ability { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(41)]
|
|
|
+ public string CallAbilityPerHP { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(42)]
|
|
|
+ public string AbilityPar { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(43)]
|
|
|
+ public int ShareType { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(44)]
|
|
|
+ public string Icon { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(45)]
|
|
|
+ public string MonsterDes { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(46)]
|
|
|
+ public string MonsterRaid { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(47)]
|
|
|
+ public int Sex { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(48)]
|
|
|
+ public int Atype { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(49)]
|
|
|
+ public string FirstTc { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(50)]
|
|
|
+ public string Tc { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(51)]
|
|
|
+ public string TeamTc { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(52)]
|
|
|
+ public string PersonTc { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(53)]
|
|
|
+ public string AssistTC { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(54)]
|
|
|
+ public int BaseExp { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(55)]
|
|
|
+ public int GoldBase { get; set; }
|
|
|
+
|
|
|
+ [ProtoMember(56)]
|
|
|
+ public int ExpRatio { get; set; }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|