コード例 #1
0
 def __init__(self, map):
     self.map = map
     self.seed = random.randint(0, 10000)
     self.me = DirectClient(config.login, self)
     self.players = [self.me]
     if self.map.campaign_rules:
         # missions with custom rules can't be replayed yet
         self.record_replay = False
コード例 #2
0
ファイル: game.py プロジェクト: MatejGolian/soundrts
class MissionGame(_Game, _Savable):

    game_type_name = "mission"
    _has_victory = False

    def __init__(self, map):
        self.map = map
        self.seed = random.randint(0, 10000)
        self.me = DirectClient(config.login, self)
        self.players = [self.me]

    def pre_run(self):
        if self.world.intro:
            play_sequence(self.world.intro)

    def post_run(self):
        _Game.post_run(self)
        self._has_victory = self.me.has_victory()

    def has_victory(self):
        return self._has_victory

    def run_on(self):
        try:
            self.map.campaign.load_resources()
            _Savable.run_on(self)
            self.map.run_next_step(self)
        finally:
            self.map.campaign.unload_resources()
コード例 #3
0
class MissionGame(_Game, _Savable):

    game_type_name = "mission"
    _has_victory = False

    def __init__(self, map):
        self.map = map
        self.seed = random.randint(0, 10000)
        self.me = DirectClient(config.login, self)
        self.players = [self.me]

    def pre_run(self):
        if self.world.intro:
            play_sequence(self.world.intro)

    def post_run(self):
        _Game.post_run(self)
        self._has_victory = self.me.has_victory()

    def has_victory(self):
        return self._has_victory

    def run_on(self):
        try:
            self.map.campaign.load_resources()
            _Savable.run_on(self)
            self.map.run_next_step(self)
        finally:
            self.map.campaign.unload_resources()
コード例 #4
0
 def __init__(self, map, players, factions):
     self.map = map
     self.seed = random.randint(0, 10000)
     self.me = DirectClient(config.login, self)
     self.players = [self.me] + [DummyClient(x) for x in players[1:]]
     for p, f in zip(self.players, factions):
         p.faction = f
コード例 #5
0
ファイル: game.py プロジェクト: sanslash332/soundrts
class MissionGame(_Game, _Savable):

    game_type_name = "mission"
    _has_victory = False

    def __init__(self, map):
        self.map = map
        self.seed = random.randint(0, 10000)
        self.me = DirectClient(config.login, self)
        self.players = [self.me]
        if self.map.campaign_rules:
            # missions with custom rules can't be replayed yet
            self.record_replay = False

    def pre_run(self):
        if self.world.intro:
            sounds.play_sequence(self.world.intro)

    def post_run(self):
        _Game.post_run(self)
        self._has_victory = self.me.has_victory()

    def has_victory(self):
        return self._has_victory

    def run_on(self):
        sounds.enter_campaign(self.map.campaign.path)
        _Savable.run_on(self)
        self.map.run_next_step(self)
        sounds.exit_campaign()
コード例 #6
0
class MissionGame(_Game, _Savable):

    game_type_name = "mission"
    _has_victory = False

    def __init__(self, map):
        self.map = map
        self.seed = random.randint(0, 10000)
        self.me = DirectClient(config.login, self)
        self.players = [self.me]
        if self.map.campaign_rules:
            # missions with custom rules can't be replayed yet
            self.record_replay = False

    def pre_run(self):
        if self.world.intro:
            sounds.play_sequence(self.world.intro)

    def post_run(self):
        _Game.post_run(self)
        self._has_victory = self.me.has_victory()

    def has_victory(self):
        return self._has_victory

    def run_on(self):
        sounds.enter_campaign(self.map.campaign.path)
        _Savable.run_on(self)
        self.map.run_next_step(self)
        sounds.exit_campaign()
コード例 #7
0
ファイル: game.py プロジェクト: sanslash332/soundrts
 def __init__(self, map):
     self.map = map
     self.seed = random.randint(0, 10000)
     self.me = DirectClient(config.login, self)
     self.players = [self.me]
     if self.map.campaign_rules:
         # missions with custom rules can't be replayed yet
         self.record_replay = False
コード例 #8
0
ファイル: game.py プロジェクト: MatejGolian/soundrts
 def __init__(self, map):
     self.map = map
     self.seed = random.randint(0, 10000)
     self.me = DirectClient(config.login, self)
     self.players = [self.me]
コード例 #9
0
 def __init__(self, map):
     self.map = map
     self.seed = random.randint(0, 10000)
     self.me = DirectClient(config.login, self)
     self.players = [self.me]