private void _addProtectShip(Dictionary <int, UIBattleShip> attackers, Dictionary <int, UIBattleShip> defenders, FleetType defType) { bool is_friend = (defType == FleetType.Friend) ? true : false; ShipModel_BattleAll[] array = (defType != 0) ? BattleTaskManager.GetBattleManager().Ships_f : BattleTaskManager.GetBattleManager().Ships_e; int num = 0; ShipModel_Defender attackTo; while (true) { if (num >= attackers.Count) { return; } ShipModel_BattleAll shipModel_BattleAll = array[num]; attackTo = _clsRaigeki.GetAttackTo(shipModel_BattleAll); if (shipModel_BattleAll != null && attackTo != null) { RaigekiDamageModel attackDamage = _clsRaigeki.GetAttackDamage(attackTo.Index, is_friend); if (attackDamage.GetProtectEffect(shipModel_BattleAll.TmpId)) { break; } } num++; } _isProtect[(int)defType] = true; _torpedoProtect.AddShipList(defenders[0], defenders[attackTo.Index], defType); }
public void CreateTorpedoWake() { ShipModel_BattleAll[] ships_f = BattleTaskManager.GetBattleManager().Ships_f; ShipModel_BattleAll[] ships_e = BattleTaskManager.GetBattleManager().Ships_e; this._setProtect(); for (int i = 0; i < this._fBattleship.get_Count(); i++) { ShipModel_BattleAll shipModel_BattleAll = ships_f[i]; ShipModel_Defender attackTo = this._clsRaigeki.GetAttackTo(shipModel_BattleAll); if (shipModel_BattleAll != null && attackTo != null) { RaigekiDamageModel attackDamage = this._clsRaigeki.GetAttackDamage(attackTo.Index, false); int arg_76_0 = (!attackDamage.GetProtectEffect(shipModel_BattleAll.TmpId)) ? attackTo.Index : 0; if (attackDamage.GetHitState(shipModel_BattleAll.TmpId) == BattleHitStatus.Miss) { this._dicIsMiss.get_Item(FleetType.Enemy)[attackTo.Index] = true; } if (attackDamage.GetHitState(shipModel_BattleAll.TmpId) == BattleHitStatus.Clitical) { this._dicIsCriticall.get_Item(FleetType.Enemy)[attackTo.Index] = true; } Vector3 injection = new Vector3(this._eBattleship.get_Item(attackTo.Index).get_transform().get_position().x, 1f, this._eBattleship.get_Item(attackTo.Index).get_transform().get_position().z + 13f); Vector3 target = new Vector3(this._eBattleship.get_Item(attackTo.Index).get_transform().get_position().x, this._eBattleship.get_Item(attackTo.Index).get_transform().get_position().y + 0.5f, this._eBattleship.get_Item(attackTo.Index).get_transform().get_position().z); this._listPSTorpedoWake.Add(this._createTorpedo(injection, target, true)); this._isTorpedoHit[0] = true; } } for (int j = 0; j < this._eBattleship.get_Count(); j++) { ShipModel_BattleAll shipModel_BattleAll2 = ships_e[j]; ShipModel_Defender attackTo2 = this._clsRaigeki.GetAttackTo(shipModel_BattleAll2); if (shipModel_BattleAll2 != null && attackTo2 != null) { RaigekiDamageModel attackDamage2 = this._clsRaigeki.GetAttackDamage(attackTo2.Index, true); int arg_233_0 = (!attackDamage2.GetProtectEffect(shipModel_BattleAll2.TmpId)) ? attackTo2.Index : 0; if (attackDamage2.GetHitState(shipModel_BattleAll2.TmpId) == BattleHitStatus.Miss) { this._dicIsMiss.get_Item(FleetType.Friend)[attackTo2.Index] = true; } if (attackDamage2.GetHitState(shipModel_BattleAll2.TmpId) == BattleHitStatus.Clitical) { this._dicIsCriticall.get_Item(FleetType.Friend)[attackTo2.Index] = true; } Vector3 injection2 = new Vector3(this._fBattleship.get_Item(attackTo2.Index).get_transform().get_position().x, 1f, this._fBattleship.get_Item(attackTo2.Index).get_transform().get_position().z - 13f); Vector3 target2 = new Vector3(this._fBattleship.get_Item(attackTo2.Index).get_transform().get_position().x, this._fBattleship.get_Item(attackTo2.Index).get_transform().get_position().y + 0.5f, this._fBattleship.get_Item(attackTo2.Index).get_transform().get_position().z); this._listPSTorpedoWake.Add(this._createTorpedo(injection2, target2, true)); this._isTorpedoHit[1] = true; } } }
private bool _createTorpedoWakeOnes(bool isFriend) { FleetType key = (!isFriend) ? FleetType.Enemy : FleetType.Friend; Dictionary <int, UIBattleShip> dictionary = (!isFriend) ? BattleTaskManager.GetBattleShips().dicEnemyBattleShips : BattleTaskManager.GetBattleShips().dicFriendBattleShips; Dictionary <int, UIBattleShip> dictionary2 = (!isFriend) ? BattleTaskManager.GetBattleShips().dicFriendBattleShips : BattleTaskManager.GetBattleShips().dicEnemyBattleShips; if (_dicIsAttack[key]) { for (int i = 0; i < dictionary.Count; i++) { ShipModel_Battle shipModel = dictionary[i].shipModel; ShipModel_Battle attackTo = _clsTorpedo.GetAttackTo(shipModel); if (shipModel != null && attackTo != null) { Vector3 position = dictionary[i].transform.position; Vector3 vector; if (isFriend) { Vector3 position2 = dictionary2[attackTo.Index].transform.position; vector = new Vector3(position2.x, position.y, position.z - 1f); } else { Vector3 position3 = dictionary2[attackTo.Index].transform.position; vector = new Vector3(position3.x, position.y, position.z + 1f); } Vector3 injection = vector; RaigekiDamageModel attackDamage = _clsTorpedo.GetAttackDamage(attackTo.Index, (!isFriend) ? true : false); int key2 = (!attackDamage.GetProtectEffect(shipModel.TmpId)) ? attackTo.Index : 0; float num = (!isFriend) ? (-20f) : 20f; float num2 = (attackDamage.GetHitState(shipModel.TmpId) != 0) ? 0f : (-3f); Vector3 position4 = dictionary2[key2].transform.position; _onesTorpedoWake = _instantiateTorpedo(target: new Vector3(position4.x + num2, position4.y, position4.z + num), injection: injection, index: i, _time: 2.65f, isDet: false, isMiss: false, isD: true); _setCameraPosition(injection.x); _straightTarget = position4; Vector3 pointOfGaze = dictionary2[key2].pointOfGaze; _straightTargetGazeY = pointOfGaze.y; break; } } } return((_onesTorpedoWake != null) ? true : false); }
private void _addProtectShip(Dictionary <int, UIBattleShip> attackers, Dictionary <int, UIBattleShip> defenders, FleetType defType) { bool is_friend = defType == FleetType.Friend; ShipModel_BattleAll[] array = (defType != FleetType.Friend) ? BattleTaskManager.GetBattleManager().Ships_f : BattleTaskManager.GetBattleManager().Ships_e; for (int i = 0; i < attackers.get_Count(); i++) { ShipModel_BattleAll shipModel_BattleAll = array[i]; ShipModel_Defender attackTo = this._clsRaigeki.GetAttackTo(shipModel_BattleAll); if (shipModel_BattleAll != null && attackTo != null) { RaigekiDamageModel attackDamage = this._clsRaigeki.GetAttackDamage(attackTo.Index, is_friend); if (attackDamage.GetProtectEffect(shipModel_BattleAll.TmpId)) { this._isProtect[(int)defType] = true; this._torpedoProtect.AddShipList(defenders.get_Item(0), defenders.get_Item(attackTo.Index), defType); break; } } } }
public void SetHpGauge() { BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera; if (BattleTaskManager.GetTorpedoHpGauges().UiPanel == null) { UIPanel uIPanel = Resources.Load <UIPanel>("Prefabs/Battle/UI/UICircleHpPanel"); BattleTaskManager.GetTorpedoHpGauges().InstancePanel(uIPanel.get_gameObject(), cutInEffectCamera.get_transform().get_gameObject()); } else { BattleTaskManager.GetTorpedoHpGauges().UiPanel.alpha = 0f; } this._dicIsCriticall = new Dictionary <FleetType, bool[]>(); this._dicIsMiss = new Dictionary <FleetType, bool[]>(); if (BattleTaskManager.GetTorpedoHpGauges().FHpGauge == null) { BattleTaskManager.GetTorpedoHpGauges().FHpGauge = new BattleHPGauges(); } int[] array = new int[this._fBattleship.get_Count()]; bool[] array2 = new bool[this._fBattleship.get_Count()]; bool[] array3 = new bool[this._fBattleship.get_Count()]; List <ShipModel_Defender> defenders = this._clsRaigeki.GetDefenders(true, true); for (int i = 0; i < this._fBattleship.get_Count(); i++) { BattleTaskManager.GetTorpedoHpGauges().FHpGauge.AddInstantiatesSafe(BattleTaskManager.GetTorpedoHpGauges().UiPanel.get_gameObject(), true, false, true, false, i); array[i] = defenders.get_Item(i).HpBefore; array2[i] = false; array3[i] = false; } this._dicIsCriticall.Add(FleetType.Friend, array3); this._dicIsMiss.Add(FleetType.Friend, array3); if (BattleTaskManager.GetTorpedoHpGauges().EHpGauge == null) { BattleTaskManager.GetTorpedoHpGauges().EHpGauge = new BattleHPGauges(); } int[] array4 = new int[this._eBattleship.get_Count()]; bool[] array5 = new bool[this._eBattleship.get_Count()]; bool[] array6 = new bool[this._eBattleship.get_Count()]; List <ShipModel_Defender> defenders2 = this._clsRaigeki.GetDefenders(false, true); int count = this._fBattleship.get_Count(); for (int j = 0; j < this._eBattleship.get_Count(); j++) { BattleTaskManager.GetTorpedoHpGauges().EHpGauge.AddInstantiatesSafe(BattleTaskManager.GetTorpedoHpGauges().UiPanel.get_gameObject(), false, false, true, false, j); array4[j] = defenders2.get_Item(j).HpBefore; array5[j] = false; array6[j] = false; } this._dicIsCriticall.Add(FleetType.Enemy, array6); this._dicIsMiss.Add(FleetType.Enemy, array6); for (int k = 0; k < this._fBattleship.get_Count(); k++) { RaigekiDamageModel attackDamage = this._clsRaigeki.GetAttackDamage(defenders.get_Item(k).TmpId); int damage = (attackDamage != null) ? attackDamage.GetDamage() : -1; BattleHitStatus status = BattleHitStatus.Normal; if (this._dicIsMiss.get_Item(FleetType.Friend)[k]) { status = BattleHitStatus.Miss; } if (this._dicIsCriticall.get_Item(FleetType.Friend)[k]) { status = BattleHitStatus.Clitical; } BattleTaskManager.GetTorpedoHpGauges().FHpGauge.SetHp(k, defenders.get_Item(k).MaxHp, array[k], defenders.get_Item(k).HpAfter, damage, status, false); } for (int l = 0; l < this._eBattleship.get_Count(); l++) { RaigekiDamageModel attackDamage2 = this._clsRaigeki.GetAttackDamage(defenders2.get_Item(l).TmpId); int damage2 = (attackDamage2 != null) ? attackDamage2.GetDamage() : -1; BattleHitStatus status2 = BattleHitStatus.Normal; if (this._dicIsMiss.get_Item(FleetType.Enemy)[l]) { status2 = BattleHitStatus.Miss; } if (this._dicIsCriticall.get_Item(FleetType.Enemy)[l]) { status2 = BattleHitStatus.Clitical; } BattleTaskManager.GetTorpedoHpGauges().EHpGauge.SetHp(l, defenders2.get_Item(l).MaxHp, array4[l], defenders2.get_Item(l).HpAfter, damage2, status2, false); } }
public void CreateTorpedoWake() { ShipModel_BattleAll[] ships_f = BattleTaskManager.GetBattleManager().Ships_f; ShipModel_BattleAll[] ships_e = BattleTaskManager.GetBattleManager().Ships_e; _setProtect(); Vector3 injection = default(Vector3); Vector3 target = default(Vector3); for (int i = 0; i < _fBattleship.Count; i++) { ShipModel_BattleAll shipModel_BattleAll = ships_f[i]; ShipModel_Defender attackTo = _clsRaigeki.GetAttackTo(shipModel_BattleAll); if (shipModel_BattleAll != null && attackTo != null) { RaigekiDamageModel attackDamage = _clsRaigeki.GetAttackDamage(attackTo.Index, is_friend: false); if (!attackDamage.GetProtectEffect(shipModel_BattleAll.TmpId)) { int index = attackTo.Index; } if (attackDamage.GetHitState(shipModel_BattleAll.TmpId) == BattleHitStatus.Miss) { _dicIsMiss[FleetType.Enemy][attackTo.Index] = true; } if (attackDamage.GetHitState(shipModel_BattleAll.TmpId) == BattleHitStatus.Clitical) { _dicIsCriticall[FleetType.Enemy][attackTo.Index] = true; } Vector3 position = _eBattleship[attackTo.Index].transform.position; float x = position.x; Vector3 position2 = _eBattleship[attackTo.Index].transform.position; injection = new Vector3(x, 1f, position2.z + 13f); Vector3 position3 = _eBattleship[attackTo.Index].transform.position; float x2 = position3.x; Vector3 position4 = _eBattleship[attackTo.Index].transform.position; float y = position4.y + 0.5f; Vector3 position5 = _eBattleship[attackTo.Index].transform.position; target = new Vector3(x2, y, position5.z); _listPSTorpedoWake.Add(_createTorpedo(injection, target, isRescue: true)); _isTorpedoHit[0] = true; } } Vector3 injection2 = default(Vector3); Vector3 target2 = default(Vector3); for (int j = 0; j < _eBattleship.Count; j++) { ShipModel_BattleAll shipModel_BattleAll2 = ships_e[j]; ShipModel_Defender attackTo2 = _clsRaigeki.GetAttackTo(shipModel_BattleAll2); if (shipModel_BattleAll2 != null && attackTo2 != null) { RaigekiDamageModel attackDamage2 = _clsRaigeki.GetAttackDamage(attackTo2.Index, is_friend: true); if (!attackDamage2.GetProtectEffect(shipModel_BattleAll2.TmpId)) { int index2 = attackTo2.Index; } if (attackDamage2.GetHitState(shipModel_BattleAll2.TmpId) == BattleHitStatus.Miss) { _dicIsMiss[FleetType.Friend][attackTo2.Index] = true; } if (attackDamage2.GetHitState(shipModel_BattleAll2.TmpId) == BattleHitStatus.Clitical) { _dicIsCriticall[FleetType.Friend][attackTo2.Index] = true; } Vector3 position6 = _fBattleship[attackTo2.Index].transform.position; float x3 = position6.x; Vector3 position7 = _fBattleship[attackTo2.Index].transform.position; injection2 = new Vector3(x3, 1f, position7.z - 13f); Vector3 position8 = _fBattleship[attackTo2.Index].transform.position; float x4 = position8.x; Vector3 position9 = _fBattleship[attackTo2.Index].transform.position; float y2 = position9.y + 0.5f; Vector3 position10 = _fBattleship[attackTo2.Index].transform.position; target2 = new Vector3(x4, y2, position10.z); _listPSTorpedoWake.Add(_createTorpedo(injection2, target2, isRescue: true)); _isTorpedoHit[1] = true; } } }