<commit_before>package com.gmail.nossr50.skills.archery;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;

import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.util.Misc;

public class DazeEventHandler {
    private ArcheryManager manager;
    private EntityDamageEvent event;
    private Player defender;

    private final static int DAZE_CHANCE = 50;

    protected int skillModifier;

    protected DazeEventHandler (ArcheryManager manager, EntityDamageEvent event, Player defender) {
        this.manager = manager;
        this.event = event;
        this.defender = defender;

        calculateSkillModifier();
    }

    protected void calculateSkillModifier() {
        this.skillModifier = SkillTools.skillCheck(manager.getSkillLevel(), Archery.dazeMaxBonusLevel);
    }

    protected void handleDazeEffect() {
        Location location = defender.getLocation();

        if (Misc.getRandom().nextInt(100) > DAZE_CHANCE) {
            location.setPitch(90);
        }
        else {
            location.setPitch(-90);
        }

        defender.teleport(location);
        event.setDamage(event.getDamage() + Archery.dazeModifier);
    }

    protected void sendAbilityMessages() {
        defender.sendMessage(LocaleLoader.getString("Combat.TouchedFuzzy"));
        manager.getMcMMOPlayer().getPlayer().sendMessage(LocaleLoader.getString("Combat.TargetDazed"));
    }
}
<commit_msg>Add potion effect for Daze.<commit_after>package com.gmail.nossr50.skills.archery;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.util.Misc;

public class DazeEventHandler {
    private ArcheryManager manager;
    private EntityDamageEvent event;
    private Player defender;

    private final static int DAZE_CHANCE = 50;

    protected int skillModifier;

    protected DazeEventHandler (ArcheryManager manager, EntityDamageEvent event, Player defender) {
        this.manager = manager;
        this.event = event;
        this.defender = defender;

        calculateSkillModifier();
    }

    protected void calculateSkillModifier() {
        this.skillModifier = SkillTools.skillCheck(manager.getSkillLevel(), Archery.dazeMaxBonusLevel);
    }

    protected void handleDazeEffect() {
        Location location = defender.getLocation();

        if (Misc.getRandom().nextInt(100) > DAZE_CHANCE) {
            location.setPitch(90);
        }
        else {
            location.setPitch(-90);
        }

        defender.teleport(location);
        defender.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20 * 10, 10));

        event.setDamage(event.getDamage() + Archery.dazeModifier);
    }

    protected void sendAbilityMessages() {
        manager.getMcMMOPlayer().getPlayer().sendMessage(LocaleLoader.getString("Combat.TargetDazed"));
    }
}

{'fraction_non_alphanumeric': 0.09487492373398414, 'fraction_numerical': 0.012202562538133009, 'mean_word_length': 2.989051094890511, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5452423', 'n_tokens_mistral': 1018, 'n_tokens_neox': 963, 'n_words': 164}