mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00: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.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -49,7 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -103,25 +105,22 @@ class HuntingWildsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (game.getPlayer(source.getControllerId()) != null) {
|
||||
for (Effect sourceEffect : source.getEffects()) {
|
||||
if (sourceEffect instanceof SearchLibraryPutInPlayEffect) {
|
||||
for (UUID target : ((SearchLibraryPutInPlayEffect)sourceEffect).getTargets()) {
|
||||
if (target != null) {
|
||||
FixedTarget fixedTarget = new FixedTarget(target);
|
||||
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
|
||||
becomesCreatureEffect.setTargetPointer(fixedTarget);
|
||||
game.addEffect(becomesCreatureEffect, source);
|
||||
|
||||
Cards foundCards = new CardsImpl(((SearchLibraryPutInPlayEffect) sourceEffect).getTargets());
|
||||
if (!foundCards.isEmpty()) {
|
||||
FixedTargets fixedTargets = new FixedTargets(foundCards, game);
|
||||
UntapTargetEffect untapEffect = new UntapTargetEffect();
|
||||
untapEffect.setTargetPointer(fixedTarget);
|
||||
untapEffect.setTargetPointer(fixedTargets);
|
||||
untapEffect.apply(game, source);
|
||||
}
|
||||
|
||||
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
|
||||
becomesCreatureEffect.setTargetPointer(fixedTargets);
|
||||
game.addEffect(becomesCreatureEffect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,14 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
@ -58,7 +57,7 @@ public class UntapTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID target: targetPointer.getTargets(game, source)) {
|
||||
for (UUID target : targetPointer.getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(target);
|
||||
if (permanent != null) {
|
||||
permanent.untap(game);
|
||||
|
|
Loading…
Reference in a new issue