mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Clean up
This commit is contained in:
@@ -184,7 +184,7 @@ public class Game {
|
|||||||
public Player getHasInitiative() {
|
public Player getHasInitiative() {
|
||||||
return initiative;
|
return initiative;
|
||||||
}
|
}
|
||||||
public void setHasInitiative(final Player p ) {
|
public void setHasInitiative(final Player p) {
|
||||||
initiative = p;
|
initiative = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -606,7 +606,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
if (sa.hasParam("GainControl")) {
|
if (sa.hasParam("GainControl")) {
|
||||||
final String g = sa.getParam("GainControl");
|
final String g = sa.getParam("GainControl");
|
||||||
Player newController = g.equals("True") ? player :
|
Player newController = g.equals("True") ? player :
|
||||||
AbilityUtils.getDefinedPlayers(sa.getHostCard(), g, sa).get(0);
|
AbilityUtils.getDefinedPlayers(hostCard, g, sa).get(0);
|
||||||
if (newController != null) {
|
if (newController != null) {
|
||||||
if (newController != gameCard.getController()) {
|
if (newController != gameCard.getController()) {
|
||||||
gameCard.runChangeControllerCommands();
|
gameCard.runChangeControllerCommands();
|
||||||
@@ -1318,7 +1318,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
if (sa.hasParam("GainControl")) {
|
if (sa.hasParam("GainControl")) {
|
||||||
final String g = sa.getParam("GainControl");
|
final String g = sa.getParam("GainControl");
|
||||||
Player newController = g.equals("True") ? sa.getActivatingPlayer() :
|
Player newController = g.equals("True") ? sa.getActivatingPlayer() :
|
||||||
AbilityUtils.getDefinedPlayers(sa.getHostCard(), g, sa).get(0);
|
AbilityUtils.getDefinedPlayers(source, g, sa).get(0);
|
||||||
if (newController != c.getController()) {
|
if (newController != c.getController()) {
|
||||||
c.runChangeControllerCommands();
|
c.runChangeControllerCommands();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,7 @@ public class DamageDealEffect extends DamageBaseEffect {
|
|||||||
// when damageStackDescription is called, just build exactly what is happening
|
// when damageStackDescription is called, just build exactly what is happening
|
||||||
final StringBuilder stringBuilder = new StringBuilder();
|
final StringBuilder stringBuilder = new StringBuilder();
|
||||||
final String damage = spellAbility.getParam("NumDmg");
|
final String damage = spellAbility.getParam("NumDmg");
|
||||||
int dmg;
|
int dmg = AbilityUtils.calculateAmount(spellAbility.getHostCard(), damage, spellAbility);
|
||||||
try { // try-catch to fix Volcano Hellion Crash
|
|
||||||
dmg = AbilityUtils.calculateAmount(spellAbility.getHostCard(), damage, spellAbility);
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
dmg = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<GameObject> targets = SpellAbilityEffect.getTargets(spellAbility);
|
List<GameObject> targets = SpellAbilityEffect.getTargets(spellAbility);
|
||||||
final List<Card> definedSources = AbilityUtils.getDefinedCards(spellAbility.getHostCard(), spellAbility.getParam("DamageSource"), spellAbility);
|
final List<Card> definedSources = AbilityUtils.getDefinedCards(spellAbility.getHostCard(), spellAbility.getParam("DamageSource"), spellAbility);
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
|
|
||||||
Card chosenCard = player.getController().chooseSingleCardForZoneChange(ZoneType.None, new ArrayList<ZoneType>(), sa, new CardCollection(draftOptions), null, Localizer.getInstance().getMessage("lblChooseCardDraft"), false, player);
|
Card chosenCard = player.getController().chooseSingleCardForZoneChange(ZoneType.None, new ArrayList<ZoneType>(), sa, new CardCollection(draftOptions), null, Localizer.getInstance().getMessage("lblChooseCardDraft"), false, player);
|
||||||
chosenCard.setTokenCard(true);
|
|
||||||
game.getAction().moveTo(ZoneType.None, chosenCard, sa, moveParams);
|
game.getAction().moveTo(ZoneType.None, chosenCard, sa, moveParams);
|
||||||
drafted.add(chosenCard);
|
drafted.add(chosenCard);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,8 +87,7 @@ public class MakeCardEffect extends SpellAbilityEffect {
|
|||||||
int toMake = amount;
|
int toMake = amount;
|
||||||
if (!name.equals("")) {
|
if (!name.equals("")) {
|
||||||
while (toMake > 0) {
|
while (toMake > 0) {
|
||||||
Card card = Card.fromPaperCard(StaticData.instance().getCommonCards().getUniqueByName(name),
|
Card card = Card.fromPaperCard(StaticData.instance().getCommonCards().getUniqueByName(name), player);
|
||||||
player);
|
|
||||||
if (sa.hasParam("TokenCard")) {
|
if (sa.hasParam("TokenCard")) {
|
||||||
card.setTokenCard(true);
|
card.setTokenCard(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,11 +80,6 @@ public class TriggerDamagePrevented extends Trigger {
|
|||||||
if (!Expressions.compare(actualAmount, operator, operand)) {
|
if (!Expressions.compare(actualAmount, operator, operand)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.print("DamageDone Amount Operator: ");
|
|
||||||
System.out.println(operator);
|
|
||||||
System.out.print("DamageDone Amount Operand: ");
|
|
||||||
System.out.println(operand);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -75,11 +75,6 @@ public class TriggerDamagePreventedOnce extends Trigger {
|
|||||||
if (!Expressions.compare(actualAmount, operator, operand)) {
|
if (!Expressions.compare(actualAmount, operator, operand)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.print("DamageDone Amount Operator: ");
|
|
||||||
System.out.println(operator);
|
|
||||||
System.out.print("DamageDone Amount Operand: ");
|
|
||||||
System.out.println(operand);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -440,7 +440,8 @@ public class SpellAbilityPickerSimulationTest extends SimulationTest {
|
|||||||
AssertJUnit.assertEquals(blocker, sa.getTargetCard());
|
AssertJUnit.assertEquals(blocker, sa.getTargetCard());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
// Run the test 100 times to ensure there's no flakiness.
|
||||||
|
@Test(invocationCount = 100)
|
||||||
public void testChoicesResultingFromRandomEffects() {
|
public void testChoicesResultingFromRandomEffects() {
|
||||||
// Sometimes, the effect of a spell can be random, and as a result of that, new choices
|
// Sometimes, the effect of a spell can be random, and as a result of that, new choices
|
||||||
// could be selected during simulation. This test verifies that this doesn't cause problems.
|
// could be selected during simulation. This test verifies that this doesn't cause problems.
|
||||||
@@ -449,8 +450,6 @@ public class SpellAbilityPickerSimulationTest extends SimulationTest {
|
|||||||
// seed during choice evaluation, although in the future, it may make sense to handle it
|
// seed during choice evaluation, although in the future, it may make sense to handle it
|
||||||
// some other way.
|
// some other way.
|
||||||
|
|
||||||
// Run the test 100 times to ensure there's no flakiness.
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
Game game = initAndCreateGame();
|
Game game = initAndCreateGame();
|
||||||
Player p = game.getPlayers().get(1);
|
Player p = game.getPlayers().get(1);
|
||||||
Player opponent = game.getPlayers().get(0);
|
Player opponent = game.getPlayers().get(0);
|
||||||
@@ -484,5 +483,4 @@ public class SpellAbilityPickerSimulationTest extends SimulationTest {
|
|||||||
AssertJUnit.assertEquals("Chaos Warp", sa.getHostCard().getName());
|
AssertJUnit.assertEquals("Chaos Warp", sa.getHostCard().getName());
|
||||||
AssertJUnit.assertEquals(expectedTarget, sa.getTargetCard());
|
AssertJUnit.assertEquals(expectedTarget, sa.getTargetCard());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ TrigPump | Secondary$ True | Tr
|
|||||||
SVar:TrigPump:DB$ PumpAll | ValidCards$ Rat.Other+YouCtrl | NumAtt$ +X | NumDef$ +X
|
SVar:TrigPump:DB$ PumpAll | ValidCards$ Rat.Other+YouCtrl | NumAtt$ +X | NumDef$ +X
|
||||||
SVar:X:Count$Valid Rat.YouCtrl
|
SVar:X:Count$Valid Rat.YouCtrl
|
||||||
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ At the beginning of your end step, you may mill four cards. If you do, return up to two Rat creature cards from your graveyard to your hand. (To mill a card, put the top card of your library into your graveyard.)
|
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ At the beginning of your end step, you may mill four cards. If you do, return up to two Rat creature cards from your graveyard to your hand. (To mill a card, put the top card of your library into your graveyard.)
|
||||||
SVar:TrigChange:AB$ ChangeZone | Cost$ Mill<4> | Origin$ Graveyard | Destination$ Hand | ChangeType$ Rat.Creature+YouOwn | ChangeNum$ 2 | SelectPrompt$ Select up to two Rat creature cards
|
SVar:TrigChange:AB$ ChangeZone | Cost$ Mill<4> | Origin$ Graveyard | Destination$ Hand | ChangeType$ Rat.Creature+YouOwn | ChangeNum$ 2 | Hidden$ True | SelectPrompt$ Select up to two Rat creature cards
|
||||||
SVar:HasAttackEffect:TRUE
|
SVar:HasAttackEffect:TRUE
|
||||||
SVar:HasBlockEffect:TRUE
|
SVar:HasBlockEffect:TRUE
|
||||||
DeckNeeds:Type$Rat
|
DeckNeeds:Type$Rat
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Name:Hunter's Insight
|
Name:Hunter's Insight
|
||||||
ManaCost:2 G
|
ManaCost:2 G
|
||||||
Types:Instant
|
Types:Instant
|
||||||
A:SP$ Effect | ValidTgts$ Creature | TgtPrompt$ Select target creature | Triggers$ TrigDamage | RememberObjects$ Targeted | SpellDescription$ Choose target creature you control. Whenever that creature deals combat damage to a player or planeswalker this turn, draw that many cards.
|
A:SP$ Effect | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature | Triggers$ TrigDamage | RememberObjects$ Targeted | SpellDescription$ Choose target creature you control. Whenever that creature deals combat damage to a player or planeswalker this turn, draw that many cards.
|
||||||
SVar:TrigDamage:Mode$ DamageDone | ValidSource$ Creature.IsRemembered | ValidTarget$ Player,Planeswalker | Execute$ TrigDraw | CombatDamage$ True | TriggerDescription$ Whenever that creature deals combat damage to a player or planeswalker this turn, draw that many cards.
|
SVar:TrigDamage:Mode$ DamageDone | ValidSource$ Creature.IsRemembered | ValidTarget$ Player,Planeswalker | Execute$ TrigDraw | CombatDamage$ True | TriggerDescription$ Whenever that creature deals combat damage to a player or planeswalker this turn, draw that many cards.
|
||||||
SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ X
|
SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ X
|
||||||
SVar:X:TriggerCount$DamageAmount
|
SVar:X:TriggerCount$DamageAmount
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Name:Mandate of Abaddon
|
Name:Mandate of Abaddon
|
||||||
ManaCost:3 B
|
ManaCost:3 B
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ ChooseCard | Choices$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBDestroyAll | SpellDescription$ Choose target creature you control. Destroy all creatures with power less than that creature's power.
|
A:SP$ ChooseCard | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBDestroyAll | SpellDescription$ Choose target creature you control. Destroy all creatures with power less than that creature's power.
|
||||||
SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Creature.powerLTX
|
SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Creature.powerLTX
|
||||||
SVar:X:Targeted$CardPower
|
SVar:X:Targeted$CardPower
|
||||||
Oracle:Choose target creature you control. Destroy all creatures with power less than that creature's power.
|
Oracle:Choose target creature you control. Destroy all creatures with power less than that creature's power.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Loyalty:4
|
|||||||
S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ Battlefield | GainsAbilitiesOf$ Planeswalker.Other | GainsValidAbilities$ Activated.Loyalty | Description$ CARDNAME has all loyalty abilities of all other planeswalkers on the battlefield.
|
S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ Battlefield | GainsAbilitiesOf$ Planeswalker.Other | GainsValidAbilities$ Activated.Loyalty | Description$ CARDNAME has all loyalty abilities of all other planeswalkers on the battlefield.
|
||||||
A:AB$ Draw | Cost$ AddCounter<1/LOYALTY> | NumCards$ 1 | SubAbility$ DBChangeZone | Planeswalker$ True | SpellDescription$ You draw a card. Each opponent exiles a card from their hand or a permanent they control.
|
A:AB$ Draw | Cost$ AddCounter<1/LOYALTY> | NumCards$ 1 | SubAbility$ DBChangeZone | Planeswalker$ True | SpellDescription$ You draw a card. Each opponent exiles a card from their hand or a permanent they control.
|
||||||
SVar:DBChangeZone:DB$ ChangeZone | Origin$ Battlefield,Hand | Destination$ Exile | DefinedPlayer$ Player.Opponent | ChangeType$ Card | ChangeNum$ 1 | Mandatory$ True
|
SVar:DBChangeZone:DB$ ChangeZone | Origin$ Battlefield,Hand | Destination$ Exile | DefinedPlayer$ Player.Opponent | ChangeType$ Card | ChangeNum$ 1 | Mandatory$ True
|
||||||
AI:RemoveDeck:Random
|
|
||||||
A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | Planeswalker$ True | SpellDescription$ Destroy target creature or planeswalker.
|
A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | Planeswalker$ True | SpellDescription$ Destroy target creature or planeswalker.
|
||||||
A:AB$ LosesGame | Cost$ SubCounter<8/LOYALTY> | Defined$ Player.Opponent+controlsLegendary.Creature_EQ0+controlsPlaneswalker_LE0 | Planeswalker$ True | Ultimate$ True | SpellDescription$ Each opponent who doesn't control a legendary creature or planeswalker loses the game.
|
A:AB$ LosesGame | Cost$ SubCounter<8/LOYALTY> | Defined$ Player.Opponent+controlsLegendary.Creature_EQ0+controlsPlaneswalker_LE0 | Planeswalker$ True | Ultimate$ True | SpellDescription$ Each opponent who doesn't control a legendary creature or planeswalker loses the game.
|
||||||
|
AI:RemoveDeck:Random
|
||||||
Oracle:Nicol Bolas, Dragon-God has all loyalty abilities of all other planeswalkers on the battlefield.\n[+1]: You draw a card. Each opponent exiles a card from their hand or a permanent they control.\n[-3]: Destroy target creature or planeswalker.\n[-8]: Each opponent who doesn't control a legendary creature or planeswalker loses the game.
|
Oracle:Nicol Bolas, Dragon-God has all loyalty abilities of all other planeswalkers on the battlefield.\n[+1]: You draw a card. Each opponent exiles a card from their hand or a permanent they control.\n[-3]: Destroy target creature or planeswalker.\n[-8]: Each opponent who doesn't control a legendary creature or planeswalker loses the game.
|
||||||
|
|||||||
Reference in New Issue
Block a user