mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
Implemented Huatli, Heart of the Sun
This commit is contained in:
parent
249b7528ff
commit
892a39a2ed
5 changed files with 117 additions and 30 deletions
|
|
@ -4,7 +4,7 @@ package mage.abilities.dynamicvalue.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -17,17 +17,13 @@ public enum GreatestPowerAmongControlledCreaturesValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player != null) {
|
||||
int amount = 0;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)) {
|
||||
if (p.getPower().getValue() > amount) {
|
||||
amount = p.getPower().getValue();
|
||||
}
|
||||
}
|
||||
return amount;
|
||||
int amount = 0;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, sourceAbility.getControllerId(), game
|
||||
)) {
|
||||
amount = Math.max(p.getPower().getValue(), amount);
|
||||
}
|
||||
return 0;
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum GreatestToughnessAmongControlledCreaturesValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, sourceAbility.getControllerId(), game
|
||||
)) {
|
||||
amount = Math.max(p.getToughness().getValue(), amount);
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreatestToughnessAmongControlledCreaturesValue copy() {
|
||||
return GreatestToughnessAmongControlledCreaturesValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the greatest toughness among creatures you control";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue