forked from External/mage
* Jaheira's Respite - fixed that it allows to choose any cards amount (#10206), added card hint;
* Arachnogenesis, Blessed Reversal - added card hint;
This commit is contained in:
parent
29afbe042c
commit
79b8093047
4 changed files with 67 additions and 86 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.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum CreaturesAttackingYouCount implements DynamicValue {
|
||||
|
||||
instance;
|
||||
|
||||
private static final Hint hint = new ValueHint("Creatures attacking you", instance);
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (CombatGroup combatGroup : game.getCombat().getGroups()) {
|
||||
if (combatGroup.getDefenderId().equals(sourceAbility.getControllerId())) {
|
||||
count += combatGroup.getAttackers().size();
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "creatures attacking you";
|
||||
}
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue