inverted the value of variabel for HumanPlaySpellAbility

moved split cards state restoration to the depths of changeZone, removed excessive action from HumanPlaySpellAbility
This commit is contained in:
Maxmtg
2013-06-29 21:16:26 +00:00
parent d375d5588c
commit 64dfce26b1
3 changed files with 13 additions and 17 deletions

View File

@@ -50,7 +50,7 @@ public class HumanPlaySpellAbility {
}
public final void fillRequirements(boolean isAlreadyTargeted, boolean isFree, boolean skipStack) {
public final void playAbility(boolean mayChoseTargets, boolean isFree, boolean skipStack) {
final Game game = ability.getActivatingPlayer().getGame();
// used to rollback
@@ -71,7 +71,7 @@ public class HumanPlaySpellAbility {
// is only executed or evaluated if the first argument does not suffice to determine the value of the expression
boolean prerequisitesMet = this.announceValuesLikeX()
&& this.announceType()
&& ( isAlreadyTargeted || setupTargets() )
&& ( !mayChoseTargets || setupTargets() ) // if you can choose targets, then do choose them.
&& ( isFree || this.payment.payCost(game) );
@@ -93,7 +93,7 @@ public class HumanPlaySpellAbility {
// no worries here. The same thread must resolve, and by this moment ability will have been resolved already
// Triggers haven't resolved yet ??
if (!isAlreadyTargeted) {
if (mayChoseTargets) {
clearTargets(ability);
}
}
@@ -131,11 +131,6 @@ public class HumanPlaySpellAbility {
final Game game = ability.getActivatingPlayer().getGame();
final Card c = ability.getSourceCard();
// split cards transform back to full form if targeting is canceled
if (c.isSplitCard()) {
c.setState(CardCharacteristicName.Original);
}
if (fromZone != null) { // and not a copy
// add back to where it came from
game.getAction().moveTo(fromZone, c, zonePosition >= 0 ? Integer.valueOf(zonePosition) : null);

View File

@@ -152,6 +152,11 @@ public class GameAction {
lastKnownInfo = c;
copied = c;
} else {
if (c.isSplitCard() && !zoneTo.is(ZoneType.Stack)) {
c.setState(CardCharacteristicName.Original);
}
lastKnownInfo = CardUtil.getLKICopy(c);
if (c.isCloned()) {

View File

@@ -118,15 +118,11 @@ public class HumanPlay {
// System.out.println("Playing:" + sa.getDescription() + " of " + sa.getSourceCard() + " new = " + newAbility);
if (newAbility) {
CostPayment payment = null;
if (sa.getPayCosts() == null) {
payment = new CostPayment(new Cost("0", sa.isAbility()), sa);
} else {
payment = new CostPayment(sa.getPayCosts(), sa);
}
Cost abCost = sa.getPayCosts() == null ? new Cost("0", sa.isAbility()) : sa.getPayCosts();
CostPayment payment = new CostPayment(abCost, sa);
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(sa, payment);
req.fillRequirements(false, false, false);
req.playAbility(true, false, false);
} else {
if (payManaCostIfNeeded(p, sa)) {
if (sa.isSpell() && !source.isCopiedSpell()) {
@@ -210,7 +206,7 @@ public class HumanPlay {
final CostPayment payment = new CostPayment(sa.getPayCosts(), sa);
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(sa, payment);
req.fillRequirements(!mayChooseNewTargets, true, false);
req.playAbility(mayChooseNewTargets, true, false);
} else {
if (sa.isSpell()) {
final Card c = sa.getSourceCard();
@@ -242,7 +238,7 @@ public class HumanPlay {
if (sa.getPayCosts() != null) {
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(sa, new CostPayment(sa.getPayCosts(), sa));
req.fillRequirements(useOldTargets, false, true);
req.playAbility(!useOldTargets, false, true);
} else {
if (payManaCostIfNeeded(player, sa)) {
AbilityUtils.resolve(sa);