Example #1
0
        private void _setProtect(FleetType type)
        {
            int num  = (type == FleetType.Friend) ? 1 : 0;
            int num2 = 0;

            while (true)
            {
                if (num2 < _dicBakuraiModel[type].Length)
                {
                    if (_dicBakuraiModel[type][num2] != null && _dicBakuraiModel[type][num2].GetProtectEffect())
                    {
                        break;
                    }
                    num2++;
                    continue;
                }
                return;
            }
            _isProtect[num] = true;
            ShipModel_Defender defender = _dicBakuraiModel[type][num2].Defender;

            if (type == FleetType.Friend)
            {
                _rescueCutIn.AddShipList(_eBattleship[0], _eBattleship[defender.Index]);
            }
            else
            {
                _rescueCutIn.AddShipList(_fBattleship[0], _fBattleship[defender.Index]);
            }
        }
        private void _setHpGauge()
        {
            BattleCutInCamera cutInCamera = BattleTaskManager.GetBattleCameras().cutInCamera;
            bool flag = false;

            _eHpPos    = _setHpGaugePosition(_eBattleship.Count);
            _eHitState = new HpHitState[_eBattleship.Count];
            UIPanel uIPanel = Resources.Load <UIPanel>("Prefabs/Battle/UI/UICircleHpPanel");

            _uiHpGaugePanel = Util.Instantiate(uIPanel.gameObject, cutInCamera.transform.gameObject).GetComponent <UIPanel>();
            for (int i = 0; i < _defenders.Count; i++)
            {
                DamageModel attackDamage = _clsShelling.GetAttackDamage(_defenders[i].TmpId);
                if (attackDamage.GetHitState() == BattleHitStatus.Clitical)
                {
                    _eHitState[attackDamage.Defender.Index] = HpHitState.Critical;
                }
                else if (attackDamage.GetHitState() == BattleHitStatus.Miss)
                {
                    if (_eHitState[attackDamage.Defender.Index] == HpHitState.None)
                    {
                        _eHitState[attackDamage.Defender.Index] = HpHitState.Miss;
                    }
                }
                else if (attackDamage.GetHitState() == BattleHitStatus.Normal && _eHitState[attackDamage.Defender.Index] != HpHitState.Critical)
                {
                    _eHitState[attackDamage.Defender.Index] = HpHitState.Hit;
                }
                BattleHitStatus status = (_eHitState[i] != HpHitState.Miss) ? ((_eHitState[i] != HpHitState.Critical) ? BattleHitStatus.Normal : BattleHitStatus.Clitical) : BattleHitStatus.Miss;
                _battleHpGauges.SetGauge(i, isFriend: false, isLight: true, isT: false, isNumber: false);
                _battleHpGauges.SetHp(i, _defenders[i].MaxHp, _defenders[i].HpBefore, _defenders[i].HpAfter, attackDamage.GetDamage(), status, isFriend: false);
                if (attackDamage.GetProtectEffect() && !flag)
                {
                    flag       = true;
                    _isProtect = true;
                    _rescueCutIn.AddShipList(_eBattleship[0], _eBattleship[i]);
                }
            }
        }
		private void _setHpGauge()
		{
			bool flag = false;
			_eHitState = new HpHitState[_eBattleship.Count];
			List<ShipModel_Defender> defenders = _clsTorpedo.GetDefenders(is_friend: false);
			for (int i = 0; i < defenders.Count; i++)
			{
				DamageModel attackDamage = _clsTorpedo.GetAttackDamage(defenders[i].TmpId);
				switch (attackDamage.GetHitState())
				{
				case BattleHitStatus.Normal:
					if (_eHitState[i] != HpHitState.Critical)
					{
						_eHitState[i] = HpHitState.Hit;
					}
					break;
				case BattleHitStatus.Clitical:
					_eHitState[i] = HpHitState.Critical;
					break;
				case BattleHitStatus.Miss:
					if (_eHitState[i] == HpHitState.None)
					{
						_eHitState[i] = HpHitState.Miss;
					}
					break;
				}
				BattleHitStatus status = (_eHitState[i] != HpHitState.Miss) ? ((_eHitState[i] != HpHitState.Critical) ? BattleHitStatus.Normal : BattleHitStatus.Clitical) : BattleHitStatus.Miss;
				_battleHpGauges.SetGauge(i, isFriend: false, isLight: false, isT: true, isNumber: false);
				_battleHpGauges.SetHp(i, defenders[i].MaxHp, defenders[i].HpBefore, defenders[i].HpAfter, attackDamage.GetDamage(), status, isFriend: false);
				if (attackDamage.GetProtectEffect() && !flag)
				{
					flag = true;
					_isProtect = true;
					_rescueCutIn.AddShipList(_eBattleship[0], _eBattleship[i]);
				}
			}
		}
        private void _setProtect()
        {
            int num = 0;
            ShipModel_Defender defender;

            while (true)
            {
                if (num >= _fBakuraiModel.Length)
                {
                    return;
                }
                if (_fBakuraiModel[num] != null)
                {
                    defender = _fBakuraiModel[num].Defender;
                    if (_fBakuraiModel[num].GetProtectEffect())
                    {
                        break;
                    }
                }
                num++;
            }
            _isProtectE = true;
            _rescueCutIn.AddShipList(_eBattleship[0], _eBattleship[defender.Index]);
        }