Minor Tweaks.
• Fixed wrong evo location • Added a "Frozen" effect when evolving.
This commit is contained in:
parent
a19cd3559d
commit
463dfc7049
@ -23,7 +23,9 @@ import mineplex.core.updater.UpdateType;
|
|||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.combat.CombatComponent;
|
import mineplex.minecraft.game.core.combat.CombatComponent;
|
||||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||||
|
import mineplex.minecraft.game.core.condition.Condition;
|
||||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||||
|
import mineplex.minecraft.game.core.condition.conditions.Cloak;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionActive;
|
import mineplex.minecraft.game.core.condition.ConditionActive;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
@ -76,6 +78,8 @@ public class Evolution extends SoloGame
|
|||||||
private NautHashMap<Location, Location> _evoPlatforms = new NautHashMap<Location, Location>();
|
private NautHashMap<Location, Location> _evoPlatforms = new NautHashMap<Location, Location>();
|
||||||
|
|
||||||
private ArrayList<Player> _evolutionsAvailable = new ArrayList<Player>();
|
private ArrayList<Player> _evolutionsAvailable = new ArrayList<Player>();
|
||||||
|
private NautHashMap<String, Float> _chargingExp = new NautHashMap<String, Float>();
|
||||||
|
private NautHashMap<String, Condition[]> _evolvingDebuffs = new NautHashMap<String, Condition[]>();
|
||||||
|
|
||||||
public Evolution(ArcadeManager manager)
|
public Evolution(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
@ -84,8 +88,7 @@ public class Evolution extends SoloGame
|
|||||||
new Kit[0],
|
new Kit[0],
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"You recieve an Evolution token every 2 kills.",
|
"You can evolve every kill.",
|
||||||
"Use it to Evolve into a new mob.",
|
|
||||||
"Each evolution has unique skills.",
|
"Each evolution has unique skills.",
|
||||||
"First to get through 10 evolutions wins!"
|
"First to get through 10 evolutions wins!"
|
||||||
});
|
});
|
||||||
@ -188,9 +191,6 @@ public class Evolution extends SoloGame
|
|||||||
_tokens.put(player.getName(), new EvoToken(player));
|
_tokens.put(player.getName(), new EvoToken(player));
|
||||||
|
|
||||||
upgradeKit(player, false);
|
upgradeKit(player, false);
|
||||||
|
|
||||||
player.setLevel(0);
|
|
||||||
player.setExp(0F);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,6 +279,22 @@ public class Evolution extends SoloGame
|
|||||||
|
|
||||||
Manager.GetCondition().Factory().Cloak("Evolving", player, null, 20, false, false);
|
Manager.GetCondition().Factory().Cloak("Evolving", player, null, 20, false, false);
|
||||||
|
|
||||||
|
//Freeze
|
||||||
|
Condition cloak = new Cloak(Manager.GetCondition(), "Evolving", player, null, ConditionType.CLOAK, 0, (int)(20 * 20), false, Material.GHAST_TEAR, (byte)0, false);
|
||||||
|
Condition speed = new Condition(Manager.GetCondition(), "Evolving", player, null, ConditionType.SPEED, 128, (int)(20 * 20), false, Material.FEATHER, (byte)0, false, false);
|
||||||
|
Condition slow = new Condition(Manager.GetCondition(), "Evolving", player, null, ConditionType.SLOW, Integer.MAX_VALUE, (int)(20 * 20), false, Material.WEB, (byte)0, false, false);
|
||||||
|
Condition jump = new Condition(Manager.GetCondition(), "Evolving", player, null, ConditionType.JUMP, -Integer.MAX_VALUE, (int)(20 * 20), false, Material.CARROT_ITEM, (byte)0, false, false);
|
||||||
|
|
||||||
|
_evolvingDebuffs.put(player.getName(), new Condition[]
|
||||||
|
{
|
||||||
|
cloak, speed, slow, jump
|
||||||
|
});
|
||||||
|
|
||||||
|
Manager.GetCondition().AddCondition(cloak);
|
||||||
|
Manager.GetCondition().AddCondition(speed);
|
||||||
|
Manager.GetCondition().AddCondition(slow);
|
||||||
|
Manager.GetCondition().AddCondition(jump);
|
||||||
|
|
||||||
((Player) player).playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 1.25f);
|
((Player) player).playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 1.25f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,8 +305,23 @@ public class Evolution extends SoloGame
|
|||||||
{
|
{
|
||||||
for (ConditionActive condition : Manager.GetCondition().GetActiveConditions().get(event.getPlayer()))
|
for (ConditionActive condition : Manager.GetCondition().GetActiveConditions().get(event.getPlayer()))
|
||||||
{
|
{
|
||||||
if (condition.GetCondition().GetType() == ConditionType.CLOAK)
|
if (_evolvingDebuffs.containsKey(event.getPlayer().getName()))
|
||||||
continue;
|
{
|
||||||
|
boolean d = false;
|
||||||
|
for (Condition debuf : _evolvingDebuffs.get(event.getPlayer().getName()))
|
||||||
|
{
|
||||||
|
if (condition.GetCondition() == debuf)
|
||||||
|
{
|
||||||
|
d = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
condition.GetCondition().Expire();
|
condition.GetCondition().Expire();
|
||||||
}
|
}
|
||||||
@ -314,11 +345,13 @@ public class Evolution extends SoloGame
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void endEvolve(final EvolutionPostEvolveEvent event)
|
public void endEvolve(final EvolutionPostEvolveEvent event)
|
||||||
{
|
{
|
||||||
try
|
if (_evolvingDebuffs.containsKey(event.getPlayer().getName()))
|
||||||
{
|
{
|
||||||
Manager.GetCondition().GetActiveCondition(event.getPlayer(), ConditionType.CLOAK).Expire();
|
for (Condition debuf : _evolvingDebuffs.get(event.getPlayer().getName()))
|
||||||
|
{
|
||||||
|
debuf.Expire();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (NullPointerException ex){}
|
|
||||||
|
|
||||||
if (getScore(event.getPlayer()) >= 10)
|
if (getScore(event.getPlayer()) >= 10)
|
||||||
{
|
{
|
||||||
@ -373,8 +406,8 @@ public class Evolution extends SoloGame
|
|||||||
{
|
{
|
||||||
_evolutionsAvailable.add(player);
|
_evolutionsAvailable.add(player);
|
||||||
|
|
||||||
player.setLevel(0);
|
if (_chargingExp.containsKey(player.getName()))
|
||||||
player.setExp(0F);
|
_chargingExp.remove(player.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,11 +463,8 @@ public class Evolution extends SoloGame
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (player.getExp() != 0F)
|
if (_chargingExp.containsKey(player.getName()))
|
||||||
player.setExp(0F);
|
_chargingExp.remove(player.getName());
|
||||||
|
|
||||||
if (player.getLevel() != 0)
|
|
||||||
player.setLevel(0);
|
|
||||||
|
|
||||||
if (Recharge.Instance.use(player, "Evolve Available", 2000, false, false))
|
if (Recharge.Instance.use(player, "Evolve Available", 2000, false, false))
|
||||||
{
|
{
|
||||||
@ -452,12 +482,16 @@ public class Evolution extends SoloGame
|
|||||||
if (!player.isOnGround() || !UtilEnt.isGrounded(player) || !UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
if (!player.isOnGround() || !UtilEnt.isGrounded(player) || !UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (player.getExp() >= .9999F)
|
if (!_chargingExp.containsKey(player.getName()))
|
||||||
|
_chargingExp.put(player.getName(), 0F);
|
||||||
|
|
||||||
|
float exp = _chargingExp.get(player.getName());
|
||||||
|
|
||||||
|
if (exp >= .9999F)
|
||||||
{
|
{
|
||||||
UtilTextMiddle.display("", "", player);
|
UtilTextMiddle.display("", "", player);
|
||||||
|
|
||||||
player.setExp(0F);
|
_chargingExp.remove(player.getName());
|
||||||
player.setLevel(0);
|
|
||||||
|
|
||||||
EvoToken token = _tokens.get(player.getName());
|
EvoToken token = _tokens.get(player.getName());
|
||||||
|
|
||||||
@ -468,9 +502,9 @@ public class Evolution extends SoloGame
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setExp(Math.min(player.getExp() + .008F, .9999F));
|
_chargingExp.put(player.getName(), Math.min(exp + .008F, .9999F));
|
||||||
|
|
||||||
UtilTextMiddle.display("", UtilTextMiddle.progress(player.getExp()).trim(), player);
|
UtilTextMiddle.display("", UtilTextMiddle.progress(_chargingExp.get(player.getName())).trim(), player);
|
||||||
|
|
||||||
UtilParticle.PlayParticle(ParticleType.PORTAL, player.getLocation().clone().add(0, 1, 0), 0.5F, 1.0F, 0.5F, 0, 5, ViewDist.NORMAL, UtilServer.getPlayers());
|
UtilParticle.PlayParticle(ParticleType.PORTAL, player.getLocation().clone().add(0, 1, 0), 0.5F, 1.0F, 0.5F, 0, 5, ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
return false;
|
return false;
|
||||||
|
@ -88,7 +88,7 @@ public class EvolveData
|
|||||||
_eggLoc = player.getLocation().getBlock().getLocation();
|
_eggLoc = player.getLocation().getBlock().getLocation();
|
||||||
_eggLocData = new SimpleEntry<Material, Byte>(_eggLoc.getBlock().getType(), _eggLoc.getBlock().getData());
|
_eggLocData = new SimpleEntry<Material, Byte>(_eggLoc.getBlock().getType(), _eggLoc.getBlock().getData());
|
||||||
|
|
||||||
_eggHolo = new Hologram(holo, _eggLoc.clone().add(0.5, 1.0, 0.5), C.cYellow + _player.getName()).setViewDistance(20).start();
|
_eggHolo = new Hologram(holo, _eggLoc.clone().add(0.5, 1.0, 0.5), C.cYellow + _player.getName()).start();
|
||||||
|
|
||||||
_to = to;
|
_to = to;
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public class EvolveData
|
|||||||
|
|
||||||
private void setupPlayer()
|
private void setupPlayer()
|
||||||
{
|
{
|
||||||
_player.teleport(_token.Viewing.clone().add(0.5, 0.0, 0.5));
|
_player.teleport(_token.Viewing);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Boolean completed
|
//Boolean completed
|
||||||
|
Loading…
Reference in New Issue
Block a user