CMObject
, Tickable
, AchievementLibrary
, CMLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class Achievements extends StdLibrary implements AchievementLibrary
AchievementLibrary.AbilityAward, AchievementLibrary.Achievement, AchievementLibrary.AchievementFlag, AchievementLibrary.AchievementLoadFlag, AchievementLibrary.AmountAward, AchievementLibrary.Award, AchievementLibrary.AwardType, AchievementLibrary.CurrencyAward, AchievementLibrary.Event, AchievementLibrary.ExpertiseAward, AchievementLibrary.StatAward, AchievementLibrary.TattooAward, AchievementLibrary.TitleAward, AchievementLibrary.Tracker
BASE_ACHIEVEMENT_PARAMETERS
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
Achievements() |
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.
|
java.lang.String |
buildRow(AchievementLibrary.Event E,
java.util.Map<java.lang.String,java.lang.String> parmTree) |
|
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.
|
protected java.util.List<AchievementLibrary.Achievement> |
fakeBumpAccountAchievement(MOB mob,
AchievementLibrary.Achievement A,
PlayerAccount account,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
|
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.
|
protected java.util.List<AchievementLibrary.Achievement> |
fakeBumpClanAchievements(MOB mob,
AchievementLibrary.Achievement A,
java.lang.Iterable<Pair<Clan,java.lang.Integer>> clans,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
|
protected java.util.List<AchievementLibrary.Achievement> |
fakeBumpPlayerAchievement(MOB mob,
AchievementLibrary.Achievement A,
PlayerStats pStats,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
|
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.
|
protected void |
giveAwards(Clan clan,
AchievementLibrary.Award[] awardSet,
AchievementLibrary.AchievementLoadFlag flag) |
|
protected boolean |
giveAwards(AchievementLibrary.Achievement A,
Achievable able,
Tattooable holder,
MOB mob,
AchievementLibrary.AchievementLoadFlag flag) |
|
protected void |
giveAwards(MOB mob,
Clan forClan,
AchievementLibrary.Award[] awardSet,
AchievementLibrary.AchievementLoadFlag flag) |
|
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.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
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.
|
protected boolean |
loadClanAchievements(Clan clan,
MOB mob,
int clanRole,
AchievementLibrary.AchievementLoadFlag flag) |
|
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.
|
protected java.lang.String |
makeAchievementHelp(AchievementLibrary.Achievement A) |
|
protected void |
possiblyBumpAccountAchievement(MOB mob,
AchievementLibrary.Achievement A,
PlayerAccount account,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
|
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.
|
protected void |
possiblyBumpClanAchievement(MOB mob,
AchievementLibrary.Achievement A,
java.lang.Iterable<Pair<Clan,java.lang.Integer>> clans,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
|
protected void |
possiblyBumpPlayerAchievement(MOB mob,
AchievementLibrary.Achievement A,
PlayerStats pStats,
AchievementLibrary.Event E,
int bumpNum,
java.lang.Object... parms) |
|
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.
|
protected java.lang.String |
removeAwards(MOB mob,
Clan forClan,
AchievementLibrary.Achievement achievement) |
|
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.
|
boolean |
shutdown() |
Shuts down the library.
|
activate, getServiceClient, L, propertiesLoaded
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, tick
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public java.lang.String evaluateAchievement(AccountStats.Agent agent, java.lang.String row, boolean addIfPossible)
AchievementLibrary
evaluateAchievement
in interface AchievementLibrary
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 otherwisepublic java.util.Enumeration<AchievementLibrary.Achievement> achievements(AccountStats.Agent agent)
AchievementLibrary
achievements
in interface AchievementLibrary
agent
- the player, or account, or null for allprotected void possiblyBumpPlayerAchievement(MOB mob, AchievementLibrary.Achievement A, PlayerStats pStats, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
protected void possiblyBumpAccountAchievement(MOB mob, AchievementLibrary.Achievement A, PlayerAccount account, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
protected void possiblyBumpClanAchievement(MOB mob, AchievementLibrary.Achievement A, java.lang.Iterable<Pair<Clan,java.lang.Integer>> clans, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
public void bumpAchievement(MOB mob, AchievementLibrary.Achievement A, int bumpNum, java.lang.Object... parms)
AchievementLibrary
bumpAchievement
in interface AchievementLibrary
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.public void possiblyBumpAchievement(MOB mob, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
AchievementLibrary
possiblyBumpAchievement
in interface AchievementLibrary
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.protected java.util.List<AchievementLibrary.Achievement> fakeBumpPlayerAchievement(MOB mob, AchievementLibrary.Achievement A, PlayerStats pStats, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
protected java.util.List<AchievementLibrary.Achievement> fakeBumpAccountAchievement(MOB mob, AchievementLibrary.Achievement A, PlayerAccount account, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
protected java.util.List<AchievementLibrary.Achievement> fakeBumpClanAchievements(MOB mob, AchievementLibrary.Achievement A, java.lang.Iterable<Pair<Clan,java.lang.Integer>> clans, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
public java.util.List<AchievementLibrary.Achievement> fakeBumpAchievement(MOB mob, AchievementLibrary.Event E, int bumpNum, java.lang.Object... parms)
AchievementLibrary
fakeBumpAchievement
in interface AchievementLibrary
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.protected void giveAwards(MOB mob, Clan forClan, AchievementLibrary.Award[] awardSet, AchievementLibrary.AchievementLoadFlag flag)
protected void giveAwards(Clan clan, AchievementLibrary.Award[] awardSet, AchievementLibrary.AchievementLoadFlag flag)
public java.lang.String removeClanAchievementAwards(MOB mob, Clan clan)
AchievementLibrary
removeClanAchievementAwards
in interface AchievementLibrary
mob
- the evicted mobclan
- the clan evicted frompublic java.lang.String fixAwardDescription(AchievementLibrary.Achievement A, AchievementLibrary.Award award, MOB forM, Tattooable forT)
AchievementLibrary
fixAwardDescription
in interface AchievementLibrary
A
- the achievement the award came fromaward
- the awardforM
- the recipient of the awardforT
- the earner of the award (mob, clan, etc...)protected java.lang.String removeAwards(MOB mob, Clan forClan, AchievementLibrary.Achievement achievement)
protected boolean giveAwards(AchievementLibrary.Achievement A, Achievable able, Tattooable holder, MOB mob, AchievementLibrary.AchievementLoadFlag flag)
public AchievementLibrary.Achievement getAchievement(java.lang.String tattoo)
AchievementLibrary
getAchievement
in interface AchievementLibrary
tattoo
- the tattoo key to find the achievement forpublic AchievementLibrary.Achievement deleteAchievement(java.lang.String tattoo)
AchievementLibrary
deleteAchievement
in interface AchievementLibrary
tattoo
- the tattoo key to find the achievement forpublic 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)
AchievementLibrary
getAchievementsHelpFromMap
in interface AchievementLibrary
helpMap
- the help mapE
- the event to get help forparmName
- the parameter of that event to get help forpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getAchievementsHelpMap()
AchievementLibrary
getAchievementsHelpMap
in interface AchievementLibrary
public java.lang.String buildRow(AchievementLibrary.Event E, java.util.Map<java.lang.String,java.lang.String> parmTree)
public java.lang.String getAwardString(AchievementLibrary.Award[] awards)
AchievementLibrary
getAwardString
in interface AchievementLibrary
awards
- a parsed awards listpublic boolean addModifyAchievement(MOB mob, AccountStats.Agent agent, java.lang.String tattoo, AchievementLibrary.Achievement A)
AchievementLibrary
addModifyAchievement
in interface AchievementLibrary
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 newpublic void resaveAchievements(java.lang.String modifyTattoo)
AchievementLibrary
resaveAchievements
in interface AchievementLibrary
modifyTattoo
- the tattoo modified or deletedpublic boolean evaluatePlayerAchievements(MOB mob)
AchievementLibrary
evaluatePlayerAchievements
in interface AchievementLibrary
mob
- the player to evaluatepublic boolean evaluateAccountAchievements(MOB mob)
AchievementLibrary
evaluateAccountAchievements
in interface AchievementLibrary
mob
- the player whose account to evaluatepublic boolean evaluateClanAchievements()
AchievementLibrary
evaluateClanAchievements
in interface AchievementLibrary
public void reloadAchievements()
AchievementLibrary
reloadAchievements
in interface AchievementLibrary
public void grantAbilitiesAndExpertises(MOB mob)
AchievementLibrary
grantAbilitiesAndExpertises
in interface AchievementLibrary
mob
- the mob to give abilities to.AbilityContainer.addAbility(Ability)
public void loadPlayerSkillAwards(Tattooable mob, PlayerStats stats)
AchievementLibrary
loadPlayerSkillAwards
in interface AchievementLibrary
mob
- the tattooable mob to check tattoos onstats
- the playerstats to load with prizesAchievementLibrary.grantAbilitiesAndExpertises(MOB)
public void reloadPlayerAwards(MOB mob, AchievementLibrary.AchievementLoadFlag flag)
AchievementLibrary
reloadPlayerAwards
in interface AchievementLibrary
mob
- the mob to awardflag
- this is happening before or after stat selectionpublic void loadAccountAchievements(MOB mob, AchievementLibrary.AchievementLoadFlag flag)
AchievementLibrary
loadAccountAchievements
in interface AchievementLibrary
mob
- the new character to load up.flag
- the circumstances under which achievements are being loadedAchievementLibrary.loadPlayerSkillAwards(Tattooable, PlayerStats)
protected boolean loadClanAchievements(Clan clan, MOB mob, int clanRole, AchievementLibrary.AchievementLoadFlag flag)
public void loadClanAchievements(MOB mob, AchievementLibrary.AchievementLoadFlag flag)
AchievementLibrary
loadClanAchievements
in interface AchievementLibrary
mob
- the new character to load up.flag
- the circumstances under which achievements are being loadedAchievementLibrary.loadPlayerSkillAwards(Tattooable, PlayerStats)
protected java.lang.String makeAchievementHelp(AchievementLibrary.Achievement A)
public java.lang.String findAchievementID(java.lang.String ID, boolean exact)
AchievementLibrary
findAchievementID
in interface AchievementLibrary
ID
- the tattoo name or display nameexact
- true for exact match only, false otherwisepublic java.lang.String getAchievementsHelp(java.lang.String ID)
AchievementLibrary
getAchievementsHelp
in interface AchievementLibrary
ID
- the tattoo name or display namepublic boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()