This commit is contained in:
BetaSteward 2010-12-10 04:23:09 +00:00
parent 850f931bc7
commit 7aadc8ed9d
4 changed files with 16 additions and 7 deletions

Binary file not shown.

View file

@ -36,6 +36,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.BoostSourceWhileControlsEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;
/**
@ -44,8 +45,15 @@ import mage.filter.FilterPermanent;
*/
public class WildNacatl extends CardImpl<WildNacatl> {
private FilterPermanent filter1 = new FilterPermanent("Mountain");
private FilterPermanent filter2 = new FilterPermanent("Plains");
private static FilterPermanent filter1 = new FilterPermanent("Mountain");
private static FilterPermanent filter2 = new FilterPermanent("Plains");
static {
filter1.getSubtype().add("Mountain");
filter1.setScopeSubtype(ComparisonScope.Any);
filter2.getSubtype().add("Plains");
filter2.setScopeSubtype(ComparisonScope.Any);
}
public WildNacatl(UUID ownerId) {
super(ownerId, 152, "Wild Nacatl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
@ -55,8 +63,6 @@ public class WildNacatl extends CardImpl<WildNacatl> {
this.subtype.add("Warrior");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
filter1.getName().add("Mountain");
filter2.getName().add("Plains");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter1, 1, 1)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter2, 1, 1)));
}

View file

@ -63,6 +63,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
private final static transient Logger logger = Logging.getLogger(AbilityImpl.class.getName());
protected UUID id;
protected UUID originalId;
protected AbilityType abilityType;
protected UUID controllerId;
protected UUID sourceId;
@ -82,6 +83,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
public AbilityImpl(AbilityType abilityType, Zone zone) {
this.id = UUID.randomUUID();
this.originalId = id;
this.abilityType = abilityType;
this.zone = zone;
this.manaCosts = new ManaCostsImpl<ManaCost>();
@ -94,6 +96,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
public AbilityImpl(AbilityImpl<T> ability) {
this.id = ability.id;
this.originalId = ability.originalId;
this.abilityType = ability.abilityType;
this.controllerId = ability.controllerId;
this.sourceId = ability.sourceId;

View file

@ -52,7 +52,7 @@ public class ActivateOncePerTurnActivatedAbility extends ActivatedAbilityImpl<Ac
@Override
public boolean canActivate(UUID playerId, Game game) {
Boolean activated = (Boolean)game.getState().getValue(this.id.toString() + "activated");
Boolean activated = (Boolean)game.getState().getValue(this.originalId.toString() + "activated");
if (activated == null)
return true;
else
@ -63,7 +63,7 @@ public class ActivateOncePerTurnActivatedAbility extends ActivatedAbilityImpl<Ac
public boolean activate(Game game, boolean noMana) {
if (canActivate(this.controllerId, game)) {
if (super.activate(game, noMana)) {
game.getState().setValue(this.id.toString() + "activated", Boolean.TRUE);
game.getState().setValue(this.originalId.toString() + "activated", Boolean.TRUE);
return true;
}
}
@ -72,7 +72,7 @@ public class ActivateOncePerTurnActivatedAbility extends ActivatedAbilityImpl<Ac
@Override
public void reset(Game game) {
game.getState().setValue(this.id.toString() + "activated", Boolean.FALSE);
game.getState().setValue(this.originalId.toString() + "activated", Boolean.FALSE);
}
@Override