Achievement : object
| [Previous] [Main] [Next] |
· | desc - Describe the achievement - this must display a string explaining the reason the points associated with this achievement were awarded. Note that this description can make use of the scoreCount information to show different descriptions depending on how many times the item has scored. For example, an achievement for finding various treasure items might want to display "finding a treasure" if only one treasure was found and "finding five treasures" if five were found. In some cases, it might be desirable to keep track of additional custom information, and use that information in generating the description. For example, the game might keep a list of treasures found with the achievement, adding to the list each time the achievement is scored, and displaying the contents of the list when the description is shown.
|
· | scoreCount - The number of times the achievement has been awarded. Each time the achievement is passed to addToScore(), this is incremented. Note that this is distinct from the number of points.
|
· | totalPoints - the number of points awarded for the achievement; if this achievement has been accomplished multiple times, this reflects the aggregate number of points awarded for all of the times it has been accomplished.
|
· | addToScoreOnce(points) - Add this achievement to the score one time only. This can be used to score an achievement without separately tracking whether or not the achievement has been accomplished previously. If the achievement has already been scored before, this will do nothing at all; otherwise, it'll score the achievement with the given number of points.
|
· | points - the number of points awarded for this Achievement if either its awardPoints or its awardPointsOnce method is called.
|
· | maxPoints - the maximum number of points that can be awarded for this Achievement if its points can be awarded for it more than once. By default this is simply the same as points. This figure is used by the library routine that calculates the maximum score.
|
· | awardPoints() - adds this Achievement to the list of Achievements accomplished, and awards the number of points contained in its points property (which must then be overridden to something other than nil).
|
· | awardPointsOnce() - this is the same as awardPoints, except that the points are awarded only the first time this method is called (so that you would typically use this method like addToScoreOnce, which it in fact calls, to ensure that the player is not awarded points multiple times for the same achievement).
|
enteringRoom(traveler)
|
{
|
darkEvents.curScriptState = 1;
|
if(!seen) addToScore(1, obstacleAchievement);
|
}
|