mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
AF_Debuff tweaks
This commit is contained in:
@@ -167,7 +167,6 @@ public class AbilityFactory_Debuff {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean debuffCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
|
private static boolean debuffCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
|
||||||
System.out.println("Checking debuff canPlayAI()");
|
|
||||||
// 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 (af.getAbTgt() == null && !AllZoneUtil.isCardInPlay(af.getHostCard()))
|
if (af.getAbTgt() == null && !AllZoneUtil.isCardInPlay(af.getHostCard()))
|
||||||
return false;
|
return false;
|
||||||
@@ -196,21 +195,14 @@ public class AbilityFactory_Debuff {
|
|||||||
if (!ComputerUtil.canPayCost(sa))
|
if (!ComputerUtil.canPayCost(sa))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
System.out.println("Past abCost in canPlayAI");
|
|
||||||
|
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
SpellAbility_Restriction restrict = sa.getRestrictions();
|
SpellAbility_Restriction restrict = sa.getRestrictions();
|
||||||
|
|
||||||
// Phase Restrictions
|
// Phase Restrictions
|
||||||
if (AllZone.Stack.size() == 0 && AllZone.Phase.isBefore(Constant.Phase.Combat_Begin)){
|
if (AllZone.Stack.size() == 0 && AllZone.Phase.isBefore(Constant.Phase.Combat_Begin)){
|
||||||
// Instant-speed pumps should not be cast outside of combat when the stack is empty
|
// Instant-speed pumps should not be cast outside of combat when the stack is empty
|
||||||
if (!AbilityFactory.isSorcerySpeed(sa))
|
if (!AbilityFactory.isSorcerySpeed(sa))
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
else if (AllZone.Stack.size() > 0){
|
|
||||||
// TODO: pump something only if the top thing on the stack will kill it via damage
|
|
||||||
// or if top thing on stack will pump it/enchant it and I want to kill it
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int activations = restrict.getNumberTurnActivations();
|
int activations = restrict.getNumberTurnActivations();
|
||||||
@@ -222,15 +214,8 @@ public class AbilityFactory_Debuff {
|
|||||||
|
|
||||||
if(af.getAbTgt() == null || !af.getAbTgt().doesTarget()) {
|
if(af.getAbTgt() == null || !af.getAbTgt().doesTarget()) {
|
||||||
ArrayList<Card> cards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
|
ArrayList<Card> cards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
|
||||||
|
|
||||||
if (cards.size() == 0)
|
if (cards.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/*
|
|
||||||
// when this happens we need to expand AI to consider if its ok for everything?
|
|
||||||
for(Card card : cards){
|
|
||||||
// TODO: if AI doesn't control Card and Pump is a Curse, than maybe use?
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return debuffTgtAI(af, sa, getKeywords(params), false);
|
return debuffTgtAI(af, sa, getKeywords(params), false);
|
||||||
@@ -239,11 +224,12 @@ public class AbilityFactory_Debuff {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean debuffDrawbackAI(AbilityFactory af, SpellAbility sa) {
|
private static boolean debuffDrawbackAI(AbilityFactory af, SpellAbility sa) {
|
||||||
|
HashMap<String,String> params = af.getMapParams();
|
||||||
if(af.getAbTgt() == null || !af.getAbTgt().doesTarget()) {
|
if(af.getAbTgt() == null || !af.getAbTgt().doesTarget()) {
|
||||||
//TODO - copied from AF_Pump.pumpDrawbackAI() - what shoul be here?
|
//TODO - copied from AF_Pump.pumpDrawbackAI() - what should be here?
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return debuffTgtAI(af, sa, getKeywords(af.getMapParams()), false);
|
return debuffTgtAI(af, sa, getKeywords(params), false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}//debuffDrawbackAI()
|
}//debuffDrawbackAI()
|
||||||
|
|||||||
Reference in New Issue
Block a user