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 ¶
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 = 90 )
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.
Functions ¶
Types ¶
type Prof ¶
Prof is a character's profile and its adjusted weights: the one source every feature reads.
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"`
}
Result is a stat check. Insights are the player's words; Lean and the totals are internal.