Spaces:
Sleeping
Sleeping
| import pytest | |
| from engine.game.game_state import initialize_game | |
| from engine.models.ability import ConditionType, EffectType | |
| def game_state(): | |
| gs = initialize_game() | |
| return gs | |
| def test_set_blades_parsed_correctly(game_state): | |
| """ | |
| Test PL!SP-bp4-025-L: | |
| - Verify the parser correctly parsed SET_BLADES effect and HAS_MOVED condition. | |
| - Note: This is a LIVE card, so it applies to members during live, not directly placeable on stage. | |
| """ | |
| # Find card in live_db | |
| card_id = -1 | |
| for cid, card in game_state.live_db.items(): | |
| if "PL!SP-bp4-025" in card.card_no: | |
| card_id = cid | |
| break | |
| assert card_id != -1, "Target card PL!SP-bp4-025 not found in live_db" | |
| card = game_state.live_db[card_id] | |
| # Check ability presence | |
| has_set_blades = False | |
| has_moved_condition = False | |
| for ab in card.abilities: | |
| for eff in ab.effects: | |
| if eff.effect_type == EffectType.SET_BLADES: | |
| has_set_blades = True | |
| assert eff.value == 3, f"SET_BLADES value should be 3, got {eff.value}" | |
| for cond in ab.conditions: | |
| if cond.type == ConditionType.HAS_MOVED: | |
| has_moved_condition = True | |
| assert has_set_blades, "Card should have SET_BLADES effect" | |
| assert has_moved_condition, "Card should have HAS_MOVED condition" | |
| def test_flavor_action_mechanic(game_state): | |
| """ | |
| Test LL-PR-004-PR: | |
| - Effect: FLAVOR_ACTION (ask what they like) | |
| """ | |
| # Find card | |
| card_id = -1 | |
| for cid, card in game_state.member_db.items(): | |
| if "LL-PR-004" in card.card_no: | |
| card_id = cid | |
| break | |
| # It might be in live_db if not member | |
| if card_id == -1: | |
| for cid, card in game_state.live_db.items(): | |
| if "LL-PR-004" in card.card_no: | |
| card_id = cid | |
| break | |
| if card_id == -1: | |
| pytest.skip("Target card LL-PR-004 not found in DB") | |
| # Check ability presence | |
| card = game_state.member_db.get(card_id) or game_state.live_db.get(card_id) | |
| has_flavor = False | |
| for ab in card.abilities: | |
| if any(e.effect_type == EffectType.FLAVOR_ACTION for e in ab.effects): | |
| has_flavor = True | |
| assert has_flavor, "Card should have FLAVOR_ACTION effect" | |