protected void Tick_LeaveSceneCoin(int deltaTimeMs)
        {
            var  sceneStates        = playerData.playerZoo.scenePlayerDataMSS.sceneStates;
            var  msg                = BroadcastLeaveSceneCoin.PreSend();
            var  leaveSceneCoinData = GlobalDataManager.GetInstance().leaveSceneCoinData;
            bool isAddedCoin        = false;

            for (int i = 0; i < sceneStates.Count; i++)
            {
                var sceneState = sceneStates[i];
                if ((sceneState.enterCount > 0 || sceneState.sceneId == GameConst.First_SceneID) &&
                    sceneState.sceneId != playerData.playerZoo.currSceneID)
                {
                    var perMinCoin = PlayerDataModule.LeaveScenePerMinCoin(sceneState.sceneId, true);
                    perMinCoin = perMinCoin * deltaTimeMs / 60000;
                    if (perMinCoin > 0)
                    {
                        isAddedCoin = true;
                        playerData.playerZoo.playerCoin.AddCoinByScene(sceneState.sceneId, perMinCoin);
                        msg.AddSceneCoin(sceneState.sceneId, perMinCoin);
                        leaveSceneCoinData.AddCoin(sceneState.sceneId, perMinCoin);
                    }
                }
            }

            if (isAddedCoin)
            {
                //发送离开金币收入消息
                BroadcastLeaveSceneCoin.Send();

                //广播金币收入变化
                MessageManager.GetInstance().Send((int)GameMessageDefine.BroadcastCoinOfPlayerDataMSSC);
            }
        }
Exemple #2
0
        ///// <summary>
        ///// 售票口基础产出公式:Y=base*0.05*1.07^((lv*1.6)-1)
        ///// </summary>
        ///// <returns></returns>
        //public static System.Numerics.BigInteger GetEntryBaseTollPrice(int level)
        //{
        //    if (level<1)
        //    {
        //        //Logger.LogWarp.LogError("等级为0");
        //        level = 1;
        //    }
        //    int baseprice = Config.ticketConfig.getInstace().getCell(1).pricebase;
        //    int number = (int)(level * 1.6f) - 1;
        //    //1.07^((lv*1.6)-1)
        //    var numerator = System.Numerics.BigInteger.Parse("107");
        //    numerator = System.Numerics.BigInteger.Pow(numerator, number);
        //    var denominator = System.Numerics.BigInteger.Parse("100");
        //    denominator = System.Numerics.BigInteger.Pow(denominator, number);

        //    //base * 0.05 * numerator/(denominator*100)
        //    var price = numerator * baseprice*5 / (denominator*100);

        //    return price;
        //}
        /// <summary>
        /// 售票口门票价格
        /// </summary>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetEntryPrice(int level, int sceneID, bool noBuffAffect)
        {   //Y=pricebase*等级段加成*(0.1*lv+0.9)*场景加成*BUFF加成+MIN(5*lv,500)
            if (sceneID == -1)
            {
                sceneID = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;
            }
            var allData = Config.ticketConfig.getInstace().AllData;

            Config.ticketCell ticketCell = null;
            foreach (var item in allData)
            {
                if (item.Value.scene == sceneID)
                {
                    ticketCell = item.Value;
                    break;
                }
            }
            //pricebase
            var pricebase = System.Numerics.BigInteger.Parse(ticketCell.pricebase);
            //等级段加成
            var lvAddition = GetLevelAddition(ticketCell, level);
            //(0.1*lv+0.9)
            float idx_1 = 0.1f * level + 0.9f;
            //场景加成
            int doublenum = Config.sceneConfig.getInstace().getCell(sceneID).doublenum;
            //BUFF加成
            float buffAll = PlayerDataModule.PlayerRatioCoinInComeAll(sceneID, noBuffAffect);
            //MIN(5*lv,500)
            int idx_2 = level;
            var price = pricebase * doublenum * lvAddition * GetInteger(idx_1 * buffAll * 100) / 100 + idx_2;

            //LogWarp.LogErrorFormat("测试:pricebase={0},等级段加成={1},产出基数={2},场景加成={3},BUFF加成={4},MIN(5*lv,500)={5}",
            //    pricebase, lvAddition, idx_1, doublenum, buffAll, idx_2);
            return(price);
        }
        /// <summary>
        /// 当前岛屿的所有场景/m收益
        /// </summary>
        /// <param name="isNeedMulBuff">false为不需要增益buff</param>
        /// <returns></returns>
        public static System.Numerics.BigInteger AllScenePerMinCoin(bool isNeedMulBuff)
        {
            var playerData = GlobalDataManager.GetInstance().playerData;
            int idx        = Config.sceneConfig.getInstace().getCell(playerData.playerZoo.currSceneID).scenetype;
            //当前场景/m收益
            var big = CurrScenePerMinCoin(isNeedMulBuff);
            //非当前场景的离线金币奖励
            var sceneStates = playerData.playerZoo.scenePlayerDataMSS.sceneStates;

            for (int i = 0; i < sceneStates.Count; i++)
            {
                var sceneState = sceneStates[i];
                if ((sceneState.enterCount > 0 || sceneState.sceneId == GameConst.First_SceneID) &&
                    sceneState.sceneId != playerData.playerZoo.currSceneID)
                {
                    if (Config.sceneConfig.getInstace().getCell(sceneState.sceneId).scenetype == idx)
                    {
                        var perMinCoin = PlayerDataModule.LeaveScenePerMinCoin(sceneState.sceneId, isNeedMulBuff);
                        big += perMinCoin;
                    }
                }
            }

            return(big);
        }
Exemple #4
0
 /// <summary>
 /// 获取场景每分钟收益
 /// </summary>
 /// <param name="sceneId"></param>
 /// <returns></returns>
 public System.Numerics.BigInteger GetSceneEarningsPerMinute(int sceneId)
 {
     if (sceneId == currSceneId)
     {
         return(PlayerDataModule.CurrScenePerMinCoin(true));
     }
     return(PlayerDataModule.LeaveScenePerMinCoin(sceneId, true));
 }
        /// <summary>
        /// 动物栏等级段加成
        /// </summary>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetLevelAddition(Config.buildupCell buildupCell, int level)
        {
            var lvshage = buildupCell.lvshage;
            int idx     = PlayerDataModule.FindLevelRangIndex01(lvshage, level);
            var idx01   = System.Numerics.BigInteger.Parse("1");

            for (int i = 0; i <= idx; i++)
            {
                idx01 = idx01 * buildupCell.lvshagecoefficient[i];
            }
            //LogWarp.LogErrorFormat(" 测试:动物栏 Lv={0},下标={1} 等级段加成={2}", level, idx, idx01);
            return(idx01);
        }
Exemple #6
0
        /// <summary>
        /// 升级收费速度的花费  Y=lv*10
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>


        /// <summary>
        /// 每分钟购票顾客升级消耗
        /// </summary>
        /// <param name="entryID"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeCheckinSpeedConsumption(int entryID, int level)
        {   /*  Y=lvupcastbase*lvupcastratio^(lv-1)*加成预期【进客速度期望等级】+lv   */
            Config.ticketCell          ticketCell = Config.ticketConfig.getInstace().getCell(entryID);
            System.Numerics.BigInteger baseVal    = System.Numerics.BigInteger.Parse(ticketCell.lvupcastbase);
            int   expectlevel   = GetUpVisitorSpeedExpectLevel(entryID, level);
            float lvupcastratio = ticketCell.lvupcastratio;
            var   computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(lvupcastratio, level - 1);

            int sceneID = ticketCell.scene;
            int number  = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectlevel) * 100);
            var price   = baseVal * computePowFloatToBigInteger.str_numerator * number / (computePowFloatToBigInteger.str_denominator * 100);

            //Logger.LogWarp.LogErrorFormat("测试:baseVal={0}  ,baseConsumption={1} number={2}", baseVal, baseConsumption, PlayerDataModule.GetAdditionExpect(level));
            return(price + level);
        }
        /// <summary>
        /// 当前动物栏的观光游客数量升级花费
        /// </summary>
        /// <param name="littleZooID"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeEnterVisitorSpawnLevelConsumption(int littleZooID, int level)
        {
            // Y=timeupbase*basenumber1^(lv-1)*加成预期【动物栏速率期望等级】
            string baseVal = Config.buildupConfig.getInstace().getCell(littleZooID).timeupbase;

            System.Numerics.BigInteger number01 = System.Numerics.BigInteger.Parse(baseVal);
            int expectlevel = GetUpVisitDurationExpectLevel(littleZooID, level);

            var basenumber = Config.buildupConfig.getInstace().getCell(littleZooID).basenumber1;
            var computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(basenumber, level - 1);

            int sceneID  = Config.buildupConfig.getInstace().getCell(littleZooID).scene;
            int number03 = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectlevel) * 100);
            var price    = number01 * computePowFloatToBigInteger.str_numerator * number03 / (100 * computePowFloatToBigInteger.str_denominator);

            return(price);
        }
        /// <summary>
        /// 当前动物栏的观光点数量升级花费
        /// </summary>
        /// <param name="littleZooID"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeVisitorLocationLevelConsumption(int littleZooID, int level)
        {   /* Y=watchupbase*期望等级消耗基数【观光点期望等级】*加成预期【观光点期望等级】 */
            string baseVal     = Config.buildupConfig.getInstace().getCell(littleZooID).watchupbase;
            int    expectlevel = GetUpGradeVisitorLocationExpectLevel(littleZooID, level);

            System.Numerics.BigInteger number01 = System.Numerics.BigInteger.Parse(baseVal);

            var basenumber = Config.buildupConfig.getInstace().getCell(littleZooID).basenumber;
            var computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(basenumber, expectlevel - 1);

            int sceneID  = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;
            int number03 = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectlevel) * 100);
            var price    = number01 * computePowFloatToBigInteger.str_numerator * number03 / (100 * computePowFloatToBigInteger.str_denominator);

            //LogWarp.LogErrorFormat("  baseVal={0}, expectlevel={1}, number02={2}, number03={3} ", baseVal, expectlevel, number02, number03);

            return(price);
        }
Exemple #9
0
        /// <summary>
        /// 售票口门票升级
        /// </summary>
        /// <param name="expectLevel"></param>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeConsumption(int level)
        {
            /*  Y=depbase*停售消耗基数【门票升级期望等级】*加成预期【门票升级期望等级】   */
            Config.ticketCell ticketCell = Config.ticketConfig.getInstace().getCell(sortEntryGateIDs[0]);
            string            depbase    = ticketCell.depbase;
            int sceneID = ticketCell.scene;

            System.Numerics.BigInteger baseVal = System.Numerics.BigInteger.Parse(depbase);
            int   expectLevel = GetUpTicketExpectLevel(level);
            float basenumber  = ticketCell.basenumber;
            var   computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(basenumber, level + 1);
            int   additionExpect = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectLevel) * 100);
            var   price          = baseVal * computePowFloatToBigInteger.str_numerator * additionExpect / (100 * computePowFloatToBigInteger.str_denominator);

            //LogWarp.LogErrorFormat("测试:  depbase ={0},分子={1},AA={2},加成预期={3},等级={4}",
            //    baseVal, computePowFloatToBigInteger.str_numerator, basenumber, additionExpect, level);
            return(price + level);
        }
Exemple #10
0
        /// <summary>
        /// 停车位数量最大位置升级消耗
        /// </summary>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeNumberConsumption(int level = -1)
        {   /*   Y=base*停售消耗基数【停车位数期望等级】*加成预期【停车位数期望等级】   */
            if (level == -1)
            {
                level = GlobalDataManager.GetInstance().playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingSpaceLevel;
            }
            int expectlevel = ParkingSpaceExpectLevel(level);
            int sceneID     = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;

            Config.parkingCell parkingCell = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(sceneID);
            string             str         = parkingCell.spaceupcastbase;

            System.Numerics.BigInteger baseVal = System.Numerics.BigInteger.Parse(str);
            var computePowFloatToBigInteger    = PlayerDataModule.GetComputePowFloatToBigInteger(parkingCell.basenumber, expectlevel - 1);
            int number = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectlevel) * 100);

            var price = baseVal * computePowFloatToBigInteger.str_numerator * number / (100 * computePowFloatToBigInteger.str_denominator);

            return(price);
        }
Exemple #11
0
        /// <summary>
        /// 每分钟招揽游客升级消耗
        /// </summary>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeEnterCarSpawnConsumption(int level = -1)
        {   /*   Y=base*停售消耗基数【来客速度期望等级】*加成预期【来客速度期望等级】   */
            if (level == -1)
            {
                level = GlobalDataManager.GetInstance().playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingEnterCarSpawnLevel;
            }
            int expectlevel = ParkingEnterCarSpawnExpectLevel(level);
            int sceneID     = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;

            Config.parkingCell parkingCell = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(sceneID);
            string             str         = parkingCell.touristcastbase;

            System.Numerics.BigInteger baseVal = System.Numerics.BigInteger.Parse(str);
            float basenumber = parkingCell.basenumber;
            var   computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(basenumber, expectlevel - 1);
            int   number = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectlevel) * 100);

            var price = baseVal * computePowFloatToBigInteger.str_numerator * number / (computePowFloatToBigInteger.str_denominator * 100);

            //LogWarp.LogErrorFormat("测试:  baseVal={0}, computePowFloatToBigInteger.str_numerator={1}, number={2}, computePowFloatToBigInteger.str_denominator={3}", baseVal, computePowFloatToBigInteger.str_numerator, number, computePowFloatToBigInteger.str_denominator);
            return(price);
        }
Exemple #12
0
        /// <summary>
        /// 停车场利润升级消耗
        /// </summary>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeParkingProfitConsumption(int level = -1)
        {   /*   Y=base*停售消耗基数【停车位数期望等级】*加成预期【停车位数期望等级】   */
            if (level == -1)
            {
                level = GlobalDataManager.GetInstance().playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingProfitLevel;
            }
            int expectLevel = ParkingProfitExpectLevel(level);
            int sceneID     = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;

            Config.parkingCell parkingCell = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(sceneID);
            string             str         = parkingCell.depletebase;

            System.Numerics.BigInteger baseVal = System.Numerics.BigInteger.Parse(str);
            var computePowFloatToBigInteger    = PlayerDataModule.GetComputePowFloatToBigInteger(parkingCell.basenumber, expectLevel - 1);
            int additionExpect = (int)(PlayerDataModule.GetAdditionExpect(sceneID, expectLevel) * 100);

            var price = baseVal * computePowFloatToBigInteger.str_numerator * additionExpect / (100 * computePowFloatToBigInteger.str_denominator);

            //LogWarp.LogErrorFormat("测试:  depbase ={0},分子={1},AA={2},加成预期={3},等级={4}",
            //   baseVal, computePowFloatToBigInteger.str_numerator, parkingCell.basenumber, additionExpect, level);
            return(price + level);
        }
        ///// <summary>
        ///// 动物升级消耗基数
        ///// </summary>
        ///// <param name="littleZooID">动物栏ID</param>
        ///// <param name="level">初始基数</param>
        ///// <returns></returns>
        //public static System.Numerics.BigInteger GetUpGradeBaseConsumption(int littleZooID,int level)
        //{
        //    //         Y=basenumber^(lv-1)+1
        //    var basenumber = Config.buildupConfig.getInstace().getCell(littleZooID).basenumber;

        //    var computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(basenumber,level-1);
        //    var number = computePowFloatToBigInteger.str_numerator / computePowFloatToBigInteger.str_denominator + 1;

        //    return number;
        //}


        /// <summary>
        /// 动物栏门票价格升级消耗
        /// </summary>
        /// <param name="littleZooID"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetUpGradeConsumption(int littleZooID, int level)
        {   /*  Y=castbase*动物消耗基数【动物栏门票期望等级】*加成预期【动物栏门票期望等级】*0.7 + lv    */
            int isLevel = level;
            var str     = Config.buildupConfig.getInstace().getCell(littleZooID).castbase;

            System.Numerics.BigInteger allbase = System.Numerics.BigInteger.Parse(str);
            int sceneID = Config.buildupConfig.getInstace().getCell(littleZooID).scene;

            var expectLevel = GetUpLittleZooPriceExpectLevel(littleZooID, level);

            var basenumber = Config.buildupConfig.getInstace().getCell(littleZooID).basenumber;
            var computePowFloatToBigInteger = PlayerDataModule.GetComputePowFloatToBigInteger(basenumber, level - 1);

            //System.Numerics.BigInteger upGradeBaseConsumption = GetUpGradeBaseConsumption(littleZooID, level);

            float additionExpect = PlayerDataModule.GetAdditionExpect(sceneID, expectLevel);
            int   number1        = (int)((additionExpect * 0.7f) * 100);

            System.Numerics.BigInteger price = computePowFloatToBigInteger.str_numerator * allbase * number1 / (computePowFloatToBigInteger.str_denominator * 100);
            //LogWarp.LogErrorFormat("测试:动物栏={0} 期望等级={1},depbase ={2},底={3},加成预期={4},分子={5},",
            //                              littleZooID, expectLevel, allbase, basenumber, additionExpect, computePowFloatToBigInteger.str_numerator);
            return(price + level);
        }
        /// <summary>
        /// 动物栏门票:
        /// </summary>
        /// <param name="level">动物栏等级</param>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetLittleZooPrice(int littleZooID, int level, bool isNeedMulBuff = false)
        {   /*      Y=pricebase*等级段加成*动物栏产出基数*场景加成*BUFF加成+MIN(5*lv,500)    */
            var buildupCell = Config.buildupConfig.getInstace().getCell(littleZooID);
            int sceneID     = buildupCell.scene;

            //基础值
            System.Numerics.BigInteger pricebase = System.Numerics.BigInteger.Parse(buildupCell.pricebase);
            //等级段加成
            var lvAddition = GetLevelAddition(buildupCell, level);
            //动物栏产出基数
            var baseTollPrice = GetLittleZooBaseTollPrice(littleZooID, level);
            //场景加成
            int doublenum = Config.sceneConfig.getInstace().getCell(sceneID).doublenum;
            //buff加成
            float buffAll = PlayerDataModule.PlayerRatioCoinInComeAll(sceneID, isNeedMulBuff);
            //MIN(5*lv,500)
            int idx_2 = level;

            var price = pricebase * lvAddition * doublenum * GetInteger(baseTollPrice * buffAll * 100) / 100 + idx_2;

            //LogWarp.LogErrorFormat("测试:pricebase={0},等级段加成={1},动物栏产出基数={2},场景加成={3},BUFF加成={4}",
            //    pricebase, lvAddition, baseTollPrice, doublenum, buffAll);
            return(price);
        }