mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Tweak CountersPutRemoveEffect and add it to some cards
This commit is contained in:
committed by
Michael Kamensky
parent
8edf933392
commit
b7e902826a
@@ -16,28 +16,31 @@ import forge.game.player.Player;
|
||||
import forge.game.player.PlayerController;
|
||||
import forge.game.player.PlayerController.BinaryChoiceType;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.util.CardTranslation;
|
||||
import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* API for adding to or subtracting from existing counters on a target.
|
||||
* API for adding counters to or subtracting existing counters from a target.
|
||||
*
|
||||
*/
|
||||
public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(sa.getActivatingPlayer().getName());
|
||||
final Player pl = !sa.hasParam("DefinedPlayer") ? sa.getActivatingPlayer() :
|
||||
AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("DefinedPlayer"), sa).getFirst();
|
||||
sb.append(pl.getName());
|
||||
|
||||
if (sa.hasParam("CounterType")) {
|
||||
CounterType ctype = CounterType.getType(sa.getParam("CounterType"));
|
||||
sb.append(" removes a ").append(ctype.getName());
|
||||
sb.append(" counter from or put another ").append(ctype.getName()).append(" counter on ");
|
||||
sb.append(" puts a ").append(ctype.getName());
|
||||
sb.append(" counter on or removes a ").append(ctype.getName()).append(" counter from ");
|
||||
} else {
|
||||
sb.append(" removes a counter from or puts another of those counters on ");
|
||||
}
|
||||
|
||||
sb.append(Lang.joinHomogenous(getTargets(sa)));
|
||||
sb.append(Lang.joinHomogenous(getDefinedCardsOrTargeted(sa))).append(".");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -57,6 +60,10 @@ public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
||||
ctype = CounterType.getType(sa.getParam("CounterType"));
|
||||
}
|
||||
|
||||
final Player pl = !sa.hasParam("DefinedPlayer") ? sa.getActivatingPlayer() :
|
||||
AbilityUtils.getDefinedPlayers(source, sa.getParam("DefinedPlayer"), sa).getFirst();
|
||||
final boolean eachExisting = sa.hasParam("EachExistingCounter");
|
||||
|
||||
GameEntityCounterTable table = new GameEntityCounterTable();
|
||||
|
||||
for (final Card tgtCard : getDefinedCardsOrTargeted(sa)) {
|
||||
@@ -67,15 +74,22 @@ public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
||||
if (gameCard == null || !tgtCard.equalsWithTimestamp(gameCard)) {
|
||||
continue;
|
||||
}
|
||||
if (!eachExisting && sa.hasParam("Optional") && !pl.getController().confirmAction(sa, null,
|
||||
Localizer.getInstance().getMessage("lblWouldYouLikePutRemoveCounters", ctype.getName(),
|
||||
CardTranslation.getTranslatedName(gameCard.getName())))) {
|
||||
continue;
|
||||
}
|
||||
if (!sa.usesTargeting() || gameCard.canBeTargetedBy(sa)) {
|
||||
if (gameCard.hasCounters()) {
|
||||
if (sa.hasParam("EachExistingCounter")) {
|
||||
if (eachExisting) {
|
||||
for (CounterType listType : Lists.newArrayList(gameCard.getCounters().keySet())) {
|
||||
addOrRemoveCounter(sa, gameCard, listType, counterAmount, table);
|
||||
addOrRemoveCounter(sa, gameCard, listType, counterAmount, table, pl);
|
||||
}
|
||||
} else {
|
||||
addOrRemoveCounter(sa, gameCard, ctype, counterAmount, table);
|
||||
addOrRemoveCounter(sa, gameCard, ctype, counterAmount, table, pl);
|
||||
}
|
||||
} else if (!eachExisting && ctype != null) {
|
||||
gameCard.addCounter(ctype, counterAmount, pl, table);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,8 +97,7 @@ public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
||||
}
|
||||
|
||||
private void addOrRemoveCounter(final SpellAbility sa, final Card tgtCard, CounterType ctype,
|
||||
final int counterAmount, GameEntityCounterTable table) {
|
||||
final Player pl = sa.getActivatingPlayer();
|
||||
final int counterAmount, GameEntityCounterTable table, final Player pl) {
|
||||
final PlayerController pc = pl.getController();
|
||||
|
||||
Map<String, Object> params = Maps.newHashMap();
|
||||
@@ -100,12 +113,15 @@ public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
||||
|
||||
params.put("CounterType", chosenType);
|
||||
prompt = Localizer.getInstance().getMessage("lblWhatToDoWithTargetCounter", chosenType.getName()) + " ";
|
||||
Boolean putCounter = pc.chooseBinary(sa, prompt, BinaryChoiceType.AddOrRemove, params);
|
||||
boolean putCounter = pc.chooseBinary(sa, prompt, BinaryChoiceType.AddOrRemove, params);
|
||||
|
||||
if (putCounter) {
|
||||
tgtCard.addCounter(chosenType, counterAmount, pl, table);
|
||||
} else {
|
||||
tgtCard.subtractCounter(chosenType, counterAmount);
|
||||
if (sa.hasParam("RememberRemovedCards")) {
|
||||
sa.getHostCard().addRemembered(tgtCard);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ Name:Jhoira's Timebug
|
||||
ManaCost:2
|
||||
Types:Artifact Creature Insect
|
||||
PT:1/2
|
||||
A:AB$ AddOrRemoveCounter | Cost$ T | CounterNum$ 1 | ValidTgts$ Permanent.inZoneBattlefield+YouCtrl,Card.suspended+YouOwn | TgtPrompt$ Choose target permanent you control or suspended card you own | TgtZone$ Battlefield,Exile | ConditionDefined$ Targeted | ConditionPresent$ Card.counters_GE1_TIME | SpellDescription$ Choose target permanent you control or suspended card you own. If that permanent or card has a time counter on it, you may remove a time counter from it or put another time counter on it.
|
||||
A:AB$ AddOrRemoveCounter | Cost$ T | CounterNum$ 1 | CounterType$ TIME | ValidTgts$ Permanent.inZoneBattlefield+YouCtrl,Card.suspended+YouOwn | TgtPrompt$ Choose target permanent you control or suspended card you own | TgtZone$ Battlefield,Exile | ConditionDefined$ Targeted | ConditionPresent$ Card.counters_GE1_TIME | SpellDescription$ Choose target permanent you control or suspended card you own. If that permanent or card has a time counter on it, you may remove a time counter from it or put another time counter on it.
|
||||
DeckNeeds:Keyword$Suspend|Vanishing
|
||||
Oracle:{T}: Choose target permanent you control or suspended card you own. If that permanent or card has a time counter on it, you may remove a time counter from it or put another time counter on it.
|
||||
|
||||
@@ -2,15 +2,12 @@ Name:Lavabrink Floodgates
|
||||
ManaCost:3 R
|
||||
Types:Artifact
|
||||
A:AB$ Mana | Cost$ T | Produced$ R R | SpellDescription$ Add {R}{R}.
|
||||
T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ TrigDecide | TriggerDescription$ At the beginning of each player's upkeep, that player may put a doom counter on CARDNAME or remove a doom counter from it. Then if it has three or more doom counters on it, sacrifice CARDNAME. When you do, it deals 6 damage to each creature.
|
||||
SVar:TrigDecide:DB$ GenericChoice | Defined$ TriggeredPlayer | Choices$ PutCounter,RemoveCounter,DoNothing
|
||||
SVar:PutCounter:DB$ PutCounter | Defined$ Self | CounterType$ DOOM | CounterNum$ 1 | Placer$ TriggeredPlayer | SubAbility$ DBSac | SpellDescription$ Put a doom counter on CARDNAME
|
||||
SVar:RemoveCounter:DB$ RemoveCounter | Defined$ Self | CounterType$ DOOM | CounterNum$ 1 | SubAbility$ DBSac | SpellDescription$ Remove a doom counter from CARDNAME
|
||||
SVar:DoNothing:DB$ Pump | Defined$ Self | SubAbility$ DBSac | SpellDescription$ Do not change the number of doom counters on CARDNAME
|
||||
T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ TrigDoom | TriggerDescription$ At the beginning of each player's upkeep, that player may put a doom counter on CARDNAME or remove a doom counter from it. Then if it has three or more doom counters on it, sacrifice CARDNAME. When you do, it deals 6 damage to each creature.
|
||||
SVar:TrigDoom:DB$ AddOrRemoveCounter | Defined$ Self | DefinedPlayer$ TriggeredPlayer | CounterType$ DOOM | CounterNum$ 1 | Optional$ True | SubAbility$ DBSac
|
||||
SVar:DBSac:DB$ Sacrifice | SacValid$ Self | ConditionPresent$ Card.Self+counters_GE3_DOOM | RememberSacrificed$ True | SubAbility$ DBTrigger
|
||||
SVar:DBTrigger:DB$ ImmediateTrigger | Execute$ TrigDamage | RememberObjects$ RememberedCard | ConditionDefined$ Remembered | ConditionPresent$ Card | SubAbility$ DBCleanup | TriggerDescription$ When you do, it deals 6 damage to each creature.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:TrigDamage:DB$ DamageAll | ValidCards$ Creature | NumDmg$ 6
|
||||
AI:RemoveDeck:All
|
||||
DeckHas:Ability$Counters
|
||||
DeckHas:Ability$Counters|Sacrifice
|
||||
Oracle:{T}: Add {R}{R}.\nAt the beginning of each player's upkeep, that player may put a doom counter on Lavabrink Floodgates or remove a doom counter from it. Then if it has three or more doom counters on it, sacrifice Lavabrink Floodgates. When you do, it deals 6 damage to each creature.
|
||||
|
||||
@@ -3,10 +3,9 @@ ManaCost:3
|
||||
Types:Artifact
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ PutPlagueCounter | TriggerDescription$ At the beginning of your upkeep, put a plague counter on CARDNAME.
|
||||
SVar:PutPlagueCounter:DB$ PutCounter | Defined$ Self | CounterType$ PLAGUE | CounterNum$ 1
|
||||
A:AB$ GenericChoice | Cost$ 1 B G | Choices$ DBPutPlagueCounter,DBRemovePlagueCounter | SpellDescription$ Put a plague counter on CARDNAME or remove a plague counter from it.
|
||||
SVar:DBRemovePlagueCounter:DB$ RemoveCounter | Defined$ Self | CounterType$ PLAGUE | CounterNum$ 1 | SpellDescription$ Remove a plague counter on this card.
|
||||
SVar:DBPutPlagueCounter:DB$ PutCounter | Defined$ Self | CounterType$ PLAGUE | CounterNum$ 1 | SpellDescription$ Put a plague counter on this card.
|
||||
A:AB$ AddOrRemoveCounter | Cost$ 1 B G | Defined$ Self | CounterType$ PLAGUE | CounterNum$ 1 | SpellDescription$ Put a plague counter on CARDNAME or remove a plague counter from it.
|
||||
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Card.Self+counters_GE3_PLAGUE | Execute$ TrigDestroyAll | TriggerDescription$ When CARDNAME has three or more plague counters on it, sacrifice it. If you do, destroy all nonland permanents.
|
||||
SVar:TrigDestroyAll:AB$ DestroyAll | ValidCards$ Permanent.nonLand | Cost$ Mandatory Sac<1/CARDNAME>
|
||||
AI:RemoveDeck:All
|
||||
DeckHas:Ability$Counters|Sacrifice
|
||||
Oracle:At the beginning of your upkeep, put a plague counter on Plague Boiler.\n{1}{B}{G}: Put a plague counter on Plague Boiler or remove a plague counter from it.\nWhen Plague Boiler has three or more plague counters on it, sacrifice it. If you do, destroy all nonland permanents.
|
||||
|
||||
14
forge-gui/res/cardsfolder/upcoming/guile_sonic_soldier.txt
Normal file
14
forge-gui/res/cardsfolder/upcoming/guile_sonic_soldier.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Name:Guile, Sonic Soldier
|
||||
ManaCost:1 U R W
|
||||
Types:Legendary Creature Human Soldier
|
||||
PT:4/4
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharge | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, put a charge counter on him or remove one from him. When you remove a counter this way, ABILITY
|
||||
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigCharge | Secondary$ True | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, put a charge counter on him or remove one from him. When you remove a counter this way, ABILITY
|
||||
SVar:TrigCharge:DB$ AddOrRemoveCounter | Defined$ Self | CounterType$ CHARGE | CounterNum$ 1 | RememberRemovedCards$ True | SubAbility$ DBImmediateTrigger
|
||||
SVar:DBImmediateTrigger:DB$ ImmediateTrigger | ConditionDefined$ Remembered | ConditionPresent$ Card.Self | ConditionCompare$ GE1 | Execute$ TrigCharm | SubAbility$ DBCleanup | TriggerDescription$ When you remove a counter this way, ABILITY
|
||||
SVar:TrigCharm:DB$ Charm | Choices$ DBDamage,DBPump
|
||||
SVar:DBDamage:DB$ DealDamage | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ 4 | SpellDescription$ CARDNAME deals 4 damage to any target.
|
||||
SVar:DBPump:DB$ Pump | Defined$ Self | KW$ Lifelink & Indestructible | SpellDescription$ CARDNAME gains lifelink and indestructible until end of turn.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
DeckHas:Ability$Counters|LifeGain
|
||||
Oracle:Whenever Guile, Sonic Soldier enters the battlefield or attacks, put a charge counter on him or remove one from him. When you remove a counter this way, choose one—\n• Sonic Boom — Guile, Sonic Soldier deals 4 damage to any target.\n• Flash Kick — Guile, Sonic Soldier gains lifelink and indestructible until end of turn.
|
||||
@@ -1908,6 +1908,7 @@ lblHowManyCountersThis=Wie viele Marken möchtest du auf {0} legen?
|
||||
lblChooseAnOpponent=Wähle Gegner
|
||||
lblDoYouWantPutTargetP1P1CountersOnCard=Möchtest du {0} +1/+1-Marken auf {1} legen?
|
||||
#CountersPutOrRemoveEffect.java
|
||||
lblWouldYouLikePutRemoveCounters=Would you like to add ''{0}'' counters to or remove ''{0}'' counters from {1}?
|
||||
lblSelectCounterTypeToAddOrRemove=Wähle Marken-Typ fürs Hinzufügen/Entfernen
|
||||
lblWhatToDoWithTargetCounter=Was soll getan werden mit dieser '%s'-Marke
|
||||
#CountersRemoveEffect.java
|
||||
|
||||
@@ -1909,8 +1909,9 @@ lblHowManyCountersThis=How many counters do you want to put on {0}?
|
||||
lblChooseAnOpponent=Choose an opponent
|
||||
lblDoYouWantPutTargetP1P1CountersOnCard=Do you want to put {0} +1/+1 counters on {1}?
|
||||
#CountersPutOrRemoveEffect.java
|
||||
lblWouldYouLikePutRemoveCounters=Would you like to add ''{0}'' counters to or remove ''{0}'' counters from {1}?
|
||||
lblSelectCounterTypeToAddOrRemove=Select type of counters to add or remove
|
||||
lblWhatToDoWithTargetCounter=What to do with that ''{0}'' counter
|
||||
lblWhatToDoWithTargetCounter=Choose what to do with ''{0}'' counter
|
||||
#CountersRemoveEffect.java
|
||||
lblAllCounters=all counters
|
||||
lblACounters=a counter
|
||||
|
||||
@@ -1907,6 +1907,7 @@ lblHowManyCountersThis=¿Cuántos contadores quieres poner en {0}?
|
||||
lblChooseAnOpponent=Elige un adversario
|
||||
lblDoYouWantPutTargetP1P1CountersOnCard=¿Quieres poner {0} contadores +1/+1 en {1}?
|
||||
#CountersPutOrRemoveEffect.java
|
||||
lblWouldYouLikePutRemoveCounters=¿Quieres añadir contadores ''{0}'' o eliminar contadores ''{0}'' de {1}?
|
||||
lblSelectCounterTypeToAddOrRemove=Selecciona el tipo de contadores a añadir o eliminar
|
||||
lblWhatToDoWithTargetCounter=Qué hacer con ese contador ''{0}''
|
||||
#CountersRemoveEffect.java
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
language.name=Italiano (IT)
|
||||
language.name=Italiano (IT)
|
||||
#SplashScreen.java
|
||||
splash.loading.examining-cards=Caricamento delle carte, esame della cartella
|
||||
splash.loading.cards-folders=Caricamento delle carte dalle cartelle
|
||||
@@ -1906,6 +1906,7 @@ lblHowManyCountersThis=Quanti segnalini vuoi aggiungere a {0}?
|
||||
lblChooseAnOpponent=Scegli un avversario
|
||||
lblDoYouWantPutTargetP1P1CountersOnCard=Vuoi aggiungere {0} segnalino/i +1/+1 a {1}?
|
||||
#CountersPutOrRemoveEffect.java
|
||||
lblWouldYouLikePutRemoveCounters=Would you like to add ''{0}'' counters to or remove ''{0}'' counters from {1}?
|
||||
lblSelectCounterTypeToAddOrRemove=Scegli il tipo di segnalini da aggiungere o rimuovere
|
||||
lblWhatToDoWithTargetCounter=Cosa fare con quel segnalino ''{0}''
|
||||
#CountersRemoveEffect.java
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
language.name=Japanese (JP)
|
||||
language.name=Japanese (JP)
|
||||
#SplashScreen.java
|
||||
splash.loading.examining-cards=カードを読み込んで、フォルダを調べます
|
||||
splash.loading.cards-folders=フォルダーからのカードのロード
|
||||
@@ -1906,6 +1906,7 @@ lblHowManyCounters={0}に何個のカウンターを置きますか?
|
||||
lblChooseAnOpponent=対戦相手一人を選ぶ
|
||||
lblDoYouWantPutTargetP1P1CountersOnCard={1}の上に {0}個の +1/+1 カウンターを置きますか?
|
||||
#CountersPutOrRemoveEffect.java
|
||||
lblWouldYouLikePutRemoveCounters=Would you like to add ''{0}'' counters to or remove ''{0}'' counters from {1}?
|
||||
lblSelectCounterTypeToAddOrRemove=置ける/取り除くカウンターの種類を選ぶ
|
||||
lblWhatToDoWithTargetCounter=「{0}」カウンターをどうしますか?
|
||||
#CountersRemoveEffect.java
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
language.name=Chinese (CN)
|
||||
language.name=Chinese (CN)
|
||||
#SplashScreen.java
|
||||
splash.loading.examining-cards=加载卡牌,检查文件夹
|
||||
splash.loading.cards-folders=从文件夹加载卡牌
|
||||
@@ -1910,6 +1910,7 @@ lblHowManyCountersThis=你想要在{0}上放置多少个指示物?
|
||||
lblChooseAnOpponent=选择一个对手
|
||||
lblDoYouWantPutTargetP1P1CountersOnCard=你想要放置{0}个+1+1指示物到{1}吗?
|
||||
#CountersPutOrRemoveEffect.java
|
||||
lblWouldYouLikePutRemoveCounters=Would you like to add ''{0}'' counters to or remove ''{0}'' counters from {1}?
|
||||
lblSelectCounterTypeToAddOrRemove=选择要添加或移除的指示物的类型
|
||||
lblWhatToDoWithTargetCounter=如何使用''{0}''指示物
|
||||
#CountersRemoveEffect.java
|
||||
|
||||
Reference in New Issue
Block a user