示例#1
0
        public void Process(GameField game, Player caster, Player opponent, PokemonCard pokemonSource)
        {
            if (!CoinflipConditional.IsOk(game, caster))
            {
                return;
            }

            DamageStopper damageStopper;

            if (maxDamage > 0)
            {
                damageStopper = new DamageStopper((x) => x <= maxDamage)
                {
                    Amount = amount
                };
            }
            else
            {
                damageStopper = new DamageStopper((x) => true)
                {
                    Amount = amount
                };
            }

            damageStopper.LastsUntilDamageTaken = LastsUntilDamage;

            if (onlyProtectSelf)
            {
                pokemonSource.DamageStoppers.Add(damageStopper);
            }
            else
            {
                game.DamageStoppers.Add(damageStopper);
            }
        }
        public override void ProcessEffects(GameField game, Player owner, Player opponent)
        {
            if (CoinFlip && game.FlipCoins(1) == 0)
            {
                return;
            }

            DamageStopper damageStopper;

            if (maxDamage > 0)
            {
                damageStopper = new DamageStopper((x) => x <= maxDamage)
                {
                    Amount = amount
                };
            }
            else
            {
                damageStopper = new DamageStopper((x) => true)
                {
                    Amount = amount
                };
            }

            if (onlyProtectSelf)
            {
                owner.ActivePokemonCard.DamageStoppers.Add(damageStopper);
            }
            else
            {
                game.DamageStoppers.Add(damageStopper);
            }

            base.ProcessEffects(game, owner, opponent);
        }