Redid evolution!

This commit is contained in:
Mysticate 2015-07-28 00:15:41 -04:00
parent 727427165f
commit 0e00086b9e
29 changed files with 1710 additions and 511 deletions

View File

@ -232,14 +232,21 @@ public abstract class Game implements Listener
public boolean GiveClock = true;
public boolean AllowParticles = true;
public long PrepareTime = 9000;
public boolean PlaySoundGameStart = true;
//Gems
public double GemMultiplier = 1;
public boolean GemHunterEnabled = true;
public boolean GemBoosterEnabled = true;
public boolean GemDoubleEnabled = true;
public double GemKillDeathRespawn = .5;
public double GemAssistDeathRespawn = .5;
public long PrepareTime = 9000;
public boolean PlaySoundGameStart = true;
public double GemKillDeathOut = 4;
public double GemAssistDeathOut = 1;
//Gameplay Data
public HashMap<Location, Player> PrivateBlockMap = new HashMap<Location, Player>();
@ -565,18 +572,27 @@ public abstract class Game implements Listener
public double GetKillsGems(Player killer, Player killed, boolean assist)
{
if (!DeathOut)
if (DeathOut)
{
return 0.5;
}
if (!assist)
{
return 4;
if (!assist)
{
return GemKillDeathOut;
}
else
{
return GemAssistDeathOut;
}
}
else
{
return 1;
if (!assist)
{
return GemKillDeathRespawn;
}
else
{
return GemAssistDeathRespawn;
}
}
}

View File

@ -0,0 +1,34 @@
package nautilus.game.arcade.game.games.evolution;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
public abstract class EvoKit extends Kit
{
public EvoKit(ArcadeManager manager, String name, String[] kitDesc, Perk[] kitPerks, EntityType type)
{
super(manager, name, KitAvailability.Hide, 0, kitDesc, kitPerks, type, null);
}
public void upgradeGive(Player player)
{
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + ("aeiou".indexOf(GetName().toLowerCase().substring(0, 1)) == -1 ? "a " : "an ") + F.elem(C.cGreen + C.Bold + GetName()) + "!");
for (String desc : GetDesc())
UtilPlayer.message(player, desc);
UtilPlayer.message(player, C.Line);
}
@Override
public abstract void GiveItems(Player player);
}

View File

@ -1,15 +0,0 @@
package nautilus.game.arcade.game.games.evolution;
import org.bukkit.entity.Player;
public class EvoScore
{
public org.bukkit.entity.Player Player;
public int Kills;
public EvoScore(Player player, int i)
{
Player = player;
Kills = i;
}
}

View File

@ -0,0 +1,35 @@
package nautilus.game.arcade.game.games.evolution;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.entity.Player;
public class EvoToken implements Comparable<EvoToken>
{
public final Player Player;
public final Kit BuffKit;
public int Kills = 0;
public EvoToken(Player player, Kit kit)
{
Player = player;
BuffKit = kit;
}
@Override
public int compareTo(EvoToken o)
{
if (Kills == o.Kills)
{
return 0;
}
if (Kills > o.Kills)
{
return -1;
}
return 1;
}
}

View File

@ -1,7 +1,33 @@
package nautilus.game.arcade.game.games.evolution;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Collections;
import mineplex.core.common.util.C;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.evolution.kits.KitAgility;
import nautilus.game.arcade.game.games.evolution.kits.KitHealth;
import nautilus.game.arcade.game.games.evolution.kits.KitRecharge;
import nautilus.game.arcade.game.games.evolution.mobs.KitBlaze;
import nautilus.game.arcade.game.games.evolution.mobs.KitChicken;
import nautilus.game.arcade.game.games.evolution.mobs.KitCreeper;
import nautilus.game.arcade.game.games.evolution.mobs.KitEnderman;
import nautilus.game.arcade.game.games.evolution.mobs.KitGolem;
import nautilus.game.arcade.game.games.evolution.mobs.KitSkeleton;
import nautilus.game.arcade.game.games.evolution.mobs.KitSlime;
import nautilus.game.arcade.game.games.evolution.mobs.KitSnowman;
import nautilus.game.arcade.game.games.evolution.mobs.KitSpider;
import nautilus.game.arcade.game.games.evolution.mobs.KitWolf;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type;
@ -11,94 +37,95 @@ import org.bukkit.event.EventPriority;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.evolution.kits.*;
import nautilus.game.arcade.game.games.evolution.mobs.*;
import nautilus.game.arcade.kit.Kit;
public class Evolution extends SoloGame
{
private ArrayList<EvoScore> _ranks = new ArrayList<EvoScore>();
private ArrayList<String> _lastScoreboard = new ArrayList<String>();
private HashMap<Player, Kit> _bonusKit = new HashMap<Player, Kit>();
private Objective _scoreObj;
private ArrayList<Kit> _boosterKits = new ArrayList<Kit>();
private ArrayList<EvoKit> _mobKits = new ArrayList<EvoKit>();
private NautHashMap<String, EvoToken> _tokens = new NautHashMap<String, EvoToken>();
private Objective _evoObj;
public Evolution(ArcadeManager manager)
{
super(manager, GameType.Evolution,
new Kit[]
{
new KitHealth(manager),
new KitAgility(manager),
new KitRecharge(manager),
new KitGolem(manager), //Iron
new KitBlaze(manager), //Chainmail
new KitSlime(manager), //Chainmail
new KitCreeper(manager), //None
new KitEnderman(manager), //Chainmail
new KitSkeleton(manager), //Leather
new KitSpider(manager), //Chainmail
new KitSnowman(manager), //Leather
new KitWolf(manager), //Leather
new KitChicken(manager),
},
new Kit[0],
new String[]
{
"You evolve when you get a kill.",
"Each evolution has unique skills.",
"",
"First to get through 10 evolutions wins!"
});
this.DamageTeamSelf = true;
//Custom kit stuff to make other things easier
_boosterKits.add(new KitHealth(manager));
_boosterKits.add(new KitAgility(manager));
_boosterKits.add(new KitRecharge(manager));
this.HungerSet = 20;
_mobKits.add(new KitGolem(manager));
_mobKits.add(new KitBlaze(manager));
_mobKits.add(new KitSlime(manager));
_mobKits.add(new KitCreeper(manager));
_mobKits.add(new KitEnderman(manager));
_mobKits.add(new KitSpider(manager));
_mobKits.add(new KitSnowman(manager));
_mobKits.add(new KitWolf(manager));
_mobKits.add(new KitChicken(manager));
_mobKits.add(new KitSkeleton(manager));
this.DeathOut = false;
ArrayList<Kit> allKits = new ArrayList<Kit>();
allKits.addAll(_boosterKits);
allKits.addAll(_mobKits);
this.PrepareFreeze = false;
Kit[] kits = new Kit[allKits.size()];
for (int i = 0 ; i < allKits.size() ; i++)
{
kits[i] = allKits.get(i);
}
setKits(kits);
DamageTeamSelf = true;
HungerSet = 20;
DeathOut = false;
PrepareFreeze = false;
this.SpawnDistanceRequirement = 16;
SpawnDistanceRequirement = 16;
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Evolutions", "dummy");
_scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME);
}
GemKillDeathRespawn = 2;
GemAssistDeathRespawn = .5;
@EventHandler(priority = EventPriority.MONITOR)
public void RegisterMobKits(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
return;
CompassEnabled = true;
CompassGiveItem = false;
AutomaticRespawn = false;
DeathSpectateSecs = 4.0;
VersionRequire1_8 = true;
_evoObj = Scoreboard.GetScoreboard().registerNewObjective("Evolutions", "dummy");
_evoObj.setDisplaySlot(DisplaySlot.BELOW_NAME);
}
//Double Kit
@EventHandler(priority = EventPriority.MONITOR)
public void StoreBonusKits(GameStateChangeEvent event)
public void storeTokens(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
if (event.GetState() != GameState.Prepare)
return;
for (Player player : GetPlayers(true))
{
_bonusKit.put(player, GetKit(player));
UpgradeKit(player, true);
_tokens.put(player.getName(), new EvoToken(player, GetKit(player)));
upgradeKit(player, false);
_evoObj.getScore(GetTeam(player).GetColor() + player.getName()).setScore(0);
}
}
@ -108,158 +135,118 @@ public class Evolution extends SoloGame
if (GetKit(player) == null)
return false;
if (GetKit(player).equals(kit))
if (GetKit(player) == (kit))
return true;
//Bonus Kit
if (_bonusKit.containsKey(player))
if (_bonusKit.get(player).equals(kit))
return true;
if (_tokens.get(player.getName()).BuffKit == kit)
return true;
return false;
}
@EventHandler
public void PlayerKillAward(CombatDeathEvent event)
public void onKill(CombatDeathEvent event)
{
Game game = Manager.GetGame();
if (game == null) return;
if (!(event.GetEvent().getEntity() instanceof Player))
if (!IsLive())
return;
if (!event.GetLog().GetKiller().IsPlayer())
return;
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (killer == null || !killer.isOnline())
return;
if (event.GetLog().GetKiller() == null)
if (!IsAlive(killer))
return;
if (killer == event.GetEvent().getEntity())
return;
final Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (killer == null)
return;
if (killer.equals(event.GetEvent().getEntity()))
return;
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
increaseScore(killer);
_evoObj.getScore(GetTeam(killer).GetColor() + killer.getName()).setScore(getScore(killer));
ScoreboardUpdate(new UpdateEvent(UpdateType.FAST));
if (getScore(killer) >= 10)
{
public void run()
{
UpgradeKit(killer, false);
}
}, 0);
End();
return;
}
if (upgradeKit(killer, true))
return;
killer.teleport(GetTeam(killer).GetSpawn());
UtilFirework.playFirework(killer.getEyeLocation(), Type.BALL, Color.GREEN, false, false);
}
public void UpgradeKit(Player player, boolean first)
{
if (!Recharge.Instance.use(player, "Evolve", 500, false, false))
return;
//Remove Old Recharges
Recharge.Instance.Reset(player);
Recharge.Instance.useForce(player, "Evolve", 500);
Kit kit = GetKit(player);
//Boolean ending
public boolean upgradeKit(Player player, boolean give)
{
if (!IsAlive(player))
return false;
for (int i=3 ; i<GetKits().length ; i++)
try
{
if (kit.equals(GetKits()[i]) || first)
EvoKit newKit = _mobKits.get(getScore(player));
SetKit(player, newKit, false);
if (give)
{
if (!first)
i++;
if (i<GetKits().length)
{
SetKit(player, GetKits()[i], false);
//Store Level
SetScore(player, i-3);
//Apply
GetKits()[i].ApplyKit(player);
//Firework
UtilFirework.playFirework(player.getEyeLocation(), Type.BALL, Color.LIME, false, false);
//Teleport
player.teleport(GetTeam(player).GetSpawn());
return;
}
else
{
End();
return;
}
newKit.upgradeGive(player);
}
return false;
}
catch (IndexOutOfBoundsException ex)
{
End();
return true;
}
}
public void SetScore(Player player, int level)
{
_scoreObj.getScore(player).setScore(level);
//Rank
for (EvoScore score : _ranks)
{
if (score.Player.equals(player))
{
score.Kills = level;
return;
}
}
_ranks.add(new EvoScore(player, level));
}
public int GetScore(Player player)
public void increaseScore(Player player)
{
if (!IsAlive(player))
return;
if (!_tokens.containsKey(player.getName()))
return;
_tokens.get(player.getName()).Kills++;
}
public int getScore(Player player)
{
if (!IsPlaying(player))
return 0;
//Rank
for (EvoScore score : _ranks)
{
if (score.Player.equals(player))
{
return score.Kills;
}
}
return 0;
return _tokens.get(player.getName()).Kills;
}
private void SortScores()
{
for (int i=0 ; i<_ranks.size() ; i++)
{
for (int j=_ranks.size()-1 ; j>0 ; j--)
{
if (_ranks.get(j).Kills > _ranks.get(j-1).Kills)
{
EvoScore temp = _ranks.get(j);
_ranks.set(j, _ranks.get(j-1));
_ranks.set(j-1, temp);
}
}
}
}
private void End()
{
SortScores();
ArrayList<EvoToken> tokens = new ArrayList<EvoToken>(_tokens.values());
Collections.sort(tokens);
//Set Places
ArrayList<Player> places = new ArrayList<Player>();
for (int i=0 ; i<_ranks.size() ; i++)
places.add(i, _ranks.get(i).Player);
ArrayList<Player> players = new ArrayList<Player>();
for (int i = 0 ; i < tokens.size() ; i++)
{
players.add(tokens.get(i).Player);
}
//Award Gems
if (_ranks.size() >= 1)
AddGems(_ranks.get(0).Player, 20, "1st Place", false, false);
if (tokens.size() >= 1)
AddGems(players.get(0), 20, "1st Place", false, false);
if (_ranks.size() >= 2)
AddGems(_ranks.get(1).Player, 15, "2nd Place", false, false);
if (tokens.size() >= 2)
AddGems(players.get(1), 15, "2nd Place", false, false);
if (_ranks.size() >= 3)
AddGems(_ranks.get(2).Player, 10, "3rd Place", false, false);
if (tokens.size() >= 3)
AddGems(players.get(2), 10, "3rd Place", false, false);
//Participation
for (Player player : GetPlayers(false))
@ -267,27 +254,27 @@ public class Evolution extends SoloGame
AddGems(player, 10, "Participation", false, false);
SetState(GameState.End);
AnnounceEnd(places);
}
@Override
public void EndCheck()
{
AnnounceEnd(players);
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.FAST)
return;
Scoreboard.Reset();
Scoreboard.WriteBlank();
for (Player player : GetPlayers(true))
{
Scoreboard.WriteOrdered("Score", C.cGreen + player.getName(), GetScore(player), true);
Scoreboard.WriteOrdered("Score", C.cGreen + player.getName(), getScore(player), true);
_evoObj.getScore(GetTeam(player).GetColor() + player.getName()).setScore(getScore(player));
}
Scoreboard.Draw();

View File

@ -0,0 +1,26 @@
package nautilus.game.arcade.game.games.evolution.events;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class EvolutionBeginEvent extends PlayerEvent
{
private static HandlerList _handlers = new HandlerList();
public EvolutionBeginEvent(Player who)
{
super(who);
}
public static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
}

View File

@ -0,0 +1,26 @@
package nautilus.game.arcade.game.games.evolution.events;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class EvolutionEndEvent extends PlayerEvent
{
private static HandlerList _handlers = new HandlerList();
public EvolutionEndEvent(Player who)
{
super(who);
}
public static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
}

View File

@ -0,0 +1,176 @@
package nautilus.game.arcade.game.games.evolution.evolve;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import net.minecraft.server.v1_7_R4.EntityBlaze;
import net.minecraft.server.v1_7_R4.EntityChicken;
import net.minecraft.server.v1_7_R4.EntityCreeper;
import net.minecraft.server.v1_7_R4.EntityEnderman;
import net.minecraft.server.v1_7_R4.EntityInsentient;
import net.minecraft.server.v1_7_R4.EntityIronGolem;
import net.minecraft.server.v1_7_R4.EntitySkeleton;
import net.minecraft.server.v1_7_R4.EntitySlime;
import net.minecraft.server.v1_7_R4.EntitySnowman;
import net.minecraft.server.v1_7_R4.EntitySpider;
import net.minecraft.server.v1_7_R4.EntityWolf;
import net.minecraft.server.v1_7_R4.EntityZombie;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
import net.minecraft.server.v1_7_R4.World;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class EvolveData
{
private long _curtime = System.currentTimeMillis();
private final EvolveManager _manager;
private final Player _player;
private final EntityType _from;
private final EntityType _to;
private boolean _switch = true;
private int _stage;
private EntityInsentient _eFrom;
private EntityInsentient _eTo;
public EvolveData(EvolveManager manager, Player player, EntityType from, EntityType to)
{
_manager = manager;
_player = player;
_from = from;
_to = to;
}
//Boolean completed
public boolean tick()
{
teleport();
_stage++;
if (_stage > 12)
return true;
if (!UtilTime.elapsed(_curtime, 1000 * (6 - (_stage / 2))))
return false;
_curtime = System.currentTimeMillis();
_switch = !_switch;
if (_switch)
{
despawn(_eTo);
_eFrom = spawn(_from);
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, new Location(_eFrom.world.getWorld(), _eFrom.locX, _eFrom.locY, _eFrom.locZ), 0.5F, 0.5F, 0.5F, 0, 5, ViewDist.SHORT, _player);
}
else
{
despawn(_eFrom);
_eTo = spawn(_to);
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, new Location(_eTo.world.getWorld(), _eTo.locX, _eTo.locY, _eTo.locZ), 0.5F, 0.5F, 0.5F, 0, 5, ViewDist.SHORT, _player);
}
return false;
}
private void teleport()
{
Location newLoc = UtilAlg.getTrajectory(_player.getLocation(), newLoc).normalize().toLocation(_player.getWorld());
double lead = i * ((2d * Math.PI)/game.GetTeamList().size());
double sizeMod = 4;
double oX = -Math.sin(lead) * sizeMod;
double oZ = Math.cos(lead) * sizeMod;
//Location
Location entLoc = spawn.clone().add(oX, 0, oZ);
_player.teleport(_manager.getLocation());
}
private EntityInsentient spawn(EntityType type)
{
try
{
EntityInsentient entity = getEntity(type).getConstructor(World.class).newInstance(((CraftWorld) _manager.getLocation().getWorld()).getHandle());
entity.setLocation(_manager.getLocation().getX(), _manager.getLocation().getY(), _manager.getLocation().getZ(), 0.0F, 0.0F);
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(entity);
entity.setCustomNameVisible(false);
UtilPlayer.sendPacket(_player, packet);
return entity;
}
catch (Exception ex)
{
ex.printStackTrace();
return null;
}
}
private void despawn(EntityInsentient entity)
{
if (entity == null)
return;
PacketPlayOutEntityDestroy packet = new PacketPlayOutEntityDestroy(new int[]
{
entity.getId()
});
UtilPlayer.sendPacket(_player, packet);
}
private Class<? extends EntityInsentient> getEntity(EntityType type)
{
if (type == EntityType.BLAZE)
return EntityBlaze.class;
if (type == EntityType.CHICKEN)
return EntityChicken.class;
if (type == EntityType.CREEPER)
return EntityCreeper.class;
if (type == EntityType.ENDERMAN)
return EntityEnderman.class;
if (type == EntityType.IRON_GOLEM)
return EntityIronGolem.class;
if (type == EntityType.SKELETON)
return EntitySkeleton.class;
if (type == EntityType.SLIME)
return EntitySlime.class;
if (type == EntityType.SNOWMAN)
return EntitySnowman.class;
if (type == EntityType.SPIDER)
return EntitySpider.class;
if (type == EntityType.WOLF)
return EntityWolf.class;
return EntityZombie.class;
}
}

View File

@ -0,0 +1,24 @@
package nautilus.game.arcade.game.games.evolution.evolve;
import nautilus.game.arcade.game.games.evolution.Evolution;
import org.bukkit.Location;
public class EvolveManager
{
private Evolution _host;
private final Location _evolveLoc;
public EvolveManager(Evolution evolution, Location evolveLoc)
{
_host = evolution;
_evolveLoc = evolveLoc;
}
public Location getLocation()
{
return _evolveLoc;
}
}

View File

@ -1,8 +1,7 @@
package nautilus.game.arcade.game.games.evolution.kits;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
@ -10,6 +9,10 @@ import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
import nautilus.game.arcade.kit.perks.PerkSpeed;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
public class KitAgility extends Kit
{
public KitAgility(ArcadeManager manager)
@ -18,21 +21,20 @@ public class KitAgility extends Kit
new String[]
{
"You are extremely agile and can double jump!"
"Before you dedicated your life to Evolution,",
"you were an extremely agile circus star!"
},
new Perk[]
{
new PerkDoubleJump("Double Jump", 0.8, 0.8, false),
new PerkSpeed(0),
},
EntityType.ZOMBIE,
null);
EntityType.ZOMBIE, new ItemBuilder(Material.FEATHER).build());
}
@Override
public void GiveItems(Player player)
{
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,8 +1,7 @@
package nautilus.game.arcade.game.games.evolution.kits;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
@ -10,6 +9,10 @@ import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkRegeneration;
import nautilus.game.arcade.kit.perks.PerkVampire;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
public class KitHealth extends Kit
{
public KitHealth(ArcadeManager manager)
@ -18,21 +21,19 @@ public class KitHealth extends Kit
new String[]
{
"You have improved survivability."
"You're better at surviving than a cockroach!"
},
new Perk[]
{
new PerkRegeneration(0),
new PerkVampire(6),
new PerkRegeneration(0)
},
EntityType.ZOMBIE,
null);
EntityType.ZOMBIE, new ItemBuilder(Material.POTION, 1, (short) 8197).build());
}
@Override
public void GiveItems(Player player)
{
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,8 +1,11 @@
package nautilus.game.arcade.game.games.evolution.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
@ -17,7 +20,8 @@ public class KitRecharge extends Kit
new String[]
{
"You are able to use your abilities more often!"
"You focus your mind before every game ",
"allowing you to perform skills more often!"
},
new Perk[]
@ -32,6 +36,6 @@ public class KitRecharge extends Kit
@Override
public void GiveItems(Player player)
{
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,50 +1,39 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseBlaze;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkFlamingSword;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseBlaze;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkFlamingSword;
public class KitBlaze extends Kit
public class KitBlaze extends EvoKit
{
public KitBlaze(ArcadeManager manager)
{
super(manager, "Blaze", KitAvailability.Hide,
{
super(manager, "Blaze",
new String[]
{
""
F.elem("Hold Block") + " to use " + F.elem("Inferno"),
F.elem("Attacks ignite opponents for 4 seconds")
},
new Perk[]
{
new PerkFlamingSword()
},
EntityType.SLIME,
null);
}, EntityType.BLAZE);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Hold Block") + " to use " + F.elem("Inferno"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 4f, 1f);
@ -52,6 +41,10 @@ public class KitBlaze extends Kit
DisguiseBlaze disguise = new DisguiseBlaze(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,5 +1,14 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkConstructor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Egg;
@ -7,68 +16,58 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkConstructor;
import nautilus.game.arcade.kit.perks.PerkFallDamage;
public class KitChicken extends Kit
public class KitChicken extends EvoKit
{
public KitChicken(ArcadeManager manager)
{
super(manager, "Chicken", KitAvailability.Hide,
new String[]
super(manager, "Chicken", new String[]
{
F.elem("Right-Click with Egg") + " to use " + F.elem("Throw Egg")
}, new Perk[]
{
""
},
new Perk[]
{
new PerkConstructor("Egg Pouch", 0.8, 8, Material.EGG, "Egg", false),
new PerkFallDamage(-2),
},
EntityType.SLIME,
null);
new PerkConstructor("Egg Pouch", 6.0, 3, Material.EGG, "Egg", false)
}, EntityType.CHICKEN);
}
@Override
public void GiveItems(Player player)
{
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Eggs") + " to use " + F.elem("Throw Egg"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.CHICKEN_IDLE, 4f, 1f);
//Disguise
DisguiseChicken disguise = new DisguiseChicken(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
@EventHandler
public void EggHit(CustomDamageEvent event)
{
if (event.IsCancelled())
if (!Manager.GetGame().IsLive())
return;
if (!(event.GetDamagerEntity(true) instanceof Player))
return;
Player player = event.GetDamagerPlayer(true);
if (!Manager.IsAlive(player))
return;
if (!HasKit(player))
return;
if (event.GetProjectile() == null)
return;
if (!(event.GetProjectile() instanceof Egg))
return;
event.AddMod("Chicken Kit", "Egg", 1, true);
event.AddMod("Chicken Kit", "Egg", 9, true);
}
}

View File

@ -1,52 +1,39 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.game.games.evolution.mobs.perks.PerkSulphurBombEVO;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkExplode;
import nautilus.game.arcade.kit.perks.PerkFood;
public class KitCreeper extends Kit
public class KitCreeper extends EvoKit
{
public KitCreeper(ArcadeManager manager)
{
super(manager, "Creeper", KitAvailability.Hide,
super(manager, "Creeper",
new String[]
{
""
F.elem("Right-Click With Axe") + " to use " + F.elem("Sulphur Bomb")
},
new Perk[]
{
new PerkFood(1),
new PerkExplode("Detonate", 1, 6000)
},
EntityType.SLIME,
null);
new PerkSulphurBombEVO()
}, EntityType.CREEPER);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.TNT));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Attack") + " to use " + F.elem("Detonate"));
UtilPlayer.message(player, C.Line);
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE));
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, 4f, 1f);
@ -54,6 +41,10 @@ public class KitCreeper extends Kit
DisguiseCreeper disguise = new DisguiseCreeper(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,52 +1,49 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseEnderman;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.game.games.evolution.mobs.perks.PerkBlockTossEVO;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBlink;
public class KitEnderman extends Kit
public class KitEnderman extends EvoKit
{
public KitEnderman(ArcadeManager manager)
{
super(manager, "Enderman", KitAvailability.Hide,
super(manager, "Enderman",
new String[]
{
""
F.elem("Right-Click Block With Sword") + " to use " + F.elem("Block Toss")
},
new Perk[]
{
new PerkBlink("Blink", 12, 4000)
},
EntityType.SLIME,
null);
new PerkBlockTossEVO()
}, EntityType.ENDERMAN);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Axe") + " to use " + F.elem("Blink"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.ENDERMAN_IDLE, 4f, 1f);
//Disguise
DisguiseEnderman disguise = new DisguiseEnderman(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,39 +1,33 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseIronGolem;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.game.games.evolution.mobs.perks.PerkSiesmicSlamEVO;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseIronGolem;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkSlam;
public class KitGolem extends Kit
public class KitGolem extends EvoKit
{
public KitGolem(ArcadeManager manager)
{
super(manager, "Iron Golem", KitAvailability.Hide,
super(manager, "Iron Golem",
new String[]
{
""
F.elem("Right-Click with Axe") + " to use " + F.elem("Ground Pound")
},
new Perk[]
{
new PerkSlam("Ground Pound", 1, 1.2, 10000),
},
EntityType.SLIME,
null);
new PerkSiesmicSlamEVO(),
}, EntityType.IRON_GOLEM);
}
@Override
@ -41,17 +35,16 @@ public class KitGolem extends Kit
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Axe") + " to use " + F.elem("Ground Pound"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.IRONGOLEM_DEATH, 4f, 1f);
//Disguise
DisguiseIronGolem disguise = new DisguiseIronGolem(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,52 +1,41 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBarrage;
import nautilus.game.arcade.kit.perks.PerkFletcher;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBarrage;
import nautilus.game.arcade.kit.perks.PerkFletcher;
public class KitSkeleton extends Kit
public class KitSkeleton extends EvoKit
{
public KitSkeleton(ArcadeManager manager)
{
super(manager, "Skeletal Archer", KitAvailability.Hide,
super(manager, "Skeletal Archer",
new String[]
{
""
F.elem("Charge Bow") + " to use " + F.elem("Barrage")
},
new Perk[]
{
new PerkFletcher(3, 2, false),
new PerkBarrage(5, 250, true, false)
},
EntityType.SLIME,
null);
}, EntityType.SKELETON);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Charge Bow") + " to use " + F.elem("Barrage"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.SKELETON_IDLE, 4f, 1f);
@ -54,6 +43,10 @@ public class KitSkeleton extends Kit
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,41 +1,33 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.game.games.evolution.mobs.perks.PerkBounceEVO;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkFallDamage;
import nautilus.game.arcade.kit.perks.PerkLeap;
public class KitSlime extends Kit
public class KitSlime extends EvoKit
{
public KitSlime(ArcadeManager manager)
{
super(manager, "Slime", KitAvailability.Hide,
super(manager, "Slime",
new String[]
{
""
},
F.elem("Right-Click with Axe") + " to use " + F.elem("Bounce")
},
new Perk[]
{
new PerkLeap("Bounce", 2, 2, 8000),
new PerkFallDamage(-40)
},
EntityType.SLIME,
null);
new PerkBounceEVO()
}, EntityType.SLIME);
}
@Override
@ -43,11 +35,6 @@ public class KitSlime extends Kit
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Axe") + " to use " + F.elem("Bounce"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.SLIME_WALK, 4f, 1f);
//Disguise
@ -55,6 +42,10 @@ public class KitSlime extends Kit
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
disguise.SetSize(3);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,5 +1,15 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseSnowman;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkArcticAura;
import nautilus.game.arcade.kit.perks.PerkConstructor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
@ -7,68 +17,62 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseSnowman;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkConstructor;
import nautilus.game.arcade.kit.perks.PerkFallDamage;
public class KitSnowman extends Kit
public class KitSnowman extends EvoKit
{
public KitSnowman(ArcadeManager manager)
{
super(manager, "Snowman", KitAvailability.Hide,
super(manager, "Snowman",
new String[]
{
""
F.elem("Right-Click with Snowball") + " to use " + F.elem("Throw Snowball"),
F.elem("You freeze enemies around you with slowness")
},
new Perk[]
{
new PerkConstructor("Snowballer", 0.5, 16, Material.SNOW_BALL, "Snowball", false),
new PerkFallDamage(-2),
},
EntityType.SLIME,
null);
new PerkArcticAura(),
}, EntityType.SNOWMAN);
}
@Override
public void GiveItems(Player player)
{
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Snowball") + " to use " + F.elem("Throw Snowball"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 4f, 1f);
//Disguise
DisguiseSnowman disguise = new DisguiseSnowman(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
@EventHandler
public void SnowballHit(CustomDamageEvent event)
{
if (event.IsCancelled())
if (!Manager.GetGame().IsLive())
return;
if (!(event.GetDamagerEntity(true) instanceof Player))
return;
Player player = event.GetDamagerPlayer(true);
if (!Manager.IsAlive(player))
return;
if (!HasKit(player))
return;
if (event.GetProjectile() == null)
return;
if (!(event.GetProjectile() instanceof Snowball))
return;
event.AddMod("Snowman Kit", "Snowball", 3, true);
event.AddMod("Snowman Kit", "Egg", 3, true);
}
}

View File

@ -1,39 +1,32 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseSpider;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.game.games.evolution.mobs.perks.PerkWebEVO;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseSpider;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkWeb;
public class KitSpider extends Kit
public class KitSpider extends EvoKit
{
public KitSpider(ArcadeManager manager)
{
super(manager, "Spider", KitAvailability.Hide,
super(manager, "Spider",
new String[]
{
""
F.elem("Right-Click Web") + " to use " + F.elem("Web Toss"),
},
new Perk[]
{
new PerkWeb(2,8)
},
EntityType.SLIME,
null);
new PerkWebEVO()
}, EntityType.SPIDER);
}
@Override
@ -41,17 +34,16 @@ public class KitSpider extends Kit
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_AXE));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Axe/Web") + " to use " + F.elem("Throw Web"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 4f, 1f);
//Disguise
DisguiseSpider disguise = new DisguiseSpider(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -1,41 +1,35 @@
package nautilus.game.arcade.game.games.evolution.mobs;
import mineplex.core.common.util.F;
import mineplex.core.disguise.disguises.DisguiseWolf;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.evolution.EvoKit;
import nautilus.game.arcade.game.games.evolution.mobs.perks.PerkPounceEVO;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkSpeed;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseBat;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkLeap;
import nautilus.game.arcade.kit.perks.PerkSpeed;
public class KitWolf extends Kit
public class KitWolf extends EvoKit
{
public KitWolf(ArcadeManager manager)
{
super(manager, "Wolf", KitAvailability.Hide,
super(manager, "Wolf",
new String[]
{
""
F.elem("Right-Click with Axe") + " to use " + F.elem("Pounce")
},
new Perk[]
{
new PerkSpeed(2),
new PerkLeap("Pounce", 1.2, 1, 4000)
},
EntityType.SLIME,
null);
new PerkSpeed(1),
new PerkPounceEVO()
}, EntityType.WOLF);
}
@Override
@ -43,17 +37,16 @@ public class KitWolf extends Kit
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_AXE));
UtilPlayer.message(player, C.Line);
UtilPlayer.message(player, C.Bold + "You evolved into " + F.elem(C.cGreen + C.Bold + GetName()) + "!");
UtilPlayer.message(player, F.elem("Right-Click with Axe") + " to use " + F.elem("Pounce"));
UtilPlayer.message(player, C.Line);
player.getWorld().playSound(player.getLocation(), Sound.WOLF_BARK, 4f, 1f);
//Disguise
DisguiseBat disguise = new DisguiseBat(player);
DisguiseWolf disguise = new DisguiseWolf(player);
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().undisguise(player);
Manager.GetDisguise().disguise(disguise);
player.getInventory().setItem(8, new ItemBuilder(Material.COMPASS).setTitle(F.item("Tracking Compass")).build());
}
}

View File

@ -0,0 +1,233 @@
package nautilus.game.arcade.game.games.evolution.mobs.perks;
import java.util.HashMap;
import java.util.HashSet;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.data.BlockTossData;
import nautilus.game.arcade.kit.perks.event.PerkBlockGrabEvent;
import nautilus.game.arcade.kit.perks.event.PerkBlockThrowEvent;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
public class PerkBlockTossEVO extends Perk implements IThrown
{
private HashMap<Player, BlockTossData> _hold = new HashMap<Player, BlockTossData>();
private HashMap<Player, Long> _charge = new HashMap<Player, Long>();
private HashSet<Player> _charged = new HashSet<Player>();
private HashMap<FallingBlock, Player> _falling = new HashMap<FallingBlock, Player>();
public PerkBlockTossEVO()
{
super("Block Toss", new String[]
{
});
}
@SuppressWarnings("deprecation")
@EventHandler
public void Grab(PlayerInteractEvent event)
{
if (!Manager.GetGame().IsLive())
return;
Player player = event.getPlayer();
if (!UtilEvent.isAction(event, ActionType.R_BLOCK))
return;
if (!Manager.IsAlive(player))
return;
if (!Kit.HasKit(player))
return;
if (!UtilInv.IsItem(event.getItem(), Material.IRON_SWORD, (byte) 0))
return;
if (_hold.containsKey(player))
return;
Block grab = event.getClickedBlock();
if (UtilBlock.usable(grab))
return;
if (!UtilBlock.airFoliage(grab.getRelative(BlockFace.UP)) || Manager.GetBlockRestore().Contains(grab.getRelative(BlockFace.UP)))
{
UtilPlayer.message(player, F.main("Game", "You may not pick up that block!"));
return;
}
if (!Recharge.Instance.use(event.getPlayer(), GetName(), 6000, true, false))
return;
Recharge.Instance.Get(event.getPlayer()).get(GetName()).DisplayForce = true;
//Event
PerkBlockGrabEvent blockEvent = new PerkBlockGrabEvent(player, grab.getTypeId(), grab.getData());
UtilServer.getServer().getPluginManager().callEvent(blockEvent);
//Block to Data
int id = grab.getTypeId();
byte data = grab.getData();
//Remove Block
//Manager.GetBlockRestore().Add(event.getClickedBlock(), 0, (byte)0, 10000);
event.getClickedBlock().getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, event.getClickedBlock().getType());
_hold.put(player, new BlockTossData(id, data));
_charge.put(player, System.currentTimeMillis());
//Effect
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, id);
}
@SuppressWarnings("deprecation")
@EventHandler
public void Throw(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
HashSet<Player> throwSet = new HashSet<Player>();
for (Player cur : _hold.keySet())
{
//Throw
if (!cur.isBlocking())
throwSet.add(cur);
//Charged Tick
if (!_charged.contains(cur))
if (System.currentTimeMillis() - _charge.get(cur) > 1200)
{
_charged.add(cur);
cur.playEffect(cur.getLocation(), Effect.CLICK1, 0);
}
}
for (Player cur : throwSet)
{
BlockTossData data = _hold.remove(cur);
FallingBlock block = cur.getWorld().spawnFallingBlock(cur.getEyeLocation().add(cur.getLocation().getDirection()), data.Type, data.Data);
_falling.put(block, cur);
_charged.remove(cur);
long charge = System.currentTimeMillis() - _charge.remove(cur);
//Throw
double mult = 1.4;
if (charge < 1200)
mult = mult * ((double)charge/1200d);
//Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 1f);
//Event
PerkBlockThrowEvent blockEvent = new PerkBlockThrowEvent(cur);
UtilServer.getServer().getPluginManager().callEvent(blockEvent);
}
}
@SuppressWarnings("deprecation")
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
if (target == null)
return;
//Damage Event
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.PROJECTILE, data.GetThrown().getVelocity().length() * 4, true, true, false,
UtilEnt.getName(data.GetThrower()), GetName());
//Block to Item
if (data.GetThrown() instanceof FallingBlock)
{
FallingBlock thrown = (FallingBlock) data.GetThrown();
FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), (byte)0);
//Remove Old
_falling.remove(thrown);
thrown.remove();
//Add New
if (data.GetThrower() instanceof Player)
_falling.put(newThrown, (Player)data.GetThrower());
}
}
@Override
public void Idle(ProjectileUser data)
{
}
@Override
public void Expire(ProjectileUser data)
{
}
@SuppressWarnings("deprecation")
@EventHandler
public void BlockForm(EntityChangeBlockEvent event)
{
if (!(event.getEntity() instanceof FallingBlock))
return;
FallingBlock falling = (FallingBlock)event.getEntity();
falling.getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, falling.getBlockId());
_falling.remove(falling);
falling.remove();
event.setCancelled(true);
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 2.5);
}
}

View File

@ -0,0 +1,147 @@
package nautilus.game.arcade.game.games.evolution.mobs.perks;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
public class PerkBounceEVO extends Perk
{
private NautHashMap<LivingEntity, Long> _live = new NautHashMap<LivingEntity, Long>();
public PerkBounceEVO()
{
super("Bounce", new String[]
{
});
}
//Literally just the slime slam code ;D
@EventHandler
public void Leap(PlayerInteractEvent event)
{
if (!Manager.GetGame().IsLive())
return;
if (!UtilEvent.isAction(event, ActionType.R))
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (!UtilInv.IsItem(event.getItem(), Material.IRON_AXE, (byte) 0))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 6000, true, true))
return;
UtilAction.velocity(player, player.getLocation().getDirection(), 1.6, false, 0, 0.5, 3.0, true);
//Record
_live.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void collide(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!Manager.GetGame().IsLive())
return;
//Collide
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!_live.containsKey(player))
continue;
for (Player cur : UtilPlayer.getNearby(player.getLocation(), 2.0))
{
if (!Manager.IsAlive(cur))
continue;
if (cur == player)
continue;
DoSlam(player, cur);
_live.remove(player);
return;
}
}
}
@EventHandler
public void end(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!Manager.GetGame().IsLive())
return;
//End
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!UtilEnt.isGrounded(player))
continue;
if (!_live.containsKey(player))
continue;
if (!UtilTime.elapsed(_live.get(player), 1000))
continue;
_live.remove(player);
}
}
public void DoSlam(Player damager, LivingEntity damagee)
{
int damage = 8;
//Damage Event
Manager.GetDamage().NewDamageEvent(damagee, damager, null,
DamageCause.CUSTOM, damage, true, true, false,
damager.getName(), GetName());
//Inform
UtilPlayer.message(damager, F.main("Game", "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName()) + "."));
UtilPlayer.message(damagee, F.main("Game", F.name(damager.getName()) + " hit you with " + F.skill(GetName()) + "."));
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 2);
}
}

View File

@ -0,0 +1,147 @@
package nautilus.game.arcade.game.games.evolution.mobs.perks;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
public class PerkPounceEVO extends Perk
{
private NautHashMap<LivingEntity, Long> _live = new NautHashMap<LivingEntity, Long>();
public PerkPounceEVO()
{
super("Pounce", new String[]
{
});
}
//Literally just the slime slam code ;D
@EventHandler
public void Leap(PlayerInteractEvent event)
{
if (!Manager.GetGame().IsLive())
return;
if (!UtilEvent.isAction(event, ActionType.R))
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (!UtilInv.IsItem(event.getItem(), Material.WOOD_AXE, (byte) 0))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 6000, true, true))
return;
UtilAction.velocity(player, player.getLocation().getDirection(), 1.4, false, 0, 0.3, 1.8, true);
//Record
_live.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void collide(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!Manager.GetGame().IsLive())
return;
//Collide
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!_live.containsKey(player))
continue;
for (Player cur : UtilPlayer.getNearby(player.getLocation(), 2.0))
{
if (!Manager.IsAlive(cur))
continue;
if (cur == player)
continue;
DoSlam(player, cur);
_live.remove(player);
return;
}
}
}
@EventHandler
public void end(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (!Manager.GetGame().IsLive())
return;
//End
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!UtilEnt.isGrounded(player))
continue;
if (!_live.containsKey(player))
continue;
if (!UtilTime.elapsed(_live.get(player), 1000))
continue;
_live.remove(player);
}
}
public void DoSlam(Player damager, LivingEntity damagee)
{
int damage = 6;
//Damage Event
Manager.GetDamage().NewDamageEvent(damagee, damager, null,
DamageCause.CUSTOM, damage, true, true, false,
damager.getName(), GetName());
//Inform
UtilPlayer.message(damager, F.main("Game", "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName()) + "."));
UtilPlayer.message(damagee, F.main("Game", F.name(damager.getName()) + " hit you with " + F.skill(GetName()) + "."));
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), .5);
}
}

View File

@ -0,0 +1,160 @@
package nautilus.game.arcade.game.games.evolution.mobs.perks;
import java.util.HashMap;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
public class PerkSiesmicSlamEVO extends Perk
{
private HashMap<LivingEntity, Long> _live = new HashMap<LivingEntity, Long>();
public PerkSiesmicSlamEVO()
{
super("Ground Pound", new String[]
{
});
}
@EventHandler
public void deactivateDeath(PlayerDeathEvent event)
{
if (!Manager.GetGame().IsLive())
return;
if (!Kit.HasKit(event.getEntity()))
return;
if (_live.containsKey(event.getEntity()))
{
_live.remove(event.getEntity());
}
}
@EventHandler
public void Leap(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (!Manager.GetGame().IsLive())
return;
if (!UtilEvent.isAction(event, ActionType.R))
return;
if (!UtilInv.IsItem(event.getItem(), Material.DIAMOND_AXE, (byte) 0))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 7000, true, false))
return;
Recharge.Instance.Get(player).get(GetName()).DisplayForce = true;
//Action
Vector vec = player.getLocation().getDirection();
if (vec.getY() < 0)
vec.setY(vec.getY() * -1);
UtilAction.velocity(player, vec, 1, true, 1, 0, 1, true);
//Record
_live.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
@SuppressWarnings("deprecation")
@EventHandler
public void Slam(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!UtilEnt.isGrounded(player))
continue;
if (!_live.containsKey(player))
continue;
if (!UtilTime.elapsed(_live.get(player), 1000))
continue;
_live.remove(player);
//Action
int damage = 8;
double range = 6;
HashMap<Player, Double> targets = UtilPlayer.getInRadius(player.getLocation(), range);
for (Player cur : targets.keySet())
{
if (cur == player)
continue;
if (!Manager.IsAlive((Player) cur))
continue;
//Damage Event
Manager.GetDamage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, damage * targets.get(cur) + 0.5, true, true, false,
player.getName(), GetName());
//Condition
Manager.GetCondition().Factory().Falling(GetName(), cur, player, 10, false, true);
//Inform
UtilPlayer.message(cur, F.main("Game", F.name(player.getName()) +" hit you with " + F.skill(GetName()) + "."));
}
//Effect
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_WOOD, 2f, 0.2f);
for (Block cur : UtilBlock.getInRadius(player.getLocation(), range).keySet())
if (UtilBlock.airFoliage(cur.getRelative(BlockFace.UP)) && !UtilBlock.airFoliage(cur))
cur.getWorld().playEffect(cur.getLocation(), Effect.STEP_SOUND, cur.getTypeId());
}
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 2.4);
}
}

View File

@ -0,0 +1,125 @@
package nautilus.game.arcade.game.games.evolution.mobs.perks;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
public class PerkSulphurBombEVO extends Perk implements IThrown
{
public PerkSulphurBombEVO()
{
super("Sulphur Bomb", new String[]
{
});
}
@EventHandler
public void fire(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (!UtilEvent.isAction(event, ActionType.R))
return;
if (!UtilInv.IsItem(event.getItem(), Material.DIAMOND_AXE, (byte) 0))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 3000, true, false))
return;
Recharge.Instance.Get(player).get(GetName()).DisplayForce = true;
event.setCancelled(true);
Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COAL, (byte)0));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true,
null, 1f, 1f,
null, 1, UpdateType.SLOW,
0.5f);
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
//Effect
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_DEATH, 2f, 1.5f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
Explode(data);
if (target == null)
return;
//Damage Event
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.PROJECTILE, 5, true, true, false,
UtilEnt.getName(data.GetThrower()), GetName());
}
@Override
public void Idle(ProjectileUser data)
{
Explode(data);
}
@Override
public void Expire(ProjectileUser data)
{
Explode(data);
}
public void Explode(ProjectileUser data)
{
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1,
ViewDist.MAX, UtilServer.getPlayers());
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
data.GetThrown().remove();
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 1.5);
}
}

View File

@ -0,0 +1,125 @@
package nautilus.game.arcade.game.games.evolution.mobs.perks;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class PerkWebEVO extends Perk implements IThrown
{
public PerkWebEVO()
{
super("Web Shot", new String[]
{
});
}
@EventHandler
public void Spawn(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
for (Player cur : UtilServer.getPlayers())
{
if (!Kit.HasKit(cur))
continue;
if (!Manager.GetGame().IsAlive(cur))
continue;
if (!Recharge.Instance.use(cur, GetName(), 3000, false, false))
continue;
if (UtilInv.contains(cur, Material.WEB, (byte)0, 8))
continue;
//Add
cur.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WEB));
}
}
@EventHandler
public void Throw(PlayerInteractEvent event)
{
if (event.getAction() == Action.PHYSICAL)
return;
if (!Manager.GetGame().IsLive())
return;
if (!Manager.IsAlive(event.getPlayer()))
return;
if (!UtilInv.IsItem(event.getItem(), Material.WEB, (byte) 0))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
event.setCancelled(true);
UtilInv.remove(player, Material.WEB, (byte)0, 1);
UtilInv.Update(player);
Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.WEB));
UtilAction.velocity(ent, player.getLocation().getDirection(), 0.8, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
if (target != null)
{
if (target instanceof Player)
{
if (!Manager.GetGame().IsAlive((Player)target))
{
return;
}
}
}
Web(data);
}
@Override
public void Idle(ProjectileUser data)
{
Web(data);
}
@Override
public void Expire(ProjectileUser data)
{
Web(data);
}
public void Web(ProjectileUser data)
{
Location loc = data.GetThrown().getLocation();
data.GetThrown().remove();
Manager.GetBlockRestore().Add(loc.getBlock(), 30, (byte)0, 4000);
}
}

View File

@ -17,7 +17,7 @@ public class PerkVampire extends Perk
{
super("Vampire", new String[]
{
C.cGray + "You heal " + recover + "HP when you kill someone",
C.cGray + "You heal " + C.cYellow + recover + " Hearts" + C.cGray + " when you kill someone",
});
_recover = recover;