mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Some minor changes to Hunting Wilds.
This commit is contained in:
parent
4b7e774ff8
commit
7c8d0881f7
2 changed files with 29 additions and 31 deletions
|
|
@ -40,6 +40,8 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||||
import mage.abilities.keyword.HasteAbility;
|
import mage.abilities.keyword.HasteAbility;
|
||||||
import mage.abilities.keyword.KickerAbility;
|
import mage.abilities.keyword.KickerAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.Cards;
|
||||||
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
|
@ -49,7 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.token.Token;
|
import mage.game.permanent.token.Token;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTargets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -103,25 +105,22 @@ class HuntingWildsEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (game.getPlayer(source.getControllerId()) != null) {
|
|
||||||
for (Effect sourceEffect : source.getEffects()) {
|
for (Effect sourceEffect : source.getEffects()) {
|
||||||
if (sourceEffect instanceof SearchLibraryPutInPlayEffect) {
|
if (sourceEffect instanceof SearchLibraryPutInPlayEffect) {
|
||||||
for (UUID target : ((SearchLibraryPutInPlayEffect)sourceEffect).getTargets()) {
|
Cards foundCards = new CardsImpl(((SearchLibraryPutInPlayEffect) sourceEffect).getTargets());
|
||||||
if (target != null) {
|
if (!foundCards.isEmpty()) {
|
||||||
FixedTarget fixedTarget = new FixedTarget(target);
|
FixedTargets fixedTargets = new FixedTargets(foundCards, game);
|
||||||
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
|
|
||||||
becomesCreatureEffect.setTargetPointer(fixedTarget);
|
|
||||||
game.addEffect(becomesCreatureEffect, source);
|
|
||||||
|
|
||||||
UntapTargetEffect untapEffect = new UntapTargetEffect();
|
UntapTargetEffect untapEffect = new UntapTargetEffect();
|
||||||
untapEffect.setTargetPointer(fixedTarget);
|
untapEffect.setTargetPointer(fixedTargets);
|
||||||
untapEffect.apply(game, source);
|
untapEffect.apply(game, source);
|
||||||
}
|
|
||||||
|
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
|
||||||
|
becomesCreatureEffect.setTargetPointer(fixedTargets);
|
||||||
|
game.addEffect(becomesCreatureEffect, source);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,13 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.abilities.effects.common;
|
package mage.abilities.effects.common;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue