@Override public MageInt getPower() { return card.getPower(); }
@Override public MageInt getPower() { return sourceObject.getPower(); }
@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.getPower().getValue(); } } } return amount; }
@Override public boolean apply(ObjectSourcePlayer<Card> input, Game game) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId()); return sourcePermanent != null && input.getObject().getPower().getValue() < sourcePermanent.getPower().getValue(); }
@Override public boolean apply(ObjectSourcePlayer<Card> input, Game game) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId()); return sourcePermanent != null && input.getObject().getPower().getValue() < sourcePermanent.getPower().getValue(); } }
@Override public boolean apply(ObjectSourcePlayer<Card> input, Game game) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId()); return sourcePermanent != null && input.getObject().getPower().getValue() <= sourcePermanent.getPower().getValue(); } }
@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; } }
@Override public boolean apply(Game game, Ability source) { RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0); Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (cost != null && creature != null && controller != null) { List<Card> revealedCards = cost.getRevealedCards(); if (!revealedCards.isEmpty()) { Card card = revealedCards.iterator().next(); if (card != null && card.getPower().getValue() >= creature.getPower().getValue()) { controller.moveCards(creature, Zone.EXILED, source, game); } } 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 int calculate(Game game, Ability sourceAbility, Effect effect) { ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, sourceAbility.getSourceId(), sourceAbility.getSourceObjectZoneChangeCounter())); if (exileZone != null) { Card exiledCard = exileZone.getRandom(game); if (exiledCard != null) { return exiledCard.getPower().getValue(); } } return 0; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card discardedCard = controller.discardOne(true, source, game); if (discardedCard != null && discardedCard.isCreature()) { int damage = discardedCard.getPower().getValue(); return new DamageTargetEffect(damage).apply(game, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { int count = card.getPower().getValue(); if (count > 0) { Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(count)); effect.setTargetPointer(getTargetPointer()); return effect.apply(game, source); } } return false; }
@Override public boolean apply(Game game, Ability source) { int amount = 0; for (Cost cost : source.getCosts()) { if (cost instanceof ExileFromGraveCost) { Card card = game.getCard(cost.getTargets().getFirstTarget()); if (card != null) { amount = card.getPower().getValue(); } break; } } if (amount > 0) { Player targetOpponent = game.getPlayer(source.getFirstTarget()); if (targetOpponent != null) { targetOpponent.loseLife(amount, game, false); return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Card targetCard = game.getCard(source.getFirstTarget()); if (targetCard != null) { int power = targetCard.getPower().getValue(); targetCard.moveToExile(null, null, source.getSourceId(), game); if (power > 0) { Permanent targetCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); if (targetCreature != null) { targetCreature.addCounters(CounterType.P1P1.createInstance(power), source, game); } } 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) { if (controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromBottom(game); if (card != null) { controller.moveCards(card, Zone.GRAVEYARD, source, game); if (card.isCreature()) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourcePermanent != null && card.getPower().getValue() <= sourcePermanent.getPower().getValue()) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } } 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) { 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 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; } }
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); } } }