Minor Tweaks.

• Fixed wrong evo location
• Added a "Frozen" effect when evolving.
This commit is contained in:
Mysticate 2015-08-10 00:21:48 -04:00
parent a19cd3559d
commit 463dfc7049
2 changed files with 60 additions and 26 deletions

View File

@ -23,7 +23,9 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.CombatComponent;
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.conditions.Cloak;
import mineplex.minecraft.game.core.condition.ConditionActive;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
@ -76,6 +78,8 @@ public class Evolution extends SoloGame
private NautHashMap<Location, Location> _evoPlatforms = new NautHashMap<Location, Location>();
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)
{
@ -84,8 +88,7 @@ public class Evolution extends SoloGame
new Kit[0],
new String[]
{
"You recieve an Evolution token every 2 kills.",
"Use it to Evolve into a new mob.",
"You can evolve every kill.",
"Each evolution has unique skills.",
"First to get through 10 evolutions wins!"
});
@ -188,9 +191,6 @@ public class Evolution extends SoloGame
_tokens.put(player.getName(), new EvoToken(player));
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);
//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);
}
@ -289,8 +305,23 @@ public class Evolution extends SoloGame
{
for (ConditionActive condition : Manager.GetCondition().GetActiveConditions().get(event.getPlayer()))
{
if (condition.GetCondition().GetType() == ConditionType.CLOAK)
continue;
if (_evolvingDebuffs.containsKey(event.getPlayer().getName()))
{
boolean d = false;
for (Condition debuf : _evolvingDebuffs.get(event.getPlayer().getName()))
{
if (condition.GetCondition() == debuf)
{
d = true;
break;
}
}
if (d)
{
continue;
}
}
condition.GetCondition().Expire();
}
@ -314,11 +345,13 @@ public class Evolution extends SoloGame
@EventHandler
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)
{
@ -372,9 +405,9 @@ public class Evolution extends SoloGame
if (!_evolutionsAvailable.contains(player))
{
_evolutionsAvailable.add(player);
player.setLevel(0);
player.setExp(0F);
if (_chargingExp.containsKey(player.getName()))
_chargingExp.remove(player.getName());
}
}
@ -430,12 +463,9 @@ public class Evolution extends SoloGame
}
else
{
if (player.getExp() != 0F)
player.setExp(0F);
if (player.getLevel() != 0)
player.setLevel(0);
if (_chargingExp.containsKey(player.getName()))
_chargingExp.remove(player.getName());
if (Recharge.Instance.use(player, "Evolve Available", 2000, false, false))
{
UtilTextMiddle.display("", C.cGreen + C.Bold + "Hold Crouch to Evolve", 0, 60, 20, player);
@ -452,12 +482,16 @@ public class Evolution extends SoloGame
if (!player.isOnGround() || !UtilEnt.isGrounded(player) || !UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
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);
player.setExp(0F);
player.setLevel(0);
_chargingExp.remove(player.getName());
EvoToken token = _tokens.get(player.getName());
@ -468,9 +502,9 @@ public class Evolution extends SoloGame
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());
return false;

View File

@ -88,7 +88,7 @@ public class EvolveData
_eggLoc = player.getLocation().getBlock().getLocation();
_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;
@ -114,7 +114,7 @@ public class EvolveData
private void setupPlayer()
{
_player.teleport(_token.Viewing.clone().add(0.5, 0.0, 0.5));
_player.teleport(_token.Viewing);
}
//Boolean completed