once canPlayAI is wrapped is has to be hidden from outside callers

This commit is contained in:
Maxmtg
2012-11-06 21:35:02 +00:00
parent 0a2b20692d
commit 5c870a0e57
85 changed files with 86 additions and 86 deletions

View File

@@ -17,7 +17,7 @@ public abstract class SpellAiLogic {
return canPlayAI(aiPlayer, params, sa); return canPlayAI(aiPlayer, params, sa);
} }
public abstract boolean canPlayAI(final Player aiPlayer, final Map<String, String> params, final SpellAbility sa); protected abstract boolean canPlayAI(final Player aiPlayer, final Map<String, String> params, final SpellAbility sa);
public final boolean doTriggerAI(final Player aiPlayer, final Map<String, String> params, final SpellAbility sa, final boolean mandatory){ public final boolean doTriggerAI(final Player aiPlayer, final Map<String, String> params, final SpellAbility sa, final boolean mandatory){
if (!ComputerUtil.canPayCost(sa, aiPlayer) && !mandatory) { if (!ComputerUtil.canPayCost(sa, aiPlayer) && !mandatory) {

View File

@@ -74,7 +74,7 @@ public class AddTurnAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return doTriggerAINoCost(aiPlayer, params, sa, false); return doTriggerAINoCost(aiPlayer, params, sa, false);
} }

View File

@@ -11,7 +11,7 @@ public class AlwaysPlayAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return true; return true;
} }

View File

@@ -31,7 +31,7 @@ public class AnimateAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -7,7 +7,7 @@ import forge.game.player.Player;
public class AnimateAllAi extends SpellAiLogic { public class AnimateAllAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
return false; return false;
} // end animateAllCanPlayAI() } // end animateAllCanPlayAI()

View File

@@ -38,7 +38,7 @@ public class AttachAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -42,7 +42,7 @@ public final class BondAi extends SpellAiLogic {
* @return a boolean. * @return a boolean.
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
return true; return true;
} // end bondCanPlayAI() } // end bondCanPlayAI()
} }

View File

@@ -12,7 +12,7 @@ public class CanPlayAsDrawbackAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return false; return false;
} }

View File

@@ -11,7 +11,7 @@ public class CannotPlayAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return false; return false;
} }

View File

@@ -25,7 +25,7 @@ public class ChangeZoneAllAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
// Change Zone All, can be any type moving from one zone to another // Change Zone All, can be any type moving from one zone to another
final Cost abCost = sa.getAbilityFactory().getAbCost(); final Cost abCost = sa.getAbilityFactory().getAbCost();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -14,7 +14,7 @@ import forge.util.MyRandom;
public class CharmAi extends SpellAiLogic { public class CharmAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
final int num = Integer.parseInt(params.containsKey("CharmNum") ? params.get("CharmNum") : "1"); final int num = Integer.parseInt(params.containsKey("CharmNum") ? params.get("CharmNum") : "1");

View File

@@ -18,7 +18,7 @@ public class ChooseCardAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Card host = sa.getSourceCard(); final Card host = sa.getSourceCard();
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();

View File

@@ -16,7 +16,7 @@ public class ChooseCardNameAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
if (params.containsKey("AILogic")) { if (params.containsKey("AILogic")) {
// Don't tap creatures that may be able to block // Don't tap creatures that may be able to block

View File

@@ -9,7 +9,7 @@ public class ChooseColorAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
if (!params.containsKey("AILogic")) { if (!params.containsKey("AILogic")) {
return false; return false;
} }

View File

@@ -10,7 +10,7 @@ import forge.game.player.Player;
public class ChooseTypeAi extends SpellAiLogic { public class ChooseTypeAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
if (!params.containsKey("AILogic")) { if (!params.containsKey("AILogic")) {
return false; return false;
} }

View File

@@ -29,7 +29,7 @@ public class ClashAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Player opp = ai.getOpponent(); final Player opp = ai.getOpponent();
if (tgt != null) { if (tgt != null) {

View File

@@ -16,7 +16,7 @@ import forge.game.player.Player;
public class CloneAi extends SpellAiLogic { public class CloneAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -22,7 +22,7 @@ public class ControlExchangeAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, final SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, final SpellAbility sa) {
Card object1 = null; Card object1 = null;
Card object2 = null; Card object2 = null;
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();

View File

@@ -62,7 +62,7 @@ import forge.game.zone.ZoneType;
*/ */
public class ControlGainAi extends SpellAiLogic { public class ControlGainAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, final SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, final SpellAbility sa) {
boolean hasCreature = false; boolean hasCreature = false;
boolean hasArtifact = false; boolean hasArtifact = false;
boolean hasEnchantment = false; boolean hasEnchantment = false;

View File

@@ -24,7 +24,7 @@ public class CopyPermanentAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
// Card source = sa.getSourceCard(); // Card source = sa.getSourceCard();
// TODO - I'm sure someone can do this AI better // TODO - I'm sure someone can do this AI better

View File

@@ -17,7 +17,7 @@ import forge.util.MyRandom;
public class CounterAi extends SpellAiLogic { public class CounterAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
boolean toReturn = true; boolean toReturn = true;
final Cost abCost = sa.getAbilityFactory().getAbCost(); final Cost abCost = sa.getAbilityFactory().getAbCost();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -18,7 +18,7 @@ import forge.util.MyRandom;
public class CountersMoveAi extends SpellAiLogic { public class CountersMoveAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what // based on what
// the expected targets could be // the expected targets could be

View File

@@ -17,7 +17,7 @@ import forge.game.zone.ZoneType;
public class CountersProliferateAi extends SpellAiLogic { public class CountersProliferateAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
boolean chance = true; boolean chance = true;
List<Card> cperms = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() { List<Card> cperms = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {

View File

@@ -26,7 +26,7 @@ import forge.util.MyRandom;
public class CountersPutAi extends SpellAiLogic { public class CountersPutAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, final SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, final SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on // based on
// what the expected targets could be // what the expected targets could be

View File

@@ -23,8 +23,8 @@ import forge.game.zone.ZoneType;
import forge.util.MyRandom; import forge.util.MyRandom;
public class CountersPutAllAi extends SpellAiLogic { public class CountersPutAllAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what // based on what
// the expected targets could be // the expected targets could be

View File

@@ -17,7 +17,7 @@ import forge.util.MyRandom;
public class CountersRemoveAi extends SpellAiLogic { public class CountersRemoveAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what // based on what
// the expected targets could be // the expected targets could be

View File

@@ -26,7 +26,7 @@ public class DamageAllAi extends SpellAiLogic
{ {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what the expected targets could be // based on what the expected targets could be
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();

View File

@@ -44,7 +44,7 @@ public class DamageDealAi extends DamageAiBase {
} }
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Cost abCost = sa.getAbilityFactory().getAbCost(); final Cost abCost = sa.getAbilityFactory().getAbCost();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -13,7 +13,7 @@ public class DamageEachAi extends DamageAiBase {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
if (tgt != null && sa.canTarget(ai.getOpponent())) { if (tgt != null && sa.canTarget(ai.getOpponent())) {

View File

@@ -27,7 +27,7 @@ public class DamagePreventAi extends SpellAiLogic {
} }
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Card hostCard = sa.getAbilityFactory().getHostCard(); final Card hostCard = sa.getAbilityFactory().getHostCard();
boolean chance = false; boolean chance = false;

View File

@@ -25,7 +25,7 @@ public class DamagePreventAllAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Card hostCard = sa.getAbilityFactory().getHostCard(); final Card hostCard = sa.getAbilityFactory().getHostCard();
boolean chance = false; boolean chance = false;

View File

@@ -28,7 +28,7 @@ public class DebuffAi extends SpellAiLogic {
// ************************************************************************* // *************************************************************************
@Override @Override
public boolean canPlayAI(final Player ai, final java.util.Map<String,String> params, final SpellAbility sa) { protected boolean canPlayAI(final Player ai, final java.util.Map<String,String> params, final SpellAbility sa) {
// if there is no target and host card isn't in play, don't activate // if there is no target and host card isn't in play, don't activate
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();
if ((sa.getTarget() == null) && !source.isInPlay()) { if ((sa.getTarget() == null) && !source.isInPlay()) {

View File

@@ -18,7 +18,7 @@ import forge.util.MyRandom;
public class DebuffAllAi extends SpellAiLogic { public class DebuffAllAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
String valid = ""; String valid = "";
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
// final Card source = sa.getSourceCard(); // final Card source = sa.getSourceCard();

View File

@@ -35,7 +35,7 @@ public class DelayedTriggerAi extends SpellAiLogic {
} }
@Override @Override
public boolean canPlayAI(forge.game.player.Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(forge.game.player.Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
final String svarName = params.get("Execute"); final String svarName = params.get("Execute");
final SpellAbility trigsa = tempCreator.getAbility(sa.getAbilityFactory().getHostCard().getSVar(svarName), sa.getAbilityFactory().getHostCard()); final SpellAbility trigsa = tempCreator.getAbility(sa.getAbilityFactory().getHostCard().getSVar(svarName), sa.getAbilityFactory().getHostCard());
return trigsa.canPlayAI(); return trigsa.canPlayAI();

View File

@@ -37,7 +37,7 @@ public class DestroyAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what the expected targets could be // based on what the expected targets could be
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();

View File

@@ -79,7 +79,7 @@ public class DestroyAllAi extends SpellAiLogic {
} }
@Override @Override
public boolean canPlayAI(final Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(final Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what the expected targets could be // based on what the expected targets could be
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();

View File

@@ -19,7 +19,7 @@ public class DigAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
double chance = .4; // 40 percent chance with instant speed stuff double chance = .4; // 40 percent chance with instant speed stuff
if (AbilityFactory.isSorcerySpeed(sa)) { if (AbilityFactory.isSorcerySpeed(sa)) {
chance = .667; // 66.7% chance for sorcery speed (since it will chance = .667; // 66.7% chance for sorcery speed (since it will

View File

@@ -14,7 +14,7 @@ public class DigUntilAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
double chance = .4; // 40 percent chance with instant speed stuff double chance = .4; // 40 percent chance with instant speed stuff
if (AbilityFactory.isSorcerySpeed(sa)) { if (AbilityFactory.isSorcerySpeed(sa)) {
chance = .667; // 66.7% chance for sorcery speed (since it will chance = .667; // 66.7% chance for sorcery speed (since it will

View File

@@ -21,7 +21,7 @@ import forge.util.MyRandom;
public class DiscardAi extends SpellAiLogic { public class DiscardAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String,String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();

View File

@@ -15,7 +15,7 @@ import forge.util.MyRandom;
public class DrainManaAi extends SpellAiLogic { public class DrainManaAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI cannot use this properly until he can use SAs during Humans turn // AI cannot use this properly until he can use SAs during Humans turn
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();

View File

@@ -48,7 +48,7 @@ public class DrawAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -22,7 +22,7 @@ import forge.util.MyRandom;
public class EffectAi extends SpellAiLogic { public class EffectAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final GameState game = Singletons.getModel().getGame(); final GameState game = Singletons.getModel().getGame();
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
boolean randomReturn = r.nextFloat() <= .6667; boolean randomReturn = r.nextFloat() <= .6667;

View File

@@ -24,7 +24,7 @@ public class EndTurnAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return false; return false;
} }
} }

View File

@@ -20,7 +20,7 @@ public class FightAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
Target tgt = sa.getTarget(); Target tgt = sa.getTarget();
tgt.resetTargets(); tgt.resetTargets();

View File

@@ -15,7 +15,7 @@ public class FogAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
// AI should only activate this during Human's Declare Blockers phase // AI should only activate this during Human's Declare Blockers phase
if (Singletons.getModel().getGame().getPhaseHandler().isPlayerTurn(sa.getActivatingPlayer())) { if (Singletons.getModel().getGame().getPhaseHandler().isPlayerTurn(sa.getActivatingPlayer())) {
return false; return false;

View File

@@ -7,7 +7,7 @@ import forge.game.player.Player;
public class GameLossAi extends SpellAiLogic { public class GameLossAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Player opp = ai.getOpponent(); final Player opp = ai.getOpponent();
if (opp.cantLose()) { if (opp.cantLose()) {
return false; return false;

View File

@@ -11,7 +11,7 @@ public class GameWinAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
if (ai.cantWin()) { if (ai.cantWin()) {
return false; return false;
} }

View File

@@ -20,7 +20,7 @@ public class LifeExchangeAi extends SpellAiLogic {
* forge.card.spellability.SpellAbility) * forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
final int myLife = aiPlayer.getLife(); final int myLife = aiPlayer.getLife();
Player opponent = aiPlayer.getOpponent(); Player opponent = aiPlayer.getOpponent();

View File

@@ -29,7 +29,7 @@ public class LifeGainAi extends SpellAiLogic {
* @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();

View File

@@ -23,7 +23,7 @@ public class LifeLoseAi extends SpellAiLogic {
* @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();

View File

@@ -18,7 +18,7 @@ import forge.util.MyRandom;
public class LifeSetAi extends SpellAiLogic { public class LifeSetAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
// Ability_Cost abCost = sa.getPayCosts(); // Ability_Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -21,7 +21,7 @@ import forge.util.MyRandom;
public class MillAi extends SpellAiLogic { public class MillAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();

View File

@@ -9,7 +9,7 @@ import forge.game.player.Player;
public class MustAttackAi extends SpellAiLogic { public class MustAttackAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
// disabled for the AI for now. Only for Gideon Jura at this time. // disabled for the AI for now. Only for Gideon Jura at this time.
return false; return false;
} }

View File

@@ -22,7 +22,7 @@ import forge.game.zone.ZoneType;
public class MustBlockAi extends SpellAiLogic { public class MustBlockAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
// disabled for the AI until he/she can make decisions about who to make // disabled for the AI until he/she can make decisions about who to make
// block // block
return false; return false;

View File

@@ -22,7 +22,7 @@ public class PhasesAi extends SpellAiLogic
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
// This still needs to be fleshed out // This still needs to be fleshed out
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -30,7 +30,7 @@ public class PlayAi extends SpellAiLogic {
} }
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Cost abCost = sa.getAbilityFactory().getAbCost(); final Cost abCost = sa.getAbilityFactory().getAbCost();
final Card source = sa.getAbilityFactory().getHostCard(); final Card source = sa.getAbilityFactory().getHostCard();

View File

@@ -26,7 +26,7 @@ public class PoisonAi extends SpellAiLogic {
* forge.card.spellability.SpellAbility) * forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();
// int humanPoison = AllZone.getHumanPlayer().getPoisonCounters(); // int humanPoison = AllZone.getHumanPlayer().getPoisonCounters();

View File

@@ -110,7 +110,7 @@ public class ProtectAi extends SpellAiLogic {
} // getProtectCreatures() } // getProtectCreatures()
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Card hostCard = sa.getAbilityFactory().getHostCard(); final Card hostCard = sa.getAbilityFactory().getHostCard();
// if there is no target and host card isn't in play, don't activate // if there is no target and host card isn't in play, don't activate
if ((sa.getTarget() == null) && !hostCard.isInPlay()) { if ((sa.getTarget() == null) && !hostCard.isInPlay()) {

View File

@@ -12,7 +12,7 @@ import forge.game.player.Player;
public class ProtectAllAi extends SpellAiLogic { public class ProtectAllAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Card hostCard = sa.getAbilityFactory().getHostCard(); final Card hostCard = sa.getAbilityFactory().getHostCard();
// if there is no target and host card isn't in play, don't activate // if there is no target and host card isn't in play, don't activate
if ((sa.getTarget() == null) && !hostCard.isInPlay()) { if ((sa.getTarget() == null) && !hostCard.isInPlay()) {

View File

@@ -30,7 +30,7 @@ public class PumpAi extends PumpAiBase {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Cost cost = sa.getPayCosts(); final Cost cost = sa.getPayCosts();
final PhaseHandler ph = Singletons.getModel().getGame().getPhaseHandler(); final PhaseHandler ph = Singletons.getModel().getGame().getPhaseHandler();
final List<String> keywords = params.containsKey("KW") ? Arrays.asList(params.get("KW").split(" & ")) : new ArrayList<String>(); final List<String> keywords = params.containsKey("KW") ? Arrays.asList(params.get("KW").split(" & ")) : new ArrayList<String>();

View File

@@ -26,7 +26,7 @@ public class PumpAllAi extends PumpAiBase {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(final Player ai, Map<String, String> params, final SpellAbility sa) { protected boolean canPlayAI(final Player ai, Map<String, String> params, final SpellAbility sa) {
String valid = ""; String valid = "";
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -12,7 +12,7 @@ public class RearrangeTopOfLibraryAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return false; return false;
} }

View File

@@ -56,7 +56,7 @@ public class RegenerateAi extends SpellAiLogic {
// ************************************************************** // **************************************************************
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Card hostCard = sa.getAbilityFactory().getHostCard(); final Card hostCard = sa.getAbilityFactory().getHostCard();
boolean chance = false; boolean chance = false;
final Cost abCost = sa.getAbilityFactory().getAbCost(); final Cost abCost = sa.getAbilityFactory().getAbCost();

View File

@@ -20,7 +20,7 @@ import forge.game.zone.ZoneType;
public class RegenerateAllAi extends SpellAiLogic { public class RegenerateAllAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Card hostCard = sa.getAbilityFactory().getHostCard(); final Card hostCard = sa.getAbilityFactory().getHostCard();
boolean chance = false; boolean chance = false;
final Cost abCost = sa.getAbilityFactory().getAbCost(); final Cost abCost = sa.getAbilityFactory().getAbCost();

View File

@@ -9,7 +9,7 @@ import forge.game.player.Player;
public class RemoveFromCombatAi extends SpellAiLogic { public class RemoveFromCombatAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
// disabled for the AI for now. Only for Gideon Jura at this time. // disabled for the AI for now. Only for Gideon Jura at this time.
return false; return false;
} }

View File

@@ -10,7 +10,7 @@ import forge.game.player.Player;
public class RepeatAi extends SpellAiLogic { public class RepeatAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Player opp = ai.getOpponent(); final Player opp = ai.getOpponent();
if (tgt != null) { if (tgt != null) {

View File

@@ -16,7 +16,7 @@ public class RestartGameAi extends SpellAiLogic {
* forge.card.spellability.SpellAbility) * forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
// The only card that uses this is Karn Liberated // The only card that uses this is Karn Liberated
// TODO Add Logic, check if AI is losing game state, or life // TODO Add Logic, check if AI is losing game state, or life

View File

@@ -12,7 +12,7 @@ import forge.util.MyRandom;
public class RevealAi extends RevealAiBase { public class RevealAi extends RevealAiBase {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI cannot use this properly until he can use SAs during Humans turn // AI cannot use this properly until he can use SAs during Humans turn
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -17,7 +17,7 @@ public class RevealHandAi extends RevealAiBase {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
// AI cannot use this properly until he can use SAs during Humans turn // AI cannot use this properly until he can use SAs during Humans turn
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -20,7 +20,7 @@ public class SacrificeAi extends SpellAiLogic {
// ************************************************************** // **************************************************************
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
boolean chance = sacrificeTgtAI(ai, params, sa); boolean chance = sacrificeTgtAI(ai, params, sa);
// Some additional checks based on what is being sacrificed, and who is // Some additional checks based on what is being sacrificed, and who is

View File

@@ -18,7 +18,7 @@ import forge.util.MyRandom;
public class SacrificeAllAi extends SpellAiLogic public class SacrificeAllAi extends SpellAiLogic
{ {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// AI needs to be expanded, since this function can be pretty complex // AI needs to be expanded, since this function can be pretty complex
// based on what the expected targets could be // based on what the expected targets could be
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();

View File

@@ -36,7 +36,7 @@ public class ScryAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
// Card source = sa.getSourceCard(); // Card source = sa.getSourceCard();
double chance = .4; // 40 percent chance of milling with instant speed double chance = .4; // 40 percent chance of milling with instant speed

View File

@@ -8,7 +8,7 @@ import forge.game.player.Player;
public class SetStateAi extends SpellAiLogic { public class SetStateAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
return false; return false;
} }

View File

@@ -11,7 +11,7 @@ public class SetStateAllAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, Map<String, String> params, SpellAbility sa) {
return true; return true;
} }

View File

@@ -6,7 +6,7 @@ import forge.game.player.Player;
public class ShuffleAi extends SpellAiLogic { public class ShuffleAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
// not really sure when the compy would use this; maybe only after a // not really sure when the compy would use this; maybe only after a
// human // human
// deliberately put a card on top of their library // deliberately put a card on top of their library

View File

@@ -11,7 +11,7 @@ import forge.game.player.Player;
public class StoreSVarAi extends SpellAiLogic { public class StoreSVarAi extends SpellAiLogic {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
//Tree of Redemption //Tree of Redemption
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -15,7 +15,7 @@ import forge.util.MyRandom;
public class TapAi extends TapAiBase { public class TapAi extends TapAiBase {
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -24,7 +24,7 @@ public class TapAllAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(final Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(final Player ai, Map<String, String> params, SpellAbility sa) {
// If tapping all creatures do it either during declare attackers of AIs // If tapping all creatures do it either during declare attackers of AIs
// turn // turn
// or during upkeep/begin combat? // or during upkeep/begin combat?

View File

@@ -17,7 +17,7 @@ public class TapOrUntapAi extends TapAiBase {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -64,7 +64,7 @@ public class TokenAi extends SpellAiLogic {
} }
@Override @Override
public boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, java.util.Map<String,String> params, SpellAbility sa) {
final Cost cost = sa.getPayCosts(); final Cost cost = sa.getPayCosts();
readParameters(params); readParameters(params);

View File

@@ -19,7 +19,7 @@ public class TwoPilesAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Card card = sa.getSourceCard(); final Card card = sa.getSourceCard();
ZoneType zone = null; ZoneType zone = null;

View File

@@ -24,7 +24,7 @@ public class UnattachAllAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();

View File

@@ -27,7 +27,7 @@ public class UntapAi extends SpellAiLogic {
* @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility) * @see forge.card.abilityfactory.SpellAiLogic#canPlayAI(forge.game.player.Player, java.util.Map, forge.card.spellability.SpellAbility)
*/ */
@Override @Override
public boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) { protected boolean canPlayAI(Player ai, Map<String, String> params, SpellAbility sa) {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();
final Cost cost = sa.getPayCosts(); final Cost cost = sa.getPayCosts();

View File

@@ -13,7 +13,7 @@ public class UntapAllAi extends SpellAiLogic {
} }
@Override @Override
public boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) { protected boolean canPlayAI(Player aiPlayer, java.util.Map<String,String> params, SpellAbility sa) {
// check SubAbilities DoTrigger? // check SubAbilities DoTrigger?
final AbilitySub abSub = sa.getSubAbility(); final AbilitySub abSub = sa.getSubAbility();
if (abSub != null) { if (abSub != null) {

View File

@@ -79,7 +79,7 @@ public class ComputerUtilAttack {
this.attackers = new ArrayList<Card>(); this.attackers = new ArrayList<Card>();
for(Card c : computerList) for(Card c : computerList)
if (CombatUtil.canAttack(c, human)) if (CombatUtil.canAttack(c, (GameEntity)human))
attackers.add(c); attackers.add(c);
this.blockers = this.getPossibleBlockers(humanList, this.attackers); this.blockers = this.getPossibleBlockers(humanList, this.attackers);