More achievements
This commit is contained in:
parent
60869d114e
commit
f266f4e016
@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="bukkit">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/Libraries/bukkit.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="http://jd.bukkit.org/dev/apidocs/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/Libraries/bukkit.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -11,12 +11,11 @@ import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -24,17 +23,18 @@ import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Horse.Style;
|
||||
import org.bukkit.entity.Horse.Variant;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -57,15 +57,68 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.*;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitHumanKnight;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitHumanMarksman;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitHumanPeasant;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadArcher;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadGhoul;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadZombie;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.NullKit;
|
||||
import net.minecraft.server.v1_7_R4.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R4.Navigation;
|
||||
|
||||
public class CastleSiege extends TeamGame
|
||||
{
|
||||
public static class KingDamageEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
private final double _damage;
|
||||
|
||||
public KingDamageEvent(Player who, double damage)
|
||||
{
|
||||
super(who);
|
||||
|
||||
_damage = damage;
|
||||
}
|
||||
|
||||
public double getDamage()
|
||||
{
|
||||
return _damage;
|
||||
}
|
||||
}
|
||||
|
||||
public static class KingSlaughterEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
public KingSlaughterEvent(Player who)
|
||||
{
|
||||
super(who);
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<String> _lastScoreboard = new ArrayList<String>();
|
||||
|
||||
private long _tntSpawn = 0;
|
||||
@ -327,6 +380,8 @@ public class CastleSiege extends TeamGame
|
||||
_kingDamager = damager;
|
||||
_kingHealth--;
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new KingDamageEvent(damager, 1));
|
||||
|
||||
if (_kingHealth < 0)
|
||||
_kingHealth = 0;
|
||||
|
||||
@ -489,6 +544,8 @@ public class CastleSiege extends TeamGame
|
||||
{
|
||||
SetCustomWinLine(C.cRed + _kingDamager.getName() + C.cWhite + " slaughtered " + _kingName + ChatColor.RESET + "!");
|
||||
AddGems(_kingDamager, 20, "King Slayer", false);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new KingSlaughterEvent(_kingDamager));
|
||||
}
|
||||
else
|
||||
SetCustomWinLine(_kingName + ChatColor.RESET + " has died!");
|
||||
|
@ -0,0 +1,22 @@
|
||||
package nautilus.game.arcade.game.games.castlesiege.kits;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public abstract class KitHuman extends Kit
|
||||
{
|
||||
public KitHuman(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
|
||||
public KitHuman(ArcadeManager manager, String name, KitAvailability kitAvailability, int cost, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, cost, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ import nautilus.game.arcade.kit.perks.PerkLeap;
|
||||
import nautilus.game.arcade.kit.perks.PerkPowershot;
|
||||
import nautilus.game.arcade.kit.perks.PerkRegeneration;
|
||||
|
||||
public class KitHumanAssassin extends Kit
|
||||
public class KitHumanAssassin extends KitHuman
|
||||
{
|
||||
public KitHumanAssassin(ArcadeManager manager)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ import nautilus.game.arcade.kit.perks.PerkCleave;
|
||||
import nautilus.game.arcade.kit.perks.PerkKnockbackGive;
|
||||
import nautilus.game.arcade.kit.perks.PerkSeismicSlamCS;
|
||||
|
||||
public class KitHumanBrawler extends Kit
|
||||
public class KitHumanBrawler extends KitHuman
|
||||
{
|
||||
public KitHumanBrawler(ArcadeManager manager)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitHumanKnight extends Kit
|
||||
public class KitHumanKnight extends KitHuman
|
||||
{
|
||||
public KitHumanKnight(ArcadeManager manager)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkBarrage;
|
||||
import nautilus.game.arcade.kit.perks.PerkFletcher;
|
||||
|
||||
public class KitHumanMarksman extends Kit
|
||||
public class KitHumanMarksman extends KitHuman
|
||||
{
|
||||
public KitHumanMarksman(ArcadeManager manager)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkKnockbackGive;
|
||||
import nautilus.game.arcade.kit.perks.PerkStrength;
|
||||
|
||||
public class KitHumanPeasant extends Kit
|
||||
public class KitHumanPeasant extends KitHuman
|
||||
{
|
||||
public KitHumanPeasant(ArcadeManager manager)
|
||||
{
|
||||
|
@ -0,0 +1,22 @@
|
||||
package nautilus.game.arcade.game.games.castlesiege.kits;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public abstract class KitUndead extends Kit
|
||||
{
|
||||
public KitUndead(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
|
||||
public KitUndead(ArcadeManager manager, String name, KitAvailability kitAvailability, int cost, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, cost, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkIronSkin;
|
||||
|
||||
public class KitUndeadArcher extends Kit
|
||||
public class KitUndeadArcher extends KitUndead
|
||||
{
|
||||
public KitUndeadArcher(ArcadeManager manager)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitUndeadGhoul extends Kit
|
||||
public class KitUndeadGhoul extends KitUndead
|
||||
{
|
||||
public KitUndeadGhoul(ArcadeManager manager)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitUndeadZombie extends Kit
|
||||
public class KitUndeadZombie extends KitUndead
|
||||
{
|
||||
public KitUndeadZombie(ArcadeManager manager)
|
||||
{
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.hideseek;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
@ -29,6 +30,7 @@ import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -37,6 +39,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
@ -82,6 +85,57 @@ import net.minecraft.server.v1_7_R4.Navigation;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class HideSeek extends TeamGame
|
||||
{
|
||||
public static class MeowEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
public MeowEvent(Player who)
|
||||
{
|
||||
super(who);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ChangeFormEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
private final Form _form;
|
||||
|
||||
public ChangeFormEvent(Player who, Form form)
|
||||
{
|
||||
super(who);
|
||||
|
||||
_form = form;
|
||||
}
|
||||
|
||||
public Form getForm()
|
||||
{
|
||||
return _form;
|
||||
}
|
||||
}
|
||||
|
||||
private GameTeam _hiders;
|
||||
private GameTeam _seekers;
|
||||
|
||||
@ -283,7 +337,13 @@ public class HideSeek extends TeamGame
|
||||
public void InitialDisguise(PlayerPrepareTeleportEvent event)
|
||||
{
|
||||
if (_hiders.HasPlayer(event.GetPlayer().getName(), true))
|
||||
_forms.put(event.GetPlayer(), new BlockForm(this, event.GetPlayer(), _allowedBlocks.get(UtilMath.r(_allowedBlocks.size()))));
|
||||
{
|
||||
Form form = new BlockForm(this, event.GetPlayer(), _allowedBlocks.get(UtilMath.r(_allowedBlocks.size())));
|
||||
|
||||
_forms.put(event.GetPlayer(), form);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ChangeFormEvent(event.GetPlayer(), form));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -314,8 +374,12 @@ public class HideSeek extends TeamGame
|
||||
//Remove Old
|
||||
_forms.get(player).Remove();
|
||||
|
||||
Form form = new BlockForm(this, player, event.getClickedBlock().getType());
|
||||
|
||||
//Set New
|
||||
_forms.put(player, new BlockForm(this, player, event.getClickedBlock().getType()));
|
||||
_forms.put(player, form);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ChangeFormEvent(player, form));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -344,8 +408,12 @@ public class HideSeek extends TeamGame
|
||||
//Remove Old
|
||||
_forms.get(player).Remove();
|
||||
|
||||
Form form = new CreatureForm(this, player, event.getRightClicked().getType());
|
||||
|
||||
//Set New
|
||||
_forms.put(player, new CreatureForm(this, player, event.getRightClicked().getType()));
|
||||
_forms.put(player, form);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ChangeFormEvent(player, form));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -372,8 +440,12 @@ public class HideSeek extends TeamGame
|
||||
//Remove Old
|
||||
_forms.get(player).Remove();
|
||||
|
||||
Form form = new CreatureForm(this, player, event.GetDamageeEntity().getType());
|
||||
|
||||
//Set New
|
||||
_forms.put(player, new CreatureForm(this, player, event.GetDamageeEntity().getType()));
|
||||
_forms.put(player, form);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ChangeFormEvent(player, form));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -742,6 +814,8 @@ public class HideSeek extends TeamGame
|
||||
this.AddGems(player, 0.25, "Meows", true);
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.NOTE, player.getLocation().add(0, 0.75, 0), 0.4f, 0.4f, 0.4f, 0, 6);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new MeowEvent(event.getPlayer()));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1077,4 +1151,14 @@ public class HideSeek extends TeamGame
|
||||
if (UtilBlock.usable(event.getClickedBlock()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
public GameTeam getHiders()
|
||||
{
|
||||
return _hiders;
|
||||
}
|
||||
|
||||
public GameTeam getSeekers()
|
||||
{
|
||||
return _seekers;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package nautilus.game.arcade.game.games.hideseek.kits;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public abstract class KitHider extends Kit
|
||||
{
|
||||
public KitHider(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
|
||||
public KitHider(ArcadeManager manager, String name, KitAvailability kitAvailability, int cost, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, cost, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class KitHiderQuick extends Kit
|
||||
public class KitHiderQuick extends KitHider
|
||||
{
|
||||
public KitHiderQuick(ArcadeManager manager)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitHiderShocker extends Kit
|
||||
public class KitHiderShocker extends KitHider
|
||||
{
|
||||
public KitHiderShocker(ArcadeManager manager)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class KitHiderSwapper extends Kit
|
||||
public class KitHiderSwapper extends KitHider
|
||||
{
|
||||
public KitHiderSwapper(ArcadeManager manager)
|
||||
{
|
||||
|
@ -0,0 +1,22 @@
|
||||
package nautilus.game.arcade.game.games.hideseek.kits;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public abstract class KitSeeker extends Kit
|
||||
{
|
||||
public KitSeeker(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
|
||||
public KitSeeker(ArcadeManager manager, String name, KitAvailability kitAvailability, int cost, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
|
||||
{
|
||||
super(manager, name, kitAvailability, cost, kitDesc, kitPerks, entityType, itemInHand);
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkLeap;
|
||||
|
||||
public class KitSeekerLeaper extends Kit
|
||||
public class KitSeekerLeaper extends KitSeeker
|
||||
{
|
||||
public KitSeekerLeaper(ArcadeManager manager)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkRadar;
|
||||
|
||||
public class KitSeekerRadar extends Kit
|
||||
public class KitSeekerRadar extends KitSeeker
|
||||
{
|
||||
public KitSeekerRadar(ArcadeManager manager)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitSeekerTNT extends Kit
|
||||
public class KitSeekerTNT extends KitSeeker
|
||||
{
|
||||
public KitSeekerTNT(ArcadeManager manager)
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
@ -22,10 +23,12 @@ import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
@ -56,6 +59,36 @@ import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class Paintball extends TeamGame
|
||||
{
|
||||
public static class ReviveEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
private final Player _revivedPlayer;
|
||||
|
||||
public ReviveEvent(Player who, Player revivedPlayer)
|
||||
{
|
||||
super(who);
|
||||
|
||||
_revivedPlayer = revivedPlayer;
|
||||
}
|
||||
|
||||
public Player getRevivedPlayer()
|
||||
{
|
||||
return _revivedPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<Player, PlayerCopy> _doubles = new HashMap<Player, PlayerCopy>();
|
||||
private HashSet<Projectile> _water = new HashSet<Projectile>();
|
||||
|
||||
@ -351,6 +384,8 @@ public class Paintball extends TeamGame
|
||||
copyIterator.remove();
|
||||
|
||||
AddGems(thrower, 3, "Revived Ally", true);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ReviveEvent(thrower, copy.GetPlayer()));
|
||||
}
|
||||
|
||||
//Clean
|
||||
|
@ -2,6 +2,18 @@ package nautilus.game.arcade.game.games.sheep;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
@ -14,17 +26,6 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class SheepData
|
||||
{
|
||||
public SheepGame Host;
|
||||
@ -63,6 +64,9 @@ public class SheepData
|
||||
{
|
||||
Holder = player;
|
||||
HolderTeam = Host.GetTeam(player);
|
||||
|
||||
if (Holder != null)
|
||||
Bukkit.getPluginManager().callEvent(new SheepGame.SheepStolenEvent(Holder));
|
||||
}
|
||||
|
||||
public void SetOwner(GameTeam team, ArrayList<Block> locs)
|
||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
@ -20,9 +21,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
@ -52,6 +55,57 @@ import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class SheepGame extends TeamGame
|
||||
{
|
||||
public static class SheepStolenEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
public SheepStolenEvent(Player who)
|
||||
{
|
||||
super(who);
|
||||
}
|
||||
}
|
||||
|
||||
public static class DropEnemySheepEvent extends PlayerEvent
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
private final Player _enemy;
|
||||
|
||||
public DropEnemySheepEvent(Player who, Player enemy)
|
||||
{
|
||||
super(who);
|
||||
|
||||
_enemy = enemy;
|
||||
}
|
||||
|
||||
public Player getEnemy()
|
||||
{
|
||||
return _enemy;
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<GameTeam, Integer> _teamScore = new HashMap<GameTeam, Integer>();
|
||||
|
||||
private HashMap<GameTeam, ArrayList<Block>> _sheepPens = new HashMap<GameTeam, ArrayList<Block>>();
|
||||
@ -428,6 +482,8 @@ public class SheepGame extends TeamGame
|
||||
if (player == null) return;
|
||||
|
||||
DropSheep(player);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new DropEnemySheepEvent(event.GetDamagerPlayer(true), player));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -614,4 +670,17 @@ public class SheepGame extends TeamGame
|
||||
{
|
||||
event.SetCancelled("True");
|
||||
}*/
|
||||
|
||||
public int getSheepCount(GameTeam team)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
for (SheepData data : _sheep.values())
|
||||
{
|
||||
if (data.HolderTeam == team)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.hideseek.HideSeek;
|
||||
import nautilus.game.arcade.game.games.hideseek.forms.CreatureForm;
|
||||
|
||||
public class BadHiderStatTracker extends StatTracker<HideSeek>
|
||||
{
|
||||
private final Set<UUID> _disqualified = new HashSet<>();
|
||||
|
||||
public BadHiderStatTracker(HideSeek game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onChangeForm(HideSeek.ChangeFormEvent event)
|
||||
{
|
||||
if (event.getForm() instanceof CreatureForm)
|
||||
_disqualified.add(event.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onPlayerDeath(PlayerDeathEvent event)
|
||||
{
|
||||
_disqualified.add(event.getEntity().getUniqueId());
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onGameStateChange(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == Game.GameState.End)
|
||||
{
|
||||
for (Player player : getGame().getHiders().GetPlayers(true))
|
||||
{
|
||||
if (!_disqualified.contains(player.getUniqueId()))
|
||||
getGame().AddStat(player, "BadHider", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndead;
|
||||
import nautilus.game.arcade.game.games.hideseek.kits.KitSeeker;
|
||||
|
||||
public class BloodThirstyStatTracker extends StatTracker<Game>
|
||||
{
|
||||
private final Map<UUID, Integer> _kills = new HashMap<>();
|
||||
|
||||
public BloodThirstyStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetLog().GetKiller() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetKiller().IsPlayer())
|
||||
return;
|
||||
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (getGame().GetKit(player) instanceof KitUndead)
|
||||
{
|
||||
Integer kills = _kills.get(killer.getUniqueId());
|
||||
|
||||
kills = (kills == null ? 0 : kills) + 1;
|
||||
|
||||
_kills.put(killer.getUniqueId(), kills);
|
||||
|
||||
if (kills >= 50)
|
||||
getGame().AddStat(killer, "BloodThirsty", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.hideseek.kits.KitSeeker;
|
||||
|
||||
public class HunterKillerStatTracker extends StatTracker<Game>
|
||||
{
|
||||
private final Map<UUID, Integer> _huntersKilled = new HashMap<>();
|
||||
|
||||
public HunterKillerStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetLog().GetKiller() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetKiller().IsPlayer())
|
||||
return;
|
||||
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (getGame().GetKit(player) instanceof KitSeeker)
|
||||
{
|
||||
Integer huntersKilled = _huntersKilled.get(killer.getUniqueId());
|
||||
|
||||
huntersKilled = (huntersKilled == null ? 0 : huntersKilled) + 1;
|
||||
|
||||
_huntersKilled.put(killer.getUniqueId(), huntersKilled);
|
||||
|
||||
if (huntersKilled >= 10)
|
||||
getGame().AddStat(killer, "HunterKiller", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.hideseek.kits.KitHider;
|
||||
import nautilus.game.arcade.game.games.hideseek.kits.KitSeeker;
|
||||
|
||||
public class HunterOfTheYearStatTracker extends StatTracker<Game>
|
||||
{
|
||||
private final Map<UUID, Integer> _hidersKilled = new HashMap<>();
|
||||
|
||||
public HunterOfTheYearStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetLog().GetKiller() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetKiller().IsPlayer())
|
||||
return;
|
||||
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (getGame().GetKit(player) instanceof KitHider)
|
||||
{
|
||||
Integer hidersKilled = _hidersKilled.get(killer.getUniqueId());
|
||||
|
||||
hidersKilled = (hidersKilled == null ? 0 : hidersKilled) + 1;
|
||||
|
||||
_hidersKilled.put(killer.getUniqueId(), hidersKilled);
|
||||
|
||||
if (hidersKilled >= 7)
|
||||
getGame().AddStat(killer, "HiderOfTheYear", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.castlesiege.CastleSiege;
|
||||
|
||||
public class KingDamageStatTracker extends StatTracker<CastleSiege>
|
||||
{
|
||||
private final Map<UUID, Double> _kingDamage = new HashMap<>();
|
||||
private double _totalKingDamage = 0;
|
||||
|
||||
public KingDamageStatTracker(CastleSiege game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onKingDamage(CastleSiege.KingDamageEvent event)
|
||||
{
|
||||
_totalKingDamage += event.getDamage();
|
||||
|
||||
Double damage = _kingDamage.get(event.getPlayer().getUniqueId());
|
||||
|
||||
damage = (damage == null ? 0 : damage) + event.getDamage();
|
||||
|
||||
_kingDamage.put(event.getPlayer().getUniqueId(), damage);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onGameStateChange(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == Game.GameState.End)
|
||||
{
|
||||
for (Player player : getGame().GetPlayers(false))
|
||||
{
|
||||
Double damage = _kingDamage.get(player.getUniqueId());
|
||||
|
||||
if (damage != null && damage >= 0.5 * _totalKingDamage)
|
||||
getGame().AddStat(player, "Assassin", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.castlesiege.CastleSiege;
|
||||
|
||||
public class KingSlayerStatTracker extends StatTracker<Game>
|
||||
{
|
||||
public KingSlayerStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onKingSlaughtered(CastleSiege.KingSlaughterEvent event)
|
||||
{
|
||||
getGame().AddStat(event.getPlayer(), "KingSlayer", 1, true, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndead;
|
||||
|
||||
public class LastStandStatTracker extends StatTracker<TeamGame>
|
||||
{
|
||||
private final Map<UUID, Integer> _kills = new HashMap<>();
|
||||
|
||||
public LastStandStatTracker(TeamGame game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetLog().GetKiller() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetKiller().IsPlayer())
|
||||
return;
|
||||
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (getGame().GetTeam(killer).GetPlayers(true).size() == 1)
|
||||
{
|
||||
Integer kills = _kills.get(killer.getUniqueId());
|
||||
|
||||
kills = (kills == null ? 0 : kills) + 1;
|
||||
|
||||
_kills.put(killer.getUniqueId(), kills);
|
||||
|
||||
if (kills >= 3)
|
||||
getGame().AddStat(killer, "LastStand", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.paintball.Paintball;
|
||||
|
||||
public class MedicStatTracker extends StatTracker<Game>
|
||||
{
|
||||
public MedicStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(Paintball.ReviveEvent event)
|
||||
{
|
||||
getGame().AddStat(event.getPlayer(), "Medic", 1, false, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.hideseek.HideSeek;
|
||||
|
||||
public class MeowStatTracker extends StatTracker<Game>
|
||||
{
|
||||
private final Map<UUID, Integer> _meowCount = new HashMap<>();
|
||||
|
||||
public MeowStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onMeow(HideSeek.MeowEvent event)
|
||||
{
|
||||
Integer meows = _meowCount.get(event.getPlayer().getUniqueId());
|
||||
|
||||
meows = (meows == null ? 0 : meows) + 1;
|
||||
|
||||
_meowCount.put(event.getPlayer().getUniqueId(), meows);
|
||||
|
||||
if (meows >= 50)
|
||||
getGame().AddStat(event.getPlayer(), "Meow", 1, true, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
|
||||
public class SheepDropStatTracker extends StatTracker<Game>
|
||||
{
|
||||
public SheepDropStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onSheepStolen(SheepGame.DropEnemySheepEvent event)
|
||||
{
|
||||
getGame().AddStat(event.getPlayer(), "AnimalRescue", 1, false, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
|
||||
public class SheepThiefStatTracker extends StatTracker<Game>
|
||||
{
|
||||
public SheepThiefStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onSheepStolen(SheepGame.SheepStolenEvent event)
|
||||
{
|
||||
getGame().AddStat(event.getPlayer(), "Thief", 1, false, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
|
||||
public class WinAsTeamStatTracker extends StatTracker<TeamGame>
|
||||
{
|
||||
private final GameTeam _team;
|
||||
private final String _stat;
|
||||
|
||||
public WinAsTeamStatTracker(TeamGame game, GameTeam team, String stat)
|
||||
{
|
||||
super(game);
|
||||
|
||||
_team = team;
|
||||
_stat = stat;
|
||||
}
|
||||
|
||||
public GameTeam getTeam()
|
||||
{
|
||||
return _team;
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onGameStateChange(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == Game.GameState.End)
|
||||
{
|
||||
if (getGame().WinnerTeam == getTeam())
|
||||
{
|
||||
List<Player> winners = getGame().getWinners();
|
||||
|
||||
if (winners != null)
|
||||
{
|
||||
for (Player winner : winners)
|
||||
getGame().AddStat(winner, _stat, 1, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class WinFastStatTracker extends StatTracker<Game>
|
||||
{
|
||||
private final int _seconds;
|
||||
private long _gameStartTime;
|
||||
|
||||
public WinFastStatTracker(Game game, int seconds)
|
||||
{
|
||||
super(game);
|
||||
|
||||
_seconds = seconds;
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onGameStateChange(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == Game.GameState.Live)
|
||||
_gameStartTime = System.currentTimeMillis();
|
||||
else if (event.GetState() == Game.GameState.End)
|
||||
{
|
||||
if (System.currentTimeMillis() - _gameStartTime < _seconds * 1000)
|
||||
{
|
||||
List<Player> winners = getGame().getWinners();
|
||||
|
||||
if (winners != null)
|
||||
{
|
||||
for (Player winner : winners)
|
||||
getGame().AddStat(winner, "Speedrunner", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
|
||||
public class WinWithSheepStatTracker extends StatTracker<SheepGame>
|
||||
{
|
||||
public WinWithSheepStatTracker(SheepGame game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onGameStateChange(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == Game.GameState.End)
|
||||
{
|
||||
if (getGame().getSheepCount(getGame().WinnerTeam) > 12)
|
||||
{
|
||||
List<Player> winners = getGame().getWinners();
|
||||
|
||||
if (winners != null)
|
||||
{
|
||||
for (Player winner : winners)
|
||||
getGame().AddStat(winner, "Selfish", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user