mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Refactor Escape and AlternativeCost
This commit is contained in:
committed by
Michael Kamensky
parent
6d193c315e
commit
b2fcc6e743
@@ -87,7 +87,7 @@ public class HumanPlay {
|
||||
|
||||
sa = AbilityUtils.addSpliceEffects(sa);
|
||||
|
||||
if (sa.hasParam("Bestow")) {
|
||||
if (sa.isBestow()) {
|
||||
source.animateBestow();
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ public class HumanPlaySpellAbility {
|
||||
|
||||
if (!prerequisitesMet) {
|
||||
if (!ability.isTrigger()) {
|
||||
rollbackAbility(fromZone, fromState, zonePosition, payment);
|
||||
rollbackAbility(fromZone, zonePosition, payment);
|
||||
if (ability.getHostCard().isMadness()) {
|
||||
// if a player failed to play madness cost, move the card to graveyard
|
||||
Card newCard = game.getAction().moveToGraveyard(c, null);
|
||||
@@ -244,14 +244,13 @@ public class HumanPlaySpellAbility {
|
||||
}
|
||||
}
|
||||
|
||||
private void rollbackAbility(final Zone fromZone, final CardStateName fromState, final int zonePosition, CostPayment payment) {
|
||||
private void rollbackAbility(final Zone fromZone, final int zonePosition, CostPayment payment) {
|
||||
// cancel ability during target choosing
|
||||
final Game game = ability.getActivatingPlayer().getGame();
|
||||
|
||||
if (fromZone != null) { // and not a copy
|
||||
// add back to where it came from
|
||||
game.getAction().moveTo(fromZone, ability.getHostCard(), zonePosition >= 0 ? Integer.valueOf(zonePosition) : null, null);
|
||||
ability.getHostCard().setState(fromState, true);
|
||||
}
|
||||
|
||||
clearTargets(ability);
|
||||
|
||||
Reference in New Issue
Block a user