mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Refactor Avalanche Caller to not use a custom private Token class
This commit is contained in:
parent
a3d1e9eae2
commit
bd6d0fdedb
1 changed files with 13 additions and 27 deletions
|
|
@ -15,7 +15,7 @@ import mage.constants.SubType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.custom.CreatureToken;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -41,9 +41,18 @@ public final class AvalancheCaller extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// {2}: Target snow land you control becomes a 4/4 Elemental creature with haste and hexproof until end of turn. It's still a land.
|
||||
Ability ability = new SimpleActivatedAbility(new BecomesCreatureTargetEffect(
|
||||
new AvalancheCallerToken(), false, true, Duration.EndOfTurn
|
||||
), new GenericManaCost(2));
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new BecomesCreatureTargetEffect(
|
||||
new CreatureToken(4, 4, "4/4 Elemental creature with hexproof and haste")
|
||||
.withSubType(SubType.ELEMENTAL)
|
||||
.withAbility(HasteAbility.getInstance())
|
||||
.withAbility(HexproofAbility.getInstance()),
|
||||
false,
|
||||
true,
|
||||
Duration.EndOfTurn
|
||||
),
|
||||
new GenericManaCost(2)
|
||||
);
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -57,26 +66,3 @@ public final class AvalancheCaller extends CardImpl {
|
|||
return new AvalancheCaller(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AvalancheCallerToken extends TokenImpl {
|
||||
|
||||
AvalancheCallerToken() {
|
||||
super("", "4/4 Elemental creature with hexproof and haste");
|
||||
this.cardType.add(CardType.CREATURE);
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(HexproofAbility.getInstance());
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
}
|
||||
|
||||
private AvalancheCallerToken(final AvalancheCallerToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public AvalancheCallerToken copy() {
|
||||
return new AvalancheCallerToken(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue