示例#1
0
 def __init__(self, settings: dict):
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     self._swipsound = ba.getsound('swip')
     self._tick_sound = ba.getsound('tick')
     self._countdownsounds = {
         10: ba.getsound('announceTen'),
         9: ba.getsound('announceNine'),
         8: ba.getsound('announceEight'),
         7: ba.getsound('announceSeven'),
         6: ba.getsound('announceSix'),
         5: ba.getsound('announceFive'),
         4: ba.getsound('announceFour'),
         3: ba.getsound('announceThree'),
         2: ba.getsound('announceTwo'),
         1: ba.getsound('announceOne')
     }
     self._flag_spawn_pos: Optional[Sequence[float]] = None
     self._update_timer: Optional[ba.Timer] = None
     self._holding_players: List[Player] = []
     self._flag_state: Optional[FlagState] = None
     self._flag_light: Optional[ba.Node] = None
     self._scoring_team: Optional[Team] = None
     self._flag: Optional[Flag] = None
     self._hold_time = int(settings['Hold Time'])
     self._time_limit = float(settings['Time Limit'])
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     self._targets: List[Target] = []
     self._update_timer: Optional[ba.Timer] = None
     self._countdown: Optional[OnScreenCountdown] = None
示例#3
0
    def on_transition_in(self) -> None:
        super().on_transition_in()
        self._scoreboard = Scoreboard()
        self._flag_spawn_pos = self.map.get_flag_position(None)
        self._spawn_flag()

        # Set up the two score regions.
        defs = self.map.defs
        self._score_regions.append(
            ba.NodeActor(
                ba.newnode('region',
                           attrs={
                               'position': defs.boxes['goal1'][0:3],
                               'scale': defs.boxes['goal1'][6:9],
                               'type': 'box',
                               'materials': [self._score_region_material]
                           })))
        self._score_regions.append(
            ba.NodeActor(
                ba.newnode('region',
                           attrs={
                               'position': defs.boxes['goal2'][0:3],
                               'scale': defs.boxes['goal2'][6:9],
                               'type': 'box',
                               'materials': [self._score_region_material]
                           })))
        ba.playsound(self._chant_sound)
示例#4
0
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     self._race_started = False
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     if self.settings['Epic Mode']:
         self.slow_motion = True
     self._score_sound = ba.getsound('score')
     self._swipsound = ba.getsound('swip')
     self._last_team_time: Optional[float] = None
     self._front_race_region: Optional[int] = None
     self._nub_tex = ba.gettexture('nub')
     self._beep_1_sound = ba.getsound('raceBeep1')
     self._beep_2_sound = ba.getsound('raceBeep2')
     self.race_region_material: Optional[ba.Material] = None
     self._regions: List[RaceRegion] = []
     self._team_finish_pts: Optional[int] = None
     self._time_text: Optional[ba.Actor] = None
     self._timer: Optional[OnScreenTimer] = None
     self._race_mines: Optional[List[RaceMine]] = None
     self._race_mine_timer: Optional[ba.Timer] = None
     self._scoreboard_timer: Optional[ba.Timer] = None
     self._player_order_update_timer: Optional[ba.Timer] = None
     self._start_lights: Optional[List[ba.Node]] = None
     self._bomb_spawn_timer: Optional[ba.Timer] = None
    def __init__(self, settings: dict):
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._chosen_one_player: Optional[Player] = None
        self._swipsound = ba.getsound('swip')
        self._countdownsounds: dict[int, ba.Sound] = {
            10: ba.getsound('announceTen'),
            9: ba.getsound('announceNine'),
            8: ba.getsound('announceEight'),
            7: ba.getsound('announceSeven'),
            6: ba.getsound('announceSix'),
            5: ba.getsound('announceFive'),
            4: ba.getsound('announceFour'),
            3: ba.getsound('announceThree'),
            2: ba.getsound('announceTwo'),
            1: ba.getsound('announceOne')
        }
        self._flag_spawn_pos: Optional[Sequence[float]] = None
        self._reset_region_material: Optional[ba.Material] = None
        self._flag: Optional[Flag] = None
        self._reset_region: Optional[ba.Node] = None
        self._epic_mode = bool(settings['Epic Mode'])
        self._chosen_one_time = int(settings['Chosen One Time'])
        self._time_limit = float(settings['Time Limit'])
        self._chosen_one_gets_shield = bool(settings['Chosen One Gets Shield'])
        self._chosen_one_gets_gloves = bool(settings['Chosen One Gets Gloves'])

        # Base class overrides
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC
                              if self._epic_mode else ba.MusicType.CHOSEN_ONE)
示例#6
0
    def __init__(self, settings: dict):
        self._race_started = False
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._score_sound = ba.getsound('score')
        self._swipsound = ba.getsound('swip')
        self._last_team_time: Optional[float] = None
        self._front_race_region: Optional[int] = None
        self._nub_tex = ba.gettexture('nub')
        self._beep_1_sound = ba.getsound('raceBeep1')
        self._beep_2_sound = ba.getsound('raceBeep2')
        self.race_region_material: Optional[ba.Material] = None
        self._regions: List[RaceRegion] = []
        self._team_finish_pts: Optional[int] = None
        self._time_text: Optional[ba.Actor] = None
        self._timer: Optional[OnScreenTimer] = None
        self._race_mines: Optional[List[RaceMine]] = None
        self._race_mine_timer: Optional[ba.Timer] = None
        self._scoreboard_timer: Optional[ba.Timer] = None
        self._player_order_update_timer: Optional[ba.Timer] = None
        self._start_lights: Optional[List[ba.Node]] = None
        self._bomb_spawn_timer: Optional[ba.Timer] = None
        self._laps = int(settings['Laps'])
        self._entire_team_must_finish = bool(
            settings.get('Entire Team Must Finish', False))
        self._time_limit = float(settings['Time Limit'])
        self._mine_spawning = int(settings['Mine Spawning'])
        self._bomb_spawning = int(settings['Bomb Spawning'])
        self._epic_mode = bool(settings['Epic Mode'])

        # Base class overrides.
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC_RACE
                              if self._epic_mode else ba.MusicType.RACE)
示例#7
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._swipsound = ba.getsound('swip')
        self._tick_sound = ba.getsound('tick')
        self._countdownsounds = {
            10: ba.getsound('announceTen'),
            9: ba.getsound('announceNine'),
            8: ba.getsound('announceEight'),
            7: ba.getsound('announceSeven'),
            6: ba.getsound('announceSix'),
            5: ba.getsound('announceFive'),
            4: ba.getsound('announceFour'),
            3: ba.getsound('announceThree'),
            2: ba.getsound('announceTwo'),
            1: ba.getsound('announceOne')
        }
        self._flag_pos: Optional[Sequence[float]] = None
        self._flag_state: Optional[int] = None
        self._flag: Optional[stdflag.Flag] = None
        self._flag_light: Optional[ba.Node] = None
        self._scoring_team: Optional[ReferenceType[ba.Team]] = None

        self._flag_region_material = ba.Material()
        self._flag_region_material.add_actions(
            conditions=('they_have_material', ba.sharedobj('player_material')),
            actions=(('modify_part_collision', 'collide',
                      True), ('modify_part_collision', 'physical', False),
                     ('call', 'at_connect',
                      ba.Call(self._handle_player_flag_region_collide, True)),
                     ('call', 'at_disconnect',
                      ba.Call(self._handle_player_flag_region_collide,
                              False))))
示例#8
0
 def on_transition_in(self) -> None:
     from bastd.actor.scoreboard import Scoreboard
     self.default_music = ba.MusicType.EPIC
     super().on_transition_in()
     ba.timer(1.3, ba.Call(ba.playsound, self._new_wave_sound))
     self._scoreboard = Scoreboard(label=ba.Lstr(resource='scoreText'),
                                   score_split=0.5)
示例#9
0
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     self._swipsound = ba.getsound('swip')
     self._tick_sound = ba.getsound('tick')
     self._countdownsounds = {
         10: ba.getsound('announceTen'),
         9: ba.getsound('announceNine'),
         8: ba.getsound('announceEight'),
         7: ba.getsound('announceSeven'),
         6: ba.getsound('announceSix'),
         5: ba.getsound('announceFive'),
         4: ba.getsound('announceFour'),
         3: ba.getsound('announceThree'),
         2: ba.getsound('announceTwo'),
         1: ba.getsound('announceOne')
     }
     self._flag_spawn_pos: Optional[Sequence[float]] = None
     self._update_timer: Optional[ba.Timer] = None
     self._holding_players: List[ba.Player] = []
     self._flag_state: Optional[int] = None
     self._flag_light: Optional[ba.Node] = None
     self._scoring_team: Optional[ba.Team] = None
     self._flag: Optional[stdflag.Flag] = None
示例#10
0
 def __init__(self, settings: Dict[str, Any]):
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     self._targets: List[Target] = []
     self._update_timer: Optional[ba.Timer] = None
     self._countdown: Optional[OnScreenCountdown] = None
     self._target_count = int(settings['Target Count'])
     self._enable_impact_bombs = bool(settings['Enable Impact Bombs'])
     self._enable_triple_bombs = bool(settings['Enable Triple Bombs'])
示例#11
0
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     if self.settings_raw['Epic Mode']:
         self.slow_motion = True
     self._last_score_time = 0.0
     self._score_sound = ba.getsound('score')
     self._base_region_materials: Dict[int, ba.Material] = {}
示例#12
0
    def __init__(self, settings: dict):
        super().__init__(settings)
        shared = SharedObjects.get()
        self._scoreboard = Scoreboard()
        self._cheer_sound = ba.getsound('cheer')
        self._chant_sound = ba.getsound('crowdChant')
        self._foghorn_sound = ba.getsound('foghorn')
        self._swipsound = ba.getsound('swip')
        self._whistle_sound = ba.getsound('refWhistle')
        self.puck_model = ba.getmodel('puck')
        self.puck_tex = ba.gettexture('puckColor')
        self._puck_sound = ba.getsound('metalHit')
        self.puck_material = ba.Material()
        self.puck_material.add_actions(actions=(('modify_part_collision',
                                                 'friction', 0.5)))
        self.puck_material.add_actions(conditions=('they_have_material',
                                                   shared.pickup_material),
                                       actions=('modify_part_collision',
                                                'collide', False))
        self.puck_material.add_actions(
            conditions=(
                ('we_are_younger_than', 100),
                'and',
                ('they_have_material', shared.object_material),
            ),
            actions=('modify_node_collision', 'collide', False),
        )
        self.puck_material.add_actions(conditions=('they_have_material',
                                                   shared.footing_material),
                                       actions=('impact_sound',
                                                self._puck_sound, 0.2, 5))

        # Keep track of which player last touched the puck
        self.puck_material.add_actions(
            conditions=('they_have_material', shared.player_material),
            actions=(('call', 'at_connect',
                      self._handle_puck_player_collide), ))

        # We want the puck to kill powerups; not get stopped by them
        self.puck_material.add_actions(
            conditions=('they_have_material',
                        PowerupBoxFactory.get().powerup_material),
            actions=(('modify_part_collision', 'physical', False),
                     ('message', 'their_node', 'at_connect', ba.DieMessage())))
        self._score_region_material = ba.Material()
        self._score_region_material.add_actions(
            conditions=('they_have_material', self.puck_material),
            actions=(('modify_part_collision', 'collide',
                      True), ('modify_part_collision', 'physical', False),
                     ('call', 'at_connect', self._handle_score)))
        self._puck_spawn_pos: Optional[Sequence[float]] = None
        self._score_regions: Optional[List[ba.NodeActor]] = None
        self._puck: Optional[Puck] = None
        self._score_to_win = int(settings['Score to Win'])
        self._time_limit = float(settings['Time Limit'])
示例#13
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        super().__init__(settings)
        if self.settings_raw['Epic Mode']:
            self.slow_motion = True

        # Print messages when players die since it matters here.
        self.announce_player_deaths = True

        self._scoreboard = Scoreboard()
        self._score_to_win = None
        self._dingsound = ba.getsound('dingSmall')
示例#14
0
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     super().__init__(settings)
     self._scoreboard = Scoreboard()
     if self.settings_raw['Epic Mode']:
         self.slow_motion = True
     self._alarmsound = ba.getsound('alarm')
     self._ticking_sound = ba.getsound('ticking')
     self._last_score_time = 0
     self._score_sound = ba.getsound('score')
     self._swipsound = ba.getsound('swip')
     self._all_bases_material = ba.Material()
     self._last_home_flag_notice_print_time = 0.0
示例#15
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._targets: List[Target] = []
        self._update_timer: Optional[ba.Timer] = None
        self._countdown: Optional[OnScreenCountdown] = None
        self._target_count = int(settings['Target Count'])
        self._enable_impact_bombs = bool(settings['Enable Impact Bombs'])
        self._enable_triple_bombs = bool(settings['Enable Triple Bombs'])

        # Base class overrides
        self.default_music = ba.MusicType.FORWARD_MARCH
示例#16
0
 def on_transition_in(self) -> None:
     super().on_transition_in()
     self._scoreboard = Scoreboard(label=ba.Lstr(resource='scoreText'),
                                   score_split=0.5)
     self._score_region = ba.NodeActor(
         ba.newnode('region',
                    attrs={
                        'position':
                        self.map.defs.boxes['score_region'][0:3],
                        'scale': self.map.defs.boxes['score_region'][6:9],
                        'type': 'box',
                        'materials': [self._score_region_material]
                    }))
示例#17
0
    def __init__(self, settings: Dict[str, Any]):
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._last_score_time = 0.0
        self._score_sound = ba.getsound('score')
        self._base_region_materials: Dict[int, ba.Material] = {}
        self._epic_mode = bool(settings['Epic Mode'])
        self._score_to_win = int(settings['Score to Win'])
        self._time_limit = float(settings['Time Limit'])

        # Base class overrides
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC if self._epic_mode else
                              ba.MusicType.FORWARD_MARCH)
示例#18
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        from bastd.actor import powerupbox
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._cheer_sound = ba.getsound("cheer")
        self._chant_sound = ba.getsound("crowdChant")
        self._foghorn_sound = ba.getsound("foghorn")
        self._swipsound = ba.getsound("swip")
        self._whistle_sound = ba.getsound("refWhistle")
        self.puck_model = ba.getmodel("puck")
        self.puck_tex = ba.gettexture("puckColor")
        self._puck_sound = ba.getsound("metalHit")
        self.puck_material = ba.Material()
        self.puck_material.add_actions(actions=(("modify_part_collision",
                                                 "friction", 0.5)))
        self.puck_material.add_actions(
            conditions=("they_have_material", ba.sharedobj('pickup_material')),
            actions=("modify_part_collision", "collide", False))
        self.puck_material.add_actions(
            conditions=(("we_are_younger_than", 100),
                        'and', ("they_have_material",
                                ba.sharedobj('object_material'))),
            actions=("modify_node_collision", "collide", False))
        self.puck_material.add_actions(
            conditions=("they_have_material",
                        ba.sharedobj('footing_material')),
            actions=("impact_sound", self._puck_sound, 0.2, 5))

        # Keep track of which player last touched the puck
        self.puck_material.add_actions(
            conditions=("they_have_material", ba.sharedobj('player_material')),
            actions=(("call", "at_connect",
                      self._handle_puck_player_collide), ))

        # We want the puck to kill powerups; not get stopped by them
        self.puck_material.add_actions(
            conditions=("they_have_material",
                        powerupbox.get_factory().powerup_material),
            actions=(("modify_part_collision", "physical", False),
                     ("message", "their_node", "at_connect", ba.DieMessage())))
        self._score_region_material = ba.Material()
        self._score_region_material.add_actions(
            conditions=("they_have_material", self.puck_material),
            actions=(("modify_part_collision", "collide",
                      True), ("modify_part_collision", "physical", False),
                     ("call", "at_connect", self._handle_score)))
        self._puck_spawn_pos: Optional[Sequence[float]] = None
        self._score_regions: Optional[List[ba.NodeActor]] = None
        self._puck: Optional[Puck] = None
示例#19
0
    def __init__(self, settings: dict):
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._score_to_win: Optional[int] = None
        self._dingsound = ba.getsound('dingSmall')
        self._epic_mode = bool(settings['Epic Mode'])
        self._kills_to_win_per_player = int(
            settings['Kills to Win Per Player'])
        self._time_limit = float(settings['Time Limit'])
        self._allow_negative_scores = bool(
            settings.get('Allow Negative Scores', False))

        # Base class overrides.
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC if self._epic_mode else
                              ba.MusicType.TO_THE_DEATH)
示例#20
0
    def __init__(self, settings: dict):
        super().__init__(settings)
        self._scoreboard: Optional[Scoreboard] = Scoreboard()

        # Load some media we need.
        self._cheer_sound = ba.getsound('cheer')
        self._chant_sound = ba.getsound('crowdChant')
        self._score_sound = ba.getsound('score')
        self._swipsound = ba.getsound('swip')
        self._whistle_sound = ba.getsound('refWhistle')
        self._score_region_material = ba.Material()
        self._score_region_material.add_actions(
            conditions=('they_have_material', FlagFactory.get().flagmaterial),
            actions=(
                ('modify_part_collision', 'collide', True),
                ('modify_part_collision', 'physical', False),
                ('call', 'at_connect', self._handle_score),
            ))
        self._flag_spawn_pos: Optional[Sequence[float]] = None
        self._score_regions: List[ba.NodeActor] = []
        self._flag: Optional[FootballFlag] = None
        self._flag_respawn_timer: Optional[ba.Timer] = None
        self._flag_respawn_light: Optional[ba.NodeActor] = None
        self._score_to_win = int(settings['Score to Win'])
        self._time_limit = float(settings['Time Limit'])
示例#21
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        super().__init__(settings)
        if self.settings_raw['Epic Mode']:
            self.slow_motion = True
        self._scoreboard = Scoreboard()
        self._score_sound = ba.getsound('score')
        self._swipsound = ba.getsound('swip')
        self._extraflagmat = ba.Material()
        self._flags: List[ConquestFlag] = []

        # We want flags to tell us they've been hit but not react physically.
        self._extraflagmat.add_actions(
            conditions=('they_have_material', ba.sharedobj('player_material')),
            actions=(('modify_part_collision', 'collide', True),
                     ('call', 'at_connect', self._handle_flag_player_collide)))
    def __init__(self, settings: dict):
        super().__init__(settings)
        self.roundNames = [
            'Grand Finale', 'Semi-Final', 'Quarter Final', 'Pre Quarter-Final'
        ]

        self._scoreboard = Scoreboard()
        self._start_time: Optional[float] = None
        self._vs_text: Optional[ba.Actor] = None
        self._round_end_timer: Optional[ba.Timer] = None
        self.count = 0
        self.myPlayers = None
        self.myPlayersScore = None
        self._epic_mode = bool(settings['Epic Mode'])
        self._lives_per_player = 1
        self._time_limit = float(settings['Time Limit'])
        self._balance_total_lives = bool(
            settings.get('Balance Total Lives', False))
        self.versusNode = None
        self.roundNameNode = None
        self.playersInGameNode = None
        self.upNextNode = None
        # Base class OVERrides:
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC
                              if self._epic_mode else ba.MusicType.SURVIVAL)
示例#23
0
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     super().__init__(settings)
     self._last_player_death_time = None
     self._scoreboard = Scoreboard()
     self.egg_model = ba.getmodel('egg')
     self.egg_tex_1 = ba.gettexture('eggTex1')
     self.egg_tex_2 = ba.gettexture('eggTex2')
     self.egg_tex_3 = ba.gettexture('eggTex3')
     self._collect_sound = ba.getsound('powerup01')
     self._pro_mode = settings.get('Pro Mode', False)
     self._max_eggs = 1.0
     self.egg_material = ba.Material()
     self.egg_material.add_actions(
         conditions=("they_have_material", ba.sharedobj('player_material')),
         actions=(("call", "at_connect", self._on_egg_player_collide), ))
     self._eggs: List[Egg] = []
     self._update_timer: Optional[ba.Timer] = None
     self._countdown: Optional[OnScreenCountdown] = None
     self._bots: Optional[spazbot.BotSet] = None
示例#24
0
    def __init__(self, settings) -> None:
        super().__init__(settings)
        self._epic_mode = self.settings_raw['Epic Mode']
        self._score_to_win = self.settings_raw['Kills to Win Per Player']
        self._time_limit = self.settings_raw['Time Limit']
        self._obstacles_enabled = self.settings_raw['Obstacles']
        self._obstacles_count = self.settings_raw['Obstacles Count']
        self._speed_enabled = self.settings_raw['Speed']
        self._bomb_enabled = self.settings_raw['Enable Bomb']
        self._pickup_enabled = self.settings_raw['Enable Pickup']
        self._jump_enabled = self.settings_raw['Enable Jump']
        self._weapon_type = WeaponType(self.settings_raw['Weapon Type'])
        self.default_music = (ba.MusicType.EPIC
                              if self._epic_mode else ba.MusicType.GRAND_ROMP)
        self.slow_motion = self._epic_mode

        self.announce_player_deaths = True
        self._scoreboard = Scoreboard()
        self._ding_sound = ba.getsound('dingSmall')

        self._shield_dropper: Optional[ba.Timer] = None
示例#25
0
    def __init__(self, settings: dict):
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._alarmsound = ba.getsound('alarm')
        self._ticking_sound = ba.getsound('ticking')
        self._score_sound = ba.getsound('score')
        self._swipsound = ba.getsound('swip')
        self._last_score_time = 0
        self._all_bases_material = ba.Material()
        self._last_home_flag_notice_print_time = 0.0
        self._score_to_win = int(settings['Score to Win'])
        self._epic_mode = bool(settings['Epic Mode'])
        self._time_limit = float(settings['Time Limit'])

        self.flag_touch_return_time = float(settings['Flag Touch Return Time'])
        self.flag_idle_return_time = float(settings['Flag Idle Return Time'])

        # Base class overrides.
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC if self._epic_mode else
                              ba.MusicType.FLAG_CATCHER)
示例#26
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        super().__init__(settings)
        self._scoreboard = Scoreboard()
        self._score_sound = ba.getsound('score')
        self._swipsound = ba.getsound('swip')
        self._extraflagmat = ba.Material()
        self._flags: List[ConquestFlag] = []
        self._epic_mode = bool(settings['Epic Mode'])
        self._time_limit = float(settings['Time Limit'])

        # Base class overrides.
        self.slow_motion = self._epic_mode
        self.default_music = (ba.MusicType.EPIC
                              if self._epic_mode else ba.MusicType.GRAND_ROMP)

        # We want flags to tell us they've been hit but not react physically.
        self._extraflagmat.add_actions(
            conditions=('they_have_material', ba.sharedobj('player_material')),
            actions=(('modify_part_collision', 'collide', True),
                     ('call', 'at_connect', self._handle_flag_player_collide)))
示例#27
0
    def __init__(self, settings: Dict[str, Any]):
        super().__init__(settings)
        self._last_player_death_time = None
        self._scoreboard = Scoreboard()
        self.egg_model = ba.getmodel('egg')
        self.egg_tex_1 = ba.gettexture('eggTex1')
        self.egg_tex_2 = ba.gettexture('eggTex2')
        self.egg_tex_3 = ba.gettexture('eggTex3')
        self._collect_sound = ba.getsound('powerup01')
        self._pro_mode = settings.get('Pro Mode', False)
        self._max_eggs = 1.0
        self.egg_material = ba.Material()
        self.egg_material.add_actions(
            conditions=('they_have_material', ba.sharedobj('player_material')),
            actions=(('call', 'at_connect', self._on_egg_player_collide), ))
        self._eggs: List[Egg] = []
        self._update_timer: Optional[ba.Timer] = None
        self._countdown: Optional[OnScreenCountdown] = None
        self._bots: Optional[BotSet] = None

        # Base class overrides
        self.default_music = ba.MusicType.FORWARD_MARCH
示例#28
0
    def __init__(self, settings: Dict[str, Any]):
        super().__init__(settings)
        shared = SharedObjects.get()
        self._scoreboard = Scoreboard()
        self._swipsound = ba.getsound('swip')
        self._tick_sound = ba.getsound('tick')
        self._countdownsounds = {
            10: ba.getsound('announceTen'),
            9: ba.getsound('announceNine'),
            8: ba.getsound('announceEight'),
            7: ba.getsound('announceSeven'),
            6: ba.getsound('announceSix'),
            5: ba.getsound('announceFive'),
            4: ba.getsound('announceFour'),
            3: ba.getsound('announceThree'),
            2: ba.getsound('announceTwo'),
            1: ba.getsound('announceOne')
        }
        self._flag_pos: Optional[Sequence[float]] = None
        self._flag_state: Optional[FlagState] = None
        self._flag: Optional[Flag] = None
        self._flag_light: Optional[ba.Node] = None
        self._scoring_team: Optional[ReferenceType[Team]] = None
        self._hold_time = int(settings['Hold Time'])
        self._time_limit = float(settings['Time Limit'])
        self._flag_region_material = ba.Material()
        self._flag_region_material.add_actions(
            conditions=('they_have_material', shared.player_material),
            actions=(
                ('modify_part_collision', 'collide', True),
                ('modify_part_collision', 'physical', False),
                ('call', 'at_connect',
                 ba.Call(self._handle_player_flag_region_collide, True)),
                ('call', 'at_disconnect',
                 ba.Call(self._handle_player_flag_region_collide, False)),
            ))

        # Base class overrides.
        self.default_music = ba.MusicType.SCARY
示例#29
0
    def __init__(self, settings: Dict[str, Any]):
        from bastd.actor.scoreboard import Scoreboard
        super().__init__(settings)
        if self.settings['Epic Mode']:
            self.slow_motion = True

        # Show messages when players die since it's meaningful here.
        self.announce_player_deaths = True

        self._solo_mode = settings.get('Solo Mode', False)
        self._scoreboard = Scoreboard()
        self._start_time: Optional[float] = None
        self._vs_text: Optional[ba.Actor] = None
        self._round_end_timer: Optional[ba.Timer] = None
示例#30
0
 def __init__(self, settings: Dict[str, Any]):
     from bastd.actor.scoreboard import Scoreboard
     super().__init__(settings)
     if self.settings['Epic Mode']:
         self.slow_motion = True
     self._scoreboard = Scoreboard()
     self._chosen_one_player: Optional[ba.Player] = None
     self._swipsound = ba.getsound('swip')
     self._countdownsounds: Dict[int, ba.Sound] = {
         10: ba.getsound('announceTen'),
         9: ba.getsound('announceNine'),
         8: ba.getsound('announceEight'),
         7: ba.getsound('announceSeven'),
         6: ba.getsound('announceSix'),
         5: ba.getsound('announceFive'),
         4: ba.getsound('announceFour'),
         3: ba.getsound('announceThree'),
         2: ba.getsound('announceTwo'),
         1: ba.getsound('announceOne')
     }
     self._flag_spawn_pos: Optional[Sequence[float]] = None
     self._reset_region_material: Optional[ba.Material] = None
     self._flag: Optional[flag.Flag] = None
     self._reset_region: Optional[ba.Node] = None