public static int GetRadingStartTurn() { DifficultKind difficult = Comm_UserDatas.Instance.User_basic.Difficult; Mst_radingtype mst_radingtype = Enumerable.Last <Mst_radingtype>(Mst_DataManager.Instance.Mst_RadingType.get_Item((int)difficult)); return(mst_radingtype.Turn_to); }
private TurnWorkResult ExecTurnEndWork() { TurnWorkResult turnWorkResult = new TurnWorkResult(); turnWorkResult.ChangeState = TurnState.TURN_START; turnInstance.AddTurn(this); if (turnInstance.GetDateTime().Day == 1) { new Api_req_Quest(this).EnforceQuestReset(); } if (Utils.IsTurnOver()) { Mem_history mem_history = new Mem_history(); mem_history.SetGameOverToTurn(turnInstance.Total_turn); Comm_UserDatas.Instance.Add_History(mem_history); } foreach (Mem_ship value in Comm_UserDatas.Instance.User_ship.Values) { value.BlingWaitToStart(); value.PurgeLovTouchData(); } Comm_UserDatas.Instance.UpdateEscortShipLocale(); Comm_UserDatas.Instance.UpdateDeckShipLocale(); List <Mem_deck> list = Comm_UserDatas.Instance.User_deck.Values.ToList(); list.ForEach(delegate(Mem_deck x) { x.ActionStart(); }); List <Mst_radingtype> types = Mst_DataManager.Instance.Mst_RadingType[(int)basicInstance.Difficult]; Mst_radingtype radingRecord = Mst_radingtype.GetRadingRecord(types, turnInstance.Total_turn); new HashSet <int>(); if (radingRecord != null) { double randDouble = Utils.GetRandDouble(1.0, 100.0, 1.0, 1); if ((double)radingRecord.Rading_rate >= randDouble) { IEnumerable <IGrouping <int, Mem_tanker> > areaEnableTanker = Mem_tanker.GetAreaEnableTanker(Comm_UserDatas.Instance.User_tanker); Dictionary <int, RadingKind> radingArea = getRadingArea(areaEnableTanker, radingRecord.Rading_type); if (radingArea.Count > 0) { Dictionary <int, List <Mem_tanker> > tankers = areaEnableTanker.ToDictionary((IGrouping <int, Mem_tanker> x) => x.Key, (IGrouping <int, Mem_tanker> y) => y.ToList()); turnWorkResult.RadingResult = getRadingResult(radingRecord.Rading_type, radingArea, tankers); } } } updateRadingEscortShipExp(turnWorkResult.RadingResult); if (basicInstance.Difficult == DifficultKind.KOU || basicInstance.Difficult == DifficultKind.SHI) { addRebellionPoint(); selectRegistanceArea(); } else { selectRegistanceArea(); addRebellionPoint(); } return(turnWorkResult); }
public static int GetRadingStartTurn() { DifficultKind difficult = Comm_UserDatas.Instance.User_basic.Difficult; Mst_radingtype mst_radingtype = Mst_DataManager.Instance.Mst_RadingType[(int)difficult].Last(); return(mst_radingtype.Turn_to); }
private TurnWorkResult ExecTurnEndWork() { TurnWorkResult turnWorkResult = new TurnWorkResult(); turnWorkResult.ChangeState = TurnState.TURN_START; this.turnInstance.AddTurn(this); if (this.turnInstance.GetDateTime().get_Day() == 1) { new Api_req_Quest(this).EnforceQuestReset(); } if (Utils.IsTurnOver()) { Mem_history mem_history = new Mem_history(); mem_history.SetGameOverToTurn(this.turnInstance.Total_turn); Comm_UserDatas.Instance.Add_History(mem_history); } using (Dictionary <int, Mem_ship> .ValueCollection.Enumerator enumerator = Comm_UserDatas.Instance.User_ship.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { Mem_ship current = enumerator.get_Current(); current.BlingWaitToStart(); current.PurgeLovTouchData(); } } Comm_UserDatas.Instance.UpdateEscortShipLocale(); Comm_UserDatas.Instance.UpdateDeckShipLocale(); List <Mem_deck> list = Enumerable.ToList <Mem_deck>(Comm_UserDatas.Instance.User_deck.get_Values()); list.ForEach(delegate(Mem_deck x) { x.ActionStart(); }); List <Mst_radingtype> types = Mst_DataManager.Instance.Mst_RadingType.get_Item((int)this.basicInstance.Difficult); Mst_radingtype radingRecord = Mst_radingtype.GetRadingRecord(types, this.turnInstance.Total_turn); HashSet <int> hashSet = new HashSet <int>(); if (radingRecord != null) { double randDouble = Utils.GetRandDouble(1.0, 100.0, 1.0, 1); if ((double)radingRecord.Rading_rate >= randDouble) { IEnumerable <IGrouping <int, Mem_tanker> > areaEnableTanker = Mem_tanker.GetAreaEnableTanker(Comm_UserDatas.Instance.User_tanker); Dictionary <int, RadingKind> radingArea = this.getRadingArea(areaEnableTanker, radingRecord.Rading_type); if (radingArea.get_Count() > 0) { Dictionary <int, List <Mem_tanker> > tankers = Enumerable.ToDictionary <IGrouping <int, Mem_tanker>, int, List <Mem_tanker> >(areaEnableTanker, (IGrouping <int, Mem_tanker> x) => x.get_Key(), (IGrouping <int, Mem_tanker> y) => Enumerable.ToList <Mem_tanker>(y)); turnWorkResult.RadingResult = this.getRadingResult(radingRecord.Rading_type, radingArea, tankers); } } } this.updateRadingEscortShipExp(turnWorkResult.RadingResult); if (this.basicInstance.Difficult == DifficultKind.KOU || this.basicInstance.Difficult == DifficultKind.SHI) { this.addRebellionPoint(); this.selectRegistanceArea(); } else { this.selectRegistanceArea(); this.addRebellionPoint(); } return(turnWorkResult); }