Example #1
0
 public override void ActionEffect(Action callBack)
 {
     // remove one shield
     // It should not be possible to get there without having at least one shield (IsActionEffectAvailable),
     //   but just in case ...
     if (Host.Shields > 0)
     {
         Messages.ShowInfoToHuman(Name + ": losing one shield to reroll any number of dice");
         Host.LoseShield();
         // reroll dice
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             SidesCanBeRerolled        = null, // all the sides can be reroll
             NumberOfDiceCanBeRerolled = 0,
             CallBack = callBack               // all the dices can be reroll
         };
         diceRerollManager.Start();
     }
     else
     {
         // should never happens, thanks to IsActionEffectAvailable...
         Messages.ShowError(Name + ": no shield available, unable to use the ability.");
         callBack();
     }
 }
Example #2
0
            public override void ActionEffect(System.Action callBack)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    NumberOfDiceCanBeRerolled = 1,
                    CallBack = callBack
                };

                diceRerollManager.Start();
            }
Example #3
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = (Combat.Defender.IsUnique) ? 2 : 1,
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
Example #4
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = (Combat.Defender.PilotSkill > 2) ? 1 : 2,
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
Example #5
0
        public override void ActionEffect(Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = 1,
                CallBack = callBack
            };

            Source.State.SpendCharge();
            diceRerollManager.Start();
        }
Example #6
0
        public override void ActionEffect(System.Action callBack)
        {
            Host.OnRerollIsConfirmed += AssignStressForEachRerolled;

            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
Example #7
0
            public override void ActionEffect(System.Action callBack)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    CallBack = callBack
                };

                diceRerollManager.Start();
                SelectAllRerolableDices();
                diceRerollManager.ConfirmRerollButtonIsPressed();
            }
Example #8
0
 public override void ActionEffect(System.Action callBack)
 {
     Host.Tokens.SpendToken(typeof(BlueTargetLockToken),
                            delegate {
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             CallBack = callBack
         };
         diceRerollManager.Start();
     }, sharaLockLetter);
 }
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                CallBack = delegate { Source.TryDiscard(callBack); }
            };

            diceRerollManager.Start();
            SelectAllRerolableDices();
            diceRerollManager.ConfirmRerollButtonIsPressed();
        }
Example #10
0
            public override void ActionEffect(System.Action callBack)
            {
                // reroll dice
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    SidesCanBeRerolled        = null, // all the sides can be reroll
                    NumberOfDiceCanBeRerolled = Combat.Attacker.PrimaryWeapon.AttackValue,
                    CallBack = callBack               // all the dices can be reroll
                };

                diceRerollManager.Start();
            }
Example #11
0
            public override void ActionEffect(System.Action callBack)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    SidesCanBeRerolled = new List <DieSide> {
                        DieSide.Blank
                    },
                    CallBack = callBack
                };

                diceRerollManager.Start();
            }
Example #12
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                SidesCanBeRerolled = new System.Collections.Generic.List <DieSide> {
                    DieSide.Focus
                },
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
Example #13
0
        //Reroll is the effect of Rage
        public override void ActionEffect(System.Action callBack)
        {
            IsReroll = true; //These effect is a reroll effect

            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = 3,
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
Example #14
0
 public override void ActionEffect(System.Action callBack)
 {
     int dices = getDices();
     if (dices > 0)
     {
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             NumberOfDiceCanBeRerolled = dices,
             CallBack = callBack
         };
         diceRerollManager.Start();
     }
 }
Example #15
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = 1,
                IsOpposite = true,
                CallBack   = delegate {
                    AssignStress(callBack);
                }
            };

            diceRerollManager.Start();
        }
Example #16
0
            public override void ActionEffect(System.Action callBack)
            {
                int tempFriendlyShips = numFriendlyShips;

                numFriendlyShips = 0;

                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    NumberOfDiceCanBeRerolled = tempFriendlyShips,
                    CallBack = callBack
                };

                diceRerollManager.Start();
            }
Example #17
0
 public override void ActionEffect(System.Action callBack)
 {
     hostAbility.usedThisRound = true;
     SpendTargetLock(() =>
     {
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             NumberOfDiceCanBeRerolled = int.MaxValue,
             IsOpposite = true,
             CallBack   = callBack
         };
         diceRerollManager.Start();
     });
 }
Example #18
0
        public override void ActionEffect(System.Action callBack)
        {
            GenericSpecialWeapon weapon = Combat.ChosenWeapon as GenericSpecialWeapon;

            weapon.State.SpendCharge();
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = 2,
                IsOpposite = true,
                CallBack   = callBack
            };

            diceRerollManager.Start();
        }
Example #19
0
        public override void ActionEffect(System.Action callBack)
        {
            // Can reroll focus if Attacker PS > 2, focus or blank if Attacker PS <= 2
            List<DieSide> allowedRerolls =
                (Combat.Attacker.PilotSkill > 2) ?
                new List<DieSide> { DieSide.Focus } :
                new List<DieSide> { DieSide.Blank, DieSide.Focus };

            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                SidesCanBeRerolled = allowedRerolls,
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
Example #20
0
 /// <summary>
 /// Creates an action effect that allows rerolling dice
 /// </summary>
 /// <param name="numberOfDice">Number of dice that can be rerolled</param>
 /// <param name="sidesCanBeRerolled">List of die sides that can be rerolled. Default is all sides.</param>
 /// <param name="isOpposite">Set to true to reroll the opposing players dice</param>
 public void AllowReroll(int numberOfDice, List <DieSide> sidesCanBeRerolled = null, bool isOpposite = false)
 {
     if (IsReroll == null)
     {
         IsReroll = true;
     }
     ActionEffects.Add(callback =>
     {
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             NumberOfDiceCanBeRerolled = numberOfDice,
             SidesCanBeRerolled        = sidesCanBeRerolled,
             IsOpposite = isOpposite,
             CallBack   = callback
         };
         diceRerollManager.Start();
     });
 }
Example #21
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = 1,
                IsOpposite = true,
                CallBack   = delegate {
                    if (Combat.CurrentDiceRoll.DiceRerolled.Any())
                    {
                        AssignStress(callBack);
                    }
                    else
                    {
                        callBack();
                    }
                }
            };

            diceRerollManager.Start();
        }
Example #22
0
        private void DiceModificationReroll(Action callback, Func <int> getCount, List <DieSide> sidesCanBeSelected, DiceModificationTimingType timing)
        {
            int diceCount = getCount();

            if (diceCount > 0)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    NumberOfDiceCanBeRerolled = diceCount,
                    SidesCanBeRerolled        = sidesCanBeSelected,
                    IsOpposite = timing == DiceModificationTimingType.Opposite,
                    CallBack   = callback
                };
                diceRerollManager.Start();
            }
            else
            {
                Messages.ShowErrorToHuman("0 dice can be rerolled");
                callback();
            }
        }
Example #23
0
        public override void ActionEffect(System.Action callBack)
        {
            if (Actions.HasTargetLockOn(Combat.Attacker, Combat.Defender))
            {
                targetLockLetter = Actions.GetTargetLocksLetterPair(Combat.Attacker, Combat.Defender);
                Combat.Attacker.Tokens.GetToken(typeof(BlueTargetLockToken), targetLockLetter).CanBeUsed = false;

                Combat.Attacker.OnAttackFinish += SetTargetLockCanBeUsed;

                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    NumberOfDiceCanBeRerolled = 1,
                    CallBack = callBack
                };
                diceRerollManager.Start();
            }
            else
            {
                Messages.ShowInfoToHuman("Cannot use ability: no Target Lock on defender");
                callBack();
            }
        }
Example #24
0
        private void DiceModificationReroll(Action callback, Func <int> getCount, List <DieSide> sidesCanBeSelected, DiceModificationTimingType timing, bool isTrueReroll = true, bool isForcedFullReroll = false)
        {
            int diceCount = getCount();

            if (diceCount > 0)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    NumberOfDiceCanBeRerolled = diceCount,
                    SidesCanBeRerolled        = sidesCanBeSelected,
                    IsOpposite         = timing == DiceModificationTimingType.Opposite,
                    IsTrueReroll       = isTrueReroll,
                    IsForcedFullReroll = isForcedFullReroll,
                    CallBack           = callback
                };
                diceRerollManager.Start();
            }
            else
            {
                Messages.ShowErrorToHuman("No dice are eligible to be rerolled");
                callback();
            }
        }
Example #25
0
 public override void ActionEffect(Action callBack)
 {
     // remove one shield
     // It should not be possible to get there without having at least one shield (IsActionEffectAvailable),
     //   but just in case ...
     if (HostShip.State.ShieldsCurrent > 0)
     {
         Messages.ShowInfoToHuman("Inaldra is losing one shield to reroll any number of dice");
         HostShip.LoseShield();
         // reroll dice
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             SidesCanBeRerolled = null,    // all the sides can be reroll
             CallBack           = callBack // all the dices can be reroll
         };
         diceRerollManager.Start();
     }
     else
     {
         // should never happens, thanks to IsActionEffectAvailable...
         Messages.ShowError("Inaldra has no shields available and is unable to use her ability");
         callBack();
     }
 }