make the "SVar=" part optional for SubAbility$ (now that all old-style drawbacks have been removed)

This commit is contained in:
jendave
2011-08-07 01:19:25 +00:00
parent 69ecdbed57
commit 0be7fd81de

View File

@@ -747,17 +747,19 @@ public class AbilityFactory {
String sSub = getMapParams().get("SubAbility"); String sSub = getMapParams().get("SubAbility");
if (sSub.startsWith("SVar=")) if(sSub.startsWith("SVar=")) {
sSub = getHostCard().getSVar(sSub.split("=")[1]); sSub = sSub.replace("SVar=", "");
}
if (sSub.startsWith("DB$")) sSub = getHostCard().getSVar(sSub);
{
if(!sSub.equals("")) {
// Older style Drawback no longer supported
AbilityFactory afDB = new AbilityFactory(); AbilityFactory afDB = new AbilityFactory();
abSub = (Ability_Sub)afDB.getAbility(sSub, getHostCard()); abSub = (Ability_Sub)afDB.getAbility(sSub, getHostCard());
} }
else{ else {
// Older style Drawback doesn't create an abSub System.out.println("SubAbility not found for: "+getHostCard());
// on Resolution use getMapParams().get("SubAbility"); to call Drawback
} }
return abSub; return abSub;