mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
fixes
This commit is contained in:
parent
850f931bc7
commit
7aadc8ed9d
4 changed files with 16 additions and 7 deletions
BIN
Mage.Client/release/sample-decks/UWR Walker.dck
Normal file
BIN
Mage.Client/release/sample-decks/UWR Walker.dck
Normal file
Binary file not shown.
|
|
@ -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)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue