mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Third draft of AbilityFactory. Overwrites changes in AbilityFactory from r2620.
Renamed DealDamage to AbilityFactory_DealDamage. Now supports the spell version. (Shock) All static modifiers removed. Added support for Buyback in the CardFactory handler for AbilityFactory cards.
This commit is contained in:
@@ -6093,14 +6093,32 @@ public class CardFactory implements NewConstants {
|
||||
// AbilityFactory cards
|
||||
ArrayList<String> IA = card.getIntrinsicAbilities();
|
||||
if (IA.size() > 0)
|
||||
{
|
||||
{
|
||||
if (card.isInstant() || card.isSorcery())
|
||||
card.clearSpellAbility();
|
||||
|
||||
for (int i=0; i<IA.size(); i++){
|
||||
AbilityFactory AF = new AbilityFactory();
|
||||
card.addSpellAbility(AF.getAbility(IA.get(i), card));
|
||||
for (int i=0; i<IA.size(); i++)
|
||||
{
|
||||
AbilityFactory AF = new AbilityFactory();
|
||||
SpellAbility sa = AF.getAbility(IA.get(i), card);
|
||||
|
||||
card.addSpellAbility(sa);
|
||||
|
||||
String bbCost = card.getSVar("Buyback");
|
||||
if (!bbCost.equals(""))
|
||||
{
|
||||
SpellAbility bbSA = sa.copy();
|
||||
bbSA.setManaCost(CardUtil.addManaCosts(card.getManaCost(), bbCost));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Buyback ").append(bbCost).append(" (You may pay an additional ").append(bbCost);
|
||||
sb.append(" as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
||||
bbSA.setDescription(sb.toString());
|
||||
bbSA.setIsBuyBackAbility(true);
|
||||
|
||||
card.addSpellAbility(bbSA);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user