Working through JIRA
This commit is contained in:
parent
6df8330b3f
commit
3efeb38a01
@ -32,6 +32,7 @@ import nautilus.game.arcade.game.games.moba.kit.devon.HeroDevon;
|
||||
import nautilus.game.arcade.game.games.moba.kit.hattori.HeroHattori;
|
||||
import nautilus.game.arcade.game.games.moba.kit.hp.HPManager;
|
||||
import nautilus.game.arcade.game.games.moba.kit.larissa.HeroLarissa;
|
||||
import nautilus.game.arcade.game.games.moba.kit.rowena.HeroRowena;
|
||||
import nautilus.game.arcade.game.games.moba.minion.MinionManager;
|
||||
import nautilus.game.arcade.game.games.moba.prepare.PrepareManager;
|
||||
import nautilus.game.arcade.game.games.moba.prepare.PrepareSelection;
|
||||
@ -99,6 +100,7 @@ public class Moba extends TeamGame
|
||||
new HeroBiff(Manager),
|
||||
new HeroLarissa(Manager),
|
||||
new HeroBardolf(Manager),
|
||||
new HeroRowena(Manager),
|
||||
new HeroBob(Manager)
|
||||
};
|
||||
|
||||
|
@ -1,11 +1,13 @@
|
||||
package nautilus.game.arcade.game.games.moba.boss.wither;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
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.UtilTextTop;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -22,6 +24,7 @@ import nautilus.game.arcade.game.games.moba.structure.tower.TowerDestroyEvent;
|
||||
import nautilus.game.arcade.game.games.moba.util.MobaUtil;
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -29,6 +32,8 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class WitherBoss extends MobaBoss
|
||||
{
|
||||
|
||||
@ -37,11 +42,13 @@ public class WitherBoss extends MobaBoss
|
||||
private static final float SPEED_HOME = 6F;
|
||||
private static final int INITIAL_HEALTH = 125;
|
||||
private static final MobaAIMethod AI_METHOD = new MobaDirectAIMethod();
|
||||
private static final int MIN_INFORM_TIME = (int) TimeUnit.SECONDS.toMillis(30);
|
||||
|
||||
private GameTeam _team;
|
||||
private MobaAI _ai;
|
||||
private DisguiseWither _disguise;
|
||||
private boolean _damageable;
|
||||
private long _lastInform;
|
||||
|
||||
public WitherBoss(Moba host, Location location, GameTeam team)
|
||||
{
|
||||
@ -137,6 +144,18 @@ public class WitherBoss extends MobaBoss
|
||||
}
|
||||
}
|
||||
|
||||
// Inform the team
|
||||
if (UtilTime.elapsed(_lastInform, MIN_INFORM_TIME))
|
||||
{
|
||||
_lastInform = System.currentTimeMillis();
|
||||
|
||||
for (Player player : _team.GetPlayers(true))
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.ANVIL_LAND, 1, 0.5F);
|
||||
player.sendMessage(F.main("Game", "Your Wither is under attack."));
|
||||
}
|
||||
}
|
||||
|
||||
double newHealth = damagee.getHealth() - event.GetDamage();
|
||||
|
||||
// Don't allow the wither to move because of damage
|
||||
|
@ -11,7 +11,7 @@ public abstract class Buff<T extends LivingEntity> implements Listener
|
||||
protected final Moba _host;
|
||||
protected final BuffManager _manager;
|
||||
protected final T _entity;
|
||||
private final long _duration;
|
||||
protected final long _duration;
|
||||
|
||||
private long _start;
|
||||
|
||||
|
@ -37,6 +37,24 @@ public class BuffManager implements Listener
|
||||
buff.apply();
|
||||
}
|
||||
|
||||
public boolean hasBuff(LivingEntity entity, Class<? extends Buff<? extends LivingEntity>> clazz)
|
||||
{
|
||||
if (!_buffs.containsKey(entity))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Buff<? extends LivingEntity> buff : _buffs.get(entity))
|
||||
{
|
||||
if (buff.getClass().equals(clazz))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void update(UpdateEvent event)
|
||||
{
|
||||
|
@ -0,0 +1,30 @@
|
||||
package nautilus.game.arcade.game.games.moba.buff.buffs;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import nautilus.game.arcade.game.games.moba.Moba;
|
||||
import nautilus.game.arcade.game.games.moba.buff.Buff;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class BuffCripple extends Buff<Player>
|
||||
{
|
||||
|
||||
private static final ItemStack
|
||||
|
||||
public BuffCripple(Moba host, Player entity, long duration)
|
||||
{
|
||||
super(host, entity, duration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApply()
|
||||
{
|
||||
UtilTextMiddle.display("", C.cRed + "Crippled", 10, 20, 10, _entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExpire()
|
||||
{
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.events.PlayerKitGiveEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.moba.Moba;
|
||||
import nautilus.game.arcade.game.games.moba.buff.buffs.BuffCripple;
|
||||
import nautilus.game.arcade.game.games.moba.util.MobaUtil;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
@ -286,6 +287,7 @@ public class HeroSkill extends Perk
|
||||
return;
|
||||
}
|
||||
|
||||
Moba moba = (Moba) Manager.GetGame();
|
||||
long current = System.currentTimeMillis();
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
@ -307,6 +309,12 @@ public class HeroSkill extends Perk
|
||||
|
||||
boolean done = UtilTime.elapsed(start, cooldown);
|
||||
|
||||
// If the player is crippled say they are
|
||||
if (moba.getBuffManager().hasBuff(player, BuffCripple.class))
|
||||
{
|
||||
itemStack =
|
||||
}
|
||||
|
||||
if (done)
|
||||
{
|
||||
_lastSkill.remove(player.getUniqueId());
|
||||
|
@ -1,27 +1,16 @@
|
||||
package nautilus.game.arcade.game.games.moba.kit.anath;
|
||||
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.game.games.moba.Moba;
|
||||
import nautilus.game.arcade.game.games.moba.kit.HeroSkill;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class SkillFireProjectile extends HeroSkill
|
||||
{
|
||||
|
||||
@ -32,8 +21,6 @@ public class SkillFireProjectile extends HeroSkill
|
||||
private static final int DAMAGE = 5;
|
||||
private static final ItemStack SKILL_ITEM = new ItemStack(Material.BLAZE_ROD);
|
||||
|
||||
private final List<SmallFireball> _fireballs = new ArrayList<>();
|
||||
|
||||
public SkillFireProjectile(int slot)
|
||||
{
|
||||
super("Flame Wand", DESCRIPTION, SKILL_ITEM, slot, ActionType.ANY);
|
||||
@ -55,54 +42,10 @@ public class SkillFireProjectile extends HeroSkill
|
||||
}
|
||||
|
||||
Vector direction = player.getLocation().getDirection().multiply(1.25);
|
||||
Item item = player.getWorld().dropItem(player.getEyeLocation().add(direction), _kit.getAmmo());
|
||||
item.setVelocity(direction);
|
||||
|
||||
SmallFireball fireball = player.getWorld().spawn(player.getEyeLocation().add(direction), SmallFireball.class);
|
||||
fireball.setShooter(player);
|
||||
fireball.setVelocity(direction);
|
||||
_fireballs.add(fireball);
|
||||
|
||||
((Moba) Manager.GetGame()).getTowerManager().addProjectile(player, fireball, DAMAGE);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void fireballPrevention(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetProjectile() != null && _fireballs.contains(event.GetProjectile()))
|
||||
{
|
||||
event.SetCancelled("Fireball Damage");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void projectileHit(ProjectileHitEvent event)
|
||||
{
|
||||
Projectile entity = event.getEntity();
|
||||
|
||||
if (!_fireballs.contains(entity))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) entity.getShooter();
|
||||
Set<LivingEntity> entities = UtilEnt.getInRadius(entity.getLocation(), 1.5).keySet();
|
||||
|
||||
if (!entities.isEmpty())
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1.2F);
|
||||
}
|
||||
|
||||
for (LivingEntity nearby : entities)
|
||||
{
|
||||
if (isTeamDamage(nearby, player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
nearby.setFireTicks(40);
|
||||
Manager.GetDamage().NewDamageEvent(nearby, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), GetName());
|
||||
}
|
||||
|
||||
_fireballs.remove(entity);
|
||||
entity.remove();
|
||||
Manager.GetFire().Add(item, player, 3, 0, 1, DAMAGE, GetName(), false);
|
||||
((Moba) Manager.GetGame()).getTowerManager().addProjectile(player, item, DAMAGE);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ 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.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -200,6 +201,15 @@ public class SkillRally extends HeroSkill
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void itemSpawn(ItemSpawnEvent event)
|
||||
{
|
||||
if (event.getEntity().getItemStack().getType() == Material.BANNER)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void playerDeath(PlayerDeathEvent event)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ public class HPManager implements Listener
|
||||
continue;
|
||||
}
|
||||
|
||||
MobaHPRegenEvent regenEvent = new MobaHPRegenEvent(player, HP5);
|
||||
MobaHPRegenEvent regenEvent = new MobaHPRegenEvent(player, HP5, true);
|
||||
UtilServer.CallEvent(regenEvent);
|
||||
|
||||
if (regenEvent.isCancelled())
|
||||
|
@ -12,14 +12,16 @@ public class MobaHPRegenEvent extends PlayerEvent implements Cancellable
|
||||
|
||||
private final double _initialHealth;
|
||||
private double _health;
|
||||
private boolean _natural;
|
||||
private boolean _cancel;
|
||||
|
||||
public MobaHPRegenEvent(Player who, double health)
|
||||
public MobaHPRegenEvent(Player who, double health, boolean natural)
|
||||
{
|
||||
super(who);
|
||||
|
||||
_initialHealth = health;
|
||||
_health = health;
|
||||
_natural = natural;
|
||||
}
|
||||
|
||||
public void setHealth(double health)
|
||||
@ -37,6 +39,16 @@ public class MobaHPRegenEvent extends PlayerEvent implements Cancellable
|
||||
return _health;
|
||||
}
|
||||
|
||||
public void setNatural(boolean natural)
|
||||
{
|
||||
_natural = natural;
|
||||
}
|
||||
|
||||
public boolean isNatural()
|
||||
{
|
||||
return _natural;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled()
|
||||
{
|
||||
|
@ -1,16 +1,19 @@
|
||||
package nautilus.game.arcade.game.games.moba.kit.larissa;
|
||||
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
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 nautilus.game.arcade.game.games.moba.Moba;
|
||||
import nautilus.game.arcade.game.games.moba.buff.BuffManager;
|
||||
import nautilus.game.arcade.game.games.moba.buff.buffs.BuffCripple;
|
||||
import nautilus.game.arcade.game.games.moba.kit.common.DashSkill;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SkillWaterDash extends DashSkill
|
||||
{
|
||||
|
||||
@ -18,6 +21,7 @@ public class SkillWaterDash extends DashSkill
|
||||
"Dash along the ground, leaving water behind you.",
|
||||
};
|
||||
private static final ItemStack SKILL_ITEM = new ItemStack(Material.FEATHER);
|
||||
private static final long CRIPPLE_DURATION = TimeUnit.SECONDS.toMillis(3);
|
||||
|
||||
public SkillWaterDash(int slot)
|
||||
{
|
||||
@ -34,23 +38,18 @@ public class SkillWaterDash extends DashSkill
|
||||
@Override
|
||||
public void dashTick(Player player)
|
||||
{
|
||||
Block block = player.getLocation().getBlock();
|
||||
UtilParticle.PlayParticleToAll(ParticleType.DRIP_WATER, player.getLocation().add(0, 1, 0), 0.5F, 0.5F, 0.5F, 0.01F, 5, ViewDist.LONG);
|
||||
Moba moba = (Moba) Manager.GetGame();
|
||||
BuffManager buffManager = moba.getBuffManager();
|
||||
|
||||
while (!UtilBlock.solid(block))
|
||||
for (Player nearby : UtilPlayer.getNearby(player.getLocation(), 2))
|
||||
{
|
||||
block = block.getRelative(BlockFace.DOWN);
|
||||
}
|
||||
if (isTeamDamage(nearby, player) || buffManager.hasBuff(nearby, BuffCripple.class))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Block fBlock = block;
|
||||
Manager.runSyncLater(() -> Manager.GetBlockRestore().add(fBlock.getRelative(BlockFace.UP), Material.WATER.getId(), (byte) 0, 7000), 10);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockFromTo(BlockFromToEvent event)
|
||||
{
|
||||
if (event.getBlock().isLiquid() || event.getToBlock().isLiquid())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
buffManager.apply(new BuffCripple(moba, nearby, CRIPPLE_DURATION));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class SkillCombatDash extends DashSkill
|
||||
setCooldown(8000);
|
||||
|
||||
_collide = false;
|
||||
_velocityTime = 400;
|
||||
_velocityTime = 250;
|
||||
_velocityStopOnEnd = true;
|
||||
_velocityMagnitude = 1.5;
|
||||
_horizontial = true;
|
||||
|
@ -9,7 +9,9 @@ import mineplex.core.common.util.particles.effects.LineParticle;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.game.games.moba.Moba;
|
||||
import nautilus.game.arcade.game.games.moba.kit.HeroSkill;
|
||||
import nautilus.game.arcade.game.games.moba.structure.tower.TowerManager;
|
||||
import nautilus.game.arcade.game.games.moba.util.MobaUtil;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -96,8 +98,11 @@ public class SkillLightArrows extends HeroSkill
|
||||
|
||||
event.getProjectile().remove();
|
||||
|
||||
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), 0.4, 40, ParticleType.FIREWORKS_SPARK, UtilServer.getPlayers());
|
||||
lineParticle.setIgnoreAllBlocks(true);
|
||||
|
||||
_arrows.putIfAbsent(player, new HashSet<>());
|
||||
_arrows.get(player).add(new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), 0.4, 20, ParticleType.FIREWORKS_SPARK, UtilServer.getPlayers()));
|
||||
_arrows.get(player).add(lineParticle);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -108,30 +113,38 @@ public class SkillLightArrows extends HeroSkill
|
||||
return;
|
||||
}
|
||||
|
||||
TowerManager towerManager = ((Moba) Manager.GetGame()).getTowerManager();
|
||||
|
||||
for (Entry<Player, Set<LineParticle>> entry : _arrows.entrySet())
|
||||
{
|
||||
Player player = entry.getKey();
|
||||
Iterator<LineParticle> iterator = entry.getValue().iterator();
|
||||
double damage = MobaUtil.scaleDamageWithBow(player.getInventory().getItem(0), 0);
|
||||
|
||||
while (iterator.hasNext())
|
||||
lineParticleLoop : while (iterator.hasNext())
|
||||
{
|
||||
LineParticle lineParticle = iterator.next();
|
||||
|
||||
if (!lineParticle.update())
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
for (LivingEntity entity : UtilEnt.getInRadius(lineParticle.getLastLocation(), 1.5).keySet())
|
||||
if (!lineParticle.update())
|
||||
{
|
||||
if (Recharge.Instance.use(player, GetName() + entity.getUniqueId(), 500, false, false))
|
||||
towerManager.damageTowerAt(lineParticle.getLastLocation(), player, damage);
|
||||
|
||||
for (LivingEntity entity : UtilEnt.getInRadius(lineParticle.getLastLocation(), 1.5).keySet())
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.SUCCESSFUL_HIT, 1, 0.8F);
|
||||
Manager.GetDamage().NewDamageEvent(entity, player, null, DamageCause.CUSTOM, damage, true, true, false, player.getName(), GetName());
|
||||
if (Recharge.Instance.use(player, GetName() + entity.getUniqueId(), 500, false, false))
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.SUCCESSFUL_HIT, 1, 0.8F);
|
||||
Manager.GetDamage().NewDamageEvent(entity, player, null, DamageCause.CUSTOM, damage, true, true, false, player.getName(), GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iterator.remove();
|
||||
else
|
||||
{
|
||||
iterator.remove();
|
||||
continue lineParticleLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,43 +37,43 @@ public class MobaAssassinShop extends MobaShopMenu
|
||||
private static final MobaShopCategory HELMET = new MobaShopCategory("Helmet", Arrays.asList(
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_HELMET)
|
||||
.setTitle(C.cGreen + "Leather Cap")
|
||||
.build(), 200)
|
||||
.addEffects(
|
||||
new MobaHPRegenEffect(0.05)
|
||||
),
|
||||
.build(), 200),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_HELMET)
|
||||
.setTitle(C.cGreen + "Ninja's Rainment")
|
||||
.setTitle(C.cGreen + "Ninja's Mask")
|
||||
.build(), 500)
|
||||
.addEffects(
|
||||
new MobaHPRegenEffect(0.1)
|
||||
new MobaKillHealEffect(2)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_HELMET)
|
||||
.setTitle(C.cGreen + "Urchin's Cap")
|
||||
.build(), 600)
|
||||
.addEffects(
|
||||
new MobaHPRegenEffect(0.2)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_HELMET)
|
||||
.setTitle(C.cYellow + "Bruiser's Helm")
|
||||
.build(), 1000)
|
||||
.addEffects(
|
||||
new MobaHPRegenEffect(0.15)
|
||||
)
|
||||
), new ItemStack(Material.LEATHER_HELMET));
|
||||
|
||||
private static final MobaShopCategory CHESTPLATE = new MobaShopCategory("Chestplate", Arrays.asList(
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_CHESTPLATE)
|
||||
.setTitle(C.cGreen + "Leather Chestplate")
|
||||
.build(), 250)
|
||||
.addEffects(
|
||||
new MobaCDREffect(0.05)
|
||||
),
|
||||
.build(), 250),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_CHESTPLATE)
|
||||
.setTitle(C.cGreen + "Ninja's Rainment")
|
||||
.setTitle(C.cGreen + "Ninja's Chestcloth")
|
||||
.build(), 750)
|
||||
.addEffects(
|
||||
new MobaCDREffect(0.15)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_CHESTPLATE)
|
||||
.setTitle(C.cGreen + "Urchin's Chestcloth")
|
||||
.build(), 850)
|
||||
.addEffects(
|
||||
new MobaMeleeDamageEffect("Urchin's Chestcloth", 1)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_CHESTPLATE)
|
||||
.setTitle(C.cYellow + "Bruiser's Chestplate")
|
||||
.build(), 1250)
|
||||
.addEffects(
|
||||
new MobaCDREffect(0.1)
|
||||
)
|
||||
), new ItemStack(Material.LEATHER_CHESTPLATE));
|
||||
|
||||
private static final MobaShopCategory LEGGINGS = new MobaShopCategory("Leggings", Arrays.asList(
|
||||
@ -81,38 +81,41 @@ public class MobaAssassinShop extends MobaShopMenu
|
||||
.setTitle(C.cGreen + "Leather Leggings")
|
||||
.build(), 250),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_LEGGINGS)
|
||||
.setTitle(C.cGreen + "Ninja's Rainment")
|
||||
.setTitle(C.cGreen + "Ninja's Leggings")
|
||||
.build(), 750)
|
||||
.addEffects(
|
||||
new MobaTotalHealthEffect(2)
|
||||
new MobaCDREffect(0.1)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_LEGGINGS)
|
||||
.setTitle(C.cGreen + "Urchin's Leggings")
|
||||
.build(), 850)
|
||||
.addEffects(
|
||||
new MobaAbilityDamageEffect("Urchin's Leggings", 0.1)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_LEGGINGS)
|
||||
.setTitle(C.cYellow + "Bruiser's Leggings")
|
||||
.build(), 1250)
|
||||
.addEffects(
|
||||
new MobaTotalHealthEffect(4)
|
||||
)
|
||||
), new ItemStack(Material.LEATHER_LEGGINGS));
|
||||
|
||||
private static final MobaShopCategory BOOTS = new MobaShopCategory("Boots", Arrays.asList(
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_BOOTS)
|
||||
.setTitle(C.cGreen + "Leather Boots")
|
||||
.build(), 200)
|
||||
.addEffects(
|
||||
new MobaSpeedEffect(0.05)
|
||||
),
|
||||
.build(), 200),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_BOOTS)
|
||||
.setTitle(C.cGreen + "Ninja's Rainment")
|
||||
.setTitle(C.cGreen + "Ninja's Boots")
|
||||
.build(), 500)
|
||||
.addEffects(
|
||||
new MobaSpeedEffect(0.15)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_BOOTS)
|
||||
.setTitle(C.cGreen + "Urchin's Boots")
|
||||
.build(), 600)
|
||||
.addEffects(
|
||||
new MobaSpeedEffect(0.17)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_BOOTS)
|
||||
.setTitle(C.cYellow + "Bruiser's Boots")
|
||||
.build(), 1000)
|
||||
.addEffects(
|
||||
new MobaSpeedEffect(0.1)
|
||||
)
|
||||
), new ItemStack(Material.LEATHER_BOOTS));
|
||||
|
||||
public MobaAssassinShop(Moba host, MobaShop shop)
|
||||
|
@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.moba.shop.effects;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.game.games.moba.kit.hp.MobaHPRegenEvent;
|
||||
import nautilus.game.arcade.game.games.moba.shop.MobaItemEffect;
|
||||
import nautilus.game.arcade.game.games.moba.util.MobaConstants;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
@ -29,9 +30,20 @@ public class MobaAbilityDamageEffect extends MobaItemEffect
|
||||
event.AddMod(_reason, event.GetDamage() * _factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHPRegen(MobaHPRegenEvent event)
|
||||
{
|
||||
if (event.isNatural())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
event.increaseHealth(_factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return "Increases ability damage by " + F.greenElem(format(_factor * 100)) + "%.";
|
||||
return "Increases ability damage/healing by " + F.greenElem(format(_factor * 100)) + "%.";
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.moba.shop.effects;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import nautilus.game.arcade.game.games.moba.shop.MobaItemEffect;
|
||||
import nautilus.game.arcade.game.games.moba.util.MobaUtil;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class MobaKillHealEffect extends MobaItemEffect
|
||||
@ -18,7 +19,7 @@ public class MobaKillHealEffect extends MobaItemEffect
|
||||
@Override
|
||||
public void onDeath(Player killed, Player killer)
|
||||
{
|
||||
killer.setHealth(Math.min(killer.getMaxHealth(), killer.getHealth() + _health));
|
||||
MobaUtil.heal(killer, _health);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,30 @@
|
||||
package nautilus.game.arcade.game.games.moba.shop.effects;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.game.games.moba.shop.MobaItemEffect;
|
||||
|
||||
public class MobaMeleeDamageEffect extends MobaItemEffect
|
||||
{
|
||||
|
||||
private String _reason;
|
||||
private double _increase;
|
||||
|
||||
public MobaMeleeDamageEffect(String reason, double increase)
|
||||
{
|
||||
_reason = reason;
|
||||
_increase = increase;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDamage(CustomDamageEvent event)
|
||||
{
|
||||
event.AddMod(_reason, _increase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return "All your melee attacks deal " + F.greenElem("+" + format(_increase)) + ".";
|
||||
}
|
||||
}
|
@ -37,14 +37,14 @@ public class MobaHunterShop extends MobaShopMenu
|
||||
.addEnchantment(Enchantment.ARROW_DAMAGE, 2)
|
||||
.build(), 1200)
|
||||
.addEffects(
|
||||
new MobaHitConditionEffect("Bow of Pursuit", ConditionType.SPEED, 2, 0, false)
|
||||
new MobaHitConditionEffect("Bow of Pursuit", ConditionType.SPEED, 3, 1, false)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.BOW)
|
||||
.setTitle(C.cYellowB + "Vampiric Bow")
|
||||
.addEnchantment(Enchantment.ARROW_DAMAGE, 1)
|
||||
.build(), 1500)
|
||||
.addEffects(
|
||||
new MobaHitArrowHealEffect(0.25)
|
||||
new MobaKillHealEffect(0.15)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.BOW)
|
||||
.setTitle(C.cYellowB + "Bow of Renewal")
|
||||
@ -88,7 +88,7 @@ public class MobaHunterShop extends MobaShopMenu
|
||||
.setTitle(C.cGreen + "Vampiric Helmet")
|
||||
.build(), 500)
|
||||
.addEffects(
|
||||
new MobaHitArrowHealEffect(0.05)
|
||||
new MobaHPRegenEffect(0.2)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_HELMET)
|
||||
.setTitle(C.cGreen + "Chainmail Helmet")
|
||||
@ -115,7 +115,7 @@ public class MobaHunterShop extends MobaShopMenu
|
||||
.setTitle(C.cGreen + "Vampiric Chestplate")
|
||||
.build(), 750)
|
||||
.addEffects(
|
||||
new MobaHitArrowHealEffect(0.15)
|
||||
new MobaKillHealEffect(3)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_CHESTPLATE)
|
||||
.setTitle(C.cGreen + "Chainmail Chestplate")
|
||||
@ -142,7 +142,7 @@ public class MobaHunterShop extends MobaShopMenu
|
||||
.setTitle(C.cGreen + "Vampiric Leggings")
|
||||
.build(), 700)
|
||||
.addEffects(
|
||||
new MobaHitArrowHealEffect(0.1)
|
||||
new MobaKillHealEffect(3)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.CHAINMAIL_LEGGINGS)
|
||||
.setTitle(C.cGreen + "Chainmail Leggings")
|
||||
@ -169,7 +169,7 @@ public class MobaHunterShop extends MobaShopMenu
|
||||
.setTitle(C.cGreen + "Vampiric Boots")
|
||||
.build(), 500)
|
||||
.addEffects(
|
||||
new MobaHitArrowHealEffect(0.05)
|
||||
new MobaKillHealEffect(1)
|
||||
),
|
||||
new MobaItem(new ItemBuilder(Material.LEATHER_BOOTS)
|
||||
.setTitle(C.cGreen + "Leather Hiking Boots")
|
||||
|
@ -1,8 +1,16 @@
|
||||
package nautilus.game.arcade.game.games.moba.structure.tower;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
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.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.moba.Moba;
|
||||
@ -40,6 +48,7 @@ public class Tower
|
||||
private boolean _firstTower;
|
||||
private boolean _dead;
|
||||
private long _lastInform;
|
||||
private double _damage;
|
||||
|
||||
private ArmorStand _stand;
|
||||
private DisguiseGuardian _guardian;
|
||||
@ -55,6 +64,7 @@ public class Tower
|
||||
_maxHealth = health;
|
||||
_firstTower = firstTower;
|
||||
_lastInform = System.currentTimeMillis();
|
||||
_damage = DAMAGE;
|
||||
}
|
||||
|
||||
public void setup()
|
||||
@ -86,6 +96,9 @@ public class Tower
|
||||
{
|
||||
if (_target == null)
|
||||
{
|
||||
// Reset damage
|
||||
_damage = DAMAGE;
|
||||
|
||||
// Target just entities
|
||||
LivingEntity target = MobaUtil.getBestEntityTarget(_host, _team, _stand, _crystal.getLocation(), TARGET_RANGE, false);
|
||||
|
||||
@ -119,7 +132,7 @@ public class Tower
|
||||
|
||||
_target.getWorld().playSound(_target.getLocation(), Sound.EXPLODE, 1, 0.2F);
|
||||
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, _target.getLocation().add(0, 1.5, 0), 0, 0, 0, 0.2F, 1, ViewDist.LONG);
|
||||
_host.getArcadeManager().GetDamage().NewDamageEvent(_target, null, null, DamageCause.CUSTOM, DAMAGE, false, true, false, "Tower", "Tower");
|
||||
_host.getArcadeManager().GetDamage().NewDamageEvent(_target, null, null, DamageCause.CUSTOM, _damage++, false, true, false, "Tower", "Tower");
|
||||
}
|
||||
|
||||
private void setLaserTarget(LivingEntity target)
|
||||
|
@ -7,7 +7,6 @@ public class MobaConstants
|
||||
public static final String BASIC_ATTACK = "Basic Attack";
|
||||
public static final String AMMO = "Ammo";
|
||||
public static final String TEAM_METADATA = "team";
|
||||
public static final String SHOOTER_METADATA = "shooter";
|
||||
|
||||
// Location Constants
|
||||
public static final String MINION_PATH_START = "WHITE";
|
||||
|
@ -202,13 +202,15 @@ public class MobaUtil
|
||||
{
|
||||
if (entity instanceof Player)
|
||||
{
|
||||
MobaHPRegenEvent regenEvent = new MobaHPRegenEvent((Player) entity, health);
|
||||
MobaHPRegenEvent regenEvent = new MobaHPRegenEvent((Player) entity, health, false);
|
||||
UtilServer.CallEvent(regenEvent);
|
||||
|
||||
if (regenEvent.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
health = regenEvent.getHealth();
|
||||
}
|
||||
|
||||
entity.setHealth(Math.min(entity.getHealth() + health, entity.getMaxHealth()));
|
||||
|
Loading…
Reference in New Issue
Block a user