mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
* Geode Golem - fixed duplicated commander tax on damage trigger (#7593);
This commit is contained in:
parent
650acf9e1e
commit
f6c0f4c712
4 changed files with 230 additions and 84 deletions
|
|
@ -1,52 +0,0 @@
|
|||
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.CommanderPlaysCountWatcher;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class CommanderPlaysCount implements DynamicValue {
|
||||
|
||||
private Integer multiplier;
|
||||
|
||||
public CommanderPlaysCount() {
|
||||
this(1);
|
||||
}
|
||||
|
||||
public CommanderPlaysCount(Integer multiplier) {
|
||||
this.multiplier = multiplier;
|
||||
}
|
||||
|
||||
public CommanderPlaysCount(final CommanderPlaysCount dynamicValue) {
|
||||
this.multiplier = dynamicValue.multiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
CommanderPlaysCountWatcher watcher = game.getState().getWatcher(CommanderPlaysCountWatcher.class);
|
||||
int value = 0;
|
||||
if (watcher != null) {
|
||||
value = watcher.getPlaysCount(sourceAbility.getSourceId());
|
||||
}
|
||||
return value * multiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommanderPlaysCount copy() {
|
||||
return new CommanderPlaysCount(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -181,6 +181,14 @@ public interface Card extends MageObject {
|
|||
return getOwnerId().equals(controllerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Commander tax calculation. Can be change from {2} to life life cost (see Liesa, Shroud of Dusk)
|
||||
*
|
||||
* @param game
|
||||
* @param source
|
||||
* @param abilityToModify
|
||||
* @return
|
||||
*/
|
||||
default boolean commanderCost(Game game, Ability source, Ability abilityToModify) {
|
||||
CommanderPlaysCountWatcher watcher = game.getState().getWatcher(CommanderPlaysCountWatcher.class);
|
||||
int castCount = watcher.getPlaysCount(getMainCard().getId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue