mirror of
https://github.com/correl/mage.git
synced 2024-12-29 11:09:17 +00:00
Some tests fixes. Returned back checking for repeated action with the fix.
This commit is contained in:
parent
f4b87c4c28
commit
dc2ebdd16d
5 changed files with 6 additions and 5 deletions
Binary file not shown.
|
@ -486,8 +486,8 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
Game sim = game.copy();
|
||||
if (sim.getPlayer(currentPlayer.getId()).activateAbility((ActivatedAbility) action.copy(), sim)) {
|
||||
sim.applyEffects();
|
||||
//if (checkForRepeatedAction(sim, node, action, currentPlayer.getId()))
|
||||
//continue;
|
||||
if (checkForRepeatedAction(sim, node, action, currentPlayer.getId()))
|
||||
continue;
|
||||
if (!sim.isGameOver() && action.isUsesStack()) {
|
||||
// only pass if the last action uses the stack
|
||||
sim.getPlayer(currentPlayer.getId()).pass();
|
||||
|
@ -839,7 +839,7 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
return sim;
|
||||
}
|
||||
|
||||
/*private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
|
||||
private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
|
||||
if (action instanceof PassAbility)
|
||||
return false;
|
||||
int val = GameStateEvaluator2.evaluate(playerId, sim);
|
||||
|
@ -848,12 +848,12 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
test = test.getParent();
|
||||
}
|
||||
if (test != null && test.getAbilities() != null && test.getAbilities().size() == 1) {
|
||||
if (action.toString().equals(test.getAbilities().get(0).toString()) && GameStateEvaluator2.evaluate(playerId, sim) == val) {
|
||||
if (action.toString().equals(test.getAbilities().get(0).toString()) && GameStateEvaluator2.evaluate(playerId, test.getGame()) == val) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
}
|
||||
|
||||
protected void getSuggestedActions() {
|
||||
try {
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -33,6 +33,7 @@ public class LevelUpAbilityTest extends CardTestBase {
|
|||
System.out.println(counter.getKey() + " : " + counter.getValue().getName() + " : " + counter.getValue().getCount());
|
||||
}
|
||||
|
||||
Assert.assertNotNull(master.getCounters());
|
||||
Assert.assertFalse(master.getCounters().isEmpty());
|
||||
Assert.assertEquals(12, master.getCounters().getCount(CounterType.LEVEL));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue