Skip to content

Commit

Permalink
config.yml Zombies renamed to Creatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigerpanzer02 committed Jul 31, 2023
1 parent a15e4f7 commit 124c32c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Village Defense is a Minecraft minigame designed for small and big servers. This minigame is unique and very
configurable, 100% free and open source!

The goal is to protect Villagers from hordes of undead Zombies. However, the game isn't that easy. There are more and
The goal is to protect Villagers from hordes of undead Creatures. However, the game isn't that easy. There are more and
more zombies every wave and more types of them come in higher waves. There is no wave limit so try to survive as long as
you can!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ public void startWave(@NotNull Arena arena) {
Bukkit.getPluginManager().callEvent(new VillageWaveStartEvent(arena, wave));

int zombiesAmount = (int) Math.ceil((arena.getPlayers().size() * 0.5) * (wave * wave) / 2);
int maxzombies = plugin.getConfig().getInt("Limit.Spawn.Zombies", 75);
int maxzombies = plugin.getConfig().getInt("Limit.Spawn.Creatures", 75);

if(zombiesAmount > maxzombies) {
int multiplier = (int) Math.ceil((zombiesAmount - (double) maxzombies) / plugin.getConfig().getInt("Zombies.Multiplier-Divider", 18));
int multiplier = (int) Math.ceil((zombiesAmount - (double) maxzombies) / plugin.getConfig().getInt("Creatures.Multiplier-Divider", 18));

if(multiplier < 2) multiplier = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void registerCreatures() {
*/
public void spawnEnemies(Random random, Arena arena) {
int spawn = arena.getWave();
int zombiesLimit = plugin.getConfig().getInt("Limit.Spawn.Zombies", 75);
int zombiesLimit = plugin.getConfig().getInt("Limit.Spawn.Creatures", 75);
if(zombiesLimit < spawn) {
spawn = (int) Math.ceil(zombiesLimit / 2.0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ default void spawn(Location location, Arena arena) {
arena.getEnemies().add(creature);
}

//TODO Simplify creature spawn reduce to one method e.g. spawn; add weight to creatures configurable!
@Override
default void spawn(Random random, Arena arena, int spawn) {
int wave = arena.getWave();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void handleCall(PluginArena arena) {
setArenaTimer(500);
}
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9_R1)) {
int zombiesLeftFrom = getPlugin().getConfig().getInt("Glowing-Status.Zombies-Left");
int zombiesLeftFrom = getPlugin().getConfig().getInt("Glowing-Status.Creatures-Left");
int startingWave;
if(zombiesLeftFrom > 0 && zombiesLeft <= zombiesLeftFrom
&& (startingWave = getPlugin().getConfig().getInt("Glowing-Status.Starting-Wave")) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void registerConfigOptions() {
getConfigPreferences().registerOption("RESPAWN_IN_GAME_JOIN", new ConfigOption("Respawn.In-Game-Join", true));
getConfigPreferences().registerOption("LIMIT_WAVE_UNLIMITED", new ConfigOption("Limit.Wave.Unlimited", true));
getConfigPreferences().registerOption("LIMIT_ENTITY_BUY_AFTER_DEATH", new ConfigOption("Limit.Wave.Entity-Buy-After-Death", true));
getConfigPreferences().registerOption("ZOMBIE_HEALTHBAR", new ConfigOption("Zombies.Health-Bar", true));
getConfigPreferences().registerOption("ZOMBIE_HEALTHBAR", new ConfigOption("Creatures.Health-Bar", true));
getConfigPreferences().registerOption("NAME_VISIBILITY_GOLEM", new ConfigOption("Name-Visibility.Golem", true));
getConfigPreferences().registerOption("NAME_VISIBILITY_WOLF", new ConfigOption("Name-Visibility.Wolf", true));
getConfigPreferences().registerOption("NAME_VISIBILITY_VILLAGER", new ConfigOption("Name-Visibility.Villager", true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void execute(CommandSender sender, String[] args) {
return;
}
if(args.length == 1) {
new MessageBuilder(ChatColor.RED + "Please type valid mob type to clear: VILLAGER, ZOMBIE, IRON_GOLEM").prefix().send(sender);
new MessageBuilder(ChatColor.RED + "Please type valid mob type to clear: VILLAGER, ZOMBIE, IRON_GOLEM, WOLF").prefix().send(sender);
return;
}
Arena arena = (Arena) registry.getPlugin().getArenaRegistry().getArena((Player) sender);
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,19 @@ Limit:
Golems: 15
# How many villagers will be spawned in an arena?
Villagers: 10
# After how many zombies should we limit them?
# Once limit is reached zombies get more health so it's still harder each wave
Zombies: 75
# After how many Creatures should we limit them?
# Once limit is reached Creatures get more health so it's still harder each wave
Creatures: 75
# Can the players buy again iron golems or wolves if these
# entities died? The config limit and permission will be ignored.
Entity-Buy-After-Death: false


Zombies:
# Active after zombies limit is reached
# Higher value means weaker zombies
Creatures:
# Active after Creatures limit is reached
# Higher value means weaker Creatures
Multiplier-Divider: 18
# Enable very simple health bar for zombies?
# Enable very simple health bar for Creatures?
# They will have health instead of their names
# It will show percentage of health left.
Health-Bar: true
Expand Down Expand Up @@ -237,9 +237,9 @@ Name-Visibility:
Glowing-Status:
# From which wave should the glowing be activated?
Starting-Wave: 6
# How many zombies should the glow be activated from?
# How many creatures should the glow be activated from?
# Set to 0 to disable
Zombies-Left: 0
Creatures-Left: 0


Update-Notifier:
Expand Down
9 changes: 0 additions & 9 deletions src/main/resources/permissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ Spawn-Limit:
Golems:
limit-wolve-10: 10

# Basic permissions for game, permissions explained here: https://wiki.plugily.xyz/
Basic:
Full-Games: "villagedefense.fullgames"
# <arena> represents arena name (NOT MAP NAME!), for example: 'villagedefense.join.ARENAnice'
# use 'villagedefense.join.*' to enable access to all arenas
Join: "villagedefense.join.<arena>"
Forcestart: "villagedefense.admin.forcestart"
Premium-Kits: "villagedefense.kits.premium"

# Don't edit it. But who's stopping you? It's your server!
# Really, don't edit ;p
# You edited it, huh? Next time hurt yourself!
Expand Down

0 comments on commit 124c32c

Please sign in to comment.