public DeckPracticeResultModel(DeckPracticeType type, PracticeDeckResultFmt fmt, UserInfoModel user_info, Dictionary <int, int> exp_rates_before) { _type = type; _mission_fmt = fmt.PracticeResult; _powup = fmt.PowerUpData; _user_info = user_info; _exps = new Dictionary <int, ShipExpModel>(); _SetShipExp(exp_rates_before); }
public Api_Result <PracticeDeckResultFmt> GetResultData(DeckPracticeType type, int deck_rid) { Api_Result <PracticeDeckResultFmt> api_Result = new Api_Result <PracticeDeckResultFmt>(); if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, out mem_deck)) { api_Result.state = Api_Result_State.Parameter_Error; return(api_Result); } mem_ship = mem_deck.Ship.getMemShip(); PracticeDeckResultFmt practiceDeckResultFmt = new PracticeDeckResultFmt(); practiceDeckResultFmt.PracticeResult.Deck = mem_deck; practiceDeckResultFmt.PracticeResult.GetSpoint = 0; if (execFunc == null) { execFunc = new Dictionary <DeckPracticeType, Action <PracticeDeckResultFmt> > { { DeckPracticeType.Normal, getPracticeUpInfo_To_Normal }, { DeckPracticeType.Hou, getPracticeUpInfo_To_Houg }, { DeckPracticeType.Rai, getPracticeUpInfo_To_Raig }, { DeckPracticeType.Taisen, getPracticeUpInfo_To_Taisen }, { DeckPracticeType.Kouku, getPracticeUpInfo_To_Kouku }, { DeckPracticeType.Sougou, getPracticeUpInfo_To_Sougou } }; } execFunc[type](practiceDeckResultFmt); practiceDeckResultFmt.PracticeResult.MemberLevel = updateRecordLevel(practiceDeckResultFmt.PracticeResult.GetMemberExp); practiceDeckResultFmt.PracticeResult.LevelUpInfo = updateShip(type, practiceDeckResultFmt.PracticeResult.GetShipExp, practiceDeckResultFmt.PowerUpData); api_Result.data = practiceDeckResultFmt; mem_deck.ActionEnd(); QuestPractice questPractice = new QuestPractice(type, practiceDeckResultFmt); questPractice.ExecuteCheck(); Comm_UserDatas.Instance.User_record.UpdatePracticeCount(BattleWinRankKinds.NONE, practiceBattle: false); return(api_Result); }
private void getPracticeUpInfo_To_Sougou(PracticeDeckResultFmt fmt) { int level = this.mem_ship.get_Item(0).Level; double num = Math.Sqrt((double)this.mem_ship.get_Item(0).Level); bool flag = Mst_DataManager.Instance.Mst_stype.get_Item(this.mem_ship.get_Item(0).Stype).IsTrainingShip(); double num2 = 30.0 + Utils.GetRandDouble(0.0, 10.0, 1.0, 1) + num; fmt.PracticeResult.GetMemberExp = (int)num2; int num3 = (!flag) ? 0 : 1; fmt.PracticeResult.GetShipExp = new Dictionary <int, int>(); fmt.PowerUpData = new Dictionary <int, PowUpInfo>(); Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship; double difficultShipExpKeisu = this.getDifficultShipExpKeisu(); double shipExpCommonKeisu = this.getShipExpCommonKeisu(); using (List <Mem_ship> .Enumerator enumerator = this.mem_ship.GetEnumerator()) { while (enumerator.MoveNext()) { Mem_ship current = enumerator.get_Current(); fmt.PracticeResult.GetShipExp.Add(current.Rid, 0); fmt.PowerUpData.Add(current.Rid, default(PowUpInfo)); Mst_ship mst_ship2 = mst_ship.get_Item(current.Ship_id); double num4 = Math.Sqrt((double)current.Level); double num5 = 40.0 + Utils.GetRandDouble(0.0, 10.0, 1.0, 1) + (double)(num3 * 10) + Utils.GetRandDouble(0.0, num, 1.0, 1) + num4; num5 = num5 * difficultShipExpKeisu * shipExpCommonKeisu; fmt.PracticeResult.GetShipExp.set_Item(current.Rid, (int)num5); Ship_GrowValues battleBaseParam = current.GetBattleBaseParam(); PowUpInfo powUpInfo = default(PowUpInfo); double max = 1.0 + (num + num4) / 20.0; powUpInfo.Karyoku = (int)Utils.GetRandDouble(0.0, max, 1.0, 1); if (battleBaseParam.Houg + powUpInfo.Karyoku > mst_ship2.Houg_max) { int num6 = mst_ship2.Houg_max - mst_ship2.Houg; powUpInfo.Karyoku = num6 - current.Kyouka.get_Item(Mem_ship.enumKyoukaIdx.Houg); } double max2 = 0.7 + (num + num4) / 20.0; powUpInfo.Lucky = (int)Utils.GetRandDouble(0.0, max2, 1.0, 1); if (battleBaseParam.Luck + powUpInfo.Lucky > mst_ship2.Luck_max) { int num7 = mst_ship2.Luck_max - mst_ship2.Luck; powUpInfo.Lucky = num7 - current.Kyouka.get_Item(Mem_ship.enumKyoukaIdx.Luck); } fmt.PowerUpData.set_Item(current.Rid, powUpInfo); } } }
private void getPracticeUpInfo_To_Sougou(PracticeDeckResultFmt fmt) { int level = mem_ship[0].Level; double num = Math.Sqrt(mem_ship[0].Level); bool flag = Mst_DataManager.Instance.Mst_stype[mem_ship[0].Stype].IsTrainingShip(); double num2 = 30.0 + Utils.GetRandDouble(0.0, 10.0, 1.0, 1) + num; fmt.PracticeResult.GetMemberExp = (int)num2; int num3 = flag ? 1 : 0; fmt.PracticeResult.GetShipExp = new Dictionary <int, int>(); fmt.PowerUpData = new Dictionary <int, PowUpInfo>(); Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship; double difficultShipExpKeisu = getDifficultShipExpKeisu(); double shipExpCommonKeisu = getShipExpCommonKeisu(); foreach (Mem_ship item in mem_ship) { fmt.PracticeResult.GetShipExp.Add(item.Rid, 0); fmt.PowerUpData.Add(item.Rid, default(PowUpInfo)); Mst_ship mst_ship2 = mst_ship[item.Ship_id]; double num4 = Math.Sqrt(item.Level); double num5 = 40.0 + Utils.GetRandDouble(0.0, 10.0, 1.0, 1) + (double)(num3 * 10) + Utils.GetRandDouble(0.0, num, 1.0, 1) + num4; num5 = num5 * difficultShipExpKeisu * shipExpCommonKeisu; fmt.PracticeResult.GetShipExp[item.Rid] = (int)num5; Ship_GrowValues battleBaseParam = item.GetBattleBaseParam(); PowUpInfo value = default(PowUpInfo); double max = 1.0 + (num + num4) / 20.0; value.Karyoku = (int)Utils.GetRandDouble(0.0, max, 1.0, 1); if (battleBaseParam.Houg + value.Karyoku > mst_ship2.Houg_max) { int num6 = mst_ship2.Houg_max - mst_ship2.Houg; value.Karyoku = num6 - item.Kyouka[Mem_ship.enumKyoukaIdx.Houg]; } double max2 = 0.7 + (num + num4) / 20.0; value.Lucky = (int)Utils.GetRandDouble(0.0, max2, 1.0, 1); if (battleBaseParam.Luck + value.Lucky > mst_ship2.Luck_max) { int num7 = mst_ship2.Luck_max - mst_ship2.Luck; value.Lucky = num7 - item.Kyouka[Mem_ship.enumKyoukaIdx.Luck]; } fmt.PowerUpData[item.Rid] = value; } }
private void getPracticeUpInfo_To_Taisen(PracticeDeckResultFmt fmt) { int level = this.mem_ship.get_Item(0).Level; double num = Math.Sqrt((double)this.mem_ship.get_Item(0).Level); bool flag = Mst_DataManager.Instance.Mst_stype.get_Item(this.mem_ship.get_Item(0).Stype).IsTrainingShip(); fmt.PracticeResult.GetMemberExp = 0; int num2 = (!flag) ? 0 : 1; fmt.PracticeResult.GetShipExp = new Dictionary <int, int>(); fmt.PowerUpData = new Dictionary <int, PowUpInfo>(); double difficultShipExpKeisu = this.getDifficultShipExpKeisu(); double shipExpCommonKeisu = this.getShipExpCommonKeisu(); Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship; using (List <Mem_ship> .Enumerator enumerator = this.mem_ship.GetEnumerator()) { while (enumerator.MoveNext()) { Mem_ship current = enumerator.get_Current(); fmt.PracticeResult.GetShipExp.Add(current.Rid, 0); fmt.PowerUpData.Add(current.Rid, default(PowUpInfo)); Mst_ship mst_ship2 = mst_ship.get_Item(current.Ship_id); if (mst_ship2.Tais != 0) { double num3 = Math.Sqrt((double)current.Level); double max = (double)(12 + num2 * 6); double num4 = 7.0 + Utils.GetRandDouble(0.0, max, 1.0, 1) + Utils.GetRandDouble(0.0, num, 1.0, 1) + num / 2.0 + num3; num4 = num4 * difficultShipExpKeisu * shipExpCommonKeisu; fmt.PracticeResult.GetShipExp.set_Item(current.Rid, (int)num4); PowUpInfo powUpInfo = default(PowUpInfo); double max2 = 1.4 + (double)num2 * 0.3 + (num + num3) / 20.0; powUpInfo.Taisen = (int)Utils.GetRandDouble(0.0, max2, 1.0, 1); Ship_GrowValues battleBaseParam = current.GetBattleBaseParam(); if (battleBaseParam.Taisen + powUpInfo.Taisen > mst_ship2.Tais_max) { int num5 = mst_ship2.Tais_max - mst_ship2.Tais; powUpInfo.Taisen = num5 - current.Kyouka.get_Item(Mem_ship.enumKyoukaIdx.Taisen); } fmt.PowerUpData.set_Item(current.Rid, powUpInfo); } } } }
private void getPracticeUpInfo_To_Taisen(PracticeDeckResultFmt fmt) { int level = mem_ship[0].Level; double num = Math.Sqrt(mem_ship[0].Level); bool flag = Mst_DataManager.Instance.Mst_stype[mem_ship[0].Stype].IsTrainingShip(); fmt.PracticeResult.GetMemberExp = 0; int num2 = flag ? 1 : 0; fmt.PracticeResult.GetShipExp = new Dictionary <int, int>(); fmt.PowerUpData = new Dictionary <int, PowUpInfo>(); double difficultShipExpKeisu = getDifficultShipExpKeisu(); double shipExpCommonKeisu = getShipExpCommonKeisu(); Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship; foreach (Mem_ship item in mem_ship) { fmt.PracticeResult.GetShipExp.Add(item.Rid, 0); fmt.PowerUpData.Add(item.Rid, default(PowUpInfo)); Mst_ship mst_ship2 = mst_ship[item.Ship_id]; if (mst_ship2.Tais != 0) { double num3 = Math.Sqrt(item.Level); double max = 12 + num2 * 6; double num4 = 7.0 + Utils.GetRandDouble(0.0, max, 1.0, 1) + Utils.GetRandDouble(0.0, num, 1.0, 1) + num / 2.0 + num3; num4 = num4 * difficultShipExpKeisu * shipExpCommonKeisu; fmt.PracticeResult.GetShipExp[item.Rid] = (int)num4; PowUpInfo value = default(PowUpInfo); double max2 = 1.4 + (double)num2 * 0.3 + (num + num3) / 20.0; value.Taisen = (int)Utils.GetRandDouble(0.0, max2, 1.0, 1); Ship_GrowValues battleBaseParam = item.GetBattleBaseParam(); if (battleBaseParam.Taisen + value.Taisen > mst_ship2.Tais_max) { int num5 = mst_ship2.Tais_max - mst_ship2.Tais; value.Taisen = num5 - item.Kyouka[Mem_ship.enumKyoukaIdx.Taisen]; } fmt.PowerUpData[item.Rid] = value; } } }
public Api_Result <PracticeDeckResultFmt> GetResultData(DeckPracticeType type, int deck_rid) { Api_Result <PracticeDeckResultFmt> api_Result = new Api_Result <PracticeDeckResultFmt>(); if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, ref this.mem_deck)) { api_Result.state = Api_Result_State.Parameter_Error; return(api_Result); } this.mem_ship = this.mem_deck.Ship.getMemShip(); PracticeDeckResultFmt practiceDeckResultFmt = new PracticeDeckResultFmt(); practiceDeckResultFmt.PracticeResult.Deck = this.mem_deck; practiceDeckResultFmt.PracticeResult.GetSpoint = 0; if (this.execFunc == null) { Dictionary <DeckPracticeType, Action <PracticeDeckResultFmt> > dictionary = new Dictionary <DeckPracticeType, Action <PracticeDeckResultFmt> >(); dictionary.Add(DeckPracticeType.Normal, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Normal)); dictionary.Add(DeckPracticeType.Hou, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Houg)); dictionary.Add(DeckPracticeType.Rai, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Raig)); dictionary.Add(DeckPracticeType.Taisen, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Taisen)); dictionary.Add(DeckPracticeType.Kouku, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Kouku)); dictionary.Add(DeckPracticeType.Sougou, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Sougou)); this.execFunc = dictionary; } this.execFunc.get_Item(type).Invoke(practiceDeckResultFmt); practiceDeckResultFmt.PracticeResult.MemberLevel = this.updateRecordLevel(practiceDeckResultFmt.PracticeResult.GetMemberExp); practiceDeckResultFmt.PracticeResult.LevelUpInfo = this.updateShip(type, practiceDeckResultFmt.PracticeResult.GetShipExp, practiceDeckResultFmt.PowerUpData); api_Result.data = practiceDeckResultFmt; this.mem_deck.ActionEnd(); QuestPractice questPractice = new QuestPractice(type, practiceDeckResultFmt); questPractice.ExecuteCheck(); Comm_UserDatas.Instance.User_record.UpdatePracticeCount(BattleWinRankKinds.NONE, false); return(api_Result); }
private void getPracticeUpInfo_To_Kouku(PracticeDeckResultFmt fmt) { int level = mem_ship[0].Level; double num = Math.Sqrt(mem_ship[0].Level); bool flag = Mst_DataManager.Instance.Mst_stype[mem_ship[0].Stype].IsTrainingShip(); fmt.PracticeResult.GetMemberExp = 0; int num2 = flag ? 1 : 0; fmt.PracticeResult.GetShipExp = new Dictionary <int, int>(); fmt.PowerUpData = new Dictionary <int, PowUpInfo>(); double difficultShipExpKeisu = getDifficultShipExpKeisu(); double shipExpCommonKeisu = getShipExpCommonKeisu(); Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship; foreach (Mem_ship item in mem_ship) { fmt.PracticeResult.GetShipExp.Add(item.Rid, 0); fmt.PowerUpData.Add(item.Rid, default(PowUpInfo)); Mst_ship mst_ship2 = mst_ship[item.Ship_id]; if (mst_ship2.Stype != 13) { if (mst_ship2.Stype == 14) { List <Mst_slotitem> mstSlotItems = item.GetMstSlotItems(); bool flag2 = false; for (int i = 0; i < mstSlotItems.Count; i++) { SlotitemCategory slotitem_type = Mst_DataManager.Instance.Mst_equip_category[mstSlotItems[i].Type3].Slotitem_type; if (slotitem_type == SlotitemCategory.Kanjouki || slotitem_type == SlotitemCategory.Suijouki) { flag2 = true; break; } } if (!flag2) { continue; } } double num3 = Math.Sqrt(item.Level); double max = 14 + num2 * 7; double num4 = 10.0 + Utils.GetRandDouble(0.0, max, 1.0, 1) + Utils.GetRandDouble(0.0, num, 1.0, 1) + num / 2.0 + num3; num4 = num4 * difficultShipExpKeisu * shipExpCommonKeisu; fmt.PracticeResult.GetShipExp[item.Rid] = (int)num4; Ship_GrowValues battleBaseParam = item.GetBattleBaseParam(); PowUpInfo value = default(PowUpInfo); double max2 = 1.5 + (double)num2 * 0.2 + (num + num3) / 20.0; value.Taiku = (int)Utils.GetRandDouble(0.0, max2, 1.0, 1); if (battleBaseParam.Taiku + value.Taiku > mst_ship2.Tyku_max) { int num5 = mst_ship2.Tyku_max - mst_ship2.Tyku; value.Taiku = num5 - item.Kyouka[Mem_ship.enumKyoukaIdx.Tyku]; } if (motherBGroup.Contains(item.Stype)) { double max3 = 1.2 + (num + num3) / 20.0; value.Karyoku = (int)Utils.GetRandDouble(0.0, max3, 1.0, 1); if (battleBaseParam.Houg + value.Karyoku > mst_ship2.Houg_max) { int num6 = mst_ship2.Houg_max - mst_ship2.Houg; value.Karyoku = num6 - item.Kyouka[Mem_ship.enumKyoukaIdx.Houg]; } } fmt.PowerUpData[item.Rid] = value; } } }
public QuestPractice(DeckPracticeType pracType, PracticeDeckResultFmt pracResultFmt) : this() { deckPrackType = pracType; deckPracticeResult = pracResultFmt; }
private QuestPractice() { checkData = getCheckDatas(3); battleResult = null; deckPracticeResult = null; }
private QuestPractice() { this.checkData = base.getCheckDatas(3); this.battleResult = null; this.deckPracticeResult = null; }
private void getPracticeUpInfo_To_Kouku(PracticeDeckResultFmt fmt) { int level = this.mem_ship.get_Item(0).Level; double num = Math.Sqrt((double)this.mem_ship.get_Item(0).Level); bool flag = Mst_DataManager.Instance.Mst_stype.get_Item(this.mem_ship.get_Item(0).Stype).IsTrainingShip(); fmt.PracticeResult.GetMemberExp = 0; int num2 = (!flag) ? 0 : 1; fmt.PracticeResult.GetShipExp = new Dictionary <int, int>(); fmt.PowerUpData = new Dictionary <int, PowUpInfo>(); double difficultShipExpKeisu = this.getDifficultShipExpKeisu(); double shipExpCommonKeisu = this.getShipExpCommonKeisu(); Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship; using (List <Mem_ship> .Enumerator enumerator = this.mem_ship.GetEnumerator()) { while (enumerator.MoveNext()) { Mem_ship current = enumerator.get_Current(); fmt.PracticeResult.GetShipExp.Add(current.Rid, 0); fmt.PowerUpData.Add(current.Rid, default(PowUpInfo)); Mst_ship mst_ship2 = mst_ship.get_Item(current.Ship_id); if (mst_ship2.Stype != 13) { if (mst_ship2.Stype == 14) { List <Mst_slotitem> mstSlotItems = current.GetMstSlotItems(); bool flag2 = false; for (int i = 0; i < mstSlotItems.get_Count(); i++) { SlotitemCategory slotitem_type = Mst_DataManager.Instance.Mst_equip_category.get_Item(mstSlotItems.get_Item(i).Type3).Slotitem_type; if (slotitem_type == SlotitemCategory.Kanjouki || slotitem_type == SlotitemCategory.Suijouki) { flag2 = true; break; } } if (!flag2) { continue; } } double num3 = Math.Sqrt((double)current.Level); double max = (double)(14 + num2 * 7); double num4 = 10.0 + Utils.GetRandDouble(0.0, max, 1.0, 1) + Utils.GetRandDouble(0.0, num, 1.0, 1) + num / 2.0 + num3; num4 = num4 * difficultShipExpKeisu * shipExpCommonKeisu; fmt.PracticeResult.GetShipExp.set_Item(current.Rid, (int)num4); Ship_GrowValues battleBaseParam = current.GetBattleBaseParam(); PowUpInfo powUpInfo = default(PowUpInfo); double max2 = 1.5 + (double)num2 * 0.2 + (num + num3) / 20.0; powUpInfo.Taiku = (int)Utils.GetRandDouble(0.0, max2, 1.0, 1); if (battleBaseParam.Taiku + powUpInfo.Taiku > mst_ship2.Tyku_max) { int num5 = mst_ship2.Tyku_max - mst_ship2.Tyku; powUpInfo.Taiku = num5 - current.Kyouka.get_Item(Mem_ship.enumKyoukaIdx.Tyku); } if (this.motherBGroup.Contains(current.Stype)) { double max3 = 1.2 + (num + num3) / 20.0; powUpInfo.Karyoku = (int)Utils.GetRandDouble(0.0, max3, 1.0, 1); if (battleBaseParam.Houg + powUpInfo.Karyoku > mst_ship2.Houg_max) { int num6 = mst_ship2.Houg_max - mst_ship2.Houg; powUpInfo.Karyoku = num6 - current.Kyouka.get_Item(Mem_ship.enumKyoukaIdx.Houg); } } fmt.PowerUpData.set_Item(current.Rid, powUpInfo); } } } }