Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2014-08-26 18:39:10 -05:00
commit 48ed5e2cba
5 changed files with 21 additions and 5 deletions

View File

@ -207,6 +207,8 @@ public abstract class Game implements Listener
public boolean EloRanking = false;
public int EloStart = 1000;
public boolean CanAddStats = true;
public ArrayList<String> GemBoosters = new ArrayList<String>();
private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>();

View File

@ -101,7 +101,7 @@ public class Micro extends TeamGame
if (_blocks.isEmpty())
return;
TimingManager.start("Block Fall");
//TimingManager.start("Block Fall");
for (int i = 0 ; i < 3 ; i++)
{
@ -134,7 +134,7 @@ public class Micro extends TeamGame
}
}
TimingManager.stop("Block Fall");
//TimingManager.stop("Block Fall");
}
@EventHandler

View File

@ -95,7 +95,7 @@ public class GameAchievementManager implements Listener
boolean displayDesc = true;
//Completed Achievement
if (data.getLevel() == type.getMaxLevel())
if (data.getLevel() >= type.getMaxLevel())
{
//Finishing for the first time
if (!Manager.GetTaskManager().hasCompletedTask(player, type.getName()))

View File

@ -271,6 +271,20 @@ public class GameManager implements Listener
event.GetGame().DeregisterKits();
}
@EventHandler
public void StatEnableDisable(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
return;
int requirement = (int)((double)event.GetGame().Manager.GetPlayerFull() * 0.75d);
event.GetGame().CanAddStats = (double)event.GetGame().GetPlayers(true).size() >= requirement;
if (!event.GetGame().CanAddStats)
event.GetGame().Announce(C.Bold + "Stats/Achievements Disabled. Requires " + requirement + " Players.");
}
@EventHandler
public void StatRegister(GameStateChangeEvent event)
{

View File

@ -21,7 +21,7 @@ public class StatTracker<G extends Game> implements Listener
public boolean canAddStats()
{
return getGame().GetPlayers(false).size() * 4 >= 3 * getGame().Manager.GetPlayerFull();
return getGame().CanAddStats;
}
public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global)