mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Cards drawn this turn - fixed rollback error on some cards usage;
This commit is contained in:
parent
e5faadf1c9
commit
a2c046993d
10 changed files with 11 additions and 8 deletions
|
@ -36,7 +36,7 @@ public final class Eyekite extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||
new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield),
|
||||
EyekiteCondition.instance, "{this} gets +2/+0 as long as you've drawn two or more cards this turn."
|
||||
)), new CardsDrawnThisTurnWatcher());
|
||||
)));
|
||||
}
|
||||
|
||||
private Eyekite(final Eyekite card) {
|
||||
|
|
|
@ -33,7 +33,6 @@ public final class FistsOfFlame extends CardImpl {
|
|||
StaticValue.get(0), Duration.EndOfTurn
|
||||
).setText("and gets +1/+0 for each card you've drawn this turn."));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addWatcher(new CardsDrawnThisTurnWatcher());
|
||||
}
|
||||
|
||||
private FistsOfFlame(final FistsOfFlame card) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public final class GnarledSage extends CardImpl {
|
|||
"and has vigilance"
|
||||
));
|
||||
|
||||
this.addAbility(ability, new CardsDrawnThisTurnWatcher());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private GnarledSage(final GnarledSage card) {
|
||||
|
|
|
@ -33,7 +33,7 @@ public final class KydeleChosenOfKruphix extends CardImpl {
|
|||
DynamicManaAbility ability = new DynamicManaAbility(
|
||||
Mana.ColorlessMana(1), CardsDrawnThisTurnDynamicValue.instance,
|
||||
new TapSourceCost(), null, false, CardsDrawnThisTurnDynamicValue.instance);
|
||||
this.addAbility(ability, new CardsDrawnThisTurnWatcher());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Partner
|
||||
this.addAbility(PartnerAbility.getInstance());
|
||||
|
|
|
@ -35,7 +35,7 @@ public final class SpinehornMinotaur extends CardImpl {
|
|||
new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield),
|
||||
SpinehornMinotaurCondition.instance, "As long as you've drawn two or more cards this turn, " +
|
||||
"{this} has double strike"
|
||||
)), new CardsDrawnThisTurnWatcher());
|
||||
)));
|
||||
}
|
||||
|
||||
private SpinehornMinotaur(final SpinehornMinotaur card) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public final class ThoughtSponge extends CardImpl {
|
|||
CounterType.P1P1.createInstance(), ThoughtSpongeValue.instance, false
|
||||
), "with a number of +1/+1 counters on it equal to " +
|
||||
"the greatest number of cards an opponent has drawn this turn"
|
||||
), new CardsDrawnThisTurnWatcher());
|
||||
));
|
||||
|
||||
// When Thought Sponge dies, draw cards equal to its power.
|
||||
this.addAbility(new DiesSourceTriggeredAbility(
|
||||
|
|
|
@ -35,7 +35,7 @@ public final class ThunderingDjinn extends CardImpl {
|
|||
CardsDrawnThisTurnDynamicValue.instance
|
||||
).setText("it deals damage to any target equal to the number of cards you've drawn this turn."), false);
|
||||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability, new CardsDrawnThisTurnWatcher());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private ThunderingDjinn(final ThunderingDjinn card) {
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class TomeAnima extends CardImpl {
|
|||
new GainAbilitySourceEffect(new CantBeBlockedSourceAbility(), Duration.WhileOnBattlefield),
|
||||
TomeAnimaCondition.instance,
|
||||
"{this} can't be blocked as long as you've drawn two or more cards this turn"
|
||||
)), new CardsDrawnThisTurnWatcher());
|
||||
)));
|
||||
}
|
||||
|
||||
private TomeAnima(final TomeAnima card) {
|
||||
|
|
|
@ -1123,6 +1123,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
getState().addWatcher(new DamageDoneWatcher());
|
||||
getState().addWatcher(new PlanarRollWatcher());
|
||||
getState().addWatcher(new PlayersAttackedThisTurnWatcher());
|
||||
getState().addWatcher(new CardsDrawnThisTurnWatcher());
|
||||
}
|
||||
|
||||
public void initPlayerDefaultWatchers(UUID playerId) {
|
||||
|
|
|
@ -17,6 +17,9 @@ public class CardsDrawnThisTurnWatcher extends Watcher {
|
|||
|
||||
private final Map<UUID, Integer> cardsDrawnThisTurn = new HashMap<>();
|
||||
|
||||
/**
|
||||
* It's a default game watcher, so no need to init it with card code
|
||||
*/
|
||||
public CardsDrawnThisTurnWatcher() {
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue