public Api_Result <AllBattleFmt> Night_Sp(BattleFormationKinds1 formationKind)
        {
            Api_Result <AllBattleFmt> api_Result = new Api_Result <AllBattleFmt>();

            if (this.userData == null)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Mst_mapcell2 nowCell = this.mapInstance.GetNowCell();

            if (nowCell.Event_2 != enumMapWarType.Midnight || this.battleKinds != ExecBattleKinds.None)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (this.userData.ShipData.get_Item(0).Get_DamageState() == DamageState.Taiha)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            base.initFormation(formationKind);
            AllBattleFmt allBattleFmt = new AllBattleFmt(this.userData.Formation, this.enemyData.Formation, this.userData.BattleFormation);
            Dictionary <int, List <Mst_slotitem> > useRationShips = null;
            List <int> list = null;

            if (!this.getCombatRationResult(out useRationShips, out list))
            {
                useRationShips = null;
            }
            using (Exec_Midnight exec_Midnight = new Exec_Midnight(2, this.seikuValue, this.userData, this.userSubInfo, this.enemyData, this.enemySubInfo, false))
            {
                allBattleFmt.NightBattle = exec_Midnight.GetResultData(this.formationParams, this.battleCommandParams);
                allBattleFmt.NightBattle.Header.UseRationShips = useRationShips;
            }
            this.battleKinds  = ExecBattleKinds.NightOnly;
            api_Result.data   = allBattleFmt;
            this.allBattleFmt = allBattleFmt;
            return(api_Result);
        }
Beispiel #2
0
        public Api_Result <AllBattleFmt> Night_Sp(BattleFormationKinds1 formationKind)
        {
            Api_Result <AllBattleFmt> api_Result = new Api_Result <AllBattleFmt>();

            if (userData == null)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Mst_mapcell2 nowCell = mapInstance.GetNowCell();

            if (nowCell.Event_2 != enumMapWarType.Midnight || battleKinds != 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (userData.ShipData[0].Get_DamageState() == DamageState.Taiha)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            initFormation(formationKind);
            AllBattleFmt allBattleFmt = new AllBattleFmt(userData.Formation, enemyData.Formation, userData.BattleFormation);
            Dictionary <int, List <Mst_slotitem> > useShipInfo = null;
            List <int> givenShips = null;

            if (!getCombatRationResult(out useShipInfo, out givenShips))
            {
                useShipInfo = null;
            }
            using (Exec_Midnight exec_Midnight = new Exec_Midnight(2, seikuValue, userData, userSubInfo, enemyData, enemySubInfo, practice: false))
            {
                allBattleFmt.NightBattle = exec_Midnight.GetResultData(formationParams, battleCommandParams);
                allBattleFmt.NightBattle.Header.UseRationShips = useShipInfo;
            }
            battleKinds       = ExecBattleKinds.NightOnly;
            api_Result.data   = allBattleFmt;
            base.allBattleFmt = allBattleFmt;
            return(api_Result);
        }