{
    "format_version": "1.10.0",
    "animation_controllers": {
        "controller.animation.p2": {
            "initial_state": "default",
            "states": {
            "default": {
                "on_entry":["/function p2_display"],
            "transitions": [
                       {
            "fire": "q.get_equipped_item_name == 'p-2' && !q.is_item_name_any('slot.weapon.offhand', 0, 'hd:sec_mag') && q.is_using_item && q.all_animations_finished && !q.is_sneaking"
                        },
                       {
            "fire_aimed": "q.get_equipped_item_name == 'p-2' && !q.is_item_name_any('slot.weapon.offhand', 0, 'hd:sec_mag') && q.is_using_item && q.all_animations_finished && q.is_sneaking"
                        },
                        {
            "reload_full":"( q.is_item_name_any('slot.weapon.offhand', 0, 'hd:sec_mag') && q.get_equipped_item_name == 'p-2') && q.is_using_item && q.all_animations_finished"
                            
                        },
                        {
             "reload_empty": "(q.get_equipped_item_name == 'p-2_empty'  && (q.is_item_name_any('slot.hotbar', 0, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 1, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 2, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 3, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 4, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 5, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 6, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 7, 'hd:sec_mag') || q.is_item_name_any('slot.hotbar', 8, 'hd:sec_mag') )) && q.is_using_item && q.all_animations_finished"
                         }
                    ]
                },
            "fire": {
            "animations": ["p2fire"],
            "transitions": [
                      {
            "default":"query.all_animations_finished"
            }
                   ]
                },
            "fire_aimed": {
            "animations": ["p2fire_aimed"],
            "transitions": [
                      {
            "default":"query.all_animations_finished"
            }
                   ]
                },
            "reload_full": {
            "animations": ["p2reload_full"],
            "transitions": [
                      {
            "default":"query.all_animations_finished"
            }
                   ]
                },
            "reload_empty": {
            "animations": ["p2reload_empty"],
            "transitions": [
                      {
            "default":"query.all_animations_finished"
            }
                   ]
                }
            }
        }
    }
}