Example #1
0
        private List <SlotitemModel> _GetSlotitemList(int ship_id, SlotitemCategory category)
        {
            List <SlotitemModel> list      = new List <SlotitemModel>();
            ShipModel            shipModel = this._GetShip(ship_id);

            if (shipModel == null)
            {
                return(list);
            }
            if (this._unset_slotitems == null)
            {
                this._UpdateUnsetSlotitems();
            }
            List <int> equipList = Mst_DataManager.Instance.Mst_ship.get_Item(shipModel.MstId).GetEquipList();
            List <int> list2;

            if (category == SlotitemCategory.None)
            {
                list2 = equipList;
            }
            else
            {
                list2 = Enumerable.ToList <int>(Enumerable.Select <KeyValuePair <int, Mst_equip_category>, int>(Enumerable.Where <KeyValuePair <int, Mst_equip_category> >(Mst_DataManager.Instance.Mst_equip_category, (KeyValuePair <int, Mst_equip_category> pair) => pair.get_Value().Slotitem_type == category), (KeyValuePair <int, Mst_equip_category> pair) => pair.get_Key()));
                list2 = Enumerable.ToList <int>(Enumerable.Intersect <int>(list2, equipList));
            }
            for (int i = 0; i < list2.get_Count(); i++)
            {
                int num = list2.get_Item(i);
                if (this._unset_slotitems.ContainsKey(num))
                {
                    list.AddRange(this._unset_slotitems.get_Item(num));
                }
            }
            return(list);
        }
Example #2
0
		private List<SlotitemModel> _GetSlotitemList(int ship_id, SlotitemCategory category)
		{
			List<SlotitemModel> list = new List<SlotitemModel>();
			ShipModel shipModel = _GetShip(ship_id);
			if (shipModel == null)
			{
				return list;
			}
			if (_unset_slotitems == null)
			{
				_UpdateUnsetSlotitems();
			}
			List<int> equipList = Mst_DataManager.Instance.Mst_ship[shipModel.MstId].GetEquipList();
			List<int> list2;
			if (category == SlotitemCategory.None)
			{
				list2 = equipList;
			}
			else
			{
				list2 = (from pair in Mst_DataManager.Instance.Mst_equip_category
					where pair.Value.Slotitem_type == category
					select pair.Key).ToList();
				list2 = list2.Intersect(equipList).ToList();
			}
			for (int i = 0; i < list2.Count; i++)
			{
				int key = list2[i];
				if (_unset_slotitems.ContainsKey(key))
				{
					list.AddRange(_unset_slotitems[key]);
				}
			}
			return list;
		}
Example #3
0
		public SlotitemModel[] GetSlotitemList(int ship_mem_id, SlotitemCategory category, int page_no, int count_in_page, out int count)
		{
			List<SlotitemModel> list = _GetSlotitemList(ship_mem_id, category);
			count = list.Count;
			int val = (page_no - 1) * count_in_page;
			val = Math.Max(val, 0);
			val = Math.Min(val, list.Count);
			int val2 = list.Count - val;
			val2 = Math.Max(val2, 0);
			val2 = Math.Min(val2, count_in_page);
			return list.GetRange(val, val2).ToArray();
		}
Example #4
0
        public List <SlotitemCategory> GetEquipCategory()
        {
            List <SlotitemCategory> list = new List <SlotitemCategory>();
            Dictionary <int, Mst_equip_category> mst_equip_category = Mst_DataManager.Instance.Mst_equip_category;
            List <int> equipList = _mst_data.GetEquipList();

            foreach (int item in equipList)
            {
                SlotitemCategory slotitem_type = mst_equip_category[item].Slotitem_type;
                list.Add(slotitem_type);
            }
            return(list.Distinct().ToList());
        }
Example #5
0
        public SlotitemModel[] GetSlotitemList(int ship_mem_id, SlotitemCategory category, int page_no, int count_in_page, out int count)
        {
            List <SlotitemModel> list = this._GetSlotitemList(ship_mem_id, category);

            count = list.get_Count();
            int num = (page_no - 1) * count_in_page;

            num = Math.Max(num, 0);
            num = Math.Min(num, list.get_Count());
            int num2 = list.get_Count() - num;

            num2 = Math.Max(num2, 0);
            num2 = Math.Min(num2, count_in_page);
            return(list.GetRange(num, num2).ToArray());
        }
Example #6
0
        public List <SlotitemCategory> GetEquipCategory()
        {
            List <SlotitemCategory> list = new List <SlotitemCategory>();
            Dictionary <int, Mst_equip_category> mst_equip_category = Mst_DataManager.Instance.Mst_equip_category;
            List <int> equipList = this._mst_data.GetEquipList();

            using (List <int> .Enumerator enumerator = equipList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.get_Current();
                    SlotitemCategory slotitem_type = mst_equip_category.get_Item(current).Slotitem_type;
                    list.Add(slotitem_type);
                }
            }
            return(Enumerable.ToList <SlotitemCategory>(Enumerable.Distinct <SlotitemCategory>(list)));
        }
        public void Initialize(KeyControl keyController, UIRemodelShipStatus uiRemodelShipStatus, UIRemodelEquipSlotItems uiRemodelEquipSlotItems, ShipModel targetShipModel, SlotitemCategory slotitemCategory)
        {
            this.mUIRemodelShipStatus = uiRemodelShipStatus;
            int  currentSlotIndex = uiRemodelEquipSlotItems.GetCurrentSlotIndex();
            bool isExSlot         = uiRemodelEquipSlotItems.currentFocusItem.isExSlot;

            this.mTargetShipModel   = targetShipModel;
            this.mSelectedSlotIndex = currentSlotIndex;
            this.slotitemCategory   = slotitemCategory;
            this.mRemodelManager    = UserInterfaceRemodelManager.instance.mRemodelManager;
            this.SetKeyController(keyController);
            this.SetTitle(slotitemCategory);
            SlotitemModel[] models = this.CreateModelArray(isExSlot);
            base.Initialize(models);
            base.get_gameObject().SetActive(false);
            base.get_gameObject().SetActive(true);
            base.ChangeFocusToUserViewHead();
            base.ChangeImmediateContentPosition(UIScrollList <SlotitemModel, UIRemodelEquipListChildNew> .ContentDirection.Hell);
            base.StartControl();
        }
        private void SetTitle(SlotitemCategory category)
        {
            string text = string.Empty;

            switch (category)
            {
            case SlotitemCategory.Syuhou:
                text = "主砲";
                break;

            case SlotitemCategory.Fukuhou:
                text = "副砲";
                break;

            case SlotitemCategory.Gyorai:
                text = "魚雷";
                break;

            case SlotitemCategory.Kiju:
                text = "機銃";
                break;

            case SlotitemCategory.Kanjouki:
                text = "艦上機";
                break;

            case SlotitemCategory.Suijouki:
                text = "水上機";
                break;

            case SlotitemCategory.Dentan:
                text = "電探";
                break;

            case SlotitemCategory.Other:
                text = "その他";
                break;
            }
            this.titleLabel.text = "装備選択\u3000- " + text + " -";
        }
Example #9
0
 public SlotitemModel[] GetSlotitemList(int ship_mem_id, SlotitemCategory category)
 {
     return(this._GetSlotitemList(ship_mem_id, category).ToArray());
 }
Example #10
0
        public string ToString(string slot_string)
        {
            string text = this.ShortName + "\n";

            text += slot_string;
            string text2 = text;

            text = string.Concat(new object[]
            {
                text2,
                "Lv",
                this.Level,
                (!this.IsMarriage()) ? string.Empty : "(結婚済)",
                "    HP:",
                this.NowHp,
                "/",
                this.MaxHp,
                (!this.IsDamaged()) ? string.Empty : "(中破絵)",
                "    Exp",
                this.Exp,
                "/",
                this.Exp_Next,
                "(",
                this.Exp_Percentage,
                "%)    艦星数:",
                this.Srate,
                "    火力:",
                this.Karyoku,
                "    雷装:",
                this.Raisou,
                "    装甲:",
                this.Soukou,
                "    回避:",
                this.Kaihi,
                "    対潜:",
                this.Taisen,
                "    索的:",
                this.Sakuteki,
                "    運  :",
                this.Lucky,
                "    対空:",
                this.Taiku,
                "    搭載:",
                base.TousaiMaxAll,
                "    速力:",
                base.Soku,
                "    射程:",
                this.Leng,
                "    Lov値:",
                this.Lov,
                "\n"
            });
            text += "装備可能なカテゴリ:";
            using (List <SlotitemCategory> .Enumerator enumerator = base.GetEquipCategory().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SlotitemCategory current = enumerator.get_Current();
                    text = text + " " + current;
                }
            }
            text += "\n";
            text += string.Format("立ち絵のID:{0}", base.GetGraphicsMstId());
            return(text);
        }
Example #11
0
        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;
                }
            }
        }
Example #12
0
 public void Forward2SoubiHenkouItemSelect(ShipModel shipModel, SlotitemCategory slotitemCategory)
 {
     this.SetStatus(ScreenStatus.MODE_SOUBI_HENKOU_ITEM_SELECT);
     this.mUIRemodelEquipListParent.SetActive(true);
     this.mUIRemodelEquipListParent.Initialize(this.mKeyController, this.mUIRemodelShipStatus, this.mUIRemodelEquipSlotItems, shipModel, slotitemCategory);
 }
Example #13
0
 protected override void setProperty(XElement element)
 {
     Id            = int.Parse(element.Element("Id").Value);
     Slotitem_type = (SlotitemCategory)(int)Enum.Parse(typeof(SlotitemCategory), element.Element("Slotitem_type").Value);
 }
Example #14
0
        public bool IsPlane()
        {
            SlotitemCategory slotitem_type = Mst_DataManager.Instance.Mst_equip_category[Type3].Slotitem_type;

            return(slotitem_type == SlotitemCategory.Kanjouki || slotitem_type == SlotitemCategory.Suijouki);
        }
Example #15
0
        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);
                    }
                }
            }
        }