コード例 #1
0
 private void CheckR7AstromechAbility(Ship.GenericShip ship)
 {
     if (!usedThisRound)
     {
         ActionsList.GenericAction newAction = new ActionsList.R7AstromechActionEffect(this)
         {
             ImageUrl = HostUpgrade.ImageUrl,
             HostShip = HostShip
         };
         HostShip.AddAvailableDiceModificationOwn(newAction);
     }
 }
コード例 #2
0
 private void AskToPerformAbilityAction()
 {
     HostShip.AskPerformFreeAction(
         new List <GenericAction>()
     {
         new TargetLockAction(),
         new BarrelRollAction()
     },
         Triggers.FinishTrigger,
         "Fine-Tuned Thrusters"
         );
 }
コード例 #3
0
ファイル: OutlawTech.cs プロジェクト: vitreuz/FlyCasual
        private void RegisterOutlawTechAbility(GenericShip ship)
        {
            if (BoardTools.Board.IsOffTheBoard(ship))
            {
                return;
            }

            if (HostShip.GetLastManeuverColor() == Movement.MovementComplexity.Complex)
            {
                RegisterAbilityTrigger(TriggerTypes.OnMovementFinish, AskAssignFocusToken);
            }
        }
コード例 #4
0
        private void PerformFreeAction(object sender, System.EventArgs e)
        {
            var previousSelectedShip = Selection.ThisShip;

            Selection.ThisShip = HostShip;

            HostShip.AskPerformFreeAction(HostShip.GetAvailableActions(), delegate
            {
                Selection.ThisShip = previousSelectedShip;
                Triggers.FinishTrigger();
            });
        }
コード例 #5
0
 private void AskPerformBoostAction(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         new BoostAction()
     {
         Color = ActionColor.Red
     },
         Triggers.FinishTrigger,
         descriptionShort: Name,
         descriptionLong: "After you perform an action, you may perform a red Boost action"
         );
 }
コード例 #6
0
 public override void ActivateAbility()
 {
     HostShip.ChangeAgilityBy(1);
     if (RuleSet.Instance is FirstEdition)
     {
         HostShip.OnAttackHitAsDefender += RegisterStealthDeviceCleanup;
     }
     else
     {
         HostShip.OnDamageWasSuccessfullyDealt += RegisterStealthDeviceCleanupSe;
     }
 }
コード例 #7
0
 private void SpendCharge(Action <bool> callback)
 {
     if (HostShip.State.Charges > 0)
     {
         HostShip.SpendCharge();
         callback(true);
     }
     else
     {
         callback(false);
     }
 }
コード例 #8
0
ファイル: Finn.cs プロジェクト: qbasicjed/FlyCasual
        public override void ActionEffect(Action callBack)
        {
            HostShip.AddAlreadyUsedDiceModification(new FinnTransportPodDiceModificationFocus()
            {
                HostShip = HostShip
            });

            Combat.CurrentDiceRoll.AddDice(DieSide.Blank).ShowWithoutRoll();
            Combat.CurrentDiceRoll.OrganizeDicePositions();

            callBack();
        }
コード例 #9
0
        private void AskPerformFreeActions(object sender, System.EventArgs e)
        {
            Sounds.PlayShipSound("Astromech-Beeping-and-whistling");

            HostShip.AskPerformFreeAction(
                new List <GenericAction>()
            {
                new BoostAction(),
                new BarrelRollAction()
            },
                Triggers.FinishTrigger);
        }
コード例 #10
0
ファイル: BB8.cs プロジェクト: vladamex/FlyCasual
        private void BB8AskBarrelRoll(object sender, EventArgs e)
        {
            Sounds.PlayShipSound("BB-8-Sound");

            HostShip.AskPerformFreeAction(
                new List <GenericAction>()
            {
                new BarrelRollAction()
            },
                Triggers.FinishTrigger
                );
        }
コード例 #11
0
        private void ActivateBiggsAbility(object sender, System.EventArgs e)
        {
            IsAbilityUsed = true;
            HostShip.AssignToken(new Conditions.BiggsDarklighterCondition(), delegate { });

            GenericShip.OnTryPerformAttackGlobal += CanPerformAttack;

            HostShip.OnDestroyed    += RemoveBiggsDarklighterAbility;
            Phases.OnCombatPhaseEnd += RemoveBiggsDarklighterAbility;

            SubPhases.DecisionSubPhase.ConfirmDecision();
        }
コード例 #12
0
ファイル: KananJarrus.cs プロジェクト: Wutex666/FlyCasual
        private void CheckPilotAbility()
        {
            bool IsDifferentPlayer = (HostShip.Owner.PlayerNo != Combat.Attacker.Owner.PlayerNo);
            bool HasFocusTokens    = HostShip.HasToken(typeof(Tokens.FocusToken));

            Board.ShipDistanceInformation distanceInfo = new Board.ShipDistanceInformation(HostShip, Combat.Attacker);

            if (IsDifferentPlayer && HasFocusTokens && distanceInfo.Range < 3)
            {
                RegisterAbilityTrigger(TriggerTypes.OnAttackStart, AskDecreaseAttack);
            }
        }
コード例 #13
0
 private void ActivateComposure(object sender, System.EventArgs e)
 {
     if (!HostShip.Tokens.HasTokenByColor(TokenColors.Green))
     {
         Messages.ShowInfo(HostUpgrade.UpgradeInfo.Name + ": You may perform a Focus action");
         HostShip.AskPerformFreeAction(new FocusAction(), Triggers.FinishTrigger);
     }
     else
     {
         Triggers.FinishTrigger();
     }
 }
コード例 #14
0
        private void CheckAbility(List <ManeuverTemplate> availableTemplates, GenericUpgrade upgrade)
        {
            List <ManeuverTemplate> dropTemplates = HostShip.GetAvailableBombDropTemplates(upgrade);

            foreach (ManeuverTemplate template in dropTemplates)
            {
                if (!availableTemplates.Any(n => n.Name == template.Name))
                {
                    availableTemplates.Add(template);
                }
            }
        }
コード例 #15
0
        private void AskToPerformBoost(object sender, System.EventArgs e)
        {
            Messages.ShowInfoToHuman(HostUpgrade.UpgradeInfo.Name + ": You may perform a red Boost action");

            HostShip.AskPerformFreeAction(
                new BoostAction()
            {
                IsRed = true
            },
                Triggers.FinishTrigger
                );
        }
コード例 #16
0
ファイル: Finn.cs プロジェクト: qbasicjed/FlyCasual
        public override void ActionEffect(Action callBack)
        {
            HostShip.AddAlreadyUsedDiceModification(new FinnTransportPodDiceModificationBlank()
            {
                HostShip = HostShip
            });

            Combat.CurrentDiceRoll.AddDice(DieSide.Focus).ShowWithoutRoll();
            Combat.CurrentDiceRoll.OrganizeDicePositions();

            HostShip.Tokens.AssignToken(typeof(Tokens.StrainToken), callBack);
        }
コード例 #17
0
        public override void ActivateAbility()
        {
            HostShip.ChangeFirepowerBy(1);

            HostShip.ShipBaseArcsType = Arcs.BaseArcsType.ArcMobile; //This seems to work, but still prompt the user twice at the beginning
            HostShip.InitializeShipBaseArc();
            HostShip.SetShipInsertImage();

            HostShip.AfterGotNumberOfAttackDice      += CheckWeakArc;
            HostShip.BeforeRemovingTokenInEndPhase   += KeepTwoFocusTokens;
            Phases.Events.OnEndPhaseStart_NoTriggers += OnEndPhaseStart_NoTriggers;
        }
コード例 #18
0
 private void ProposeFreeEvadeAction(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         new EvadeAction()
     {
         HostShip = HostShip
     },
         Triggers.FinishTrigger,
         descriptionShort: Name,
         descriptionLong: "After you decloak, you may perform an Evade action"
         );
 }
コード例 #19
0
        private void BB8AskBarrelRoll(object sender, EventArgs e)
        {
            Sounds.PlayShipSound("BB-8-Sound");

            HostShip.AskPerformFreeAction(
                new BarrelRollAction(),
                Triggers.FinishTrigger,
                HostUpgrade.UpgradeInfo.Name,
                "When you reveal a green maneuver, you may perform a free Barrel Roll action.",
                HostUpgrade
                );
        }
コード例 #20
0
        private void UsePatternAnalyzer(object sender, System.EventArgs e)
        {
            List <GenericAction> actions = Selection.ThisShip.GetAvailableActions();

            HostShip.AskPerformFreeAction(
                actions,
                Triggers.FinishTrigger,
                HostUpgrade.UpgradeInfo.Name,
                "While you fully execute a red maneuver, before the Check Difficulty step, you may perform 1 action",
                HostUpgrade
                );
        }
コード例 #21
0
        private void AskPerformBoostAction(object sender, System.EventArgs e)
        {
            Messages.ShowInfoToHuman("Vectored Thrusters: you may perform a red boost action");

            HostShip.AskPerformFreeAction(
                new BoostAction()
            {
                IsRed = true
            },
                Triggers.FinishTrigger
                );
        }
コード例 #22
0
        private void DeathfireEffect(object sender, EventArgs e)
        {
            var actions = HostShip.GetAvailableActions()
                          .Where(action => action is BombDropAction)
                          .ToList();

            HostShip.AskPerformFreeAction(actions, () =>
            {
                ClearIsAbilityUsedFlag();
                Triggers.FinishTrigger();
            });
        }
コード例 #23
0
        private void RegisterTargetingAstromech(GenericShip hostShip)
        {
            if (HostShip.GetLastManeuverColor() != Movement.MovementComplexity.Complex)
            {
                return;
            }
            if (Board.IsOffTheBoard(hostShip))
            {
                return;
            }

            RegisterAbilityTrigger(TriggerTypes.OnMovementFinish, AssignAstromechTargetingLock);
        }
コード例 #24
0
ファイル: R2Astromech.cs プロジェクト: vitreuz/FlyCasual
 private void RegenShield(object sender, EventArgs e)
 {
     HostUpgrade.State.SpendCharge();
     HostShip.Tokens.AssignToken(typeof(WeaponsDisabledToken), () =>
     {
         if (HostShip.TryRegenShields())
         {
             Sounds.PlayShipSound("R2D2-Proud");
             Messages.ShowInfo(HostName + " causes " + HostShip.PilotInfo.PilotName + " to recover 1 shield and gain 1 disarm token");
         }
         Triggers.FinishTrigger();
     });
 }
コード例 #25
0
 private void AskToUseLeevanTenzaAbility(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         new EvadeAction()
     {
         Color = ActionColor.Red
     },
         Triggers.FinishTrigger,
         HostShip.PilotInfo.PilotName,
         "After you perform a Barrel Roll or Boost action, you may perform a red Evade action.",
         HostShip
         );
 }
コード例 #26
0
ファイル: KadSolus.cs プロジェクト: vladamex/FlyCasual
        protected virtual bool CheckAbility()
        {
            if (HostShip.GetLastManeuverColor() != Movement.MovementComplexity.Complex)
            {
                return(false);
            }
            if (BoardTools.Board.IsOffTheBoard(HostShip))
            {
                return(false);
            }

            return(true);
        }
コード例 #27
0
 private void UseAbility(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         new FocusAction()
     {
         Color = ActionColor.Red
     },
         Triggers.FinishTrigger,
         HostUpgrade.UpgradeInfo.Name,
         "Before you engage, you may perform a red Focus action.",
         HostUpgrade
         );
 }
コード例 #28
0
ファイル: Vizier.cs プロジェクト: vladamex/FlyCasual
        private void AskToPerformCoordinate(object sender, System.EventArgs e)
        {
            Messages.ShowInfo("\"Vizier\" can perform a Coordinate action");

            RestrictedAbilityIsActivated  = true;
            HostShip.OnActionIsPerformed += CheckActionRestriction;
            HostShip.OnMovementStart     += ClearRestrictedAbility;

            HostShip.AskPerformFreeAction(new CoordinateAction()
            {
                Host = HostShip
            }, Triggers.FinishTrigger);
        }
コード例 #29
0
 private void AcquireSecondTargetLock(object sender, System.EventArgs e)
 {
     IsAbilityUsed = true;
     HostShip.ChooseTargetToAcquireTargetLock(
         delegate
     {
         IsAbilityUsed = false;
         Triggers.FinishTrigger();
     },
         "You may acquare a lock",
         HostUpgrade.ImageUrl
         );
 }
コード例 #30
0
ファイル: IdenVersio.cs プロジェクト: jychuah/FlyCasual
 private void UseIdenVersioAbilitySE(object sender, System.EventArgs e)
 {
     // Are there any non-crit damage results in the damage queue?
     if (HostShip.State.Charges > 0)
     {
         // If there are we prompt to see if they want to use the ability.
         AskToUseAbility(AlwaysUseByDefault, delegate { HostShip.RemoveCharge(BlankDamage); });
     }
     else
     {
         Triggers.FinishTrigger();
     }
 }