mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
CardFactoryUtil: improved Bestow a bit
This commit is contained in:
@@ -1406,7 +1406,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
} else if (keyword.startsWith("Modular") || keyword.startsWith("Soulshift") || keyword.startsWith("Bloodthirst")
|
} else if (keyword.startsWith("Modular") || keyword.startsWith("Soulshift") || keyword.startsWith("Bloodthirst")
|
||||||
|| keyword.startsWith("Strive") || keyword.startsWith("Escalate")
|
|| keyword.startsWith("Strive") || keyword.startsWith("Escalate")
|
||||||
|| keyword.startsWith("ETBReplacement") || keyword.startsWith("MayEffectFromOpeningHand")) {
|
|| keyword.startsWith("ETBReplacement") || keyword.startsWith("MayEffectFromOpeningHand")) {
|
||||||
} else if (keyword.startsWith("Provoke") || keyword.startsWith("Devour") || keyword.equals("Unleash")) {
|
} else if (keyword.startsWith("Provoke") || keyword.startsWith("Devour") || keyword.equals("Unleash")
|
||||||
|
|| keyword.startsWith("Soulbond")) {
|
||||||
sbLong.append(keyword + " (" + Keyword.getInstance(keyword).getReminderText() + ")");
|
sbLong.append(keyword + " (" + Keyword.getInstance(keyword).getReminderText() + ")");
|
||||||
} else if (keyword.contains("Haunt")) {
|
} else if (keyword.contains("Haunt")) {
|
||||||
sb.append("\r\nHaunt (");
|
sb.append("\r\nHaunt (");
|
||||||
@@ -1433,11 +1434,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
sbLong.append("and paying the difference in mana costs between this and the sacrificed ");
|
sbLong.append("and paying the difference in mana costs between this and the sacrificed ");
|
||||||
sbLong.append(offeringType);
|
sbLong.append(offeringType);
|
||||||
sbLong.append(". Mana cost includes color.)");
|
sbLong.append(". Mana cost includes color.)");
|
||||||
} else if (keyword.startsWith("Soulbond")) {
|
|
||||||
sbLong.append(keyword + " (" + Keyword.getInstance(keyword).getReminderText() + ")");
|
|
||||||
} else if (keyword.startsWith("Equip") || keyword.startsWith("Fortify") || keyword.startsWith("Outlast")
|
} else if (keyword.startsWith("Equip") || keyword.startsWith("Fortify") || keyword.startsWith("Outlast")
|
||||||
|| keyword.startsWith("Unearth") || keyword.startsWith("Scavenge") || keyword.startsWith("Ninjutsu")
|
|| keyword.startsWith("Unearth") || keyword.startsWith("Scavenge") || keyword.startsWith("Ninjutsu")
|
||||||
|| keyword.startsWith("Evoke")) {
|
|| keyword.startsWith("Evoke") || keyword.startsWith("Bestow")) {
|
||||||
// keyword parsing takes care of adding a proper description
|
// keyword parsing takes care of adding a proper description
|
||||||
} else if (keyword.startsWith("CantBeBlockedBy")) {
|
} else if (keyword.startsWith("CantBeBlockedBy")) {
|
||||||
sbLong.append(getName()).append(" can't be blocked ");
|
sbLong.append(getName()).append(" can't be blocked ");
|
||||||
|
|||||||
@@ -2703,24 +2703,7 @@ public class CardFactoryUtil {
|
|||||||
card.getCurrentState().addUnparsedAbility(abilityStr.toString());
|
card.getCurrentState().addUnparsedAbility(abilityStr.toString());
|
||||||
}
|
}
|
||||||
else if (keyword.startsWith("Bestow")) {
|
else if (keyword.startsWith("Bestow")) {
|
||||||
final String[] params = keyword.split(":");
|
addSpellAbility(keyword, card, null);
|
||||||
final String cost = params[1];
|
|
||||||
card.removeIntrinsicKeyword(keyword);
|
|
||||||
|
|
||||||
final StringBuilder sbAttach = new StringBuilder();
|
|
||||||
sbAttach.append("SP$ Attach | Cost$ ");
|
|
||||||
sbAttach.append(cost);
|
|
||||||
sbAttach.append(" | AILogic$ ").append(params.length > 2 ? params[2] : "Pump");
|
|
||||||
sbAttach.append(" | Bestow$ True | ValidTgts$ Creature");
|
|
||||||
final SpellAbility bestow = AbilityFactory.getAbility(sbAttach.toString(), card);
|
|
||||||
|
|
||||||
bestow.setDescription("Bestow " + ManaCostParser.parse(cost) + " (If you cast this"
|
|
||||||
+ " card for its bestow cost, it's an Aura spell with enchant creature. It"
|
|
||||||
+ " becomes a creature again if it's not attached to a creature.)");
|
|
||||||
bestow.setStackDescription("Bestow - " + card.getName());
|
|
||||||
bestow.setBasicSpell(false);
|
|
||||||
card.addSpellAbility(bestow);
|
|
||||||
card.getCurrentState().addUnparsedAbility(sbAttach.toString());
|
|
||||||
}
|
}
|
||||||
else if (keyword.equals("Hideaway")) {
|
else if (keyword.equals("Hideaway")) {
|
||||||
card.getCurrentState().addIntrinsicKeyword("CARDNAME enters the battlefield tapped.");
|
card.getCurrentState().addIntrinsicKeyword("CARDNAME enters the battlefield tapped.");
|
||||||
@@ -3190,7 +3173,32 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
public static void addSpellAbility(final String keyword, final Card card, final KeywordsChange kws) {
|
public static void addSpellAbility(final String keyword, final Card card, final KeywordsChange kws) {
|
||||||
final boolean intrinsic = kws == null;
|
final boolean intrinsic = kws == null;
|
||||||
if (keyword.startsWith("Evoke")) {
|
if (keyword.startsWith("Bestow")) {
|
||||||
|
final String[] params = keyword.split(":");
|
||||||
|
final String cost = params[1];
|
||||||
|
|
||||||
|
final StringBuilder sbAttach = new StringBuilder();
|
||||||
|
sbAttach.append("SP$ Attach | Cost$ ");
|
||||||
|
sbAttach.append(cost);
|
||||||
|
sbAttach.append(" | AILogic$ ").append(params.length > 2 ? params[2] : "Pump");
|
||||||
|
sbAttach.append(" | Bestow$ True | ValidTgts$ Creature");
|
||||||
|
|
||||||
|
final SpellAbility sa = AbilityFactory.getAbility(sbAttach.toString(), card);
|
||||||
|
sa.setDescription("Bestow " + ManaCostParser.parse(cost) +
|
||||||
|
" (" + Keyword.getInstance(keyword).getReminderText() + ")");
|
||||||
|
sa.setStackDescription("Bestow - " + card.getName());
|
||||||
|
sa.setBasicSpell(false);
|
||||||
|
if (!intrinsic) {
|
||||||
|
sa.setTemporary(true);
|
||||||
|
sa.setIntrinsic(false);
|
||||||
|
//sa.setOriginalHost(hostCard);
|
||||||
|
kws.addSpellAbility(sa);
|
||||||
|
} else {
|
||||||
|
// add ability to instrinic strings so copies/clones create the ability also
|
||||||
|
card.getCurrentState().addUnparsedAbility(sbAttach.toString());
|
||||||
|
}
|
||||||
|
card.addSpellAbility(sa);
|
||||||
|
} else if (keyword.startsWith("Evoke")) {
|
||||||
final String[] k = keyword.split(":");
|
final String[] k = keyword.split(":");
|
||||||
final Cost evokedCost = new Cost(k[1], false);
|
final Cost evokedCost = new Cost(k[1], false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user