Make single-player banzai games not give achievements

This commit is contained in:
Alejandro 2020-02-04 14:12:34 +02:00
parent 304907ddf1
commit ae412592b1

View File

@ -157,11 +157,14 @@ public class BattleBanzaiGame extends Game {
public void onEnd() { public void onEnd() {
GameTeam winningTeam = null; GameTeam winningTeam = null;
boolean singleTeamGame = this.teams.values().stream().filter(t -> t.getMembers().size() > 0).count() == 1;
for (GameTeam team : this.teams.values()) { for (GameTeam team : this.teams.values()) {
for (GamePlayer player : team.getMembers()) { if (!singleTeamGame) {
if (player.getScore() > 0) { for (GamePlayer player : team.getMembers()) {
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallPlayer")); if (player.getScore() > 0) {
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallQuestCompleted")); AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallPlayer"));
}
} }
} }
@ -171,10 +174,12 @@ public class BattleBanzaiGame extends Game {
} }
if (winningTeam != null) { if (winningTeam != null) {
for (GamePlayer player : winningTeam.getMembers()) { if (!singleTeamGame) {
if (player.getScore() > 0) { for (GamePlayer player : winningTeam.getMembers()) {
this.room.sendComposer(new RoomUserActionComposer(player.getHabbo().getRoomUnit(), RoomUserAction.WAVE).compose()); if (player.getScore() > 0) {
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallWinner")); this.room.sendComposer(new RoomUserActionComposer(player.getHabbo().getRoomUnit(), RoomUserAction.WAVE).compose());
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallWinner"));
}
} }
} }