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()) {
if (!singleTeamGame) {
for (GamePlayer player : team.getMembers()) { for (GamePlayer player : team.getMembers()) {
if (player.getScore() > 0) { if (player.getScore() > 0) {
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallPlayer")); AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallPlayer"));
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallQuestCompleted")); }
} }
} }
@ -171,12 +174,14 @@ public class BattleBanzaiGame extends Game {
} }
if (winningTeam != null) { if (winningTeam != null) {
if (!singleTeamGame) {
for (GamePlayer player : winningTeam.getMembers()) { for (GamePlayer player : winningTeam.getMembers()) {
if (player.getScore() > 0) { if (player.getScore() > 0) {
this.room.sendComposer(new RoomUserActionComposer(player.getHabbo().getRoomUnit(), RoomUserAction.WAVE).compose()); this.room.sendComposer(new RoomUserActionComposer(player.getHabbo().getRoomUnit(), RoomUserAction.WAVE).compose());
AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallWinner")); AchievementManager.progressAchievement(player.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("BattleBallWinner"));
} }
} }
}
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) { for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
item.setExtradata((6 + winningTeam.teamColor.type) + ""); item.setExtradata((6 + winningTeam.teamColor.type) + "");