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); }
private void _createTorpedo(FleetType type, Dictionary <int, UIBattleShip> dicAttackShip, Dictionary <int, UIBattleShip> dicDefenceShip) { if (!_dicIsAttack[type]) { return; } for (int i = 0; i < dicAttackShip.Count; i++) { ShipModel_Battle shipModel = dicAttackShip[i].shipModel; ShipModel_Battle attackTo = _clsTorpedo.GetAttackTo(shipModel); if (shipModel != null && attackTo != null) { if (shipModel.ShipType == 4) { _isTC[(int)type] = true; } if (_listTorpedoWake != null) { _listTorpedoWake.Add(_instantiateTorpedo(dicAttackShip[i].transform.position, dicDefenceShip[attackTo.Index].transform.position, i, 8f, isDet: false, isMiss: false, isD: false)); } } } }