Inheritance: ModelBase
コード例 #1
0
        static BattleInfo()
        {
            SessionService.Instance.Subscribe("api_port/port", _ => r_Current = null);

            var rFirstStages = new[]
            {
                "api_req_sortie/battle",
                "api_req_battle_midnight/sp_midnight",
                "api_req_sortie/airbattle",
                "api_req_combined_battle/airbattle",
                "api_req_combined_battle/battle",
                "api_req_combined_battle/battle_water",
                "api_req_combined_battle/sp_midnight",

                "api_req_practice/battle",
            };
            SessionService.Instance.Subscribe(rFirstStages, r => r_Current?.ProcessFirstStage(r));

            var rSecondStages = new[]
            {
                "api_req_battle_midnight/battle",
                "api_req_combined_battle/midnight_battle",

                "api_req_practice/midnight_battle",
            };
            SessionService.Instance.Subscribe(rSecondStages, r => r_Current?.ProcessSecondStage(r));
        }
コード例 #2
0
        protected override void Process(ProgressInfo rpProgress, BattleInfo rpBattle, RawBattleResult rpResult)
        {
            if (!rpBattle.IsBossBattle)
                return;

            var rSortie = SortieInfo.Current;
            if (MapIDs.Contains(rSortie.Map.ID) && rpResult.Rank >= LowestRank)
                rpProgress.Progress++;
        }
コード例 #3
0
        internal BattleEvent(MapInfo rpMap, RawMapExploration rpData, string rpNodeWikiID) : base(rpData)
        {
            Battle = new BattleInfo(rpData);

            int rNodeID;
            if (rpNodeWikiID.IsNullOrEmpty())
                rNodeID = rpData.Node << 16;
            else
                rNodeID = rpNodeWikiID[0] - 'A';
            EnemyEncounters = EnemyEncounterService.Instance.GetEncounters(rpMap.ID, rNodeID, rpMap.Difficulty);
        }
コード例 #4
0
        public FakeStage(BattleInfo rpOwner) : base(rpOwner)
        {
            Func<IParticipant, BattleParticipantSnapshot> rSelector = r =>
            {
                var rHP = ((FriendShip)r).Ship.HP;
                return new BattleParticipantSnapshot(rHP.Maximum, rHP.Current) { Participant = r };
            };

            FriendMain = rpOwner.Participants.FriendMain.Select(rSelector).ToList().AsReadOnly();
            FriendEscort = rpOwner.Participants.FriendEscort?.Select(rSelector).ToList().AsReadOnly();
        }
コード例 #5
0
        public FakeStage(BattleInfo rpOwner) : base(rpOwner)
        {
            Func <IParticipant, BattleParticipantSnapshot> rSelector = r =>
            {
                var rHP = ((FriendShip)r).Ship.HP;
                return(new BattleParticipantSnapshot(rHP.Maximum, rHP.Current)
                {
                    Participant = r
                });
            };

            FriendMain   = rpOwner.Participants.FriendMain.Select(rSelector).ToArray();
            FriendEscort = rpOwner.Participants.FriendEscort?.Select(rSelector).ToArray();
        }
コード例 #6
0
        protected override void Process(ProgressInfo rpProgress, BattleInfo rpBattle, RawBattleResult rpResult)
        {
            var rBits = new BitVector32(rpProgress.Progress);

            if (rpResult.Rank >= BattleRank.S)
                rBits[r_Sections[1]] = Math.Min(rBits[r_Sections[1]] + 1, 6);
            if (rpBattle.IsBossBattle)
                rBits[r_Sections[2]] = Math.Min(rBits[r_Sections[2]] + 1, 24);
            if (rpBattle.IsBossBattle && rpResult.Rank >= BattleRank.B)
                rBits[r_Sections[3]] = Math.Min(rBits[r_Sections[3]] + 1, 12);

            rpProgress.Progress = rBits.Data;
            UpdatePercentage(rpProgress, rBits);
        }
コード例 #7
0
        internal BattleInfo()
        {
            r_Current = this;

            var rFleets = KanColleGame.Current.Port.Fleets;
            if (rFleets.CombinedFleetType == 0)
                Participants.FriendMain = KanColleGame.Current.Sortie.Fleet.Ships.Select(r => new FriendShip(r)).ToList<IParticipant>();
            else
            {
                Participants.FriendMain = rFleets[1].Ships.Select(r => new FriendShip(r)).ToList<IParticipant>().AsReadOnly();
                Participants.FriendEscort = rFleets[2].Ships.Select(r => new FriendShip(r)).ToList<IParticipant>().AsReadOnly();
            }

            CurrentStage = new FakeStage(this);
            OnPropertyChanged(nameof(CurrentStage));
        }
コード例 #8
0
 internal protected BattleStage(BattleInfo rpOwner)
 {
     Owner = rpOwner;
 }
コード例 #9
0
 internal protected BattleStage(BattleInfo rpOwner)
 {
     Owner = rpOwner;
 }
コード例 #10
0
 protected override void Process(ProgressInfo rpProgress, BattleInfo rpBattle, RawBattleResult rpResult)
 {
     rpProgress.Progress += rpBattle.CurrentStage.Enemy.Count(r => r.State == BattleParticipantState.Sunk && TargetType.Contains(r.Participant.Info.Type.ID));
 }
コード例 #11
0
 protected abstract void Process(ProgressInfo rpProgress, BattleInfo rpBattle, RawBattleResult rpResult);
コード例 #12
0
 internal BattleEvent(RawMapExploration rpData) : base(rpData)
 {
     Battle = new BattleInfo();
 }
コード例 #13
0
        internal BattleInfo(Fleet rpParticipantFleet)
        {
            r_Current = this;

            Participants.FriendMain = rpParticipantFleet.Ships.Select(r => new FriendShip(r)).ToList<IParticipant>();
        }
コード例 #14
0
 protected override void Process(ProgressInfo rpProgress, BattleInfo rpBattle, RawBattleResult rpResult)
 {
     rpProgress.Progress++;
 }