Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        private void _NomralWeapon(RequsetFishData fish_data, int hit_sequence)
        {
            var bufferData = _Visitor.Farm.FindBuffer(
                _Visitor.FocusBufferBlock,
                FarmBuffer.BUFFER_TYPE.SPEC);

            long dieRate = _Visitor.Farm.GameRate - 10;

            dieRate -= bufferData.Rate;

            dieRate += bufferData.BufferTempValue.HiLoRate;

            if (_Visitor.PlayerRecord.Status != 0)
            {
                dieRate += 200;                 // 提高20%
            }

            if (_Request.WeaponData.WeaponType == WEAPON_TYPE.FREE_POWER)
            {
                // 特武 免费炮
                dieRate /= 2;
            }

            if (dieRate < 0)
            {
                dieRate = 0;
            }

            dieRate *= 0x0FFFFFFF;                     // 自然死亡率

            dieRate *= _Request.WeaponData.WeaponOdds; // 子弹威力

            dieRate *= new FishHitAllocateTable().GetAllocateData(_Request.WeaponData.TotalHits, hit_sequence);

            dieRate /= 1000;

            dieRate /= fish_data.FishOdds;             // 鱼的倍数

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

            dieRate /= oddsRule;         // 翻倍

            dieRate /= 1000;             // 死亡率换算回实际百分比

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

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

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

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

            _DieHandle(win, fish_data, dieRate);
        }