mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Clean up
This commit is contained in:
@@ -2569,7 +2569,6 @@ public class AbilityUtils {
|
|||||||
// Count$ThisTurnCast <Valid>
|
// Count$ThisTurnCast <Valid>
|
||||||
// Count$LastTurnCast <Valid>
|
// Count$LastTurnCast <Valid>
|
||||||
if (sq[0].startsWith("ThisTurnCast") || sq[0].startsWith("LastTurnCast")) {
|
if (sq[0].startsWith("ThisTurnCast") || sq[0].startsWith("LastTurnCast")) {
|
||||||
|
|
||||||
final String[] workingCopy = l[0].split("_");
|
final String[] workingCopy = l[0].split("_");
|
||||||
final String validFilter = workingCopy[1];
|
final String validFilter = workingCopy[1];
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class CostAdjustment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Cost result = cost.copy();
|
Cost result = cost.copy();
|
||||||
|
|
||||||
boolean isStateChangeToFaceDown = false;
|
boolean isStateChangeToFaceDown = false;
|
||||||
if (sa.isSpell() && sa.isCastFaceDown()) {
|
if (sa.isSpell() && sa.isCastFaceDown()) {
|
||||||
// Turn face down to apply cost modifiers correctly
|
// Turn face down to apply cost modifiers correctly
|
||||||
@@ -60,7 +60,7 @@ public class CostAdjustment {
|
|||||||
result.add(new Cost(ManaCost.get(n), false));
|
result.add(new Cost(ManaCost.get(n), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardCollection cardsOnBattlefield = new CardCollection(game.getCardsIn(ZoneType.Battlefield));
|
CardCollection cardsOnBattlefield = new CardCollection(game.getCardsIn(ZoneType.Battlefield));
|
||||||
cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Stack));
|
cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Stack));
|
||||||
cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Command));
|
cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Command));
|
||||||
@@ -68,7 +68,7 @@ public class CostAdjustment {
|
|||||||
cardsOnBattlefield.add(host);
|
cardsOnBattlefield.add(host);
|
||||||
}
|
}
|
||||||
final List<StaticAbility> raiseAbilities = Lists.newArrayList();
|
final List<StaticAbility> raiseAbilities = Lists.newArrayList();
|
||||||
|
|
||||||
// Sort abilities to apply them in proper order
|
// Sort abilities to apply them in proper order
|
||||||
for (Card c : cardsOnBattlefield) {
|
for (Card c : cardsOnBattlefield) {
|
||||||
for (final StaticAbility stAb : c.getStaticAbilities()) {
|
for (final StaticAbility stAb : c.getStaticAbilities()) {
|
||||||
@@ -94,11 +94,10 @@ public class CostAdjustment {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyRaise(final Cost cost, final SpellAbility sa, final StaticAbility st) {
|
private static void applyRaise(final Cost cost, final SpellAbility sa, final StaticAbility st) {
|
||||||
final Card hostCard = st.getHostCard();
|
final Card hostCard = st.getHostCard();
|
||||||
final Card card = sa.getHostCard();
|
|
||||||
|
|
||||||
if (!checkRequirement(sa, st)) {
|
if (!checkRequirement(sa, st)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -138,7 +137,7 @@ public class CostAdjustment {
|
|||||||
count = Integer.parseInt(amount);
|
count = Integer.parseInt(amount);
|
||||||
} else {
|
} else {
|
||||||
if (st.hasParam("AffectedAmount")) {
|
if (st.hasParam("AffectedAmount")) {
|
||||||
count = AbilityUtils.calculateAmount(card, st.hasSVar(amount) ? st.getSVar(amount) : amount, sa);
|
count = AbilityUtils.calculateAmount(hostCard, st.hasSVar(amount) ? st.getSVar(amount) : amount, sa);
|
||||||
} else {
|
} else {
|
||||||
count = AbilityUtils.calculateAmount(hostCard, amount, st);
|
count = AbilityUtils.calculateAmount(hostCard, amount, st);
|
||||||
}
|
}
|
||||||
@@ -152,13 +151,13 @@ public class CostAdjustment {
|
|||||||
cost.add(part);
|
cost.add(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If cardsToDelveOut is null, will immediately exile the delved cards and remember them on the host card.
|
// If cardsToDelveOut is null, will immediately exile the delved cards and remember them on the host card.
|
||||||
// Otherwise, will return them in cardsToDelveOut and the caller is responsible for doing the above.
|
// Otherwise, will return them in cardsToDelveOut and the caller is responsible for doing the above.
|
||||||
public static final void adjust(ManaCostBeingPaid cost, final SpellAbility sa, CardCollection cardsToDelveOut, boolean test) {
|
public static final void adjust(ManaCostBeingPaid cost, final SpellAbility sa, CardCollection cardsToDelveOut, boolean test) {
|
||||||
final Game game = sa.getActivatingPlayer().getGame();
|
final Game game = sa.getActivatingPlayer().getGame();
|
||||||
final Card originalCard = sa.getHostCard();
|
final Card originalCard = sa.getHostCard();
|
||||||
|
|
||||||
if (sa.isTrigger()) {
|
if (sa.isTrigger()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -204,7 +203,7 @@ public class CostAdjustment {
|
|||||||
}
|
}
|
||||||
// need to reduce generic extra because of 2 hybrid mana
|
// need to reduce generic extra because of 2 hybrid mana
|
||||||
cost.decreaseGenericMana(sumGeneric);
|
cost.decreaseGenericMana(sumGeneric);
|
||||||
|
|
||||||
if (sa.isSpell() && sa.isOffering()) { // cost reduction from offerings
|
if (sa.isSpell() && sa.isOffering()) { // cost reduction from offerings
|
||||||
adjustCostByOffering(cost, sa);
|
adjustCostByOffering(cost, sa);
|
||||||
}
|
}
|
||||||
@@ -263,7 +262,7 @@ public class CostAdjustment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<Card, ManaCostShard> convokedCards = sa.getActivatingPlayer().getController().chooseCardsForConvokeOrImprovise(sa, cost.toManaCost(), untappedCards, improvise);
|
Map<Card, ManaCostShard> convokedCards = sa.getActivatingPlayer().getController().chooseCardsForConvokeOrImprovise(sa, cost.toManaCost(), untappedCards, improvise);
|
||||||
|
|
||||||
// Convoked creats are tapped here, setting up their taps triggers,
|
// Convoked creats are tapped here, setting up their taps triggers,
|
||||||
// Then again when payment is done(In InputPayManaCost.done()) with suppression of Taps triggers.
|
// Then again when payment is done(In InputPayManaCost.done()) with suppression of Taps triggers.
|
||||||
// This is to make sure that triggers go off at the right time
|
// This is to make sure that triggers go off at the right time
|
||||||
@@ -296,15 +295,13 @@ public class CostAdjustment {
|
|||||||
|
|
||||||
final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canOffer, offeringType);
|
final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canOffer, offeringType);
|
||||||
|
|
||||||
if (!toSacList.isEmpty()) {
|
if (toSacList.isEmpty()) {
|
||||||
toSac = toSacList.getFirst();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
toSac = toSacList.getFirst();
|
||||||
|
|
||||||
cost.subtractManaCost(toSac.getManaCost());
|
cost.subtractManaCost(toSac.getManaCost());
|
||||||
|
|
||||||
sa.setSacrificedAsOffering(toSac);
|
sa.setSacrificedAsOffering(toSac);
|
||||||
toSac.setUsedToPay(true); //stop it from interfering with mana input
|
toSac.setUsedToPay(true); //stop it from interfering with mana input
|
||||||
}
|
}
|
||||||
@@ -315,15 +312,13 @@ public class CostAdjustment {
|
|||||||
|
|
||||||
final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canEmerge, "Creature");
|
final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canEmerge, "Creature");
|
||||||
|
|
||||||
if (!toSacList.isEmpty()) {
|
if (toSacList.isEmpty()) {
|
||||||
toSac = toSacList.getFirst();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
toSac = toSacList.getFirst();
|
||||||
|
|
||||||
cost.decreaseGenericMana(toSac.getCMC());
|
cost.decreaseGenericMana(toSac.getCMC());
|
||||||
|
|
||||||
sa.setSacrificedAsEmerge(toSac);
|
sa.setSacrificedAsEmerge(toSac);
|
||||||
toSac.setUsedToPay(true); //stop it from interfering with mana input
|
toSac.setUsedToPay(true); //stop it from interfering with mana input
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ public class Untap extends Phase {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public static boolean canUntap(final Card c) {
|
public static boolean canUntap(final Card c) {
|
||||||
|
|
||||||
if (c.hasKeyword("CARDNAME doesn't untap during your untap step.")
|
if (c.hasKeyword("CARDNAME doesn't untap during your untap step.")
|
||||||
|| c.hasKeyword("This card doesn't untap during your next untap step.")
|
|| c.hasKeyword("This card doesn't untap during your next untap step.")
|
||||||
|| c.hasKeyword("This card doesn't untap during your next two untap steps.")
|
|| c.hasKeyword("This card doesn't untap during your next two untap steps.")
|
||||||
|
|||||||
Reference in New Issue
Block a user