private bool FilterTargetsForDealDamage(GenericShip ship) { // Only enemies in range 1 (range of bomb detonation is range 1) return(FilterByTargetType(ship, new List <TargetTypes>() { TargetTypes.Enemy }) && BombsManager.GetShipsInRange(detonatedBombObject).Contains(ship)); }
private bool IsAtLeastOneEnemyInRange(GenericBomb bomb, GameObject bombObject) { List <GenericShip> shipsInRange = BombsManager.GetShipsInRange(bombObject); // Count only enemies shipsInRange = shipsInRange.Where(n => n.Owner.PlayerNo != bomb.Host.Owner.PlayerNo).ToList(); return(shipsInRange.Count > 0); }
protected override void Detonate() { Phases.OnActivationPhaseEnd_Triggers -= PlanTimedDetonation; foreach (var ship in BombsManager.GetShipsInRange(BombsManager.CurrentBombObject)) { RegisterDetonationTriggerForShip(ship); } base.Detonate(); }
private void CheckDamage(GenericBomb bomb, GenericDeviceGameObject model) { if (BombsManager.GetShipsInRange(model).Contains(Host)) { Triggers.RegisterTrigger( new Trigger() { Name = "Rattled: Damage", TriggerOwner = Host.Owner.PlayerNo, TriggerType = TriggerTypes.OnAbilityDirect, EventHandler = RattledDamage } ); } }
private void CheckCatAbility(ref int count) { if (Combat.ChosenWeapon.WeaponType == WeaponTypes.PrimaryWeapon) { foreach (var bombHolder in BombsManager.GetBombsOnBoard()) { List <GenericShip> shipsNear = BombsManager.GetShipsInRange(bombHolder.Key); if (shipsNear.Contains(Combat.Defender) && bombHolder.Value.HostShip.Owner.PlayerNo == HostShip.Owner.PlayerNo) { Messages.ShowInfo(HostShip.PilotInfo.PilotName + ": +1 attack die"); count++; return; } } } }