File size: 1,553 Bytes
bb3fbf9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pytest

from engine.game.game_state import initialize_game


def get_card_id(gs, card_no):
    for cid, card in gs.member_db.items():
        if card.card_no == card_no:
            return cid
    pytest.fail(f"Card {card_no} not found")


def test_plhs_bp2_017_n_ability():
    gs = initialize_game(use_real_data=True)
    gs.verbose = True
    player = gs.players[gs.current_player]

    # 1. Test without 10 cards in discard
    card_id = get_card_id(gs, "PL!HS-bp2-017-N")
    player.hand = [card_id]
    player.discard = [1, 2, 3, 4, 5, 6, 7, 8, 9]  # 9 cards

    initial_hand_size = len(player.hand)

    # Place card on stage (triggers TOUJYOU)
    # Action 1: hand[0] to area 0
    gs._execute_action(1)

    # Hand size should be 0 (no draw)
    assert len(player.hand) == 0
    assert len(gs.triggered_abilities) == 0

    # 2. Test with 10 cards in discard
    gs = initialize_game(use_real_data=True)
    player = gs.players[gs.current_player]
    card_id = get_card_id(gs, "PL!HS-bp2-017-N")
    player.hand = [card_id]
    player.discard = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]  # 10 cards

    # Action 1: hand[0] to area 1
    gs._execute_action(2)

    # Hand size should be 1 (drew a card)
    # Note: apply_action processes triggers automatically if they don't require choice
    # DRAW(1) doesn't require choice, so it should happen immediately.
    assert len(player.hand) == 1
    print("Verification successful!")


if __name__ == "__main__":
    test_plhs_bp2_017_n_ability()