Tweak nether minibosses
This commit is contained in:
parent
f4397d0b0b
commit
394ebf9ad0
@ -1,8 +1,8 @@
|
||||
package mineplex.game.clans.clans.nether.miniboss;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -29,7 +29,7 @@ public class NetherMinibossManager implements Listener
|
||||
{
|
||||
private static final long MINIBOSS_SPAWN_RATE = 10000;
|
||||
private NetherManager _manager;
|
||||
private HashMap<Location, NetherMinibossType> _spawns = new HashMap<>();
|
||||
private Map<Location, NetherMinibossType> _spawns = new HashMap<>();
|
||||
private long _lastSpawned;
|
||||
private boolean _allowSpawn = false;
|
||||
private boolean _allowSpawnEvent = false;
|
||||
@ -49,16 +49,13 @@ public class NetherMinibossManager implements Listener
|
||||
sort.add(new Location(manager.getNetherWorld(), 43, 134, 22));
|
||||
sort.add(new Location(manager.getNetherWorld(), 102, 141, -31));
|
||||
sort.add(new Location(manager.getNetherWorld(), 151, 136, 34));
|
||||
sort.sort(new Comparator<Location>()
|
||||
sort.sort((o1, o2) ->
|
||||
{
|
||||
public int compare(Location o1, Location o2)
|
||||
if (UtilMath.offset2d(o1, manager.getNetherWorld().getSpawnLocation()) < UtilMath.offset(o2, manager.getNetherWorld().getSpawnLocation()))
|
||||
{
|
||||
if (UtilMath.offset2d(o1, manager.getNetherWorld().getSpawnLocation()) < UtilMath.offset(o2, manager.getNetherWorld().getSpawnLocation()))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
@ -17,12 +17,12 @@ public enum NetherMinibossType
|
||||
ARCHER("Undead Archer", 25D, EntityType.SKELETON, ArcherMiniboss.class)
|
||||
;
|
||||
|
||||
private Class<? extends NetherMiniBoss> _code;
|
||||
private Class<? extends NetherMiniBoss<?>> _code;
|
||||
private String _name;
|
||||
private Double _maxHealth;
|
||||
private EntityType _type;
|
||||
|
||||
private NetherMinibossType(String name, Double maxHealth, EntityType type, Class<? extends NetherMiniBoss> code)
|
||||
private NetherMinibossType(String name, Double maxHealth, EntityType type, Class<? extends NetherMiniBoss<?>> code)
|
||||
{
|
||||
_name = name;
|
||||
_maxHealth = maxHealth;
|
||||
@ -35,7 +35,7 @@ public enum NetherMinibossType
|
||||
* @param spawn The location to spawn the boss in
|
||||
* @return The instance of the miniboss
|
||||
*/
|
||||
public NetherMiniBoss getNewInstance(Location spawn)
|
||||
public NetherMiniBoss<?> getNewInstance(Location spawn)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
package mineplex.game.clans.clans.nether.miniboss.bosses;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Location;
|
||||
@ -38,7 +37,7 @@ public class ArcherMiniboss extends NetherMiniBoss<Skeleton>
|
||||
private static final double RUNE_DROP_CHANCE = .02;
|
||||
private static final int MAX_VALUABLE_DROPS = 5;
|
||||
private static final Material[] VALUABLE_DROP_TYPES = new Material[] {Material.DIAMOND, Material.GOLD_INGOT, Material.IRON_INGOT, Material.LEATHER};
|
||||
private static final Material[] SET_DROP_TYPES = (Material[])Arrays.asList(Material.values()).stream().filter(t -> t.name().contains("HELMET") || t.name().contains("CHESTPLATE") || t.name().contains("LEGGINGS") || t.name().contains("BOOTS")).toArray();
|
||||
private static final Material[] SET_DROP_TYPES = new Material[] {Material.DIAMOND_HELMET, Material.DIAMOND_CHESTPLATE, Material.DIAMOND_LEGGINGS, Material.DIAMOND_BOOTS, Material.GOLD_HELMET, Material.GOLD_CHESTPLATE, Material.GOLD_LEGGINGS, Material.GOLD_BOOTS, Material.IRON_HELMET, Material.IRON_CHESTPLATE, Material.IRON_LEGGINGS, Material.IRON_BOOTS, Material.CHAINMAIL_HELMET, Material.CHAINMAIL_CHESTPLATE, Material.CHAINMAIL_LEGGINGS, Material.CHAINMAIL_BOOTS, Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS};
|
||||
private static final double SET_DROP_CHANCE = .02;
|
||||
|
||||
public ArcherMiniboss(String displayName, Double maxHealth, Location spawn, EntityType type)
|
||||
|
@ -1,18 +1,7 @@
|
||||
package mineplex.game.clans.clans.nether.miniboss.bosses;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.amplifiers.AmplifierManager;
|
||||
import mineplex.game.clans.clans.nether.miniboss.MinibossFireball;
|
||||
import mineplex.game.clans.clans.nether.miniboss.NetherMiniBoss;
|
||||
import mineplex.game.clans.items.runes.RuneManager.RuneAttribute;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -24,6 +13,16 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.amplifiers.AmplifierManager;
|
||||
import mineplex.game.clans.clans.nether.miniboss.MinibossFireball;
|
||||
import mineplex.game.clans.clans.nether.miniboss.NetherMiniBoss;
|
||||
import mineplex.game.clans.items.runes.RuneManager.RuneAttribute;
|
||||
|
||||
/**
|
||||
* Class for running an individual Ghast miniboss
|
||||
*/
|
||||
@ -36,7 +35,7 @@ public class GhastMiniboss extends NetherMiniBoss<Ghast>
|
||||
private static final int MAX_VALUABLE_DROPS = 5;
|
||||
private static final Material[] VALUABLE_DROP_TYPES = new Material[] {Material.DIAMOND, Material.GOLD_INGOT, Material.IRON_INGOT, Material.LEATHER};
|
||||
private static final double MAX_TARGET_RANGE = 25;
|
||||
private static final Material[] SET_DROP_TYPES = (Material[])Arrays.asList(Material.values()).stream().filter(t -> t.name().contains("HELMET") || t.name().contains("CHESTPLATE") || t.name().contains("LEGGINGS") || t.name().contains("BOOTS")).toArray();
|
||||
private static final Material[] SET_DROP_TYPES = new Material[] {Material.DIAMOND_HELMET, Material.DIAMOND_CHESTPLATE, Material.DIAMOND_LEGGINGS, Material.DIAMOND_BOOTS, Material.GOLD_HELMET, Material.GOLD_CHESTPLATE, Material.GOLD_LEGGINGS, Material.GOLD_BOOTS, Material.IRON_HELMET, Material.IRON_CHESTPLATE, Material.IRON_LEGGINGS, Material.IRON_BOOTS, Material.CHAINMAIL_HELMET, Material.CHAINMAIL_CHESTPLATE, Material.CHAINMAIL_LEGGINGS, Material.CHAINMAIL_BOOTS, Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS};
|
||||
private static final double SET_DROP_CHANCE = .02;
|
||||
private long _lastFireballUse;
|
||||
private int _fireballsRemaining;
|
||||
|
@ -1,17 +1,7 @@
|
||||
package mineplex.game.clans.clans.nether.miniboss.bosses;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.amplifiers.AmplifierManager;
|
||||
import mineplex.game.clans.clans.nether.miniboss.NetherMiniBoss;
|
||||
import mineplex.game.clans.items.runes.RuneManager.RuneAttribute;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -28,6 +18,15 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.amplifiers.AmplifierManager;
|
||||
import mineplex.game.clans.clans.nether.miniboss.NetherMiniBoss;
|
||||
import mineplex.game.clans.items.runes.RuneManager.RuneAttribute;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
/**
|
||||
* Class for running an individual Warrior miniboss
|
||||
*/
|
||||
@ -36,7 +35,7 @@ public class WarriorMiniboss extends NetherMiniBoss<Zombie>
|
||||
private static final double RUNE_DROP_CHANCE = .02;
|
||||
private static final int MAX_VALUABLE_DROPS = 5;
|
||||
private static final Material[] VALUABLE_DROP_TYPES = new Material[] {Material.DIAMOND, Material.GOLD_INGOT, Material.IRON_INGOT, Material.LEATHER};
|
||||
private static final Material[] SET_DROP_TYPES = (Material[])Arrays.asList(Material.values()).stream().filter(t -> t.name().contains("HELMET") || t.name().contains("CHESTPLATE") || t.name().contains("LEGGINGS") || t.name().contains("BOOTS")).toArray();
|
||||
private static final Material[] SET_DROP_TYPES = new Material[] {Material.DIAMOND_HELMET, Material.DIAMOND_CHESTPLATE, Material.DIAMOND_LEGGINGS, Material.DIAMOND_BOOTS, Material.GOLD_HELMET, Material.GOLD_CHESTPLATE, Material.GOLD_LEGGINGS, Material.GOLD_BOOTS, Material.IRON_HELMET, Material.IRON_CHESTPLATE, Material.IRON_LEGGINGS, Material.IRON_BOOTS, Material.CHAINMAIL_HELMET, Material.CHAINMAIL_CHESTPLATE, Material.CHAINMAIL_LEGGINGS, Material.CHAINMAIL_BOOTS, Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS};
|
||||
private static final double SET_DROP_CHANCE = .02;
|
||||
private static final double LEAP_CHANCE = .9;
|
||||
private static final double LEAP_MIN_DIST = 3;
|
||||
|
Loading…
Reference in New Issue
Block a user