mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Better way to handle daze effect.
This commit is contained in:
parent
79bcd76aa0
commit
1bcf43db63
@ -18,8 +18,6 @@ public class DazeEventHandler {
|
|||||||
private EntityDamageEvent event;
|
private EntityDamageEvent event;
|
||||||
private Player defender;
|
private Player defender;
|
||||||
|
|
||||||
private final static int DAZE_CHANCE = 50;
|
|
||||||
|
|
||||||
protected int skillModifier;
|
protected int skillModifier;
|
||||||
|
|
||||||
protected DazeEventHandler (ArcheryManager manager, EntityDamageEvent event, Player defender) {
|
protected DazeEventHandler (ArcheryManager manager, EntityDamageEvent event, Player defender) {
|
||||||
@ -37,13 +35,7 @@ public class DazeEventHandler {
|
|||||||
|
|
||||||
protected void handleDazeEffect() {
|
protected void handleDazeEffect() {
|
||||||
Location location = defender.getLocation();
|
Location location = defender.getLocation();
|
||||||
|
location.setPitch(90 - Misc.getRandom().nextInt(181));
|
||||||
if (Misc.getRandom().nextInt(100) > DAZE_CHANCE) {
|
|
||||||
location.setPitch(90);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
location.setPitch(-90);
|
|
||||||
}
|
|
||||||
|
|
||||||
defender.teleport(location);
|
defender.teleport(location);
|
||||||
defender.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20 * 10, 10));
|
defender.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20 * 10, 10));
|
||||||
|
Loading…
Reference in New Issue
Block a user