Documentation
¶
Overview ¶
Package unlock finds the follow-up quests that turning in a plan's quests makes available. The links come from the player's own Questie data (prerequisites, next-in-chain), from the dataset's quest_lines order when Questie is silent, and from unlocks observed in game. Nothing here guesses a giver or a position. The rules are in docs/plan-format.md.
Index ¶
Constants ¶
const ( EvAccepted = "accepted" EvTurnedIn = "turnedin" EvAbandoned = "abandoned" )
Event kinds in WoWCompanionDB.observed.events.
const DefaultDepth = 2
DefaultDepth is how many links ahead a plan looks.
const Env = "WOWC_OBSERVED_UNLOCKS"
Env names a file to use instead of the default path.
const LearnRadius = 12.0
LearnRadius is how close (map percent, same map) the acceptance must be to the turn-in.
const LearnWindow = 120
LearnWindow is the seconds after a turn-in within which an acceptance counts as unlocked by it.
const MaxEvents = 400
MaxEvents is the most events read; the newest are kept.
Variables ¶
This section is empty.
Functions ¶
func AddonSV ¶
AddonSV is the addon's SavedVariables file beside ForeverScribe.lua; empty when the path has no folder.
Types ¶
type Event ¶
type Event struct {
T int64
Kind string
QuestID int
Character string
Map int
X, Y float64
NPC string
OffPlan bool // an acceptance of a quest the plan did not list
}
Event is one entry of the addon's bounded observation log.
func ParseEvents ¶
ParseEvents reads WoWCompanionDB.observed.events out of a SavedVariables file's text. Entries with an unknown kind or no quest id are skipped; at most MaxEvents of the newest are returned, oldest first.
type Follow ¶
type Follow struct {
ID int
Depth int // 1: unlocked by a planned quest; 2: by a depth-1 follow-up
UnlockedBy []int // the turn-ins that unlock it, sorted
Chain string // the quest line's name, when known
Observed bool // the link or the start comes from an in-game observation
Start *Start // the observed start, when Questie does not give one
}
Follow is a quest the plan's turn-ins unlock.
func Find ¶
Find lists the follow-ups, shallowest first, then by quest id. A follow-up is kept only when every prerequisite is met by the planned turn-ins (or is done), its level fits the same band as an available quest, it is not exclusive with a planned or done quest, it is not a breadcrumb for a quest already done or planned, and its start is known.
type Input ¶
type Input struct {
Qx *questie.Index // may be nil: then only the lines and observations give links, and no quest can be named
Who questie.Who // Done and InLog are the facts at capture (with observed events applied)
Planned []int // quests whose turn-in the plan makes
Lines Lines // may be nil
Obs []Obs // learned unlocks, may be nil
Depth int // 0: DefaultDepth
OnMap int // keep a follow-up only when its giver stands on this map; 0: any
Skip func(name string) bool
}
Input is what Find needs.
type Lines ¶
Lines gives the quest after questID in its quest line (0 when none) and the line's name.
func FromDataset ¶
FromDataset reads quest_lines from ds; nil when ds is nil.
type Obs ¶
Obs is an unlock learned in game: after A was turned in, B was offered by NPC at the place.
type Store ¶
Store is the local file of observed unlocks. It stays on the player's machine.