- Added the missing stack description to AF_Fog.

This commit is contained in:
jendave
2011-08-06 13:24:50 +00:00
parent c49977d4e1
commit 9a312e2127

View File

@@ -13,6 +13,12 @@ public class AbilityFactory_Combat {
final AbilityFactory af = AF;
@Override
public String getStackDescription(){
// when getStackDesc is called, just build exactly what is happening
return fogStackDescription(af, this);
}
public boolean canPlayAI()
{
return fogCanPlayAI(af, this);
@@ -33,6 +39,12 @@ public class AbilityFactory_Combat {
final AbilityFactory af = AF;
@Override
public String getStackDescription(){
// when getStackDesc is called, just build exactly what is happening
return fogStackDescription(af, this);
}
public boolean canPlayAI()
{
return fogCanPlayAI(af, this);
@@ -67,6 +79,25 @@ public class AbilityFactory_Combat {
return dbFog;
}
public static String fogStackDescription(AbilityFactory af, SpellAbility sa) {
StringBuilder sb = new StringBuilder();
if (!(sa instanceof Ability_Sub))
sb.append(sa.getSourceCard().getName()).append(" - ");
else
sb.append(" ");
sb.append(sa.getSourceCard().getController());
sb.append(" prevents all combat damage this turn.");
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
sb.append(abSub.getStackDescription());
}
return sb.toString();
}
public static boolean fogCanPlayAI(final AbilityFactory af, SpellAbility sa){
// 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());