mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- First step towards the player keyword "Spells and abilities your opponents control can't cause you to sacrifice permanents."
This commit is contained in:
@@ -1275,7 +1275,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
final boolean hasVanish = CardFactoryUtil.hasKeyword(this, "Vanishing") != -1;
|
final boolean hasVanish = CardFactoryUtil.hasKeyword(this, "Vanishing") != -1;
|
||||||
|
|
||||||
if (hasVanish && AllZoneUtil.isCardInPlay(this)) {
|
if (hasVanish && AllZoneUtil.isCardInPlay(this)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(this);
|
Singletons.getModel().getGameAction().sacrifice(this, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasSuspend() && AllZoneUtil.isCardExiled(this)) {
|
if (this.hasSuspend() && AllZoneUtil.isCardExiled(this)) {
|
||||||
|
|||||||
@@ -1176,7 +1176,7 @@ public class GameAction {
|
|||||||
* a {@link forge.Card} object.
|
* a {@link forge.Card} object.
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public final boolean sacrifice(final Card c) {
|
public final boolean sacrifice(final Card c, final SpellAbility source) {
|
||||||
if (c.isImmutable()) {
|
if (c.isImmutable()) {
|
||||||
System.out.println("Trying to sacrifice immutables: " + c);
|
System.out.println("Trying to sacrifice immutables: " + c);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ public final class AbilityFactoryCopy {
|
|||||||
if (params.get("AtEOT").equals("Sacrifice")) {
|
if (params.get("AtEOT").equals("Sacrifice")) {
|
||||||
// maybe do a setSacrificeAtEOT, but
|
// maybe do a setSacrificeAtEOT, but
|
||||||
// probably not.
|
// probably not.
|
||||||
Singletons.getModel().getGameAction().sacrifice(target[index]);
|
Singletons.getModel().getGameAction().sacrifice(target[index], sa);
|
||||||
} else if (params.get("AtEOT").equals("Exile")) {
|
} else if (params.get("AtEOT").equals("Exile")) {
|
||||||
Singletons.getModel().getGameAction().exile(target[index]);
|
Singletons.getModel().getGameAction().exile(target[index]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ public class AbilityFactoryDestroy {
|
|||||||
for (final Card tgtC : tgtCards) {
|
for (final Card tgtC : tgtCards) {
|
||||||
if (AllZoneUtil.isCardInPlay(tgtC) && ((tgt == null) || tgtC.canBeTargetedBy(sa))) {
|
if (AllZoneUtil.isCardInPlay(tgtC) && ((tgt == null) || tgtC.canBeTargetedBy(sa))) {
|
||||||
if (sac) {
|
if (sac) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(tgtC);
|
Singletons.getModel().getGameAction().sacrifice(tgtC, sa);
|
||||||
} else if (noRegen) {
|
} else if (noRegen) {
|
||||||
Singletons.getModel().getGameAction().destroyNoRegeneration(tgtC);
|
Singletons.getModel().getGameAction().destroyNoRegeneration(tgtC);
|
||||||
} else {
|
} else {
|
||||||
@@ -566,7 +566,7 @@ public class AbilityFactoryDestroy {
|
|||||||
for (final Card unTgtC : untargetedCards) {
|
for (final Card unTgtC : untargetedCards) {
|
||||||
if (AllZoneUtil.isCardInPlay(unTgtC)) {
|
if (AllZoneUtil.isCardInPlay(unTgtC)) {
|
||||||
if (sac) {
|
if (sac) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(unTgtC);
|
Singletons.getModel().getGameAction().sacrifice(unTgtC, sa);
|
||||||
} else if (noRegen) {
|
} else if (noRegen) {
|
||||||
Singletons.getModel().getGameAction().destroyNoRegeneration(unTgtC);
|
Singletons.getModel().getGameAction().destroyNoRegeneration(unTgtC);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ public class AbilityFactoryMana {
|
|||||||
final int num = card.getCounters(Counters.getType(deplete));
|
final int num = card.getCounters(Counters.getType(deplete));
|
||||||
if (num == 0) {
|
if (num == 0) {
|
||||||
abMana.setUndoable(false);
|
abMana.setUndoable(false);
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -452,8 +452,7 @@ public class AbilityFactorySacrifice {
|
|||||||
|
|
||||||
if (valid.equals("Self")) {
|
if (valid.equals("Self")) {
|
||||||
if (AllZone.getZoneOf(card).is(ZoneType.Battlefield)) {
|
if (AllZone.getZoneOf(card).is(ZoneType.Battlefield)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
if (Singletons.getModel().getGameAction().sacrifice(card, sa) && remSacrificed) {
|
||||||
if (remSacrificed) {
|
|
||||||
card.addRemembered(card);
|
card.addRemembered(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -543,7 +542,7 @@ public class AbilityFactorySacrifice {
|
|||||||
sacList.add(c);
|
sacList.add(c);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Singletons.getModel().getGameAction().sacrifice(c)) {
|
if (Singletons.getModel().getGameAction().sacrifice(c, sa)) {
|
||||||
sacList.add(c);
|
sacList.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -836,7 +835,7 @@ public class AbilityFactorySacrifice {
|
|||||||
list = AbilityFactory.filterListByType(list, valid, sa);
|
list = AbilityFactory.filterListByType(list, valid, sa);
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
if (Singletons.getModel().getGameAction().sacrifice(list.get(i)) && remSacrificed) {
|
if (Singletons.getModel().getGameAction().sacrifice(list.get(i), sa) && remSacrificed) {
|
||||||
card.addRemembered(list.get(i));
|
card.addRemembered(list.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class CardFactoryArtifacts {
|
|||||||
AllZone.getHumanPlayer().discard(c, null);
|
AllZone.getHumanPlayer().discard(c, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
} else if (c.equals(card)) {
|
} else if (c.equals(card)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ class CardFactoryArtifacts {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
if (card.getController().isHuman()) {
|
if (card.getController().isHuman()) {
|
||||||
if (AllZone.getHumanPlayer().getZone(ZoneType.Hand).isEmpty()) {
|
if (AllZone.getHumanPlayer().getZone(ZoneType.Hand).isEmpty()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
} else {
|
} else {
|
||||||
AllZone.getInputControl().setInput(discard);
|
AllZone.getInputControl().setInput(discard);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ class CardFactoryAuras {
|
|||||||
|
|
||||||
if (!grave.is(ZoneType.Graveyard)) {
|
if (!grave.is(ZoneType.Graveyard)) {
|
||||||
// Animated Creature got removed before ability resolved
|
// Animated Creature got removed before ability resolved
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ class CardFactoryAuras {
|
|||||||
|
|
||||||
if (CardFactoryUtil.hasProtectionFrom(card, animated)) {
|
if (CardFactoryUtil.hasProtectionFrom(card, animated)) {
|
||||||
// Animated a creature with protection
|
// Animated a creature with protection
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -534,7 +534,7 @@ class CardFactoryAuras {
|
|||||||
final PlayerZone play = card.getController().getZone(ZoneType.Battlefield);
|
final PlayerZone play = card.getController().getZone(ZoneType.Battlefield);
|
||||||
|
|
||||||
if (play.contains(c)) {
|
if (play.contains(c)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}; // Detach
|
}; // Detach
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public class CardFactoryCreatures {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
final CardList hand = card.getController().getCardsIn(ZoneType.Hand);
|
final CardList hand = card.getController().getCardsIn(ZoneType.Hand);
|
||||||
if (hand.size() == 0) {
|
if (hand.size() == 0) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
} else {
|
} else {
|
||||||
card.getController().discardRandom(this);
|
card.getController().discardRandom(this);
|
||||||
}
|
}
|
||||||
@@ -547,7 +547,7 @@ public class CardFactoryCreatures {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (AllZoneUtil.isCardInPlay(card)) {
|
if (AllZoneUtil.isCardInPlay(card)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1587,7 +1587,7 @@ public class CardFactoryCreatures {
|
|||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
toSac.clear();
|
toSac.clear();
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1603,10 +1603,10 @@ public class CardFactoryCreatures {
|
|||||||
private void done() {
|
private void done() {
|
||||||
if (getTotalPower() >= 12) {
|
if (getTotalPower() >= 12) {
|
||||||
for (final Card sac : toSac) {
|
for (final Card sac : toSac) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(sac);
|
Singletons.getModel().getGameAction().sacrifice(sac, null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
toSac.clear();
|
toSac.clear();
|
||||||
this.stop();
|
this.stop();
|
||||||
|
|||||||
@@ -213,14 +213,14 @@ class CardFactoryLands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectCard(final Card c, final PlayerZone zone) {
|
public void selectCard(final Card c, final PlayerZone zone) {
|
||||||
if (c.isLand() && zone.is(ZoneType.Battlefield) && c.isUntapped()) {
|
if (c.isLand() && zone.is(ZoneType.Battlefield) && c.isUntapped()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
if (paid[0] < 1) {
|
if (paid[0] < 1) {
|
||||||
paid[0]++;
|
paid[0]++;
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
@@ -234,7 +234,7 @@ class CardFactoryLands {
|
|||||||
}; // Input
|
}; // Input
|
||||||
if ((AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer()).filter(CardListFilter.UNTAPPED)
|
if ((AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer()).filter(CardListFilter.UNTAPPED)
|
||||||
.size() < 2)) {
|
.size() < 2)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
AllZone.getInputControl().setInput(target);
|
AllZone.getInputControl().setInput(target);
|
||||||
@@ -283,12 +283,12 @@ class CardFactoryLands {
|
|||||||
// if any are tapped, sacrifice it
|
// if any are tapped, sacrifice it
|
||||||
// else sacrifice random
|
// else sacrifice random
|
||||||
if (tappedLand.size() > 0) {
|
if (tappedLand.size() > 0) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(tappedLand.get(0));
|
Singletons.getModel().getGameAction().sacrifice(tappedLand.get(0), null);
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(land.get(0));
|
Singletons.getModel().getGameAction().sacrifice(land.get(0), null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
} else { // this is the human resolution
|
} else { // this is the human resolution
|
||||||
final Input target = new Input() {
|
final Input target = new Input() {
|
||||||
@@ -303,14 +303,14 @@ class CardFactoryLands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectCard(final Card c, final PlayerZone zone) {
|
public void selectCard(final Card c, final PlayerZone zone) {
|
||||||
if (c.isLand() && zone.is(ZoneType.Battlefield) && land.contains(c)) {
|
if (c.isLand() && zone.is(ZoneType.Battlefield) && land.contains(c)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
} // selectCard()
|
} // selectCard()
|
||||||
@@ -342,7 +342,7 @@ class CardFactoryLands {
|
|||||||
|
|
||||||
if (land.size() > 0) {
|
if (land.size() > 0) {
|
||||||
for (final Card c : land) {
|
for (final Card c : land) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,21 +367,21 @@ class CardFactoryLands {
|
|||||||
CardList tappedPlains = new CardList(plains);
|
CardList tappedPlains = new CardList(plains);
|
||||||
tappedPlains = tappedPlains.getType("Basic");
|
tappedPlains = tappedPlains.getType("Basic");
|
||||||
for (final Card c : tappedPlains) {
|
for (final Card c : tappedPlains) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < tappedPlains.size(); i++) {
|
for (int i = 0; i < tappedPlains.size(); i++) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(plains.get(i));
|
Singletons.getModel().getGameAction().sacrifice(plains.get(i), null);
|
||||||
}
|
}
|
||||||
// if any are tapped, sacrifice it
|
// if any are tapped, sacrifice it
|
||||||
// else sacrifice random
|
// else sacrifice random
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
} else { // this is the human resolution
|
} else { // this is the human resolution
|
||||||
final int[] paid = { 0 };
|
final int[] paid = { 0 };
|
||||||
if ((AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer()).filter(CardListFilter.UNTAPPED)
|
if ((AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer()).filter(CardListFilter.UNTAPPED)
|
||||||
.size() < 2)) {
|
.size() < 2)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Input target = new Input() {
|
final Input target = new Input() {
|
||||||
@@ -396,14 +396,14 @@ class CardFactoryLands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectCard(final Card c, final PlayerZone zone) {
|
public void selectCard(final Card c, final PlayerZone zone) {
|
||||||
if (c.isLand() && zone.is(ZoneType.Battlefield) && c.isUntapped()) {
|
if (c.isLand() && zone.is(ZoneType.Battlefield) && c.isUntapped()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
if (paid[0] < 1) {
|
if (paid[0] < 1) {
|
||||||
paid[0]++;
|
paid[0]++;
|
||||||
CMatchUI.SINGLETON_INSTANCE.showMessage(
|
CMatchUI.SINGLETON_INSTANCE.showMessage(
|
||||||
@@ -659,7 +659,7 @@ class CardFactoryLands {
|
|||||||
Singletons.getModel().getGameAction().moveToHand(CardFactoryUtil.getWorstLand(land));
|
Singletons.getModel().getGameAction().moveToHand(CardFactoryUtil.getWorstLand(land));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
} else { // this is the human resolution
|
} else { // this is the human resolution
|
||||||
final Input target = new Input() {
|
final Input target = new Input() {
|
||||||
@@ -676,7 +676,7 @@ class CardFactoryLands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -728,7 +728,7 @@ class CardFactoryLands {
|
|||||||
final Card c = CardFactoryUtil.getWorstLand(land);
|
final Card c = CardFactoryUtil.getWorstLand(land);
|
||||||
Singletons.getModel().getGameAction().moveToHand(c);
|
Singletons.getModel().getGameAction().moveToHand(c);
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
} else { // this is the human resolution
|
} else { // this is the human resolution
|
||||||
final Input target = new Input() {
|
final Input target = new Input() {
|
||||||
@@ -745,7 +745,7 @@ class CardFactoryLands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ public class CardFactorySorceries {
|
|||||||
// selected are sacrificed.
|
// selected are sacrificed.
|
||||||
for (int i = 0; i < target.size(); i++) {
|
for (int i = 0; i < target.size(); i++) {
|
||||||
if (AllZoneUtil.isCardInPlay(target.get(i)) && !saveList.contains(target.get(i))) {
|
if (AllZoneUtil.isCardInPlay(target.get(i)) && !saveList.contains(target.get(i))) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(target.get(i));
|
Singletons.getModel().getGameAction().sacrifice(target.get(i), this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // resolve()
|
} // resolve()
|
||||||
@@ -738,7 +738,7 @@ public class CardFactorySorceries {
|
|||||||
if (compLand.size() > humLand.size()) {
|
if (compLand.size() > humLand.size()) {
|
||||||
compLand.shuffle();
|
compLand.shuffle();
|
||||||
for (int i = 0; i < (compLand.size() - humLand.size()); i++) {
|
for (int i = 0; i < (compLand.size() - humLand.size()); i++) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(compLand.get(i));
|
Singletons.getModel().getGameAction().sacrifice(compLand.get(i), this);
|
||||||
}
|
}
|
||||||
} else if (humLand.size() > compLand.size()) {
|
} else if (humLand.size() > compLand.size()) {
|
||||||
final int diff = humLand.size() - compLand.size();
|
final int diff = humLand.size() - compLand.size();
|
||||||
@@ -765,7 +765,7 @@ public class CardFactorySorceries {
|
|||||||
CardListUtil.sortCMC(compCreats);
|
CardListUtil.sortCMC(compCreats);
|
||||||
compCreats.reverse();
|
compCreats.reverse();
|
||||||
for (int i = 0; i < (compCreats.size() - humCreats.size()); i++) {
|
for (int i = 0; i < (compCreats.size() - humCreats.size()); i++) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(compCreats.get(i));
|
Singletons.getModel().getGameAction().sacrifice(compCreats.get(i), this);
|
||||||
}
|
}
|
||||||
} else if (humCreats.size() > compCreats.size()) {
|
} else if (humCreats.size() > compCreats.size()) {
|
||||||
final int diff = humCreats.size() - compCreats.size();
|
final int diff = humCreats.size() - compCreats.size();
|
||||||
@@ -1895,7 +1895,7 @@ public class CardFactorySorceries {
|
|||||||
if (toSac != null) {
|
if (toSac != null) {
|
||||||
final Card c = (Card) toSac;
|
final Card c = (Card) toSac;
|
||||||
baseCMC = CardUtil.getConvertedManaCost(c);
|
baseCMC = CardUtil.getConvertedManaCost(c);
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, this);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1816,7 +1816,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(crd);
|
Singletons.getModel().getGameAction().sacrifice(crd, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1824,7 +1824,7 @@ public class CardFactoryUtil {
|
|||||||
public void selectCard(final Card card, final PlayerZone zone) {
|
public void selectCard(final Card card, final PlayerZone zone) {
|
||||||
if (choices.contains(card)) {
|
if (choices.contains(card)) {
|
||||||
if (card == spell.getSourceCard()) {
|
if (card == spell.getSourceCard()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(spell.getSourceCard());
|
Singletons.getModel().getGameAction().sacrifice(spell.getSourceCard(), null);
|
||||||
this.stop();
|
this.stop();
|
||||||
} else {
|
} else {
|
||||||
spell.getSourceCard().setChampionedCard(card);
|
spell.getSourceCard().setChampionedCard(card);
|
||||||
@@ -5179,7 +5179,7 @@ public class CardFactoryUtil {
|
|||||||
numCreatures[0] = selection.size();
|
numCreatures[0] = selection.size();
|
||||||
for (int m = 0; m < selection.size(); m++) {
|
for (int m = 0; m < selection.size(); m++) {
|
||||||
card.addDevoured(selection.get(m));
|
card.addDevoured(selection.get(m));
|
||||||
Singletons.getModel().getGameAction().sacrifice(selection.get(m));
|
Singletons.getModel().getGameAction().sacrifice(selection.get(m), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5190,7 +5190,7 @@ public class CardFactoryUtil {
|
|||||||
final Card c = creats.get(i);
|
final Card c = creats.get(i);
|
||||||
if ((c.getNetAttack() <= 1) && ((c.getNetAttack() + c.getNetDefense()) <= 3)) {
|
if ((c.getNetAttack() <= 1) && ((c.getNetAttack() + c.getNetDefense()) <= 3)) {
|
||||||
card.addDevoured(c);
|
card.addDevoured(c);
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
// is this needed?
|
// is this needed?
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class CostSacrifice extends CostPartWithList {
|
|||||||
public final void payAI(final SpellAbility ability, final Card source, final CostPayment payment) {
|
public final void payAI(final SpellAbility ability, final Card source, final CostPayment payment) {
|
||||||
this.addListToHash(ability, "Sacrificed");
|
this.addListToHash(ability, "Sacrificed");
|
||||||
for (final Card c : this.getList()) {
|
for (final Card c : this.getList()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ public class CostSacrifice extends CostPartWithList {
|
|||||||
// TODO Ask First
|
// TODO Ask First
|
||||||
for (final Card card : typeList) {
|
for (final Card card : typeList) {
|
||||||
payment.getAbility().addCostToHashList(card, "Sacrificed");
|
payment.getAbility().addCostToHashList(card, "Sacrificed");
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
payment.setPaidManaPart(part, true);
|
payment.setPaidManaPart(part, true);
|
||||||
@@ -304,7 +304,7 @@ public class CostSacrifice extends CostPartWithList {
|
|||||||
if (typeList.contains(card)) {
|
if (typeList.contains(card)) {
|
||||||
this.nSacrifices++;
|
this.nSacrifices++;
|
||||||
part.addToList(card);
|
part.addToList(card);
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, sa);
|
||||||
typeList.remove(card);
|
typeList.remove(card);
|
||||||
// in case nothing else to sacrifice
|
// in case nothing else to sacrifice
|
||||||
if (this.nSacrifices == nNeeded) {
|
if (this.nSacrifices == nNeeded) {
|
||||||
@@ -365,7 +365,7 @@ public class CostSacrifice extends CostPartWithList {
|
|||||||
if (choice.equals(0)) {
|
if (choice.equals(0)) {
|
||||||
part.addToList(card);
|
part.addToList(card);
|
||||||
part.addListToHash(sa, "Sacrificed");
|
part.addListToHash(sa, "Sacrificed");
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, sa);
|
||||||
this.stop();
|
this.stop();
|
||||||
payment.paidCost(part);
|
payment.paidCost(part);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class SpellPermanent extends Spell {
|
|||||||
|
|
||||||
final CardList creature = (CardList) SpellPermanent.this.championGetCreature.execute();
|
final CardList creature = (CardList) SpellPermanent.this.championGetCreature.execute();
|
||||||
if (creature.size() == 0) {
|
if (creature.size() == 0) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(source);
|
Singletons.getModel().getGameAction().sacrifice(source, null);
|
||||||
return;
|
return;
|
||||||
} else if (controller.isHuman()) {
|
} else if (controller.isHuman()) {
|
||||||
AllZone.getInputControl().setInput(SpellPermanent.this.championInputComes);
|
AllZone.getInputControl().setInput(SpellPermanent.this.championInputComes);
|
||||||
@@ -114,7 +114,7 @@ public class SpellPermanent extends Spell {
|
|||||||
runParams.put("Championed", source.getChampionedCard());
|
runParams.put("Championed", source.getChampionedCard());
|
||||||
AllZone.getTriggerHandler().runTrigger(TriggerType.Championed, runParams);
|
AllZone.getTriggerHandler().runTrigger(TriggerType.Championed, runParams);
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(this.getSourceCard());
|
Singletons.getModel().getGameAction().sacrifice(this.getSourceCard(), null);
|
||||||
}
|
}
|
||||||
} // computer
|
} // computer
|
||||||
} // resolve()
|
} // resolve()
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class EndOfTurn extends Phase implements java.io.Serializable {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if (AllZoneUtil.isCardInPlay(card)) {
|
if (AllZoneUtil.isCardInPlay(card)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
} else if (GameActionUtil.showYesNoDialog(c, sb.toString())) {
|
} else if (GameActionUtil.showYesNoDialog(c, sb.toString())) {
|
||||||
abMana.produceMana();
|
abMana.produceMana();
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
if (ComputerUtil.canPayCost(aiPaid)) {
|
if (ComputerUtil.canPayCost(aiPaid)) {
|
||||||
ComputerUtil.playNoStack(aiPaid);
|
ComputerUtil.playNoStack(aiPaid);
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
if (ComputerUtil.canPayCost(aiPaid)) {
|
if (ComputerUtil.canPayCost(aiPaid)) {
|
||||||
ComputerUtil.playNoStack(aiPaid);
|
ComputerUtil.playNoStack(aiPaid);
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -582,7 +582,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
// probably need to restrict by controller also
|
// probably need to restrict by controller also
|
||||||
if (artifact.isArtifact() && zone.is(ZoneType.Battlefield)
|
if (artifact.isArtifact() && zone.is(ZoneType.Battlefield)
|
||||||
&& zone.getPlayer().isHuman()) {
|
&& zone.getPlayer().isHuman()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(artifact);
|
Singletons.getModel().getGameAction().sacrifice(artifact, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
} // selectCard()
|
} // selectCard()
|
||||||
@@ -592,7 +592,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
if (null == target) {
|
if (null == target) {
|
||||||
this.tapAndDamage(player);
|
this.tapAndDamage(player);
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getGameAction().sacrifice(target);
|
Singletons.getModel().getGameAction().sacrifice(target, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // resolve
|
} // resolve
|
||||||
@@ -722,7 +722,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
} else {
|
} else {
|
||||||
final Card target = CardFactoryUtil.getBestLandAI(playerLand);
|
final Card target = CardFactoryUtil.getBestLandAI(playerLand);
|
||||||
|
|
||||||
Singletons.getModel().getGameAction().sacrifice(target);
|
Singletons.getModel().getGameAction().sacrifice(target, null);
|
||||||
}
|
}
|
||||||
} // end resolve()
|
} // end resolve()
|
||||||
}; // end noPay ability
|
}; // end noPay ability
|
||||||
@@ -1982,7 +1982,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
final int fadeCounters = card.getCounters(Counters.FADE);
|
final int fadeCounters = card.getCounters(Counters.FADE);
|
||||||
if (fadeCounters <= 0) {
|
if (fadeCounters <= 0) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
} else {
|
} else {
|
||||||
card.subtractCounter(Counters.FADE, 1);
|
card.subtractCounter(Counters.FADE, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1762,7 +1762,7 @@ public class ComputerUtil {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Singletons.getModel().getGameAction().sacrifice(c)) {
|
if (!Singletons.getModel().getGameAction().sacrifice(c, null)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public final class PlayerUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void selectCard(final Card card, final PlayerZone zone) {
|
public void selectCard(final Card card, final PlayerZone zone) {
|
||||||
if (zone.equals(AllZone.getHumanPlayer().getZone(ZoneType.Battlefield)) && list.contains(card)) {
|
if (zone.equals(AllZone.getHumanPlayer().getZone(ZoneType.Battlefield)) && list.contains(card)) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(card);
|
Singletons.getModel().getGameAction().sacrifice(card, null);
|
||||||
this.n++;
|
this.n++;
|
||||||
list.remove(card);
|
list.remove(card);
|
||||||
|
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ public class MagicStack extends MyObservable {
|
|||||||
@Override
|
@Override
|
||||||
public void selectCard(final Card c, final PlayerZone zone) {
|
public void selectCard(final Card c, final PlayerZone zone) {
|
||||||
if (zone.is(ZoneType.Battlefield) && c.getController().isHuman() && c.isLand()) {
|
if (zone.is(ZoneType.Battlefield) && c.getController().isHuman() && c.isLand()) {
|
||||||
Singletons.getModel().getGameAction().sacrifice(c);
|
Singletons.getModel().getGameAction().sacrifice(c, null);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user