mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
- Fixed #6790
This commit is contained in:
parent
019bbafd20
commit
181eb871fe
3 changed files with 30 additions and 20 deletions
|
|
@ -23,7 +23,9 @@ public final class Heartstone extends CardImpl {
|
||||||
public Heartstone(UUID ownerId, CardSetInfo setInfo) {
|
public Heartstone(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
|
|
||||||
// Activated abilities of creatures cost {1} less to activate. This effect can't reduce the amount of mana an ability costs to activate to less than one mana.
|
// Activated abilities of creatures cost {1} less to activate.
|
||||||
|
// This effect can't reduce the amount of mana an ability
|
||||||
|
// costs to activate to less than one mana.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HeartstoneEffect()));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HeartstoneEffect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -39,7 +41,8 @@ public final class Heartstone extends CardImpl {
|
||||||
|
|
||||||
class HeartstoneEffect extends CostModificationEffectImpl {
|
class HeartstoneEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
private static final String effectText = "Activated abilities of creatures cost {1} less to activate. This effect can't reduce the mana in that cost to less than one mana.";
|
private static final String effectText = "Activated abilities of creatures cost "
|
||||||
|
+ "{1} less to activate. This effect can't reduce the mana in that cost to less than one mana.";
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||||
|
|
||||||
public HeartstoneEffect() {
|
public HeartstoneEffect() {
|
||||||
|
|
@ -64,10 +67,12 @@ class HeartstoneEffect extends CostModificationEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED
|
if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED
|
||||||
|| (abilityToModify.getAbilityType() == AbilityType.MANA && (abilityToModify instanceof ActivatedAbility))) {
|
|| (abilityToModify.getAbilityType() == AbilityType.MANA
|
||||||
|
&& (abilityToModify instanceof ActivatedAbility))) {
|
||||||
// Activated abilities of creatures
|
// Activated abilities of creatures
|
||||||
Permanent permanent = game.getPermanent(abilityToModify.getSourceId());
|
Permanent permanent = game.getPermanentOrLKIBattlefield(abilityToModify.getSourceId());
|
||||||
if (permanent != null && filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) {
|
if (permanent != null
|
||||||
|
&& filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -26,7 +25,8 @@ public final class TrainingGrounds extends CardImpl {
|
||||||
public TrainingGrounds(UUID ownerId, CardSetInfo setInfo) {
|
public TrainingGrounds(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}");
|
||||||
|
|
||||||
// Activated abilities of creatures you control cost up to {2} less to activate. This effect can't reduce the amount of mana an ability costs to activate to less than one mana.
|
// Activated abilities of creatures you control cost up to {2} less to activate.
|
||||||
|
// This effect can't reduce the amount of mana an ability costs to activate to less than one mana.
|
||||||
this.addAbility(new SimpleStaticAbility(new TrainingGroundsEffect()));
|
this.addAbility(new SimpleStaticAbility(new TrainingGroundsEffect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,7 +42,8 @@ public final class TrainingGrounds extends CardImpl {
|
||||||
|
|
||||||
class TrainingGroundsEffect extends CostModificationEffectImpl {
|
class TrainingGroundsEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
private static final String effectText = "Activated abilities of creatures you control cost up to {2} less to activate. "
|
private static final String effectText = "Activated abilities of creatures you control "
|
||||||
|
+ "cost up to {2} less to activate. "
|
||||||
+ "This effect can't reduce the mana in that cost to less than one mana";
|
+ "This effect can't reduce the mana in that cost to less than one mana";
|
||||||
|
|
||||||
TrainingGroundsEffect() {
|
TrainingGroundsEffect() {
|
||||||
|
|
@ -101,8 +102,9 @@ class TrainingGroundsEffect extends CostModificationEffectImpl {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Activated abilities of creatures you control
|
//Activated abilities of creatures you control
|
||||||
Permanent permanent = game.getPermanent(abilityToModify.getSourceId());
|
Permanent permanent = game.getPermanentOrLKIBattlefield(abilityToModify.getSourceId());
|
||||||
return permanent != null && permanent.isCreature()
|
return permanent != null
|
||||||
|
&& permanent.isCreature()
|
||||||
&& permanent.isControlledBy(source.getControllerId());
|
&& permanent.isControlledBy(source.getControllerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@ public final class ZirdaTheDawnwaker extends CardImpl {
|
||||||
// Companion — Each permanent card in your starting deck has an activated ability.
|
// Companion — Each permanent card in your starting deck has an activated ability.
|
||||||
this.addAbility(new CompanionAbility(ZirdaTheDawnwakerCompanionCondition.instance));
|
this.addAbility(new CompanionAbility(ZirdaTheDawnwakerCompanionCondition.instance));
|
||||||
|
|
||||||
// Abilities you activate that aren't mana abilities cost {2} less to activate. This effect can't reduce the mana in that cost to less than one mana.
|
// Abilities you activate that aren't mana abilities cost {2} less to activate.
|
||||||
|
// This effect can't reduce the mana in that cost to less than one mana.
|
||||||
this.addAbility(new SimpleStaticAbility(new ZirdaTheDawnwakerEffect()));
|
this.addAbility(new SimpleStaticAbility(new ZirdaTheDawnwakerEffect()));
|
||||||
|
|
||||||
// {1}, {T}: Target creature can't block this turn.
|
// {1}, {T}: Target creature can't block this turn.
|
||||||
|
|
@ -76,11 +77,11 @@ enum ZirdaTheDawnwakerCompanionCondition implements CompanionCondition {
|
||||||
.stream()
|
.stream()
|
||||||
.filter(MageObject::isPermanent)
|
.filter(MageObject::isPermanent)
|
||||||
.allMatch(card -> card
|
.allMatch(card -> card
|
||||||
.getAbilities()
|
.getAbilities()
|
||||||
.stream()
|
.stream()
|
||||||
.map(Ability::getAbilityType)
|
.map(Ability::getAbilityType)
|
||||||
.anyMatch(abilityType -> abilityType == AbilityType.ACTIVATED
|
.anyMatch(abilityType -> abilityType == AbilityType.ACTIVATED
|
||||||
|| abilityType == AbilityType.MANA)
|
|| abilityType == AbilityType.MANA)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -89,8 +90,8 @@ class ZirdaTheDawnwakerEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
ZirdaTheDawnwakerEffect() {
|
ZirdaTheDawnwakerEffect() {
|
||||||
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||||
staticText = "Abilities you activate that aren't mana abilities cost {2} less to activate. " +
|
staticText = "Abilities you activate that aren't mana abilities cost {2} less to activate. "
|
||||||
"This effect can't reduce the mana in that cost to less than one mana.";
|
+ "This effect can't reduce the mana in that cost to less than one mana.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private ZirdaTheDawnwakerEffect(final ZirdaTheDawnwakerEffect effect) {
|
private ZirdaTheDawnwakerEffect(final ZirdaTheDawnwakerEffect effect) {
|
||||||
|
|
@ -101,7 +102,8 @@ class ZirdaTheDawnwakerEffect extends CostModificationEffectImpl {
|
||||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||||
Mana mana = abilityToModify.getManaCostsToPay().getMana();
|
Mana mana = abilityToModify.getManaCostsToPay().getMana();
|
||||||
int reduceMax = mana.getGeneric();
|
int reduceMax = mana.getGeneric();
|
||||||
if (reduceMax > 0 && mana.count() == mana.getGeneric()) {
|
if (reduceMax > 0
|
||||||
|
&& mana.count() == mana.getGeneric()) {
|
||||||
reduceMax--;
|
reduceMax--;
|
||||||
}
|
}
|
||||||
reduceMax = Math.min(reduceMax, 2);
|
reduceMax = Math.min(reduceMax, 2);
|
||||||
|
|
@ -116,7 +118,8 @@ class ZirdaTheDawnwakerEffect extends CostModificationEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
return abilityToModify.getAbilityType() == AbilityType.ACTIVATED
|
return abilityToModify.getAbilityType() == AbilityType.ACTIVATED
|
||||||
&& abilityToModify.isControlledBy(source.getControllerId());
|
&& abilityToModify.isControlledBy(source.getControllerId())
|
||||||
|
&& abilityToModify.getAbilityType() != AbilityType.MANA; // no mana abilities
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue