Пример #1
0
        private Ship[] GetTargetShips(Fleet[] fleets)
        {
            if (fleets.Count() == 1)
             				return fleets.Single().Ships;

             			if(KanColleClient.Current.Settings.IsViewRangeCalcIncludeFirstFleet
             			&& KanColleClient.Current.Settings.IsViewRangeCalcIncludeSecondFleet)
             				return fleets.SelectMany(x => x.Ships).ToArray();

             			if (KanColleClient.Current.Settings.IsViewRangeCalcIncludeFirstFleet)
             				return fleets.First().Ships;

             			if (KanColleClient.Current.Settings.IsViewRangeCalcIncludeSecondFleet)
             				return fleets.Last().Ships;

             			return new Ship[0];
        }
Пример #2
0
        public override double Calc(Fleet[] fleets)
        {
            if (fleets == null || fleets.Length == 0) return 0;
            var ships = fleets.SelectMany(x => x.Ships).ToArray();

            // http://wikiwiki.jp/kancolle/?%C6%EE%C0%BE%BD%F4%C5%E7%B3%A4%B0%E8#area5
            // [索敵装備と装備例] によって示されている計算式
            // stype=7 が偵察機 (2 倍する索敵値)、stype=8 が電探

            var spotter = ships.SelectMany(
                x => x.EquippedSlots
                    .Where(s => s.Item.Info.RawData.api_type.Get(1) == 7)
                    .Where(s => s.Current > 0)
                    .Select(s => s.Item.Info.RawData.api_saku)
                ).Sum();

            var radar = ships.SelectMany(
                x => x.EquippedSlots
                    .Where(s => s.Item.Info.RawData.api_type.Get(1) == 8)
                    .Select(s => s.Item.Info.RawData.api_saku)
                ).Sum();

            return (spotter * 2) + radar + (int)Math.Sqrt(ships.Sum(x => x.ViewRange) - spotter - radar);
        }
Пример #3
0
        public override double Calc(Fleet[] fleets)
        {
            if (fleets == null || fleets.Length == 0) return 0;
            var ships = fleets.SelectMany(x => x.Ships).ToArray();

            // http://wikiwiki.jp/kancolle/?%C6%EE%C0%BE%BD%F4%C5%E7%B3%A4%B0%E8#search-calc
            // > 2-5式では説明出来ない事象を解決するため膨大な検証報告数より導き出した新式。2014年11月に改良され精度があがった。
            // > 索敵スコア
            // > = 艦上爆撃機 × (1.04)
            // > + 艦上攻撃機 × (1.37)
            // > + 艦上偵察機 × (1.66)
            // > + 水上偵察機 × (2.00)
            // > + 水上爆撃機 × (1.78)
            // > + 小型電探 × (1.00)
            // > + 大型電探 × (0.99)
            // > + 探照灯 × (0.91)
            // > + √(各艦毎の素索敵) × (1.69)
            // > + (司令部レベルを5の倍数に切り上げ) × (-0.61)

            var itemScore = ships
                .SelectMany(x => x.EquippedSlots)
                .Select(x => x.Item.Info)
                .GroupBy(
                    x => x.Type,
                    x => x.RawData.api_saku,
                    (type, scores) => new { type, score = scores.Sum() })
                .Aggregate(.0, (score, item) => score + GetScore(item.type, item.score));

            var shipScore = ships
                .Select(x => x.ViewRange - x.EquippedSlots.Sum(s => s.Item.Info.RawData.api_saku))
                .Select(x => Math.Sqrt(x))
                .Sum() * 1.69;

            var level = (((KanColleClient.Current.Homeport.Admiral.Level + 4) / 5) * 5);
            var admiralScore = level * -0.61;

            return itemScore + shipScore + admiralScore;
        }
Пример #4
0
        public override double Calc(Fleet[] fleets)
        {
            if (fleets == null || fleets.Length == 0) return 0;

            return fleets.SelectMany(x => x.Ships).Sum(x => x.ViewRange);
        }