コード例 #1
0
        private IEnumerator UseGrantedPower()
        {
            int targets = GetPowerNumeral(0, 1);
            int damages = GetPowerNumeral(1, 4);

            var usePowerAction = ActionSources.OfType <UsePowerAction>().First();
            var cs             = usePowerAction.CardSource ?? usePowerAction.Power.CardSource;

            var coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, cs.Card), damages, DamageType.Energy, targets, false, targets, cardSource: cs);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            //when played via discard, I'll already be in the trash, so skip
            if (!Card.IsInTrash)
            {
                coroutine = DestroySelf();
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
コード例 #2
0
        private IEnumerator UseGrantedPower()
        {
            int reduces = GetPowerNumeral(0, 2);

            var usePowerAction = ActionSources.OfType <UsePowerAction>().First();
            var cs             = usePowerAction.CardSource ?? usePowerAction.Power.CardSource;

            var card = GetCardThisCardIsNextTo();
            ReduceDamageStatusEffect effect = new ReduceDamageStatusEffect(reduces);

            effect.CardSource = cs.Card;
            effect.UntilStartOfNextTurn(this.DecisionMaker.TurnTaker);
            effect.TargetCriteria.IsInPlayAndNotUnderCard = true;
            effect.TargetCriteria.IsHero   = true;
            effect.TargetCriteria.IsTarget = true;

            var coroutine = GameController.AddStatusEffect(effect, true, cs);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #3
0
        private IEnumerator UseGrantedPower()
        {
            int djinnHP = GetPowerNumeral(0, 2);
            int otherHP = GetPowerNumeral(1, 1);

            var usePowerAction = ActionSources.OfType <UsePowerAction>().First();
            var cs             = usePowerAction.CardSource ?? usePowerAction.Power.CardSource;

            var coroutine = base.GameController.GainHP(DecisionMaker, c => c.IsTarget && c.IsInPlayAndHasGameText && (c.IsHero || IsDjinn(c)), c => IsDjinn(c) ? djinnHP : otherHP, cardSource: cs);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            //when played via discard, I'll already be in the trash, so skip
            if (!Card.IsInTrash)
            {
                coroutine = DestroySelf();
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
コード例 #4
0
        private IEnumerator UseGrantedPower()
        {
            int targets = GetPowerNumeral(0, 1);
            int damages = GetPowerNumeral(1, 6);

            var usePowerAction = ActionSources.OfType <UsePowerAction>().First();
            var cs             = usePowerAction.CardSource ?? usePowerAction.Power.CardSource;

            var coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, cs.Card), damages, DamageType.Energy, targets, false, targets, cardSource: cs);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #5
0
        private IEnumerator UseGrantedPower()
        {
            int hp = GetPowerNumeral(0, 3);

            var usePowerAction = ActionSources.OfType <UsePowerAction>().First();
            var cs             = usePowerAction.CardSource ?? usePowerAction.Power.CardSource;

            var coroutine = base.GameController.GainHP(DecisionMaker, c => c.IsTarget && c.IsHero && c.IsInPlayAndHasGameText, hp, cardSource: cs);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #6
0
        private IEnumerator UseGrantedPower()
        {
            int damages = GetPowerNumeral(0, 2);

            var usePowerAction = ActionSources.OfType <UsePowerAction>().First();
            var cs             = usePowerAction.CardSource ?? usePowerAction.Power.CardSource;

            var coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, cs.Card), damages, DamageType.Sonic, null, false, null,
                                                                      allowAutoDecide: true,
                                                                      additionalCriteria: c => c.IsInPlay && !c.IsHero,
                                                                      cardSource: cs);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }