Documentation
¶
Index ¶
- func ApplyVtMPredatorType(predatorType string, stats map[string]any)
- func CanAffordAny(system string, currentXP int, statsJSON string) bool
- func CharacterOptions(system string) map[string][]string
- func CostRulesDescription(system string) string
- func FieldHints(system string) string
- func MinimumXPCost(system string) (int, bool)
- func RollStats(system, archetype string) map[string]any
- func RollStatsFromSchema(schemaJSON string) map[string]any
- func ValidFields(system string) []string
- func VtMInClanDisciplinesFor(clan string) ([]string, bool)
- func WGRecalcDerived(stats map[string]any, field string)
- func WGTalentCost(name string) int
- func WGTalentExists(name string) bool
- func XPCostFor(system, field string, newVal int, statsJSON string) int
- func XPKey(system string) string
- func XPLabel(system string) string
- type WGArchetypeView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyVtMPredatorType ¶
ApplyVtMPredatorType modifies a character stats map in-place with the grants for the named Predator Type. No-op if the type is not found.
func CanAffordAny ¶
CanAffordAny returns true if the character can afford at least one valid advancement for the system, given their current XP and stats. Pass statsJSON for VtM discipline checks. Returns false for coc and paranoia (no XP advancement).
func CharacterOptions ¶
CharacterOptions returns a map of field key → possible values for every chooseable (text/select) field in a given ruleset system. Fields whose values depend on another field (e.g. l5r family depends on clan) are omitted. Returns nil for unknown or fully-numeric systems.
func CostRulesDescription ¶
CostRulesDescription returns a brief human-readable summary of XP costs for a system.
func FieldHints ¶
FieldHints returns a string listing valid field keys for the system, suitable for injection into an AI prompt. This prevents the AI from guessing human-readable names (e.g. "ballistic_skill") instead of the actual JSON stat keys (e.g. "bs").
func MinimumXPCost ¶
MinimumXPCost returns the cheapest legal advancement threshold for a system. It is the shared eligibility floor; exact costs still come from XPCostFor.
func RollStats ¶
RollStats returns a map of randomly generated starting field values for the given ruleset system. Every schema field is populated — text fields are randomly chosen from canonical options. An unrecognised system returns an empty map.
If a system isn't handled by the switch below, RollStats falls back to reading "default" values from the schema_json if provided. This allows new rulesets to be added without Go code changes — just define defaults in the migration SQL.
func RollStatsFromSchema ¶
RollStatsFromSchema generates starting stats purely from schema_json field defaults. This allows adding new rulesets without any Go code changes. Fields with a "default" value use it directly; fields with "options" but no default pick randomly; everything else gets a zero/empty value.
func ValidFields ¶
ValidFields returns the list of advanceable field names for the given system. For talent advances (wrath_glory), the prefix "talent:" is used but talents are not enumerated here — use WGTalentExists to check a specific talent.
func VtMInClanDisciplinesFor ¶
VtMInClanDisciplinesFor returns the in-clan discipline field keys for a VtM clan. Lookup is case-insensitive. The second return value is false if the clan is not recognized. Caitiff returns an empty slice (all disciplines are out-of-clan for them).
func WGRecalcDerived ¶
WGRecalcDerived recalculates W&G derived stats that depend on the given field. stats is the full character stats map (modified in place). field is the attribute that was just advanced (e.g., "toughness"). Requires "archetype" key in stats to look up tier.
func WGTalentCost ¶
WGTalentCost returns the XP cost for a named W&G talent. Returns 20 (default) for unknown talent names.
func WGTalentExists ¶
WGTalentExists returns true if name is a known purchasable W&G talent. Archetype starting abilities (Fiery Invective, Psyker, etc.) return false.
func XPCostFor ¶
XPCostFor returns the XP cost for advancing field to newVal for the given system. statsJSON is required only for VtM discipline in/out-of-clan determination; pass "" otherwise. Returns 0 for systems where XP is threshold-based rather than spent (dnd5e level-up).
Types ¶
type WGArchetypeView ¶
type WGArchetypeView struct {
// contains filtered or unexported fields
}
WGArchetypeView is an exported view of a wgArchetypeDef for use outside this package.
func WGArchetypeDefFor ¶
func WGArchetypeDefFor(name string) (WGArchetypeView, bool)
WGArchetypeDefFor looks up the W&G archetype definition for the given name. Returns an exported WGArchetypeView and true if found, or zero-value and false if not found.
func (WGArchetypeView) Abilities ¶
func (v WGArchetypeView) Abilities() []string
Abilities returns the archetype's starting abilities (free, cannot be repurchased).