Skip to content

Commit

Permalink
fix Eredrim#61 Limit "non original" infected lives
Browse files Browse the repository at this point in the history
  • Loading branch information
Oruss7 committed Jan 9, 2021
1 parent 6eacc26 commit 9f6c4b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/net/slipcor/pvparena/core/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ public enum CFG {
GOAL_FOOD_FPLAYERITEMS("goal.food.fplayeritems", 10, "Food"),
GOAL_FOOD_FTEAMITEMS("goal.food.fteamitems", 100, "Food"),

GOAL_INFECTED_ILIVES("goal.infected.iilives", 1, "Infect"),
GOAL_INFECTED_NLIVES("goal.infected.inlives", 1, "Infect"),
GOAL_INFECTED_STARTING_INFECTED_LIVES("goal.infected.iilives", 1, "Infect"),
GOAL_INFECTED_NORMAL_INFECTED_LIVES("goal.infected.wheninfectedlives", 1, "Infect"),
GOAL_INFECTED_NORMAL_LIVES("goal.infected.inlives", 1, "Infect"),
GOAL_INFECTED_PPROTECTS("goal.infected.iplayerprotect", 0, "Infect"),

GOAL_LIBERATION_JAILEDSCOREBOARD("goal.liberation.jailedscoreboard", false, "Liberation"),
Expand Down
16 changes: 8 additions & 8 deletions src/net/slipcor/pvparena/goals/GoalInfect.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public void commitPlayerDeath(final Player player, final boolean doesRespawn,
PAGoalEvent gEvent = new PAGoalEvent(this.arena, this, "playerDeath:" + player.getName());
Bukkit.getPluginManager().callEvent(gEvent);
// dying player -> infected
this.getLifeMap().put(player.getName(), this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_ILIVES));
this.getLifeMap().put(player.getName(), this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NORMAL_INFECTED_LIVES));
this.arena.msg(player, Language.parse(this.arena, MSG.GOAL_INFECTED_YOU));
this.arena.broadcast(Language.parse(this.arena, MSG.GOAL_INFECTED_PLAYER, player.getName()));

Expand Down Expand Up @@ -568,10 +568,10 @@ public void commitStart() {

@Override
public void displayInfo(final CommandSender sender) {
sender.sendMessage("normal lives: "
+ this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NLIVES) + " || " +
"infected lives: "
+ this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_ILIVES));
sender.sendMessage(String.format("normal lives: %s || start infected lives: %s || when infected lives: %s",
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NORMAL_LIVES),
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_STARTING_INFECTED_LIVES),
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NORMAL_INFECTED_LIVES)));
}

@Override
Expand Down Expand Up @@ -609,7 +609,7 @@ public boolean hasSpawn(final String string) {

@Override
public void initate(final Player player) {
this.updateLives(player, this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NLIVES));
this.updateLives(player, this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NORMAL_LIVES));
}

@Override
Expand Down Expand Up @@ -640,11 +640,11 @@ public void parseStart() {
for (final ArenaPlayer ap : team.getTeamMembers()) {
this.arena.getDebugger().i("#" + pos + ": " + ap, ap.getName());
this.getLifeMap().put(ap.getName(),
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NLIVES));
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_NORMAL_LIVES));
if (pos-- == 0) {
infected = ap;
this.getLifeMap().put(ap.getName(),
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_ILIVES));
this.arena.getArenaConfig().getInt(CFG.GOAL_INFECTED_STARTING_INFECTED_LIVES));
}
//break;
}
Expand Down

0 comments on commit 9f6c4b9

Please sign in to comment.