Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
8630a1ba4c
@ -516,49 +516,49 @@ public enum Achievement
|
||||
AchievementCategory.MICRO_BATTLE),
|
||||
|
||||
//MineStrike
|
||||
MINE_STRIKE_WINS("Striker", 0,
|
||||
MINE_STRIKE_WINS("Striker", 800,
|
||||
new String[]{"MineStrike.Wins"},
|
||||
new String[]{"Win 50 games of MineStrike"},
|
||||
new int[]{50},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_BOOM_HEADSHOT("BOOM! HEADSHOT!", 0,
|
||||
MINE_STRIKE_BOOM_HEADSHOT("BOOM! HEADSHOT!", 1000,
|
||||
new String[]{"MineStrike.BoomHeadshot"},
|
||||
new String[]{"Kill 500 people with headshots"},
|
||||
new int[]{500},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_ACE("Ace", 0,
|
||||
MINE_STRIKE_ACE("Ace", 2000,
|
||||
new String[]{"MineStrike.Ace"},
|
||||
new String[]{"Get the kill on all enemies in a single round"},
|
||||
new int[]{1},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_KABOOM("Kaboom!", 0,
|
||||
MINE_STRIKE_KABOOM("Kaboom!", 1000,
|
||||
new String[]{"MineStrike.Kaboom"},
|
||||
new String[]{"Kill two people with a single", "High Explosive Grenade"},
|
||||
new int[]{1},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_ASSASSINATION("Assassination", 0,
|
||||
MINE_STRIKE_ASSASSINATION("Assassination", 800,
|
||||
new String[]{"MineStrike.Assassination"},
|
||||
new String[]{"Get 20 backstab kills with the knife"},
|
||||
new int[]{20},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_CLUTCH_OR_KICK("Clutch or Kick", 0,
|
||||
MINE_STRIKE_CLUTCH_OR_KICK("Clutch or Kick", 1200,
|
||||
new String[]{"MineStrike.ClutchOrKick"},
|
||||
new String[]{"Be the last one alive, and kill", "3 or more enemies to achieve victory"},
|
||||
new int[]{1},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_KILLING_SPREE("Killing Spree", 0,
|
||||
MINE_STRIKE_KILLING_SPREE("Killing Spree", 1600,
|
||||
new String[]{"MineStrike.KillingSpree"},
|
||||
new String[]{"Kill 4 enemies in a row with no more", "than 5 seconds between each kill"},
|
||||
new int[]{1},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
MINE_STRIKE_BLINDFOLDED("Blindfolded", 0,
|
||||
MINE_STRIKE_BLINDFOLDED("Blindfolded", 1000,
|
||||
new String[]{"MineStrike.Blindfolded"},
|
||||
new String[]{"Kill 2 enemies while blinded from", "a single flashbang"},
|
||||
new int[]{1},
|
||||
|
@ -102,6 +102,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
public class HubManager extends MiniClientPlugin<HubClient>
|
||||
{
|
||||
// ☃❅ Snowman!
|
||||
public HubType Type = HubType.Halloween;
|
||||
|
||||
private BlockRestore _blockRestore;
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
@ -30,6 +31,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.halloween;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
@ -19,15 +20,18 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
@ -53,6 +57,8 @@ public class Halloween extends SoloGame
|
||||
private int _maxMobs = 80;
|
||||
private ArrayList<CreatureBase> _mobs = new ArrayList<CreatureBase>();
|
||||
|
||||
private HashMap<Player, Long> _damageTime = new HashMap<Player, Long>();
|
||||
|
||||
private HashSet<Player> _soundOff = new HashSet<Player>();
|
||||
|
||||
public long total = 0;
|
||||
@ -111,7 +117,7 @@ public class Halloween extends SoloGame
|
||||
|
||||
this.PrepareFreeze = false;
|
||||
|
||||
this.HungerSet = 20;
|
||||
//this.HungerSet = 20;
|
||||
|
||||
this.WorldBoundaryKill = false;
|
||||
}
|
||||
@ -562,4 +568,85 @@ public class Halloween extends SoloGame
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
private int hungerTick = 0;
|
||||
@EventHandler
|
||||
public void Hunger(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (_mobs.size() < 30)
|
||||
{
|
||||
for (Player player : GetPlayers(true))
|
||||
UtilPlayer.hunger(player, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
int rate = 4;
|
||||
if (_mobs.size() > 60)
|
||||
rate = 3;
|
||||
if (_mobs.size() > 70)
|
||||
rate = 2;
|
||||
if (_mobs.size() >= 80)
|
||||
rate = 1;
|
||||
|
||||
hungerTick = (hungerTick + 1)%rate;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
if (_damageTime.containsKey(player))
|
||||
{
|
||||
if (!UtilTime.elapsed(_damageTime.get(player), 2000))
|
||||
continue;
|
||||
}
|
||||
|
||||
player.setSaturation(3f);
|
||||
player.setExhaustion(0f);
|
||||
|
||||
if (player.getFoodLevel() <= 2)
|
||||
{
|
||||
if (Recharge.Instance.use(player, "Food Message", 4000, false, false))
|
||||
UtilPlayer.message(player, F.main("Game", "Attack monsters players to restore hunger!"));
|
||||
}
|
||||
|
||||
if (hungerTick == 0)
|
||||
{
|
||||
if (player.getFoodLevel() > 2)
|
||||
{
|
||||
UtilPlayer.hunger(player, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void HungerRestore(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
if (event.GetDamagerPlayer(true) == null)
|
||||
return;
|
||||
|
||||
if (event.GetDamage() <= 1)
|
||||
return;
|
||||
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
if (damager == null)
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(damager, "Hunger Restore", 100, false, false))
|
||||
return;
|
||||
|
||||
_damageTime.put(damager, System.currentTimeMillis());
|
||||
|
||||
if (event.GetCause() == DamageCause.PROJECTILE)
|
||||
UtilPlayer.hunger(damager, 6);
|
||||
else
|
||||
UtilPlayer.hunger(damager, 4);
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ public class MobGhast extends CreatureBase<Ghast>
|
||||
@Override
|
||||
public void SpawnCustom(Ghast ent)
|
||||
{
|
||||
ent.setMaxHealth(80);
|
||||
ent.setHealth(80);
|
||||
ent.setMaxHealth(55);
|
||||
ent.setHealth(55);
|
||||
|
||||
ent.setCustomName("Ghast");
|
||||
}
|
||||
|
@ -118,6 +118,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
|
||||
if (event.GetDamagerPlayer(true) == null)
|
||||
event.SetCancelled("Non-Player");
|
||||
|
||||
if (event.GetDamagerPlayer(true) != null)
|
||||
event.GetDamagerPlayer(true).setFoodLevel(20);
|
||||
|
||||
event.SetKnockback(false);
|
||||
}
|
||||
@ -137,6 +140,11 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
event.SetCancelled("Projectile");
|
||||
UtilPlayer.message(event.GetDamagerPlayer(true), F.main("Boss", "Projectiles cannot harm " + F.elem("Pumpkin Minions") + "!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (event.GetDamagerPlayer(true) != null)
|
||||
event.GetDamagerPlayer(true).setFoodLevel(20);
|
||||
}
|
||||
}
|
||||
//Attacked Shield
|
||||
else if (_shields.contains(event.GetDamageeEntity()))
|
||||
@ -150,6 +158,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
||||
|
||||
if (event.GetDamagerPlayer(true) == null)
|
||||
return;
|
||||
|
||||
if (event.GetDamagerPlayer(true) != null)
|
||||
event.GetDamagerPlayer(true).setFoodLevel(20);
|
||||
|
||||
//Effect
|
||||
Host.Manager.GetBlood().Effects(event.GetDamageeEntity().getLocation(), 10, 0.2, null, 0f, 0f, Material.BLAZE_POWDER, (byte)0, 10, false);
|
||||
|
@ -10,7 +10,7 @@ public class Wave5 extends WaveBase
|
||||
{
|
||||
public Wave5(Halloween host)
|
||||
{
|
||||
super(host, "Double the Giants! Double the fun!", 80000, host.GetSpawnSet(1), HalloweenAudio.WAVE_5);
|
||||
super(host, "Double the Giants! Double the fun!", 90000, host.GetSpawnSet(1), HalloweenAudio.WAVE_5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,6 +66,12 @@ public class PerkFlameSlam extends Perk
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (!UtilEnt.isGrounded(player))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " while airborne."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 8000, true, true))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user