stats

package
v0.7.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
const (
	MaxInsights = 3
	MaxInsight  = 90
)

MaxInsights and MaxInsight bound what the player reads.

View Source
const (
	SourceCaptured = "captured" // the addon's recorded totals
	SourceGear     = "gear"     // derived: how many worn items carry each stat
	SourceNone     = "none"
)

Sources of the totals.

View Source
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.

View Source
const (
	RoleDamage = "damage"
	RoleTank   = "tank"
	RoleHealer = "healer"
)

Roles.

View Source
const (
	PrefBalanced = "balanced"
	PrefDamage   = "damage"
	PrefSurvival = "survival"
)

Stat preferences, stored with the play style.

View Source
const LowLevel = 20

LowLevel is the level below which the numbers are small and quest gear matters more than tuning.

Variables

View Source
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

func Adjust

func Adjust(weights map[string]float64, pref string) map[string]float64

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.

func ClassWord

func ClassWord(class string) string

ClassWord is "Warrior" for "WARRIOR".

func Classes

func Classes() []string

Classes are the class tokens the table covers.

func Name

func Name(stat string) string

Name is a stat as a player says it.

Types

type Prof

type Prof struct {
	Profile
	Weights map[string]float64 // after the stat preference
	Focus   string
}

Prof is a character's profile and its adjusted weights: the one source every feature reads.

func For

func For(c character.Character, group string) (Prof, bool)

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) Title

func (p Prof) Title() string

Title is "Fury · leveling".

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 ForClass

func ForClass(class string) (Profile, bool)

ForClass is the balanced fallback of a class.

func Lookup

func Lookup(class, spec, role string) (Profile, bool)

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.

func (Profile) Label

func (p Profile) Label() string

Label is the profile's short name: the spec, or the class for a fallback.

func (Profile) Reason

func (p Profile) Reason(stat string) string

Reason is the one-line plain reason a stat matters (or not) to a profile.

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.

func Check

func Check(c character.Character, ds store.DataStore, group string) Result

Check reads the character's stats against its play style's profile. group is the character's top talent group name ("" when unknown). ds may be nil: only recorded totals are then read.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL