Esempio n. 1
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);
        }
        public override void Init()
        {
            currSceneID            = playerData.playerZoo.currSceneID;
            sortGateIDs            = GlobalDataManager.GetInstance().logicTableEntryGate.GetSortGateIDs(currSceneID);
            trigerLoadLittleZooIDs = new List <int>();
            parkingCell            = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(currSceneID);
            ticketCell             = GetTicketCell();
            InitLeaveSceneCD();

            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetParkingProfitLevelOfPlayerData, this.OnSetParkingProfitLevelOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetParkingSpaceLevelOfPlayerData, this.OnSetParkingSpaceLevelOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetParkingEnterCarSpawnLevelOfPlayerData, this.OnSetParkingEnterCarSpawnLevelOfPlayerData);

            //MessageManager.GetInstance().Regist((int)GameMessageDefine.SetCoinOfPlayerData, this.OnSetCoinOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.AddCoinOfPlayerDataMSSC, this.OnSetCoinOfPlayerDataMSSC);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetDiamondOfPlayerData, this.OnSetDiamondOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetStarOfPlayerData, this.OnSetStarOfPlayerData);

            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetLittleZooTicketsLevelPlayerData, this.OnSetLittleZooTicketsLevelPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetLittleZooVisitorLocationLevelOfPlayerData, this.OnSetLittleZooVisitorLocationLevelOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetLittleZooEnterVisitorSpawnLevelOfPlayerData, this.OnSetLittleZooEnterVisitorSpawnLevelOfPlayerData);


            MessageManager.GetInstance().Regist((int)GameMessageDefine.OpenNewLittleZoo, this.OnOpenNewLittleZoo);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.VisitorVisitCDFinshedReply, OnVisitorVisitCDFinshedReply);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.EntryGateCheckInCDFinshedReply, OnEntryGateCheckGoToZoo);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetAnimalLevel, this.OnSetAnimalLevelData);

            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetEntryGateLevelOfPlayerData, this.OnSetEntryGateLevelOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetEntryGatePureLevelOfPlayerData, this.OnSetEntryGatePureLevelOfPlayerData);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.SetEntryGateNumOfPlayerData, this.OnSetEntryGateNumOfPlayerData);


            MessageManager.GetInstance().Regist((int)GameMessageDefine.IncreaseCrossRoadStageID, this.OnIncreaseCrossRoadStageID);
        }
    private void SetTicketToClickCallbacks(int sceneID)
    {
        var sortGateIDs = GlobalDataManager.GetInstance().logicTableEntryGate.GetSortGateIDs(sceneID);

        Config.ticketCell ticketCell = Config.ticketConfig.getInstace().getCell(sortGateIDs[0]);
        if (!clickCallbacks.ContainsKey(ticketCell.prefabsname))
        {
            clickCallbacks.Add(ticketCell.prefabsname, OnClickEntry);
        }
    }
Esempio n. 4
0
        /// <summary>
        /// 售票口等级段加成
        /// </summary>
        /// <returns></returns>
        public static System.Numerics.BigInteger GetLevelAddition(Config.ticketCell ticketCell, int level)
        {
            var lvshage = ticketCell.lvshage;
            int idx     = PlayerDataModule.FindLevelRangIndex01(lvshage, level);
            var idx01   = System.Numerics.BigInteger.Parse("1");

            for (int i = 0; i <= idx; i++)
            {
                idx01 = idx01 * ticketCell.lvshagecoefficient[i];
            }
            //LogWarp.LogErrorFormat(" 测试:售票口  Lv={0}, 等级段加成={1}", level, idx01);
            return(idx01);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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);
        }
        public Vector3 GetEntryGateGroupFocusPoint()
        {
            var dinst       = GlobalDataManager.GetInstance();
            var sortGateIDs = dinst.logicTableEntryGate.GetSortGateIDs(dinst.playerData.playerZoo.currSceneID);

            Config.ticketCell ticketCell  = Config.ticketConfig.getInstace().getCell(sortGateIDs[0]);
            Vector3           ret         = Vector3.zero;
            Transform         centerTrans = null;
            GameObject        go          = GameObject.Find("damen");

            if (go != null)
            {
                ret         = go.transform.position;
                centerTrans = go.transform.Find(ticketCell.prefabsname + "/Center");
            }
            if (centerTrans != null)
            {
                ret = centerTrans.position;
            }
            return(ret);
        }
 /// <summary>
 /// 获取对应场景的本地售票口数据
 /// </summary>
 /// <returns></returns>
 private Config.ticketCell GetTicketCell()
 {
     Config.ticketCell ticketCell = null;
     ticketCell = Config.ticketConfig.getInstace().getCell(sortGateIDs[0]);
     return(ticketCell);
 }