GI changes
This commit is contained in:
parent
53c6c07208
commit
bb9ca490b1
@ -26,7 +26,7 @@ public class KitGuardian extends SmashKit
|
||||
{
|
||||
|
||||
private static final Perk[] PERKS = {
|
||||
new PerkSmashStats(4, 1.25, 0.25, 4),
|
||||
new PerkSmashStats(4, 1.25, 0.25, 4.5),
|
||||
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
|
||||
new PerkWhirlpoolBlade(),
|
||||
new PerkWaterSplash(),
|
||||
@ -79,10 +79,10 @@ public class KitGuardian extends SmashKit
|
||||
};
|
||||
|
||||
private static final ItemStack[] PLAYER_ARMOR = {
|
||||
new ItemStack(Material.DIAMOND_BOOTS),
|
||||
new ItemStack(Material.DIAMOND_LEGGINGS),
|
||||
null,
|
||||
null,
|
||||
new ItemStack(Material.DIAMOND_CHESTPLATE),
|
||||
null,
|
||||
};
|
||||
|
||||
public KitGuardian(ArcadeManager manager)
|
||||
|
@ -80,7 +80,7 @@ public abstract class SmashKit extends ProgressingKit
|
||||
|
||||
if (gameTeam != null)
|
||||
{
|
||||
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
||||
disguise.setName(gameTeam.GetColor() + player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6,7 +6,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
|
@ -168,7 +168,7 @@ public class SmashEnderman extends SmashUltimate
|
||||
continue;
|
||||
}
|
||||
|
||||
EnderDragon dragon = _dragons.get(player);
|
||||
EnderDragon dragon = _dragons.get(key);
|
||||
|
||||
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, dragon.getLocation(), 0, 0, 0, 0, 1, ViewDist.LONGER);
|
||||
|
||||
|
@ -6,6 +6,7 @@ import java.util.Set;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
@ -183,11 +184,15 @@ public class PerkTargetLazer extends SmashPerk
|
||||
{
|
||||
long time = data.getTimeElapsed() / 1000;
|
||||
double damage = 0.5 * time;
|
||||
ArmorStand targetPlaceholder = data.update(Manager);
|
||||
|
||||
targetPlaceholder.remove();
|
||||
|
||||
data.getAttacker().sendMessage(F.main("Game", "Your laser broke dealing damage to " + F.name(data.getTarget().getName())) + ".");
|
||||
Manager.GetDamage().NewDamageEvent(data.getTarget(), data.getAttacker(), null, DamageCause.CUSTOM, damage, false, true, false, data.getAttacker().getName(), GetName());
|
||||
setLazerTarget(data.getAttacker(), null);
|
||||
|
||||
Recharge.Instance.use(data.getAttacker(), GetName(), COOLDOWN, true, true);
|
||||
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -250,6 +255,7 @@ public class PerkTargetLazer extends SmashPerk
|
||||
if (target == null)
|
||||
{
|
||||
disguise.setTarget(0);
|
||||
data.update(Manager).remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
|
||||
|
||||
private static final int COOLDOWN = 5000;
|
||||
private static final int EXPIRE_TIME = 3000;
|
||||
private static final float VELOCITY = 1.2F;
|
||||
private static final float VELOCITY = 1.6F;
|
||||
private static final float HIT_BOX = 0.5F;
|
||||
private static final int DAMAGE = 2;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class TargetLazerData
|
||||
|
||||
public ArmorStand update(ArcadeManager manager)
|
||||
{
|
||||
if (_targetPlaceholder == null)
|
||||
if (_targetPlaceholder == null || !_targetPlaceholder.isValid())
|
||||
{
|
||||
manager.GetGame().CreatureAllowOverride = true;
|
||||
_targetPlaceholder = _target.getWorld().spawn(_target.getLocation(), ArmorStand.class);
|
||||
@ -51,7 +51,7 @@ public class TargetLazerData
|
||||
{
|
||||
return _target;
|
||||
}
|
||||
|
||||
|
||||
public long getTimeElapsed()
|
||||
{
|
||||
return System.currentTimeMillis() - _startTime;
|
||||
|
@ -61,7 +61,7 @@ public class PerkSpiderLeap extends Perk
|
||||
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
||||
if (UtilEnt.isGrounded(player))
|
||||
{
|
||||
player.setExp((float) Math.min(0.999, player.getExp() + ENERGY_PER_TICK));
|
||||
_secondJump.remove(player.getUniqueId());
|
||||
|
@ -47,7 +47,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
|
||||
{
|
||||
|
||||
private static final int COOLDOWN = 24000;
|
||||
private static final int DAMAGE = 3;
|
||||
private static final float DAMAGE = 2.6F;
|
||||
private static final int START_TIME = 2000;
|
||||
private static final int END_TIME = 6000;
|
||||
private static final float KNOCKBACK_MAGNITUDE = 1.5F;
|
||||
|
@ -58,7 +58,7 @@ public class PerkBatWave extends SmashPerk
|
||||
private Map<UUID, Long> _active = new HashMap<>();
|
||||
private Map<UUID, Location> _direction = new HashMap<>();
|
||||
private Map<UUID, List<Bat>> _bats = new HashMap<>();
|
||||
private Map<UUID, Integer> _damageTaken = new HashMap<>();
|
||||
private Map<UUID, Double> _damageTaken = new HashMap<>();
|
||||
private Set<UUID> _pulling = new HashSet<>();
|
||||
private Set<UUID> _allowLeash = new HashSet<>();
|
||||
|
||||
@ -315,10 +315,10 @@ public class PerkBatWave extends SmashPerk
|
||||
|
||||
if (!_damageTaken.containsKey(key))
|
||||
{
|
||||
_damageTaken.put(key, 0);
|
||||
_damageTaken.put(key, 0D);
|
||||
}
|
||||
|
||||
_damageTaken.put(key, (int) (_damageTaken.get(key) + event.GetDamage()));
|
||||
_damageTaken.put(key, (_damageTaken.get(key) + event.GetDamage()));
|
||||
|
||||
if (_damageTaken.get(key) >= DISABLE_DAMAGE)
|
||||
{
|
||||
|
@ -3,21 +3,23 @@ package nautilus.game.arcade.game.games.smash.perks.witch;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
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 com.google.common.collect.Sets;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
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.UtilItem;
|
||||
@ -27,22 +29,25 @@ 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.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.game.games.smash.perks.SmashPerk;
|
||||
|
||||
public class PerkWitchPotion extends SmashPerk
|
||||
public class PerkWitchPotion extends SmashPerk implements IThrown
|
||||
{
|
||||
|
||||
|
||||
private static final int COOLDOWN = 2000;
|
||||
private static final int RANGE_NOMRAL = 3;
|
||||
private static final int RANGE_SMASH = 4;
|
||||
private static final int DAMAGE_NORMAL = 7;
|
||||
private static final int DAMAGE_NORMAL = 6;
|
||||
private static final int DAMAGE_SMASH = 10;
|
||||
private static final int KNOCKBACK_MAGNITUDE = 2;
|
||||
|
||||
|
||||
private List<Projectile> _proj = new ArrayList<>();
|
||||
|
||||
public PerkWitchPotion()
|
||||
@ -89,65 +94,19 @@ public class PerkWitchPotion extends SmashPerk
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Start
|
||||
ThrownPotion potion = player.launchProjectile(ThrownPotion.class);
|
||||
UtilAction.velocity(potion, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
|
||||
|
||||
_proj.add(potion);
|
||||
|
||||
Manager.GetProjectile().AddThrow(potion, player, this, 10000, true, true, true, false, false, 0.5F);
|
||||
|
||||
// Inform
|
||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Hit(ProjectileHitEvent event)
|
||||
{
|
||||
if (!_proj.remove(event.getEntity()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (player.equals(event.getEntity().getShooter()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(event.getEntity().getShooter() instanceof Player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Player thrower = (Player) event.getEntity().getShooter();
|
||||
|
||||
if (UtilMath.offset(player.getLocation().add(0, 1, 0), event.getEntity().getLocation()) > (isSuperActive(thrower) ? RANGE_SMASH : RANGE_NOMRAL))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
String name = UtilEnt.getName((LivingEntity) event.getEntity().getShooter());
|
||||
|
||||
// Standard
|
||||
if (!isSuperActive(thrower))
|
||||
{
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, DAMAGE_NORMAL, true, true, false, name, GetName());
|
||||
|
||||
Manager.GetCondition().Factory().Slow(GetName(), player, null, 3, 1, true, false, false, false);
|
||||
}
|
||||
// Super Effect
|
||||
else
|
||||
{
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, DAMAGE_SMASH, true, true, false, name, GetName());
|
||||
|
||||
Manager.GetCondition().Factory().Slow(GetName(), player, null, 7, 2, true, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Update(UpdateEvent event)
|
||||
{
|
||||
@ -155,7 +114,7 @@ public class PerkWitchPotion extends SmashPerk
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Iterator<Projectile> potionIterator = _proj.iterator();
|
||||
|
||||
while (potionIterator.hasNext())
|
||||
@ -179,7 +138,68 @@ public class PerkWitchPotion extends SmashPerk
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Set<LivingEntity> players = Sets.newHashSet(target);
|
||||
Player thrower = (Player) data.getThrower();
|
||||
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (player.equals(data.getThrower()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
double d = UtilMath.offset(player.getLocation().add(0, 1, 0), target.getLocation());
|
||||
|
||||
if (d > (isSuperActive(thrower) ? RANGE_SMASH : RANGE_NOMRAL))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
players.add(player);
|
||||
}
|
||||
|
||||
boolean smash = isSuperActive(thrower);
|
||||
int i = 0;
|
||||
|
||||
for (LivingEntity entity : players)
|
||||
{
|
||||
if (smash)
|
||||
{
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(entity, thrower, null, DamageCause.CUSTOM, (i++ == 0 ? DAMAGE_NORMAL + 1 : DAMAGE_NORMAL), true, true, false, thrower.getName(), GetName());
|
||||
|
||||
Manager.GetCondition().Factory().Slow(GetName(), entity, null, 3, 1, true, false, false, false);
|
||||
}
|
||||
// Super Effect
|
||||
else
|
||||
{
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(entity, thrower, null, DamageCause.CUSTOM, DAMAGE_SMASH, true, true, false, thrower.getName(), GetName());
|
||||
|
||||
Manager.GetCondition().Factory().Slow(GetName(), entity, null, 7, 2, true, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user