mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
[MIC] Implemented Visions of Glory
This commit is contained in:
parent
244cacfe3b
commit
645779376f
8 changed files with 87 additions and 5 deletions
|
|
@ -543,7 +543,7 @@ public interface Ability extends Controllable, Serializable {
|
|||
|
||||
void adjustTargets(Game game);
|
||||
|
||||
void setCostAdjuster(CostAdjuster costAdjuster);
|
||||
Ability setCostAdjuster(CostAdjuster costAdjuster);
|
||||
|
||||
CostAdjuster getCostAdjuster();
|
||||
|
||||
|
|
|
|||
|
|
@ -1323,8 +1323,9 @@ public abstract class AbilityImpl implements Ability {
|
|||
* @param costAdjuster
|
||||
*/
|
||||
@Override
|
||||
public void setCostAdjuster(CostAdjuster costAdjuster) {
|
||||
public AbilityImpl setCostAdjuster(CostAdjuster costAdjuster) {
|
||||
this.costAdjuster = costAdjuster;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package mage.abilities.costs.costadjusters;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.constants.CommanderCardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum CommanderManaValueAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
Player player = game.getPlayer(ability.getControllerId());
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
int maxValue = game
|
||||
.getCommanderCardsFromAnyZones(
|
||||
player, CommanderCardType.ANY,
|
||||
Zone.BATTLEFIELD, Zone.COMMAND
|
||||
)
|
||||
.stream()
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.max()
|
||||
.orElse(0);
|
||||
CardUtil.reduceCost(ability, maxValue);
|
||||
}
|
||||
}
|
||||
|
|
@ -177,8 +177,9 @@ public class FlashbackAbility extends SpellAbility {
|
|||
*
|
||||
* @param abilityName
|
||||
*/
|
||||
public void setAbilityName(String abilityName) {
|
||||
public FlashbackAbility setAbilityName(String abilityName) {
|
||||
this.abilityName = abilityName;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -664,8 +664,9 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setCostAdjuster(CostAdjuster costAdjuster) {
|
||||
public StackAbility setCostAdjuster(CostAdjuster costAdjuster) {
|
||||
this.costAdjuster = costAdjuster;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue