mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Some minor adjustements to test handling.
This commit is contained in:
parent
70480ebb5e
commit
1f44e1a592
3 changed files with 15 additions and 3 deletions
|
@ -71,6 +71,7 @@ import mage.target.TargetSource;
|
|||
import mage.target.TargetSpell;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetPermanentOrPlayer;
|
||||
import static org.mage.test.serverside.base.CardTestPlayerBase.NO_TARGET;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -134,7 +135,7 @@ public class TestPlayer extends ComputerPlayer {
|
|||
for (Ability ability: this.getPlayable(game, true)) {
|
||||
if (ability.toString().startsWith(groups[0])) {
|
||||
Ability newAbility = ability.copy();
|
||||
if (groups.length > 1) {
|
||||
if (groups.length > 1 && !groups[1].equals("target=NO_TARGET")) {
|
||||
if (!addTargets(newAbility, groups, game)) {
|
||||
// targets could not be set -> try next priority
|
||||
break;
|
||||
|
@ -543,7 +544,7 @@ public class TestPlayer extends ComputerPlayer {
|
|||
return null;
|
||||
}
|
||||
|
||||
private boolean checkExecuteCondition(String[] groups, Game game) {
|
||||
private boolean checkExecuteCondition(String[] groups, Game game) {
|
||||
if (groups[2].startsWith("spellOnStack=")) {
|
||||
String spellOnStack = groups[2].substring(13);
|
||||
for (StackObject stackObject: game.getStack()) {
|
||||
|
|
|
@ -31,6 +31,8 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl;
|
|||
*/
|
||||
public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl {
|
||||
|
||||
public static final String NO_TARGET = "NO_TARGET";
|
||||
|
||||
protected enum ExpectedType {
|
||||
TURN_NUMBER,
|
||||
RESULT,
|
||||
|
@ -39,7 +41,7 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl {
|
|||
GRAVEYARD,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
|
||||
protected GameOptions gameOptions;
|
||||
|
||||
public CardTestPlayerBase() {
|
||||
|
|
|
@ -796,6 +796,15 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
player.addAction(turnNum, step, "activate:" + ability + "$target=" + targetName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param turnNum
|
||||
* @param step
|
||||
* @param player
|
||||
* @param ability
|
||||
* @param targetName if not target has to be defined use the constant NO_TARGET
|
||||
* @param spellOnStack
|
||||
*/
|
||||
public void activateAbility(int turnNum, PhaseStep step, TestPlayer player, String ability, String targetName, String spellOnStack) {
|
||||
StringBuilder sb = new StringBuilder("activate:").append(ability);
|
||||
if (targetName != null && !targetName.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue