Example #1
0
        public void Run()
        {
            var randomValue = _Visitor.FindIRandom(RandomData.RULE.ADJUSTMENT_PLAYER_PHASE, 0).NextInt(0, 1000);

            if (_CheckPlayerRecord(randomValue))
            {
                return;
            }

            randomValue = _Visitor.FindIRandom(RandomData.RULE.ADJUSTMENT_PLAYER_PHASE, 1).NextInt(0, 1000);

            // 從VIR00 - VIR03
            CheckFarmBufferType(randomValue);
        }
Example #2
0
        /// <summary>
        ///     檢查隨機道具
        /// </summary>
        private void _CheckRandom()
        {
            // 拿到魚的掉落物品清單
            var randomWeapons = FishTreasure.Get().Find(x => x.FishType == _FishData.FishType).RandomWeapons;

            var bufferData = _DataVisitor.Farm.FindBuffer(_DataVisitor.FocusBufferBlock, FarmBuffer.BUFFER_TYPE.SPEC);

            var list = new List <WEAPON_TYPE>();

            // 計算魚掉那個寶
            foreach (var t in randomWeapons)
            {
                long gate = bufferData.Rate / randomWeapons.Length;

                var dd = new SpecialWeaponPowerTable().WeaponPowers.FirstOrDefault(x => x.WeaponType == t);

                var power = new SpecialWeaponPowerTable().WeaponPowers.Find(x => x.WeaponType == t).Power;

                gate = (0x0FFFFFFF / power) * gate;

                gate = gate / 1000;

                if (bufferData.BufferTempValue.HiLoRate >= 0)
                {
                    gate *= 2;
                }

                if (bufferData.BufferTempValue.HiLoRate < -200)
                {
                    gate /= 2;
                }

                var randomValue = _DataVisitor.FindIRandom(RandomData.RULE.CHECK_TREASURE, 0).NextInt(0, 0x10000000);
                if (randomValue >= gate)
                {
                    continue;
                }

                // 在這隻魚身上得到的道具
                list.Add(t);
            }

            OrderByWeapon(list);
        }
Example #3
0
        private bool _CheckFishTypeToOddsRule(RequsetFishData fish_data)
        {
            if (fish_data.FishType >= FISH_TYPE.SPECIAL_SCREEN_BOMB &&
                fish_data.FishType <= FISH_TYPE.SPECIAL_BIG_OCTOPUS_BOMB)
            {
                return(false);                // 特殊鱼 不翻倍
            }

            if (fish_data.FishOdds < 10)
            {
                return(false);                // 小鱼 不翻倍
            }

            if (fish_data.FishType == FISH_TYPE.BLUE_WHALE)
            {
                var randNumber = _Visitor.FindIRandom(RandomData.RULE.ODDS, 0).NextInt(0, 1000);
                if (randNumber < 500)
                {
                    return(false);                    // 藍鯨 50%不翻倍
                }
            }

            if (fish_data.FishType == FISH_TYPE.RED_WHALE)
            {
                var randNumber = _Visitor.FindIRandom(RandomData.RULE.ODDS, 1).NextInt(0, 1000);
                if (randNumber < 750)
                {
                    return(false);                    // 藍鯨 75%不翻倍
                }
            }

            if (fish_data.FishType == FISH_TYPE.GOLDEN_WHALE)
            {
                var randNumber = _Visitor.FindIRandom(RandomData.RULE.ODDS, 2).NextInt(0, 1000);
                if (randNumber < 875)
                {
                    return(false);                    // 金鯨 87%不翻倍
                }
            }

            return(true);
        }
Example #4
0
        private void _SpecialWeapon(RequsetFishData fish_data)
        {
            long dieRate =
                new SpecialWeaponPowerTable().WeaponPowers.Find(x => x.WeaponType == _Request.WeaponData.WeaponType).Power;

            dieRate *= 0x0FFFFFFF;

            dieRate /= _Request.FishDatas.Sum(x => x.FishOdds);             // 总倍数

            var bufferData = _Visitor.Farm.FindBuffer(
                _Visitor.FocusBufferBlock,
                FarmBuffer.BUFFER_TYPE.NORMAL);

            var oddsRule = new OddsRuler(_Visitor, fish_data, bufferData).RuleResult();

            dieRate /= oddsRule;


            if (dieRate > 0x0FFFFFFF)
            {
                dieRate = 0x10000000;                 // > 100%
            }

            if (_Request.WeaponData.WeaponType == WEAPON_TYPE.BIG_OCTOPUS_BOMB)
            {
                dieRate = 0x10000000;                 // > 100%
            }

            var randomValue = _Visitor.FindIRandom(RandomData.RULE.DEATH, 0).NextInt(0, 0x10000000);

            if (randomValue >= dieRate)
            {
                _Miss(fish_data, _Request.WeaponData, dieRate);
                return;
            }

            var win = fish_data.FishOdds * _Request.WeaponData.GetTotalBet() * oddsRule;

            _DieHandle(win, fish_data, dieRate);
        }