Added Rainbow, Arrow Trail, Death effect and Double Jump Effect
This commit is contained in:
parent
b414a308fe
commit
41a649456a
@ -28,6 +28,11 @@ public class DustSpellColor extends ParticleColor
|
|||||||
_blue = b;
|
_blue = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Color toAwtColor()
|
||||||
|
{
|
||||||
|
return new Color(_red, _green, _blue);
|
||||||
|
}
|
||||||
|
|
||||||
public float getX()
|
public float getX()
|
||||||
{
|
{
|
||||||
return (float) _red / 255f;
|
return (float) _red / 255f;
|
||||||
|
@ -62,6 +62,7 @@ import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom;
|
|||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRainbow;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailSpring;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailSpring;
|
||||||
@ -81,6 +82,7 @@ import mineplex.core.gadget.gadgets.death.DeathMapleLeaf;
|
|||||||
import mineplex.core.gadget.gadgets.death.DeathMusic;
|
import mineplex.core.gadget.gadgets.death.DeathMusic;
|
||||||
import mineplex.core.gadget.gadgets.death.DeathPinataBurst;
|
import mineplex.core.gadget.gadgets.death.DeathPinataBurst;
|
||||||
import mineplex.core.gadget.gadgets.death.DeathPresentDanger;
|
import mineplex.core.gadget.gadgets.death.DeathPresentDanger;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathRainbow;
|
||||||
import mineplex.core.gadget.gadgets.death.DeathShadow;
|
import mineplex.core.gadget.gadgets.death.DeathShadow;
|
||||||
import mineplex.core.gadget.gadgets.death.DeathSpring;
|
import mineplex.core.gadget.gadgets.death.DeathSpring;
|
||||||
import mineplex.core.gadget.gadgets.death.DeathStorm;
|
import mineplex.core.gadget.gadgets.death.DeathStorm;
|
||||||
@ -96,6 +98,7 @@ import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord;
|
|||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpRainbow;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpSpring;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpSpring;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
|
||||||
@ -226,7 +229,7 @@ import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
|||||||
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
|
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
|
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleGryo;
|
import mineplex.core.gadget.gadgets.particle.ParticleRainbow;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
|
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
|
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
|
||||||
@ -281,6 +284,7 @@ import mineplex.core.gadget.set.SetHalloween;
|
|||||||
import mineplex.core.gadget.set.SetHowlingWinds;
|
import mineplex.core.gadget.set.SetHowlingWinds;
|
||||||
import mineplex.core.gadget.set.SetMusic;
|
import mineplex.core.gadget.set.SetMusic;
|
||||||
import mineplex.core.gadget.set.SetParty;
|
import mineplex.core.gadget.set.SetParty;
|
||||||
|
import mineplex.core.gadget.set.SetRainbow;
|
||||||
import mineplex.core.gadget.set.SetShadow;
|
import mineplex.core.gadget.set.SetShadow;
|
||||||
import mineplex.core.gadget.set.SetSpring;
|
import mineplex.core.gadget.set.SetSpring;
|
||||||
import mineplex.core.gadget.set.SetTitan;
|
import mineplex.core.gadget.set.SetTitan;
|
||||||
@ -476,6 +480,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addSet(new SetSpring(this));
|
addSet(new SetSpring(this));
|
||||||
addSet(new SetCanadian(this));
|
addSet(new SetCanadian(this));
|
||||||
addSet(new SetHalloween(this));
|
addSet(new SetHalloween(this));
|
||||||
|
addSet(new SetRainbow(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createGadgets()
|
private void createGadgets()
|
||||||
@ -638,7 +643,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ParticleCanadian(this));
|
addGadget(new ParticleCanadian(this));
|
||||||
|
|
||||||
addGadget(new ParticleHalloween(this));
|
addGadget(new ParticleHalloween(this));
|
||||||
addGadget(new ParticleGryo(this, _achievementManager));
|
addGadget(new ParticleRainbow(this, _achievementManager));
|
||||||
|
|
||||||
// Arrow Trails
|
// Arrow Trails
|
||||||
addGadget(new ArrowTrailFrostLord(this));
|
addGadget(new ArrowTrailFrostLord(this));
|
||||||
@ -656,6 +661,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ArrowTrailHalloween(this));
|
addGadget(new ArrowTrailHalloween(this));
|
||||||
addGadget(new ArrowTrailSpring(this));
|
addGadget(new ArrowTrailSpring(this));
|
||||||
addGadget(new ArrowTrailRedWhite(this));
|
addGadget(new ArrowTrailRedWhite(this));
|
||||||
|
addGadget(new ArrowTrailRainbow(this, _achievementManager));
|
||||||
|
|
||||||
// Death Effect
|
// Death Effect
|
||||||
addGadget(new DeathFrostLord(this));
|
addGadget(new DeathFrostLord(this));
|
||||||
@ -674,6 +680,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new DeathSpring(this));
|
addGadget(new DeathSpring(this));
|
||||||
addGadget(new DeathMapleLeaf(this));
|
addGadget(new DeathMapleLeaf(this));
|
||||||
addGadget(new DeathHalloween(this));
|
addGadget(new DeathHalloween(this));
|
||||||
|
addGadget(new DeathRainbow(this, _achievementManager));
|
||||||
|
|
||||||
// Double Jump
|
// Double Jump
|
||||||
addGadget(new DoubleJumpFrostLord(this));
|
addGadget(new DoubleJumpFrostLord(this));
|
||||||
@ -691,6 +698,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new DoubleJumpHalloween(this));
|
addGadget(new DoubleJumpHalloween(this));
|
||||||
addGadget(new DoubleJumpSpring(this));
|
addGadget(new DoubleJumpSpring(this));
|
||||||
addGadget(new DoubleJumpMaple(this));
|
addGadget(new DoubleJumpMaple(this));
|
||||||
|
addGadget(new DoubleJumpRainbow(this, _achievementManager));
|
||||||
|
|
||||||
// Hat
|
// Hat
|
||||||
for (HatType hatType : HatType.values())
|
for (HatType hatType : HatType.values())
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.arrowtrail;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.achievement.AchievementManager;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.set.SetRainbow;
|
||||||
|
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||||
|
import mineplex.core.gadget.util.CostConstants;
|
||||||
|
import mineplex.core.particleeffects.BabyFireworkEffect;
|
||||||
|
|
||||||
|
public class ArrowTrailRainbow extends ArrowEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private final AchievementManager _achievementManager;
|
||||||
|
private final Map<Player, Integer> _rings;
|
||||||
|
|
||||||
|
public ArrowTrailRainbow(GadgetManager manager, AchievementManager achievementManager)
|
||||||
|
{
|
||||||
|
super(manager, "Rainbow Arrows", SetRainbow.GADGET_LORE, CostConstants.NO_LORE, Material.WOOL, (byte) (UtilMath.r(14) + 1));
|
||||||
|
|
||||||
|
_achievementManager = achievementManager;
|
||||||
|
_rings = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.enableCustom(player, message);
|
||||||
|
|
||||||
|
int size = Math.min(SetRainbow.PER_LEVEL, 1 + _achievementManager.getMineplexLevelNumber(player) / SetRainbow.PER_LEVEL);
|
||||||
|
|
||||||
|
_rings.put(player, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.disableCustom(player, message);
|
||||||
|
|
||||||
|
_rings.remove(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doTrail(Arrow arrow)
|
||||||
|
{
|
||||||
|
Player shooter = (Player) arrow.getShooter();
|
||||||
|
int rings = _rings.get(shooter);
|
||||||
|
|
||||||
|
for (int i = 0; i < rings; i++)
|
||||||
|
{
|
||||||
|
DustSpellColor colour = SetRainbow.COLOURS[i];
|
||||||
|
|
||||||
|
new ColoredParticle(ParticleType.RED_DUST, colour, UtilAlg.getRandomLocation(arrow.getLocation(), 0.2))
|
||||||
|
.display();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doHitEffect(Arrow arrow)
|
||||||
|
{
|
||||||
|
Player shooter = (Player) arrow.getShooter();
|
||||||
|
Location location = arrow.getLocation();
|
||||||
|
int rings = _rings.get(shooter);
|
||||||
|
|
||||||
|
for (int i = 0; i < rings; i++)
|
||||||
|
{
|
||||||
|
DustSpellColor colour = SetRainbow.COLOURS[i];
|
||||||
|
|
||||||
|
new BabyFireworkEffect(UtilAlg.getRandomLocation(location, 1, 0.5, 1), colour.toAwtColor())
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.death;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import mineplex.core.achievement.AchievementManager;
|
||||||
|
import mineplex.core.blood.BloodEvent;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.set.SetRainbow;
|
||||||
|
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||||
|
import mineplex.core.gadget.util.CostConstants;
|
||||||
|
|
||||||
|
public class DeathRainbow extends DeathEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final double RADIUS = 1.3;
|
||||||
|
|
||||||
|
private final AchievementManager _achievementManager;
|
||||||
|
private final Map<Player, Integer> _rings;
|
||||||
|
|
||||||
|
public DeathRainbow(GadgetManager manager, AchievementManager achievementManager)
|
||||||
|
{
|
||||||
|
super(manager, "Rainbow Death", SetRainbow.GADGET_LORE, CostConstants.NO_LORE, Material.WOOL, (byte) (UtilMath.r(14) + 1));
|
||||||
|
|
||||||
|
_achievementManager = achievementManager;
|
||||||
|
_rings = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.enableCustom(player, message);
|
||||||
|
|
||||||
|
int size = Math.min(SetRainbow.PER_LEVEL, 1 + _achievementManager.getMineplexLevelNumber(player) / SetRainbow.PER_LEVEL);
|
||||||
|
|
||||||
|
_rings.put(player, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.disableCustom(player, message);
|
||||||
|
|
||||||
|
_rings.remove(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlood(Player player, BloodEvent event)
|
||||||
|
{
|
||||||
|
event.setItem(Material.WOOL, (byte) (UtilMath.r(14) + 1));
|
||||||
|
|
||||||
|
Location location = player.getLocation().add(0, 0.2, 0);
|
||||||
|
int rings = _rings.get(player);
|
||||||
|
|
||||||
|
Manager.runSyncTimer(new BukkitRunnable()
|
||||||
|
{
|
||||||
|
|
||||||
|
int iterations = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
if (++iterations > 15)
|
||||||
|
{
|
||||||
|
cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location pLocation = location.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < rings; i++)
|
||||||
|
{
|
||||||
|
DustSpellColor colour = SetRainbow.COLOURS[i];
|
||||||
|
|
||||||
|
for (double theta = 0; theta < 2 * Math.PI; theta += Math.PI / 20)
|
||||||
|
{
|
||||||
|
double x = RADIUS * Math.cos(theta);
|
||||||
|
double z = RADIUS * Math.sin(theta);
|
||||||
|
|
||||||
|
pLocation.add(x, 0, z);
|
||||||
|
|
||||||
|
new ColoredParticle(ParticleType.RED_DUST, colour, pLocation)
|
||||||
|
.display();
|
||||||
|
|
||||||
|
pLocation.subtract(x, 0, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
pLocation.add(0, 0.2, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.doublejump;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import mineplex.core.achievement.AchievementManager;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.set.SetRainbow;
|
||||||
|
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||||
|
import mineplex.core.gadget.util.CostConstants;
|
||||||
|
|
||||||
|
public class DoubleJumpRainbow extends DoubleJumpEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private final AchievementManager _achievementManager;
|
||||||
|
private final Map<Player, Integer> _rings;
|
||||||
|
|
||||||
|
public DoubleJumpRainbow(GadgetManager manager, AchievementManager achievementManager)
|
||||||
|
{
|
||||||
|
super(manager, "Rainbow Leap", SetRainbow.GADGET_LORE, CostConstants.NO_LORE, Material.WOOL, (byte) (UtilMath.r(14) + 1));
|
||||||
|
|
||||||
|
_achievementManager = achievementManager;
|
||||||
|
_rings = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.enableCustom(player, message);
|
||||||
|
|
||||||
|
int size = Math.min(SetRainbow.PER_LEVEL, 1 + _achievementManager.getMineplexLevelNumber(player) / SetRainbow.PER_LEVEL);
|
||||||
|
|
||||||
|
_rings.put(player, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.disableCustom(player, message);
|
||||||
|
|
||||||
|
_rings.remove(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doEffect(Player player)
|
||||||
|
{
|
||||||
|
Location location = player.getLocation().add(0, 0.2, 0);
|
||||||
|
int rings = _rings.get(player);
|
||||||
|
|
||||||
|
Manager.runSyncTimer(new BukkitRunnable()
|
||||||
|
{
|
||||||
|
|
||||||
|
int iterations = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
if (++iterations > 15)
|
||||||
|
{
|
||||||
|
cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double radius = 0.5;
|
||||||
|
|
||||||
|
for (int i = 0; i < rings; i++)
|
||||||
|
{
|
||||||
|
DustSpellColor colour = SetRainbow.COLOURS[i];
|
||||||
|
|
||||||
|
for (double theta = 0; theta < 2 * Math.PI; theta += Math.PI / (2 * i + 1))
|
||||||
|
{
|
||||||
|
double x = radius * Math.cos(theta);
|
||||||
|
double z = radius * Math.sin(theta);
|
||||||
|
|
||||||
|
location.add(x, 0, z);
|
||||||
|
|
||||||
|
new ColoredParticle(ParticleType.RED_DUST, colour, location)
|
||||||
|
.display();
|
||||||
|
|
||||||
|
location.subtract(x, 0, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
radius += 0.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,6 @@ package mineplex.core.gadget.gadgets.particle;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -11,35 +10,21 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.achievement.AchievementManager;
|
import mineplex.core.achievement.AchievementManager;
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.common.util.particles.ColoredParticle;
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
import mineplex.core.common.util.particles.DustSpellColor;
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.set.SetRainbow;
|
||||||
import mineplex.core.gadget.types.ParticleGadget;
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
import mineplex.core.gadget.util.CostConstants;
|
import mineplex.core.gadget.util.CostConstants;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
public class ParticleGryo extends ParticleGadget
|
public class ParticleRainbow extends ParticleGadget
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final int RING_PER = 10;
|
|
||||||
private static final DustSpellColor[] COLOURS =
|
|
||||||
{
|
|
||||||
new DustSpellColor(Color.RED),
|
|
||||||
new DustSpellColor(Color.ORANGE),
|
|
||||||
new DustSpellColor(Color.YELLOW),
|
|
||||||
new DustSpellColor(Color.LIME),
|
|
||||||
new DustSpellColor(Color.GREEN),
|
|
||||||
new DustSpellColor(Color.AQUA),
|
|
||||||
new DustSpellColor(Color.TEAL),
|
|
||||||
new DustSpellColor(Color.BLUE),
|
|
||||||
new DustSpellColor(Color.FUCHSIA),
|
|
||||||
new DustSpellColor(Color.PURPLE),
|
|
||||||
};
|
|
||||||
private static final double STARTING_RADIUS = 0.7;
|
private static final double STARTING_RADIUS = 0.7;
|
||||||
private static final double SEPARATING_RADIUS = 0.1;
|
private static final double SEPARATING_RADIUS = 0.1;
|
||||||
private static final double MAX_THETA = 2 * Math.PI;
|
private static final double MAX_THETA = 2 * Math.PI;
|
||||||
@ -50,20 +35,9 @@ public class ParticleGryo extends ParticleGadget
|
|||||||
|
|
||||||
private double _vectorTheta;
|
private double _vectorTheta;
|
||||||
|
|
||||||
public ParticleGryo(GadgetManager manager, AchievementManager achievementManager)
|
public ParticleRainbow(GadgetManager manager, AchievementManager achievementManager)
|
||||||
{
|
{
|
||||||
super(manager, "Rainbow Aura", new String[]
|
super(manager, "Rainbow Aura", SetRainbow.GADGET_LORE, CostConstants.NO_LORE, Material.WOOL, (byte) (UtilMath.r(14) + 1));
|
||||||
{
|
|
||||||
C.cWhite + "Bask in the light of",
|
|
||||||
C.cWhite + "your dedication with a",
|
|
||||||
C.cWhite + "set of rainbows that get",
|
|
||||||
C.cWhite + "cooler the more you level up",
|
|
||||||
C.blankLine,
|
|
||||||
C.cWhite + "+1 Ring per " + RING_PER + " Mineplex Levels",
|
|
||||||
C.blankLine,
|
|
||||||
C.cBlue + "Only purchasable during",
|
|
||||||
C.cBlue + "November 2017",
|
|
||||||
}, CostConstants.NO_LORE, Material.WOOL, (byte) (UtilMath.r(14) + 1));
|
|
||||||
|
|
||||||
_achievementManager = achievementManager;
|
_achievementManager = achievementManager;
|
||||||
_rings = new HashMap<>();
|
_rings = new HashMap<>();
|
||||||
@ -74,7 +48,7 @@ public class ParticleGryo extends ParticleGadget
|
|||||||
{
|
{
|
||||||
super.enableCustom(player, message);
|
super.enableCustom(player, message);
|
||||||
|
|
||||||
int size = Math.min(RING_PER, 1 + _achievementManager.getMineplexLevelNumber(player) / RING_PER);
|
int size = Math.min(SetRainbow.PER_LEVEL, 1 + _achievementManager.getMineplexLevelNumber(player) / SetRainbow.PER_LEVEL);
|
||||||
|
|
||||||
_rings.put(player, size);
|
_rings.put(player, size);
|
||||||
}
|
}
|
||||||
@ -97,7 +71,7 @@ public class ParticleGryo extends ParticleGadget
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < rings; i++)
|
for (int i = 0; i < rings; i++)
|
||||||
{
|
{
|
||||||
DustSpellColor colour = COLOURS[i];
|
DustSpellColor colour = SetRainbow.COLOURS[i];
|
||||||
double x = Math.random() - 0.5;
|
double x = Math.random() - 0.5;
|
||||||
double y = Math.random() - 0.5;
|
double y = Math.random() - 0.5;
|
||||||
double z = Math.random() - 0.5;
|
double z = Math.random() - 0.5;
|
||||||
@ -114,7 +88,7 @@ public class ParticleGryo extends ParticleGadget
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < rings; i++)
|
for (int i = 0; i < rings; i++)
|
||||||
{
|
{
|
||||||
DustSpellColor colour = COLOURS[i];
|
DustSpellColor colour = SetRainbow.COLOURS[i];
|
||||||
int j = i + 1;
|
int j = i + 1;
|
||||||
double vectorTheta = _vectorTheta + (MAX_THETA / j);
|
double vectorTheta = _vectorTheta + (MAX_THETA / j);
|
||||||
double r = STARTING_RADIUS + SEPARATING_RADIUS * j;
|
double r = STARTING_RADIUS + SEPARATING_RADIUS * j;
|
@ -0,0 +1,54 @@
|
|||||||
|
package mineplex.core.gadget.set;
|
||||||
|
|
||||||
|
import org.bukkit.Color;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRainbow;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathRainbow;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpRainbow;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleRainbow;
|
||||||
|
import mineplex.core.gadget.types.GadgetSet;
|
||||||
|
|
||||||
|
public class SetRainbow extends GadgetSet
|
||||||
|
{
|
||||||
|
|
||||||
|
public static final int PER_LEVEL = 10;
|
||||||
|
public static final String[] GADGET_LORE =
|
||||||
|
{
|
||||||
|
C.cWhite + "Bask in the light of",
|
||||||
|
C.cWhite + "your dedication with a",
|
||||||
|
C.cWhite + "set of rainbows that get",
|
||||||
|
C.cWhite + "cooler the more you level up",
|
||||||
|
C.blankLine,
|
||||||
|
C.cWhite + "+1 Color per " + PER_LEVEL + " Mineplex Levels",
|
||||||
|
C.blankLine,
|
||||||
|
C.cBlue + "Only purchasable as part of",
|
||||||
|
C.cBlue + "the Rainbow Bundle during",
|
||||||
|
C.cBlue + "November 2017",
|
||||||
|
};
|
||||||
|
public static final DustSpellColor[] COLOURS =
|
||||||
|
{
|
||||||
|
new DustSpellColor(Color.RED),
|
||||||
|
new DustSpellColor(Color.ORANGE),
|
||||||
|
new DustSpellColor(Color.YELLOW),
|
||||||
|
new DustSpellColor(Color.LIME),
|
||||||
|
new DustSpellColor(Color.GREEN),
|
||||||
|
new DustSpellColor(Color.AQUA),
|
||||||
|
new DustSpellColor(Color.TEAL),
|
||||||
|
new DustSpellColor(Color.BLUE),
|
||||||
|
new DustSpellColor(Color.FUCHSIA),
|
||||||
|
new DustSpellColor(Color.PURPLE),
|
||||||
|
};
|
||||||
|
|
||||||
|
public SetRainbow(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Rainbow", "None",
|
||||||
|
manager.getGadget(ArrowTrailRainbow.class),
|
||||||
|
manager.getGadget(DeathRainbow.class),
|
||||||
|
manager.getGadget(DoubleJumpRainbow.class),
|
||||||
|
manager.getGadget(ParticleRainbow.class)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -90,7 +90,6 @@ public abstract class GadgetSet implements Listener
|
|||||||
public void customDisable(Player player)
|
public void customDisable(Player player)
|
||||||
{
|
{
|
||||||
player.sendMessage(F.main("Gadget", "Set Disabled: " + F.elem(C.cRed + getName())));
|
player.sendMessage(F.main("Gadget", "Set Disabled: " + F.elem(C.cRed + getName())));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Gadget[] getGadgets()
|
public Gadget[] getGadgets()
|
||||||
|
@ -43,6 +43,7 @@ public class PowerPlayClubRewards
|
|||||||
.put(YearMonth.of(2017, Month.AUGUST), new UnknownSalesPackageItem("Melonhead Morph"))
|
.put(YearMonth.of(2017, Month.AUGUST), new UnknownSalesPackageItem("Melonhead Morph"))
|
||||||
.put(YearMonth.of(2017, Month.SEPTEMBER), new UnknownSalesPackageItem("Tornado"))
|
.put(YearMonth.of(2017, Month.SEPTEMBER), new UnknownSalesPackageItem("Tornado"))
|
||||||
.put(YearMonth.of(2017, Month.OCTOBER), new UnknownSalesPackageItem("Ghast Morph"))
|
.put(YearMonth.of(2017, Month.OCTOBER), new UnknownSalesPackageItem("Ghast Morph"))
|
||||||
|
.put(YearMonth.of(2017, Month.NOVEMBER), new UnknownSalesPackageItem("Tic Tac Toc"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public interface PowerPlayClubItem
|
public interface PowerPlayClubItem
|
||||||
|
Loading…
Reference in New Issue
Block a user