mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Add confirm when discarding hand as payment
This commit is contained in:
@@ -9,16 +9,6 @@ import forge.game.spellability.SpellAbility;
|
||||
|
||||
public class LifeExchangeEffect extends SpellAbilityEffect {
|
||||
|
||||
// *************************************************************************
|
||||
// ************************ EXCHANGE LIFE **********************************
|
||||
// *************************************************************************
|
||||
|
||||
|
||||
|
||||
// *************************************************************************
|
||||
// ************************* LOSE LIFE *************************************
|
||||
// *************************************************************************
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||
*/
|
||||
@@ -28,7 +18,6 @@ public class LifeExchangeEffect extends SpellAbilityEffect {
|
||||
final Player activatingPlayer = sa.getActivatingPlayer();
|
||||
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||
|
||||
|
||||
if (tgtPlayers.size() == 1) {
|
||||
sb.append(activatingPlayer).append(" exchanges life totals with ");
|
||||
sb.append(tgtPlayers.get(0));
|
||||
@@ -78,7 +67,6 @@ public class LifeExchangeEffect extends SpellAbilityEffect {
|
||||
} else {
|
||||
// they are equal, so nothing to do
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,16 +12,6 @@ import forge.game.zone.ZoneType;
|
||||
|
||||
public class LifeExchangeVariantEffect extends SpellAbilityEffect {
|
||||
|
||||
// *************************************************************************
|
||||
// ************************ EXCHANGE LIFE **********************************
|
||||
// *************************************************************************
|
||||
|
||||
|
||||
|
||||
// *************************************************************************
|
||||
// ************************* LOSE LIFE *************************************
|
||||
// *************************************************************************
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||
*/
|
||||
@@ -88,7 +78,7 @@ public class LifeExchangeVariantEffect extends SpellAbilityEffect {
|
||||
source.addNewPT(power, toughness, timestamp);
|
||||
game.fireEvent(new GameEventCardStatsChanged(source));
|
||||
} else {
|
||||
// do nothing if they are equal
|
||||
// do nothing if they are equal
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,7 @@ Types:Creature Human Warrior
|
||||
PT:1/1
|
||||
K:Intimidate
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | Execute$ TrigDiscard | CombatDamage$ True | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may discard a card. If you do, draw a card.
|
||||
SVar:TrigDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | RememberDiscarded$ True | SubAbility$ DBDraw
|
||||
SVar:DBDraw:DB$ Draw | NumCards$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:TrigDiscard:AB$ Draw | NumCards$ 1 | Cost$ Discard<1/Card>
|
||||
AI:RemoveDeck:Random
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/academy_raider.jpg
|
||||
Oracle:Intimidate (This creature can't be blocked except by artifact creatures and/or creatures that share a color with it.)\nWhenever Academy Raider deals combat damage to a player, you may discard a card. If you do, draw a card.
|
||||
|
||||
@@ -2,5 +2,5 @@ Name:Assassin's Trophy
|
||||
ManaCost:B G
|
||||
Types:Instant
|
||||
A:SP$ Destroy | Cost$ B G | ValidTgts$ Permanent.OppCtrl | AITgts$ Permanent.nonLand,Land.nonBasic | TgtPrompt$ Select target permanent an opponent controls | SubAbility$ DBChange | SpellDescription$ Destroy target permanent an opponent controls. Its controller may search their library for a basic land card, put it onto the battlefield, then shuffle.
|
||||
SVar:DBChange:DB$ ChangeZone | Optional$ True | Origin$ Library | Destination$ Battlefield | DefinedPlayer$ TargetedController | ChangeType$ Land.Basic | ChangeNum$ 1 | DefinedPlayer$ TargetedController | ShuffleNonMandatory$ True
|
||||
SVar:DBChange:DB$ ChangeZone | Optional$ True | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ 1 | DefinedPlayer$ TargetedController | ShuffleNonMandatory$ True
|
||||
Oracle:Destroy target permanent an opponent controls. Its controller may search their library for a basic land card, put it onto the battlefield, then shuffle.
|
||||
|
||||
@@ -4,10 +4,8 @@ Types:Creature Beast
|
||||
PT:4/5
|
||||
K:Trample
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | Execute$ TrigDiscard | CombatDamage$ True | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may discard all the cards in your hand. If you do, draw that many cards.
|
||||
SVar:TrigDiscard:DB$ Discard | Mode$ Hand | RememberDiscarded$ True | SubAbility$ DBDraw
|
||||
SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ X | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$Amount
|
||||
SVar:TrigDiscard:AB$ Draw | Cost$ Discard<1/Hand> | NumCards$ X
|
||||
SVar:X:Discarded$Amount
|
||||
DeckHas:Ability$Discard
|
||||
DeckHints:Keyword$Madness & Ability$Delirium
|
||||
Oracle:Trample\nWhenever Book Devourer deals combat damage to a player, you may discard all the cards in your hand. If you do, draw that many cards.
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Ride Down
|
||||
ManaCost:R W
|
||||
Types:Instant
|
||||
A:SP$ Pump | Cost$ R W | ValidTgts$ Creature.blocking | RememberObjects$ Targeted | TgtPrompt$ Select target blocking creature | SubAbility$ DBDestroy | SpellDescription$ Destroy target blocking creature. Creatures that were blocked by that creature this combat gain trample until end of turn. | StackDescription$ SpellDescription
|
||||
SVar:DBDestroy:DB$ Destroy | Defined$ Remembered | RememberLKI$ True | SubAbility$ DBPump | StackDescription$ None
|
||||
SVar:DBDestroy:DB$ Destroy | Defined$ Remembered | SubAbility$ DBPump | StackDescription$ None
|
||||
SVar:DBPump:DB$ PumpAll | ValidCards$ Creature.blockedByRemembered | KW$ Trample | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/ride_down.jpg
|
||||
|
||||
@@ -85,6 +85,9 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
if (discardType.equals("Hand")) {
|
||||
if (!controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantDiscardYourHand"), ability)) {
|
||||
return null;
|
||||
}
|
||||
if (hand.size() > 1 && ability.getActivatingPlayer() != null) {
|
||||
hand = ability.getActivatingPlayer().getController().orderMoveToZoneList(hand, ZoneType.Graveyard, ability);
|
||||
}
|
||||
@@ -205,7 +208,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
}
|
||||
|
||||
if (!player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblDrawNCardsConfirm", String.valueOf(c)), ability)) {
|
||||
if (!controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDrawNCardsConfirm", String.valueOf(c)), ability)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -240,7 +243,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
return source.getZone() == player.getZone(cost.from) && player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblExileConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
return source.getZone() == player.getZone(cost.from) && controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblExileConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
|
||||
if (type.equals("All")) {
|
||||
@@ -366,7 +369,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
private PaymentDecision exileFromTop(final CostExile cost, final SpellAbility sa, final Player player, final int nNeeded) {
|
||||
final CardCollectionView list = player.getCardsIn(ZoneType.Library, nNeeded);
|
||||
|
||||
if (list.size() > nNeeded || !player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblExileNCardFromYourTopLibraryConfirm"), ability)) {
|
||||
if (list.size() > nNeeded || !controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblExileNCardFromYourTopLibraryConfirm"), ability)) {
|
||||
return null;
|
||||
}
|
||||
return PaymentDecision.card(list);
|
||||
@@ -434,7 +437,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
if (source.getController() == ability.getActivatingPlayer() && source.isInPlay()) {
|
||||
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblExertCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
return controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblExertCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -470,7 +473,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
}
|
||||
|
||||
if (!player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantFlipNCoinAction", String.valueOf(c)), ability)) {
|
||||
if (!controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantFlipNCoinAction", String.valueOf(c)), ability)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -486,7 +489,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
}
|
||||
|
||||
if (!player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantRollNDiceAction", String.valueOf(c), "d" + cost.getType()), ability)) {
|
||||
if (!controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantRollNDiceAction", String.valueOf(c), "d" + cost.getType()), ability)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -551,7 +554,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
}
|
||||
|
||||
if (!player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblMillNCardsFromYourLibraryConfirm", String.valueOf(c)), ability)) {
|
||||
if (!controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblMillNCardsFromYourLibraryConfirm", String.valueOf(c)), ability)) {
|
||||
return null;
|
||||
}
|
||||
return PaymentDecision.number(c);
|
||||
@@ -567,7 +570,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
// for costs declared mandatory, this is only reachable with a valid amount
|
||||
if (ability.getPayCosts().isMandatory() || (player.canPayLife(c) && player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblPayNLifeConfirm", String.valueOf(c)), ability))) {
|
||||
if (ability.getPayCosts().isMandatory() || (player.canPayLife(c) && controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblPayNLifeConfirm", String.valueOf(c)), ability))) {
|
||||
return PaymentDecision.number(c);
|
||||
}
|
||||
return null;
|
||||
@@ -583,7 +586,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
if (player.canPayEnergy(c) &&
|
||||
player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblPayEnergyConfirm", cost.toString(), String.valueOf(player.getCounters(CounterEnumType.ENERGY)), "{E}"), ability)) {
|
||||
controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblPayEnergyConfirm", cost.toString(), String.valueOf(player.getCounters(CounterEnumType.ENERGY)), "{E}"), ability)) {
|
||||
return PaymentDecision.number(c);
|
||||
}
|
||||
return null;
|
||||
@@ -608,7 +611,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
player.getCardsIn(cost.getFrom()), cost.getType().split(";"), player, source, ability);
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
return source.getZone() == player.getZone(cost.from) && player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblPutCardToLibraryConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
return source.getZone() == player.getZone(cost.from) && controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblPutCardToLibraryConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
|
||||
if (cost.from == ZoneType.Hand) {
|
||||
@@ -718,7 +721,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
final Card card = ability.getHostCard();
|
||||
if (card.getController() == player && card.isInPlay()) {
|
||||
final CardView view = CardView.get(card);
|
||||
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName())), ability) ? PaymentDecision.card(card) : null;
|
||||
return controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName())), ability) ? PaymentDecision.card(card) : null;
|
||||
}
|
||||
} else {
|
||||
final CardCollectionView validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(ZoneType.Battlefield),
|
||||
@@ -966,7 +969,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
if (maxCounters < cntRemoved) {
|
||||
return null;
|
||||
}
|
||||
if (!player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm", amount, cost.counter.getName().toLowerCase(), CardTranslation.getTranslatedName(source.getName())), ability)) {
|
||||
if (!controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm", amount, cost.counter.getName().toLowerCase(), CardTranslation.getTranslatedName(source.getName())), ability)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1022,7 +1025,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
if (source.getController() == ability.getActivatingPlayer() && source.isInPlay()) {
|
||||
return ability.getPayCosts().isMandatory() || player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
return ability.getPayCosts().isMandatory() || controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1030,7 +1033,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
if (type.equals("OriginalHost")) {
|
||||
Card host = ability.getOriginalHost();
|
||||
if (host.getController() == ability.getActivatingPlayer() && host.isInPlay()) {
|
||||
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(host.getName())), ability) ? PaymentDecision.card(host) : null;
|
||||
return controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(host.getName())), ability) ? PaymentDecision.card(host) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1200,7 +1203,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
@Override
|
||||
public PaymentDecision visit(final CostUnattach cost) {
|
||||
final Card cardToUnattach = cost.findCardToUnattach(source, player, ability);
|
||||
if (cardToUnattach != null && player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblUnattachCardConfirm", CardTranslation.getTranslatedName(cardToUnattach.getName())), ability)) {
|
||||
if (cardToUnattach != null && controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblUnattachCardConfirm", CardTranslation.getTranslatedName(cardToUnattach.getName())), ability)) {
|
||||
return PaymentDecision.card(cardToUnattach);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user