示例#1
0
        public void OnAttachedTo(PokemonCard attachedTo, bool fromHand, GameField game)
        {
            if (!CoinflipConditional.IsOk(game, attachedTo.Owner))
            {
                return;
            }

            attachedTo.Heal(Amount, game);
        }
示例#2
0
        public void Process(GameField game, Player caster, Player opponent, PokemonCard pokemonSource)
        {
            var selector = OpponentPicks ? opponent : caster;
            var other    = OpponentPicks ? caster : opponent;

            if (!CoinflipConditional.IsOk(game, caster))
            {
                return;
            }

            PokemonCard target = Targeting.AskForTargetFromTargetingMode(TargetingMode, game, selector, other, selector.ActivePokemonCard);

            target?.Heal(Amount, game);
        }
示例#3
0
        public void Process(GameField game, Player caster, Player opponent, PokemonCard pokemonSource)
        {
            while (true)
            {
                PokemonCard target = Targeting.AskForTargetFromTargetingMode(TargetingMode, game, caster, opponent, caster.ActivePokemonCard);

                if (target == null)
                {
                    return;
                }

                if (target.AttachedEnergy.Count < amountToDiscard)
                {
                    continue;
                }

                if (target.AttachedEnergy.Count == AmountToDiscard)
                {
                    for (int i = 0; i < AmountToDiscard; i++)
                    {
                        target.DiscardEnergyCard(target.AttachedEnergy[0], game);
                    }
                    target.AttachedEnergy.Clear();
                }
                else
                {
                    var message  = new PickFromListMessage(target.AttachedEnergy.OfType <Card>().ToList(), AmountToDiscard).ToNetworkMessage(game.Id);
                    var response = caster.NetworkPlayer.SendAndWaitForResponse <CardListMessage>(message);

                    foreach (var id in response.Cards)
                    {
                        var card = (EnergyCard)game.Cards[id];

                        target.DiscardEnergyCard(card, game);
                    }
                }

                target.Heal(AmountToHeal, game);

                break;
            }
        }