def hit(self, mode='default#$%', waterfall_hits=None,
            **kwargs):
        """Method which is called to indicate this shot was just hit. This
        method will advance the currently-active shot profile.

        Args:
            force: Boolean that forces this hit to be registered. Default is
                False which means if there are no balls in play (e.g. after a
                tilt) then this hit isn't processed. Set this to True if you
                want to force the hit to be processed even if no balls are in
                play.

        Note that the shot must be enabled in order for this hit to be
        processed.

        """
        if (not self.machine.game or
                (self.machine.game and not self.machine.game.balls_in_play) or
                self.active_delay_switches):
            return

        if mode == 'default#$%':
            mode = self.active_mode

        profile, state = self.get_mode_state(mode)

        if self.debug:
            self.log.debug("Hit! Mode: %s, Profile: %s, State: %s",
                           mode, profile, state)

        # do this before the events are posted since events could change the
        # profile
        if not self.enable_table[mode]['settings']['block']:
            need_to_waterfall = True
        else:
            need_to_waterfall = False

        # post events
        self.machine.events.post(self.name + '_hit', profile=profile,
                                 state=state)
        self.machine.events.post(self.name + '_' + profile + '_hit',
                                 profile=profile, state=state)
        self.machine.events.post(self.name + '_' + profile + '_' + state +
                                 '_hit', profile=profile, state=state)

        # Need to try because the event postings above could be used to stop
        # the mode, in which case the mode entry won't be in the enable_table
        try:
            advance = self.enable_table[mode]['settings']['advance_on_hit']
        except __HOLE__:
            advance = False

        if advance:
            if self.debug:
                self.log.debug("Mode '%s' advance_on_hit is True.", mode)
            self.advance(mode=mode)
        elif self.debug:
            self.log.debug('Not advancing profile state since the current '
                           'mode %s has setting advance_on_hit set to '
                           'False or this mode is not in the enable_table',
                           mode)

        for group in [x for x in self.groups]:
            self.log.debug("Notifying shot_group %s of new hit", group)
            group.hit(mode, profile, state)

        if Shot.monitor_enabled:
            for callback in self.machine.monitors['shots']:
                callback(name=self.name, profile=profile, state=state)

        if need_to_waterfall:

            if self.debug:
                self.log.debug('%s block: False. Waterfalling hits', mode)

            if not waterfall_hits:
                waterfall_hits = set()

            self._waterfall_hits(mode, waterfall_hits.add(profile))

        elif self.debug:
            self.log.debug('%s settings has block enabled', mode)
dataset/ETHPy150Open missionpinball/mpf/mpf/devices/shot.py/Shot.hit