[WOE] Implement Rowdy Research ; Implement Witchstalker Frenzy (#10985)

* add new DynamicValue

* [WOE] Implement Rowdy Research

* [WOE] Implement Witchstalker Frenzy
This commit is contained in:
Susucre 2023-08-24 14:33:10 +02:00 committed by GitHub
parent 8de38bcde2
commit 5998f43f4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 126 additions and 0 deletions

View file

@ -0,0 +1,40 @@
package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.game.Game;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
* @author Susucr
*/
public enum CreaturesThatAttackedThisTurnCount implements DynamicValue {
instance;
private static final Hint hint = new ValueHint("Creatures that attacked this turn", instance);
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
AttackedThisTurnWatcher watcher = game.getState()
.getWatcher(AttackedThisTurnWatcher.class);
return watcher == null ? 0 : watcher.getAttackedThisTurnCreatures().size();
}
@Override
public DynamicValue copy() {
return instance;
}
@Override
public String getMessage() {
return "creatures that attacked this turn";
}
public static Hint getHint() {
return hint;
}
}