Add additional checks for stack_next_action_bought
release-tag / release-image (push) Successful in 14s

Related to legonzaur/heron-realms-front#61
This commit is contained in:
2024-05-17 14:13:42 +02:00
parent 699ffe6398
commit d9665fdb6c
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ async def effect_restack_discarded(_effect: Effect, turn: "Turn", target: str):
async def effect_stack_next_action(_effect: Effect, turn: "Turn", target: str):
return await turn.buy_card(target, turn.player.buy_on_stack)
return await turn.buy_card(target, turn.player.stack_next_action_bought_check)
async def effect_stack_next_card(_effect: Effect, turn: "Turn", target: str):
+7
View File
@@ -230,6 +230,13 @@ class Turn(Serializable):
else:
return await self.player.put_on_stack_from_discard(str(card.uuid))
async def stack_next_action_bought_check(self, card: Card) -> bool:
if card.card_type != CardType.ACTION:
print("You can only buy actions with this effect!")
return False
return await self.stack_next_card_bought_check(card)
async def stack_next_card_bought_check(self, card: Card) -> bool:
if card.cost is None:
print("You cannot buy a card that doesn't has any cost")