More from GI testing
This commit is contained in:
parent
e5e953a8ab
commit
28a2a8c098
@ -19,6 +19,7 @@ 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.UtilItem;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -63,6 +64,11 @@ public class PerkEggGun extends SmashPerk
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UtilItem.isSword(player.getItemInHand()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSuperActive(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
|
@ -44,7 +44,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
|
||||
private static final int COOLDOWN = 2000;
|
||||
private static final int CHARGE_TIME = 1200;
|
||||
private static final int DAMAGE = 12;
|
||||
private static final int DAMAGE = 11;
|
||||
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
|
||||
|
||||
private Map<UUID, BlockTossData> _hold = new HashMap<>();
|
||||
|
@ -1,8 +1,10 @@
|
||||
package nautilus.game.arcade.game.games.smash.perks.golem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@ -13,10 +15,11 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
|
||||
|
||||
public class SmashGolem extends SmashUltimate
|
||||
@ -24,6 +27,7 @@ public class SmashGolem extends SmashUltimate
|
||||
|
||||
private static final int DURATION = 16000;
|
||||
private static final int HIT_FREQUENCY = 400;
|
||||
private static final int DAMAGE_RADIUS = 2;
|
||||
private static final int EFFECT_RADIUS = 5;
|
||||
|
||||
public SmashGolem()
|
||||
@ -40,7 +44,7 @@ public class SmashGolem extends SmashUltimate
|
||||
@EventHandler
|
||||
public void update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
if (event.getType() != UpdateType.FASTEST)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -49,33 +53,45 @@ public class SmashGolem extends SmashUltimate
|
||||
|
||||
for (Player player : alivePlayers)
|
||||
{
|
||||
|
||||
if (!isUsingUltimate(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for (Player other : alivePlayers)
|
||||
{
|
||||
if (player.equals(other))
|
||||
if (player.equals(other) || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
other.playSound(other.getLocation(), Sound.MINECART_BASE, 0.2f, 0.2f);
|
||||
|
||||
if (UtilEnt.isGrounded(other))
|
||||
{
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, 1 + 2 * Math.random(), false, false, false, other.getName(), GetName());
|
||||
|
||||
// Velocity
|
||||
if (Recharge.Instance.use(other, GetName() + " Hit", HIT_FREQUENCY, false, false))
|
||||
boolean grounded = false;
|
||||
|
||||
for (Block block : UtilBlock.getInRadius(other.getLocation(), DAMAGE_RADIUS).keySet())
|
||||
{
|
||||
if (block.getType() != Material.AIR)
|
||||
{
|
||||
UtilAction.velocity(other, new Vector(Math.random() - 0.5, Math.random() * 0.2, Math.random() - 0.5), Math.random() * 1 + 1, false, 0, 0.1 + Math.random() * 0.2, 2, true);
|
||||
grounded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!grounded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, 1 + 2 * Math.random(), false, false, false, other.getName(), GetName());
|
||||
|
||||
// Velocity
|
||||
if (Recharge.Instance.use(other, GetName() + " Hit", HIT_FREQUENCY, false, false))
|
||||
{
|
||||
UtilAction.velocity(other, new Vector(Math.random() - 0.5, Math.random() * 0.2, Math.random() - 0.5), Math.random() * 1 + 1, false, 0, 0.1 + Math.random() * 0.2, 2, true);
|
||||
}
|
||||
|
||||
// Effect
|
||||
for (Block block : UtilBlock.getInRadius(other.getLocation(), EFFECT_RADIUS).keySet())
|
||||
{
|
||||
|
@ -187,6 +187,7 @@ public class PerkTargetLazer extends SmashPerk
|
||||
ArmorStand targetPlaceholder = data.update(Manager);
|
||||
|
||||
targetPlaceholder.remove();
|
||||
setLazerTarget(data.getAttacker(), null);
|
||||
|
||||
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());
|
||||
@ -255,7 +256,6 @@ public class PerkTargetLazer extends SmashPerk
|
||||
if (target == null)
|
||||
{
|
||||
disguise.setTarget(0);
|
||||
data.update(Manager).remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ import nautilus.game.arcade.kit.Perk;
|
||||
public class PerkWaterSplash extends Perk
|
||||
{
|
||||
|
||||
private static final int COOLDOWN = 18000;
|
||||
private static final int COOLDOWN = 12000;
|
||||
private static final int VELOCITY_Y = 1;
|
||||
private static final int RADIUS = 5;
|
||||
private static final int MIN_AIR_TIME = 750;
|
||||
@ -173,7 +173,9 @@ public class PerkWaterSplash extends Perk
|
||||
{
|
||||
_usedSecondBoost.add(uuid);
|
||||
|
||||
UtilAction.velocity(player, new Vector(0, VELOCITY_Y, 0));
|
||||
Vector direction = player.getLocation().getDirection().setY(0.2);
|
||||
|
||||
UtilAction.velocity(player, direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,9 +65,8 @@ public class PerkSpiderLeap extends Perk
|
||||
{
|
||||
player.setExp((float) Math.min(0.999, player.getExp() + ENERGY_PER_TICK));
|
||||
_secondJump.remove(player.getUniqueId());
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
player.setExp((float) Math.max(0, player.getExp() - ENERGY_PER_TICK));
|
||||
|
@ -8,6 +8,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Bat;
|
||||
@ -285,7 +286,8 @@ public class PerkBatWave extends SmashPerk
|
||||
_active.remove(key);
|
||||
_direction.remove(key);
|
||||
_pulling.remove(key);
|
||||
|
||||
_damageTaken.remove(key);
|
||||
|
||||
if (_bats.containsKey(key))
|
||||
{
|
||||
for (Bat bat : _bats.get(key))
|
||||
@ -308,20 +310,17 @@ public class PerkBatWave extends SmashPerk
|
||||
if (event.GetDamageePlayer() != null)
|
||||
{
|
||||
Player player = event.GetDamageePlayer();
|
||||
UUID key = player.getUniqueId();
|
||||
|
||||
_damageTaken.putIfAbsent(key, 0D);
|
||||
|
||||
if (hasPerk(player))
|
||||
{
|
||||
UUID key = player.getUniqueId();
|
||||
|
||||
if (!_damageTaken.containsKey(key))
|
||||
{
|
||||
_damageTaken.put(key, 0D);
|
||||
}
|
||||
|
||||
if (hasPerk(player) && _damageTaken.containsKey(key))
|
||||
{
|
||||
_damageTaken.put(key, (_damageTaken.get(key) + event.GetDamage()));
|
||||
|
||||
if (_damageTaken.get(key) >= DISABLE_DAMAGE)
|
||||
{
|
||||
Bukkit.broadcastMessage("cleared!!! " + _damageTaken.get(key));
|
||||
Clear(player);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package nautilus.game.arcade.game.games.smash.perks.witch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -14,8 +15,6 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
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;
|
||||
@ -45,7 +44,6 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
|
||||
private static final int RANGE_NOMRAL = 3;
|
||||
private static final int RANGE_SMASH = 4;
|
||||
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<>();
|
||||
@ -101,7 +99,7 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
|
||||
|
||||
_proj.add(potion);
|
||||
|
||||
Manager.GetProjectile().AddThrow(potion, player, this, 10000, true, true, true, false, false, 0.5F);
|
||||
Manager.GetProjectile().AddThrow(potion, player, this, 10000, true, true, true, false, false, 1);
|
||||
|
||||
// Inform
|
||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||
@ -145,12 +143,12 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Set<LivingEntity> players = Sets.newHashSet(target);
|
||||
Set<LivingEntity> players = new HashSet<>();
|
||||
Player thrower = (Player) data.getThrower();
|
||||
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
return;
|
||||
players.add(target);
|
||||
}
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
@ -170,26 +168,14 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
|
||||
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());
|
||||
// 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);
|
||||
}
|
||||
Manager.GetCondition().Factory().Slow(GetName(), entity, null, 3, 1, true, false, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user