professions

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 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 professions plans profession leveling and lists the materials worth keeping, from the dataset's recipes and recipe_reagents tables and the captured skills, bags and bank. The rules are in docs/professions.md.

Nothing is inferred: a recipe with no skill-up thresholds, a recipe with no reagent rows and a bank that was never captured are each reported as unknown.

Index

Constants

View Source
const (
	MinRecipes = 3
	MaxRecipes = 5
)

Plan sizes: the fewest and most recipes a plan lists.

View Source
const (
	Orange  = "orange"  // below the yellow threshold: always a skill-up
	Yellow  = "yellow"  // from the yellow threshold up to grey: still a skill-up
	Unknown = "unknown" // the dataset has no thresholds for the recipe
)

Difficulty of a recipe at the character's skill.

View Source
const KeepWindow = 50

KeepWindow is how many skill points above the character's skill a recipe may be learned and still count for the keep list.

Variables

View Source
var ErrNoRecipes = errors.New("the dataset has no recipes for the profession")

ErrNoRecipes is returned when the dataset has no recipes for a profession.

Functions

func FarMaterials

func FarMaterials(c character.Character, ds store.DataStore) map[int64][]string

FarMaterials returns the reagent item ids, with their professions, of recipes the character cannot learn for more than KeepWindow skill points: materials to bank, not to carry. A profession with no captured skill or no recipes in the dataset contributes nothing.

func Render

func Render(plans []Leveling) string

Render is the plain-text form of plans.

Types

type Keep

type Keep struct {
	ItemID      int64
	Name        string
	Count       int // bags plus bank
	Bags, Bank  int
	Professions []string
}

Keep is a bag or bank item that is a reagent for a recipe still worth making.

func KeepList

func KeepList(c character.Character, ds store.DataStore) ([]Keep, error)

KeepList returns the bag and bank items that are reagents of the character's professions, for recipes learnable within KeepWindow skill points of their current skill and not yet grey, most numerous first. It returns ErrNoRecipes when the dataset has no recipes for any of the professions (the caller then falls back to a guess); a profession whose skill was not captured is skipped.

type Leveling

type Leveling struct {
	Profession string
	Skill      *int
	Max        *int
	Steps      []Step
	BankKnown  bool     // false when the bank was never captured: Have counts bags only
	Notes      []string // everything unknown or missing, in plain words
}

Leveling is the leveling plan for one profession, the result of Plan.

func Plan

func Plan(c character.Character, ds store.DataStore, profession string) Leveling

Plan lists the next recipes that still give skill-ups for one profession, with what each needs and how much of it the bags and bank hold.

type Reagent

type Reagent struct {
	ItemID  int64
	Name    string
	Need    int
	Have    int
	Missing int
}

Reagent is one reagent of a planned recipe. Have counts bags and, when captured, bank.

type Recipe

type Recipe struct {
	SpellID     int64
	Name        string
	CreatesItem int64 // 0 when the recipe makes no item
	LearnSkill  *int
	YellowSkill *int
	GreySkill   *int
}

Recipe is the part of a recipes row the advisor uses. Rank fields are nil when unknown.

func Recipes

func Recipes(ds store.DataStore, profession string) ([]Recipe, error)

Recipes returns the profession's recipes from the dataset, once per spell, or ErrNoRecipes.

type Step

type Step struct {
	Recipe        Recipe
	CreatesName   string // empty when the recipe makes no item or the dataset has no name for it
	Difficulty    string
	Reagents      []Reagent
	ReagentsKnown bool // false when the dataset lists no reagents for the recipe
}

Step is one recipe in a plan.

func Select

func Select(recipes []Recipe, skill int) []Step

Select picks the recipes a character at skill should make next: those they can already learn (a recipe with no learn skill counts as learnable, and is noted), orange before yellow, and within a difficulty the highest learn skill first, then the lowest spell id. Recipes with no thresholds follow in the same learn-skill order; at most MaxRecipes are returned.

Jump to

Keyboard shortcuts

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