@Override public MageInt getToughness() { return card.getToughness(); }
@Override public MageInt getToughness() { return sourceObject.getToughness(); }
break; case PARAM_PT: resInfo.add(card.getPower() + " / " + card.getToughness()); break; case PARAM_ABILITIES_COUNT:
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int amount = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); if (permanent != null) { for (UUID uuid : permanent.getImprinted()) { Card card = game.getCard(uuid); if (card != null) { amount += card.getToughness().getValue(); } } } return amount; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.getImprinted().isEmpty()) { Card card = game.getCard(permanent.getImprinted().get(0)); if (card != null) { permanent.addPower(card.getPower().getValue()); permanent.addToughness(card.getToughness().getValue()); return true; } return true; } return false; } }
public static int getCardDefinitionScore(final Game game, final Card card) { int value = 3; //TODO: add new rating system card value if (card.isLand()) { int score = (int) ((value / 2.0f) * 50); //TODO: check this for "any color" lands //TODO: check this for dual and filter lands /*for (Mana mana : card.getMana()) { score += 50; }*/ score += card.getMana().size() * 50; return score; } final int score = value * 100 - card.getManaCost().convertedManaCost() * 20; if (card.getCardType().contains(CardType.CREATURE)) { return score + (card.getPower().getValue() + card.getToughness().getValue()) * 10; } else { return score + (/*card.getRemoval()*50*/+card.getRarity().getRating() * 30); } }
@Override public boolean apply(Game game, Ability source) { Card targetCreatureCard = game.getCard(source.getFirstTarget()); if (targetCreatureCard != null) { targetCreatureCard.moveToExile(null, null, source.getSourceId(), game); int toughness = targetCreatureCard.getToughness().getValue(); SaprolingToken token = new SaprolingToken(); return token.putOntoBattlefield(toughness, game, source.getSourceId(), source.getControllerId()); } return false; } }
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { if (!permanent.getImprinted().isEmpty()) { List<UUID> imprinted = permanent.getImprinted(); if (imprinted == null || imprinted.isEmpty()) { return false; } Card card = game.getCard(imprinted.get(imprinted.size() - 1)); if (card != null && card.isCreature()) { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { permanent.getSubtype(game).addAll(card.getSubtype(game)); } break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { permanent.getPower().setValue(card.getPower().getValue()); permanent.getToughness().setValue(card.getToughness().getValue()); } } return true; } } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card targetCard = game.getCard(getTargetPointer().getFirst(game, source)); if (targetCard != null) { if (game.getState().getZone(targetCard.getId()) == Zone.GRAVEYARD) { controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); } controller.gainLife(targetCard.getToughness().getValue(), game, source); return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } Library library = player.getLibrary(); if (library == null || !library.hasCards()) { return false; } Card card = library.getFromTop(game); if (card == null) { return false; } if (player.moveCards(card, Zone.EXILED, source, game) && card.isCreature()) { game.addEffect(new BoostSourceEffect(card.getPower().getValue(), card.getToughness().getValue(), Duration.EndOfTurn), source); } return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { int xValue = card.getToughness().getValue() * -1; controller.moveCards(card, Zone.HAND, source, game); if (xValue != 0) { ContinuousEffect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); game.addEffect(effect, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.GRAVEYARD, true); return new CreateTokenEffect( new RitualOfTheReturnedZombieToken(card.getPower().getValue(), card.getToughness().getValue())).apply(game, source); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { Cards cards = new CardsImpl(); Card card = controller.getLibrary().getFromTop(game); if (card != null) { cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); if (card.isCreature()) { controller.drawCards(card.getPower().getValue(), game); controller.gainLife(card.getToughness().getValue(), game, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player you = game.getPlayer(source.getControllerId()); Card card = null; if (targetPlayer != null && you != null) { targetPlayer.revealCards("Talaras Bane", targetPlayer.getHand(), game); TargetCard target = new TargetCard(Zone.HAND, filter); if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) { card = targetPlayer.getHand().get(target.getFirstTarget(), game); } if (card != null) { int lifeGain = card.getToughness().getValue(); you.gainLife(lifeGain, game, source); return targetPlayer.discard(card, source, game); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Card creatureCard = game.getCard(this.getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (creatureCard != null && controller != null) { boolean result = false; if (game.getState().getZone(creatureCard.getId()) == Zone.GRAVEYARD) { result = controller.moveCardToExileWithInfo(creatureCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); ZombieToken2 token = new ZombieToken2(creatureCard.getPower().getValue(), creatureCard.getToughness().getValue()); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); } return result; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } Cards cards = new CardsImpl(); Card lastCard = null; for (Card card : player.getLibrary().getCards(game)) { if (card != null) { cards.add(card); if (card.isCreature()) { lastCard = card; break; } } } player.revealCards(source, cards, game); if (lastCard != null) { game.addEffect(new SetPowerToughnessSourceEffect( 2 * lastCard.getPower().getValue(), 2 * lastCard.getToughness().getValue(), Duration.UntilYourNextTurn, SubLayer.SetPT_7b ), source); } player.putCardsOnBottomOfLibrary(cards, game, source, false); return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { if (controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if(card != null) { Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); if (card.isCreature()) { controller.gainLife(card.getToughness().getValue(), game, source); controller.loseLife(card.getPower().getValue(), game, false); return controller.moveCards(cards.getCards(game), Zone.HAND, source, game); } } } return true; } return false; } }
private void init(Card card, Game game) { power = card.getPower().copy(); toughness = card.getToughness().copy(); copyFromCard(card, game); // if temporary added abilities to the spell/card exist, you need to add it to the permanent derived from that card Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(card.getId()); if (otherAbilities != null) { abilities.addAll(otherAbilities); } /*if (card.getCardType().contains(CardType.PLANESWALKER)) { this.loyalty = new MageInt(card.getLoyalty().getValue()); }*/ if (card instanceof LevelerCard) { maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters(); } if (isTransformable()) { if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId()) != null) { game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId(), null); setTransformed(true); TransformAbility.transform(this, getSecondCardFace(), game); } } }
permanent.getToughness().setValue(sourceCard.getToughness().getValue()); permanent.setTransformable(sourceCard.isTransformable());
permanent.getToughness().setValue(card.getToughness().getValue()); permanent.getColor(game).setColor(card.getColor(game)); permanent.getManaCost().clear();