mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Laying some groundwork for DoTriggerAI() functions that will be used by the Trigger Controller instead of canPlayAI().
This commit is contained in:
@@ -17,7 +17,6 @@ public class AbilityFactory_AlterLife {
|
|||||||
private static final long serialVersionUID = 8869422603616247307L;
|
private static final long serialVersionUID = 8869422603616247307L;
|
||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
@@ -32,13 +31,17 @@ public class AbilityFactory_AlterLife {
|
|||||||
|
|
||||||
public boolean canPlayAI()
|
public boolean canPlayAI()
|
||||||
{
|
{
|
||||||
return gainLifeCanPlayAI(af, this, params.get("LifeAmount"));
|
return gainLifeCanPlayAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), this);
|
gainLifeResolve(af, this);
|
||||||
gainLifeResolve(af, this, amount);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
return gainLifeDoTriggerAI(af, this, mandatory);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -50,7 +53,6 @@ public class AbilityFactory_AlterLife {
|
|||||||
private static final long serialVersionUID = 6631124959690157874L;
|
private static final long serialVersionUID = 6631124959690157874L;
|
||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
@@ -68,13 +70,12 @@ public class AbilityFactory_AlterLife {
|
|||||||
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
||||||
// then call xCount with that card to properly calculate the amount
|
// then call xCount with that card to properly calculate the amount
|
||||||
// Or choosing how many to sacrifice
|
// Or choosing how many to sacrifice
|
||||||
return gainLifeCanPlayAI(af, this, params.get("LifeAmount"));
|
return gainLifeCanPlayAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), this);
|
gainLifeResolve(af, this);
|
||||||
gainLifeResolve(af, this, amount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -86,7 +87,6 @@ public class AbilityFactory_AlterLife {
|
|||||||
private static final long serialVersionUID = 6631124959690157874L;
|
private static final long serialVersionUID = 6631124959690157874L;
|
||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
@@ -99,13 +99,12 @@ public class AbilityFactory_AlterLife {
|
|||||||
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
||||||
// then call xCount with that card to properly calculate the amount
|
// then call xCount with that card to properly calculate the amount
|
||||||
// Or choosing how many to sacrifice
|
// Or choosing how many to sacrifice
|
||||||
return gainLifeCanPlayAI(af, this, params.get("LifeAmount"));
|
return gainLifeCanPlayAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), this);
|
gainLifeResolve(af, this);
|
||||||
gainLifeResolve(af, this, amount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -113,6 +112,11 @@ public class AbilityFactory_AlterLife {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
return gainLifeDoTriggerAI(af, this, mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbGainLife;
|
return dbGainLife;
|
||||||
}
|
}
|
||||||
@@ -147,11 +151,12 @@ public class AbilityFactory_AlterLife {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa, final String amountStr){
|
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Ability_Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
int life = AllZone.ComputerPlayer.getLife();
|
int life = AllZone.ComputerPlayer.getLife();
|
||||||
|
String amountStr = af.getMapParams().get("LifeAmount");
|
||||||
|
|
||||||
if (abCost != null){
|
if (abCost != null){
|
||||||
// AI currently disabled for these costs
|
// AI currently disabled for these costs
|
||||||
@@ -184,32 +189,57 @@ public class AbilityFactory_AlterLife {
|
|||||||
boolean chance = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed());
|
boolean chance = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed());
|
||||||
|
|
||||||
Target tgt = sa.getTarget();
|
Target tgt = sa.getTarget();
|
||||||
|
if (tgt != null){
|
||||||
if (sa.getTarget() != null){
|
|
||||||
tgt.resetTargets();
|
tgt.resetTargets();
|
||||||
sa.getTarget().addTarget(AllZone.ComputerPlayer);
|
if (tgt.canOnlyTgtOpponent())
|
||||||
|
tgt.addTarget(AllZone.HumanPlayer);
|
||||||
|
else
|
||||||
|
tgt.addTarget(AllZone.ComputerPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((r.nextFloat() < .6667) && chance);
|
return ((r.nextFloat() < .6667) && chance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void gainLifeResolve(final AbilityFactory af, final SpellAbility sa, int lifeAmount){
|
public static boolean gainLifeDoTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){
|
||||||
|
if (!ComputerUtil.canPayCost(sa) && !mandatory) // If there is a cost payment it's usually not mandatory
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// If the Target is gaining life, target self.
|
||||||
|
// if the Target is modifying how much life is gained, this needs to be handled better
|
||||||
|
Target tgt = sa.getTarget();
|
||||||
|
if (tgt != null){
|
||||||
|
tgt.resetTargets();
|
||||||
|
if (tgt.canOnlyTgtOpponent())
|
||||||
|
tgt.addTarget(AllZone.HumanPlayer);
|
||||||
|
else
|
||||||
|
tgt.addTarget(AllZone.ComputerPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check SubAbilities DoTrigger?
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
if (abSub != null) {
|
||||||
|
return abSub.doTrigger(mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void gainLifeResolve(final AbilityFactory af, final SpellAbility sa){
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Card card = af.getHostCard();
|
Card card = af.getHostCard();
|
||||||
|
int lifeAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), sa);
|
||||||
ArrayList<Player> tgtPlayers;
|
ArrayList<Player> tgtPlayers;
|
||||||
|
|
||||||
Target tgt = af.getAbTgt();
|
Target tgt = af.getAbTgt();
|
||||||
if (tgt != null)
|
if (tgt != null && !params.containsKey("Defined"))
|
||||||
tgtPlayers = tgt.getTargetPlayers();
|
tgtPlayers = tgt.getTargetPlayers();
|
||||||
else
|
else
|
||||||
tgtPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), af.getMapParams().get("Defined"), sa);
|
tgtPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), params.get("Defined"), sa);
|
||||||
|
|
||||||
for(Player p : tgtPlayers)
|
for(Player p : tgtPlayers)
|
||||||
if (tgt == null || p.canTarget(af.getHostCard()))
|
if (tgt == null || p.canTarget(af.getHostCard()))
|
||||||
p.gainLife(lifeAmount, sa.getSourceCard());
|
p.gainLife(lifeAmount, sa.getSourceCard());
|
||||||
|
|
||||||
|
|
||||||
if (af.hasSubAbility()){
|
if (af.hasSubAbility()){
|
||||||
Ability_Sub abSub = sa.getSubAbility();
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
if (abSub != null){
|
if (abSub != null){
|
||||||
@@ -232,7 +262,6 @@ public class AbilityFactory_AlterLife {
|
|||||||
private static final long serialVersionUID = 1129762905315395160L;
|
private static final long serialVersionUID = 1129762905315395160L;
|
||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
@@ -250,13 +279,17 @@ public class AbilityFactory_AlterLife {
|
|||||||
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
||||||
// then call xCount with that card to properly calculate the amount
|
// then call xCount with that card to properly calculate the amount
|
||||||
// Or choosing how many to sacrifice
|
// Or choosing how many to sacrifice
|
||||||
return loseLifeCanPlayAI(af, this, params.get("LifeAmount"));
|
return loseLifeCanPlayAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), this);
|
loseLifeResolve(af, this);
|
||||||
loseLifeResolve(af, this, amount);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
return loseLifeDoTriggerAI(af, this, mandatory);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return abLoseLife;
|
return abLoseLife;
|
||||||
@@ -267,7 +300,6 @@ public class AbilityFactory_AlterLife {
|
|||||||
private static final long serialVersionUID = -2966932725306192437L;
|
private static final long serialVersionUID = -2966932725306192437L;
|
||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
@@ -285,13 +317,12 @@ public class AbilityFactory_AlterLife {
|
|||||||
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
||||||
// then call xCount with that card to properly calculate the amount
|
// then call xCount with that card to properly calculate the amount
|
||||||
// Or choosing how many to sacrifice
|
// Or choosing how many to sacrifice
|
||||||
return loseLifeCanPlayAI(af, this, params.get("LifeAmount"));
|
return loseLifeCanPlayAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), this);
|
loseLifeResolve(af, this);
|
||||||
loseLifeResolve(af, this, amount);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return spLoseLife;
|
return spLoseLife;
|
||||||
@@ -302,7 +333,6 @@ public class AbilityFactory_AlterLife {
|
|||||||
private static final long serialVersionUID = -2966932725306192437L;
|
private static final long serialVersionUID = -2966932725306192437L;
|
||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
@@ -315,19 +345,23 @@ public class AbilityFactory_AlterLife {
|
|||||||
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
// if X depends on abCost, the AI needs to choose which card he would sacrifice first
|
||||||
// then call xCount with that card to properly calculate the amount
|
// then call xCount with that card to properly calculate the amount
|
||||||
// Or choosing how many to sacrifice
|
// Or choosing how many to sacrifice
|
||||||
return loseLifeCanPlayAI(af, this, params.get("LifeAmount"));
|
return loseLifeCanPlayAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), this);
|
loseLifeResolve(af, this);
|
||||||
loseLifeResolve(af, this, amount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean chkAI_Drawback() {
|
public boolean chkAI_Drawback() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
return loseLifeDoTriggerAI(af, this, mandatory);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return dbLoseLife;
|
return dbLoseLife;
|
||||||
}
|
}
|
||||||
@@ -361,13 +395,15 @@ public class AbilityFactory_AlterLife {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean loseLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa, final String amountStr){
|
public static boolean loseLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Ability_Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
int humanLife = AllZone.HumanPlayer.getLife();
|
int humanLife = AllZone.HumanPlayer.getLife();
|
||||||
int aiLife = AllZone.ComputerPlayer.getLife();
|
int aiLife = AllZone.ComputerPlayer.getLife();
|
||||||
|
|
||||||
|
String amountStr = af.getMapParams().get("LifeAmount");
|
||||||
|
|
||||||
// TODO handle proper calculation of X values based on Cost and what would be paid
|
// TODO handle proper calculation of X values based on Cost and what would be paid
|
||||||
final int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
|
final int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
|
||||||
|
|
||||||
@@ -406,9 +442,28 @@ public class AbilityFactory_AlterLife {
|
|||||||
return ((r.nextFloat() < .6667) && chance);
|
return ((r.nextFloat() < .6667) && chance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loseLifeResolve(final AbilityFactory af, final SpellAbility sa, int lifeAmount){
|
public static boolean loseLifeDoTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){
|
||||||
|
if (!ComputerUtil.canPayCost(sa) && !mandatory) // If there is a cost payment it's usually not mandatory
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Target tgt = sa.getTarget();
|
||||||
|
if (tgt != null){
|
||||||
|
tgt.addTarget(AllZone.HumanPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check SubAbilities DoTrigger?
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
if (abSub != null) {
|
||||||
|
return abSub.doTrigger(mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loseLifeResolve(final AbilityFactory af, final SpellAbility sa){
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Card card = af.getHostCard();
|
Card card = af.getHostCard();
|
||||||
|
int lifeAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), sa);
|
||||||
|
|
||||||
ArrayList<Player> tgtPlayers;
|
ArrayList<Player> tgtPlayers;
|
||||||
|
|
||||||
@@ -478,6 +533,11 @@ public class AbilityFactory_AlterLife {
|
|||||||
poisonResolve(af, this, amount);
|
poisonResolve(af, this, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
return poisonDoTriggerAI(af, this, mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abPoison;
|
return abPoison;
|
||||||
}
|
}
|
||||||
@@ -544,10 +604,40 @@ public class AbilityFactory_AlterLife {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return poisonDoTriggerAI(af, this, mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbPoison;
|
return dbPoison;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean poisonDoTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){
|
||||||
|
if (!ComputerUtil.canPayCost(sa) && !mandatory) // If there is a cost payment it's usually not mandatory
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Target tgt = sa.getTarget();
|
||||||
|
if (tgt != null){
|
||||||
|
tgt.addTarget(AllZone.HumanPlayer);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ArrayList<Player> players = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), af.getMapParams().get("Defined"), sa);
|
||||||
|
for(Player p : players)
|
||||||
|
if (!mandatory && p.isComputer() && p.getPoisonCounters() > p.getOpponent().getPoisonCounters())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check SubAbilities DoTrigger?
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
if (abSub != null) {
|
||||||
|
return abSub.doTrigger(mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private static void poisonResolve(final AbilityFactory af, final SpellAbility sa, int num){
|
private static void poisonResolve(final AbilityFactory af, final SpellAbility sa, int num){
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Card card = af.getHostCard();
|
Card card = af.getHostCard();
|
||||||
|
|||||||
@@ -30,6 +30,12 @@ public class AbilityFactory_ChangeZone {
|
|||||||
return changeZoneDescription(AF, this);
|
return changeZoneDescription(AF, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
setMiscellaneous(AF, abChangeZone);
|
setMiscellaneous(AF, abChangeZone);
|
||||||
return abChangeZone;
|
return abChangeZone;
|
||||||
@@ -75,6 +81,12 @@ public class AbilityFactory_ChangeZone {
|
|||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
return changeZoneDescription(AF, this);
|
return changeZoneDescription(AF, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
setMiscellaneous(AF, dbChangeZone);
|
setMiscellaneous(AF, dbChangeZone);
|
||||||
return dbChangeZone;
|
return dbChangeZone;
|
||||||
@@ -940,6 +952,12 @@ public class AbilityFactory_ChangeZone {
|
|||||||
return changeZoneAllDescription(AF, this);
|
return changeZoneAllDescription(AF, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
setMiscellaneous(AF, abChangeZone);
|
setMiscellaneous(AF, abChangeZone);
|
||||||
return abChangeZone;
|
return abChangeZone;
|
||||||
@@ -985,6 +1003,12 @@ public class AbilityFactory_ChangeZone {
|
|||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
return changeZoneAllDescription(AF, this);
|
return changeZoneAllDescription(AF, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
setMiscellaneous(AF, dbChangeZone);
|
setMiscellaneous(AF, dbChangeZone);
|
||||||
return dbChangeZone;
|
return dbChangeZone;
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ public class AbilityFactory_Combat {
|
|||||||
fogResolve(af, this);
|
fogResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abFog;
|
return abFog;
|
||||||
}
|
}
|
||||||
@@ -75,6 +81,12 @@ public class AbilityFactory_Combat {
|
|||||||
return fogPlayDrawbackAI(af, this);
|
return fogPlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbFog;
|
return dbFog;
|
||||||
}
|
}
|
||||||
@@ -100,8 +112,11 @@ public class AbilityFactory_Combat {
|
|||||||
|
|
||||||
public static boolean fogCanPlayAI(final AbilityFactory af, SpellAbility sa){
|
public static boolean fogCanPlayAI(final AbilityFactory af, SpellAbility sa){
|
||||||
// AI should only activate this during Human's Declare Blockers phase
|
// AI should only activate this during Human's Declare Blockers phase
|
||||||
boolean chance = AllZone.Phase.is(Constant.Phase.Combat_Declare_Blockers_InstantAbility, sa.getActivatingPlayer().getOpponent());
|
boolean chance;
|
||||||
|
if (AllZone.Phase.isPlayerTurn(sa.getActivatingPlayer().getOpponent()))
|
||||||
|
chance = AllZone.Phase.isBefore(Constant.Phase.Combat_FirstStrikeDamage);
|
||||||
|
else
|
||||||
|
chance = AllZone.Phase.isAfter(Constant.Phase.Combat_Damage);
|
||||||
// Only cast when Stack is empty, so Human uses spells/abilities first
|
// Only cast when Stack is empty, so Human uses spells/abilities first
|
||||||
chance &= AllZone.Stack.size() == 0;
|
chance &= AllZone.Stack.size() == 0;
|
||||||
|
|
||||||
@@ -116,8 +131,11 @@ public class AbilityFactory_Combat {
|
|||||||
|
|
||||||
public static boolean fogPlayDrawbackAI(final AbilityFactory af, SpellAbility sa){
|
public static boolean fogPlayDrawbackAI(final AbilityFactory af, SpellAbility sa){
|
||||||
// AI should only activate this during Human's turn
|
// AI should only activate this during Human's turn
|
||||||
boolean chance = AllZone.Phase.isPlayerTurn(sa.getActivatingPlayer().getOpponent()) ||
|
boolean chance;
|
||||||
AllZone.Phase.isAfter(Constant.Phase.Combat_Damage);
|
if (AllZone.Phase.isPlayerTurn(sa.getActivatingPlayer().getOpponent()))
|
||||||
|
chance = AllZone.Phase.isBefore(Constant.Phase.Combat_FirstStrikeDamage);
|
||||||
|
else
|
||||||
|
chance = AllZone.Phase.isAfter(Constant.Phase.Combat_Damage);
|
||||||
|
|
||||||
Ability_Sub subAb = sa.getSubAbility();
|
Ability_Sub subAb = sa.getSubAbility();
|
||||||
if (subAb != null)
|
if (subAb != null)
|
||||||
@@ -126,6 +144,25 @@ public class AbilityFactory_Combat {
|
|||||||
return chance;
|
return chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean fogDoTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){
|
||||||
|
if (!ComputerUtil.canPayCost(sa) && !mandatory) // If there is a cost payment it's usually not mandatory
|
||||||
|
return false;
|
||||||
|
|
||||||
|
boolean chance;
|
||||||
|
if (AllZone.Phase.isPlayerTurn(sa.getActivatingPlayer().getOpponent()))
|
||||||
|
chance = AllZone.Phase.isBefore(Constant.Phase.Combat_FirstStrikeDamage);
|
||||||
|
else
|
||||||
|
chance = AllZone.Phase.isAfter(Constant.Phase.Combat_Damage);
|
||||||
|
|
||||||
|
// check SubAbilities DoTrigger?
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
if (abSub != null) {
|
||||||
|
return chance && abSub.doTrigger(mandatory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return chance;
|
||||||
|
}
|
||||||
|
|
||||||
public static void fogResolve(final AbilityFactory af, final SpellAbility sa){
|
public static void fogResolve(final AbilityFactory af, final SpellAbility sa){
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ public class AbilityFactory_CounterMagic {
|
|||||||
counterResolve(af, this);
|
counterResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abCounter;
|
return abCounter;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public class AbilityFactory_Counters {
|
|||||||
putResolve(af, this);
|
putResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abPutCounter;
|
return abPutCounter;
|
||||||
}
|
}
|
||||||
@@ -88,6 +94,12 @@ public class AbilityFactory_Counters {
|
|||||||
return putPlayDrawbackAI(af, this);
|
return putPlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbPutCounter;
|
return dbPutCounter;
|
||||||
}
|
}
|
||||||
@@ -183,13 +195,13 @@ public class AbilityFactory_Counters {
|
|||||||
// TODO handle proper calculation of X values based on Cost
|
// TODO handle proper calculation of X values based on Cost
|
||||||
final int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
|
final int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
|
||||||
|
|
||||||
// prevent run-away activations - first time will always return true
|
// prevent run-away activations - first time will always return true
|
||||||
boolean chance = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed());
|
boolean chance = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed());
|
||||||
|
|
||||||
// Targeting
|
// Targeting
|
||||||
if (abTgt != null){
|
if (abTgt != null){
|
||||||
abTgt.resetTargets();
|
abTgt.resetTargets();
|
||||||
// target loop
|
// target loop
|
||||||
while(abTgt.getNumTargeted() < abTgt.getMaxTargets(sa.getSourceCard(), sa)){
|
while(abTgt.getNumTargeted() < abTgt.getMaxTargets(sa.getSourceCard(), sa)){
|
||||||
if (list.size() == 0){
|
if (list.size() == 0){
|
||||||
if (abTgt.getNumTargeted() < abTgt.getMinTargets(sa.getSourceCard(), sa) || abTgt.getNumTargeted() == 0){
|
if (abTgt.getNumTargeted() < abTgt.getMinTargets(sa.getSourceCard(), sa) || abTgt.getNumTargeted() == 0){
|
||||||
@@ -202,36 +214,12 @@ public class AbilityFactory_Counters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (af.isCurse()){
|
if (af.isCurse()){
|
||||||
if (type.equals("M1M1")){
|
choice = chooseCursedTarget(list, type, amount);
|
||||||
// try to kill the best killable creature, or reduce the best one
|
}
|
||||||
CardList killable = list.filter(new CardListFilter() {
|
else{
|
||||||
public boolean addCard(Card c) {
|
choice = chooseBoonTarget(list, type, amount);
|
||||||
return c.getNetDefense() <= amount;
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
if (killable.size() > 0)
|
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(killable);
|
|
||||||
else
|
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(list);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// improve random choice here
|
|
||||||
list.shuffle();
|
|
||||||
choice = list.get(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (type.equals("P1P1")){
|
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(list);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// The AI really should put counters on cards that can use it.
|
|
||||||
// Charge counters on things with Charge abilities, etc. Expand these above
|
|
||||||
list.shuffle();
|
|
||||||
choice = list.get(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (choice == null){ // can't find anything left
|
if (choice == null){ // can't find anything left
|
||||||
if (abTgt.getNumTargeted() < abTgt.getMinTargets(sa.getSourceCard(), sa) || abTgt.getNumTargeted() == 0){
|
if (abTgt.getNumTargeted() < abTgt.getMinTargets(sa.getSourceCard(), sa) || abTgt.getNumTargeted() == 0){
|
||||||
@@ -246,21 +234,21 @@ public class AbilityFactory_Counters {
|
|||||||
list.remove(choice);
|
list.remove(choice);
|
||||||
abTgt.addTarget(choice);
|
abTgt.addTarget(choice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// Placeholder: No targeting necessary
|
// Placeholder: No targeting necessary
|
||||||
int currCounters = sa.getSourceCard().getCounters(Counters.valueOf(type));
|
int currCounters = sa.getSourceCard().getCounters(Counters.valueOf(type));
|
||||||
// each non +1/+1 counter on the card is a 10% chance of not activating this ability.
|
// each non +1/+1 counter on the card is a 10% chance of not activating this ability.
|
||||||
|
|
||||||
if (!type.equals("P1P1") && r.nextFloat() < .1 * currCounters)
|
if (!type.equals("P1P1") && r.nextFloat() < .1 * currCounters)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ability_Sub subAb = sa.getSubAbility();
|
Ability_Sub subAb = sa.getSubAbility();
|
||||||
if (subAb != null)
|
if (subAb != null)
|
||||||
chance &= subAb.chkAI_Drawback();
|
chance &= subAb.chkAI_Drawback();
|
||||||
|
|
||||||
return ((r.nextFloat() < .6667) && chance);
|
return ((r.nextFloat() < .6667) && chance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean putPlayDrawbackAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean putPlayDrawbackAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
@@ -302,34 +290,10 @@ public class AbilityFactory_Counters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (af.isCurse()){
|
if (af.isCurse()){
|
||||||
if (type.equals("M1M1")){
|
choice = chooseCursedTarget(list, type, amount);
|
||||||
// try to kill the best killable creature, or reduce the best one
|
|
||||||
CardList killable = list.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return c.getNetDefense() <= amount;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (killable.size() > 0)
|
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(killable);
|
|
||||||
else
|
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(list);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// improve random choice here
|
|
||||||
list.shuffle();
|
|
||||||
choice = list.get(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (type.equals("P1P1")){
|
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(list);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// The AI really should put counters on cards that can use it.
|
|
||||||
// Charge counters on things with Charge abilities, etc. Expand these above
|
|
||||||
list.shuffle();
|
|
||||||
choice = list.get(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (choice == null){ // can't find anything left
|
if (choice == null){ // can't find anything left
|
||||||
@@ -355,6 +319,124 @@ public class AbilityFactory_Counters {
|
|||||||
return chance;
|
return chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean putDoTriggerAI(final AbilityFactory af, final SpellAbility sa, boolean mandatory){
|
||||||
|
// if there is a cost, it's gotta be optional
|
||||||
|
if (!ComputerUtil.canPayCost(sa) && !mandatory)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
HashMap<String,String> params = af.getMapParams();
|
||||||
|
Target abTgt = sa.getTarget();
|
||||||
|
final Card source = sa.getSourceCard();
|
||||||
|
boolean chance = true;
|
||||||
|
boolean preferred = true;
|
||||||
|
CardList list;
|
||||||
|
Player player = af.isCurse() ? AllZone.HumanPlayer : AllZone.ComputerPlayer;
|
||||||
|
String type = af.getMapParams().get("CounterType");
|
||||||
|
String amountStr = af.getMapParams().get("CounterNum");
|
||||||
|
final int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
|
||||||
|
|
||||||
|
if (abTgt == null){
|
||||||
|
// No target. So must be defined
|
||||||
|
list = new CardList(AbilityFactory.getDefinedCards(source, params.get("Defined"), sa).toArray());
|
||||||
|
|
||||||
|
if (!mandatory){
|
||||||
|
// todo: If Trigger isn't mandatory, when wouldn't we want to put a counter?
|
||||||
|
// things like Powder Keg, which are way too complex for the AI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
list = AllZoneUtil.getPlayerCardsInPlay(player);
|
||||||
|
list = list.getTargetableCards(source);
|
||||||
|
if (abTgt != null){
|
||||||
|
list = list.getValidCards(abTgt.getValidTgts(),source.getController(),source);
|
||||||
|
}
|
||||||
|
if (list.isEmpty() && mandatory){
|
||||||
|
// If there isn't any prefered cards to target, gotta choose non-preferred ones
|
||||||
|
list = AllZoneUtil.getPlayerCardsInPlay(player.getOpponent());
|
||||||
|
list = list.getTargetableCards(source);
|
||||||
|
if (abTgt != null){
|
||||||
|
list = list.getValidCards(abTgt.getValidTgts(),source.getController(),source);
|
||||||
|
}
|
||||||
|
preferred = false;
|
||||||
|
}
|
||||||
|
// Not mandatory, or the the list was regenerated and is still empty, so return false since there are no targets
|
||||||
|
if (list.isEmpty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Card choice = null;
|
||||||
|
|
||||||
|
// Choose targets here:
|
||||||
|
if (af.isCurse()){
|
||||||
|
if (preferred)
|
||||||
|
choice = chooseCursedTarget(list, type, amount);
|
||||||
|
|
||||||
|
else{
|
||||||
|
if (type.equals("M1M1")){
|
||||||
|
choice = CardFactoryUtil.AI_getWorstCreature(list);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
choice = CardFactoryUtil.getRandomCard(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if (preferred)
|
||||||
|
choice = chooseBoonTarget(list, type, amount);
|
||||||
|
|
||||||
|
else{
|
||||||
|
if (type.equals("P1P1")){
|
||||||
|
choice = CardFactoryUtil.AI_getWorstCreature(list);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
choice = CardFactoryUtil.getRandomCard(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abTgt.addTarget(choice);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability_Sub subAb = sa.getSubAbility();
|
||||||
|
if (subAb != null)
|
||||||
|
chance &= subAb.doTrigger(mandatory);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Card chooseCursedTarget(CardList list, String type, final int amount){
|
||||||
|
Card choice;
|
||||||
|
if (type.equals("M1M1")){
|
||||||
|
// try to kill the best killable creature, or reduce the best one
|
||||||
|
CardList killable = list.filter(new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.getNetDefense() <= amount;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (killable.size() > 0)
|
||||||
|
choice = CardFactoryUtil.AI_getBestCreature(killable);
|
||||||
|
else
|
||||||
|
choice = CardFactoryUtil.AI_getBestCreature(list);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// improve random choice here
|
||||||
|
choice = CardFactoryUtil.getRandomCard(list);
|
||||||
|
}
|
||||||
|
return choice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Card chooseBoonTarget(CardList list, String type, final int amount){
|
||||||
|
Card choice;
|
||||||
|
if (type.equals("P1P1")){
|
||||||
|
choice = CardFactoryUtil.AI_getBestCreature(list);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// The AI really should put counters on cards that can use it.
|
||||||
|
// Charge counters on things with Charge abilities, etc. Expand these above
|
||||||
|
choice = CardFactoryUtil.getRandomCard(list);
|
||||||
|
}
|
||||||
|
return choice;
|
||||||
|
}
|
||||||
|
|
||||||
public static void putResolve(final AbilityFactory af, final SpellAbility sa){
|
public static void putResolve(final AbilityFactory af, final SpellAbility sa){
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
String DrawBack = params.get("SubAbility");
|
String DrawBack = params.get("SubAbility");
|
||||||
@@ -415,6 +497,12 @@ public class AbilityFactory_Counters {
|
|||||||
removeResolve(af, this);
|
removeResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abRemCounter;
|
return abRemCounter;
|
||||||
}
|
}
|
||||||
@@ -468,6 +556,12 @@ public class AbilityFactory_Counters {
|
|||||||
return removePlayDrawbackAI(af, this);
|
return removePlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return spRemoveCounter;
|
return spRemoveCounter;
|
||||||
}
|
}
|
||||||
@@ -656,6 +750,12 @@ public class AbilityFactory_Counters {
|
|||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
return proliferateStackDescription(this);
|
return proliferateStackDescription(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return abProliferate;
|
return abProliferate;
|
||||||
@@ -713,6 +813,12 @@ public class AbilityFactory_Counters {
|
|||||||
public boolean chkAI_Drawback() {
|
public boolean chkAI_Drawback() {
|
||||||
return shouldProliferateAI(this);
|
return shouldProliferateAI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return dbProliferate;
|
return dbProliferate;
|
||||||
@@ -919,6 +1025,12 @@ public class AbilityFactory_Counters {
|
|||||||
putAllResolve(af, this);
|
putAllResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abPutCounterAll;
|
return abPutCounterAll;
|
||||||
}
|
}
|
||||||
@@ -967,6 +1079,12 @@ public class AbilityFactory_Counters {
|
|||||||
return putAllPlayDrawbackAI(af, this);
|
return putAllPlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbPutCounterAll;
|
return dbPutCounterAll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,12 @@ public class AbilityFactory_DealDamage {
|
|||||||
AF.getHostCard().setAbilityUsed(AF.getHostCard().getAbilityUsed() + 1);
|
AF.getHostCard().setAbilityUsed(AF.getHostCard().getAbilityUsed() + 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};// Ability_Activated
|
};// Ability_Activated
|
||||||
|
|
||||||
return abDamage;
|
return abDamage;
|
||||||
@@ -77,6 +83,12 @@ public class AbilityFactory_DealDamage {
|
|||||||
damageAllResolve(af, this);
|
damageAllResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abDamageAll;
|
return abDamageAll;
|
||||||
}
|
}
|
||||||
@@ -165,6 +177,12 @@ public class AbilityFactory_DealDamage {
|
|||||||
doResolve(this);
|
doResolve(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}; // Drawback
|
}; // Drawback
|
||||||
|
|
||||||
return dbDealDamage;
|
return dbDealDamage;
|
||||||
@@ -191,6 +209,12 @@ public class AbilityFactory_DealDamage {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbDamageAll;
|
return dbDamageAll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ public class AbilityFactory_Destroy {
|
|||||||
destroyResolve(af, this, noRegen);
|
destroyResolve(af, this, noRegen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abDestroy;
|
return abDestroy;
|
||||||
}
|
}
|
||||||
@@ -260,6 +266,12 @@ public class AbilityFactory_Destroy {
|
|||||||
destroyAllResolve(af, this, noRegen);
|
destroyAllResolve(af, this, noRegen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abDestroyAll;
|
return abDestroyAll;
|
||||||
}
|
}
|
||||||
@@ -330,6 +342,12 @@ public class AbilityFactory_Destroy {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbDestroyAll;
|
return dbDestroyAll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,12 @@ public class AbilityFactory_GainControl {
|
|||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};//Ability_Activated
|
};//Ability_Activated
|
||||||
|
|
||||||
return abControl;
|
return abControl;
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ public class AbilityFactory_Mana {
|
|||||||
manaResolve(this, af);
|
manaResolve(this, af);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abMana;
|
return abMana;
|
||||||
}
|
}
|
||||||
@@ -37,6 +43,12 @@ public class AbilityFactory_Mana {
|
|||||||
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
||||||
private static final long serialVersionUID = 1454043766057140491L;
|
private static final long serialVersionUID = 1454043766057140491L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public boolean canPlayAI()
|
public boolean canPlayAI()
|
||||||
@@ -70,6 +82,12 @@ public class AbilityFactory_Mana {
|
|||||||
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
||||||
private static final long serialVersionUID = 1454043766057140491L;
|
private static final long serialVersionUID = 1454043766057140491L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -89,6 +107,12 @@ public class AbilityFactory_Mana {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbMana;
|
return dbMana;
|
||||||
}
|
}
|
||||||
@@ -199,6 +223,12 @@ public class AbilityFactory_Mana {
|
|||||||
manaReflectedResolve(this, af);
|
manaReflectedResolve(this, af);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
abMana.setReflectedMana(true);
|
abMana.setReflectedMana(true);
|
||||||
return abMana;
|
return abMana;
|
||||||
@@ -215,6 +245,12 @@ public class AbilityFactory_Mana {
|
|||||||
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
||||||
private static final long serialVersionUID = 1454043766057140491L;
|
private static final long serialVersionUID = 1454043766057140491L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// todo: maybe add can produce here, so old AI code can use reflected mana?
|
// todo: maybe add can produce here, so old AI code can use reflected mana?
|
||||||
};
|
};
|
||||||
//tmpMana.setReflectedMana(true);
|
//tmpMana.setReflectedMana(true);
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
untapResolve(af, this);
|
untapResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abUntap;
|
return abUntap;
|
||||||
}
|
}
|
||||||
@@ -79,6 +85,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
return untapPlayDrawbackAI(af, this);
|
return untapPlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbUntap;
|
return dbUntap;
|
||||||
}
|
}
|
||||||
@@ -301,6 +313,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
tapResolve(af, this);
|
tapResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abTap;
|
return abTap;
|
||||||
}
|
}
|
||||||
@@ -351,6 +369,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
return tapPlayDrawbackAI(af, this);
|
return tapPlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbTap;
|
return dbTap;
|
||||||
}
|
}
|
||||||
@@ -572,6 +596,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
untapAllResolve(af, this);
|
untapAllResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abUntap;
|
return abUntap;
|
||||||
}
|
}
|
||||||
@@ -676,6 +706,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
tapAllResolve(af, this);
|
tapAllResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abUntap;
|
return abUntap;
|
||||||
}
|
}
|
||||||
@@ -724,6 +760,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
return tapAllPlayDrawbackAI(af, this);
|
return tapAllPlayDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbTap;
|
return dbTap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,12 @@ public class AbilityFactory_Pump {
|
|||||||
hostCard.setAbilityUsed(hostCard.getAbilityUsed() + 1);
|
hostCard.setAbilityUsed(hostCard.getAbilityUsed() + 1);
|
||||||
}//resolve()
|
}//resolve()
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
@@ -116,6 +122,12 @@ public class AbilityFactory_Pump {
|
|||||||
public boolean chkAI_Drawback() {
|
public boolean chkAI_Drawback() {
|
||||||
return doDrawbackAI(this);
|
return doDrawbackAI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
return dbPump;
|
return dbPump;
|
||||||
@@ -514,6 +526,13 @@ public class AbilityFactory_Pump {
|
|||||||
}//resolve()
|
}//resolve()
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
return abPumpAll;
|
return abPumpAll;
|
||||||
@@ -630,6 +649,12 @@ public class AbilityFactory_Pump {
|
|||||||
public boolean chkAI_Drawback() {
|
public boolean chkAI_Drawback() {
|
||||||
return chkPumpAllDrawbackAI(this);
|
return chkPumpAllDrawbackAI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
return dbPumpAll;
|
return dbPumpAll;
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public class AbilityFactory_Regenerate {
|
|||||||
return regenerateStackDescription(af, this);
|
return regenerateStackDescription(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};//Ability_Activated
|
};//Ability_Activated
|
||||||
|
|
||||||
return abRegenerate;
|
return abRegenerate;
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ public class AbilityFactory_Sacrifice {
|
|||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
return sacrificeDescription(af, this);
|
return sacrificeDescription(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return abSacrifice;
|
return abSacrifice;
|
||||||
}
|
}
|
||||||
@@ -73,6 +79,12 @@ public class AbilityFactory_Sacrifice {
|
|||||||
public String getStackDescription(){
|
public String getStackDescription(){
|
||||||
return sacrificeDescription(af, this);
|
return sacrificeDescription(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return dbSacrifice;
|
return dbSacrifice;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,12 @@ public class AbilityFactory_Token extends AbilityFactory {
|
|||||||
public String getStackDescription() {
|
public String getStackDescription() {
|
||||||
return doStackDescription(this);
|
return doStackDescription(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return abToken;
|
return abToken;
|
||||||
@@ -164,6 +170,12 @@ public class AbilityFactory_Token extends AbilityFactory {
|
|||||||
doResolve(this);
|
doResolve(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}; // Spell
|
}; // Spell
|
||||||
|
|
||||||
return dbDealDamage;
|
return dbDealDamage;
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ public class AbilityFactory_Turns {
|
|||||||
addTurnResolve(af, this, amount);
|
addTurnResolve(af, this, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abAddTurn;
|
return abAddTurn;
|
||||||
}
|
}
|
||||||
@@ -98,6 +104,12 @@ public class AbilityFactory_Turns {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbAddTurn;
|
return dbAddTurn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
drawResolve(af, this);
|
drawResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abDraw;
|
return abDraw;
|
||||||
}
|
}
|
||||||
@@ -95,6 +101,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
return drawTargetAI(af, this);
|
return drawTargetAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbDraw;
|
return dbDraw;
|
||||||
}
|
}
|
||||||
@@ -335,6 +347,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
millResolve(af, this);
|
millResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abMill;
|
return abMill;
|
||||||
}
|
}
|
||||||
@@ -395,6 +413,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
return millTargetAI(af, this);
|
return millTargetAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbMill;
|
return dbMill;
|
||||||
}
|
}
|
||||||
@@ -590,6 +614,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
discardResolve(af, this);
|
discardResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abDraw;
|
return abDraw;
|
||||||
}
|
}
|
||||||
@@ -660,6 +690,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
return discardCheckDrawbackAI(af, this);
|
return discardCheckDrawbackAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbDraw;
|
return dbDraw;
|
||||||
}
|
}
|
||||||
@@ -940,6 +976,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
return scryTargetAI(af, this);
|
return scryTargetAI(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return dbScry;
|
return dbScry;
|
||||||
}
|
}
|
||||||
@@ -1054,6 +1096,12 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
scryResolve(af, this);
|
scryResolve(af, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doTrigger(boolean mandatory) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return abScry;
|
return abScry;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ abstract public class Ability_Activated extends SpellAbility implements java.io.
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Cost_Payment.canPayAdditionalCosts(payCosts, this);
|
return Cost_Payment.canPayAdditionalCosts(payCosts, this);
|
||||||
//TODO: make sure you can't play the Computer's activated abilities
|
}
|
||||||
|
|
||||||
|
// This should be overridden by ALL AFs
|
||||||
|
public boolean doTrigger(boolean mandatory){
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ abstract public class Ability_Sub extends SpellAbility implements java.io.Serial
|
|||||||
|
|
||||||
abstract public boolean chkAI_Drawback();
|
abstract public boolean chkAI_Drawback();
|
||||||
|
|
||||||
|
abstract public boolean doTrigger(boolean mandatory);
|
||||||
|
|
||||||
public void setParent(SpellAbility parent) {
|
public void setParent(SpellAbility parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3536,7 +3536,7 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void showInfoDialg(String message) {
|
public static void showInfoDialg(String message) {
|
||||||
AllZone.Display.setCard(c);
|
//AllZone.Display.setCard(c); // c doesn't exist here!
|
||||||
JOptionPane.showMessageDialog(null, message);
|
JOptionPane.showMessageDialog(null, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -419,6 +419,10 @@ public class Phase extends MyObservable
|
|||||||
return phaseIndex > findIndex(phase);
|
return phaseIndex > findIndex(phase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isBefore(String phase) {
|
||||||
|
return phaseIndex < findIndex(phase);
|
||||||
|
}
|
||||||
|
|
||||||
private int findIndex(String phase) {
|
private int findIndex(String phase) {
|
||||||
for(int i = 0; i < phaseOrder.length; i++) {
|
for(int i = 0; i < phaseOrder.length; i++) {
|
||||||
if(phase.equals(phaseOrder[i]))
|
if(phase.equals(phaseOrder[i]))
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
|||||||
AllZone.GameAction.checkWheneverKeyword(c,"EntersBattleField",null);
|
AllZone.GameAction.checkWheneverKeyword(c,"EntersBattleField",null);
|
||||||
|
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getController());
|
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getController());
|
||||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, c.getController());
|
|
||||||
|
|
||||||
//Amulet of Vigor
|
//Amulet of Vigor
|
||||||
if(c.isTapped()) {
|
if(c.isTapped()) {
|
||||||
@@ -99,7 +98,6 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
|||||||
//System.out.println("A land was just put onto the battlefield: " + c.getName());
|
//System.out.println("A land was just put onto the battlefield: " + c.getName());
|
||||||
|
|
||||||
CardList list = new CardList(play.getCards());
|
CardList list = new CardList(play.getCards());
|
||||||
CardList graveList = new CardList(grave.getCards());
|
|
||||||
|
|
||||||
CardList listValakut = list.filter(new CardListFilter() {
|
CardList listValakut = list.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
@@ -128,28 +126,6 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
CardList ankhs = AllZoneUtil.getCardsInPlay("Ankh of Mishra");
|
|
||||||
//
|
|
||||||
//ankhs.add(AllZoneUtil.getCardsInPlay("Zo-Zu the Punisher"));
|
|
||||||
//
|
|
||||||
final Card ankhLand = c;
|
|
||||||
for(Card ankh:ankhs) {
|
|
||||||
final Card source = ankh;
|
|
||||||
SpellAbility ability = new Ability(source, "") {
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
ankhLand.getController().addDamage(2, source);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append(source).append(" - deals 2 damage to ").append(ankhLand.getController());
|
|
||||||
ability.setStackDescription(sb.toString());
|
|
||||||
|
|
||||||
AllZone.Stack.add(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
CardList seeds = AllZoneUtil.getCardsInPlay("Seed the Land");
|
CardList seeds = AllZoneUtil.getCardsInPlay("Seed the Land");
|
||||||
final Card seedLand = c;
|
final Card seedLand = c;
|
||||||
|
|||||||
@@ -172,7 +172,18 @@ public class Target {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// These below functions are quite limited to the damage classes, we should find a way to move them into AF_DealDamage
|
public boolean canOnlyTgtOpponent() {
|
||||||
|
boolean player = false;
|
||||||
|
boolean opponent = false;
|
||||||
|
for(String s: ValidTgts){
|
||||||
|
if (s.equals("Opponent"))
|
||||||
|
opponent = true;
|
||||||
|
else if (s.equals("Player"))
|
||||||
|
player = true;
|
||||||
|
}
|
||||||
|
return opponent && !player;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean canTgtPlayer() {
|
public boolean canTgtPlayer() {
|
||||||
for(String s: ValidTgts){
|
for(String s: ValidTgts){
|
||||||
if (s.equals("Player") || s.equals("Opponent"))
|
if (s.equals("Player") || s.equals("Opponent"))
|
||||||
|
|||||||
Reference in New Issue
Block a user