mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
[SNC] Implemented Bouncer's Beatdown
This commit is contained in:
parent
afe94f2030
commit
b333dd981b
4 changed files with 81 additions and 11 deletions
|
|
@ -1,12 +1,15 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
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.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author Styxo
|
||||
|
|
@ -14,15 +17,18 @@ import mage.game.permanent.Permanent;
|
|||
public enum GreatestPowerAmongControlledCreaturesValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
private static final Hint hint=new ValueHint("Greatest power among creatures you control",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.getPower().getValue(), amount);
|
||||
}
|
||||
return amount;
|
||||
return game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
sourceAbility.getControllerId(), game
|
||||
).stream()
|
||||
.map(MageObject::getPower)
|
||||
.mapToInt(MageInt::getValue)
|
||||
.sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -40,4 +46,7 @@ public enum GreatestPowerAmongControlledCreaturesValue implements DynamicValue {
|
|||
return "X";
|
||||
}
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
|
|
@ -11,14 +10,17 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ExileTargetIfDiesEffect extends OneShotEffect {
|
||||
|
||||
public ExileTargetIfDiesEffect() {
|
||||
this("creature");
|
||||
}
|
||||
|
||||
public ExileTargetIfDiesEffect(String targetName) {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "If that creature would die this turn, exile it instead";
|
||||
this.staticText = "If that " + targetName + " would die this turn, exile it instead";
|
||||
}
|
||||
|
||||
public ExileTargetIfDiesEffect(final ExileTargetIfDiesEffect effect) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue