Documentation
¶
Overview ¶
Package stats is the stat compass: per class, spec and role stat priorities (our own curated table), a plain-words stat check of a character against them, and the weights every other feature (upgrade ranking, Auction House suffixes) shares, so the advice agrees everywhere.
THE WEIGHTS ARE BALLPARK. They say how much a stat type matters to a play style, from 0 to 1, as a guide for a leveling or dungeon character, not a simulation. Players differ; the advice says so.
Index ¶
- Constants
- Variables
- func Adjust(weights map[string]float64, pref string) map[string]float64
- func ClassWord(class string) string
- func Classes() []string
- func Effects(t *character.Totals) map[string]string
- func Name(stat string) string
- func Verified(s Suffix, rows []store.Row) bool
- type Prof
- type Profile
- type Result
- type Suffix
Constants ¶
const ( NeedsPlayStyle = "play_style" Hook = "Choose a play style for a stat check" )
NeedsPlayStyle and Hook are ADV-093's structured answer for a character with no play style.
const ( MaxInsights = 3 MaxInsight = 120 )
MaxInsights and MaxInsight bound what the player reads.
const ( SourceCaptured = "captured" // the addon's recorded totals SourceGear = "gear" // derived: how many worn items carry each stat SourceNone = "none" )
Sources of the totals.
const ( Strength = "strength" Agility = "agility" Stamina = "stamina" Intellect = "intellect" Spirit = "spirit" Armor = "armor" Dodge = "dodge" Parry = "parry" Block = "block" AttackPower = "attack_power" Crit = "crit" )
Stat names, as the profile tables and the gear weights spell them.
const ( RoleDamage = "damage" RoleTank = "tank" RoleHealer = "healer" )
Roles.
const ( PrefBalanced = "balanced" PrefDamage = "damage" PrefSurvival = "survival" )
Stat preferences, stored with the play style.
const LowLevel = 20
LowLevel is the level below which the numbers are small and quest gear matters more than tuning.
Variables ¶
var Prefs = []struct{ Value, Label string }{ {PrefBalanced, "Balanced"}, {PrefDamage, "More damage"}, {PrefSurvival, "More survivability"}, }
Prefs are the allowed stat preferences with the words the player sees.
Primary are the stats an item carries and a total can be compared across.
var StatNames = map[int64]string{/* contains filtered or unexported fields */}
StatNames maps the dataset's stat type ids to stat names.
var Suffixes = []Suffix{ {"eagle", "of the Eagle", []int64{idStamina, idIntellect}, "Stamina + Intellect"}, {"owl", "of the Owl", []int64{idIntellect, idSpirit}, "Intellect + Spirit"}, {"whale", "of the Whale", []int64{idStamina, idSpirit}, "Stamina + Spirit"}, {"bear", "of the Bear", []int64{idStrength, idStamina}, "Strength + Stamina"}, {"tiger", "of the Tiger", []int64{idStrength, idAgility}, "Strength + Agility"}, {"monkey", "of the Monkey", []int64{idAgility, idStamina}, "Agility + Stamina"}, {"falcon", "of the Falcon", []int64{idAgility, idIntellect}, "Agility + Intellect"}, {"wolf", "of the Wolf", []int64{idAgility, idSpirit}, "Agility + Spirit"}, {"boar", "of the Boar", []int64{idStrength, idSpirit}, "Strength + Spirit"}, {"gorilla", "of the Gorilla", []int64{idStrength, idIntellect}, "Strength + Intellect"}, {"strength", "of Strength", []int64{idStrength}, "Strength"}, {"agility", "of Agility", []int64{idAgility}, "Agility"}, {"stamina", "of Stamina", []int64{idStamina}, "Stamina"}, {"intellect", "of Intellect", []int64{idIntellect}, "Intellect"}, {"spirit", "of Spirit", []int64{idSpirit}, "Spirit"}, }
Suffixes is every suffix the advice can name, in the order a tie falls back to.
Functions ¶
func Adjust ¶
Adjust returns the weights with a stat preference applied: "damage" lifts the damage stats and eases the survival ones, "survival" the reverse. Weights stay within 0 to 1, and the primary stat (the one the profile weights highest) always keeps the lead: a preference moves the other stats up or down next to it but never past it.
func Effects ¶ added in v0.7.56
Effects are the client's per-point numbers for a character, read from the addon's capture, one phrase per stat ("+0.06% spell crit a point"). Empty for a stat the capture has none for.
Types ¶
type Prof ¶
Prof is a character's profile and its adjusted weights: the one source every feature reads.
func For ¶
For is the profile and weights of a character with a play style; ok is false with none or for a class the table does not know. group is the character's top talent group, used when the play style names no spec.
func (Prof) Order ¶ added in v0.7.56
Order is the profile's priority: the stats that matter (weight at least fineWeight, the five primary stats and, for tanks, armor), highest weight first. The primary stat always leads (see Adjust); a tie keeps the table's order of the primary stats.
func (Prof) RankSuffixes ¶ added in v0.7.56
RankSuffixes orders the suffixes for a priority: only suffixes that carry the priority's lead stat, best first by the sum of the weights of the stats they give (so Stamina + Intellect beats Intellect + Spirit when Stamina outweighs Spirit, and a pair beats the single stat). A tie keeps the table order.
type Profile ¶
type Profile struct {
Class string // class token, "WARRIOR"
Spec string // tree name; empty for the class's fallback
Role string
Arch string // which reasons apply
Weights map[string]float64
}
Profile is one stat priority list.
func Lookup ¶
Lookup picks the profile for a class, a spec the player chose (a tree name, or a talent group name that contains one) and a role. The spec wins when it names a profile of the class; else the role's first profile; else the class's balanced fallback (its first profile). ok is false for a class the table does not know.
type Result ¶
type Result struct {
Needs string `json:"needs,omitempty" jsonschema:"play_style when the character has no play style; offer the choices"`
Hook string `json:"hook,omitempty"`
Profile string `json:"profile,omitempty" jsonschema:"for example 'Fury · leveling'"`
Insights []string `json:"insights,omitempty" jsonschema:"one to three plain sentences, ranked by impact"`
Asks []string `json:"asks,omitempty"`
// Internal: for the answer's reasoning and the report, never to be quoted as numbers.
Source string `json:"source,omitempty" jsonschema:"captured totals, gear-only (derived from worn items) or none"`
Lean map[string]float64 `json:"lean,omitempty" jsonschema:"per stat, how far the wanted share is above (positive) or below the share held; internal"`
Totals map[string]float64 `json:"totals,omitempty" jsonschema:"the numbers the check read; internal, never quote them"`
Swap []string `json:"swap,omitempty" jsonschema:"worn items that carry a stat the play style barely uses, to swap first"`
Weight map[string]float64 `json:"weights,omitempty" jsonschema:"the profile's stat weights after the preference; internal"`
// Priority is the stats in order, the primary stat first; Suffixes the item suffixes that fit, best first.
Priority []string `json:"priority,omitempty" jsonschema:"the stats that matter, the primary stat first; internal"`
Suffixes []string `json:"suffixes,omitempty" jsonschema:"item suffixes that fit the priority, best first, such as 'of the Eagle'"`
}
Result is a stat check. Insights are the player's words; Lean and the totals are internal.
type Suffix ¶ added in v0.7.56
Suffix is a random stat suffix of world-drop gear: its name, the stats it gives (the client's stat type ids) and the words for them. This is a curated game-fact table (the dataset holds item names and stat ids, not the suffix list); a suffix is only offered when the dataset holds an item with that name, and with those stats where the item's stats are known (see Verified).
func SuffixByKey ¶ added in v0.7.56
SuffixByKey is the suffix with the key, "eagle".