Even more fixes!
This commit is contained in:
parent
4e9cf4dbb4
commit
e48dfbefe4
@ -43,7 +43,6 @@ 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>();
|
||||
|
||||
@ -107,10 +106,8 @@ public class PerkBlockTossEVO extends Perk implements IThrown
|
||||
//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));
|
||||
_hold.put(player, new BlockTossData(id, data, System.currentTimeMillis()));
|
||||
|
||||
_charge.put(player, System.currentTimeMillis());
|
||||
|
||||
//Effect
|
||||
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, id);
|
||||
}
|
||||
@ -132,7 +129,7 @@ public class PerkBlockTossEVO extends Perk implements IThrown
|
||||
|
||||
//Charged Tick
|
||||
if (!_charged.contains(cur))
|
||||
if (System.currentTimeMillis() - _charge.get(cur) > 1200)
|
||||
if (System.currentTimeMillis() - _hold.get(cur).Time > 1200)
|
||||
{
|
||||
_charged.add(cur);
|
||||
cur.playEffect(cur.getLocation(), Effect.CLICK1, 0);
|
||||
@ -149,7 +146,7 @@ public class PerkBlockTossEVO extends Perk implements IThrown
|
||||
|
||||
_charged.remove(cur);
|
||||
|
||||
long charge = System.currentTimeMillis() - _charge.remove(cur);
|
||||
long charge = System.currentTimeMillis() - data.Time;
|
||||
|
||||
//Throw
|
||||
double mult = 1.4;
|
||||
|
@ -109,20 +109,11 @@ public class SoloSuperSmash extends SuperSmash
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
|
||||
Scoreboard.writeGroup(GetPlayers(true), player ->
|
||||
Scoreboard.writeGroup(GetPlayers(false), player ->
|
||||
{
|
||||
int lives = getLives(player);
|
||||
|
||||
String out;
|
||||
if (lives >= 4) out = C.cGreen + player.getName();
|
||||
else if (lives == 3) out = C.cYellow + player.getName();
|
||||
else if (lives == 2) out = C.cGold + player.getName();
|
||||
else if (lives == 1) out = C.cRed + player.getName();
|
||||
else if (lives == 0) out = C.cRed + player.getName();
|
||||
else
|
||||
return null;
|
||||
|
||||
return Pair.create(out, lives);
|
||||
return Pair.create(getLiveColour(lives) + player.getName(), lives);
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
@ -548,8 +548,9 @@ public abstract class SuperSmash extends Game
|
||||
case 2:
|
||||
return C.cGold;
|
||||
case 1:
|
||||
case 0:
|
||||
return C.cRed;
|
||||
case 0:
|
||||
return C.cGray + C.Strike;
|
||||
default:
|
||||
return C.cGreen;
|
||||
}
|
||||
@ -617,5 +618,12 @@ public abstract class SuperSmash extends Game
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (message.startsWith("/lives"))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
_lives.put(player, 4);
|
||||
Announce(C.cWhiteB + player.getName() + C.cAquaB + " reset their lives!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ 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;
|
||||
import nautilus.game.arcade.kit.perks.data.BlockTossData;
|
||||
import nautilus.game.arcade.kit.perks.event.PerkBlockGrabEvent;
|
||||
@ -48,7 +49,6 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
|
||||
|
||||
private Map<UUID, BlockTossData> _hold = new HashMap<>();
|
||||
private Map<UUID, Long> _charge = new HashMap<>();
|
||||
private Set<UUID> _charged = new HashSet<>();
|
||||
private Map<FallingBlock, UUID> _falling = new HashMap<>();
|
||||
|
||||
@ -121,9 +121,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
// Remove Block
|
||||
event.getClickedBlock().getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, event.getClickedBlock().getType());
|
||||
|
||||
_hold.put(player.getUniqueId(), new BlockTossData(id, data));
|
||||
|
||||
_charge.put(player.getUniqueId(), System.currentTimeMillis());
|
||||
_hold.put(player.getUniqueId(), new BlockTossData(id, data, System.currentTimeMillis()));
|
||||
|
||||
// Effect
|
||||
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, id);
|
||||
@ -137,7 +135,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Player> throwSet = new HashSet<Player>();
|
||||
Set<Player> throwSet = new HashSet<>();
|
||||
|
||||
for (UUID key : _hold.keySet())
|
||||
{
|
||||
@ -157,7 +155,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
// Charged Tick
|
||||
if (!_charged.contains(key))
|
||||
{
|
||||
if (System.currentTimeMillis() - _charge.get(key) > CHARGE_TIME)
|
||||
if (System.currentTimeMillis() - _hold.get(key).Time > CHARGE_TIME)
|
||||
{
|
||||
_charged.add(key);
|
||||
player.getWorld().playEffect(player.getLocation(), Effect.CLICK1, 0);
|
||||
@ -180,12 +178,10 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
|
||||
_charged.remove(key);
|
||||
|
||||
long charge = System.currentTimeMillis() - _charge.remove(key);
|
||||
long charge = System.currentTimeMillis() - data.Time;
|
||||
|
||||
// Throw
|
||||
double mult = 1.4 * (charge / CHARGE_TIME);
|
||||
|
||||
Bukkit.broadcastMessage("mult = " + mult);
|
||||
double mult = Math.min(1.4, 1.4 * ((double) charge / CHARGE_TIME));
|
||||
|
||||
// Action
|
||||
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
|
||||
|
@ -49,14 +49,14 @@ public class PerkEndermanTeleport extends SmashPerk
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (!hasPerk(player))
|
||||
if (!hasPerk(player) || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
UUID key = player.getUniqueId();
|
||||
|
||||
if (!(player.isSneaking() || Recharge.Instance.usable(player, GetName())))
|
||||
if (!player.isSneaking() || !Recharge.Instance.usable(player, GetName()))
|
||||
{
|
||||
_target.remove(key);
|
||||
_charge.remove(key);
|
||||
@ -88,7 +88,7 @@ public class PerkEndermanTeleport extends SmashPerk
|
||||
{
|
||||
_charge.put(key, _charge.get(key) + CHARGE_PER_TICK);
|
||||
|
||||
UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(player)), 0, 10, 10, player);
|
||||
UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(key)), 0, 10, 10, player);
|
||||
|
||||
if (_charge.get(key) >= 1)
|
||||
{
|
||||
|
@ -135,20 +135,6 @@ public class SmashEnderman extends SmashUltimate
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void dragonDamageeCancel(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetDamagerEntity(false) == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_dragons.values().contains(event.GetDamagerEntity(false)))
|
||||
{
|
||||
event.SetCancelled("Enderman Dragon Damagee");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void dragonDamagerCancel(CustomDamageEvent event)
|
||||
{
|
||||
@ -169,8 +155,10 @@ public class SmashEnderman extends SmashUltimate
|
||||
public void updateDamageAoe(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
{
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
for (UUID key : _dragons.keySet())
|
||||
{
|
||||
Player player = UtilPlayer.searchExact(key);
|
||||
|
@ -122,7 +122,7 @@ public class PerkTargetLazer extends SmashPerk
|
||||
{
|
||||
if (data.getTimeElapsed() < MAX_TIME)
|
||||
{
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
contained = true;
|
||||
@ -132,7 +132,7 @@ public class PerkTargetLazer extends SmashPerk
|
||||
|
||||
if (best == null)
|
||||
{
|
||||
player.sendMessage(F.main("Game", "There are no targets within the range."));
|
||||
player.sendMessage(F.main("Game", "There are no targets within range."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ public class PerkTargetLazer extends SmashPerk
|
||||
long time = data.getTimeElapsed() / 1000;
|
||||
double damage = 0.5 * time;
|
||||
|
||||
data.getAttacker().sendMessage(F.main("Game", "Your laser ended dealing damage to " + F.name(data.getTarget().getName())) + ".");
|
||||
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);
|
||||
|
@ -38,7 +38,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 int HIT_BOX = 1;
|
||||
private static final float HIT_BOX = 0.5F;
|
||||
private static final int DAMAGE = 2;
|
||||
|
||||
private Set<Item> _items = new HashSet<>();
|
||||
|
@ -4,10 +4,12 @@ public class BlockTossData
|
||||
{
|
||||
public int Type;
|
||||
public byte Data;
|
||||
public long Time;
|
||||
|
||||
public BlockTossData(int type, byte data)
|
||||
public BlockTossData(int type, byte data, long time)
|
||||
{
|
||||
Type = type;
|
||||
Data = data;
|
||||
Time = time;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user