Tweak difficulty

This commit is contained in:
Mathieu Strypsteen 2024-09-23 11:02:33 +02:00
parent db0469dd57
commit 03eae3ecc9
2 changed files with 10 additions and 2 deletions

View file

@ -21,7 +21,7 @@ import net.kyori.adventure.text.format.NamedTextColor;
public class EndEvent extends Event {
private PotionEffectType[] effects;
private int livesLeft = 5;
private int livesLeft;
public EndEvent(Team team, Difficulty difficulty, int scoreOnSuccess) {
super(team, difficulty, scoreOnSuccess);
@ -33,6 +33,14 @@ public class EndEvent extends Event {
case SWEAT -> new PotionEffectType[] { PotionEffectType.HUNGER };
case IMPOSSIBLE -> new PotionEffectType[] { PotionEffectType.HUNGER, PotionEffectType.WEAKNESS };
};
livesLeft = switch (difficulty) {
case BABY -> 50;
case EASY -> 20;
case MEDIUM -> 10;
case HARD -> 5;
case SWEAT -> 3;
case IMPOSSIBLE -> 1;
};
}
@Override

View file

@ -36,7 +36,7 @@ public class FallEvent extends Event {
Player player = MC13DTL.board.getPlayers(team).getFirst();
Location location = player.getLocation();
location.setX(((int) location.getX()) + 0.5);
location.setZ(((int) location.getX()) + 0.5);
location.setZ(((int) location.getZ()) + 0.5);
World world = player.getWorld();
location.setY(world.getHighestBlockYAt(location));
targetHeight = (int) location.getY() + 5;