mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Some minor fixes to Valakut, the molten Pinnacle and Scapeshift (text, target handling, optionality).
This commit is contained in:
parent
4e2ed0178b
commit
d6789fa383
2 changed files with 18 additions and 20 deletions
|
|
@ -96,27 +96,24 @@ class ScapeshiftEffect extends OneShotEffect<ScapeshiftEffect> {
|
|||
return false;
|
||||
}
|
||||
int amount = 0;
|
||||
TargetControlledPermanent sacrificeLand = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledLandPermanent(), true);
|
||||
TargetControlledPermanent sacrificeLand = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledLandPermanent("lands you control"), true);
|
||||
if(player.chooseTarget(Outcome.Sacrifice, sacrificeLand, source, game)){
|
||||
for(Object uuid : sacrificeLand.getTargets()){
|
||||
Permanent land = game.getPermanent((UUID)uuid);
|
||||
if(land != null){
|
||||
land.sacrifice(source.getId(), game);
|
||||
land.sacrifice(source.getSourceId(), game);
|
||||
amount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(amount, new FilterLandCard());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(amount, new FilterLandCard("lands"));
|
||||
target.setRequired(true);
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
for (UUID cardId: (List<UUID>)target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId())) {
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null)
|
||||
permanent.setTapped(true);
|
||||
}
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,4 +124,4 @@ class ScapeshiftEffect extends OneShotEffect<ScapeshiftEffect> {
|
|||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,15 +29,15 @@
|
|||
package mage.sets.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
|
@ -86,8 +86,8 @@ public class ValakutTheMoltenPinnacle extends CardImpl<ValakutTheMoltenPinnacle>
|
|||
class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl<ValakutTheMoltenPinnacleTriggeredAbility> {
|
||||
|
||||
ValakutTheMoltenPinnacleTriggeredAbility () {
|
||||
super(Zone.BATTLEFIELD, new DamageTargetEffect(3));
|
||||
this.addTarget(new TargetCreatureOrPlayer());
|
||||
super(Zone.BATTLEFIELD, new DamageTargetEffect(3), true);
|
||||
this.addTarget(new TargetCreatureOrPlayer(true));
|
||||
}
|
||||
|
||||
ValakutTheMoltenPinnacleTriggeredAbility(ValakutTheMoltenPinnacleTriggeredAbility ability) {
|
||||
|
|
@ -95,16 +95,17 @@ class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl<Vala
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return game.getBattlefield().count(ValakutTheMoltenPinnacle.filter, getSourceId(), getControllerId(), game) > 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) {
|
||||
if(permanent.hasSubtype("Mountain")){
|
||||
int count = game.getBattlefield().count(ValakutTheMoltenPinnacle.filter, getSourceId(), getControllerId(), game);
|
||||
if(count > 5){
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue