コード例 #1
0
ファイル: test_duel.py プロジェクト: linluxiang/sgs
from core.src.game_control import GameControl
from core.src.event import EventList
from core.src.action_stack import ActionStack
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
コード例 #2
0
from core.src.game_control import GameControl
from core.src.event import EventList
from core.src.action_stack import ActionStack
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('-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),
コード例 #3
0
from core.src.event import EventList
from core.src.action_stack import ActionStack
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('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
コード例 #4
0
from core.src.action_stack import ActionStack
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

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),
コード例 #5
0
from core.src.game_control import GameControl
from core.src.event import EventList
from core.src.action_stack import ActionStack
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('-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),
コード例 #6
0
from core.src.action_stack import ActionStack
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
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()