mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Removed doDrawBack function.
This commit is contained in:
@@ -298,17 +298,7 @@ public class AbilityFactory_AlterLife {
|
||||
if (tgt == null || p.canTarget(af.getHostCard()))
|
||||
p.gainLife(lifeAmount, sa.getSourceCard());
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
// *************************************************************************
|
||||
@@ -589,17 +579,7 @@ public class AbilityFactory_AlterLife {
|
||||
if (tgt == null || p.canTarget(af.getHostCard()))
|
||||
p.loseLife(lifeAmount, sa.getSourceCard());
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
// *************************************************************************
|
||||
@@ -762,17 +742,7 @@ public class AbilityFactory_AlterLife {
|
||||
p.addPoisonCounters(num);
|
||||
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
private static String poisonStackDescription(AbilityFactory af, SpellAbility sa){
|
||||
@@ -1122,17 +1092,7 @@ public class AbilityFactory_AlterLife {
|
||||
if(tgt == null || p.canTarget(af.getHostCard()))
|
||||
p.setLife(lifeAmount, sa.getSourceCard());
|
||||
|
||||
if(af.hasSubAbility()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
}//end class AbilityFactory_AlterLife
|
||||
|
||||
@@ -1205,17 +1205,7 @@ public class AbilityFactory_ChangeZone {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
// **************************** Known Utility **************************************
|
||||
@@ -1510,17 +1500,7 @@ public class AbilityFactory_ChangeZone {
|
||||
AllZone.ComputerPlayer.shuffle();
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -180,13 +180,6 @@ public class AbilityFactory_Combat {
|
||||
// Expand Fog keyword here depending on what we need out of it.
|
||||
AllZone.GameInfo.setPreventCombatDamageThisTurn(true);
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -859,13 +859,6 @@ public class AbilityFactory_DealDamage {
|
||||
//anything else to go here?
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,14 +393,7 @@ public class AbilityFactory_Destroy {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
// *********************************************************************************
|
||||
@@ -646,13 +639,6 @@ public class AbilityFactory_Destroy {
|
||||
card.addRemembered(list.get(i));
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,18 +468,12 @@ public class AbilityFactory_Mana {
|
||||
|
||||
public static void doDrawback(AbilityFactory af, Ability_Mana abMana, Card card){
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
String DrawBack = params.get("SubAbility");
|
||||
|
||||
// if mana production has any type of SubAbility, undoable=false
|
||||
if (af.hasSubAbility()){
|
||||
abMana.setUndoable(false);
|
||||
Ability_Sub abSub = abMana.getSubAbility();
|
||||
if (abSub != null){
|
||||
abSub.resolve();
|
||||
}
|
||||
else{
|
||||
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, abMana);
|
||||
}
|
||||
abSub.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,18 +385,7 @@ public class AbilityFactory_PermanentState {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
public static void chooseUntapUpTo(AbilityFactory af, SpellAbility sa, HashMap<String,String> params){
|
||||
@@ -784,18 +773,7 @@ public class AbilityFactory_PermanentState {
|
||||
tgtC.tap();
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
// ****************************************
|
||||
@@ -900,15 +878,7 @@ public class AbilityFactory_PermanentState {
|
||||
|
||||
for(int i = 0; i < list.size(); i++) list.get(i).untap();
|
||||
|
||||
if (af.hasSubAbility()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(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();
|
||||
|
||||
if (af.hasSubAbility()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
private static boolean tapAllCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
|
||||
@@ -1409,18 +1371,7 @@ public class AbilityFactory_PermanentState {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
//Phasing? Something else? Who knows!
|
||||
|
||||
@@ -695,18 +695,7 @@ public class AbilityFactory_Pump {
|
||||
}
|
||||
}
|
||||
|
||||
if (AF.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
|
||||
}
|
||||
|
||||
@@ -906,19 +895,7 @@ public class AbilityFactory_Pump {
|
||||
}
|
||||
}
|
||||
|
||||
if (AF.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
private boolean pumpAllTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory){
|
||||
|
||||
@@ -747,17 +747,7 @@ public class AbilityFactory_Reveal {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
private static boolean scryTargetAI(AbilityFactory af, SpellAbility sa) {
|
||||
@@ -1017,18 +1007,7 @@ public class AbilityFactory_Reveal {
|
||||
if (tgt == null || p.canTarget(AF.getHostCard()))
|
||||
AllZoneUtil.rearrangeTopOfLibrary(AF.getHostCard(), p, numCards, shuffle);
|
||||
}
|
||||
if (AF.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
}//end class AbilityFactory_Reveal
|
||||
|
||||
@@ -329,14 +329,7 @@ public class AbilityFactory_Sacrifice {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -453,15 +453,6 @@ public class AbilityFactory_Token extends AbilityFactory {
|
||||
}
|
||||
}
|
||||
|
||||
if (AF.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,17 +393,7 @@ public class AbilityFactory_ZoneAffecting {
|
||||
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
@@ -704,17 +694,7 @@ public class AbilityFactory_ZoneAffecting {
|
||||
if (tgt == null || p.canTarget(af.getHostCard()))
|
||||
p.mill(numCards, destination);
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
@@ -955,17 +935,7 @@ public class AbilityFactory_ZoneAffecting {
|
||||
}
|
||||
}
|
||||
|
||||
if (af.hasSubAbility()){
|
||||
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);
|
||||
}
|
||||
}
|
||||
AbilityFactory.resolveSubAbility(sa);
|
||||
}
|
||||
|
||||
private static String discardStackDescription(AbilityFactory af, SpellAbility sa){
|
||||
|
||||
@@ -2859,6 +2859,7 @@ public class CardFactoryUtil {
|
||||
return tot;
|
||||
}
|
||||
|
||||
/*
|
||||
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
|
||||
// not just the negative ones
|
||||
@@ -3003,7 +3004,7 @@ public class CardFactoryUtil {
|
||||
}
|
||||
}//end MakeToken drawback
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public static int getNumberOfMostProminentCreatureType(CardList list, String type) {
|
||||
list = list.getType(type);
|
||||
|
||||
Reference in New Issue
Block a user