Achievements now need 75%+ players at START of game
This commit is contained in:
parent
d9e1f35985
commit
f9ce0d353c
@ -207,6 +207,8 @@ public abstract class Game implements Listener
|
|||||||
public boolean EloRanking = false;
|
public boolean EloRanking = false;
|
||||||
public int EloStart = 1000;
|
public int EloStart = 1000;
|
||||||
|
|
||||||
|
public boolean CanAddStats = true;
|
||||||
|
|
||||||
public ArrayList<String> GemBoosters = new ArrayList<String>();
|
public ArrayList<String> GemBoosters = new ArrayList<String>();
|
||||||
private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>();
|
private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>();
|
||||||
|
|
||||||
|
@ -271,6 +271,20 @@ public class GameManager implements Listener
|
|||||||
event.GetGame().DeregisterKits();
|
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
|
@EventHandler
|
||||||
public void StatRegister(GameStateChangeEvent event)
|
public void StatRegister(GameStateChangeEvent event)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ public class StatTracker<G extends Game> implements Listener
|
|||||||
|
|
||||||
public boolean canAddStats()
|
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)
|
public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global)
|
||||||
|
Loading…
Reference in New Issue
Block a user