예제 #1
0
        private void AskPerformFreeAction(object sender, System.EventArgs e)
        {
            if (HostShip.State.Force > 0)
            {
                Messages.ShowInfoToHuman(HostUpgrade.UpgradeInfo.Name + ": You may spend a force token to perform free action");

                HostShip.BeforeFreeActionIsPerformed += PayForceToken;
                HostShip.OnActionIsPerformed         += CheckSupernaturalReflexesDamage;
                HostShip.OnActionIsSkipped           += DeregisterSupernaturalReflexesEvents;

                HostShip.AskPerformFreeAction
                (
                    new List <GenericAction>()
                {
                    new BoostAction(),
                    new BarrelRollAction()
                },
                    Triggers.FinishTrigger
                );
            }
            else
            {
                Triggers.FinishTrigger();
            }
        }
예제 #2
0
        private void PerformAction(object sender, System.EventArgs e)
        {
            var ship = Selection.ThisShip;

            Roster.HighlightPlayer(HostShip.Owner.PlayerNo);
            Selection.ChangeActiveShip(HostShip);
            bool oldValue = HostShip.CanPerformActionsWhileStressed;

            HostShip.CanPerformActionsWhileStressed = true;
            //List<GenericAction> actions = Selection.ThisShip.ActionBar.AllActions;
            List <GenericAction> actions = Selection.ThisShip.GetAvailableActions();

            HostShip.CanPerformActionsWhileStressed = oldValue;

            foreach (GenericAction action in actions)
            {
                action.CanBePerformedWhileStressed = true;
            }

            HostShip.AskPerformFreeAction(
                actions,
                delegate {
                Roster.HighlightPlayer(ship.Owner.PlayerNo);
                Selection.ChangeActiveShip(ship);
                Triggers.FinishTrigger();
            },
                HostShip.PilotInfo.PilotName,
                "After another friendly ship is destroyed, you may perform an action, even while stressed",
                HostShip
                );
        }
예제 #3
0
파일: BB8.cs 프로젝트: Wutex666/FlyCasual
 private void BB8AskBarrelRoll(object sender, EventArgs e)
 {
     HostShip.AskPerformFreeAction(new List <ActionsList.GenericAction>()
     {
         new ActionsList.BarrelRollAction()
     }, Triggers.FinishTrigger);
 }
예제 #4
0
        private void PerformAction(object sender, System.EventArgs e)
        {
            Messages.ShowInfoToHuman("\"Avenger\": a friendly ship was destroyed you may to perform an action");

            var ship = Selection.ThisShip;

            Roster.HighlightPlayer(HostShip.Owner.PlayerNo);
            Selection.ChangeActiveShip(HostShip);
            bool oldValue = HostShip.CanPerformActionsWhileStressed;

            HostShip.CanPerformActionsWhileStressed = true;
            //List<GenericAction> actions = Selection.ThisShip.ActionBar.AllActions;
            List <GenericAction> actions = Selection.ThisShip.GetAvailableActions();

            HostShip.CanPerformActionsWhileStressed = oldValue;
            foreach (GenericAction action in actions)
            {
                action.CanBePerformedWhileStressed = true;
            }
            HostShip.AskPerformFreeAction(actions, delegate {
                Roster.HighlightPlayer(ship.Owner.PlayerNo);
                Selection.ChangeActiveShip(ship);
                Triggers.FinishTrigger();
            });
        }
예제 #5
0
파일: R4P17.cs 프로젝트: vitreuz/FlyCasual
        private void UseAbility(object sender, EventArgs e)
        {
            if (HostShip.AssignedManeuver.ColorComplexity == MovementComplexity.Complex && HostUpgrade.State.Charges > 0)
            {
                HostShip.BeforeActionIsPerformed += SpendCharge;

                HostShip.OnCheckCanPerformActionsWhileStressed += ConfirmThatIsPossible;
                HostShip.OnCanPerformActionWhileStressed       += AlwaysAllow;

                List <GenericAction> actions = HostShip.GetAvailableActions();

                HostShip.AskPerformFreeAction(
                    actions,
                    delegate
                {
                    HostShip.OnCheckCanPerformActionsWhileStressed -= ConfirmThatIsPossible;
                    HostShip.OnCanPerformActionWhileStressed       -= AlwaysAllow;

                    HostShip.BeforeActionIsPerformed -= SpendCharge;
                    Triggers.FinishTrigger();
                },
                    HostUpgrade.UpgradeInfo.Name,
                    "After you fully execute a red maneuver, you may spend 1 Charge to perform an action, even while stressed",
                    HostUpgrade
                    );
            }
            else
            {
                Triggers.FinishTrigger();
            }
        }
예제 #6
0
        private void PerformPushAction(object sender, System.EventArgs e)
        {
            List <GenericAction> actions          = HostShip.GetAvailableActions();
            List <GenericAction> actionBarActions = actions.Where(n => n.IsInActionBar).ToList();

            HostShip.AskPerformFreeAction(actionBarActions, AddStressToken);
        }
예제 #7
0
        private void PerformFreeAction(object sender, System.EventArgs e)
        {
            HostShip.GenerateAvailableActionsList();
            List <ActionsList.GenericAction> actions = Selection.ThisShip.GetAvailableActionsList();

            HostShip.AskPerformFreeAction(actions, Triggers.FinishTrigger);
        }
예제 #8
0
        private void AskPerformPerositionAction(object sender, System.EventArgs e)
        {
            if (!HostShip.IsStressed)
            {
                Messages.ShowInfoToHuman("AutoThrusters: you may perform a red action");

                HostShip.AskPerformFreeAction(
                    new List <GenericAction>()
                {
                    new BoostAction()
                    {
                        IsRed = true
                    },
                    new BarrelRollAction()
                    {
                        IsRed = true
                    }
                },
                    Triggers.FinishTrigger
                    );
            }
            else
            {
                Triggers.FinishTrigger();
            }
        }
예제 #9
0
        private void PerformBarrelRollNotAction(object sender, System.EventArgs e)
        {
            DecisionSubPhase.ConfirmDecisionNoCallback();

            Sounds.PlayShipSound("Ill try spinning - thats a good trick!");

            BarrelRollAction brAction = new BarrelRollAction {
                IsRealAction = false
            };

            HostShip.State.SpendForce(
                1,
                delegate
            {
                HostShip.AskPerformFreeAction(
                    brAction,
                    Triggers.FinishTrigger,
                    HostShip.PilotInfo.PilotName,
                    "You must perform Barrel Roll (this is not an action)",
                    HostShip,
                    isForced: true
                    );
            }
                );
        }
예제 #10
0
 private void AskToUseLeevanTenzaAbility(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(new EvadeAction()
     {
         IsRed = true
     }, Triggers.FinishTrigger);
 }
예제 #11
0
 private void AskToPerformPurpleReposition(object sender, EventArgs e)
 {
     if (HostShip.State.Force > 0)
     {
         HostShip.AskPerformFreeAction(
             new List <GenericAction>()
         {
             new BarrelRollAction()
             {
                 HostShip = HostShip, Color = ActionColor.Purple
             },
             new BoostAction()
             {
                 HostShip = HostShip, Color = ActionColor.Purple
             }
         },
             Triggers.FinishTrigger,
             descriptionShort: "Intuitive Controls",
             descriptionLong: "You may perform a purple barrel roll or boost action",
             imageHolder: HostShip
             );
     }
     else
     {
         Messages.ShowError("No force tokens left");
         Triggers.FinishTrigger();
     }
 }
예제 #12
0
        private void AskPerformFreeAction(object sender, System.EventArgs e)
        {
            if (HostShip.State.Force > 0)
            {
                HostShip.BeforeActionIsPerformed += PayForceToken;
                HostShip.OnActionIsPerformed     += CheckDebuff;
                HostShip.OnActionIsSkipped       += DeregisterDebuffEvents;

                HostShip.AskPerformFreeAction
                (
                    new List <GenericAction>()
                {
                    new BoostAction(),
                    new BarrelRollAction()
                },
                    Triggers.FinishTrigger,
                    HostUpgrade.UpgradeInfo.Name,
                    "You may spend 1 Force to perform a Barrel Roll or Boost action. Then, if you performed an action you do not have on your action bar, gain 1 strain token. Skip your action during Activation.",
                    HostUpgrade
                );
            }
            else
            {
                Triggers.FinishTrigger();
            }
        }
예제 #13
0
        private void PerformAction(object sender, System.EventArgs e)
        {
            var ship = Selection.ThisShip;

            Roster.HighlightPlayer(HostShip.Owner.PlayerNo);
            Selection.ChangeActiveShip(HostShip);

            HostShip.OnCheckCanPerformActionsWhileStressed += ConfirmThatIsPossible;
            HostShip.OnCanPerformActionWhileStressed       += AlwaysAllow;

            List <GenericAction> actions = Selection.ThisShip.GetAvailableActions();

            HostShip.OnCheckCanPerformActionsWhileStressed -= ConfirmThatIsPossible;
            HostShip.OnCanPerformActionWhileStressed       -= AlwaysAllow;

            foreach (GenericAction action in actions)
            {
                action.CanBePerformedWhileStressed = true;
            }

            HostShip.AskPerformFreeAction(
                actions,
                delegate {
                Roster.HighlightPlayer(ship.Owner.PlayerNo);
                Selection.ChangeActiveShip(ship);
                Triggers.FinishTrigger();
            },
                HostShip.PilotInfo.PilotName,
                "After another friendly ship is destroyed, you may perform an action, even while stressed",
                HostShip
                );
        }
예제 #14
0
        private void AskPerformFreeAction(object sender, System.EventArgs e)
        {
            if (HostShip.State.Force > 0)
            {
                HostShip.BeforeActionIsPerformed += PayForceToken;
                HostShip.OnActionIsPerformed     += CheckSupernaturalReflexesDamage;
                HostShip.OnActionIsSkipped       += DeregisterSupernaturalReflexesEvents;

                HostShip.AskPerformFreeAction
                (
                    new List <GenericAction>()
                {
                    new BoostAction(),
                    new BarrelRollAction()
                },
                    Triggers.FinishTrigger,
                    HostUpgrade.UpgradeInfo.Name,
                    "Before you activate, you may spend 1 Force to perform a Barrel Roll or Boost action. Then, if you performed an action you do not have on your action bar, suffer 1 damage.",
                    HostUpgrade
                );
            }
            else
            {
                Triggers.FinishTrigger();
            }
        }
예제 #15
0
        private void UseAdvancedSensors(object sender, System.EventArgs e)
        {
            List <GenericAction> actions = HostShip.GetAvailableActions();

            HostShip.AskPerformFreeAction(actions, SubPhases.DecisionSubPhase.ConfirmDecision);
            // if ability is used, skipped Perform Action
            HostShip.IsSkipsActionSubPhase = true;
        }
예제 #16
0
 private void ProposeFreeEvadeAction(object sender, System.EventArgs e)
 {
     Messages.ShowInfo("Stygium Array: You may perform an Evade action");
     HostShip.AskPerformFreeAction(new EvadeAction()
     {
         HostShip = HostShip
     }, Triggers.FinishTrigger);
 }
예제 #17
0
 private void PerformThreatTracker(object sender, EventArgs e)
 {
     Selection.ChangeActiveShip(HostShip);
     HostShip.AskPerformFreeAction(
         threatTrackerActions,
         ThreatTrackerCallback
         );
 }
예제 #18
0
        private void UseAbility(object sender, System.EventArgs e)
        {
            Messages.ShowInfo(HostUpgrade.UpgradeInfo.Name + ": You can perform free Red Focus action");

            HostShip.AskPerformFreeAction(new FocusAction()
            {
                IsRed = true
            }, Triggers.FinishTrigger);
        }
예제 #19
0
        private void BB8AskBarrelRoll(object sender, EventArgs e)
        {
            Sounds.PlayShipSound("BB-8-Sound");

            HostShip.AskPerformFreeAction(
                new BarrelRollAction(),
                Triggers.FinishTrigger
                );
        }
예제 #20
0
        private void PerformFreeReposition(object sender, System.EventArgs e)
        {
            List <GenericAction> actions = new List <GenericAction>()
            {
                new BoostAction(), new BarrelRollAction()
            };

            HostShip.AskPerformFreeAction(actions, Triggers.FinishTrigger);
        }
예제 #21
0
        private void AskToPerformWhiteActionAsRed(object sender, System.EventArgs e)
        {
            Messages.ShowInfoToHuman(HostUpgrade.UpgradeInfo.Name + ": You may perform an action");

            HostShip.AskPerformFreeAction(
                HostShip.GetAvailableActionsWhiteOnlyAsRed(),
                Triggers.FinishTrigger
                );
        }
예제 #22
0
        private void AskPerformAction(object sender, EventArgs e)
        {
            HostShip.BeforeFreeActionIsPerformed += SpendCharge;

            HostShip.AskPerformFreeAction(
                AbilityActions,
                CleanUp
                );
        }
예제 #23
0
 private void AskUseAbility(object sender, EventArgs e)
 {
     Messages.ShowInfo("AfterBurners: You may spend 1 charge to perform a boost action");
     HostShip.BeforeFreeActionIsPerformed += RegisterSpendChargeTrigger;
     HostShip.AskPerformFreeAction(new BoostAction()
     {
         CanBePerformedWhileStressed = true
     }, CleanUp);
 }
예제 #24
0
        private void PerformAction(object sender, System.EventArgs e)
        {
            HostShip.GenerateAvailableActionsList();
            List <GenericAction> actions = Selection.ThisShip.GetAvailableActionsList();

            HostShip.BeforeFreeActionIsPerformed += PayForceCost;
            Messages.ShowInfo("Darth Vader: you may spend 1 force to perform an action");
            HostShip.AskPerformFreeAction(actions, CleanUp);
        }
예제 #25
0
        private void PerformFreeFocusAction(object sender, System.EventArgs e)
        {
            List <ActionsList.GenericAction> actions = new List <ActionsList.GenericAction>()
            {
                new ActionsList.FocusAction()
            };

            HostShip.AskPerformFreeAction(actions, Triggers.FinishTrigger);
        }
예제 #26
0
파일: Virago.cs 프로젝트: krumok/FlyCasual
 private void AskUseAbility(object sender, EventArgs e)
 {
     Messages.ShowInfo("Virago: You may spend 1 charge to perform a red boost action. There are " + HostUpgrade.Charges + " charges remaining.");
     HostShip.BeforeFreeActionIsPerformed += RegisterSpendChargeTrigger;
     Selection.ChangeActiveShip(HostShip);
     HostShip.AskPerformFreeAction(new BoostAction()
     {
         IsRed = true, CanBePerformedWhileStressed = false
     }, CleanUp);
 }
예제 #27
0
 protected virtual void TurrPhennirPilotAbility(object sender, EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         new List <ActionsList.GenericAction>()
     {
         new ActionsList.BoostAction(),
         new ActionsList.BarrelRollAction()
     },
         Triggers.FinishTrigger);
 }
예제 #28
0
 private void AskToPerformFreeAction(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         HostShip.GetAvailableActions(),
         Triggers.FinishTrigger,
         HostShip.PilotInfo.PilotName,
         "After you drop or launch a device, you may perform an action",
         HostShip
         );
 }
예제 #29
0
 private void PerformFreeCloakAction(object sender, System.EventArgs e)
 {
     HostShip.AskPerformFreeAction(
         new CloakAction(),
         Triggers.FinishTrigger,
         HostUpgrade.UpgradeInfo.Name,
         "After you perform an attack, you may perform a free Cloak action",
         HostUpgrade
         );
 }
예제 #30
0
 private void PerformFreeAction()
 {
     HostShip.AskPerformFreeAction(
         HostShip.GetAvailableActions(),
         FinishAbility,
         HostShip.PilotInfo.PilotName,
         "After you defend, you may spend 1 Calculate token to perform an action",
         HostShip
         );
 }