Beispiel #1
0
        public int GetRequireUseBauxiteNum(Mem_ship ship, ref int haveBauxite, out List <int> afterOnslot)
        {
            afterOnslot = new List <int>(ship.Onslot);
            if (haveBauxite == 0)
            {
                return(0);
            }
            int      num      = haveBauxite;
            Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(ship.Ship_id);

            for (int i = 0; i < ship.Slotnum; i++)
            {
                if (haveBauxite == 0)
                {
                    break;
                }
                if (afterOnslot.get_Item(i) < mst_ship.Maxeq.get_Item(i))
                {
                    int num2 = ship.Slot.get_Item(i);
                    int num3 = mst_ship.Maxeq.get_Item(i) - ship.Onslot.get_Item(i);
                    int num4 = num3 * 5;
                    if (haveBauxite >= num4)
                    {
                        afterOnslot.set_Item(i, afterOnslot.get_Item(i) + num3);
                        haveBauxite -= num4;
                    }
                }
            }
            return(num - haveBauxite);
        }
Beispiel #2
0
        private void updateShipPracticeEnemy(SerializableDictionary <int, int> getShipExp, ref SerializableDictionary <int, List <int> > lvupInfo)
        {
            List <Mem_ship>       shipData  = E_Data.ShipData;
            Dictionary <int, int> mst_level = mst_shiplevel;

            foreach (Mem_ship item in shipData)
            {
                Mem_ship     mem_ship     = Comm_UserDatas.Instance.User_ship[item.Rid];
                Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);
                Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                int          addExp       = getShipExp[mem_ship.Rid];
                List <int>   lvupInfo2    = null;
                int          levelupInfo  = mem_ship.getLevelupInfo(mst_level, mem_shipBase.Level, mem_shipBase.Exp, ref addExp, out lvupInfo2);
                lvupInfo.Add(mem_ship.Rid, lvupInfo2);
                mem_shipBase.Level = levelupInfo;
                mem_shipBase.Exp  += addExp;
                int num = levelupInfo - mem_ship.Level;
                Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = mem_ship.Kyouka;
                for (int i = 0; i < num; i++)
                {
                    dictionary = mem_ship.getLevelupKyoukaValue(mem_ship.Ship_id, dictionary);
                }
                mem_shipBase.SetKyoukaValue(dictionary);
                mem_ship.SetRequireExp(mem_shipBase.Level, mst_level);
                mem_ship.Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
            }
        }
Beispiel #3
0
        public void ShipAddExp(List <Mem_ship> ships, List <int> addExps)
        {
            int count = addExps.get_Count();
            Dictionary <int, int> dictionary = Mst_DataManager.Instance.Get_MstLevel(true);

            for (int i = 0; i < count; i++)
            {
                Mem_shipBase mem_shipBase = new Mem_shipBase(ships.get_Item(i));
                Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship.get_Item(mem_shipBase.Ship_id);
                List <int>   list         = null;
                int          num          = addExps.get_Item(i);
                int          levelupInfo  = ships.get_Item(i).getLevelupInfo(dictionary, ships.get_Item(i).Level, ships.get_Item(i).Exp, ref num, out list);
                mem_shipBase.Level = levelupInfo;
                mem_shipBase.Exp  += num;
                int num2 = levelupInfo - ships.get_Item(i).Level;
                Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = ships.get_Item(i).Kyouka;
                for (int j = 0; j < num2; j++)
                {
                    dictionary2 = ships.get_Item(i).getLevelupKyoukaValue(ships.get_Item(i).Ship_id, dictionary2);
                }
                mem_shipBase.SetKyoukaValue(dictionary2);
                int num3 = 0;
                int num4 = 0;
                dictionary.TryGetValue(mem_shipBase.Level - 1, ref num3);
                dictionary.TryGetValue(mem_shipBase.Level + 1, ref num4);
                ships.get_Item(i).SetRequireExp(mem_shipBase.Level, dictionary);
                ships.get_Item(i).Set_ShipParam(mem_shipBase, mst_data, false);
            }
        }
Beispiel #4
0
        public int GetRequireUseBauxiteNum(Mem_ship ship, ref int haveBauxite, out List <int> afterOnslot)
        {
            afterOnslot = new List <int>(ship.Onslot);
            if (haveBauxite == 0)
            {
                return(0);
            }
            int      num      = haveBauxite;
            Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship[ship.Ship_id];

            for (int i = 0; i < ship.Slotnum; i++)
            {
                if (haveBauxite == 0)
                {
                    break;
                }
                if (afterOnslot[i] < mst_ship.Maxeq[i])
                {
                    int num4 = ship.Slot[i];
                    int num2 = mst_ship.Maxeq[i] - ship.Onslot[i];
                    int num3 = num2 * 5;
                    if (haveBauxite >= num3)
                    {
                        afterOnslot[i] += num2;
                        haveBauxite    -= num3;
                    }
                }
            }
            return(num - haveBauxite);
        }
Beispiel #5
0
        public void ShipAddExp(List <Mem_ship> ships, List <int> addExps)
        {
            int count = addExps.Count;
            Dictionary <int, int> dictionary = Mst_DataManager.Instance.Get_MstLevel(shipTable: true);

            for (int i = 0; i < count; i++)
            {
                Mem_shipBase mem_shipBase = new Mem_shipBase(ships[i]);
                Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                List <int>   lvupInfo     = null;
                int          addExp       = addExps[i];
                int          num          = mem_shipBase.Level = ships[i].getLevelupInfo(dictionary, ships[i].Level, ships[i].Exp, ref addExp, out lvupInfo);
                mem_shipBase.Exp += addExp;
                int num2 = num - ships[i].Level;
                Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = ships[i].Kyouka;
                for (int j = 0; j < num2; j++)
                {
                    dictionary2 = ships[i].getLevelupKyoukaValue(ships[i].Ship_id, dictionary2);
                }
                mem_shipBase.SetKyoukaValue(dictionary2);
                int value  = 0;
                int value2 = 0;
                dictionary.TryGetValue(mem_shipBase.Level - 1, out value);
                dictionary.TryGetValue(mem_shipBase.Level + 1, out value2);
                ships[i].SetRequireExp(mem_shipBase.Level, dictionary);
                ships[i].Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
            }
        }
        public BattleBaseData(Mem_deck deck)
        {
            List <Mem_ship> memShip = deck.Ship.getMemShip();

            this.ShipData       = new List <Mem_ship>();
            this.SlotData       = new List <List <Mst_slotitem> >();
            this.StartHp        = new List <int>();
            this.SlotLevel      = new List <List <int> >();
            this.SlotExperience = new Dictionary <int, int[]>();
            memShip.ForEach(delegate(Mem_ship x)
            {
                this.SlotData.Add(x.GetMstSlotItems());
                List <int> list = null;
                this.setSlotLevel(x.Slot, false, out list, ref this.SlotExperience);
                this.SlotLevel.Add(list);
                Mst_ship mst_data     = Mst_DataManager.Instance.Mst_ship.get_Item(x.Ship_id);
                Mem_shipBase baseData = new Mem_shipBase(x);
                Mem_ship mem_ship     = new Mem_ship();
                mem_ship.Set_ShipParamPracticeShip(baseData, mst_data);
                this.ShipData.Add(mem_ship);
                this.StartHp.Add(mem_ship.Nowhp);
            });
            this.Enemy_Name        = deck.Name;
            this.haveBattleCommand = false;
        }
Beispiel #7
0
        public bool Check_51()
        {
            if (userDeckShip[1].Count < 6)
            {
                return(false);
            }
            if (userDeckShip[1][0].Ship_id != 427)
            {
                return(false);
            }
            HashSet <string> enableYomi = new HashSet <string>
            {
                "あおば",
                "きぬがさ",
                "かこ",
                "ふるたか",
                "てんりゅう",
                "ゆうばり"
            };
            int num = userDeckShip[1].Count(delegate(Mem_ship x)
            {
                Mst_ship value = null;
                return(mstShips.TryGetValue(x.Ship_id, out value) && enableYomi.Contains(value.Yomi));
            });

            return((num == 5) ? true : false);
        }
Beispiel #8
0
        private void updateShip(Dictionary <int, int> shipExp, out Dictionary <int, List <int> > lvupInfo)
        {
            lvupInfo = new Dictionary <int, List <int> >();
            int count = mem_ships.Count;

            for (int i = 0; i < count; i++)
            {
                mem_ships[i].SetSubFuel_ToMission(mst_mission.Use_fuel);
                mem_ships[i].SetSubBull_ToMission(mst_mission.Use_bull);
                Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ships[i]);
                Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                List <int>   lvupInfo2    = null;
                int          addExp       = shipExp[mem_ships[i].Rid];
                int          levelupInfo  = mem_ships[i].getLevelupInfo(mst_level, mem_ships[i].Level, mem_ships[i].Exp, ref addExp, out lvupInfo2);
                lvupInfo.Add(mem_ships[i].Rid, lvupInfo2);
                mem_shipBase.Level = levelupInfo;
                mem_shipBase.Exp  += addExp;
                int num = levelupInfo - mem_ships[i].Level;
                Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = mem_ships[i].Kyouka;
                for (int j = 0; j < num; j++)
                {
                    dictionary = mem_ships[i].getLevelupKyoukaValue(mem_ships[i].Ship_id, dictionary);
                }
                mem_shipBase.SetKyoukaValue(dictionary);
                setCondSubValue(ref mem_shipBase.Cond);
                int value  = 0;
                int value2 = 0;
                mst_level.TryGetValue(mem_shipBase.Level - 1, out value);
                mst_level.TryGetValue(mem_shipBase.Level + 1, out value2);
                mem_ships[i].SetRequireExp(mem_shipBase.Level, mst_level);
                mem_ships[i].Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
                mem_ships[i].SumLovToMission(resultInfo.MissionResult);
            }
        }
Beispiel #9
0
        protected virtual int getBakuraiAtkPow(FighterInfo fighter, int fighterNum, Mem_ship target)
        {
            if (!fighter.ValidBakurai())
            {
                return(0);
            }
            Mst_ship  mst_ship  = Mst_DataManager.Instance.Mst_ship[target.Ship_id];
            Mst_stype mst_stype = Mst_DataManager.Instance.Mst_stype[target.Stype];
            int       num       = fighter.AttackShipPow;

            if (fighter.Kind == FighterInfo.FighterKinds.RAIG && mst_stype.IsLandFacillity(mst_ship.Soku))
            {
                num = 0;
            }
            int    num2 = 150;
            double num3 = valance3 + (double)num * Math.Sqrt(fighterNum);

            if (fighter.Kind == FighterInfo.FighterKinds.RAIG)
            {
                num3 *= 0.8 + (double)randInstance.Next(2) * 0.7;
            }
            if (num3 > (double)num2)
            {
                num3 = (double)num2 + Math.Sqrt(num3 - (double)num2);
            }
            return((int)num3);
        }
Beispiel #10
0
 public __ShipModel_Battle__(Mst_ship mst_data, __ShipModel_Battle_BaseData__ baseData, int hp, List <SlotitemModel_Battle> slotitems, SlotitemModel_Battle slotitemex)
 {
     _mst_data   = mst_data;
     _base_data  = baseData;
     _hp         = hp;
     _slotitems  = slotitems;
     _slotitemex = slotitemex;
 }
 public ShipModel_Defender(Mst_ship mst_data, __ShipModel_Battle_BaseData__ baseData, int hp, List <SlotitemModel_Battle> slotitems, SlotitemModel_Battle slotitemex)
 {
     this._mst_data          = mst_data;
     this._base_data         = baseData;
     this._hp_before         = hp;
     this._slotitems_before  = slotitems;
     this._slotitemex_before = slotitemex;
     this._hp_after          = (this._hp_pre_after = (this._hp_after_recovery = this._hp_before));
 }
 public ShipModel_Eater(Mst_ship mst_data, __ShipModel_Battle_BaseData__ baseData, int hp, List <SlotitemModel_Battle> slotitems, SlotitemModel_Battle slotitemex)
 {
     this._mst_data          = mst_data;
     this._base_data         = baseData;
     this._hp                = hp;
     this._slotitems_before  = slotitems;
     this._slotitemex_before = slotitemex;
     this._init();
 }
Beispiel #13
0
        private bool containsAllYomi(List <Mem_ship> ships, HashSet <string> target)
        {
            int num = ships.Count(delegate(Mem_ship x)
            {
                Mst_ship value = null;
                return(mstShips.TryGetValue(x.Ship_id, out value) && target.Contains(value.Yomi));
            });

            return((target.Count() <= num) ? true : false);
        }
Beispiel #14
0
        public Api_Result <Mem_ship> Marriage(int ship_rid)
        {
            Api_Result <Mem_ship> api_Result = new Api_Result <Mem_ship>();

            if (!this.ValidMarriage(ship_rid))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Mem_useitem mem_useitem = null;

            if (!Comm_UserDatas.Instance.User_useItem.TryGetValue(55, ref mem_useitem))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mem_useitem.Value == 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            Mem_ship     mem_ship     = Comm_UserDatas.Instance.User_ship.get_Item(ship_rid);
            Mst_ship     mst_ship     = Mst_DataManager.Instance.Mst_ship.get_Item(mem_ship.Ship_id);
            Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);
            int          num          = mem_ship.Maxhp - mem_shipBase.C_taik_powerup;
            int          num2         = num + this.getMariageTaik(num);

            if (num2 > mst_ship.Taik_max)
            {
                num2 = mst_ship.Taik_max;
            }
            mem_shipBase.C_taik         = num2 - mst_ship.Taik;
            mem_shipBase.C_taik_powerup = ((num2 + mem_shipBase.C_taik_powerup <= mst_ship.Taik_max) ? mem_shipBase.C_taik_powerup : (mst_ship.Taik_max - num2));
            num2 += mem_shipBase.C_taik_powerup;
            mem_shipBase.Nowhp = num2;
            int luck = mem_ship.Luck;
            int num3 = (int)Utils.GetRandDouble(3.0, 6.0, 1.0, 1);
            int num4 = luck + num3;

            if (num4 > mst_ship.Luck_max)
            {
                num4 = mst_ship.Luck_max;
            }
            mem_shipBase.C_luck = num4 - mst_ship.Luck;
            mem_shipBase.Level  = 100;
            mem_ship.Set_ShipParam(mem_shipBase, mst_ship, false);
            Dictionary <int, int> mst_level = Mst_DataManager.Instance.Get_MstLevel(true);

            mem_ship.SetRequireExp(mem_ship.Level, mst_level);
            mem_ship.SumLovToMarriage();
            Comm_UserDatas.Instance.Ship_book.get_Item(mem_ship.Ship_id).UpdateShipBook(false, true);
            Comm_UserDatas.Instance.User_useItem.get_Item(55).Sub_UseItem(1);
            api_Result.data = mem_ship;
            return(api_Result);
        }
Beispiel #15
0
        public static void DeckRefresh(int DeckID)
        {
            List <Mem_ship> memShip = Comm_UserDatas.Instance.User_deck[DeckID].Ship.getMemShip();

            foreach (Mem_ship item in memShip)
            {
                item.SubHp(-(item.Maxhp - item.Nowhp));
                Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship[item.Ship_id];
                item.Set_ChargeData(mst_ship.Bull_max, mst_ship.Fuel_max, mst_ship.Maxeq.ToList());
            }
        }
Beispiel #16
0
		public bool IsValidGradeUp(ShipModel ship)
		{
			Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship[ship.MstId];
			if (mst_ship.Aftershipid <= 0)
			{
				return false;
			}
			if (ship.Level < mst_ship.Afterlv)
			{
				return false;
			}
			return true;
		}
Beispiel #17
0
        private Dictionary <int, List <int> > updateShip(DeckPracticeType type, Dictionary <int, int> getShipExp, Dictionary <int, PowUpInfo> powerUp)
        {
            Dictionary <int, List <int> > dictionary = new Dictionary <int, List <int> >();

            double[] array = this.useMaterial.get_Item(type);
            using (List <Mem_ship> .Enumerator enumerator = this.mem_ship.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship     current      = enumerator.get_Current();
                    int          rid          = current.Rid;
                    Mem_shipBase mem_shipBase = new Mem_shipBase(current);
                    Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship.get_Item(mem_shipBase.Ship_id);
                    int          num          = getShipExp.get_Item(rid);
                    List <int>   list         = null;
                    int          levelupInfo  = current.getLevelupInfo(this.mstLevelShip, current.Level, current.Exp, ref num, out list);
                    getShipExp.set_Item(rid, num);
                    if (getShipExp.get_Item(rid) != 0)
                    {
                        mem_shipBase.Exp  += num;
                        mem_shipBase.Level = levelupInfo;
                    }
                    dictionary.Add(rid, list);
                    Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = current.Kyouka;
                    if (!powerUp.get_Item(current.Rid).IsAllZero())
                    {
                        this.addKyoukaValues(powerUp.get_Item(current.Rid), dictionary2);
                    }
                    int num2 = levelupInfo - current.Level;
                    for (int i = 0; i < num2; i++)
                    {
                        dictionary2 = current.getLevelupKyoukaValue(current.Ship_id, dictionary2);
                    }
                    mem_shipBase.SetKyoukaValue(dictionary2);
                    current.SetRequireExp(mem_shipBase.Level, this.mstLevelShip);
                    mem_shipBase.Fuel = (int)((double)mem_shipBase.Fuel - (double)mem_shipBase.Fuel * array[0]);
                    mem_shipBase.Bull = (int)((double)mem_shipBase.Bull - (double)mem_shipBase.Bull * array[1]);
                    if (mem_shipBase.Fuel < 0)
                    {
                        mem_shipBase.Fuel = 0;
                    }
                    if (mem_shipBase.Bull < 0)
                    {
                        mem_shipBase.Bull = 0;
                    }
                    current.Set_ShipParam(mem_shipBase, mst_data, false);
                }
            }
            return(dictionary);
        }
Beispiel #18
0
        public static void DeckRefresh(int DeckID)
        {
            List <Mem_ship> memShip = Comm_UserDatas.Instance.User_deck.get_Item(DeckID).Ship.getMemShip();

            using (List <Mem_ship> .Enumerator enumerator = memShip.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship current = enumerator.get_Current();
                    current.SubHp(-(current.Maxhp - current.Nowhp));
                    Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(current.Ship_id);
                    current.Set_ChargeData(mst_ship.Bull_max, mst_ship.Fuel_max, Enumerable.ToList <int>(mst_ship.Maxeq));
                }
            }
        }
Beispiel #19
0
        public static void SetShipKyoukaValue(int ship_id, PowUpInfo powerUpValues)
        {
            Mem_ship     mem_ship     = Comm_UserDatas.Instance.User_ship.get_Item(ship_id);
            Mst_ship     mst_ship     = Mst_DataManager.Instance.Mst_ship.get_Item(mem_ship.Ship_id);
            Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);

            mem_shipBase.C_houg   = ((powerUpValues.Karyoku - mst_ship.Houg <= 0) ? mem_shipBase.C_houg : (powerUpValues.Karyoku - mst_ship.Houg));
            mem_shipBase.C_raig   = ((powerUpValues.Raisou - mst_ship.Raig <= 0) ? mem_shipBase.C_raig : (powerUpValues.Raisou - mst_ship.Raig));
            mem_shipBase.C_kaihi  = ((powerUpValues.Kaihi - mst_ship.Kaih <= 0) ? mem_shipBase.C_kaihi : (powerUpValues.Kaihi - mst_ship.Kaih));
            mem_shipBase.C_luck   = ((powerUpValues.Lucky - mst_ship.Luck <= 0) ? mem_shipBase.C_luck : (powerUpValues.Lucky - mst_ship.Luck));
            mem_shipBase.C_souk   = ((powerUpValues.Soukou - mst_ship.Souk <= 0) ? mem_shipBase.C_souk : (powerUpValues.Soukou - mst_ship.Souk));
            mem_shipBase.C_tyku   = ((powerUpValues.Taiku - mst_ship.Tyku <= 0) ? mem_shipBase.C_tyku : (powerUpValues.Taiku - mst_ship.Tyku));
            mem_shipBase.C_taisen = ((powerUpValues.Taisen - mst_ship.Tais <= 0) ? mem_shipBase.C_taisen : (powerUpValues.Taisen - mst_ship.Tais));
            mem_ship.Set_ShipParam(mem_shipBase, mst_ship, false);
        }
Beispiel #20
0
        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);
                }
            }
        }
Beispiel #21
0
        private void updateRadingEscortShipExp(List <RadingResultData> radingData)
        {
            HashSet <int> radingArea = new HashSet <int>();

            if (radingData != null && radingData.Count > 0)
            {
                radingData.ForEach(delegate(RadingResultData x)
                {
                    radingArea.Add(x.AreaId);
                });
            }
            Dictionary <int, int> mstLevel = ArrayMaster.GetMstLevel();

            foreach (Mem_esccort_deck value3 in Comm_UserDatas.Instance.User_EscortDeck.Values)
            {
                if (value3.Ship.Count() > 0)
                {
                    int             num     = radingArea.Contains(value3.Maparea_id) ? 1 : 2;
                    List <Mem_ship> memShip = value3.Ship.getMemShip();
                    foreach (Mem_ship item in memShip)
                    {
                        if (item.IsFight() && !item.IsBlingShip())
                        {
                            double       num2         = Math.Sqrt(item.Level);
                            int          addExp       = (num != 1) ? ((int)(num2 * (1.0 + Utils.GetRandDouble(0.0, 3.0, 1.0, 1) + 0.5))) : ((int)(num2 * (20.0 + Utils.GetRandDouble(0.0, 80.0, 1.0, 1) + 0.5)));
                            Mem_shipBase mem_shipBase = new Mem_shipBase(item);
                            List <int>   lvupInfo     = new List <int>();
                            int          num3         = mem_shipBase.Level = item.getLevelupInfo(mstLevel, mem_shipBase.Level, mem_shipBase.Exp, ref addExp, out lvupInfo);
                            mem_shipBase.Exp += addExp;
                            int num4 = num3 - item.Level;
                            Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = item.Kyouka;
                            for (int i = 0; i < num4; i++)
                            {
                                dictionary = item.getLevelupKyoukaValue(item.Ship_id, dictionary);
                            }
                            mem_shipBase.SetKyoukaValue(dictionary);
                            int value  = 0;
                            int value2 = 0;
                            mstLevel.TryGetValue(mem_shipBase.Level - 1, out value);
                            mstLevel.TryGetValue(mem_shipBase.Level + 1, out value2);
                            item.SetRequireExp(mem_shipBase.Level, mstLevel);
                            Mst_ship mst_data = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                            item.Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
                        }
                    }
                }
            }
        }
Beispiel #22
0
        public Api_Result <Mem_ship> ExpandSlot(int shipRid)
        {
            Api_Result <Mem_ship> api_Result = new Api_Result <Mem_ship>();
            Mem_ship     mem_ship            = Comm_UserDatas.Instance.User_ship[shipRid];
            Mem_shipBase mem_shipBase        = new Mem_shipBase(mem_ship);
            Mst_ship     mst_data            = Mst_DataManager.Instance.Mst_ship[mem_ship.Ship_id];

            mem_shipBase.Exslot = -1;
            mem_ship.Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
            api_Result.data = mem_ship;
            Mem_useitem value = null;

            Comm_UserDatas.Instance.User_useItem.TryGetValue(64, out value);
            value.Sub_UseItem(1);
            return(api_Result);
        }
Beispiel #23
0
        public Api_Result <Mem_ship> ExpandSlot(int shipRid)
        {
            Api_Result <Mem_ship> api_Result = new Api_Result <Mem_ship>();
            Mem_ship     mem_ship            = Comm_UserDatas.Instance.User_ship.get_Item(shipRid);
            Mem_shipBase mem_shipBase        = new Mem_shipBase(mem_ship);
            Mst_ship     mst_data            = Mst_DataManager.Instance.Mst_ship.get_Item(mem_ship.Ship_id);

            mem_shipBase.Exslot = -1;
            mem_ship.Set_ShipParam(mem_shipBase, mst_data, false);
            api_Result.data = mem_ship;
            Mem_useitem mem_useitem = null;

            Comm_UserDatas.Instance.User_useItem.TryGetValue(64, ref mem_useitem);
            mem_useitem.Sub_UseItem(1);
            return(api_Result);
        }
Beispiel #24
0
        private Dictionary <int, List <int> > updateShip(DeckPracticeType type, Dictionary <int, int> getShipExp, Dictionary <int, PowUpInfo> powerUp)
        {
            Dictionary <int, List <int> > dictionary = new Dictionary <int, List <int> >();

            double[] array = useMaterial[type];
            foreach (Mem_ship item in mem_ship)
            {
                int          rid          = item.Rid;
                Mem_shipBase mem_shipBase = new Mem_shipBase(item);
                Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                int          addExp       = getShipExp[rid];
                List <int>   lvupInfo     = null;
                int          levelupInfo  = item.getLevelupInfo(mstLevelShip, item.Level, item.Exp, ref addExp, out lvupInfo);
                getShipExp[rid] = addExp;
                if (getShipExp[rid] != 0)
                {
                    mem_shipBase.Exp  += addExp;
                    mem_shipBase.Level = levelupInfo;
                }
                dictionary.Add(rid, lvupInfo);
                Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = item.Kyouka;
                if (!powerUp[item.Rid].IsAllZero())
                {
                    addKyoukaValues(powerUp[item.Rid], dictionary2);
                }
                int num = levelupInfo - item.Level;
                for (int i = 0; i < num; i++)
                {
                    dictionary2 = item.getLevelupKyoukaValue(item.Ship_id, dictionary2);
                }
                mem_shipBase.SetKyoukaValue(dictionary2);
                item.SetRequireExp(mem_shipBase.Level, mstLevelShip);
                mem_shipBase.Fuel = (int)((double)mem_shipBase.Fuel - (double)mem_shipBase.Fuel * array[0]);
                mem_shipBase.Bull = (int)((double)mem_shipBase.Bull - (double)mem_shipBase.Bull * array[1]);
                if (mem_shipBase.Fuel < 0)
                {
                    mem_shipBase.Fuel = 0;
                }
                if (mem_shipBase.Bull < 0)
                {
                    mem_shipBase.Bull = 0;
                }
                item.Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
            }
            return(dictionary);
        }
Beispiel #25
0
        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);
                    }
                }
            }
        }
Beispiel #26
0
        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;
            }
        }
Beispiel #27
0
        private bool isValidRaigeki(Mem_ship ship, List <Mst_slotitem> slotitems)
        {
            if (ship.Get_DamageState() > DamageState.Shouha || !ship.IsFight())
            {
                return(false);
            }
            if (ship.GetBattleBaseParam().Raig <= 0)
            {
                return(false);
            }
            if (!ship.IsEnemy() || practiceFlag)
            {
                if (ship.Level >= 10 && Mst_DataManager.Instance.Mst_stype[ship.Stype].IsSubmarine())
                {
                    return(true);
                }
                if (slotitems == null || slotitems.Count == 0)
                {
                    return(false);
                }
                Mst_slotitem item = Mst_DataManager.Instance.Mst_Slotitem[41];
                if (slotitems.Contains(item))
                {
                    return(true);
                }
                return(false);
            }
            if (Mst_DataManager.Instance.Mst_stype[ship.Stype].IsSubmarine())
            {
                Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship[ship.Ship_id];
                return((mst_ship.Yomi.Equals("flagship") || mst_ship.Yomi.Equals("elite")) ? true : false);
            }
            if (slotitems == null || slotitems.Count == 0)
            {
                return(false);
            }
            Mst_slotitem item2 = Mst_DataManager.Instance.Mst_Slotitem[541];

            if (slotitems.Contains(item2))
            {
                return(true);
            }
            return(false);
        }
Beispiel #28
0
        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;
                }
            }
        }
Beispiel #29
0
 private bool isValidRaigeki(Mem_ship ship, List <Mst_slotitem> slotitems)
 {
     if (ship.Get_DamageState() > DamageState.Shouha || !ship.IsFight())
     {
         return(false);
     }
     if (ship.GetBattleBaseParam().Raig <= 0)
     {
         return(false);
     }
     if (!ship.IsEnemy() || this.practiceFlag)
     {
         if (ship.Level >= 10 && Mst_DataManager.Instance.Mst_stype.get_Item(ship.Stype).IsSubmarine())
         {
             return(true);
         }
         if (slotitems == null || slotitems.get_Count() == 0)
         {
             return(false);
         }
         Mst_slotitem mst_slotitem = Mst_DataManager.Instance.Mst_Slotitem.get_Item(41);
         return(slotitems.Contains(mst_slotitem));
     }
     else
     {
         if (Mst_DataManager.Instance.Mst_stype.get_Item(ship.Stype).IsSubmarine())
         {
             Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(ship.Ship_id);
             return(mst_ship.Yomi.Equals("flagship") || mst_ship.Yomi.Equals("elite"));
         }
         if (slotitems == null || slotitems.get_Count() == 0)
         {
             return(false);
         }
         Mst_slotitem mst_slotitem2 = Mst_DataManager.Instance.Mst_Slotitem.get_Item(541);
         return(slotitems.Contains(mst_slotitem2));
     }
 }
Beispiel #30
0
 private void Start()
 {
     this._MapArea    = SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID;
     this._clsRepair  = new RepairManager(this._MapArea);
     this._mstManager = Mst_DataManager.Instance;
     this._shipdata   = new Mst_ship();
     this._FadeDone   = false;
     if (SingletonMonoBehaviour <PortObjectManager> .exist())
     {
         SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate
         {
             SoundUtils.SwitchBGM(BGMFileInfos.PortTools);
             this.OnTransitionFinished();
         }, true, true);
     }
     else
     {
         this.OnTransitionFinished();
     }
     this._isStartUP   = false;
     this._now_texgirl = 0;
     this.bd1          = GameObject.Find("board1_top/board").GetComponent <board>();
     this.StartUp();
 }