Spaces:
Running
Running
| import numpy as np | |
| from pytest_bdd import given, scenario, then, when | |
| from engine.models.ability import Condition, ConditionType | |
| from engine.models.card import MemberCard | |
| from engine.models.enums import Group | |
| def test_group_filter(): | |
| pass | |
| def test_cost_check(): | |
| pass | |
| def test_opponent_has(): | |
| pass | |
| def cond_group(): | |
| return Condition(ConditionType.GROUP_FILTER, {"group": "Aqours"}) | |
| def member_aqours(game_state): | |
| m = MemberCard( | |
| 1, "A1", "Aq", 1, np.zeros(7, dtype=int), np.zeros(7, dtype=int), 1, groups=[Group.from_japanese_name("Aqours")] | |
| ) | |
| game_state.member_db[1] = m | |
| return {"card_id": 1} | |
| def check_condition_member(game_state, cond, context): | |
| p0 = game_state.players[0] | |
| return game_state._check_condition(p0, cond, context=context) | |
| def check_true(result): | |
| assert result is True | |
| def cond_cost_le(): | |
| return Condition(ConditionType.COST_CHECK, {"value": 3, "comparison": "LE"}) | |
| def member_cost_3(game_state): | |
| m = MemberCard(2, "C3", "Cost3", 3, np.zeros(7, dtype=int), np.zeros(7, dtype=int), 1) | |
| game_state.member_db[2] = m | |
| return {"card_id": 2} | |
| def cond_opponent_has(): | |
| return Condition(ConditionType.OPPONENT_HAS) | |
| def opponent_has_stage(game_state): | |
| p1 = game_state.players[1] | |
| m = MemberCard(100, "O1", "Opp", 1, np.zeros(7, dtype=int), np.zeros(7, dtype=int), 1) | |
| game_state.member_db[100] = m | |
| p1.stage[0] = 100 | |
| def check_condition_general(game_state, cond): | |
| p0 = game_state.players[0] | |
| return game_state._check_condition(p0, cond) | |