Spaces:
Running
Running
| from compiler.parser import AbilityParser | |
| from engine.models.ability import EffectType | |
| def test_pl_pr_001_pr_recovery(): | |
| """ | |
| Test PL!-PR-001-PR ability text: | |
| '{{jidou.png|自動}}このメンバーがステージから控え室に置かれたとき、あなたの控え室の「アクティブにする」を持つメンバーを1枚手札に加えてもよい。' | |
| Expected: | |
| - Trigger: ON_LEAVES | |
| - Effect: RECOVER_MEMBER (or ADD_TO_HAND from discard) | |
| - Filter: has_ability='active' | |
| - Should NOT contain EffectType.ACTIVATE_MEMBER | |
| """ | |
| text = "{{jidou.png|自動}}このメンバーがステージから控え室に置かれたとき、あなたの控え室の「アクティブにする」を持つメンバーを1枚手札に加えてもよい。" | |
| abilities = AbilityParser.parse_ability_text(text) | |
| assert len(abilities) == 1 | |
| ab = abilities[0] | |
| # Check trigger | |
| assert ab.trigger == 8 # TriggerType.ON_LEAVES | |
| # Check effect is retrieval, not activation | |
| assert len(ab.effects) == 1 | |
| eff = ab.effects[0] | |
| assert eff.effect_type in [EffectType.RECOVER_MEMBER, EffectType.ADD_TO_HAND] | |
| assert eff.params.get("from") == "discard" | |
| assert eff.params.get("has_ability") == "active" | |
| # Ensure NO Activate effect (ID 29) | |
| assert eff.effect_type != EffectType.ACTIVATE_MEMBER | |