forked from External/mage
[GNT] implemented Militant Angel
This commit is contained in:
parent
209bccef0c
commit
9986c1d365
6 changed files with 186 additions and 10 deletions
|
|
@ -0,0 +1,44 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.PlayersAttackedThisTurnWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class AttackedThisTurnOpponentsCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return this.calculate(game, sourceAbility.getControllerId());
|
||||
}
|
||||
|
||||
public int calculate(Game game, UUID controllerId) {
|
||||
PlayersAttackedThisTurnWatcher watcher = (PlayersAttackedThisTurnWatcher) game.getState().getWatchers().get(PlayersAttackedThisTurnWatcher.class.getSimpleName());
|
||||
if (watcher != null) {
|
||||
return watcher.getAttackedOpponentsCount(controllerId);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttackedThisTurnOpponentsCount copy() {
|
||||
return new AttackedThisTurnOpponentsCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the number of opponents you attacked this turn";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue