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 _createTorpedoWakeOnes() { Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips; Dictionary <int, UIBattleShip> dicEnemyBattleShips = BattleTaskManager.GetBattleShips().dicEnemyBattleShips; bool isTC = false; for (int i = 0; i < _clsTorpedo.ShienShips.Length; i++) { if (_clsTorpedo.ShienShips[i] != null && _clsTorpedo.ShienShips[i].ShipType == 4) { isTC = true; } } _listTorpedoWake = new List <PSTorpedoWake>(); List <ShipModel_Defender> defenders = _clsTorpedo.GetDefenders(is_friend: false); Vector3 injection = default(Vector3); for (int j = 0; j < defenders.Count; j++) { DamageModel attackDamage = _clsTorpedo.GetAttackDamage(defenders[j].TmpId); Vector3 vecStraightTarget = (!attackDamage.GetProtectEffect()) ? dicEnemyBattleShips[j].transform.position : dicEnemyBattleShips[0].transform.position; float x = vecStraightTarget.x; float y = vecStraightTarget.y; Vector3 position = dicFriendBattleShips[0].transform.position; injection = new Vector3(x, y, position.z - 1f); Vector3 target = (attackDamage.GetHitState() != 0) ? new Vector3(vecStraightTarget.x, vecStraightTarget.y, vecStraightTarget.z + 20f) : new Vector3(vecStraightTarget.x - 3f, vecStraightTarget.y, vecStraightTarget.z + 20f); _listTorpedoWake.Add(_createTorpedo(isOnes: true, injection, target, 2.65f, isDet: false, isMiss: false)); _setTopCamera(injection.x); _vecStraightTarget = vecStraightTarget; Vector3 pointOfGaze = dicEnemyBattleShips[j].pointOfGaze; _fStraightTargetGazeHeight = pointOfGaze.y; } foreach (PSTorpedoWake item in _listTorpedoWake) { item.Injection(iTween.EaseType.linear, isPlaySE: true, isTC, delegate { }); } }