CardFactoryUtil: add Ascend for non-permanent Spell

This commit is contained in:
Hanmac
2018-01-10 07:30:03 +01:00
parent 941e25d7a7
commit 052fb65518
5 changed files with 33 additions and 3 deletions

View File

@@ -8,9 +8,11 @@ import forge.game.ability.effects.ManaEffect;
import forge.game.ability.effects.ManaReflectedEffect;
import forge.game.card.Card;
import forge.game.cost.Cost;
import forge.game.player.Player;
import forge.game.spellability.AbilityManaPart;
import forge.game.spellability.Spell;
import forge.game.spellability.TargetRestrictions;
import forge.game.zone.ZoneType;
public class SpellApiBased extends Spell {
private static final long serialVersionUID = -6741797239508483250L;
@@ -52,6 +54,14 @@ public class SpellApiBased extends Spell {
*/
@Override
public void resolve() {
if (isBlessing() && !getHostCard().isPermanent()) {
Player pl = this.getActivatingPlayer();
if (pl != null && pl.getZone(ZoneType.Battlefield).size() >= 10) {
pl.setBlessing(true);
}
}
effect.resolve(this);
getActivatingPlayer().getAchievementTracker().onSpellResolve(this);
}

View File

@@ -2084,8 +2084,6 @@ public class Card extends GameEntity implements Comparable<Card> {
sb.delete(sb.lastIndexOf("\r\n"), sb.lastIndexOf("\r\n") + 3);
}
sb.append("Convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for {1} or one mana of that creature's color.)\r\n");
} else if (keyword.equals("Improvise")) {
sb.append(Keyword.IMPROVISE.getDescription()).append("\r\n");
} else if (keyword.equals("Delve")) {
if (sb.toString().endsWith("\r\n\r\n")) {
sb.delete(sb.lastIndexOf("\r\n"), sb.lastIndexOf("\r\n") + 3);
@@ -2107,7 +2105,8 @@ public class Card extends GameEntity implements Comparable<Card> {
sb.delete(sb.lastIndexOf("\r\n"), sb.lastIndexOf("\r\n") + 3);
}
sb.append("Remove CARDNAME from your deck before playing if you're not playing for ante.\r\n");
} else if (keyword.equals("Retrace") || keyword.equals("Changeling")) {
} else if (keyword.equals("Ascend") || keyword.equals("Changeling")
|| keyword.equals("Improvise") || keyword.equals("Retrace")) {
sb.append(keyword + " (" + inst.getReminderText() + ")");
} else if (keyword.startsWith("Presence")) {
sb.append(inst.getReminderText());

View File

@@ -2108,6 +2108,11 @@ public class CardFactoryUtil {
trigger.setOverridingAbility(AbilityFactory.getAbility(effect, card));
inst.addTrigger(trigger);
} else {
SpellAbility sa = card.getFirstSpellAbility();
if (sa != null && sa.isSpell()) {
sa.setBlessing(true);
}
}
} else if (keyword.startsWith("Bushido")) {
final String[] k = keyword.split(" ", 2);

View File

@@ -103,6 +103,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
private boolean manifestUp = false;
private boolean cumulativeupkeep = false;
private boolean outlast = false;
private boolean blessing = false;
private SplitSide splitSide = null;
enum SplitSide { LEFT, RIGHT };
private int totalManaSpent = 0;
@@ -757,6 +758,13 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
outlast = outlast0;
}
public boolean isBlessing() {
return blessing;
}
public void setBlessing(boolean blessing0) {
blessing = blessing0;
}
public StaticAbility getMayPlay() {
return mayPlay;
}