mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Add game-related achievements
This commit is contained in:
parent
1d8b82c4ec
commit
12d03bebc9
@ -142,6 +142,13 @@ public abstract class Game implements Runnable {
|
|||||||
|
|
||||||
this.saveScores();
|
this.saveScores();
|
||||||
|
|
||||||
|
int totalPointsGained = this.teams.values().stream().mapToInt(GameTeam::getTotalScore).sum();
|
||||||
|
|
||||||
|
Habbo roomOwner = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.room.getOwnerId());
|
||||||
|
if (roomOwner != null) {
|
||||||
|
AchievementManager.progressAchievement(roomOwner, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GameAuthorExperience"), totalPointsGained);
|
||||||
|
}
|
||||||
|
|
||||||
GameTeam winningTeam = null;
|
GameTeam winningTeam = null;
|
||||||
for (GameTeam team : this.teams.values()) {
|
for (GameTeam team : this.teams.values()) {
|
||||||
if (winningTeam == null || team.getTotalScore() > winningTeam.getTotalScore()) {
|
if (winningTeam == null || team.getTotalScore() > winningTeam.getTotalScore()) {
|
||||||
@ -152,6 +159,11 @@ public abstract class Game implements Runnable {
|
|||||||
if (winningTeam != null) {
|
if (winningTeam != null) {
|
||||||
for (GamePlayer player : winningTeam.getMembers()) {
|
for (GamePlayer player : winningTeam.getMembers()) {
|
||||||
WiredHandler.handleCustomTrigger(WiredTriggerTeamWins.class, player.getHabbo().getRoomUnit(), this.room, new Object[]{this});
|
WiredHandler.handleCustomTrigger(WiredTriggerTeamWins.class, player.getHabbo().getRoomUnit(), this.room, new Object[]{this});
|
||||||
|
|
||||||
|
Habbo winner = player.getHabbo();
|
||||||
|
if (winner != null) {
|
||||||
|
AchievementManager.progressAchievement(roomOwner, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GamePlayerExperience"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (GameTeam team : this.teams.values()) {
|
for (GameTeam team : this.teams.values()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user