Achievements
public interface AchievementLibrary extends CMLibrary
Modifier and Type | Interface | Description |
---|---|---|
static interface |
AchievementLibrary.AbilityAward |
The AbilityAward interface provides pre-parsed award information for those who
complete the achievement.
|
static interface |
AchievementLibrary.Achievement |
The achievement interface provides basic information about the specific achievement,
as defined in the achievements.ini definition file.
|
static class |
AchievementLibrary.AchievementFlag |
Legal values for the FLAGS field in an achievement.
|
static class |
AchievementLibrary.AchievementLoadFlag |
Flags to denote how awards are given when achievements
are granted, especially on character creation and/or
remort.
|
static interface |
AchievementLibrary.AmountAward |
The award interface provides pre-parsed award information for those who
complete the achievement.
|
static interface |
AchievementLibrary.Award |
The award interface provides pre-parsed award information for those who
complete the achievement.
|
static class |
AchievementLibrary.AwardType |
The award type is an enumeration of the different types
of awards that can be granted for completing an achievement.
|
static interface |
AchievementLibrary.CurrencyAward |
The award interface provides pre-parsed award information for those who
complete the achievement.
|
static class |
AchievementLibrary.Event |
Events define the type of achievement, describing specific arguments that
the achievement of each event type needs.
|
static interface |
AchievementLibrary.ExpertiseAward |
The ExpertiseAward interface provides pre-parsed award information for those who
complete the achievement.
|
static interface |
AchievementLibrary.StatAward |
The award interface provides pre-parsed award information for those who
complete the achievement.
|
static interface |
AchievementLibrary.TattooAward |
The TattooAward interface provides pre-parsed award information for those who
complete the achievement.
|
static interface |
AchievementLibrary.TitleAward |
The award interface provides pre-parsed award information for those who
complete the achievement.
|
static interface |
AchievementLibrary.Tracker |
A tracker object assigned to a particular player or account
for a particular achievement, allowing the achievement to
track progress if it needs to, or just providing a way
to quickly query completion otherwise.
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String[] |
BASE_ACHIEVEMENT_PARAMETERS |
The list of arguments/parameters common to all achievement event types
-- remember to also modify fillAchievementParmTree
|
idConverter
Modifier and Type | Method | Description |
---|---|---|
java.util.Enumeration<AchievementLibrary.Achievement> |
achievements(AccountStats.Agent agent) |
Allows iterating through all the achievements of the given agent group.
|
boolean |
addModifyAchievement(MOB mob,
AccountStats.Agent agent,
java.lang.String tattoo,
AchievementLibrary.Achievement A) |
Allows a new achievement to be added or removed, with a user interface
editor presented for the given mob.
|
void |
bumpAchievement(MOB mob,
AchievementLibrary.Achievement A,
int bumpNum,
java.lang.Object... parms) |
Always causes a player to have one of their achievements bumped,
this method is called with event specific parameters which might possibly cause the achievement
to be bumped in the tracker, which might cause it to be completed as well.
|
AchievementLibrary.Achievement |
deleteAchievement(java.lang.String tattoo) |
Finds and deleted the achievement with teh given tattoo key.
|
boolean |
evaluateAccountAchievements(MOB mob) |
Iterates through all the player account achievements to see if the given
mob has completed any new ones, granting them and the awards if they have.
|
java.lang.String |
evaluateAchievement(AccountStats.Agent agent,
java.lang.String row,
boolean addIfPossible) |
This method is how an achievement definition row is evaluated and added
to the permanent list of achievements.
|
boolean |
evaluateClanAchievements() |
Iterates through all the clan achievements to see if any clans
have completed any new ones, granting them and the awards if they have.
|
boolean |
evaluatePlayerAchievements(MOB mob) |
Iterates through all the player achievements to see if the given mob has completed
any new ones, granting them and the awards if they have.
|
java.util.List<AchievementLibrary.Achievement> |
fakeBumpAchievement(MOB mob,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
When an event occurs that might possible cause a player to have one of their achievements bumped,
this method is called with event specific parameters which might possibly cause the achievement
to be bumped in the tracker, which might cause it to be completed as well.
|
java.lang.String |
findAchievementID(java.lang.String ID,
boolean exact) |
Searches for an Achievement of the given tattoo name or display name,
and returns the tattoo or display name that applies.
|
java.lang.String |
fixAwardDescription(AchievementLibrary.Achievement A,
AchievementLibrary.Award award,
MOB forM,
Tattooable forT) |
Returns a friendly description of the award, adjusting for the recipient, and
who the award was actually awarded to.
|
AchievementLibrary.Achievement |
getAchievement(java.lang.String tattoo) |
Returns the achievement with the given tattoo key.
|
java.lang.String |
getAchievementsHelp(java.lang.String ID) |
Searches for an Achievement of the given tattoo name or display name,
and returns a help entry for the achievement.
|
java.lang.String |
getAchievementsHelpFromMap(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> helpMap,
AchievementLibrary.Event E,
java.lang.String parmName) |
Given the comments/help entried from the achievement definition file, and an event,
and the name of the parameter inside the event, this returns the help entry for
that parameter
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
getAchievementsHelpMap() |
Returns all the comment/help entries from the achievement definition file
The map is of the form event ID, then parameter->help map.
|
java.lang.String |
getAwardString(AchievementLibrary.Award[] awards) |
Converts a parsed awards list back into an unparsed parameter/value string.
|
void |
grantAbilitiesAndExpertises(MOB mob) |
Typically called when a mob gains a level, to allow the achievements on the mob to
assign any new skills or expertises.
|
void |
loadAccountAchievements(MOB mob,
AchievementLibrary.AchievementLoadFlag flag) |
When a new player is created, this method inspects their account tattoos
for any that need to be passed down to this new player.
|
void |
loadClanAchievements(MOB mob,
AchievementLibrary.AchievementLoadFlag flag) |
When a new player added to a clan, this method inspects their clan tattoos
for any that need to be passed down to this new member.
|
void |
loadPlayerSkillAwards(Tattooable mob,
PlayerStats stats) |
When a player is loaded, this method inspects their tattoos for any past
achievements and, if found, loads the playerstats with trackable
skill and expertises mappings, allowing them to receive those awards when
the time is right.
|
void |
possiblyBumpAchievement(MOB mob,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
When an event occurs that might possible cause a player to have one of their achievements bumped,
this method is called with event specific parameters which might possibly cause the achievement
to be bumped in the tracker, which might cause it to be completed as well.
|
void |
reloadAchievements() |
Forces all achievements to be reloaded from the definition file.
|
void |
reloadPlayerAwards(MOB mob,
AchievementLibrary.AchievementLoadFlag flag) |
When a player remorts, they keep their player achievements, but the rewards
are removed.
|
java.lang.String |
removeClanAchievementAwards(MOB mob,
Clan clan) |
When a clan member is removed from his clan for any reason, this
method is called to remove any inhereted benefits, such as titles,
or abilities or expertises, etc.
|
void |
resaveAchievements(java.lang.String modifyTattoo) |
Forces any changed or deleted achievements to re-saved to
the definition file.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
static final java.lang.String[] BASE_ACHIEVEMENT_PARAMETERS
java.lang.String evaluateAchievement(AccountStats.Agent agent, java.lang.String row, boolean addIfPossible)
agent
- whether this is a player or accountrow
- the coded key=value pairs row.addIfPossible
- true if, on success, the new achievement is added, false otherwisevoid reloadAchievements()
boolean evaluatePlayerAchievements(MOB mob)
mob
- the player to evaluateboolean evaluateAccountAchievements(MOB mob)
mob
- the player whose account to evaluateboolean evaluateClanAchievements()
java.util.Enumeration<AchievementLibrary.Achievement> achievements(AccountStats.Agent agent)
agent
- the player, or account, or null for allAchievementLibrary.Achievement getAchievement(java.lang.String tattoo)
tattoo
- the tattoo key to find the achievement forAchievementLibrary.Achievement deleteAchievement(java.lang.String tattoo)
tattoo
- the tattoo key to find the achievement forvoid resaveAchievements(java.lang.String modifyTattoo)
modifyTattoo
- the tattoo modified or deletedboolean addModifyAchievement(MOB mob, AccountStats.Agent agent, java.lang.String tattoo, AchievementLibrary.Achievement A)
mob
- the mob adding or editing the achievementagent
- whether player or account achievementtattoo
- the tattoo of the new or old achievementA
- the achievement to modify, or null for newvoid possiblyBumpAchievement(MOB mob, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
mob
- the player whose achievement needs to be checkedE
- the event that occurredbumpNum
- the amount to bump the achievement byparms
- any event-specific argument that help determine whether a bump is warranted.void bumpAchievement(MOB mob, AchievementLibrary.Achievement A, int bumpNum, java.lang.Object... parms)
mob
- the mob who is bumping the achievementA
- the achievementbumpNum
- the amount to bump, plus or minusparms
- any event-specific argument that help determine whether a bump is warranted.java.util.List<AchievementLibrary.Achievement> fakeBumpAchievement(MOB mob, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
mob
- the player whose achievement needs to be checkedE
- the event that occurredbumpNum
- the amount to bump the achievement byparms
- any event-specific argument that help determine whether a bump is warranted.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getAchievementsHelpMap()
java.lang.String getAchievementsHelpFromMap(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> helpMap, AchievementLibrary.Event E, java.lang.String parmName)
helpMap
- the help mapE
- the event to get help forparmName
- the parameter of that event to get help forjava.lang.String getAwardString(AchievementLibrary.Award[] awards)
awards
- a parsed awards listvoid grantAbilitiesAndExpertises(MOB mob)
mob
- the mob to give abilities to.AbilityContainer.addAbility(Ability)
void loadPlayerSkillAwards(Tattooable mob, PlayerStats stats)
mob
- the tattooable mob to check tattoos onstats
- the playerstats to load with prizesgrantAbilitiesAndExpertises(MOB)
void loadAccountAchievements(MOB mob, AchievementLibrary.AchievementLoadFlag flag)
mob
- the new character to load up.flag
- the circumstances under which achievements are being loadedloadPlayerSkillAwards(Tattooable, PlayerStats)
void loadClanAchievements(MOB mob, AchievementLibrary.AchievementLoadFlag flag)
mob
- the new character to load up.flag
- the circumstances under which achievements are being loadedloadPlayerSkillAwards(Tattooable, PlayerStats)
void reloadPlayerAwards(MOB mob, AchievementLibrary.AchievementLoadFlag flag)
mob
- the mob to awardflag
- this is happening before or after stat selectionjava.lang.String getAchievementsHelp(java.lang.String ID)
ID
- the tattoo name or display namejava.lang.String findAchievementID(java.lang.String ID, boolean exact)
ID
- the tattoo name or display nameexact
- true for exact match only, false otherwisejava.lang.String fixAwardDescription(AchievementLibrary.Achievement A, AchievementLibrary.Award award, MOB forM, Tattooable forT)
A
- the achievement the award came fromaward
- the awardforM
- the recipient of the awardforT
- the earner of the award (mob, clan, etc...)java.lang.String removeClanAchievementAwards(MOB mob, Clan clan)
mob
- the evicted mobclan
- the clan evicted from