mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
* Urza's Incubator - Fixed the not working cost reduction.
This commit is contained in:
parent
e277337c98
commit
171a8b336d
2 changed files with 46 additions and 58 deletions
|
@ -77,6 +77,11 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
|
|||
this.upTo = effect.upTo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
if (upTo) {
|
||||
|
@ -109,16 +114,6 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite this in effect that inherits from this
|
||||
*
|
||||
* @param source
|
||||
* @param game
|
||||
*/
|
||||
protected void setRuntimeData(Ability source, Game game) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite this in effect that inherits from this
|
||||
*
|
||||
|
|
|
@ -1,48 +1,41 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common.cost;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SpellsCostReductionAllOfChosenSubtypeEffect extends SpellsCostReductionAllEffect {
|
||||
|
||||
String subtype = null;
|
||||
|
||||
public SpellsCostReductionAllOfChosenSubtypeEffect(FilterCard filter, int amount) {
|
||||
super(filter, amount);
|
||||
}
|
||||
|
||||
public SpellsCostReductionAllOfChosenSubtypeEffect(final SpellsCostReductionAllOfChosenSubtypeEffect effect) {
|
||||
super(effect);
|
||||
this.subtype = effect.subtype;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellsCostReductionAllOfChosenSubtypeEffect copy() {
|
||||
return new SpellsCostReductionAllOfChosenSubtypeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean selectedByRuntimeData(Card card, Ability source, Game game) {
|
||||
if (subtype != null) {
|
||||
return card.hasSubtype(subtype);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setRuntimeData(Ability source, Game game) {
|
||||
subtype = (String) game.getState().getValue(source.getSourceId() + "_type");
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common.cost;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SpellsCostReductionAllOfChosenSubtypeEffect extends SpellsCostReductionAllEffect {
|
||||
|
||||
public SpellsCostReductionAllOfChosenSubtypeEffect(FilterCard filter, int amount) {
|
||||
super(filter, amount);
|
||||
}
|
||||
|
||||
public SpellsCostReductionAllOfChosenSubtypeEffect(final SpellsCostReductionAllOfChosenSubtypeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellsCostReductionAllOfChosenSubtypeEffect copy() {
|
||||
return new SpellsCostReductionAllOfChosenSubtypeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean selectedByRuntimeData(Card card, Ability source, Game game) {
|
||||
String subtype = (String) game.getState().getValue(source.getSourceId() + "_type");
|
||||
if (subtype != null) {
|
||||
return card.hasSubtype(subtype);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue