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:
Oleg Agafonov 2024-10-26 11:33:32 +04:00
parent a06935da81
commit a9bdf2eb18
12 changed files with 342 additions and 88 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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);
}
}