Beispiel #1
0
        private void StartSubphaseForColonelJendonAbility(object sender, System.EventArgs e)
        {
            if (HostShip.Owner.Ships.Count > 1 && HostShip.HasToken(typeof(Tokens.BlueTargetLockToken), '*'))
            {
                var pilotAbilityDecision = (ColonelJendonDecisionSubPhase)Phases.StartTemporarySubPhaseNew(
                    Name,
                    typeof(ColonelJendonDecisionSubPhase),
                    Triggers.FinishTrigger
                    );

                pilotAbilityDecision.InfoText = "Use Colonel Jendon's ability?";

                var blueTargetLocks = HostShip.GetAssignedTokens()
                                      .Where(t => t is Tokens.BlueTargetLockToken)
                                      .Select(x => (Tokens.BlueTargetLockToken)x)
                                      .OrderBy(y => y.Letter)
                                      .ToList();

                pilotAbilityDecision.AddDecision("No", DontUseColonelJendonAbility);

                blueTargetLocks.ForEach(l => {
                    var name = "Target Lock " + l.Letter;
                    pilotAbilityDecision.AddDecision(name, delegate { UseColonelJendonAbility(l.Letter); });
                    pilotAbilityDecision.AddTooltip(name, l.OtherTokenOwner.ImageUrl);
                });

                pilotAbilityDecision.DefaultDecision = "No";

                pilotAbilityDecision.Start();
            }
            else
            {
                Triggers.FinishTrigger();
            }
        }