mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
Fixed that surge craeted exceptions for rule tooltip text generation.
This commit is contained in:
parent
6100609ae2
commit
1e89fb60d1
4 changed files with 20 additions and 14 deletions
|
|
@ -49,10 +49,10 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
*/
|
||||
public class RecklessBushwhacker extends CardImpl {
|
||||
|
||||
private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures you control");
|
||||
private final static FilterControlledCreaturePermanent FILTER = new FilterControlledCreaturePermanent("other creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
FILTER.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public RecklessBushwhacker(UUID ownerId) {
|
||||
|
|
@ -72,7 +72,7 @@ public class RecklessBushwhacker extends CardImpl {
|
|||
|
||||
// When Reckless Bushwhacker enters the battlefield, if its surge cost was paid, other creatures you control get +1/+0 and gain haste until end of turn.
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn, true), false);
|
||||
ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, filter, true));
|
||||
ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, FILTER, true));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, SurgedCondition.getInstance(),
|
||||
"When {this} enters the battlefield, if its surge cost was paid, other creatures you control get +1/+0 and gain haste until end of turn."));
|
||||
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class SaddlebackLagac extends CardImpl {
|
||||
|
||||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("target creatures");
|
||||
private final static FilterCreaturePermanent FILTER = new FilterCreaturePermanent("target creatures");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
FILTER.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public SaddlebackLagac(UUID ownerId) {
|
||||
|
|
@ -60,7 +60,7 @@ public class SaddlebackLagac extends CardImpl {
|
|||
|
||||
// When Saddleback Lagac enters the battlefield, support 2.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SupportEffect(this, 2, true), false);
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 2, filter, false));
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 2, FILTER, false));
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -35,16 +34,16 @@ import mage.cards.Card;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* Checks if a the spell was cast with the alternate prowl costs
|
||||
* Checks if a the spell was cast with the alternate prowl costs
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ProwlCondition implements Condition {
|
||||
|
||||
private static ProwlCondition fInstance = null;
|
||||
|
||||
private ProwlCondition() {}
|
||||
private ProwlCondition() {
|
||||
}
|
||||
|
||||
public static Condition getInstance() {
|
||||
if (fInstance == null) {
|
||||
|
|
@ -57,9 +56,9 @@ public class ProwlCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
for (Ability ability: card.getAbilities()) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof ProwlAbility) {
|
||||
if(((ProwlAbility) ability).isActivated(source, game)) {
|
||||
if (((ProwlAbility) ability).isActivated(source, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -67,4 +66,10 @@ public class ProwlCondition implements Condition {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{source}'s prowl cost was paid";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,12 +57,13 @@ public class SurgeAbility extends SpellAbility {
|
|||
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
|
||||
this.timing = card.getSpellAbility().getTiming();
|
||||
this.setRuleAtTheTop(true);
|
||||
rule = "Surge " + surgeCosts
|
||||
this.rule = "Surge " + surgeCosts
|
||||
+ " <i>(You may cast this spell for its surge cost if you or a teammate has cast another spell this turn.)</i>";
|
||||
}
|
||||
|
||||
public SurgeAbility(final SurgeAbility ability) {
|
||||
super(ability);
|
||||
this.rule = ability.rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue