mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixed a problem with the third ability consisting of both sides of the split card being added onto the combined split card face.
- Merge: merging the latest trunk into SplitCards.
This commit is contained in:
@@ -84,6 +84,12 @@ public abstract class SpellAbilityAi {
|
||||
if (sa.getRestrictions().getPlaneswalker() && Singletons.getModel().getGame().getPhaseHandler().is(PhaseType.MAIN2)) {
|
||||
return true;
|
||||
}
|
||||
if (sa.isTrigger()) {
|
||||
return true;
|
||||
}
|
||||
if (sa.isSpell() && !sa.isBuyBackAbility()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PhaseHandler phase = Singletons.getModel().getGame().getPhaseHandler();
|
||||
return phase.is(PhaseType.END_OF_TURN) && phase.getNextTurn().equals(ai);
|
||||
|
||||
@@ -747,7 +747,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
// Blink permanents with ETB triggers
|
||||
else if (sa.isAbility() && (sa.getPayCosts() != null) && SpellAbilityAi.playReusable(ai, sa)) {
|
||||
else if (SpellAbilityAi.playReusable(ai, sa)) {
|
||||
aiPermanents = CardLists.filter(aiPermanents, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CounterAi extends SpellAbilityAi {
|
||||
if (toPay <= usableManaSources) {
|
||||
// If this is a reusable Resource, feel free to play it most of
|
||||
// the time
|
||||
if (!sa.getPayCosts().isReusuableResource() || sa.isSpell()) {
|
||||
if (!SpellAbilityAi.playReusable(ai,sa)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class CounterAi extends SpellAbilityAi {
|
||||
if (toPay <= usableManaSources) {
|
||||
// If this is a reusable Resource, feel free to play it most
|
||||
// of the time
|
||||
if (!sa.getPayCosts().isReusuableResource() || (MyRandom.getRandom().nextFloat() < .4)) {
|
||||
if (!SpellAbilityAi.playReusable(ai,sa) || (MyRandom.getRandom().nextFloat() < .4)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class CountersPutAllAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
|
||||
if (sa.isTrigger() || sa instanceof AbilitySub || SpellAbilityAi.playReusable(ai, sa)) {
|
||||
if (SpellAbilityAi.playReusable(ai, sa)) {
|
||||
return chance;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public class LifeLoseAi extends SpellAbilityAi {
|
||||
}
|
||||
|
||||
boolean randomReturn = r.nextFloat() <= .6667;
|
||||
if (SpellAbilityAi.playReusable(ai, sa) || priority) {
|
||||
if (priority || SpellAbilityAi.playReusable(ai, sa)) {
|
||||
randomReturn = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ public class DiscardEffect extends RevealEffectBase {
|
||||
List<Card> chosen = getDiscardedList(p, dPChHand);
|
||||
|
||||
for (Card c : chosen) {
|
||||
dPChHand.remove(chosen);
|
||||
dPChHand.remove(c);
|
||||
toBeDiscarded.add(c);
|
||||
}
|
||||
} else
|
||||
|
||||
@@ -287,7 +287,9 @@ public class CardFactory {
|
||||
|
||||
// this is the "default" spell for permanents like creatures and artifacts
|
||||
if (card.isPermanent() && !card.isAura() && !card.isLand()) {
|
||||
card.addSpellAbility(new SpellPermanent(card));
|
||||
if (card.getRules().getSplitType() != CardSplitType.Split) {
|
||||
card.addSpellAbility(new SpellPermanent(card)); // ignore the default spell for combined split cards
|
||||
}
|
||||
}
|
||||
|
||||
CardFactoryUtil.parseKeywords(card, cardName);
|
||||
@@ -358,6 +360,7 @@ public class CardFactory {
|
||||
if (card.isInAlternateState()) {
|
||||
card.setState(CardCharacteristicName.Original);
|
||||
}
|
||||
|
||||
if ( st == CardSplitType.Split ) {
|
||||
card.setName(rules.getName());
|
||||
|
||||
@@ -374,7 +377,8 @@ public class CardFactory {
|
||||
combinedCardColorArr.add(combinedCardColor);
|
||||
card.setColor(combinedCardColorArr);
|
||||
|
||||
// Combined abilities -- DOESN'T WORK AS DESIRED (?)
|
||||
// Combined abilities -- DOESN'T DISPLAY THE ABILITY TEXT IN THE CHOICE BOX YET
|
||||
card.getCharacteristics().getIntrinsicAbility().clear();
|
||||
for (String a : rules.getMainPart().getAbilities()) {
|
||||
card.addIntrinsicAbility(a);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ public class CostPutCounter extends CostPartWithList {
|
||||
super(amount, type, description);
|
||||
this.counter = cntr;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
@@ -56,6 +56,9 @@ public class CostReveal extends CostPartWithList {
|
||||
super(amount, type, description);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CostUnattach extends CostPartWithList {
|
||||
public boolean isUndoable() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isReusable() { return false; }
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
Reference in New Issue
Block a user