Documentation
¶
Overview ¶
Package advice ranks what a captured character should do next. Every step names its source; a fact neither the capture nor the dataset holds is reported as unknown, never guessed. The rules are in docs/advice.md.
Index ¶
- Constants
- Variables
- func ByQuestOrder[T any](items []T, quest func(T) int, order []int) []T
- func IsClassQuest(s Step) bool
- func IsSpellQuest(s Step) bool
- func Render(c character.Character, steps []Step, total int) string
- func TalentTitle(c character.Character, ds store.DataStore, n int) string
- func TalentsKnown(t *character.Talents) bool
- func WhoOf(c character.Character) questie.Who
- type Available
- type MissedSpellQuest
- type SpellQuest
- type Step
Constants ¶
const ( KindTurnIn = "turn_in" KindQuest = "quest" KindTalent = "talent" KindProfession = "profession" KindGear = "gear" )
Step kinds.
const ( MaxBelow = 5 // a quest more than this far below is grey and skipped MaxAbove = 3 // a quest more than this far above is too hard and skipped )
Quest level window around the character's level.
const ( AvailBelow = 2 AvailAbove = 2 // MaxAvailable caps how many "Pick up" steps WhatsNext adds. MaxAvailable = 3 )
Level band for a quest the character has not picked up: the character's level -2 to +2.
const ( ClassQuestPrefix = "Class quest: pick up " ClassQuestNote = "Class quests often teach a core ability." // MaxClassQuests caps how many class quests lead the list (the prompt budget). MaxClassQuests = 3 )
Class quest wording. A class quest is a pick-up limited to the player's class (or a few classes).
const AbandonPrefix = "Abandon "
AbandonPrefix starts the title of the step for a failed quest.
const MaxLocated = 5
MaxLocated is how many quests in the log get a location from Questie (the prompt budget).
const PickUpPrefix = "Pick up: "
PickUpPrefix starts the title of a step for a quest that is not yet in the log.
const SpellQuestPrefix = "Pick up "
SpellQuestPrefix starts the title of a spell-quest pick-up step.
const TalentAsk = `ask "What talents should I get?"`
TalentAsk is the question that gets the player's talent picks.
Variables ¶
var SpellQuests = []SpellQuest{ {QuestID: 5658, Spell: "Touch of Weakness", Class: 5, Rank1: []int64{2652, 2943}}, }
SpellQuests is the curated table of quest-taught spells. Facts only, from the quest and spell pages on wowhead and warcraft.wiki. The quest's own level, race and giver come from the player's Questie. Add a row per class or racial quest that grants a spell.
Functions ¶
func ByQuestOrder ¶ added in v0.7.78
ByQuestOrder puts the items whose quest is in order into that order, each in a slot an on-route item held; everything else stays where it was. The panel's list and the answers' facts use it so they follow the route.
func IsClassQuest ¶ added in v0.7.0
IsClassQuest reports whether the step is a class quest pick-up.
func IsSpellQuest ¶ added in v0.7.89
IsSpellQuest reports whether the step is a spell-quest pick-up.
func TalentTitle ¶ added in v0.7.81
TalentTitle is the top line for n unspent class talent points: the build's next pick, net of the ranks already spent, or a hedge when the capture cannot say what is spent.
func TalentsKnown ¶ added in v0.7.81
TalentsKnown reports whether the capture lists what the character has already picked.
Types ¶
type Available ¶ added in v0.4.0
Available is the quests a character could pick up now. Unchecked names each rule the dataset could not support, so an empty list is never read as "nothing to pick up".
func AvailableQuests ¶ added in v0.4.0
AvailableQuests finds quests the character has not picked up but could: level within the band, class and race allowed, the previous step of its quest line completed, not completed, not in the log, not a DNT or deprecated placeholder, and in a zone the log already has quests in (the last-saved zone, or else the zones of the log's quests, is "nearby"). Ranked by level fit, then a shared quest line, then a shared zone. ds may be nil.
type MissedSpellQuest ¶ added in v0.7.89
type MissedSpellQuest struct {
SpellQuest
Quest *questie.Quest
Giver questie.Place
}
MissedSpellQuest is a spell quest the character can take, has not, and so lacks its spell.
func MissedSpellQuests ¶ added in v0.7.89
func MissedSpellQuests(c character.Character, qx *questie.Index) []MissedSpellQuest
MissedSpellQuests lists the spell quests the character is eligible for (class, race, level), whose spell is not known, and that are neither done nor in the log. It needs the capture's known spells and the player's Questie; without them it says nothing.
type SpellQuest ¶ added in v0.7.89
type SpellQuest struct {
QuestID int
Spell string
Class int // the game's class id
Rank1 []int64 // spell ids of Rank 1 (any of them known means the spell is learned)
}
SpellQuest is a spell whose first rank a quest teaches, not a trainer. Every later rank is then blocked at the trainer until the quest is done.
func QuestSpellFor ¶ added in v0.7.89
func QuestSpellFor(name string, class int) (SpellQuest, bool)
QuestSpellFor is the table row for a spell by name and class id.
type Step ¶
type Step struct {
Kind string `json:"kind"`
Title string `json:"title"`
Reason string `json:"reason"`
Zone string `json:"zone,omitempty"`
// Progress is the quest's objective progress, such as "Crab Season: 3/8 Crab Claws".
Progress string `json:"progress,omitempty"`
QuestID int `json:"quest_id,omitempty"`
// Location is where to go (an NPC or objective and its map percent), when the player's own
// Questie could place it.
Location string `json:"location,omitempty"`
Sources []string `json:"sources"`
// The structured parts of the step, for the digest; never part of the JSON the tools print.
Name string `json:"-"` // the quest's bare title
Level int `json:"-"` // the quest's level, 0 when unknown
NPC string `json:"-"` // the giver of a pick-up, or the turn-in NPC
Elite bool `json:"-"` // an elite or group quest
Points int `json:"-"` // unspent talent points, for a talent step
// A trip is a quest with nothing to do that is handed in elsewhere: Finisher, FinisherPlace and
// Instance (the dungeon, when the finisher is inside one) say where.
Trip bool `json:"-"`
Finisher string `json:"-"`
FinisherPlace string `json:"-"`
Instance string `json:"-"`
InstanceZone string `json:"-"` // the dungeon's zone
}
Step is one piece of advice.