- Changed Prowl to be used for other Creature types than Rogue.

This commit is contained in:
Sloth
2011-08-24 16:53:06 +00:00
parent 99d06c01be
commit 0bea97b042
4 changed files with 40 additions and 16 deletions

View File

@@ -479,8 +479,8 @@ public class Phase extends MyObservable implements java.io.Serializable {
Player nextTurn = extraTurns.isEmpty() ? getPlayerTurn().getOpponent() : extraTurns.pop(); Player nextTurn = extraTurns.isEmpty() ? getPlayerTurn().getOpponent() : extraTurns.pop();
AllZone.resetZoneMoveTracking(); AllZone.resetZoneMoveTracking();
AllZone.getComputerPlayer().setProwl(false); AllZone.getComputerPlayer().resetProwl();
AllZone.getHumanPlayer().setProwl(false); AllZone.getHumanPlayer().resetProwl();
return skipTurnTimeVault(nextTurn); return skipTurnTimeVault(nextTurn);
} }

View File

@@ -5,6 +5,7 @@ import forge.card.cardFactory.CardFactoryUtil;
import forge.card.mana.ManaPool; import forge.card.mana.ManaPool;
import forge.card.spellability.Ability; import forge.card.spellability.Ability;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
import forge.card.trigger.Trigger;
import javax.swing.*; import javax.swing.*;
import java.util.*; import java.util.*;
@@ -32,7 +33,7 @@ public abstract class Player extends MyObservable {
protected int nTurns = 0; protected int nTurns = 0;
protected boolean skipNextUntap = false; protected boolean skipNextUntap = false;
protected boolean prowl = false; protected ArrayList<String> prowl = new ArrayList<String>();
protected int maxLandsToPlay = 1; protected int maxLandsToPlay = 1;
protected int numLandsPlayed = 0; protected int numLandsPlayed = 0;
@@ -91,7 +92,7 @@ public abstract class Player extends MyObservable {
loseConditionSpell = null; loseConditionSpell = null;
maxLandsToPlay = 1; maxLandsToPlay = 1;
numLandsPlayed = 0; numLandsPlayed = 0;
prowl = false; prowl = new ArrayList<String>();
handSizeOperations = new ArrayList<HandSizeOp>(); handSizeOperations = new ArrayList<HandSizeOp>();
keywords.clear(); keywords.clear();
@@ -377,8 +378,11 @@ public abstract class Player extends MyObservable {
GameActionUtil.executeDamageDealingEffects(source, damageToDo); GameActionUtil.executeDamageDealingEffects(source, damageToDo);
GameActionUtil.executeDamageToPlayerEffects(this, source, damageToDo); GameActionUtil.executeDamageToPlayerEffects(this, source, damageToDo);
if(isCombat && source.isType("Rogue")) if(isCombat) {
source.getController().setProwl(true); ArrayList<String> types = source.getType();
for (String type : types)
source.getController().addProwlType(type);
}
//Run triggers //Run triggers
HashMap<String, Object> runParams = new HashMap<String, Object>(); HashMap<String, Object> runParams = new HashMap<String, Object>();
@@ -1630,12 +1634,16 @@ public abstract class Player extends MyObservable {
* *
* @return a boolean. * @return a boolean.
*/ */
public boolean hasProwl() { public boolean hasProwl(String type) {
return prowl; return prowl.contains(type);
} }
public void setProwl(boolean newProwl) { public void addProwlType(String type) {
prowl = newProwl; prowl.add(type);
}
public void resetProwl() {
prowl = new ArrayList<String>();
} }
private ArrayList<HandSizeOp> handSizeOperations; private ArrayList<HandSizeOp> handSizeOperations;

View File

@@ -5,6 +5,7 @@ import forge.*;
import forge.card.abilityFactory.AbilityFactory; import forge.card.abilityFactory.AbilityFactory;
import forge.card.cardFactory.CardFactoryUtil; import forge.card.cardFactory.CardFactoryUtil;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
/** /**
@@ -39,7 +40,14 @@ public class SpellAbility_Restriction extends SpellAbility_Variables {
if (value.equals("Threshold")) setThreshold(true); if (value.equals("Threshold")) setThreshold(true);
if (value.equals("Metalcraft")) setMetalcraft(true); if (value.equals("Metalcraft")) setMetalcraft(true);
if (value.equals("Hellbent")) setHellbent(true); if (value.equals("Hellbent")) setHellbent(true);
if (value.equals("Prowl")) setProwl(true); if (value.startsWith("Prowl")) {
ArrayList<String> prowlTypes = new ArrayList<String>();
prowlTypes.add("Rogue");
if(value.split("Prowl").length > 1) {
prowlTypes.add(value.split("Prowl")[1]);
}
setProwl(prowlTypes);
}
} }
if (params.containsKey("ActivationZone")) if (params.containsKey("ActivationZone"))
@@ -181,10 +189,18 @@ public class SpellAbility_Restriction extends SpellAbility_Variables {
if (!activator.hasMetalcraft()) if (!activator.hasMetalcraft())
return false; return false;
} }
if (prowl) { if (prowl != null) {
if (!activator.hasProwl()) //only true if the activating player has damaged the opponent with one of the specified types
boolean prowlFlag = false;
for (String type : prowl) {
if (activator.hasProwl(type)) {
prowlFlag = true;
}
}
if (!prowlFlag) {
return false; return false;
} }
}
if (sIsPresent != null) { if (sIsPresent != null) {
CardList list = AllZoneUtil.getCardsInZone(presentZone); CardList list = AllZoneUtil.getCardsInZone(presentZone);

View File

@@ -40,7 +40,7 @@ public class SpellAbility_Variables {
protected boolean threshold = false; protected boolean threshold = false;
protected boolean metalcraft = false; protected boolean metalcraft = false;
protected boolean hellbent = false; protected boolean hellbent = false;
protected boolean prowl = false; protected ArrayList<String> prowl = null;
protected String sIsPresent = null; protected String sIsPresent = null;
protected String presentCompare = "GE1"; // Default Compare to Greater or Equal to 1 protected String presentCompare = "GE1"; // Default Compare to Greater or Equal to 1
@@ -268,8 +268,8 @@ public class SpellAbility_Variables {
* *
* @param bProwl a boolean. * @param bProwl a boolean.
*/ */
public void setProwl(boolean bProwl) { public void setProwl(ArrayList<String> types) {
prowl = bProwl; prowl = types;
} }
//IsPresent for Valid battlefield stuff //IsPresent for Valid battlefield stuff