Example #1
0
        /// <summary>
        /// 设置声望勋章属性
        /// </summary>
        /// <param name="client"></param>
        public static void SetPrestigeMedalProps(GameClient client, PrestigeMedalData PrestigeMedalData)
        {
            // 如果1.4.1的功能没开放
            if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot4Dot1))
            {
                return;
            }

            //加成
            int life    = PrestigeMedalData.LifeAdd;
            int attack  = PrestigeMedalData.AttackAdd;
            int defense = PrestigeMedalData.DefenseAdd;
            int hit     = PrestigeMedalData.HitAdd;

            foreach (PrestigeMedalBasicData d in _prestigeMedalBasicList.Values)
            {
                if (d.MedalID < PrestigeMedalData.MedalID)
                {
                    life    += d.LifeMax;
                    attack  += d.AttackMax;
                    defense += d.DefenseMax;
                    hit     += d.HitMax;
                }
            }

            //额外加成
            double zhuoYue = 0;
            double diKang  = 0;

            if (PrestigeMedalData.MedalID > 1)
            {
                PrestigeMedalSpecialData d = GetPrestigeMedalSpecialDataByID(PrestigeMedalData.MedalID - 1);
                zhuoYue += d.DoubleAttack;
                diKang  += d.DiDouble;
            }

            client.ClientData.PropsCacheManager.SetExtPropsSingle((int)PropsSystemTypes.PrestigeMedal, (int)ExtPropIndexes.MaxLifeV, life);
            client.ClientData.PropsCacheManager.SetExtPropsSingle((int)PropsSystemTypes.PrestigeMedal, (int)ExtPropIndexes.AddAttack, attack);
            client.ClientData.PropsCacheManager.SetExtPropsSingle((int)PropsSystemTypes.PrestigeMedal, (int)ExtPropIndexes.AddDefense, defense);
            client.ClientData.PropsCacheManager.SetExtPropsSingle((int)PropsSystemTypes.PrestigeMedal, (int)ExtPropIndexes.HitV, hit);
            client.ClientData.PropsCacheManager.SetExtPropsSingle((int)PropsSystemTypes.PrestigeMedal, (int)ExtPropIndexes.DoubleAttack, zhuoYue);
            client.ClientData.PropsCacheManager.SetExtPropsSingle((int)PropsSystemTypes.PrestigeMedal, (int)ExtPropIndexes.DeDoubleAttack, diKang);
        }
Example #2
0
        /// <summary>
        /// 加载声望勋章额外信息
        /// </summary>
        public static bool LoadPrestigeMedalSpecialData()
        {
            string fileName = "Config/ShengWangSpecialAttribute.xml";

            GeneralCachingXmlMgr.RemoveCachingXml(Global.GameResPath(fileName));

            XElement xml = GeneralCachingXmlMgr.GetXElement(Global.GameResPath(fileName));

            if (null == xml)
            {
                LogManager.WriteLog(LogTypes.Fatal, "加载Config/ShengWangSpecialAttribute.xml时出错!!!文件不存在");
                return(false);
            }

            try
            {
                _prestigeMedalSpecialList.Clear();

                IEnumerable <XElement> xmlItems = xml.Elements();
                foreach (var xmlItem in xmlItems)
                {
                    if (xmlItem == null)
                    {
                        continue;
                    }

                    PrestigeMedalSpecialData config = new PrestigeMedalSpecialData();
                    config.SpecialID    = Convert.ToInt32(Global.GetDefAttributeStr(xmlItem, "ID", "0"));
                    config.MedalID      = Convert.ToInt32(Global.GetDefAttributeStr(xmlItem, "NeedFuWen", "0"));
                    config.DoubleAttack = Convert.ToDouble(Global.GetDefAttributeStr(xmlItem, "ZhiMingYiJi", "0"));
                    config.DiDouble     = Convert.ToDouble(Global.GetDefAttributeStr(xmlItem, "DiKangZhiMingYiJi", "0"));
                    _prestigeMedalSpecialList.Add(config.MedalID, config);
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(LogTypes.Fatal, "加载Config/ShengWangSpecialAttribute.xml时出现异常!!!", ex);
                return(false);
            }

            return(true);
        }
Example #3
0
 public static void SetPrestigeMedalProps(GameClient client, PrestigeMedalData PrestigeMedalData)
 {
     if (!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot4Dot1))
     {
         int life    = PrestigeMedalData.LifeAdd;
         int attack  = PrestigeMedalData.AttackAdd;
         int defense = PrestigeMedalData.DefenseAdd;
         int hit     = PrestigeMedalData.HitAdd;
         foreach (PrestigeMedalBasicData d in PrestigeMedalManager._prestigeMedalBasicList.Values)
         {
             if (d.MedalID < PrestigeMedalData.MedalID)
             {
                 life    += d.LifeMax;
                 attack  += d.AttackMax;
                 defense += d.DefenseMax;
                 hit     += d.HitMax;
             }
         }
         double zhuoYue = 0.0;
         double diKang  = 0.0;
         if (PrestigeMedalData.MedalID > 1)
         {
             PrestigeMedalSpecialData d2 = PrestigeMedalManager.GetPrestigeMedalSpecialDataByID(PrestigeMedalData.MedalID - 1);
             zhuoYue += d2.DoubleAttack;
             diKang  += d2.DiDouble;
         }
         client.ClientData.PropsCacheManager.SetExtPropsSingle(new object[]
         {
             9,
             13,
             life
         });
         client.ClientData.PropsCacheManager.SetExtPropsSingle(new object[]
         {
             9,
             45,
             attack
         });
         client.ClientData.PropsCacheManager.SetExtPropsSingle(new object[]
         {
             9,
             46,
             defense
         });
         client.ClientData.PropsCacheManager.SetExtPropsSingle(new object[]
         {
             9,
             18,
             hit
         });
         client.ClientData.PropsCacheManager.SetExtPropsSingle(new object[]
         {
             9,
             36,
             zhuoYue
         });
         client.ClientData.PropsCacheManager.SetExtPropsSingle(new object[]
         {
             9,
             53,
             diKang
         });
     }
 }