mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Various fixed. +3 tests passed.
This commit is contained in:
parent
c761c62a3e
commit
a47b8c25df
17 changed files with 156 additions and 96 deletions
|
@ -396,6 +396,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
||||||
targets = threats(opponentId, source.getSourceId(), ((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), game, target.getTargets());
|
targets = threats(opponentId, source.getSourceId(), ((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), game, target.getTargets());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targets.isEmpty()) {
|
||||||
if (outcome.isGood()) {
|
if (outcome.isGood()) {
|
||||||
if (target.canTarget(playerId, source, game)) {
|
if (target.canTarget(playerId, source, game)) {
|
||||||
target.addTarget(playerId, source, game);
|
target.addTarget(playerId, source, game);
|
||||||
|
@ -408,6 +409,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (targets.isEmpty() && target.isRequired()) {
|
if (targets.isEmpty() && target.isRequired()) {
|
||||||
targets = game.getBattlefield().getActivePermanents(((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), playerId, game);
|
targets = game.getBattlefield().getActivePermanents(((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), playerId, game);
|
||||||
|
@ -422,6 +424,19 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outcome.isGood()) {
|
||||||
|
if (target.canTarget(playerId, source, game)) {
|
||||||
|
target.addTarget(playerId, source, game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (target.canTarget(opponentId, source, game)) {
|
||||||
|
target.addTarget(opponentId, source, game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!target.isRequired())
|
if (!target.isRequired())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1501,12 +1516,12 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
||||||
protected List<Permanent> threats(UUID playerId, UUID sourceId, FilterPermanent filter, Game game, List<UUID> targets) {
|
protected List<Permanent> threats(UUID playerId, UUID sourceId, FilterPermanent filter, Game game, List<UUID> targets) {
|
||||||
List<Permanent> threats = playerId == null ?
|
List<Permanent> threats = playerId == null ?
|
||||||
game.getBattlefield().getAllActivePermanents(filter) :
|
game.getBattlefield().getAllActivePermanents(filter) :
|
||||||
game.getBattlefield().getAllActivePermanents(filter, playerId);
|
game.getBattlefield().getActivePermanents(filter, playerId, sourceId, game);
|
||||||
|
|
||||||
Iterator<Permanent> it = threats.iterator();
|
Iterator<Permanent> it = threats.iterator();
|
||||||
while (it.hasNext()) { // remove permanents already targeted
|
while (it.hasNext()) { // remove permanents already targeted
|
||||||
Permanent test = it.next();
|
Permanent test = it.next();
|
||||||
if (targets.contains(test.getId()))
|
if (targets.contains(test.getId()) || (playerId != null && !test.getControllerId().equals(playerId)))
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
Collections.sort(threats, new PermanentComparator(game));
|
Collections.sort(threats, new PermanentComparator(game));
|
||||||
|
|
|
@ -1,19 +1,72 @@
|
||||||
NAME:RB Aggro
|
NAME:RB Aggro
|
||||||
4 [ALA:156] Blightning
|
1 [GUR:3] Mountain
|
||||||
2 [ZEN:245] Mountain
|
1 [SHM:296] Mountain
|
||||||
2 [ZEN:244] Mountain
|
1 [AVR:240] Mountain
|
||||||
2 [ZEN:243] Mountain
|
1 [SHM:295] Mountain
|
||||||
2 [ZEN:242] Mountain
|
1 [SHM:294] Mountain
|
||||||
4 [ZEN:223] Scalding Tarn
|
1 [TSP:295] Mountain
|
||||||
4 [M10:146] Lightning Bolt
|
1 [TSP:294] Mountain
|
||||||
4 [WWK:139] Lavaclaw Reaches
|
1 [10E:379] Mountain
|
||||||
3 [M10:134] Earthquake
|
1 [SOM:245] Mountain
|
||||||
4 [ZEN:126] Goblin Guide
|
1 [ZEN:262] Mountain
|
||||||
4 [CON:65] Hellspark Elemental
|
1 [ZEN:245] Mountain
|
||||||
4 [M10:125] Ball Lightning
|
1 [10E:378] Mountain
|
||||||
4 [ALA:103] Hell's Thunder
|
1 [SOM:244] Mountain
|
||||||
2 [CON:70] Quenchable Fire
|
1 [SOM:243] Mountain
|
||||||
3 [ZEN:119] Burst Lightning
|
1 [ZEN:244] Mountain
|
||||||
4 [ZEN:211] Arid Mesa
|
1 [SOM:242] Mountain
|
||||||
4 [M10:223] Dragonskull Summit
|
1 [ZEN:243] Mountain
|
||||||
4 [WWK:90] Searing Blaze
|
1 [ZEN:242] Mountain
|
||||||
|
1 [ALA:243] Mountain
|
||||||
|
1 [ALA:242] Mountain
|
||||||
|
1 [M12:245] Mountain
|
||||||
|
1 [CHK:299] Mountain
|
||||||
|
1 [M12:243] Mountain
|
||||||
|
1 [M12:244] Mountain
|
||||||
|
1 [CHK:300] Mountain
|
||||||
|
1 [CHK:301] Mountain
|
||||||
|
1 [M12:242] Mountain
|
||||||
|
1 [CHK:302] Mountain
|
||||||
|
1 [10E:376] Mountain
|
||||||
|
1 [M11:243] Mountain
|
||||||
|
1 [M11:242] Mountain
|
||||||
|
1 [M11:245] Mountain
|
||||||
|
1 [M11:244] Mountain
|
||||||
|
1 [MBS:152] Mountain
|
||||||
|
1 [ALA:244] Mountain
|
||||||
|
1 [ALA:245] Mountain
|
||||||
|
1 [ZEN:263] Mountain
|
||||||
|
1 [ZEN:264] Mountain
|
||||||
|
1 [RAV:301] Mountain
|
||||||
|
1 [RAV:300] Mountain
|
||||||
|
1 [RAV:299] Mountain
|
||||||
|
1 [USG:345] Mountain
|
||||||
|
1 [USG:346] Mountain
|
||||||
|
1 [M10:242] Mountain
|
||||||
|
1 [RAV:302] Mountain
|
||||||
|
1 [USG:343] Mountain
|
||||||
|
1 [USG:344] Mountain
|
||||||
|
1 [ISD:259] Mountain
|
||||||
|
1 [ROE:244] Mountain
|
||||||
|
1 [ISD:261] Mountain
|
||||||
|
1 [ISD:260] Mountain
|
||||||
|
1 [ROE:241] Mountain
|
||||||
|
1 [ROE:242] Mountain
|
||||||
|
1 [ROE:243] Mountain
|
||||||
|
1 [MRD:301] Mountain
|
||||||
|
1 [MRD:300] Mountain
|
||||||
|
1 [MRD:299] Mountain
|
||||||
|
1 [M10:244] Mountain
|
||||||
|
1 [M10:243] Mountain
|
||||||
|
1 [M10:245] Mountain
|
||||||
|
1 [LRW:294] Mountain
|
||||||
|
1 [TMP:319] Mountain
|
||||||
|
1 [LRW:295] Mountain
|
||||||
|
1 [LRW:296] Mountain
|
||||||
|
1 [LRW:297] Mountain
|
||||||
|
1 [TMP:322] Mountain
|
||||||
|
1 [MRD:302] Mountain
|
||||||
|
1 [TMP:320] Mountain
|
||||||
|
1 [TMP:321] Mountain
|
||||||
|
1 [INV:345] Mountain
|
||||||
|
1 [INV:344] Mountain
|
||||||
|
|
Binary file not shown.
|
@ -350,6 +350,7 @@ public class SoulbondKeywordTest extends CardTestPlayerBase {
|
||||||
assertAbilities(playerA, "Elite Vanguard", abilities);
|
assertAbilities(playerA, "Elite Vanguard", abilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void testExileAndReturnBack() {
|
public void testExileAndReturnBack() {
|
||||||
//TODO: Soulbond + Soulshift
|
//TODO: Soulbond + Soulshift
|
||||||
Assert.assertTrue(false);
|
Assert.assertTrue(false);
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class ArchangelsLightTest extends CardTestPlayerBase {
|
||||||
assertLife(playerB, 20);
|
assertLife(playerB, 20);
|
||||||
assertGraveyardCount(playerA, 1);
|
assertGraveyardCount(playerA, 1);
|
||||||
assertGraveyardCount(playerA, "Archangel's Light", 1);
|
assertGraveyardCount(playerA, "Archangel's Light", 1);
|
||||||
Assert.assertEquals(currentGame.getPlayer(playerA.getId()).getLibrary().size(), 66);
|
Assert.assertEquals(currentGame.getPlayer(playerA.getId()).getLibrary().size(), 77);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,10 @@ public class SorinLordOfInnistradTest extends CardTestPlayerBase {
|
||||||
assertLife(playerA, 23);
|
assertLife(playerA, 23);
|
||||||
assertLife(playerB, 20);
|
assertLife(playerB, 20);
|
||||||
assertPermanentCount(playerA, "Sorin, Lord of Innistrad", 0);
|
assertPermanentCount(playerA, "Sorin, Lord of Innistrad", 0);
|
||||||
assertPermanentCount(playerA, "Craw Wurm", 1);
|
|
||||||
assertPermanentCount(playerB, "Craw Wurm", 0);
|
assertPermanentCount(playerB, "Craw Wurm", 0);
|
||||||
assertPermanentCount(playerA, "Angel of Mercy", 1);
|
|
||||||
assertPermanentCount(playerB, "Angel of Mercy", 0);
|
assertPermanentCount(playerB, "Angel of Mercy", 0);
|
||||||
|
assertPermanentCount(playerA, "Craw Wurm", 1);
|
||||||
|
assertPermanentCount(playerA, "Angel of Mercy", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,9 @@ public class CondemnTest extends CardTestPlayerBase {
|
||||||
assertPermanentCount(playerA, "Sejiri Merfolk", 0);
|
assertPermanentCount(playerA, "Sejiri Merfolk", 0);
|
||||||
assertLife(playerB, 20);
|
assertLife(playerB, 20);
|
||||||
assertLife(playerA, 21);
|
assertLife(playerA, 21);
|
||||||
|
|
||||||
// check was put on top
|
// check was put on top
|
||||||
Assert.assertEquals(currentGame.getPlayer(playerA.getId()).getLibrary().size(), 61);
|
Assert.assertEquals(72, currentGame.getPlayer(playerA.getId()).getLibrary().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
public class BloodArtistTest extends CardTestPlayerBase {
|
public class BloodArtistTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that whenever Blood Artist goes to graveyard, it would trigget its ability.
|
* Tests that whenever Blood Artist goes to graveyard, it would trigger its ability.
|
||||||
* Tests that after Blood Artist went to graveyard, his ability doesn't work anymore.
|
* Tests that after Blood Artist went to graveyard, his ability doesn't work anymore.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@ -26,9 +26,9 @@ public class BloodArtistTest extends CardTestPlayerBase {
|
||||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Bloodflow Connoisseur", 1);
|
addCard(Constants.Zone.BATTLEFIELD, playerB, "Bloodflow Connoisseur", 1);
|
||||||
|
|
||||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Blood Artist");
|
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Blood Artist");
|
||||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Bloodflow Connoisseur");
|
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Bloodflow Connoisseur");
|
||||||
|
|
||||||
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
|
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertLife(playerA, 23);
|
assertLife(playerA, 23);
|
||||||
|
|
|
@ -230,7 +230,9 @@ public class TestPlayer extends ComputerPlayer<TestPlayer> {
|
||||||
for (UUID id: ability.getTargets().get(0).possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
|
for (UUID id: ability.getTargets().get(0).possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
|
||||||
MageObject object = game.getObject(id);
|
MageObject object = game.getObject(id);
|
||||||
if (object != null && object.getName().equals(t)) {
|
if (object != null && object.getName().equals(t)) {
|
||||||
|
if (ability.getTargets().get(0).getNumberOfTargets() == 1) {
|
||||||
ability.getTargets().get(0).clearChosen();
|
ability.getTargets().get(0).clearChosen();
|
||||||
|
}
|
||||||
ability.getTargets().get(0).addTarget(id, ability, game);
|
ability.getTargets().get(0).addTarget(id, ability, game);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
|
|
||||||
package mage.abilities;
|
package mage.abilities;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.Constants.AbilityType;
|
import mage.Constants.AbilityType;
|
||||||
import mage.Constants.EffectType;
|
import mage.Constants.EffectType;
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
|
@ -47,6 +44,10 @@ import mage.game.Game;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.Targets;
|
import mage.target.Targets;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Practically everything in the game is started from an Ability. This
|
* Practically everything in the game is started from an Ability. This
|
||||||
* interface describes what an Ability is composed of at the highest level.
|
* interface describes what an Ability is composed of at the highest level.
|
||||||
|
@ -356,8 +357,9 @@ public interface Ability extends Serializable {
|
||||||
* Returns true if this abilities source is in the zone for the ability
|
* Returns true if this abilities source is in the zone for the ability
|
||||||
*
|
*
|
||||||
* @param game
|
* @param game
|
||||||
|
* @param checkLKI
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean isInUseableZone(Game game);
|
public boolean isInUseableZone(Game game, boolean checkLKI);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,13 +458,15 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInUseableZone(Game game) {
|
public boolean isInUseableZone(Game game, boolean checkLKI) {
|
||||||
// try LKI first
|
// try LKI first
|
||||||
|
|
||||||
|
if (checkLKI) {
|
||||||
MageObject lkiTest = game.getLastKnownInformation(getSourceId(), zone);
|
MageObject lkiTest = game.getLastKnownInformation(getSourceId(), zone);
|
||||||
if (lkiTest != null) {
|
if (lkiTest != null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check against current state
|
// check against current state
|
||||||
Zone test = game.getState().getZone(sourceId);
|
Zone test = game.getState().getZone(sourceId);
|
||||||
|
|
|
@ -28,13 +28,14 @@
|
||||||
|
|
||||||
package mage.abilities;
|
package mage.abilities;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -51,7 +52,7 @@ public class TriggeredAbilities extends HashMap<UUID, TriggeredAbility> {
|
||||||
|
|
||||||
public void checkTriggers(GameEvent event, Game game) {
|
public void checkTriggers(GameEvent event, Game game) {
|
||||||
for (TriggeredAbility ability: this.values()) {
|
for (TriggeredAbility ability: this.values()) {
|
||||||
if (ability.isInUseableZone(game)) {
|
if (ability.isInUseableZone(game, true)) {
|
||||||
MageObject object = game.getLastKnownInformation(ability.getSourceId(), event.getZone());
|
MageObject object = game.getLastKnownInformation(ability.getSourceId(), event.getZone());
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
object = game.getObject(ability.getSourceId());
|
object = game.getObject(ability.getSourceId());
|
||||||
|
|
|
@ -28,15 +28,11 @@
|
||||||
|
|
||||||
package mage.abilities.common;
|
package mage.abilities.common;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import mage.Constants;
|
import mage.Constants;
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -59,7 +55,7 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility<DiesTrigger
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInUseableZone(Game game) {
|
public boolean isInUseableZone(Game game, boolean checkLKI) {
|
||||||
// check it was previously on battlefield
|
// check it was previously on battlefield
|
||||||
MageObject before = game.getLastKnownInformation(sourceId, Constants.Zone.BATTLEFIELD);
|
MageObject before = game.getLastKnownInformation(sourceId, Constants.Zone.BATTLEFIELD);
|
||||||
// check now it is in graveyard
|
// check now it is in graveyard
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
case WhileOnStack:
|
case WhileOnStack:
|
||||||
case WhileInGraveyard:
|
case WhileInGraveyard:
|
||||||
Ability ability = layeredEffects.getAbility(effect.getId());
|
Ability ability = layeredEffects.getAbility(effect.getId());
|
||||||
if (ability.isInUseableZone(game))
|
if (ability.isInUseableZone(game, false))
|
||||||
layerEffects.add(effect);
|
layerEffects.add(effect);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -163,7 +163,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
List<RequirementEffect> effects = new ArrayList<RequirementEffect>();
|
List<RequirementEffect> effects = new ArrayList<RequirementEffect>();
|
||||||
for (RequirementEffect effect: requirementEffects) {
|
for (RequirementEffect effect: requirementEffects) {
|
||||||
Ability ability = requirementEffects.getAbility(effect.getId());
|
Ability ability = requirementEffects.getAbility(effect.getId());
|
||||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game)) {
|
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) {
|
||||||
if (effect.applies(permanent, ability, game))
|
if (effect.applies(permanent, ability, game))
|
||||||
effects.add(effect);
|
effects.add(effect);
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
List<RestrictionEffect> effects = new ArrayList<RestrictionEffect>();
|
List<RestrictionEffect> effects = new ArrayList<RestrictionEffect>();
|
||||||
for (RestrictionEffect effect: restrictionEffects) {
|
for (RestrictionEffect effect: restrictionEffects) {
|
||||||
Ability ability = restrictionEffects.getAbility(effect.getId());
|
Ability ability = restrictionEffects.getAbility(effect.getId());
|
||||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game)) {
|
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) {
|
||||||
if (effect.applies(permanent, ability, game))
|
if (effect.applies(permanent, ability, game))
|
||||||
effects.add(effect);
|
effects.add(effect);
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
//get all applicable transient Replacement effects
|
//get all applicable transient Replacement effects
|
||||||
for (ReplacementEffect effect: replacementEffects) {
|
for (ReplacementEffect effect: replacementEffects) {
|
||||||
Ability ability = replacementEffects.getAbility(effect.getId());
|
Ability ability = replacementEffects.getAbility(effect.getId());
|
||||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game)) {
|
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) {
|
||||||
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
||||||
if (effect.applies(event, ability, game)) {
|
if (effect.applies(event, ability, game)) {
|
||||||
replaceEffects.add(effect);
|
replaceEffects.add(effect);
|
||||||
|
@ -208,7 +208,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
}
|
}
|
||||||
for (PreventionEffect effect: preventionEffects) {
|
for (PreventionEffect effect: preventionEffects) {
|
||||||
Ability ability = preventionEffects.getAbility(effect.getId());
|
Ability ability = preventionEffects.getAbility(effect.getId());
|
||||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game)) {
|
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) {
|
||||||
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
||||||
if (effect.applies(event, ability, game)) {
|
if (effect.applies(event, ability, game)) {
|
||||||
replaceEffects.add(effect);
|
replaceEffects.add(effect);
|
||||||
|
@ -230,7 +230,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
|
|
||||||
for (CostModificationEffect effect: costModificationEffects) {
|
for (CostModificationEffect effect: costModificationEffects) {
|
||||||
Ability ability = costModificationEffects.getAbility(effect.getId());
|
Ability ability = costModificationEffects.getAbility(effect.getId());
|
||||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game)) {
|
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) {
|
||||||
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
||||||
costEffects.add(effect);
|
costEffects.add(effect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -640,7 +640,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
||||||
if (checkStateAndTriggered()) {
|
if (checkStateAndTriggered()) {
|
||||||
applyEffects();
|
applyEffects();
|
||||||
}
|
}
|
||||||
resetLKI();
|
//resetLKI();
|
||||||
applyEffects();
|
applyEffects();
|
||||||
if (isPaused() || isGameOver()) return;
|
if (isPaused() || isGameOver()) return;
|
||||||
// resetPassed should be called if player performs any action
|
// resetPassed should be called if player performs any action
|
||||||
|
@ -660,7 +660,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
||||||
state.getPlayers().resetPassed();
|
state.getPlayers().resetPassed();
|
||||||
fireUpdatePlayersEvent();
|
fireUpdatePlayersEvent();
|
||||||
state.getRevealed().reset();
|
state.getRevealed().reset();
|
||||||
resetLKI();
|
//resetLKI();
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
//removeBookmark(bookmark);
|
//removeBookmark(bookmark);
|
||||||
|
|
|
@ -28,16 +28,6 @@
|
||||||
|
|
||||||
package mage.game;
|
package mage.game;
|
||||||
|
|
||||||
import mage.abilities.TriggeredAbility;
|
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
import mage.game.stack.SpellStack;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
import mage.abilities.*;
|
import mage.abilities.*;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
|
@ -48,11 +38,10 @@ import mage.choices.Choice;
|
||||||
import mage.game.combat.Combat;
|
import mage.game.combat.Combat;
|
||||||
import mage.game.combat.CombatGroup;
|
import mage.game.combat.CombatGroup;
|
||||||
import mage.game.command.Command;
|
import mage.game.command.Command;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
|
||||||
import mage.game.permanent.Battlefield;
|
import mage.game.permanent.Battlefield;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.PermanentCard;
|
import mage.game.stack.SpellStack;
|
||||||
import mage.game.stack.StackObject;
|
import mage.game.stack.StackObject;
|
||||||
import mage.game.turn.Turn;
|
import mage.game.turn.Turn;
|
||||||
import mage.game.turn.TurnMods;
|
import mage.game.turn.TurnMods;
|
||||||
|
@ -64,6 +53,9 @@ import mage.util.Copyable;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
import mage.watchers.Watchers;
|
import mage.watchers.Watchers;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
|
|
@ -28,37 +28,32 @@
|
||||||
|
|
||||||
package mage.game.stack;
|
package mage.game.stack;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import mage.Constants.AbilityType;
|
import mage.Constants.AbilityType;
|
||||||
import mage.abilities.Mode;
|
|
||||||
import mage.abilities.Modes;
|
|
||||||
import mage.abilities.costs.AlternativeCost;
|
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.costs.Costs;
|
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.Effects;
|
|
||||||
import mage.choices.Choice;
|
|
||||||
import mage.choices.Choices;
|
|
||||||
import mage.game.*;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.EffectType;
|
import mage.Constants.EffectType;
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Abilities;
|
import mage.abilities.*;
|
||||||
import mage.abilities.AbilitiesImpl;
|
import mage.abilities.costs.AlternativeCost;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.StateTriggeredAbility;
|
import mage.abilities.costs.Costs;
|
||||||
import mage.abilities.costs.CostsImpl;
|
import mage.abilities.costs.CostsImpl;
|
||||||
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.game.events.GameEvent;
|
import mage.abilities.effects.Effect;
|
||||||
|
import mage.abilities.effects.Effects;
|
||||||
|
import mage.choices.Choice;
|
||||||
|
import mage.choices.Choices;
|
||||||
|
import mage.game.Game;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.Targets;
|
import mage.target.Targets;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -329,7 +324,7 @@ public class StackAbility implements StackObject, Ability {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInUseableZone(Game game) {
|
public boolean isInUseableZone(Game game, boolean checkLKI) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue