示例#1
0
        private void updateShip(BattleWinRankKinds rank, int mvpShip, SerializableDictionary <int, int> getShipExp, out SerializableDictionary <int, List <int> > lvupInfo)
        {
            lvupInfo = new SerializableDictionary <int, List <int> >();
            List <Mem_ship> shipData = F_Data.ShipData;
            int             count    = shipData.Count;
            bool            flag     = true;
            double          num      = 1.0;
            double          num2     = 0.0;

            if (!practiceFlag)
            {
                flag = E_Data.ShipData.Exists((Mem_ship x) => (!Mst_DataManager.Instance.Mst_stype[x.Stype].IsSubmarine()) ? true : false);
                if (!flag)
                {
                    num  = 0.25;
                    num2 = 0.5;
                }
            }
            Dictionary <int, int> dictionary = mst_shiplevel;

            for (int i = 0; i < count; i++)
            {
                Mem_ship     mem_ship     = shipData[i];
                Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);
                Mst_ship     mst_ship     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                int          addExp       = getShipExp[mem_ship.Rid];
                List <int>   lvupInfo2    = null;
                int          levelupInfo  = mem_ship.getLevelupInfo(dictionary, mem_shipBase.Level, mem_shipBase.Exp, ref addExp, out lvupInfo2);
                lvupInfo.Add(mem_ship.Rid, lvupInfo2);
                if (!mem_ship.Escape_sts)
                {
                    mem_shipBase.Level = levelupInfo;
                    mem_shipBase.Exp  += addExp;
                    mem_shipBase.Fuel -= mst_ship.Use_fuel;
                    if (mem_shipBase.Fuel < 0)
                    {
                        mem_shipBase.Fuel = 0;
                    }
                    int num3 = mst_ship.Use_bull;
                    if (battleKinds == ExecBattleKinds.DayToNight)
                    {
                        num3 = (int)Math.Ceiling((double)num3 * 1.5);
                    }
                    num3 = (int)((double)num3 * num + num2);
                    if (!flag && num3 <= 0)
                    {
                        num3 = 1;
                    }
                    mem_shipBase.Bull -= num3;
                    if (mem_shipBase.Bull < 0)
                    {
                        mem_shipBase.Bull = 0;
                    }
                    setCondSubValue(ref mem_shipBase.Cond);
                    bool mvp   = (mvpShip == mem_ship.Rid) ? true : false;
                    bool flag2 = (F_SubInfo[mem_ship.Rid].DeckIdx == 0) ? true : false;
                    setCondBonus(rank, flag2, mvp, ref mem_shipBase.Cond);
                    int num4 = levelupInfo - mem_ship.Level;
                    Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = mem_ship.Kyouka;
                    for (int j = 0; j < num4; j++)
                    {
                        dictionary2 = mem_ship.getLevelupKyoukaValue(mem_ship.Ship_id, dictionary2);
                    }
                    mem_shipBase.SetKyoukaValue(dictionary2);
                    if (mem_ship.Get_DamageState() >= DamageState.Tyuuha)
                    {
                        clothBrokenIds.Add(mem_ship.Ship_id);
                    }
                    if (practiceFlag)
                    {
                        mem_shipBase.Nowhp = F_Data.StartHp[i];
                    }
                    else if (mem_shipBase.Nowhp <= 0)
                    {
                        deleteTargetShip.Add(mem_ship);
                    }
                    int value  = 0;
                    int value2 = 0;
                    dictionary.TryGetValue(mem_shipBase.Level - 1, out value);
                    dictionary.TryGetValue(mem_shipBase.Level + 1, out value2);
                    mem_ship.SetRequireExp(mem_shipBase.Level, dictionary);
                    mem_ship.SumLovToBattle(rank, flag2, mvp, F_Data.StartHp[i], mem_ship.Nowhp);
                    mem_shipBase.Lov = mem_ship.Lov;
                    mem_ship.Set_ShipParam(mem_shipBase, mst_ship, enemy_flag: false);
                }
            }
        }