protected override void PerformXAction(int currentTurn) { if (attachedPlayer != null && !attachedPlayer.IsKnockedOut && attachedPlayer.CurrentStation.StationLocation.IsOnShip()) { SittingDuck.DrainEnergy(attachedPlayer.CurrentStation.StationLocation, 1); } }
internal InterceptorsOnShipComponent( SittingDuck sittingDuck, Interceptors interceptors) { Interceptors = interceptors; this.sittingDuck = sittingDuck; }
internal InterceptorsInSpaceComponent( SittingDuck sittingDuck, StationLocation stationLocation) { this.stationLocation = stationLocation; this.sittingDuck = sittingDuck; }
protected override void PerformZAction(int currentTurn) { foreach (var zone in EnumFactory.All <ZoneLocation>()) { Attack(1 + SittingDuck.GetEnergyInReactor(zone)); } }
protected override void PerformYAction(int currentTurn) { var stationsWithMultiplePlayers = EnumFactory.All <StationLocation>() .Where(stationLocation => stationLocation.IsOnShip()) .Where(stationLocation => SittingDuck.GetPlayerCount(stationLocation) > 1); SittingDuck.KnockOutPlayers(stationsWithMultiplePlayers); }
protected override void PerformXAction(int currentTurn) { foreach (var adjacentLocation in AdjacentLocations()) { DroneLocations.Add(adjacentLocation); } SittingDuck.SubscribeToMovingIn(DroneLocations, PoisonPlayer); SittingDuck.SubscribeToMovingOut(DroneLocations, PoisonPlayer); }
protected override void PerformZAction(int currentTurn) { var removedRocketCount = SittingDuck.RemoveAllRockets(); for (var i = 0; i < removedRocketCount; i++) { AttackSpecificZone(2, ZoneLocation.Red, ThreatDamageType.Standard); } }
protected UpperStation( StationLocation stationLocation, ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(stationLocation, threatController, gravolift, bluewardDoors, redwardDoors, sittingDuck) { }
protected override void PerformYAction(int currentTurn) { var energyDrained = SittingDuck.DrainReactors(new [] { CurrentZone }, 1); if (energyDrained == 0) { Attack(1); } }
protected override void PerformYAction(int currentTurn) { var drainedCapsule = SittingDuck.DestroyFuelCapsule(); if (drainedCapsule) { AttackAllZones(1); } }
static void Main() { var players = GetPlayers(); var sittingDuck = new SittingDuck(); sittingDuck.SetPlayers(players); var externalTracks = new [] { new ExternalTrack(TrackConfiguration.Track1, sittingDuck.BlueZone), new ExternalTrack(TrackConfiguration.Track2, sittingDuck.RedZone), new ExternalTrack(TrackConfiguration.Track3, sittingDuck.WhiteZone) }; var internalTrack = new InternalTrack(TrackConfiguration.Track4); var externalThreats = new ExternalThreat[] { new Destroyer(3, ZoneLocation.Blue, sittingDuck), new Fighter(4, ZoneLocation.Red, sittingDuck), new Fighter(5, ZoneLocation.White, sittingDuck) }; var internalThreats = new InternalThreat[] { new SkirmishersA(3, sittingDuck), new Fissure(2, sittingDuck) //new Alien(1, sittingDuck) }; var game = new Game(sittingDuck, externalThreats, externalTracks, internalThreats, internalTrack, players); var currentTurn = 0; try { for (currentTurn = 0; currentTurn < Game.NumberOfTurns; currentTurn++) { game.PerformTurn(); } } catch (LoseException loseException) { Console.WriteLine("Killed on turn {0} by: {1}", currentTurn, loseException.Threat); } Console.WriteLine("Damage Taken:\r\nBlue: {0}\r\nRed: {1}\r\nWhite: {2}", sittingDuck.BlueZone.TotalDamage, sittingDuck.RedZone.TotalDamage, sittingDuck.WhiteZone.TotalDamage); Console.WriteLine("Threats killed: {0}. Threats survived: {1}", game.defeatedThreats.Count, game.survivedThreats.Count); Console.WriteLine("Total points: {0}", game.TotalPoints); foreach (var zone in sittingDuck.Zones) { foreach (var token in zone.AllDamageTokensTaken) { Console.WriteLine("{0} damage token taken in zone {1}. Still damaged: {2}", token, zone.ZoneLocation, zone.CurrentDamageTokens.Contains(token)); } } }
protected override void PerformYAction(int currentTurn) { var otherPlayersInStation = SittingDuck.GetPlayersInStation(attachedPlayer.CurrentStation.StationLocation) .Except(new [] { attachedPlayer }); foreach (var player in otherPlayersInStation) { player.KnockOut(); } }
internal LowerWhiteStation( ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(StationLocation.LowerWhite, threatController, gravolift, bluewardDoors, redwardDoors, sittingDuck) { CentralReactor = new CentralReactor(); AlphaComponent = new PulseCannon(CentralReactor); VisualConfirmationComponent = new VisualConfirmationComponent(); }
internal UpperWhiteStation( CentralReactor whiteReactor, ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(StationLocation.UpperWhite, threatController, gravolift, bluewardDoors, redwardDoors, sittingDuck) { AlphaComponent = new CentralHeavyLaserCannon(whiteReactor, ZoneLocation.White); Shield = new CentralShield(whiteReactor); ComputerComponent = new ComputerComponent(); }
internal UpperBlueStation( SideReactor redReactor, ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(StationLocation.UpperBlue, threatController, gravolift, bluewardDoors, redwardDoors, sittingDuck) { AlphaComponent = new SideHeavyLaserCannon(redReactor, ZoneLocation.Blue); Shield = new SideShield(redReactor); BattleBotsComponent = new BattleBotsComponent(); }
protected override void PerformYAction(int currentTurn) { var upperRedPlayers = SittingDuck.GetPlayersInStation(StationLocation.UpperRed); var lowerRedPlayers = SittingDuck.GetPlayersInStation(StationLocation.LowerRed); var upperBluePlayers = SittingDuck.GetPlayersInStation(StationLocation.UpperBlue); var lowerBluePlayers = SittingDuck.GetPlayersInStation(StationLocation.LowerBlue); SittingDuck.TeleportPlayers(upperRedPlayers, StationLocation.UpperBlue); SittingDuck.TeleportPlayers(lowerRedPlayers, StationLocation.LowerBlue); SittingDuck.TeleportPlayers(upperBluePlayers, StationLocation.UpperRed); SittingDuck.TeleportPlayers(lowerBluePlayers, StationLocation.LowerRed); }
protected StandardStation( StationLocation stationLocation, ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(stationLocation, threatController) { Gravolift = gravolift; BluewardDoors = bluewardDoors; RedwardDoors = redwardDoors; SittingDuck = sittingDuck; }
internal UpperRedStation( SideReactor redReactor, Interceptors interceptors, ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(StationLocation.UpperRed, threatController, gravolift, bluewardDoors, redwardDoors, sittingDuck) { AlphaComponent = new SideHeavyLaserCannon(redReactor, ZoneLocation.Red); Shield = new SideShield(redReactor); InterceptorComponent = new InterceptorsOnShipComponent(sittingDuck, interceptors); }
internal LowerRedStation( CentralReactor whiteReactor, ThreatController threatController, Gravolift gravolift, Doors bluewardDoors, Doors redwardDoors, SittingDuck sittingDuck) : base(StationLocation.LowerRed, threatController, gravolift, bluewardDoors, redwardDoors, sittingDuck) { BatteryPack = new BatteryPack(); AlphaComponent = new SideLightLaserCannon(BatteryPack, ZoneLocation.Red); BattleBotsComponent = new BattleBotsComponent(); SideReactor = new SideReactor(whiteReactor); }
private void InfectPlayers() { if (infectedPlayers == null) { infectedPlayers = new InfectedPlayers(this); infectedPlayers.Initialize(SittingDuck, ThreatController, EventMaster); ThreatController.AddInternalThreat(infectedPlayers, TimeAppears, Position); } var playersInCurrentStation = SittingDuck.GetPlayersInStation(CurrentStation); foreach (var player in playersInCurrentStation) { infectedPlayers.InfectPlayer(player); } }
public override void TakeDamage(int damage, Player performingPlayer, bool isHeroic, StationLocation?stationLocation) { var remainingDamageWillDestroyThreat = RemainingHealth <= damage; var energyDrained = 0; if (remainingDamageWillDestroyThreat) { energyDrained = SittingDuck.DrainReactors(new [] { CurrentZone }, 1); } var cannotTakeDamage = remainingDamageWillDestroyThreat && energyDrained == 0; if (!cannotTakeDamage) { base.TakeDamage(damage, performingPlayer, isHeroic, stationLocation); } }
protected override void PerformYAction(int currentTurn) { switch (numberOfYsCrossed) { case 0: SittingDuck.AddZoneDebuff(new[] { ZoneLocation.Red }, ZoneDebuff.DisruptedOptics, this); break; case 1: SittingDuck.AddZoneDebuff(new[] { ZoneLocation.Blue }, ZoneDebuff.DisruptedOptics, this); break; default: throw new InvalidOperationException("Invalid number of Y's crossed."); } numberOfYsCrossed++; }
private void TeleportPlayersToOppositeDecks() { var playersByStation = EnumFactory.All <StationLocation>() .Where(stationLocation => stationLocation.IsOnShip()) .Select(stationLocation => new { Players = SittingDuck.GetPlayersInStation(stationLocation).ToList(), StationLocation = stationLocation }) .ToList(); foreach (var playerList in playersByStation) { SittingDuck.TeleportPlayers( playerList.Players, playerList.StationLocation.OppositeStationLocation().GetValueOrDefault()); } }
protected override void OnReachingEndOfTrack() { base.OnReachingEndOfTrack(); var malfunctionTypes = new[] { PlayerActionType.Alpha, PlayerActionType.Bravo, PlayerActionType.Charlie }; if (ActionType != null && malfunctionTypes.Contains(ActionType.Value)) { SittingDuck.AddIrreparableMalfunctionToStations( CurrentStations, new IrreparableMalfunction { ActionType = ActionType.Value }); } }
protected override void PerformYAction(int currentTurn) { SittingDuck.DrainReactors(EnumFactory.All <ZoneLocation>(), 1); }
protected override void PerformXAction(int currentTurn) { SittingDuck.DrainReactors(new [] { ZoneLocation.White }, 2); }
protected override void OnHealthReducedToZero() { base.OnHealthReducedToZero(); SittingDuck.RemoveZoneDebuffForSource(EnumFactory.All <ZoneLocation>(), this); }
protected override void PerformYAction(int currentTurn) { SittingDuck.RemoveZoneDebuffForSource(EnumFactory.All <ZoneLocation>(), this); SittingDuck.AddZoneDebuff(EnumFactory.All <ZoneLocation>(), ZoneDebuff.ReversedShields, this); }
protected override void PerformXAction(int currentTurn) { SittingDuck.AddZoneDebuff(EnumFactory.All <ZoneLocation>(), ZoneDebuff.IneffectiveShields, this); }
private bool IsAnyPlayerPresent() { return(SittingDuck.GetPlayerCount(CurrentStation) != 0); }