<commit_before>Recipe: Skillshot (with Auto-Rotate)
==============================================

This guide shows you how to build an MPF config for a skillshot with
automatically-rotating targets. When the player's turn starts the target shots
will rotate one "lit" shot rapidly, and when the ball is plunged the rotation
will stop and the lit shot will flash as the skillshot target.


Step 1. Create a skillshot mode and shots
------------------------------------------

Skillshots are a self-contained set of rules, so it's wise to create a separate
mode that can be started when a player's ball starts and ended after the
skillshot is hit (or missed).

.. code-block:: mpf-config
  #config_version=5
  modes:
    - skillshot_with_auto_rotate
    -
  switches:
    s_dropbank_1:
      number: 1
    s_dropbank_2:
      number: 2
    s_dropbank_3
      number: 3
    s_dropbank_4:
      number: 4
    s_dropbank_5:
      number: 5
  lights:
    l_dropbank_1:
      number: 1
    l_dropbank_2:
      number: 2
    l_dropbank_3
      number: 3
    l_dropbank_4:
      number: 4
    l_dropbank_5:
      number: 5

  ##! mode: skillshot_with_auto_rotate
  #! mode:
  #!   start_events: start_mode_skillshot_with_auto_rotate
  #!   stop_events: stop_mode_skillshot_with_auto_rotate
  #!   priority: 1000
  #! shot_profiles:
  #!   skillshot_profile:
  #!     states:
  #!       - name: off
  #!       - name: on


The first thing our mode needs is :doc:`/config/shots`. Each possible target
will be a shot (in this example, we'll have five). Each shot has a switch,
a light, and a shot profile to track its state. The sample code below uses
dropbank switches for the skillshot, but you are free to use any switches you
like.

Each shot will also have unique ``advance_events`` configured, which will be
explained in detail in section 4. What's important to note now is that the first
shot includes ``advance_events: mode_skillshot_started`` so that this shot will
automatically light when the mode starts, as the first shot in the rotation.

.. code-block:: mpf-config

  ##! mode: skillshot_with_auto_rotate
  mode:
    start_events: start_mode_skillshot_with_auto_rotate
    stop_events: stop_mode_skillshot_with_auto_rotate
    priority: 1000

  shots:<commit_msg>fix typo in mpf-config code block<commit_after>Recipe: Skillshot (with Auto-Rotate)
==============================================

This guide shows you how to build an MPF config for a skillshot with
automatically-rotating targets. When the player's turn starts the target shots
will rotate one "lit" shot rapidly, and when the ball is plunged the rotation
will stop and the lit shot will flash as the skillshot target.


Step 1. Create a skillshot mode and shots
------------------------------------------

Skillshots are a self-contained set of rules, so it's wise to create a separate
mode that can be started when a player's ball starts and ended after the
skillshot is hit (or missed).

.. code-block:: yaml

  #config_version=5
  modes:
    - skillshot_with_auto_rotate
  switches:
    s_dropbank_1:
      number: 1
    s_dropbank_2:
      number: 2
    s_dropbank_3
      number: 3
    s_dropbank_4:
      number: 4
    s_dropbank_5:
      number: 5
  lights:
    l_dropbank_1:
      number: 1
    l_dropbank_2:
      number: 2
    l_dropbank_3
      number: 3
    l_dropbank_4:
      number: 4
    l_dropbank_5:
      number: 5

The first thing our mode needs is :doc:`/config/shots`. Each possible target
will be a shot (in this example, we'll have five). Each shot has a switch,
a light, and a shot profile to track its state. The sample code below uses
dropbank switches for the skillshot, but you are free to use any switches you
like.

Each shot will also have unique ``advance_events`` configured, which will be
explained in detail in section 4. What's important to note now is that the first
shot includes ``advance_events: mode_skillshot_started`` so that this shot will
automatically light when the mode starts, as the first shot in the rotation.

.. code-block:: mpf-config

  ##! mode: skillshot_with_auto_rotate
  mode:
    start_events: start_mode_skillshot_with_auto_rotate
    stop_events: stop_mode_skillshot_with_auto_rotate
    priority: 1000

  shots:
{'fraction_non_alphanumeric': 0.09559689192371086, 'fraction_numerical': 0.013656698846244408, 'mean_word_length': 3.218470705064548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '236467', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1262, 'n_words': 516}