hearthbreaker
hearthbreaker copied to clipboard
Tried to put back a card that hadn't been used yet
Sorry, I messed up and forgot the decks.
Traceback (most recent call last):
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\uct.py", line 583, in UCTPlayGame
m = UCT(rootstate = state, seconds = 12000, verbose = False)
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\uct.py", line 553, in UCT
state.DoMove(random.choice(state.GetMoves()))
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\uct.py", line 177, in DoMove
self.game.current_player.minions[move[3]].attack()
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\game_objects.py", line 943, in attack
super().attack()
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\game_objects.py", line 455, in attack
self.player.game.check_delayed()
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\engine.py", line 91, in check_delayed
minion.activate_delayed()
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\game_objects.py", line 526, in activate_delayed
self.trigger(delayed['event'], *delayed['args'])
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\game_objects.py", line 130, in trigger
handler[0](*args)
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\game_objects.py", line 967, in delayed_death
rattle.do(self)
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\tags\base.py", line 566, in do
super().do(target)
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\tags\base.py", line 539, in do
action.act(owner, t, other)
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\tags\action.py", line 330, in act
target.deck.put_back(self.card.get_card(target, target, actor))
File "C:\Users\Ragowit\Documents\GitHub\mcts\hearthbreaker\hearthbreaker\engine.py", line 565, in put_back
raise GameException("Tried to put back a card that hadn't been used yet")
hearthbreaker.game_objects.GameException: Tried to put back a card that hadn't been used yet
Will try reproduce, with deck information.
Looks like Malorne was the root of the problem, but I don't know why. Maybe he came out of a sneeds/webspinner/unstable portal.
Now, I think the problem is that when Malorne comes out of an unstable portal or whichever, his card isn't set as "drawn." So then when he's added back into the deck, it has a problem. It's easy to fix if this is the problem, but I can't think of how to test this to verify the situation, since it requires getting the right card out of random chance.
Maybe an ugly solution, but can we create a testcard of Unstable Portal which can only get Malorne? Would that work?
Or create a test and then iterate through random seed until we find one that summons Malorne, and then scratch the iteration and use the seed number?
for i in range(10000):
random.seed(i)
game = ... test case
Once found:
random.seed(268)
game = ... test case
So, I followed your suggestion about a Malorne specific Unstable Portal, and it passed just fine. Then I thought it might be mindgames, but that one works fine as well. Basically, I can't seem to find a way to cause this error.
Maybe put this one on hold until I get the error again with deck information.