예제 #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();
     }
 }
예제 #2
0
            public override void ActionEffect(System.Action callBack)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    NumberOfDiceCanBeRerolled = 1,
                    CallBack = callBack
                };

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

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

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

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

            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                CallBack = callBack
            };

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

                diceRerollManager.Start();
                SelectAllRerolableDices();
                diceRerollManager.ConfirmRerollButtonIsPressed();
            }
예제 #8
0
파일: SharaBey.cs 프로젝트: xNyer/FlyCasual
 public override void ActionEffect(System.Action callBack)
 {
     Host.Tokens.SpendToken(typeof(BlueTargetLockToken),
                            delegate {
         DiceRerollManager diceRerollManager = new DiceRerollManager
         {
             CallBack = callBack
         };
         diceRerollManager.Start();
     }, sharaLockLetter);
 }
예제 #9
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                CallBack = delegate { Source.TryDiscard(callBack); }
            };

            diceRerollManager.Start();
            SelectAllRerolableDices();
            diceRerollManager.ConfirmRerollButtonIsPressed();
        }
예제 #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();
            }
예제 #11
0
            public override void ActionEffect(System.Action callBack)
            {
                DiceRerollManager diceRerollManager = new DiceRerollManager
                {
                    SidesCanBeRerolled = new List <DieSide> {
                        DieSide.Blank
                    },
                    CallBack = callBack
                };

                diceRerollManager.Start();
            }
예제 #12
0
파일: Wired.cs 프로젝트: xNyer/FlyCasual
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                SidesCanBeRerolled = new System.Collections.Generic.List <DieSide> {
                    DieSide.Focus
                },
                CallBack = callBack
            };

            diceRerollManager.Start();
        }
예제 #13
0
파일: Rage.cs 프로젝트: jychuah/FlyCasual
        //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();
        }
예제 #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();
     }
 }
예제 #15
0
        public override void ActionEffect(System.Action callBack)
        {
            DiceRerollManager diceRerollManager = new DiceRerollManager
            {
                NumberOfDiceCanBeRerolled = 1,
                IsOpposite = true,
                CallBack   = delegate {
                    AssignStress(callBack);
                }
            };

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

                numFriendlyShips = 0;

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

                diceRerollManager.Start();
            }
예제 #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();
     });
 }
예제 #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();
        }
예제 #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();
        }
예제 #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();
     });
 }
예제 #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();
        }
예제 #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();
            }
        }
예제 #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();
            }
        }
예제 #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();
            }
        }
예제 #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();
     }
 }