예제 #1
0
        public static void ProcessDoulbeExperience()
        {
            DateTime dateTime = TimeUtil.NowDateTime();

            if (dateTime.Ticks - SpecailTimeManager.JugeDoulbeExperienceTicks >= 50000000L)
            {
                SpecailTimeManager.JugeDoulbeExperienceTicks   = dateTime.Ticks;
                SpecailTimeManager.IsDoulbeExperienceAndLingli = SpecailTimeManager.InDoubleExperienceAndLingLiTimeRange(dateTime);
                SpecailTimeManager.IsDoulbeKaoHuo = SpecailTimeManager.InDoubleKaoHuoTimeRange(dateTime);
            }
        }
예제 #2
0
        /// <summary>
        /// 获取喝的二锅头的当前收益
        /// </summary>
        /// <param name="client"></param>
        /// <returns></returns>
        public string GetErGuoTouBufferExperience(GameClient client)
        {
            BufferData bufferData = Global.GetBufferDataByID(client, (int)BufferItemTypes.ErGuoTou);

            if (null == bufferData)
            {
                return("0");
            }

            if (Global.IsBufferDataOver(bufferData))
            {
                return("0");
            }

            //判断如果是否在打坐,则自动增加经验和内力值
            RoleSitExpItem roleSitExpItem = null;

            if (client.ClientData.Level < Data.RoleSitExpList.Length)
            {
                roleSitExpItem = Data.RoleSitExpList[client.ClientData.Level];
            }

            //经验的收益
            if (null != roleSitExpItem)
            {
                int    experience    = roleSitExpItem.Experience;
                double dblExperience = 1.0;

                //这儿应该是双倍烤火时间(后期加入)
                if (SpecailTimeManager.JugeIsDoulbeKaoHuo())
                {
                    dblExperience += 1.0;
                }

                //如果是处于组队状态,则有经验加成
                //处理组队状态下的祝福经验加成
                dblExperience += Global.ProcessTeamZhuFuExperience(client);

                double multiExpNum = (bufferData.BufferVal & 0x00000000FFFFFFFF) - 1.0;

                //增加额外的倍数
                dblExperience += multiExpNum;

                //处理双倍经验的buffer
                experience = (int)(experience * dblExperience);

                return(experience.ToString());
            }

            return("0");
        }
예제 #3
0
        private static bool InDoubleKaoHuoTimeRange(DateTime dateTime)
        {
            DateTimeRange[] dateTimeRangeArray = SpecailTimeManager.GetTimeLimitsByID(2);
            bool            result;

            if (null == dateTimeRangeArray)
            {
                result = false;
            }
            else
            {
                int endMinute = 0;
                result = Global.JugeDateTimeInTimeRange(dateTime, dateTimeRangeArray, out endMinute, true);
            }
            return(result);
        }
예제 #4
0
        public static bool InSpercailTime(int spercailid)
        {
            DateTime dateTime = TimeUtil.NowDateTime();

            DateTimeRange[] dateTimeRangeArray = SpecailTimeManager.GetTimeLimitsByID(spercailid);
            bool            result;

            if (null == dateTimeRangeArray)
            {
                result = false;
            }
            else
            {
                int endMinute = 0;
                result = Global.JugeDateTimeInTimeRange(dateTime, dateTimeRangeArray, out endMinute, true);
            }
            return(result);
        }
예제 #5
0
        /// <summary>
        /// 处理是否是翻倍的时间
        /// </summary>
        public static void ProcessDoulbeExperience()
        {
            DateTime dateTime = DateTime.Now;

            if (dateTime.Ticks - SpecailTimeManager.JugeDoulbeExperienceTicks < (5L * 1000L * 10000L))
            {
                return;
            }

            //限制5秒钟判断一次
            SpecailTimeManager.JugeDoulbeExperienceTicks = dateTime.Ticks;

            //当前是否在双倍经验和双倍灵力时间
            SpecailTimeManager.IsDoulbeExperienceAndLingli = SpecailTimeManager.InDoubleExperienceAndLingLiTimeRange(dateTime);

            //是否是烤火翻倍时间
            SpecailTimeManager.IsDoulbeKaoHuo = SpecailTimeManager.InDoubleKaoHuoTimeRange(dateTime);
        }
예제 #6
0
        public static bool InSpercailTime(int spercailid)
        {
            DateTime dateTime = DateTime.Now;

            DateTimeRange[] dateTimeRangeArray = SpecailTimeManager.GetTimeLimitsByID(spercailid);
            if (null == dateTimeRangeArray)
            {
                return(false);
            }

            int endMinute = 0;

            if (!Global.JugeDateTimeInTimeRange(dateTime, dateTimeRangeArray, out endMinute))
            {
                return(false);
            }

            return(true);
        }
예제 #7
0
        public string GetErGuoTouBufferExperience(GameClient client)
        {
            BufferData bufferData = Global.GetBufferDataByID(client, 48);
            string     result;

            if (null == bufferData)
            {
                result = "0";
            }
            else if (Global.IsBufferDataOver(bufferData, 0L))
            {
                result = "0";
            }
            else
            {
                RoleSitExpItem roleSitExpItem = null;
                if (client.ClientData.Level < Data.RoleSitExpList.Length)
                {
                    roleSitExpItem = Data.RoleSitExpList[client.ClientData.Level];
                }
                if (null != roleSitExpItem)
                {
                    int    experience    = roleSitExpItem.Experience;
                    double dblExperience = 1.0;
                    if (SpecailTimeManager.JugeIsDoulbeKaoHuo())
                    {
                        dblExperience += 1.0;
                    }
                    dblExperience += Global.ProcessTeamZhuFuExperience(client);
                    double multiExpNum = (double)(bufferData.BufferVal & (long)0xffff_ffffUL) - 1.0;
                    dblExperience += multiExpNum;
                    result         = ((int)((double)experience * dblExperience)).ToString();
                }
                else
                {
                    result = "0";
                }
            }
            return(result);
        }
예제 #8
0
 private static int ReloadXmlFile_config_specialtimes()
 {
     return(SpecailTimeManager.ResetSpecialTimeLimits());
 }