mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
cleanup regarding params in a couple AFs
This commit is contained in:
@@ -44,7 +44,8 @@ public class AbilityFactory_DelayedTrigger {
|
||||
|
||||
private static boolean doChkAI_Drawback(final AbilityFactory AF, final SpellAbility SA)
|
||||
{
|
||||
String svarName = AF.getMapParams().get("Execute");
|
||||
HashMap<String,String> params = AF.getMapParams();
|
||||
String svarName = params.get("Execute");
|
||||
SpellAbility trigsa = tempCreator.getAbility(AF.getHostCard().getSVar(svarName), AF.getHostCard());
|
||||
|
||||
if(trigsa instanceof Ability_Sub)
|
||||
@@ -59,16 +60,17 @@ public class AbilityFactory_DelayedTrigger {
|
||||
|
||||
private static boolean doTriggerAI(final AbilityFactory AF,final SpellAbility SA)
|
||||
{
|
||||
String svarName = AF.getMapParams().get("Execute");
|
||||
HashMap<String,String> params = AF.getMapParams();
|
||||
String svarName = params.get("Execute");
|
||||
SpellAbility trigsa = tempCreator.getAbility(AF.getHostCard().getSVar(svarName),AF.getHostCard());
|
||||
|
||||
if(!AF.getMapParams().containsKey("OptionalDecider"))
|
||||
if(!params.containsKey("OptionalDecider"))
|
||||
{
|
||||
return trigsa.doTrigger(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return trigsa.doTrigger(!AF.getMapParams().get("OptionalDecider").equals("You"));
|
||||
return trigsa.doTrigger(!params.get("OptionalDecider").equals("You"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,8 @@ public class AbilityFactory_Destroy {
|
||||
Cost abCost = sa.getPayCosts();
|
||||
Target abTgt = sa.getTarget();
|
||||
final Card source = sa.getSourceCard();
|
||||
final boolean noRegen = af.getMapParams().containsKey("NoRegen");
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
final boolean noRegen = params.containsKey("NoRegen");
|
||||
|
||||
CardList list;
|
||||
list = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer);
|
||||
@@ -220,7 +221,8 @@ public class AbilityFactory_Destroy {
|
||||
|
||||
Target tgt = sa.getTarget();
|
||||
final Card source = sa.getSourceCard();
|
||||
final boolean noRegen = af.getMapParams().containsKey("NoRegen");
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
final boolean noRegen = params.containsKey("NoRegen");
|
||||
|
||||
|
||||
if (tgt != null){
|
||||
@@ -313,11 +315,12 @@ public class AbilityFactory_Destroy {
|
||||
}
|
||||
|
||||
private static String destroyStackDescription(final AbilityFactory af, SpellAbility sa) {
|
||||
final boolean noRegen = af.getMapParams().containsKey("NoRegen");
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
final boolean noRegen = params.containsKey("NoRegen");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Card host = af.getHostCard();
|
||||
|
||||
String conditionDesc = af.getMapParams().get("ConditionDescription");
|
||||
String conditionDesc = params.get("ConditionDescription");
|
||||
if (conditionDesc != null)
|
||||
sb.append(conditionDesc).append(" ");
|
||||
|
||||
@@ -327,7 +330,7 @@ public class AbilityFactory_Destroy {
|
||||
if (tgt != null)
|
||||
tgtCards = tgt.getTargetCards();
|
||||
else{
|
||||
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), af.getMapParams().get("Defined"), sa);
|
||||
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
|
||||
}
|
||||
|
||||
if (sa instanceof Ability_Sub)
|
||||
@@ -376,7 +379,7 @@ public class AbilityFactory_Destroy {
|
||||
if (tgt != null)
|
||||
tgtCards = tgt.getTargetCards();
|
||||
else{
|
||||
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), af.getMapParams().get("Defined"), sa);
|
||||
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
|
||||
}
|
||||
|
||||
for(Card tgtC : tgtCards){
|
||||
@@ -498,8 +501,9 @@ public class AbilityFactory_Destroy {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String name = af.getHostCard().getName();
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
|
||||
String conditionDesc = af.getMapParams().get("ConditionDescription");
|
||||
String conditionDesc = params.get("ConditionDescription");
|
||||
if (conditionDesc != null)
|
||||
sb.append(conditionDesc).append(" ");
|
||||
|
||||
@@ -627,4 +631,5 @@ public class AbilityFactory_Destroy {
|
||||
card.addRemembered(list.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}//end class AbilityFactory_Destroy
|
||||
|
||||
@@ -542,6 +542,7 @@ public class AbilityFactory_PermanentState {
|
||||
if (!ComputerUtil.canPayCost(sa))
|
||||
return false;
|
||||
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
Target tgt = af.getAbTgt();
|
||||
Card source = sa.getSourceCard();
|
||||
|
||||
@@ -549,7 +550,7 @@ public class AbilityFactory_PermanentState {
|
||||
boolean randomReturn = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed());
|
||||
|
||||
if (tgt == null){
|
||||
ArrayList<Card> defined = AbilityFactory.getDefinedCards(source, af.getMapParams().get("Defined"), sa);
|
||||
ArrayList<Card> defined = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa);
|
||||
|
||||
boolean bFlag = false;
|
||||
for(Card c : defined)
|
||||
@@ -1218,6 +1219,8 @@ public class AbilityFactory_PermanentState {
|
||||
// when getStackDesc is called, just build exactly what is happening
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
|
||||
if (sa instanceof Ability_Sub)
|
||||
sb.append(" ");
|
||||
else
|
||||
@@ -1230,7 +1233,7 @@ public class AbilityFactory_PermanentState {
|
||||
if (tgt != null)
|
||||
tgtCards = tgt.getTargetCards();
|
||||
else{
|
||||
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), af.getMapParams().get("Defined"), sa);
|
||||
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
|
||||
}
|
||||
|
||||
Iterator<Card> it = tgtCards.iterator();
|
||||
@@ -1253,6 +1256,7 @@ public class AbilityFactory_PermanentState {
|
||||
if (!ComputerUtil.canPayCost(sa))
|
||||
return false;
|
||||
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
Target tgt = af.getAbTgt();
|
||||
Card source = sa.getSourceCard();
|
||||
|
||||
@@ -1262,7 +1266,7 @@ public class AbilityFactory_PermanentState {
|
||||
if (tgt == null){
|
||||
//assume we are looking to tap human's stuff
|
||||
//TODO - check for things with untap abilities, and don't tap those.
|
||||
ArrayList<Card> defined = AbilityFactory.getDefinedCards(source, af.getMapParams().get("Defined"), sa);
|
||||
ArrayList<Card> defined = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa);
|
||||
|
||||
boolean bFlag = false;
|
||||
for(Card c : defined)
|
||||
|
||||
Reference in New Issue
Block a user