mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
test framework: improved aiXXX commands support:
- added more options for priority control (play single priority, play multiple priorities until stack resolved); - added more options for step control (play single step, play multiple steps); - improved compatibility with AI and real time commands (now check commands can be called inside AI controlled steps); - added tests for assign non-blocked damage;
This commit is contained in:
parent
a06935da81
commit
a9bdf2eb18
12 changed files with 342 additions and 88 deletions
|
|
@ -20,8 +20,8 @@ import java.util.List;
|
|||
*/
|
||||
public class MockCard extends CardImpl implements MockableCard {
|
||||
|
||||
static public String ADVENTURE_NAME_SEPARATOR = " // ";
|
||||
static public String MODAL_DOUBLE_FACES_NAME_SEPARATOR = " // ";
|
||||
public static String ADVENTURE_NAME_SEPARATOR = " // ";
|
||||
public static String MODAL_DOUBLE_FACES_NAME_SEPARATOR = " // ";
|
||||
|
||||
// Needs to be here, as it is normally calculated from the
|
||||
// PlaneswalkerEntersWithLoyaltyAbility of the card... but the MockCard
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package mage.constants;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
*/
|
||||
|
|
@ -51,6 +53,13 @@ public enum PhaseStep {
|
|||
return text;
|
||||
}
|
||||
|
||||
public static PhaseStep fromString(String needText) {
|
||||
return Arrays.stream(values())
|
||||
.filter(step -> step.toString().equals(needText))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public String getStepText() {
|
||||
return stepText;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -966,7 +966,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
return false;
|
||||
}
|
||||
|
||||
private static int getLethalDamage(Permanent damaged, Permanent damaging, Game game) {
|
||||
return damaged.getLethalDamage(damaging.getId(), game);
|
||||
private static int getLethalDamage(Permanent blocker, Permanent attacker, Game game) {
|
||||
return blocker.getLethalDamage(attacker.getId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue