예제 #1
0
파일: NPC.cs 프로젝트: abel/sinan
 public Npc(Variant config)
 {
     ID = config.GetStringOrDefault("_id");
     NpcType = config.GetStringOrDefault("SubType");
     Name = config.GetStringOrDefault("Name");
     m_value = config.GetVariantOrDefault("Value");
     if (m_value != null)
     {
         m_task = m_value.GetVariantOrDefault("Task");
         SceneID = m_value.GetStringOrDefault("SceneID");
         X = m_value.GetIntOrDefault("X");
         Y = m_value.GetIntOrDefault("Y");
         object lev;
         if (m_value.TryGetValueT("MustKill", out lev))
         {
             if (lev is bool)
             {
                 if ((bool)lev)
                 {
                     m_killLev = 1;
                 }
             }
             else if (lev != null)
             {
                 int.TryParse(lev.ToString(), out m_killLev);
             }
         }
     }
 }
예제 #2
0
 /// <summary>
 /// 判断是否存在某等级的技能
 /// </summary>
 /// <param name="v"></param>
 /// <param name="skillid">技能ID</param>
 /// <param name="level">技能等级</param>
 /// <returns>true表示存在,false表示不存在</returns>
 public bool PetSkillIDLevel(Variant v, string skillid, int level)
 {
     if (v == null) return false;
     IList ls;
     if (v.TryGetValueT(skillid, out ls))
     {
         if (ls.Contains(level))
             return true;
     }
     return false;
 }