Пример #1
0
 private void SetStateIcon(ShipModel model)
 {
     if (model.IsInRepair())
     {
         this._uiDamageIcon.alpha      = 1f;
         this._uiDamageIcon.spriteName = "icon-ss_syufuku";
         this.setStateIconSize(false);
     }
     else if (model.IsInMission())
     {
         this._uiDamageIcon.alpha      = 1f;
         this._uiDamageIcon.spriteName = "icon-ss_ensei";
         this.setStateIconSize(false);
     }
     else if (model.IsTettaiBling() && model.IsInDeck() != -1)
     {
         this._uiDamageIcon.alpha      = 1f;
         this._uiDamageIcon.spriteName = "shipicon_withdraw";
         this.setStateIconSize(true);
     }
     else if (model.IsBling())
     {
         this._uiDamageIcon.alpha      = 1f;
         this._uiDamageIcon.spriteName = "icon_kaikou";
         this.setStateIconSize(true);
     }
     else
     {
         this.UpdateDamage(model.DamageStatus);
         this.setStateIconSize(false);
     }
 }
Пример #2
0
        public bool IsValidShip(int ship_mem_id)
        {
            ShipModel ship = base.UserInfo.GetShip(ship_mem_id);

            if (ship.IsBling())
            {
                return(false);
            }
            if (ship.IsInMission())
            {
                return(false);
            }
            DeckModelBase deck = ship.getDeck();

            if (deck != null)
            {
                if (deck.IsEscortDeckMyself())
                {
                    return(false);
                }
                if (deck.IsActionEnd())
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #3
0
 public bool IsValidBreakShip(ShipModel ship)
 {
     if (ship.IsLocked())
     {
         return(false);
     }
     if (ship.HasLocked())
     {
         return(false);
     }
     if (ship.IsInDeck() >= 0)
     {
         return(false);
     }
     if (ship.IsInEscortDeck() >= 0)
     {
         return(false);
     }
     if (ship.IsInRepair())
     {
         return(false);
     }
     if (ship.IsBling())
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
        public bool IsValidStartRepair(int ship_mem_id, bool use_repairkit)
        {
            ShipModel shipModel = _ships.Find((ShipModel x) => x.MemId == ship_mem_id);

            if (shipModel == null)
            {
                return(false);
            }
            if (shipModel.TaikyuRate >= 100.0)
            {
                return(false);
            }
            if (shipModel.IsInMission() || shipModel.IsInRepair())
            {
                return(false);
            }
            if (shipModel.IsBling())
            {
                return(false);
            }
            if (shipModel.IsBlingWaitFromEscortDeck())
            {
                return(false);
            }
            MaterialInfo resourcesForRepair = shipModel.GetResourcesForRepair();

            if (base.Material.Fuel < resourcesForRepair.Fuel)
            {
                return(false);
            }
            if (base.Material.Steel < resourcesForRepair.Steel)
            {
                return(false);
            }
            if (use_repairkit && base.Material.RepairKit < 1)
            {
                return(false);
            }
            DeckModelBase deck = shipModel.getDeck();

            if (deck != null)
            {
                if (deck.IsEscortDeckMyself())
                {
                    return(false);
                }
                return(deck.AreaId == MapArea.Id);
            }
            if (shipModel.IsBlingWaitFromDeck() && shipModel.AreaIdBeforeBlingWait == MapArea.Id)
            {
                return(true);
            }
            if (MapArea.Id == 1)
            {
                return(true);
            }
            return(false);
        }
Пример #5
0
        public static void log(ShipModel[] ships)
        {
            string text = string.Empty;

            for (int i = 0; i < ships.Length; i++)
            {
                ShipModel shipModel = ships[i];
                if (shipModel == null)
                {
                    text += string.Format("[{0}] - \n", i);
                }
                else
                {
                    text += string.Format("[{0}]{1} {2} Lv:{3}", new object[]
                    {
                        i,
                        shipModel.ShipTypeName,
                        shipModel.ShortName,
                        shipModel.Level
                    });
                    text += string.Format(" {0}/{1}({2:F}% - {3})", new object[]
                    {
                        shipModel.NowHp,
                        shipModel.MaxHp,
                        shipModel.TaikyuRate,
                        shipModel.DamageStatus
                    });
                    text += string.Format(" 疲労度:{0}", shipModel.Condition);
                    DeckModelBase deck = shipModel.getDeck();
                    if (deck != null && deck is DeckModel)
                    {
                        text += string.Format(" [艦隊ID:{0}{1}に編成中]", ((DeckModel)deck).Id, (!shipModel.IsInActionEndDeck()) ? string.Empty : "(行動終了済)");
                    }
                    else if (deck != null && deck is EscortDeckModel)
                    {
                        text += string.Format(" [護衛艦隊{0}に編成中]", ((EscortDeckModel)deck).Id);
                    }
                    text += string.Format(" {0}", (!shipModel.IsLocked()) ? string.Empty : "[ロック]");
                    text += string.Format(" {0}", (!shipModel.IsInRepair()) ? string.Empty : "[入渠中]");
                    text += string.Format(" {0}", (!shipModel.IsInMission()) ? string.Empty : "[遠征中]");
                    text += string.Format(" {0}", (!shipModel.IsBling()) ? string.Empty : "[回航中]");
                    if (shipModel.IsBlingWait())
                    {
                        text += string.Format("[回航待ち中(Area:{0})]", shipModel.AreaIdBeforeBlingWait);
                    }
                    text += string.Format(" {0}", (!shipModel.IsTettaiBling()) ? string.Empty : "[撤退中]");
                    text += string.Format(" mstID:{0} memID:{1}", shipModel.MstId, shipModel.MemId);
                    text += string.Format("\n", new object[0]);
                }
            }
            Logging.log(new object[]
            {
                text
            });
        }
        public void SetDeckShipDetailButtons(ShipModel ship, IOrganizeManager manager = null, MonoBehaviour CallBackTarget = null)
        {
            this.isDeckShipDetail = true;
            this.ship             = ship;
            bool flag = (manager != null) ? manager.IsValidShip(ship.MemId) : this.IsValidShip();

            this.LeftButton.SetActive(true);
            this.setChangeButton(this.LeftButton, flag, CallBackTarget);
            this.setUnsetButton(this.RightButton, manager, CallBackTarget);
            this.buttonManager.nowForcusButton = ((!flag) ? this.RightButton : this.LeftButton);
            this.LockSwitch.SetActive(false);
            if (ship.IsBling() && ship.IsInDeck() != -1)
            {
                this.buttonManager.setFocus(1);
            }
            GameObject backBG = (!(CallBackTarget == null)) ? CallBackTarget.get_gameObject() : null;

            this.setBackBG(backBG);
        }
        public void SetDeckShipDetailButtons(ShipModel ship, IOrganizeManager manager = null, MonoBehaviour CallBackTarget = null)
        {
            isDeckShipDetail = true;
            this.ship        = ship;
            bool flag = manager?.IsValidShip(ship.MemId) ?? IsValidShip();

            LeftButton.SetActive(isActive: true);
            setChangeButton(LeftButton, flag, CallBackTarget);
            setUnsetButton(RightButton, manager, CallBackTarget);
            buttonManager.nowForcusButton = ((!flag) ? RightButton : LeftButton);
            LockSwitch.SetActive(isActive: false);
            if (ship.IsBling() && ship.IsInDeck() != -1)
            {
                buttonManager.setFocus(1);
            }
            GameObject backBG = (!(CallBackTarget == null)) ? CallBackTarget.gameObject : null;

            setBackBG(backBG);
        }
Пример #8
0
 private CheckBoxStatus _GetCheckBoxStatus(ShipModel ship, DeckModel deck)
 {
     if (ship == null)
     {
         return(CheckBoxStatus.DISABLE);
     }
     if (ship.IsInMission() || ship.IsBling())
     {
         return(CheckBoxStatus.DISABLE);
     }
     if (ship.GetResourcesForSupply().HasPositive())
     {
         if (_checked_ships.IndexOf(ship.MemId) == -1)
         {
             return(CheckBoxStatus.OFF);
         }
         return(CheckBoxStatus.ON);
     }
     return(CheckBoxStatus.DISABLE);
 }
Пример #9
0
 public virtual void UpdateStateIcon(UISprite _stateIcon)
 {
     _stateIcon.transform.localPositionX(67f);
     if (_clsShipModel.IsInRepair())
     {
         _stateIcon.alpha      = 1f;
         _stateIcon.spriteName = "icon-s_syufuku";
     }
     else if (_clsShipModel.IsBling())
     {
         _stateIcon.alpha = 1f;
         _stateIcon.transform.localPositionX(88f);
         _stateIcon.spriteName = "icon-s_kaiko";
     }
     else if (_clsShipModel.IsInMission())
     {
         _stateIcon.alpha      = 1f;
         _stateIcon.spriteName = "icon-s_ensei";
     }
     else if (_clsShipModel.DamageStatus == DamageState.Taiha)
     {
         _stateIcon.alpha      = 1f;
         _stateIcon.spriteName = "icon-s_taiha";
     }
     else if (_clsShipModel.DamageStatus == DamageState.Tyuuha)
     {
         _stateIcon.alpha      = 1f;
         _stateIcon.spriteName = "icon-s_chuha";
     }
     else if (_clsShipModel.DamageStatus == DamageState.Shouha)
     {
         _stateIcon.alpha      = 1f;
         _stateIcon.spriteName = "icon-s_shoha";
     }
     else
     {
         _stateIcon.alpha = 0f;
     }
 }
Пример #10
0
        public static void log(ShipModel[] ships)
        {
            string text = string.Empty;

            for (int i = 0; i < ships.Length; i++)
            {
                ShipModel shipModel = ships[i];
                if (shipModel == null)
                {
                    text += $"[{i}] - \n";
                    continue;
                }
                text += $"[{i}]{shipModel.ShipTypeName} {shipModel.ShortName} Lv:{shipModel.Level}";
                text += $" {shipModel.NowHp}/{shipModel.MaxHp}({shipModel.TaikyuRate:F}% - {shipModel.DamageStatus})";
                text += $" 疲労度:{shipModel.Condition}";
                DeckModelBase deck = shipModel.getDeck();
                if (deck != null && deck is DeckModel)
                {
                    text += string.Format(" [艦隊ID:{0}{1}に編成中]", ((DeckModel)deck).Id, (!shipModel.IsInActionEndDeck()) ? string.Empty : "(行動終了済)");
                }
                else if (deck != null && deck is EscortDeckModel)
                {
                    text += $" [護衛艦隊{((EscortDeckModel)deck).Id}に編成中]";
                }
                text += string.Format(" {0}", (!shipModel.IsLocked()) ? string.Empty : "[ロック]");
                text += string.Format(" {0}", (!shipModel.IsInRepair()) ? string.Empty : "[入渠中]");
                text += string.Format(" {0}", (!shipModel.IsInMission()) ? string.Empty : "[遠征中]");
                text += string.Format(" {0}", (!shipModel.IsBling()) ? string.Empty : "[回航中]");
                if (shipModel.IsBlingWait())
                {
                    text += $"[回航待ち中(Area:{shipModel.AreaIdBeforeBlingWait})]";
                }
                text += string.Format(" {0}", (!shipModel.IsTettaiBling()) ? string.Empty : "[撤退中]");
                text += $" mstID:{shipModel.MstId} memID:{shipModel.MemId}";
                text += $"\n";
            }
            log(text);
        }
Пример #11
0
        public bool IsValidShip(int ship_mem_id)
        {
            ShipModel ship = base.UserInfo.GetShip(ship_mem_id);

            if (ship.IsBling())
            {
                return(false);
            }
            DeckModelBase deck = ship.getDeck();

            if (deck != null)
            {
                if (deck.AreaId != MapArea.Id)
                {
                    return(false);
                }
                if (!deck.IsEscortDeckMyself())
                {
                    return(false);
                }
            }
            return(_edit_deck.HasShipMemId(ship_mem_id));
        }
Пример #12
0
		public bool IsValidShip(ShipModel ship)
		{
			if (ship == null)
			{
				return false;
			}
			if (ship.IsInRepair())
			{
				return false;
			}
			if (ship.IsInMission())
			{
				return false;
			}
			if (ship.IsBling())
			{
				return false;
			}
			if (ship.IsInActionEndDeck())
			{
				return false;
			}
			return true;
		}
Пример #13
0
 public bool IsValidShip(ShipModel ship)
 {
     return(ship != null && !ship.IsInRepair() && !ship.IsInMission() && !ship.IsBling() && !ship.IsInActionEndDeck());
 }