<commit_before><?php
/**
 * BMSkillOrnery: Code specific to the ornery die skill
 *
 * @author james
 */

/**
 * This class contains code specific to the ornery die skill
 */
class BMSkillOrnery extends BMSkill {
    public static $hooked_methods = array('perform_end_of_turn_die_actions');

    public static function perform_end_of_turn_die_actions(&$args) {
        if (!is_array($args)) {
            return;
        }

        if (!array_key_exists('die', $args)) {
            return;
        }

        if (!($args['die'] instanceof BMDie)) {
            return;
        }

        if (!array_key_exists('attackType', $args)) {
            return;
        }

        if ('Pass' == $args['attackType']) {
            return;
        }

        $die = $args['die'];

        if ($die->hasAttacked) {
            return;
        }

        if ($die->unavailable) {
            return;
        }

        $die->roll(FALSE);
        $die->add_flag('HasJustRerolledOrnery');
        return TRUE;
    }

    protected static function get_description() {
        return 'At the end of every turn, if the player does not pass, ' .
               'then the attacker\'s ornery dice reroll, even if they ' .
               'did not attack in that turn. Ornery dice do not reroll a ' .
               'second time if they attacked.';
    }

    protected static function get_interaction_descriptions() {
        return array();
    }
}<commit_msg>Updated descriptions of ornery<commit_after><?php
/**
 * BMSkillOrnery: Code specific to the ornery die skill
 *
 * @author james
 */

/**
 * This class contains code specific to the ornery die skill
 */
class BMSkillOrnery extends BMSkill {
    public static $hooked_methods = array('perform_end_of_turn_die_actions');

    public static function perform_end_of_turn_die_actions(&$args) {
        if (!is_array($args)) {
            return;
        }

        if (!array_key_exists('die', $args)) {
            return;
        }

        if (!($args['die'] instanceof BMDie)) {
            return;
        }

        if (!array_key_exists('attackType', $args)) {
            return;
        }

        if ('Pass' == $args['attackType']) {
            return;
        }

        $die = $args['die'];

        if ($die->hasAttacked) {
            return;
        }

        if ($die->unavailable) {
            return;
        }

        $die->roll(FALSE);
        $die->add_flag('HasJustRerolledOrnery');
        return TRUE;
    }

    protected static function get_description() {
        return 'Ornery dice reroll every time the player makes any attack - ' .
               'whether the Ornery dice participated in it or not. The only time ' .
               'they don\'t reroll is if the player passes, making no attack whatsoever.';
    }

    protected static function get_interaction_descriptions() {
        return array(
            'Mad' => 'Dice with both Ornery and Mad Swing have their sizes randomized during ornery rerolls',
            'Mood' => 'Dice with both Ornery and Mood Swing have their sizes randomized during ornery rerolls',
        );
    }
}
{'fraction_non_alphanumeric': 0.10925449871465295, 'fraction_numerical': 0.0, 'mean_word_length': 1.9619410085632731, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4094737', 'n_tokens_mistral': 925, 'n_tokens_neox': 885, 'n_words': 257}