Merge branch 'Myst_LOBBERS'
This commit is contained in:
commit
8fd3a3a838
@ -644,38 +644,30 @@ public enum Achievement
|
|||||||
new int[]{2000},
|
new int[]{2000},
|
||||||
AchievementCategory.BOMB_LOBBERS),
|
AchievementCategory.BOMB_LOBBERS),
|
||||||
|
|
||||||
// BOMB_LOBBERS_REKT_X3("Rekt x3", 800,
|
|
||||||
// new String[]{"Bomb Lobbers.3Kill"},
|
|
||||||
// new String[]{"Kill 3 players with one explosion"},
|
|
||||||
// new int[]{1},
|
|
||||||
// AchievementCategory.BOMB_LOBBERS),
|
|
||||||
|
|
||||||
BOMB_LOBBERS_ULTIMATE_KILLER("Ultimate Killer", 800,
|
BOMB_LOBBERS_ULTIMATE_KILLER("Ultimate Killer", 800,
|
||||||
new String[]{"Bomb Lobbers.Killer"},
|
new String[]{"Bomb Lobbers.Killer"},
|
||||||
new String[]{"Kill 6 players in a single game"},
|
new String[]{"Kill 6 players in a single game"},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.BOMB_LOBBERS),
|
AchievementCategory.BOMB_LOBBERS),
|
||||||
|
|
||||||
BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1000,
|
BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1200,
|
||||||
new String[]{"Bomb Lobbers.JellySkin"},
|
new String[]{"Bomb Lobbers.JellySkin"},
|
||||||
new String[]{"Win a game without taking any damage."},
|
new String[]{"Win a game without taking any damage."},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.BOMB_LOBBERS),
|
AchievementCategory.BOMB_LOBBERS),
|
||||||
|
|
||||||
BOMB_LOBBERS_BEST_TEAM("The Best Team", 800,
|
|
||||||
new String[]{"Bomb Lobbers.BestTeam"},
|
|
||||||
new String[]{"Win a game without losing a teammate"},
|
|
||||||
new int[]{1},
|
|
||||||
AchievementCategory.BOMB_LOBBERS),
|
|
||||||
|
|
||||||
BOMB_LOBBERS_BLAST_PROOF("Blast Proof", 800,
|
BOMB_LOBBERS_BLAST_PROOF("Blast Proof", 800,
|
||||||
new String[]{"Bomb Lobbers.BlastProof"},
|
new String[]{"Bomb Lobbers.BlastProof"},
|
||||||
new String[]{"Win 20 games using Armorer"},
|
new String[]{"Win 20 games using Armorer"},
|
||||||
new int[]{20},
|
new int[]{20},
|
||||||
|
AchievementCategory.BOMB_LOBBERS),
|
||||||
|
|
||||||
|
BOMB_LOBBERS_SNIPER("Sniper", 10000,
|
||||||
|
new String[]{"Bomb Lobbers.Direct Hit"},
|
||||||
|
new String[]{"Get 50 direct hits"},
|
||||||
|
new int[]{50},
|
||||||
AchievementCategory.BOMB_LOBBERS)
|
AchievementCategory.BOMB_LOBBERS)
|
||||||
|
|
||||||
|
|
||||||
// BOMB_LOBBERS_
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private String _name;
|
private String _name;
|
||||||
|
@ -33,12 +33,12 @@ import nautilus.game.arcade.game.TeamGame;
|
|||||||
import nautilus.game.arcade.game.games.lobbers.events.TNTPreExplodeEvent;
|
import nautilus.game.arcade.game.games.lobbers.events.TNTPreExplodeEvent;
|
||||||
import nautilus.game.arcade.game.games.lobbers.events.TNTThrowEvent;
|
import nautilus.game.arcade.game.games.lobbers.events.TNTThrowEvent;
|
||||||
import nautilus.game.arcade.game.games.lobbers.kits.KitArmorer;
|
import nautilus.game.arcade.game.games.lobbers.kits.KitArmorer;
|
||||||
import nautilus.game.arcade.game.games.lobbers.kits.KitPitcher;
|
|
||||||
import nautilus.game.arcade.game.games.lobbers.kits.KitJumper;
|
import nautilus.game.arcade.game.games.lobbers.kits.KitJumper;
|
||||||
|
import nautilus.game.arcade.game.games.lobbers.kits.KitPitcher;
|
||||||
import nautilus.game.arcade.game.games.lobbers.kits.KitWaller;
|
import nautilus.game.arcade.game.games.lobbers.kits.KitWaller;
|
||||||
import nautilus.game.arcade.game.games.lobbers.trackers.Tracker6Kill;
|
import nautilus.game.arcade.game.games.lobbers.trackers.Tracker6Kill;
|
||||||
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBestTeam;
|
|
||||||
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBlastProof;
|
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBlastProof;
|
||||||
|
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerDirectHit;
|
||||||
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerNoDamage;
|
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerNoDamage;
|
||||||
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerTNTThrown;
|
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerTNTThrown;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
@ -79,7 +79,6 @@ public class BombLobbers extends TeamGame implements IThrown
|
|||||||
new KitJumper(manager),
|
new KitJumper(manager),
|
||||||
new KitArmorer(manager),
|
new KitArmorer(manager),
|
||||||
new KitPitcher(manager),
|
new KitPitcher(manager),
|
||||||
// new KitMortar(manager), << Spare time kit for Bobbeh
|
|
||||||
new KitWaller(manager)
|
new KitWaller(manager)
|
||||||
}, new String[]
|
}, new String[]
|
||||||
{
|
{
|
||||||
@ -109,7 +108,21 @@ public class BombLobbers extends TeamGame implements IThrown
|
|||||||
|
|
||||||
HungerSet = 20;
|
HungerSet = 20;
|
||||||
|
|
||||||
registerStatTrackers(new Tracker6Kill(this), new TrackerBestTeam(this), new TrackerBlastProof(this), new TrackerNoDamage(this), new TrackerTNTThrown(this));
|
WorldTimeSet = 6000;
|
||||||
|
|
||||||
|
registerStatTrackers(new Tracker6Kill(this), new TrackerBlastProof(this), new TrackerNoDamage(this), new TrackerTNTThrown(this), new TrackerDirectHit(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void setTime(GameStateChangeEvent event)
|
||||||
|
{
|
||||||
|
if (event.GetState() != GameState.Prepare)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (WorldData.MapName.equalsIgnoreCase("Intergalactic"))
|
||||||
|
{
|
||||||
|
WorldTimeSet = 18000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addKill(Player player)
|
public void addKill(Player player)
|
||||||
@ -295,6 +308,8 @@ public class BombLobbers extends TeamGame implements IThrown
|
|||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
NautHashMap<TNTPrimed, BombToken> toAdd = new NautHashMap<TNTPrimed, BombToken>();
|
||||||
|
|
||||||
Iterator<Entry<TNTPrimed, BombToken>> iterator = _tnt.entrySet().iterator();
|
Iterator<Entry<TNTPrimed, BombToken>> iterator = _tnt.entrySet().iterator();
|
||||||
while (iterator.hasNext())
|
while (iterator.hasNext())
|
||||||
{
|
{
|
||||||
@ -330,10 +345,16 @@ public class BombLobbers extends TeamGame implements IThrown
|
|||||||
tnt.getKey().remove();
|
tnt.getKey().remove();
|
||||||
|
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
_tnt.put(newTNT, token);
|
toAdd.put(newTNT, token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Prevent concurrent modification thigns
|
||||||
|
for (Entry<TNTPrimed, BombToken> entry : toAdd.entrySet())
|
||||||
|
{
|
||||||
|
_tnt.put(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -12,7 +12,6 @@ import org.bukkit.event.EventHandler;
|
|||||||
|
|
||||||
public class Tracker6Kill extends StatTracker<Game>
|
public class Tracker6Kill extends StatTracker<Game>
|
||||||
{
|
{
|
||||||
|
|
||||||
public Tracker6Kill(Game game)
|
public Tracker6Kill(Game game)
|
||||||
{
|
{
|
||||||
super(game);
|
super(game);
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package nautilus.game.arcade.game.games.lobbers.trackers;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.NautHashMap;
|
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
|
||||||
import nautilus.game.arcade.game.Game;
|
|
||||||
import nautilus.game.arcade.game.Game.GameState;
|
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
|
||||||
import nautilus.game.arcade.stats.StatTracker;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
|
|
||||||
public class TrackerBestTeam extends StatTracker<Game>
|
|
||||||
{
|
|
||||||
private NautHashMap<GameTeam, Integer> _teams = new NautHashMap<GameTeam, Integer>();
|
|
||||||
|
|
||||||
public TrackerBestTeam(Game game)
|
|
||||||
{
|
|
||||||
super(game);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onGameStart(GameStateChangeEvent event)
|
|
||||||
{
|
|
||||||
if (event.GetState() != GameState.Prepare)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (GameTeam team : getGame().GetTeamList())
|
|
||||||
{
|
|
||||||
_teams.put(team, team.GetPlayers(true).size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onGameEnd(GameStateChangeEvent event)
|
|
||||||
{
|
|
||||||
if (event.GetState() != GameState.End)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (GameTeam team : getGame().GetTeamList())
|
|
||||||
{
|
|
||||||
if (_teams.get(team) == team.GetPlayers(true).size())
|
|
||||||
{
|
|
||||||
for (Player player : team.GetPlayers(true))
|
|
||||||
{
|
|
||||||
addStat(player, "BestTeam", 1, true, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,38 @@
|
|||||||
|
package nautilus.game.arcade.game.games.lobbers.trackers;
|
||||||
|
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
import nautilus.game.arcade.game.Game;
|
||||||
|
import nautilus.game.arcade.stats.StatTracker;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
|
||||||
|
public class TrackerDirectHit extends StatTracker<Game>
|
||||||
|
{
|
||||||
|
public TrackerDirectHit(Game game)
|
||||||
|
{
|
||||||
|
super(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onKillDirectHit(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (!getGame().IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetDamagerPlayer(true) == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player damager = event.GetDamagerPlayer(true);
|
||||||
|
|
||||||
|
if (!getGame().IsAlive(damager))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetReason() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetReason().toLowerCase().contains("direct hit"))
|
||||||
|
addStat(damager, "Direct Hit", 1, false, false);
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,6 @@ package nautilus.game.arcade.game.games.lobbers.trackers;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
import nautilus.game.arcade.game.Game;
|
import nautilus.game.arcade.game.Game;
|
||||||
@ -16,36 +15,25 @@ import org.bukkit.event.EventPriority;
|
|||||||
|
|
||||||
public class TrackerNoDamage extends StatTracker<Game>
|
public class TrackerNoDamage extends StatTracker<Game>
|
||||||
{
|
{
|
||||||
private Set<String> _noDamage = new HashSet<String>();
|
private Set<String> _damaged = new HashSet<String>();
|
||||||
|
|
||||||
public TrackerNoDamage(Game game)
|
public TrackerNoDamage(Game game)
|
||||||
{
|
{
|
||||||
super(game);
|
super(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onGameStart(GameStateChangeEvent event)
|
|
||||||
{
|
|
||||||
if (event.GetState() != GameState.Prepare)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (Player player : getGame().GetPlayers(true))
|
|
||||||
{
|
|
||||||
_noDamage.add(player.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onGameEnd(GameStateChangeEvent event)
|
public void onGameEnd(GameStateChangeEvent event)
|
||||||
{
|
{
|
||||||
if (event.GetState() != GameState.End)
|
if (event.GetState() != GameState.End)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (String name : _noDamage)
|
if (event.GetGame().getWinners() == null)
|
||||||
{
|
return;
|
||||||
Player player = UtilPlayer.searchExact(name);
|
|
||||||
|
|
||||||
if (player == null || !player.isOnline())
|
for (Player player : event.GetGame().getWinners())
|
||||||
|
{
|
||||||
|
if (_damaged.contains(player.getName()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
addStat(player, "JellySkin", 1, true, false);
|
addStat(player, "JellySkin", 1, true, false);
|
||||||
@ -61,9 +49,7 @@ public class TrackerNoDamage extends StatTracker<Game>
|
|||||||
if (event.GetDamageePlayer() == null || !event.GetDamageePlayer().isOnline())
|
if (event.GetDamageePlayer() == null || !event.GetDamageePlayer().isOnline())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_noDamage.contains(event.GetDamageePlayer().getName()))
|
if (!_damaged.contains(event.GetDamageePlayer().getName()))
|
||||||
{
|
_damaged.add(event.GetDamageePlayer().getName());
|
||||||
_noDamage.remove(event.GetDamageePlayer().getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,5 +22,4 @@ public class TrackerTNTThrown extends StatTracker<Game>
|
|||||||
|
|
||||||
addStat(event.getPlayer(), "Thrown", 1, false, false);
|
addStat(event.getPlayer(), "Thrown", 1, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user