mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
CardFactoryUtil: add Ascend for non-permanent Spell
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user