|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AchievementLibrary
The achievement library forms the basis of the achievement system, which accepts player events as input, as well as the file based achievement definition files, and tracks player and account completion of achievements through trackers.
AchievementLibrary.Event
,
AchievementLibrary.Tracker
,
AchievementLibrary.Achievement
Nested Class Summary | |
---|---|
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.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.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. |
Field Summary | |
---|---|
static java.lang.String[] |
BASE_ACHIEVEMENT_PARAMETERS
The list of arguments/parameters common to all achievement event types |
Method Summary | |
---|---|
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. |
AchievementLibrary.Achievement |
deleteAchievement(java.lang.String tattoo)
Finds and deleted the achievement with teh given tattoo key. |
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 |
evaluateAchievements(MOB mob)
Iterates through all the 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. |
AchievementLibrary.Achievement |
getAchievement(java.lang.String tattoo)
Returns the achievement with the given tattoo key. |
java.lang.String |
getAchievementsHelp(java.lang.String ID,
boolean exact)
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 |
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 |
removeAwards(MOB mob,
AchievementLibrary.Award[] awardSet,
AchievementLibrary.AchievementLoadFlag flag)
When a player remorts, they lost their account achievement awards, which are restored later. |
void |
resaveAchievements(java.lang.String modifyTattoo)
Forces any changed or deleted achievements to re-saved to the definition file. |
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary |
---|
activate, getServiceClient, L, propertiesLoaded, shutdown |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, name, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
static final java.lang.String[] BASE_ACHIEVEMENT_PARAMETERS
Method Detail |
---|
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 achievment is added, false otherwise
void reloadAchievements()
boolean evaluateAchievements(MOB mob)
mob
- the player to evaluate
java.util.Enumeration<AchievementLibrary.Achievement> achievements(AccountStats.Agent agent)
agent
- the player, or account, or null for all
AchievementLibrary.Achievement getAchievement(java.lang.String tattoo)
tattoo
- the tattoo key to find the achievement for
AchievementLibrary.Achievement deleteAchievement(java.lang.String tattoo)
tattoo
- the tattoo key to find the achievement for
void 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 new
void 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.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 for
java.lang.String getAwardString(AchievementLibrary.Award[] awards)
awards
- a parsed awards list
void 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 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, boolean exact)
ID
- the tattoo name or display nameexact
- true for exact matches only, false for startswith
java.lang.String removeAwards(MOB mob, AchievementLibrary.Award[] awardSet, AchievementLibrary.AchievementLoadFlag flag)
mob
- the mob to lostawardSet
- the awards to removeflag
- whether this is happening before or after stat selection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |