Archived
Add additional checks for stack_next_action_bought
release-tag / release-image (push) Successful in 14s
release-tag / release-image (push) Successful in 14s
Related to legonzaur/heron-realms-front#61
This commit is contained in:
@@ -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):
|
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):
|
async def effect_stack_next_card(_effect: Effect, turn: "Turn", target: str):
|
||||||
|
|||||||
@@ -230,6 +230,13 @@ class Turn(Serializable):
|
|||||||
else:
|
else:
|
||||||
return await self.player.put_on_stack_from_discard(str(card.uuid))
|
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:
|
async def stack_next_card_bought_check(self, card: Card) -> bool:
|
||||||
if card.cost is None:
|
if card.cost is None:
|
||||||
print("You cannot buy a card that doesn't has any cost")
|
print("You cannot buy a card that doesn't has any cost")
|
||||||
|
|||||||
Reference in New Issue
Block a user