- Removed doDrawBack function.

This commit is contained in:
jendave
2011-08-07 01:05:22 +00:00
parent 2f844c805f
commit c9fd38bb2b
13 changed files with 27 additions and 259 deletions

View File

@@ -298,17 +298,7 @@ public class AbilityFactory_AlterLife {
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()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, lifeAmount, card.getController(), card.getController().getOpponent(), tgtPlayers.get(0), card, null, sa);
}
}
} }
// ************************************************************************* // *************************************************************************
@@ -589,17 +579,7 @@ public class AbilityFactory_AlterLife {
if (tgt == null || p.canTarget(af.getHostCard())) if (tgt == null || p.canTarget(af.getHostCard()))
p.loseLife(lifeAmount, sa.getSourceCard()); p.loseLife(lifeAmount, sa.getSourceCard());
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, lifeAmount, card.getController(), card.getController().getOpponent(), tgtPlayers.get(0), card, null, sa);
}
}
} }
// ************************************************************************* // *************************************************************************
@@ -762,17 +742,7 @@ public class AbilityFactory_AlterLife {
p.addPoisonCounters(num); p.addPoisonCounters(num);
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, num, card.getController(), card.getController().getOpponent(), tgtPlayers.get(0), card, null, sa);
}
}
} }
private static String poisonStackDescription(AbilityFactory af, SpellAbility sa){ private static String poisonStackDescription(AbilityFactory af, SpellAbility sa){
@@ -1122,17 +1092,7 @@ public class AbilityFactory_AlterLife {
if(tgt == null || p.canTarget(af.getHostCard())) if(tgt == null || p.canTarget(af.getHostCard()))
p.setLife(lifeAmount, sa.getSourceCard()); p.setLife(lifeAmount, sa.getSourceCard());
if(af.hasSubAbility()) { AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if(abSub != null) {
abSub.resolve();
}
else {
String DrawBack = params.get("SubAbility");
if(af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, lifeAmount, card.getController(), card.getController().getOpponent(), tgtPlayers.get(0), card, null, sa);
}
}
} }
}//end class AbilityFactory_AlterLife }//end class AbilityFactory_AlterLife

View File

@@ -1205,17 +1205,7 @@ public class AbilityFactory_ChangeZone {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
//moved to general resolve
}
else{
String DrawBack = af.getMapParams().get("SubAbility");
Card card = sa.getSourceCard();
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, targetCard, sa);
}
}
} }
// **************************** Known Utility ************************************** // **************************** Known Utility **************************************
@@ -1510,17 +1500,7 @@ public class AbilityFactory_ChangeZone {
AllZone.ComputerPlayer.shuffle(); AllZone.ComputerPlayer.shuffle();
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = af.getMapParams().get("SubAbility");
Card card = sa.getSourceCard();
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
}
} }

View File

@@ -180,13 +180,6 @@ public class AbilityFactory_Combat {
// Expand Fog keyword here depending on what we need out of it. // Expand Fog keyword here depending on what we need out of it.
AllZone.GameInfo.setPreventCombatDamageThisTurn(true); AllZone.GameInfo.setPreventCombatDamageThisTurn(true);
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
} }
} }

View File

@@ -859,13 +859,6 @@ public class AbilityFactory_DealDamage {
//anything else to go here? //anything else to go here?
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
} }
} }

View File

@@ -393,14 +393,7 @@ public class AbilityFactory_Destroy {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, tgtCards.get(0), sa);
}
} }
// ********************************************************************************* // *********************************************************************************
@@ -646,13 +639,6 @@ public class AbilityFactory_Destroy {
card.addRemembered(list.get(i)); card.addRemembered(list.get(i));
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
} }
} }

View File

@@ -468,18 +468,12 @@ public class AbilityFactory_Mana {
public static void doDrawback(AbilityFactory af, Ability_Mana abMana, Card card){ public static void doDrawback(AbilityFactory af, Ability_Mana abMana, Card card){
HashMap<String,String> params = af.getMapParams(); HashMap<String,String> params = af.getMapParams();
String DrawBack = params.get("SubAbility");
// if mana production has any type of SubAbility, undoable=false // if mana production has any type of SubAbility, undoable=false
if (af.hasSubAbility()){ if (af.hasSubAbility()){
abMana.setUndoable(false); abMana.setUndoable(false);
Ability_Sub abSub = abMana.getSubAbility(); Ability_Sub abSub = abMana.getSubAbility();
if (abSub != null){ abSub.resolve();
abSub.resolve();
}
else{
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, abMana);
}
} }
} }

View File

@@ -385,18 +385,7 @@ public class AbilityFactory_PermanentState {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
Card c = tgtCards.get(0);
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, c, sa);
}
}
} }
public static void chooseUntapUpTo(AbilityFactory af, SpellAbility sa, HashMap<String,String> params){ public static void chooseUntapUpTo(AbilityFactory af, SpellAbility sa, HashMap<String,String> params){
@@ -784,18 +773,7 @@ public class AbilityFactory_PermanentState {
tgtC.tap(); tgtC.tap();
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
Card c = tgtCards.get(0);
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, c, sa);
}
}
} }
// **************************************** // ****************************************
@@ -900,15 +878,7 @@ public class AbilityFactory_PermanentState {
for(int i = 0; i < list.size(); i++) list.get(i).untap(); for(int i = 0; i < list.size(); i++) list.get(i).untap();
if (af.hasSubAbility()) { AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if(abSub != null) {
abSub.resolve();
}
else {
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
}
} }
private static boolean untapAllCanPlayAI(final AbilityFactory af, final SpellAbility sa) { private static boolean untapAllCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
@@ -1050,15 +1020,7 @@ public class AbilityFactory_PermanentState {
for(int i = 0; i < list.size(); i++) list.get(i).tap(); for(int i = 0; i < list.size(); i++) list.get(i).tap();
if (af.hasSubAbility()) { AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if(abSub != null) {
abSub.resolve();
}
else {
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
}
} }
private static boolean tapAllCanPlayAI(final AbilityFactory af, final SpellAbility sa) { private static boolean tapAllCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
@@ -1409,18 +1371,7 @@ public class AbilityFactory_PermanentState {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
Card c = tgtCards.get(0);
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, c, sa);
}
}
} }
//Phasing? Something else? Who knows! //Phasing? Something else? Who knows!

View File

@@ -695,18 +695,7 @@ public class AbilityFactory_Pump {
} }
} }
if (AF.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
Card first = tgtCards.get(0);
CardFactoryUtil.doDrawBack(params.get("SubAbility"), 0,
hostCard.getController(), hostCard.getController().getOpponent(),
first.getController(), hostCard, first, sa);
}
}
} }
@@ -906,19 +895,7 @@ public class AbilityFactory_Pump {
} }
} }
if (AF.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
Card first = list.get(0);
CardFactoryUtil.doDrawBack(params.get("SubAbility"), 0,
hostCard.getController(), hostCard.getController().getOpponent(),
first.getController(), hostCard, first, sa);
}
}
} }
private boolean pumpAllTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){ private boolean pumpAllTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){

View File

@@ -747,17 +747,7 @@ public class AbilityFactory_Reveal {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, source.getController(), source.getController().getOpponent(), tgtPlayers.get(0), source, null, sa);
}
}
} }
private static boolean scryTargetAI(AbilityFactory af, SpellAbility sa) { private static boolean scryTargetAI(AbilityFactory af, SpellAbility sa) {
@@ -1017,18 +1007,7 @@ public class AbilityFactory_Reveal {
if (tgt == null || p.canTarget(AF.getHostCard())) if (tgt == null || p.canTarget(AF.getHostCard()))
AllZoneUtil.rearrangeTopOfLibrary(AF.getHostCard(), p, numCards, shuffle); AllZoneUtil.rearrangeTopOfLibrary(AF.getHostCard(), p, numCards, shuffle);
} }
if (AF.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = AF.getMapParams().get("SubAbility");
if (AF.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, numCards, AF.getHostCard().getController(), AF.getHostCard().getController().getOpponent(), tgtPlayers.get(0), AF.getHostCard(), null, sa);
}
}
} }
}//end class AbilityFactory_Reveal }//end class AbilityFactory_Reveal

View File

@@ -329,14 +329,7 @@ public class AbilityFactory_Sacrifice {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
} }

View File

@@ -453,15 +453,6 @@ public class AbilityFactory_Token extends AbilityFactory {
} }
} }
if (AF.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
CardFactoryUtil.doDrawBack(AF.getMapParams().get("SubAbility"), finalAmount, AF.getHostCard().getController(),
AF.getHostCard().getController().getOpponent(), null, AF.getHostCard(), null, sa);
}
}
} }
} }

View File

@@ -393,17 +393,7 @@ public class AbilityFactory_ZoneAffecting {
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, source.getController(), source.getController().getOpponent(), tgtPlayers.get(0), source, null, sa);
}
}
} }
//********************************************************************** //**********************************************************************
@@ -704,17 +694,7 @@ public class AbilityFactory_ZoneAffecting {
if (tgt == null || p.canTarget(af.getHostCard())) if (tgt == null || p.canTarget(af.getHostCard()))
p.mill(numCards, destination); p.mill(numCards, destination);
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, source.getController(), source.getController().getOpponent(), tgtPlayers.get(0), source, null, sa);
}
}
} }
////////////////////// //////////////////////
@@ -955,17 +935,7 @@ public class AbilityFactory_ZoneAffecting {
} }
} }
if (af.hasSubAbility()){ AbilityFactory.resolveSubAbility(sa);
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else{
String DrawBack = params.get("SubAbility");
if (af.hasSubAbility())
CardFactoryUtil.doDrawBack(DrawBack, 0, source.getController(), source.getController().getOpponent(), source.getController(), source, null, sa);
}
}
} }
private static String discardStackDescription(AbilityFactory af, SpellAbility sa){ private static String discardStackDescription(AbilityFactory af, SpellAbility sa){

View File

@@ -2859,6 +2859,7 @@ public class CardFactoryUtil {
return tot; return tot;
} }
/*
public static void doDrawBack(String DB, int nDB, Player cardController, Player Opp, Player TgtP, Card Src, Card TgtC, SpellAbility sa) { public static void doDrawBack(String DB, int nDB, Player cardController, Player Opp, Player TgtP, Card Src, Card TgtC, SpellAbility sa) {
// Drawbacks may be any simple additional effect a spell or ability may have // Drawbacks may be any simple additional effect a spell or ability may have
// not just the negative ones // not just the negative ones
@@ -3003,7 +3004,7 @@ public class CardFactoryUtil {
} }
}//end MakeToken drawback }//end MakeToken drawback
} }*/
public static int getNumberOfMostProminentCreatureType(CardList list, String type) { public static int getNumberOfMostProminentCreatureType(CardList list, String type) {
list = list.getType(type); list = list.getType(type);