Check for faction combos only using locked cards

This commit is contained in:
2024-05-06 14:57:17 +02:00
parent d4c7540b6f
commit 67d7c8005d
+11 -24
View File
@@ -121,53 +121,40 @@ card_effect_all_behaviours = {
# Effect Times
def effect_times_same_faction(effect: Effect, turn: "Turn"):
times = 0
for c in turn.player.board:
if c.faction == effect.card.faction and c in turn.cards_locked:
for c in turn.cards_locked:
if c.faction == effect.card.faction:
times += 1
return times
def effect_times_other_same_faction(effect: Effect, turn: "Turn"):
times = 0
for c in turn.player.board:
if (
c.faction == effect.card.faction
and c != effect.card
and c in turn.cards_locked
):
for c in turn.cards_locked:
if c.faction == effect.card.faction and c != effect.card:
times += 1
return times
def effect_times_champion(effect: Effect, turn: "Turn"):
times = 0
for c in turn.player.board:
if c.card_type == CardType.CHAMPION and c in turn.cards_locked:
for c in turn.cards_locked:
if c.card_type == CardType.CHAMPION:
times += 1
return times
def effect_times_other_champion(effect: Effect, turn: "Turn"):
times = 0
for c in turn.player.board:
if (
c.card_type == CardType.CHAMPION
and c != effect.card
and c in turn.cards_locked
):
for c in turn.cards_locked:
if c.card_type == CardType.CHAMPION and c != effect.card:
times += 1
return times
def effect_times_other_guard(effect: Effect, turn: "Turn"):
times = 0
for c in turn.player.board:
if (
c.card_type == CardType.CHAMPION
and c.guard is True
and c != effect.card
and c in turn.cards_locked
):
for c in turn.cards_locked:
if c.card_type == CardType.CHAMPION and c.guard is True and c != effect.card:
times += 1
return times
@@ -183,7 +170,7 @@ effect_times_all_behaviours = {
def create_effect_behaviour(effect: EffectParser) -> Awaitable[None]:
async def effect_type_behaviour(_e: Effect, _t: "Turn"):
async def effect_type_behaviour(e: Effect, t: "Turn"):
return True
if effect.effect_type in effect_types_all_behaviours: