Skip to content

Commit

Permalink
Added configurable initial grace period. (#106)
Browse files Browse the repository at this point in the history
* NEW: the initial grace period duration can be customized (with a minimum of 15 seconds, to avoid any problem related to the initial fall).
  • Loading branch information
AmauryCarrade committed Jan 11, 2016
1 parent 6af5432 commit 5c13593
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class UHGameManager
{
private final Boolean RANDOM_COLORS_IN_SOLO;
private final Boolean BROADCAST_SLOW_START_PROGRESS;
private final Long GRACE_PERIOD;
private final UHSound DEATH_SOUND;

private UHCReloaded p = null;
Expand Down Expand Up @@ -126,6 +127,7 @@ public UHGameManager(UHCReloaded plugin)
// Loads the config
RANDOM_COLORS_IN_SOLO = p.getConfig().getBoolean("teams-options.randomColors");
BROADCAST_SLOW_START_PROGRESS = p.getConfig().getBoolean("start.slow.broadcastProgress");
GRACE_PERIOD = (long) Math.min(p.getConfig().getDouble("start.gracePeriod", 30), 15) * 20l;
DEATH_SOUND = new UHSound(p.getConfig().getConfigurationSection("death.announcements.sound"));
}

Expand Down Expand Up @@ -595,7 +597,7 @@ public void run()
{
damageIsOn = true;
}
}, 600L);
}, GRACE_PERIOD);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ start:
# Display a title to everyone when the game begins
displayTitle: true

# Damages are enabled after this amount of seconds.
# Cannot be less than 15 seconds, to avoid initial-fall-related problems.
gracePeriod: 30



death:
Expand Down

0 comments on commit 5c13593

Please sign in to comment.