コード例 #1
0
ファイル: game_init.py プロジェクト: neuront/sgs
def statuses_mode(players_tokens):
    if len(players_tokens) < 2:
        raise ValueError('too few players, need at least 2')
    if 8 < len(players_tokens):
        raise ValueError('too much players, need at most 8')
    random.shuffle(players_tokens)

    players = [Player(t) for t in players_tokens]
    pc = PlayersControl()
    for p in players: pc.add_player(p)

    gc = GameControl(EventList(), CardPool.create(), pc, ActionStack())
    gc.game_init(players)

    host = players[0]
    others = players[1:]
    def after_host_selected():
        gc.push_frame(_SelectCharacter(
                    gc, others,
                    { p.token: characters_select_dict(random_pick_characters(3))
                            for p in others },
                    gc.start))
    gc.push_frame(_SelectCharacter(
              gc, [host],
              { host.token: characters_select_dict(random_pick_characters(3)) },
              after_host_selected))
    return gc
コード例 #2
0
ファイル: test_frames.py プロジェクト: linluxiang/sgs
def make_gc():
    class FakeCardPool:
        def cards_by_ids(self, ids):
            return map(lambda i: cards[i], ids)

        def discard(self, cards):
            pass

    class FakeActionStack:
        def pop(self):
            pass

    return GameControl(EventList(), FakeCardPool(), None, FakeActionStack())
コード例 #3
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('-chitu', 5, card.HEART),
            test_data.CardInfo('-dawan', 13, card.SPADE),
            test_data.CardInfo('+jueying', 5, card.SPADE),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('steal', 7, card.CLUB),
            test_data.CardInfo('duel', 8, card.DIAMOND),
            test_data.CardInfo('-zixing', 13, card.DIAMOND),
            test_data.CardInfo('+dilu', 5, card.CLUB),

            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('steal', 9, card.HEART),
            test_data.CardInfo('steal', 10, card.CLUB),

            test_data.CardInfo('steal', 9, card.HEART),
            test_data.CardInfo('steal', 10, card.CLUB),
     ])), pc, ActionStack())
players = [Player(19, 3), Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards
コード例 #4
0
ファイル: test_heavenly_scent.py プロジェクト: linluxiang/sgs
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('rattan armor', 2, card.SPADE),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('fire attack', 7, card.HEART),
            test_data.CardInfo('duel', 8, card.HEART),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.HEART),

            test_data.CardInfo('dodge', 13, card.DIAMOND),
            test_data.CardInfo('dodge', 1, card.DIAMOND),
            test_data.CardInfo('dodge', 2, card.DIAMOND),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
heavenly_scent.add_to(players[0])
gc.start()
コード例 #5
0
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('fire attack', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
            test_data.CardInfo('fire attack', 4, card.HEART),
            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('dodge', 8, card.DIAMOND),
            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.DIAMOND),
        ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0))  # until getting cards

# cards:
コード例 #6
0
ファイル: test_duel.py プロジェクト: neuront/sgs
import core.src.card as card
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('duel', 1, card.SPADE),
            test_data.CardInfo('arson attack', 2, card.HEART),
            test_data.CardInfo('slash', 3, card.DIAMOND),
            test_data.CardInfo('duel', 4, card.SPADE),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('slash', 8, card.DIAMOND),

            test_data.CardInfo('duel', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

assert_eq({
    'code': ret_code.OK,
    'action': 'use',
コード例 #7
0
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('duel', 1, card.SPADE),
            test_data.CardInfo('zhangba serpent spear', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.DIAMOND),
            test_data.CardInfo('dodge', 4, card.DIAMOND),
            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('sabotage', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('slash', 8, card.DIAMOND),
            test_data.CardInfo('duel', 9, card.SPADE),
            test_data.CardInfo('zhangba serpent spear', 10, card.HEART),
        ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0))  # until getting cards

result = gc.player_act({
    'token': players[0].token,
コード例 #8
0
from test_common import *
import test_data

players = [Player(19, 3), Player(91, 3), Player(1729, 3)]
pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('peach', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.HEART),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('fire attack', 7, card.HEART),
            test_data.CardInfo('peach', 8, card.HEART),

            test_data.CardInfo('peach', 9, card.HEART),
            test_data.CardInfo('peach', 10, card.HEART),
            test_data.CardInfo('peach', 11, card.HEART),
            test_data.CardInfo('peach', 12, card.HEART),

            test_data.CardInfo('slash', 13, card.SPADE),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('dodge', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.HEART),
     ])), pc, ActionStack())
map(lambda p: pc.add_player(p), players)
gc.start()

# cards:
# name         | rank | id | suit
コード例 #9
0
ファイル: test_youth_beauty.py プロジェクト: neuront/sgs
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('rattan armor', 2, card.SPADE),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('arson attack', 7, card.HEART),
            test_data.CardInfo('duel', 8, card.HEART),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.HEART),

            test_data.CardInfo('slash', 13, card.CLUB),
            test_data.CardInfo('dodge', 1, card.DIAMOND),
            test_data.CardInfo('dodge', 2, card.DIAMOND),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
heavenly_scent.add_to(players[0])
youth_beauty.add_to(players[0])
gc.start()
コード例 #10
0
ファイル: test_fire_attack.py プロジェクト: linluxiang/sgs
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('fire attack', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
            test_data.CardInfo('fire attack', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('dodge', 8, card.DIAMOND),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

# cards:
コード例 #11
0
ファイル: test_sabotage.py プロジェクト: neuront/sgs
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards(
            [
                test_data.CardInfo("sabotage", 1, card.SPADE),
                test_data.CardInfo("sabotage", 2, card.SPADE),
                test_data.CardInfo("sabotage", 3, card.SPADE),
                test_data.CardInfo("sabotage", 4, card.SPADE),
                test_data.CardInfo("slash", 5, card.SPADE),
                test_data.CardInfo("dodge", 6, card.HEART),
                test_data.CardInfo("slash", 7, card.CLUB),
                test_data.CardInfo("dodge", 8, card.DIAMOND),
                test_data.CardInfo("sabotage", 9, card.HEART),
                test_data.CardInfo("sabotage", 10, card.CLUB),
            ]
        )
    ),
    pc,
    ActionStack(),
)
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0))  # until getting cards
コード例 #12
0
ファイル: test_sabotage.py プロジェクト: linluxiang/sgs
import core.src.card as card
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('sabotage', 1, card.SPADE),
            test_data.CardInfo('sabotage', 2, card.SPADE),
            test_data.CardInfo('sabotage', 3, card.SPADE),
            test_data.CardInfo('sabotage', 4, card.SPADE),

            test_data.CardInfo('slash', 5, card.SPADE),
            test_data.CardInfo('dodge', 6, card.HEART),
            test_data.CardInfo('slash', 7, card.CLUB),
            test_data.CardInfo('dodge', 8, card.DIAMOND),

            test_data.CardInfo('sabotage', 9, card.HEART),
            test_data.CardInfo('sabotage', 10, card.CLUB),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

# cards:
# name     | rank (id = rank - 1) | suit
コード例 #13
0
ファイル: test_steal.py プロジェクト: neuront/sgs
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('-chitu', 5, card.HEART),
            test_data.CardInfo('-dawan', 13, card.SPADE),
            test_data.CardInfo('+jueying', 5, card.SPADE),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('steal', 7, card.CLUB),
            test_data.CardInfo('duel', 8, card.DIAMOND),
            test_data.CardInfo('-zixing', 13, card.DIAMOND),
            test_data.CardInfo('+dilu', 5, card.CLUB),

            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('steal', 9, card.HEART),
            test_data.CardInfo('steal', 10, card.CLUB),

            test_data.CardInfo('steal', 9, card.HEART),
            test_data.CardInfo('steal', 10, card.CLUB),
     ])), pc, ActionStack())
players = [Player(19, 3), Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards
コード例 #14
0
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('rattan armor', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),
            test_data.CardInfo('steal', 5, card.CLUB),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.HEART),
            test_data.CardInfo('duel', 8, card.HEART),
            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),
            test_data.CardInfo('fire attack', 11, card.CLUB),
            test_data.CardInfo('dodge', 12, card.HEART),
        ])), pc, ActionStack())
players = [Player(91, 8), Player(1729, 8)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0))  # until getting cards

# cards:
コード例 #15
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards(
            [
                test_data.CardInfo("sabotage", 1, card.SPADE),
                test_data.CardInfo("rattan armor", 2, card.SPADE),
                test_data.CardInfo("sabotage", 3, card.SPADE),
                test_data.CardInfo("sabotage", 4, card.SPADE),
                test_data.CardInfo("sabotage", 5, card.SPADE),
                test_data.CardInfo("sabotage", 6, card.HEART),
                test_data.CardInfo("sabotage", 7, card.CLUB),
                test_data.CardInfo("sabotage", 8, card.DIAMOND),
                test_data.CardInfo("sabotage", 9, card.HEART),
                test_data.CardInfo("sabotage", 10, card.CLUB),
                test_data.CardInfo("sabotage", 11, card.HEART),
                test_data.CardInfo("sabotage", 12, card.CLUB),
            ]
        )
    ),
    pc,
    ActionStack(),
)
players = [Player(91, 1), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()
コード例 #16
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('arson attack', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('dodge', 5, card.HEART),
            test_data.CardInfo('dodge', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.HEART),
            test_data.CardInfo('dodge', 8, card.HEART),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.HEART),
            test_data.CardInfo('dodge', 13, card.HEART),
            test_data.CardInfo('duel', 1, card.DIAMOND),

            test_data.CardInfo('dodge', 2, card.DIAMOND),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
bequeathed_strategy.add_to(players[0])
gc.start()
コード例 #17
0
ファイル: test_arson_attack.py プロジェクト: neuront/sgs
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('arson attack', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
            test_data.CardInfo('arson attack', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('dodge', 8, card.DIAMOND),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

assert_eq({
コード例 #18
0
ファイル: test_fury_pith.py プロジェクト: neuront/sgs
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player
import ext.src.skills.fury_pith as fury_pith

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('+jueying', 5, card.SPADE),
            test_data.CardInfo('duel', 2, card.HEART),
            test_data.CardInfo('duel', 3, card.HEART),
            test_data.CardInfo('duel', 4, card.HEART),

            test_data.CardInfo('dodge', 5, card.DIAMOND),
            test_data.CardInfo('slash', 6, card.HEART),
            test_data.CardInfo('slash', 7, card.HEART),
            test_data.CardInfo('slash', 8, card.HEART),

            test_data.CardInfo('duel', 9, card.HEART),
            test_data.CardInfo('duel', 10, card.HEART),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
fury_pith.add_to(players[1])
gc.start()

# cards:
# name     | rank | id | suit

# +jueying | 1    | 0  | SPADE
コード例 #19
0
ファイル: test_peach.py プロジェクト: neuront/sgs
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('slash', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('peach', 6, card.HEART),
            test_data.CardInfo('peach', 7, card.DIAMOND),
            test_data.CardInfo('peach', 8, card.DIAMOND),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 5), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

result = gc.player_act({
    'token': players[0].token,
    'action': 'card',
コード例 #20
0
ファイル: test_suicide.py プロジェクト: linluxiang/sgs
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('fire attack', 1, card.HEART),
            test_data.CardInfo('slash', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),
            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('slash', 6, card.CLUB),
            test_data.CardInfo('slash', 7, card.CLUB),
            test_data.CardInfo('slash', 8, card.CLUB),
            test_data.CardInfo('slash', 9, card.CLUB),
            test_data.CardInfo('slash', 10, card.CLUB),
            test_data.CardInfo('slash', 11, card.CLUB),
            test_data.CardInfo('slash', 12, card.CLUB),
            test_data.CardInfo('slash', 13, card.CLUB),
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('slash', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.SPADE),
            test_data.CardInfo('slash', 4, card.SPADE),
            test_data.CardInfo('slash', 5, card.SPADE),
            test_data.CardInfo('slash', 6, card.SPADE),
            test_data.CardInfo('slash', 7, card.SPADE),
        ])), pc, ActionStack())
players = [Player(19, 1), Player(91, 1), Player(1729, 1)]
map(lambda p: pc.add_player(p), players)
gc.start()
コード例 #21
0
from test_common import *
import test_data

players = [Player(19, 3), Player(91, 3), Player(1729, 3)]
pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('peach', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.HEART),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('arson attack', 7, card.HEART),
            test_data.CardInfo('peach', 8, card.HEART),

            test_data.CardInfo('peach', 9, card.HEART),
            test_data.CardInfo('peach', 10, card.HEART),
            test_data.CardInfo('peach', 11, card.HEART),
            test_data.CardInfo('peach', 12, card.HEART),

            test_data.CardInfo('slash', 13, card.SPADE),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('dodge', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.HEART),
     ])), pc, ActionStack())
map(lambda p: pc.add_player(p), players)
gc.start()

# cards:
# name         | rank | id | suit
コード例 #22
0
from test_common import *
import test_data

players = [Player(19, 3), Player(91, 3), Player(1729, 3)]
pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('peach', 4, card.HEART),
            test_data.CardInfo('slash', 5, card.HEART),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('fire attack', 7, card.HEART),
            test_data.CardInfo('peach', 8, card.HEART),
            test_data.CardInfo('peach', 9, card.HEART),
            test_data.CardInfo('peach', 10, card.HEART),
            test_data.CardInfo('peach', 11, card.HEART),
            test_data.CardInfo('peach', 12, card.HEART),
            test_data.CardInfo('slash', 13, card.SPADE),
            test_data.CardInfo('slash', 1, card.CLUB),
            test_data.CardInfo('dodge', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.HEART),
        ])), pc, ActionStack())
map(lambda p: pc.add_player(p), players)
gc.start()

# cards:
# name         | rank | id | suit
コード例 #23
0
import core.src.card as card
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
    test_data.CardInfo('duel', 1, card.SPADE),
    test_data.CardInfo('zhangba serpent spear', 2, card.SPADE),
    test_data.CardInfo('slash', 3, card.DIAMOND),
    test_data.CardInfo('dodge', 4, card.DIAMOND),

    test_data.CardInfo('slash', 5, card.CLUB),
    test_data.CardInfo('sabotage', 6, card.HEART),
    test_data.CardInfo('dodge', 7, card.DIAMOND),
    test_data.CardInfo('slash', 8, card.DIAMOND),

    test_data.CardInfo('duel', 9, card.SPADE),
    test_data.CardInfo('zhangba serpent spear', 10, card.HEART),
])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

assert_eq({
    'code': ret_code.OK,
    'action': 'use',
コード例 #24
0
ファイル: test_rattan_armor.py プロジェクト: neuront/sgs
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('rattan armor', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('steal', 5, card.CLUB),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.HEART),
            test_data.CardInfo('duel', 8, card.HEART),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),

            test_data.CardInfo('arson attack', 11, card.CLUB),
            test_data.CardInfo('dodge', 12, card.HEART),
     ])), pc, ActionStack())
players = [Player(91, 8), Player(1729, 8)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

# cards:
コード例 #25
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('-chitu', 5, card.HEART),
            test_data.CardInfo('-dawan', 13, card.SPADE),
            test_data.CardInfo('+jueying', 5, card.SPADE),
            test_data.CardInfo('slash', 1, card.CLUB),

            test_data.CardInfo('-zixing', 13, card.DIAMOND),
            test_data.CardInfo('+dilu', 5, card.CLUB),
            test_data.CardInfo('+hualiu', 5, card.DIAMOND),
            test_data.CardInfo('duel', 2, card.SPADE),

            test_data.CardInfo('sabotage', 3, card.HEART),
            test_data.CardInfo('dodge', 4, card.DIAMOND),
            test_data.CardInfo('slash', 5, card.DIAMOND),
            test_data.CardInfo('slash', 6, card.SPADE),

            test_data.CardInfo('+zhuahuangfeidian', 5, card.HEART),
            test_data.CardInfo('zhangba serpent spear', 7, card.HEART),

            test_data.CardInfo('slash', 8, card.SPADE),
            test_data.CardInfo('slash', 9, card.HEART),
     ])), pc, ActionStack())
players = [Player(19, 4), Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

assert_eq(0, gc.distance_between(players[0], players[0]))
コード例 #26
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('fire attack', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('dodge', 5, card.HEART),
            test_data.CardInfo('dodge', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.HEART),
            test_data.CardInfo('dodge', 8, card.HEART),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.HEART),
            test_data.CardInfo('dodge', 13, card.HEART),
            test_data.CardInfo('duel', 1, card.DIAMOND),

            test_data.CardInfo('dodge', 2, card.DIAMOND),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
bequeathed_strategy.add_to(players[0])
gc.start()
コード例 #27
0
ファイル: test_fury_pith.py プロジェクト: linluxiang/sgs
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards(
            [
                test_data.CardInfo("+jueying", 5, card.SPADE),
                test_data.CardInfo("duel", 2, card.HEART),
                test_data.CardInfo("duel", 3, card.HEART),
                test_data.CardInfo("duel", 4, card.HEART),
                test_data.CardInfo("dodge", 5, card.DIAMOND),
                test_data.CardInfo("slash", 6, card.HEART),
                test_data.CardInfo("slash", 7, card.HEART),
                test_data.CardInfo("slash", 8, card.HEART),
                test_data.CardInfo("duel", 9, card.HEART),
                test_data.CardInfo("duel", 10, card.HEART),
            ]
        )
    ),
    pc,
    ActionStack(),
)
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
fury_pith.add_to(players[1])
gc.start()
コード例 #28
0
ファイル: test_player.py プロジェクト: neuront/sgs
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('arson attack', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
            test_data.CardInfo('arson attack', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('dodge', 8, card.DIAMOND),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),

            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.DIAMOND),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

# cards:
# name         | rank (id = rank - 1) | suit
コード例 #29
0
ファイル: test_game_control.py プロジェクト: neuront/sgs
from test_common import *
import test_data
import fake_players_control
import fake_player

pc = fake_players_control.PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('slash', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.SPADE),
            test_data.CardInfo('slash', 4, card.SPADE),
            test_data.CardInfo('slash', 5, card.SPADE),
            test_data.CardInfo('slash', 6, card.SPADE),
            test_data.CardInfo('slash', 7, card.SPADE),
            test_data.CardInfo('slash', 8, card.SPADE),
            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
            test_data.CardInfo('slash', 11, card.SPADE),
            test_data.CardInfo('slash', 12, card.SPADE),
            test_data.CardInfo('slash', 13, card.SPADE),
            test_data.CardInfo('dodge', 1, card.HEART),
            test_data.CardInfo('dodge', 2, card.HEART),
            test_data.CardInfo('dodge', 3, card.HEART),
            test_data.CardInfo('dodge', 4, card.HEART),
            test_data.CardInfo('dodge', 5, card.HEART),
     ])), pc, ActionStack())
players = [fake_player.Player(6), fake_player.Player(24),
           fake_player.Player(1729)]
map(lambda p: pc.add_player(p), players)
gc.start()
assert_eq(200, gc.player_act({
                                 'token': players[0].token,
コード例 #30
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('fire attack', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),
            test_data.CardInfo('dodge', 5, card.HEART),
            test_data.CardInfo('dodge', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.HEART),
            test_data.CardInfo('dodge', 8, card.HEART),
            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),
            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.HEART),
            test_data.CardInfo('dodge', 13, card.HEART),
            test_data.CardInfo('duel', 1, card.DIAMOND),
            test_data.CardInfo('dodge', 2, card.DIAMOND),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
        ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
bequeathed_strategy.add_to(players[0])
gc.start()
コード例 #31
0
ファイル: test_merciless.py プロジェクト: linluxiang/sgs
from ext.src.player import Player
import ext.src.skills.merciless as merciless

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('duel', 7, card.HEART),
            test_data.CardInfo('duel', 8, card.HEART),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),

            test_data.CardInfo('dodge', 11, card.CLUB),
            test_data.CardInfo('dodge', 12, card.HEART),
     ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
merciless.add_to(players[1])
gc.start()

# cards:
# name         | rank | id | suit
コード例 #32
0
ファイル: test_slash.py プロジェクト: neuront/sgs
import core.src.card as card
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
    test_data.CardInfo('slash', 1, card.SPADE),
    test_data.CardInfo('slash', 2, card.HEART),
    test_data.CardInfo('slash', 3, card.DIAMOND),
    test_data.CardInfo('slash', 4, card.SPADE),

    test_data.CardInfo('dodge', 5, card.HEART),
    test_data.CardInfo('dodge', 6, card.HEART),
    test_data.CardInfo('dodge', 7, card.DIAMOND),
    test_data.CardInfo('dodge', 8, card.DIAMOND),

    test_data.CardInfo('slash', 9, card.SPADE),
    test_data.CardInfo('slash', 10, card.SPADE),
])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

assert_eq({
    'code': ret_code.OK,
    'action': 'use',
    'card': {
        0: {
コード例 #33
0
import core.src.card as card
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
    test_data.CardInfo('vermilion feather fan', 1, card.DIAMOND),
    test_data.CardInfo('duel', 2, card.SPADE),
    test_data.CardInfo('slash', 3, card.DIAMOND),
    test_data.CardInfo('dodge', 4, card.DIAMOND),

    test_data.CardInfo('slash', 5, card.CLUB),
    test_data.CardInfo('slash', 6, card.HEART),
    test_data.CardInfo('dodge', 7, card.DIAMOND),
    test_data.CardInfo('slash', 8, card.DIAMOND),

    test_data.CardInfo('duel', 9, card.SPADE),
    test_data.CardInfo('thunder slash', 10, card.HEART),
])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

assert_eq({
    'code': ret_code.OK,
    'action': 'use',
コード例 #34
0
ファイル: test_suicide.py プロジェクト: linluxiang/sgs
pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('fire attack', 1, card.HEART),
            test_data.CardInfo('slash', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('slash', 6, card.CLUB),
            test_data.CardInfo('slash', 7, card.CLUB),
            test_data.CardInfo('slash', 8, card.CLUB),

            test_data.CardInfo('slash', 9, card.CLUB),
            test_data.CardInfo('slash', 10, card.CLUB),
            test_data.CardInfo('slash', 11, card.CLUB),
            test_data.CardInfo('slash', 12, card.CLUB),

            test_data.CardInfo('slash', 13, card.CLUB),
            test_data.CardInfo('slash', 1, card.SPADE),

            test_data.CardInfo('slash', 2, card.SPADE),
            test_data.CardInfo('slash', 3, card.SPADE),

            test_data.CardInfo('slash', 4, card.SPADE),
            test_data.CardInfo('slash', 5, card.SPADE),

            test_data.CardInfo('slash', 6, card.SPADE),
            test_data.CardInfo('slash', 7, card.SPADE),
     ])), pc, ActionStack())
players = [Player(19, 1), Player(91, 1), Player(1729, 1)]
map(lambda p: pc.add_player(p), players)
コード例 #35
0
ファイル: test_duel.py プロジェクト: linluxiang/sgs
import core.src.card as card
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('duel', 1, card.SPADE),
            test_data.CardInfo('fire attack', 2, card.HEART),
            test_data.CardInfo('slash', 3, card.DIAMOND),
            test_data.CardInfo('duel', 4, card.SPADE),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('slash', 8, card.DIAMOND),

            test_data.CardInfo('duel', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

last_event_id = len(gc.get_events(players[0].token, 0)) # until getting cards

# cards:
# name        | rank (id = rank - 1) | suit
コード例 #36
0
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player
import ext.src.skills.martial_saint as martial_saint
import ext.src.skills.dragon_heart as dragon_heart

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('duel', 1, card.SPADE),
            test_data.CardInfo('arson attack', 2, card.HEART),
            test_data.CardInfo('slash', 3, card.CLUB),
            test_data.CardInfo('duel', 4, card.SPADE),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('arson attack', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('slash', 8, card.DIAMOND),

            test_data.CardInfo('duel', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
martial_saint.add_to(players[0])
dragon_heart.add_to(players[1])

gc.start()

# cards:
# name         | rank (id = rank - 1) | suit
コード例 #37
0
ファイル: test_surprise_raid.py プロジェクト: neuront/sgs
import core.src.ret_code as ret_code
from ext.src.players_control import PlayersControl
from ext.test.fake_player import Player
import ext.src.skills.surprise_raid as surprise_raid

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(EventList(), test_data.CardPool(test_data.gen_cards([
            test_data.CardInfo('zhangba serpent spear', 12, card.SPADE),
            test_data.CardInfo('slash', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.CLUB),
            test_data.CardInfo('dodge', 4, card.DIAMOND),

            test_data.CardInfo('slash', 5, card.CLUB),
            test_data.CardInfo('dodge', 6, card.HEART),
            test_data.CardInfo('dodge', 7, card.DIAMOND),
            test_data.CardInfo('slash', 8, card.DIAMOND),

            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
     ])), pc, ActionStack())
players = [Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
surprise_raid.add_to(players[0])
gc.start()

assert_eq({
    'code': ret_code.OK,
    'action': 'use',
    'card': {
コード例 #38
0
from ext.src.players_control import PlayersControl
from ext.src.player import Player

from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('zhangba serpent spear', 1, card.SPADE),
            test_data.CardInfo('slash', 2, card.HEART),
            test_data.CardInfo('slash', 3, card.DIAMOND),
            test_data.CardInfo('slash', 4, card.HEART),
            test_data.CardInfo('fire attack', 5, card.CLUB),
            test_data.CardInfo('sabotage', 6, card.HEART),
            test_data.CardInfo('sabotage', 7, card.DIAMOND),
            test_data.CardInfo('sabotage', 8, card.DIAMOND),
            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.SPADE),
            test_data.CardInfo('fire attack', 11, card.HEART),
            test_data.CardInfo('sabotage', 12, card.DIAMOND),
        ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
gc.start()

result = gc.player_act({
    'token': players[0].token,
    'action': 'equip',
コード例 #39
0
ファイル: test_steal.py プロジェクト: linluxiang/sgs
pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards(
            [
                test_data.CardInfo("-chitu", 5, card.HEART),
                test_data.CardInfo("-dawan", 13, card.SPADE),
                test_data.CardInfo("+jueying", 5, card.SPADE),
                test_data.CardInfo("slash", 1, card.CLUB),
                test_data.CardInfo("steal", 7, card.CLUB),
                test_data.CardInfo("duel", 8, card.DIAMOND),
                test_data.CardInfo("-zixing", 13, card.DIAMOND),
                test_data.CardInfo("+dilu", 5, card.CLUB),
                test_data.CardInfo("slash", 1, card.CLUB),
                test_data.CardInfo("slash", 1, card.CLUB),
                test_data.CardInfo("slash", 1, card.CLUB),
                test_data.CardInfo("slash", 1, card.CLUB),
                test_data.CardInfo("steal", 9, card.HEART),
                test_data.CardInfo("steal", 10, card.CLUB),
                test_data.CardInfo("steal", 9, card.HEART),
                test_data.CardInfo("steal", 10, card.CLUB),
            ]
        )
    ),
    pc,
    ActionStack(),
)
players = [Player(19, 3), Player(91, 4), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
コード例 #40
0
from test_common import *
import test_data

pc = PlayersControl()
gc = GameControl(
    EventList(),
    test_data.CardPool(
        test_data.gen_cards([
            test_data.CardInfo('slash', 1, card.SPADE),
            test_data.CardInfo('rattan armor', 2, card.CLUB),
            test_data.CardInfo('slash', 3, card.HEART),
            test_data.CardInfo('slash', 4, card.HEART),
            test_data.CardInfo('rattan armor', 2, card.SPADE),
            test_data.CardInfo('fire attack', 6, card.HEART),
            test_data.CardInfo('fire attack', 7, card.HEART),
            test_data.CardInfo('duel', 8, card.HEART),
            test_data.CardInfo('slash', 9, card.SPADE),
            test_data.CardInfo('slash', 10, card.CLUB),
            test_data.CardInfo('dodge', 11, card.HEART),
            test_data.CardInfo('dodge', 12, card.HEART),
            test_data.CardInfo('dodge', 13, card.DIAMOND),
            test_data.CardInfo('dodge', 1, card.DIAMOND),
            test_data.CardInfo('dodge', 2, card.DIAMOND),
            test_data.CardInfo('dodge', 3, card.DIAMOND),
        ])), pc, ActionStack())
players = [Player(91, 3), Player(1729, 4)]
map(lambda p: pc.add_player(p), players)
heavenly_scent.add_to(players[0])
gc.start()