1package com.runehive.content.achievement;
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.items.containers.bank.VaultCurrency;
5import com.runehive.net.packet.out.SendAnnouncement;
6import com.runehive.net.packet.out.SendMessage;
33 if (current >= list.getAmount())
38 player.
send(
new SendAnnouncement(
"You've completed the achievement",
"'" + list.getTask() +
"'", list.getType().getColor()));
45 final int current = player.playerAchievements.computeIfAbsent(
achievement, a -> 0);
48 if (current >= list.getAmount())
50 player.playerAchievements.put(
achievement, increase);
51 if (player.playerAchievements.get(
achievement) >= list.getAmount()) {
53 player.send(
new SendAnnouncement(
"You've completed the achievement",
"'" + list.getTask() +
"'", list.getType().getColor()));
69 player.
send(
new SendMessage(
"You have successfully mastered all achievements."));
Handles the achievements.
static void activate(Player player, AchievementKey achievement, int increase)
Activates the achievement for the individual player.
static void activate(Player player, AchievementKey achievement)
Activates the achievement for the individual player.
static int getDifficultyAmount(AchievementType difficulty)
static int getDifficultyAchievement(AchievementType difficulty)
Handles getting the amount of achievements based on the difficulty.
static int getDifficultyCompletion(Player player, AchievementType difficulty)
Handles getting the amount of achievements completed based on it's difficulty.
static boolean completed(Player player, AchievementList achievement)
Checks if the reward is completed.
static void completeAll(Player player)
Completes all the achievements for player (used for administrative purposes).
static int getTotalCompleted(Player player)
Gets the total amount of achievements completed.
static boolean completedAll(Player player)
Checks if a player has completed all the available achievements.
static int getColor(Player player, AchievementType difficulty)
This class represents a character controlled by a player.
final BankVault bankVault
HashMap< AchievementKey, Integer > playerAchievements
void send(OutgoingPacket encoder)
boolean add(VaultCurrency currency, long amount)
Adds an amount into the player's bank vault with no checks.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Holds all the achievements.
static List< AchievementList > asList(AchievementType difficulty)
The types of achievement types.
All the bank vault currency types.