Documentation ¶
Index ¶
- Constants
- Variables
- func AcceptableExtensions() []string
- func AdjustTechLevel(str string, delta fxp.Int) (s string, changed bool)
- func AdjustedPoints(entity *Entity, trait *Trait, canLevel bool, ...) fxp.Int
- func AdjustedPointsForNonContainerSkillOrTechnique(e *Entity, points fxp.Int, name, specialization string, tags []string, ...) fxp.Int
- func AdjustedPointsForNonContainerSpell(e *Entity, points fxp.Int, name, powerSource string, colleges, tags []string, ...) fxp.Int
- func AppendBufferOntoNewLine(to, from LineBuilder)
- func AppendStringOntoNewLine(to LineBuilder, from string)
- func AttributeChoices(entity *Entity, prefix string, flags AttributeFlags, currentKey string) (choices []*AttributeChoice, current *AttributeChoice)
- func AttributeIDFor(entity *Entity, preferred string) string
- func ChooseWeightedStringOption(options []*WeightedStringOption, not string) string
- func CombineTags(tags []string) string
- func Convert(paths ...string) error
- func CostMultiplierForTraitModifier(baseLevels fxp.Int, trait *Trait, useLevelFromTrait bool) fxp.Int
- func CountPrereqsForSpell(spell *Spell, availableSpells []*Spell, nonSpellsCountAs int, ...) int
- func CountThresholdOpMet(op threshold.Op, attributes *Attributes) int
- func CreateFullKeySet() map[string]bool
- func DeepSearchableExtensions() []string
- func DefaultAttributeIDFor(entity *Entity) string
- func DefaultMasterLibraryPath() string
- func DefaultRootLibraryPath() string
- func DefaultTypeIsSkillBased(skillDefaultType string) bool
- func DefaultUserLibraryPath() string
- func Export(entity *Entity, templatePath, exportPath string) error
- func ExportSheets(templatePath string, fileList []string) error
- func ExtendedWeightAdjustedForModifiers(equipment *Equipment, defUnits fxp.WeightUnit, qty fxp.Int, ...) fxp.Weight
- func ExtractContainedWeightReduction(s string, defUnits fxp.WeightUnit) (string, error)
- func ExtractTags(tags string) []string
- func ExtractTechLevel(str string) (techLevel fxp.Int, start, end int)
- func FormatRelativeSkill(e *Entity, numOnly bool, diff AttributeDifficulty, rsl fxp.Int) string
- func GCSExtensions() []string
- func GCSSecondaryExtensions() []string
- func HasTag(tag string, tags []string) bool
- func HasText(has bool) string
- func Hash64(in Hashable) uint64
- func IDForNavNode(fullPath string, kind byte) tid.TID
- func IDForPDFTOC(pdfPath, title string, pageNum int) tid.TID
- func IncludesModifiersFrom() string
- func InstallEvaluatorFunctions(m map[string]eval.Function)
- func InvalidFileData() string
- func IsNodeOpen(node Openable) bool
- func IsThresholdOpMet(op threshold.Op, attributes *Attributes) bool
- func LibSrcTooltip() string
- func ModifierEnabledTooltip() string
- func MultiplierForEquipmentModifier(equipment *Equipment, isPerLevel bool) fxp.Int
- func NoAdditionalModifiers() string
- func NodesToHashesByID[T NodeTypes](result map[tid.TID]HashAndData, data ...T)
- func PageRefTooltip() string
- func RegisterKeyBinding(id string, action *unison.Action)
- func RegisteredMimeTypes() []string
- func ReplaceTechLevel(str string, value fxp.Int) string
- func ResolveAttributeName(entity *Entity, attribute string) string
- func ResolveStudyHours(s []*Study) fxp.Int
- func SanitizeDockableGroups(groups []dgroup.Group) []dgroup.Group
- func SanitizeID(id string, permitLeadingDigits bool, reserved ...string) string
- func SaveEquipment(equipment []*Equipment, filePath string) error
- func SaveEquipmentModifiers(modifiers []*EquipmentModifier, filePath string) error
- func SaveNotes(notes []*Note, filePath string) error
- func SaveSkills(skills []*Skill, filePath string) error
- func SaveSpells(spells []*Spell, filePath string) error
- func SaveTraitModifiers(modifiers []*TraitModifier, filePath string) error
- func SaveTraits(traits []*Trait, filePath string) error
- func SetNodeOpen(node Openable, open bool) bool
- func StudyHoursProgressText(hours fxp.Int, needed study.Level, force bool) string
- func SyncSheetsAndTemplates(paths ...string) error
- func TechLevelInfo() string
- func ToColumnCutoff(in int64) float32
- func Traverse[T NodeTypes](f func(T) bool, onlyEnabled, excludeContainers bool, in ...T)
- func ValueAdjustedForModifiers(equipment *Equipment, value fxp.Int, modifiers []*EquipmentModifier) fxp.Int
- func WeaponSVG(melee bool) *unison.SVG
- func WeightAdjustedForModifiers(equipment *Equipment, weight fxp.Weight, modifiers []*EquipmentModifier, ...) fxp.Weight
- type Ancestry
- func (a *Ancestry) GenderedOptions(gender string) *AncestryOptions
- func (a *Ancestry) RandomAge(resolver eval.VariableResolver, gender string, not int) int
- func (a *Ancestry) RandomEyes(gender, not string) string
- func (a *Ancestry) RandomGender(not string) string
- func (a *Ancestry) RandomHair(gender, not string) string
- func (a *Ancestry) RandomHandedness(gender, not string) string
- func (a *Ancestry) RandomHeight(resolver eval.VariableResolver, gender string, not fxp.Length) fxp.Length
- func (a *Ancestry) RandomName(nameGeneratorRefs []*NameGeneratorRef, gender string) string
- func (a *Ancestry) RandomSkin(gender, not string) string
- func (a *Ancestry) RandomWeight(resolver eval.VariableResolver, gender string, not fxp.Weight) fxp.Weight
- func (a *Ancestry) Save(filePath string) error
- type AncestryOptions
- func (o *AncestryOptions) RandomAge(resolver eval.VariableResolver, not int) int
- func (o *AncestryOptions) RandomEye(not string) string
- func (o *AncestryOptions) RandomHair(not string) string
- func (o *AncestryOptions) RandomHandedness(not string) string
- func (o *AncestryOptions) RandomHeight(resolver eval.VariableResolver, not fxp.Length) fxp.Length
- func (o *AncestryOptions) RandomName(nameGeneratorRefs []*NameGeneratorRef) string
- func (o *AncestryOptions) RandomSkin(not string) string
- func (o *AncestryOptions) RandomWeight(resolver eval.VariableResolver, not fxp.Weight) fxp.Weight
- type Attribute
- func (a *Attribute) AttributeDef() *AttributeDef
- func (a *Attribute) Clone(entity *Entity) *Attribute
- func (a *Attribute) Current() fxp.Int
- func (a *Attribute) CurrentThreshold() *PoolThreshold
- func (a *Attribute) Hash(h hash.Hash)
- func (a *Attribute) ID() string
- func (a *Attribute) MarshalJSON() ([]byte, error)
- func (a *Attribute) Maximum() fxp.Int
- func (a *Attribute) PointCost() fxp.Int
- func (a *Attribute) SetID(value string)
- func (a *Attribute) SetMaximum(value fxp.Int)
- func (a *Attribute) UnmarshalJSON(data []byte) error
- type AttributeBonus
- func (a *AttributeBonus) ActualLimitation() stlimit.Option
- func (a *AttributeBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (a *AttributeBonus) Clone() Feature
- func (a *AttributeBonus) FeatureType() feature.Type
- func (a *AttributeBonus) FillWithNameableKeys(_, _ map[string]string)
- func (a *AttributeBonus) Hash(h hash.Hash)
- func (a *AttributeBonus) SetLevel(level fxp.Int)
- type AttributeChoice
- type AttributeData
- type AttributeDef
- func (a *AttributeDef) AllowsDecimal() bool
- func (a *AttributeDef) BaseValue(resolver eval.VariableResolver) fxp.Int
- func (a *AttributeDef) Clone() *AttributeDef
- func (a *AttributeDef) CombinedName() string
- func (a *AttributeDef) ComputeCost(entity *Entity, value, costReduction fxp.Int, sizeModifier int) fxp.Int
- func (a *AttributeDef) Hash(h hash.Hash)
- func (a *AttributeDef) ID() string
- func (a *AttributeDef) IsSeparator() bool
- func (a *AttributeDef) MarshalJSON() ([]byte, error)
- func (a *AttributeDef) Pool() bool
- func (a *AttributeDef) Primary() bool
- func (a *AttributeDef) ResolveFullName() string
- func (a *AttributeDef) Secondary() bool
- func (a *AttributeDef) SetID(value string)
- func (a *AttributeDef) UnmarshalJSON(data []byte) error
- type AttributeDefData
- type AttributeDefs
- func (a *AttributeDefs) Clone() *AttributeDefs
- func (a *AttributeDefs) Hash(h hash.Hash)
- func (a *AttributeDefs) List(omitSeparators bool) []*AttributeDef
- func (a *AttributeDefs) MarshalJSON() ([]byte, error)
- func (a *AttributeDefs) ResetTargetKeyPrefixes(prefixProvider func() string)
- func (a *AttributeDefs) Save(filePath string) error
- func (a *AttributeDefs) UnmarshalJSON(data []byte) error
- type AttributeDifficulty
- func (a *AttributeDifficulty) Description(entity *Entity) string
- func (a *AttributeDifficulty) Hash(h hash.Hash)
- func (a *AttributeDifficulty) Key() string
- func (a *AttributeDifficulty) MarshalJSON() ([]byte, error)
- func (a *AttributeDifficulty) Normalize(entity *Entity)
- func (a AttributeDifficulty) ShouldOmit() bool
- func (a *AttributeDifficulty) UnmarshalJSON(data []byte) error
- type AttributeFlags
- type AttributePrereq
- func (p *AttributePrereq) Clone(parent *PrereqList) Prereq
- func (p *AttributePrereq) FillWithNameableKeys(_, _ map[string]string)
- func (p *AttributePrereq) Hash(h hash.Hash)
- func (p *AttributePrereq) ParentList() *PrereqList
- func (p *AttributePrereq) PrereqType() prereq.Type
- func (p *AttributePrereq) Satisfied(entity *Entity, _ any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type Attributes
- func (a *Attributes) Clone(entity *Entity) *Attributes
- func (a *Attributes) Cost(attrID string) fxp.Int
- func (a *Attributes) Current(attrID string) fxp.Int
- func (a *Attributes) Hash(h hash.Hash)
- func (a *Attributes) List() []*Attribute
- func (a *Attributes) MarshalJSON() ([]byte, error)
- func (a *Attributes) Maximum(attrID string) fxp.Int
- func (a *Attributes) PoolThreshold(attrID, state string) fxp.Int
- func (a *Attributes) UnmarshalJSON(data []byte) error
- type Binding
- type BlockLayout
- func (b *BlockLayout) ByRow() [][]string
- func (b *BlockLayout) Clone() *BlockLayout
- func (b *BlockLayout) EnsureValidity()
- func (b *BlockLayout) HTMLGridTemplate() string
- func (b *BlockLayout) MarshalJSON() ([]byte, error)
- func (b *BlockLayout) Reset()
- func (b *BlockLayout) String() string
- func (b *BlockLayout) UnmarshalJSON(data []byte) error
- type Body
- func (b *Body) AddLocation(loc *HitLocation)
- func (b *Body) Clone(entity *Entity, owningLocation *HitLocation) *Body
- func (b *Body) Hash(h hash.Hash)
- func (b *Body) LookupLocationByID(entity *Entity, idStr string) *HitLocation
- func (b *Body) MarshalJSON() ([]byte, error)
- func (b *Body) OwningLocation() *HitLocation
- func (b *Body) RemoveLocation(loc *HitLocation)
- func (b *Body) ResetTargetKeyPrefixes(prefixProvider func() string)
- func (b *Body) Rewrap()
- func (b *Body) Save(filePath string) error
- func (b *Body) SetOwningLocation(loc *HitLocation)
- func (b *Body) UniqueHitLocations(entity *Entity) []*HitLocation
- func (b *Body) UnmarshalJSON(data []byte) error
- func (b *Body) Update(entity *Entity)
- type BodyData
- type Bonus
- type BonusOwner
- type CalendarRef
- type Campaign
- type CampaignData
- type CellData
- type CollegeList
- type ConditionalModifier
- func (c *ConditionalModifier) Add(source string, amt fxp.Int)
- func (c *ConditionalModifier) ApplyNameableKeys(_ map[string]string)
- func (c *ConditionalModifier) CellData(columnID int, data *CellData)
- func (c *ConditionalModifier) ClearSource()
- func (c *ConditionalModifier) Clone(_ LibraryFile, _ DataOwner, _ *ConditionalModifier, preserveID bool) *ConditionalModifier
- func (c *ConditionalModifier) Compare(other *ConditionalModifier) int
- func (c *ConditionalModifier) Container() bool
- func (c *ConditionalModifier) DataOwner() DataOwner
- func (c *ConditionalModifier) Enabled() bool
- func (c *ConditionalModifier) FillWithNameableKeys(_, _ map[string]string)
- func (c *ConditionalModifier) GetSource() Source
- func (c *ConditionalModifier) HasChildren() bool
- func (c *ConditionalModifier) Hash(h hash.Hash)
- func (c *ConditionalModifier) ID() tid.TID
- func (c *ConditionalModifier) IsOpen() bool
- func (c *ConditionalModifier) Kind() string
- func (c *ConditionalModifier) NameableReplacements() map[string]string
- func (c *ConditionalModifier) NodeChildren() []*ConditionalModifier
- func (c *ConditionalModifier) Parent() *ConditionalModifier
- func (c *ConditionalModifier) SetChildren(_ []*ConditionalModifier)
- func (c *ConditionalModifier) SetDataOwner(_ DataOwner)
- func (c *ConditionalModifier) SetOpen(_ bool)
- func (c *ConditionalModifier) SetParent(_ *ConditionalModifier)
- func (c *ConditionalModifier) String() string
- func (c *ConditionalModifier) SyncWithSource()
- func (c *ConditionalModifier) Total() fxp.Int
- type ConditionalModifierBonus
- func (c *ConditionalModifierBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (c *ConditionalModifierBonus) Clone() Feature
- func (c *ConditionalModifierBonus) FeatureType() feature.Type
- func (c *ConditionalModifierBonus) FillWithNameableKeys(m, existing map[string]string)
- func (c *ConditionalModifierBonus) Hash(h hash.Hash)
- func (c *ConditionalModifierBonus) SetLevel(level fxp.Int)
- type ConditionalModifierListProvider
- type ContainedQuantityPrereq
- func (p *ContainedQuantityPrereq) Clone(parent *PrereqList) Prereq
- func (p *ContainedQuantityPrereq) FillWithNameableKeys(_, _ map[string]string)
- func (p *ContainedQuantityPrereq) Hash(h hash.Hash)
- func (p *ContainedQuantityPrereq) ParentList() *PrereqList
- func (p *ContainedQuantityPrereq) PrereqType() prereq.Type
- func (p *ContainedQuantityPrereq) Satisfied(_ *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type ContainedWeightPrereq
- func (p *ContainedWeightPrereq) Clone(parent *PrereqList) Prereq
- func (p *ContainedWeightPrereq) FillWithNameableKeys(_, _ map[string]string)
- func (p *ContainedWeightPrereq) Hash(h hash.Hash)
- func (p *ContainedWeightPrereq) ParentList() *PrereqList
- func (p *ContainedWeightPrereq) PrereqType() prereq.Type
- func (p *ContainedWeightPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type ContainedWeightReduction
- func (c *ContainedWeightReduction) Clone() Feature
- func (c *ContainedWeightReduction) FeatureType() feature.Type
- func (c *ContainedWeightReduction) FillWithNameableKeys(_, _ map[string]string)
- func (c *ContainedWeightReduction) FixedReduction(defUnits fxp.WeightUnit) fxp.Weight
- func (c *ContainedWeightReduction) Hash(h hash.Hash)
- func (c *ContainedWeightReduction) IsPercentageReduction() bool
- func (c *ContainedWeightReduction) PercentageReduction() fxp.Int
- type CostReduction
- type DRBonus
- func (d *DRBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (d *DRBonus) Clone() Feature
- func (d *DRBonus) FeatureType() feature.Type
- func (d *DRBonus) FillWithNameableKeys(_, _ map[string]string)
- func (d *DRBonus) Hash(h hash.Hash)
- func (d *DRBonus) MarshalJSON() ([]byte, error)
- func (d *DRBonus) Normalize()
- func (d *DRBonus) SetLevel(level fxp.Int)
- func (d *DRBonus) UnmarshalJSON(data []byte) error
- type DRBonusData
- type DataOwner
- type DataOwnerProvider
- type Document
- type EditorData
- type Entity
- func (e *Entity) AddDRBonusesFor(locationID string, tooltip *xio.ByteBuffer, drMap map[string]int) map[string]int
- func (e *Entity) AddNamedWeaponBonusesFor(nameQualifier, usageQualifier string, tagsQualifier []string, dieCount int, ...) map[*WeaponBonus]bool
- func (e *Entity) AddWeaponWithSkillBonusesFor(name, specialization, usage string, tags []string, dieCount int, ...) map[*WeaponBonus]bool
- func (e *Entity) Ancestry() *Ancestry
- func (e *Entity) AttributeBonusFor(attributeID string, limitation stlimit.Option, tooltip *xio.ByteBuffer) fxp.Int
- func (e *Entity) BasicLift() fxp.Weight
- func (e *Entity) BasicLiftForST(st fxp.Int) fxp.Weight
- func (e *Entity) BestSkillNamed(name, specialization string, requirePoints bool, excludes map[string]bool) *Skill
- func (e *Entity) CarriedEquipmentList() []*Equipment
- func (e *Entity) CarryOnBack() fxp.Weight
- func (e *Entity) ConditionalModifiers() []*ConditionalModifier
- func (e *Entity) CostReductionFor(attributeID string) fxp.Int
- func (e *Entity) DataOwner() DataOwner
- func (e *Entity) DiscardCaches()
- func (e *Entity) Dodge(enc encumbrance.Level) int
- func (e *Entity) EmbeddedEval(s string) string
- func (e *Entity) EncumbranceLevel(forSkills bool) encumbrance.Level
- func (e *Entity) Entity() *Entity
- func (e *Entity) EquippedWeapons(melee bool) []*Weapon
- func (e *Entity) Hash(h hash.Hash)
- func (e *Entity) LiftingStrength() fxp.Int
- func (e *Entity) LiftingSwing() *dice.Dice
- func (e *Entity) LiftingThrust() *dice.Dice
- func (e *Entity) MarshalJSON() ([]byte, error)
- func (e *Entity) MaximumCarry(enc encumbrance.Level) fxp.Weight
- func (e *Entity) Move(enc encumbrance.Level) int
- func (e *Entity) NamedWeaponSkillBonusesFor(name, usage string, tags []string, tooltip *xio.ByteBuffer) []*SkillBonus
- func (e *Entity) NoteList() []*Note
- func (e *Entity) OneHandedLift() fxp.Weight
- func (e *Entity) OtherEquipmentList() []*Equipment
- func (e *Entity) OwningEntity() *Entity
- func (e *Entity) PointsBreakdown() *PointsBreakdown
- func (e *Entity) PreservesUserDesc() bool
- func (e *Entity) Reactions() []*ConditionalModifier
- func (e *Entity) Recalculate()
- func (e *Entity) ResolveAttribute(attrID string) *Attribute
- func (e *Entity) ResolveAttributeCurrent(attrID string) fxp.Int
- func (e *Entity) ResolveAttributeDef(attrID string) *AttributeDef
- func (e *Entity) ResolveAttributeName(attrID string) string
- func (e *Entity) ResolveVariable(variableName string) string
- func (e *Entity) RunningShoveAndKnockOver() fxp.Weight
- func (e *Entity) Save(filePath string) error
- func (e *Entity) SetCarriedEquipmentList(list []*Equipment)
- func (e *Entity) SetNoteList(list []*Note)
- func (e *Entity) SetOtherEquipmentList(list []*Equipment)
- func (e *Entity) SetPointsRecord(record []*PointsRecord)
- func (e *Entity) SetSkillList(list []*Skill)
- func (e *Entity) SetSpellList(list []*Spell)
- func (e *Entity) SetTraitList(list []*Trait)
- func (e *Entity) SetUnspentPoints(unspent fxp.Int)
- func (e *Entity) SetWeapons(_ bool, _ []*Weapon)
- func (e *Entity) ShiftSlightly() fxp.Weight
- func (e *Entity) ShoveAndKnockOver() fxp.Weight
- func (e *Entity) SkillBonusFor(name, specialization string, tags []string, tooltip *xio.ByteBuffer) fxp.Int
- func (e *Entity) SkillList() []*Skill
- func (e *Entity) SkillNamed(name, specialization string, requirePoints bool, excludes map[string]bool) []*Skill
- func (e *Entity) SkillPointBonusFor(name, specialization string, tags []string, tooltip *xio.ByteBuffer) fxp.Int
- func (e *Entity) SourceMatcher() *SrcMatcher
- func (e *Entity) SpellBonusFor(name, powerSource string, colleges, tags []string, tooltip *xio.ByteBuffer) fxp.Int
- func (e *Entity) SpellList() []*Spell
- func (e *Entity) SpellPointBonusFor(name, powerSource string, colleges, tags []string, tooltip *xio.ByteBuffer) fxp.Int
- func (e *Entity) StrikingStrength() fxp.Int
- func (e *Entity) Swing() *dice.Dice
- func (e *Entity) SwingFor(st int) *dice.Dice
- func (e *Entity) SyncWithLibrarySources()
- func (e *Entity) TelekineticStrength() fxp.Int
- func (e *Entity) ThrowingStrength() fxp.Int
- func (e *Entity) Thrust() *dice.Dice
- func (e *Entity) ThrustFor(st int) *dice.Dice
- func (e *Entity) TraitList() []*Trait
- func (e *Entity) TwoHandedLift() fxp.Weight
- func (e *Entity) UnmarshalJSON(data []byte) error
- func (e *Entity) UnspentPoints() fxp.Int
- func (e *Entity) UpdateSkills() bool
- func (e *Entity) UpdateSpells() bool
- func (e *Entity) WealthCarried() fxp.Int
- func (e *Entity) WealthNotCarried() fxp.Int
- func (e *Entity) WeaponOwner() WeaponOwner
- func (e *Entity) Weapons(melee bool) []*Weapon
- func (e *Entity) WeightCarried(forSkills bool) fxp.Weight
- type EntityData
- type Equipment
- func (e *Equipment) ActiveModifierFor(name string) *EquipmentModifier
- func (e *Equipment) AdjustedValue() fxp.Int
- func (e *Equipment) AdjustedWeight(forSkills bool, defUnits fxp.WeightUnit) fxp.Weight
- func (e *Equipment) ApplyNameableKeys(m map[string]string)
- func (e *Equipment) CanConvertToFromContainer() bool
- func (e *Equipment) CellData(columnID int, data *CellData)
- func (e *Equipment) ClearSource()
- func (e *Equipment) ClearUnusedFieldsForType()
- func (e *Equipment) Clone(from LibraryFile, owner DataOwner, parent *Equipment, preserveID bool) *Equipment
- func (e *Equipment) Container() bool
- func (e *Equipment) ConvertToContainer()
- func (e *Equipment) ConvertToNonContainer()
- func (e *Equipment) CurrentLevel() fxp.Int
- func (e *Equipment) DataOwner() DataOwner
- func (e *Equipment) Depth() int
- func (e *Equipment) Description() string
- func (e *Equipment) DisplayLegalityClass() string
- func (e *Equipment) Enabled() bool
- func (e *Equipment) ExtendedValue() fxp.Int
- func (e *Equipment) ExtendedWeight(forSkills bool, defUnits fxp.WeightUnit) fxp.Weight
- func (e *Equipment) FeatureList() Features
- func (e *Equipment) FillWithNameableKeys(m, existing map[string]string)
- func (e *Equipment) GetSource() Source
- func (e *Equipment) HasChildren() bool
- func (e *Equipment) Hash(h hash.Hash)
- func (e *Equipment) ID() tid.TID
- func (e *Equipment) IsLeveled() bool
- func (e *Equipment) IsOpen() bool
- func (e *Equipment) Kind() string
- func (e *Equipment) LocalNotesWithReplacements() string
- func (e *Equipment) MarshalJSON() ([]byte, error)
- func (e *Equipment) ModifierNotes() string
- func (e *Equipment) NameWithReplacements() string
- func (e *Equipment) NameableReplacements() map[string]string
- func (e *Equipment) NodeChildren() []*Equipment
- func (e *Equipment) Notes() string
- func (e *Equipment) Parent() *Equipment
- func (e *Equipment) RatedStrength() fxp.Int
- func (e *Equipment) RequiresTL() bool
- func (e *Equipment) SecondaryText(optionChecker func(display.Option) bool) string
- func (e *Equipment) SetChildren(children []*Equipment)
- func (e *Equipment) SetDataOwner(owner DataOwner)
- func (e *Equipment) SetOpen(open bool)
- func (e *Equipment) SetParent(parent *Equipment)
- func (e *Equipment) SetTL(tl string)
- func (e *Equipment) String() string
- func (e *Equipment) SyncWithSource()
- func (e *Equipment) TL() string
- func (e *Equipment) TagList() []string
- func (e *Equipment) UnmarshalJSON(data []byte) error
- type EquipmentData
- type EquipmentEditData
- type EquipmentListProvider
- type EquipmentModifier
- func (e *EquipmentModifier) ApplyNameableKeys(m map[string]string)
- func (e *EquipmentModifier) CellData(columnID int, data *CellData)
- func (e *EquipmentModifier) ClearSource()
- func (e *EquipmentModifier) ClearUnusedFieldsForType()
- func (e *EquipmentModifier) Clone(from LibraryFile, owner DataOwner, parent *EquipmentModifier, preserveID bool) *EquipmentModifier
- func (e *EquipmentModifier) Container() bool
- func (e *EquipmentModifier) CostDescription() string
- func (e *EquipmentModifier) CostMultiplier() fxp.Int
- func (e *EquipmentModifier) DataOwner() DataOwner
- func (e *EquipmentModifier) Depth() int
- func (e *EquipmentModifier) Enabled() bool
- func (e *EquipmentModifier) FillWithNameableKeys(m, existing map[string]string)
- func (e *EquipmentModifier) FullCostDescription() string
- func (e *EquipmentModifier) FullDescription() string
- func (e *EquipmentModifier) GetSource() Source
- func (e *EquipmentModifier) HasChildren() bool
- func (e *EquipmentModifier) Hash(h hash.Hash)
- func (e *EquipmentModifier) ID() tid.TID
- func (e *EquipmentModifier) IsOpen() bool
- func (e *EquipmentModifier) Kind() string
- func (e *EquipmentModifier) LocalNotesWithReplacements() string
- func (e *EquipmentModifier) MarshalJSON() ([]byte, error)
- func (e *EquipmentModifier) NameWithReplacements() string
- func (e *EquipmentModifier) NameableReplacements() map[string]string
- func (e *EquipmentModifier) NodeChildren() []*EquipmentModifier
- func (e *EquipmentModifier) OwningEquipment() *Equipment
- func (e *EquipmentModifier) Parent() *EquipmentModifier
- func (e *EquipmentModifier) SecondaryText(optionChecker func(display.Option) bool) string
- func (e *EquipmentModifier) SetChildren(children []*EquipmentModifier)
- func (e *EquipmentModifier) SetDataOwner(owner DataOwner)
- func (e *EquipmentModifier) SetEnabled(enabled bool)
- func (e *EquipmentModifier) SetOpen(open bool)
- func (e *EquipmentModifier) SetParent(parent *EquipmentModifier)
- func (e *EquipmentModifier) String() string
- func (e *EquipmentModifier) SyncWithSource()
- func (e *EquipmentModifier) TagList() []string
- func (e *EquipmentModifier) UnmarshalJSON(data []byte) error
- func (e *EquipmentModifier) WeightDescription() string
- func (e *EquipmentModifier) WeightMultiplier() fxp.Int
- type EquipmentModifierData
- type EquipmentModifierEditData
- type EquipmentModifierEditDataNonContainerOnly
- type EquipmentModifierListProvider
- type EquipmentModifierNonContainerSyncData
- type EquipmentModifierSyncData
- type EquipmentSyncData
- type EquippedEquipmentPrereq
- func (p *EquippedEquipmentPrereq) Clone(parent *PrereqList) Prereq
- func (p *EquippedEquipmentPrereq) FillWithNameableKeys(m, existing map[string]string)
- func (p *EquippedEquipmentPrereq) Hash(h hash.Hash)
- func (p *EquippedEquipmentPrereq) ParentList() *PrereqList
- func (p *EquippedEquipmentPrereq) PrereqType() prereq.Type
- func (p *EquippedEquipmentPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, ...) bool
- type Feature
- type Features
- type FileInfo
- type GeneralModifier
- type GeneralSettings
- type HashAndData
- type Hashable
- type HeaderData
- func ConditionalModifiersHeaderData(columnID int) HeaderData
- func EquipmentHeaderData(columnID int, entity *Entity, carried, forPage bool) HeaderData
- func EquipmentModifierHeaderData(columnID int) HeaderData
- func NotesHeaderData(columnID int) HeaderData
- func ReactionModifiersHeaderData(columnID int) HeaderData
- func SkillsHeaderData(columnID int) HeaderData
- func SpellsHeaderData(columnID int) HeaderData
- func TraitModifierHeaderData(columnID int) HeaderData
- func TraitsHeaderData(columnID int) HeaderData
- func WeaponHeaderData(columnID int, melee, forPage bool) HeaderData
- type HitLocation
- func (h *HitLocation) Clone(entity *Entity, owningTable *Body) *HitLocation
- func (h *HitLocation) DR(entity *Entity, tooltip *xio.ByteBuffer, drMap map[string]int) map[string]int
- func (h *HitLocation) DisplayDR(entity *Entity, tooltip *xio.ByteBuffer) string
- func (h *HitLocation) Hash(hasher hash.Hash)
- func (h *HitLocation) ID() string
- func (h *HitLocation) MarshalJSON() ([]byte, error)
- func (h *HitLocation) OwningTable() *Body
- func (h *HitLocation) ResetTargetKeyPrefixes(prefixProvider func() string)
- func (h *HitLocation) SetID(value string)
- func (h *HitLocation) SetSubTable(bodyType *Body)
- func (h *HitLocation) UnmarshalJSON(data []byte) error
- type HitLocationData
- type IDer
- type KeyBindings
- func (b *KeyBindings) Current(id string) unison.KeyBinding
- func (b *KeyBindings) MakeCurrent()
- func (b *KeyBindings) MarshalJSON() ([]byte, error)
- func (b *KeyBindings) Reset()
- func (b *KeyBindings) ResetOne(id string)
- func (b *KeyBindings) Save(filePath string) error
- func (b *KeyBindings) Set(id string, binding unison.KeyBinding)
- func (b *KeyBindings) ShouldOmit() bool
- func (b *KeyBindings) UnmarshalJSON(data []byte) error
- type Level
- func CalculateRitualMagicSpellLevel(e *Entity, name, powerSource, ritualSkillName string, ritualPrereqCount int, ...) Level
- func CalculateSkillLevel(e *Entity, name, specialization string, tags []string, def *SkillDefault, ...) Level
- func CalculateSpellLevel(e *Entity, name, powerSource string, colleges, tags []string, ...) Level
- func CalculateTechniqueLevel(e *Entity, replacements map[string]string, name, specialization string, ...) Level
- type LeveledAmount
- type LeveledOwner
- type Libraries
- type Library
- func (l *Library) AvailableReleases() (current string, releases []Release)
- func (l *Library) CheckForAvailableUpgrade(ctx context.Context, client *http.Client)
- func (l *Library) CleanupFavorites()
- func (l *Library) Compare(other *Library) int
- func (l *Library) ConfigureForKey(key string)
- func (l *Library) Download(ctx context.Context, client *http.Client, release Release) error
- func (l *Library) IsMaster() bool
- func (l *Library) IsUser() bool
- func (l *Library) Key() string
- func (l *Library) Path() string
- func (l *Library) SetPath(newPath string) error
- func (l *Library) StopAllWatches()
- func (l *Library) Valid() bool
- func (l *Library) VersionOnDisk() string
- func (l *Library) Watch(callback func(lib *Library, fullPath string, what notify.Event), ...) *MonitorToken
- type LibraryFile
- type LineBuilder
- type ListProvider
- type MonitorToken
- type NameGenerator
- type NameGeneratorRef
- type NamedFileRef
- type NamedFileSet
- type NavNodeInfo
- type NavigatorSettings
- type Node
- type NodeTypes
- type Note
- func (n *Note) ApplyNameableKeys(m map[string]string)
- func (n *Note) CanConvertToFromContainer() bool
- func (n *Note) CellData(columnID int, data *CellData)
- func (n *Note) ClearSource()
- func (n *Note) ClearUnusedFieldsForType()
- func (n *Note) Clone(from LibraryFile, owner DataOwner, parent *Note, preserveID bool) *Note
- func (n *Note) Container() bool
- func (n *Note) ConvertToContainer()
- func (n *Note) ConvertToNonContainer()
- func (n *Note) DataOwner() DataOwner
- func (n *Note) Depth() int
- func (n *Note) Enabled() bool
- func (n *Note) FillWithNameableKeys(m, existing map[string]string)
- func (n *Note) GetSource() Source
- func (n *Note) HasChildren() bool
- func (n *Note) Hash(h hash.Hash)
- func (n *Note) ID() tid.TID
- func (n *Note) IsOpen() bool
- func (n *Note) Kind() string
- func (n *Note) MarshalJSON() ([]byte, error)
- func (n *Note) NameableReplacements() map[string]string
- func (n *Note) NodeChildren() []*Note
- func (n *Note) Parent() *Note
- func (n *Note) SetChildren(children []*Note)
- func (n *Note) SetDataOwner(owner DataOwner)
- func (n *Note) SetOpen(open bool)
- func (n *Note) SetParent(parent *Note)
- func (n *Note) String() string
- func (n *Note) SyncWithSource()
- func (n *Note) TextWithReplacements() string
- func (n *Note) UnmarshalJSON(data []byte) error
- type NoteData
- type NoteEditData
- type NoteListProvider
- type NoteSyncData
- type Openable
- type PDFInfo
- type PageRef
- type PageRefs
- func (p *PageRefs) List() []*PageRef
- func (p *PageRefs) Lookup(id string) *PageRef
- func (p *PageRefs) MarshalJSON() ([]byte, error)
- func (p *PageRefs) Remove(id string)
- func (p *PageRefs) Save(filePath string) error
- func (p *PageRefs) Set(pageRef *PageRef)
- func (p *PageRefs) ShouldOmit() bool
- func (p *PageRefs) UnmarshalJSON(data []byte) error
- type PageSettings
- type PageSettingsOverrides
- func (p *PageSettingsOverrides) Apply(page *PageSettings)
- func (p *PageSettingsOverrides) ParseBottomMargin(in string)
- func (p *PageSettingsOverrides) ParseLeftMargin(in string)
- func (p *PageSettingsOverrides) ParseOrientation(in string)
- func (p *PageSettingsOverrides) ParseRightMargin(in string)
- func (p *PageSettingsOverrides) ParseSize(in string)
- func (p *PageSettingsOverrides) ParseTopMargin(in string)
- type PointsBreakdown
- type PointsRecord
- type PoolThreshold
- func (p *PoolThreshold) AddOp(op threshold.Op)
- func (p *PoolThreshold) Clone() *PoolThreshold
- func (p *PoolThreshold) ContainsOp(op threshold.Op) bool
- func (p *PoolThreshold) Hash(h hash.Hash)
- func (p *PoolThreshold) MarshalJSON() ([]byte, error)
- func (p *PoolThreshold) RemoveOp(op threshold.Op)
- func (p *PoolThreshold) String() string
- func (p *PoolThreshold) Threshold(resolver eval.VariableResolver) fxp.Int
- func (p *PoolThreshold) UnmarshalJSON(data []byte) error
- type PoolThresholdData
- type Prereq
- type PrereqList
- func (p *PrereqList) Clone(parent *PrereqList) Prereq
- func (p *PrereqList) CloneAsPrereqList(parent *PrereqList) *PrereqList
- func (p *PrereqList) CloneResolvingEmpty(isContainer, pruneIfEmpty bool) *PrereqList
- func (p *PrereqList) FillWithNameableKeys(m, existing map[string]string)
- func (p *PrereqList) Hash(h hash.Hash)
- func (p *PrereqList) ParentList() *PrereqList
- func (p *PrereqList) PrereqType() prereq.Type
- func (p *PrereqList) Satisfied(entity *Entity, exclude any, buffer *xio.ByteBuffer, prefix string, ...) bool
- func (p *PrereqList) ShouldOmit() bool
- type Prereqs
- type Profile
- func (p *Profile) AdjustedSizeModifier() int
- func (p *Profile) ApplyRandomizers(entity *Entity)
- func (p *Profile) AutoFill(entity *Entity)
- func (p *Profile) CanExportPortrait() bool
- func (p *Profile) ExportPortrait(filePath string) error
- func (p *Profile) Portrait() *unison.Image
- func (p *Profile) PortraitExtension() string
- func (p *Profile) SetAdjustedSizeModifier(value int)
- func (p *Profile) Update(entity *Entity)
- type ProfileRandom
- type RawPointsAdjuster
- type ReactionBonus
- func (r *ReactionBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (r *ReactionBonus) Clone() Feature
- func (r *ReactionBonus) FeatureType() feature.Type
- func (r *ReactionBonus) FillWithNameableKeys(m, existing map[string]string)
- func (r *ReactionBonus) Hash(h hash.Hash)
- func (r *ReactionBonus) SetLevel(level fxp.Int)
- type ReactionModifierListProvider
- type Release
- type Settings
- func (s *Settings) AddRecentFile(filePath string)
- func (s *Settings) EnsureValidity()
- func (s *Settings) GeneralSettings() *GeneralSettings
- func (s *Settings) LastDir(key string) string
- func (s *Settings) Libraries() Libraries
- func (s *Settings) ListRecentFiles() []string
- func (s *Settings) Save() error
- func (s *Settings) SetLastDir(key, dir string)
- func (s *Settings) SheetSettings() *SheetSettings
- type SheetSettings
- func (s *SheetSettings) Clone(entity *Entity) *SheetSettings
- func (s *SheetSettings) EnsureValidity()
- func (s *SheetSettings) MarshalJSON() ([]byte, error)
- func (s *SheetSettings) Save(filePath string) error
- func (s *SheetSettings) SetOwningEntity(entity *Entity)
- func (s *SheetSettings) UnmarshalJSON(data []byte) error
- type SheetSettingsData
- type SheetSettingsResponder
- type Skill
- func (s *Skill) AdjustedPoints(tooltip *xio.ByteBuffer) fxp.Int
- func (s *Skill) AdjustedRelativeLevel() fxp.Int
- func (s *Skill) ApplyNameableKeys(m map[string]string)
- func (s *Skill) BaseSkill(e *Entity, def *SkillDefault, requirePoints bool) *Skill
- func (s *Skill) BestSwappableSkill() *Skill
- func (s *Skill) CalculateLevel(excludes map[string]bool) Level
- func (s *Skill) CanSwapDefaults() bool
- func (s *Skill) CanSwapDefaultsWith(other *Skill) bool
- func (s *Skill) CellData(columnID int, data *CellData)
- func (s *Skill) ClearSource()
- func (s *Skill) ClearUnusedFieldsForType()
- func (s *Skill) Clone(from LibraryFile, owner DataOwner, parent *Skill, preserveID bool) *Skill
- func (s *Skill) Container() bool
- func (s *Skill) DataOwner() DataOwner
- func (s *Skill) DecrementSkillLevel()
- func (s *Skill) DefaultSkill() *Skill
- func (s *Skill) Depth() int
- func (s *Skill) Description() string
- func (s *Skill) Enabled() bool
- func (s *Skill) FeatureList() Features
- func (s *Skill) FillWithNameableKeys(m, existing map[string]string)
- func (s *Skill) GetSource() Source
- func (s *Skill) HasChildren() bool
- func (s *Skill) HasDefaultTo(other *Skill) bool
- func (s *Skill) Hash(h hash.Hash)
- func (s *Skill) ID() tid.TID
- func (s *Skill) IncrementSkillLevel()
- func (s *Skill) IsOpen() bool
- func (s *Skill) IsTechnique() bool
- func (s *Skill) Kind() string
- func (s *Skill) LocalNotesWithReplacements() string
- func (s *Skill) MarshalJSON() ([]byte, error)
- func (s *Skill) ModifierNotes() string
- func (s *Skill) NameWithReplacements() string
- func (s *Skill) NameableReplacements() map[string]string
- func (s *Skill) NodeChildren() []*Skill
- func (s *Skill) Notes() string
- func (s *Skill) Parent() *Skill
- func (s *Skill) RatedStrength() fxp.Int
- func (s *Skill) RawPoints() fxp.Int
- func (s *Skill) RelativeLevel() string
- func (s *Skill) RequiresTL() bool
- func (s *Skill) SecondaryText(optionChecker func(display.Option) bool) string
- func (s *Skill) SetChildren(children []*Skill)
- func (s *Skill) SetDataOwner(owner DataOwner)
- func (s *Skill) SetOpen(open bool)
- func (s *Skill) SetParent(parent *Skill)
- func (s *Skill) SetRawPoints(points fxp.Int) bool
- func (s *Skill) SetTL(tl string)
- func (s *Skill) SpecializationWithReplacements() string
- func (s *Skill) String() string
- func (s *Skill) SwapDefaults()
- func (s *Skill) SyncWithSource()
- func (s *Skill) TL() string
- func (s *Skill) TagList() []string
- func (s *Skill) TechniqueSatisfied(tooltip *xio.ByteBuffer, prefix string) bool
- func (s *Skill) TemplatePickerData() *TemplatePicker
- func (s *Skill) UnmarshalJSON(data []byte) error
- func (s *Skill) UpdateLevel() bool
- type SkillAdjustmentProvider
- type SkillBonus
- type SkillContainerOnlySyncData
- type SkillData
- type SkillDefault
- func (s *SkillDefault) CloneWithoutLevelOrPoints() *SkillDefault
- func (s *SkillDefault) Equivalent(replacements map[string]string, other *SkillDefault) bool
- func (s *SkillDefault) FillWithNameableKeys(m, existing map[string]string)
- func (s *SkillDefault) FullName(entity *Entity, replacements map[string]string) string
- func (s *SkillDefault) Hash(h hash.Hash)
- func (s *SkillDefault) ModifierAsString() string
- func (s *SkillDefault) NameWithReplacements(replacements map[string]string) string
- func (s *SkillDefault) SetType(t string)
- func (s *SkillDefault) SkillBased() bool
- func (s *SkillDefault) SkillLevel(entity *Entity, replacements map[string]string, requirePoints bool, ...) fxp.Int
- func (s *SkillDefault) SkillLevelFast(entity *Entity, replacements map[string]string, requirePoints bool, ...) fxp.Int
- func (s *SkillDefault) SpecializationWithReplacements(replacements map[string]string) string
- func (s *SkillDefault) Type() string
- type SkillEditData
- type SkillListProvider
- type SkillNonContainerOnlyEditData
- type SkillNonContainerOnlySyncData
- type SkillPointBonus
- func (s *SkillPointBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (s *SkillPointBonus) Clone() Feature
- func (s *SkillPointBonus) FeatureType() feature.Type
- func (s *SkillPointBonus) FillWithNameableKeys(m, existing map[string]string)
- func (s *SkillPointBonus) Hash(h hash.Hash)
- func (s *SkillPointBonus) SetLevel(level fxp.Int)
- type SkillPrereq
- func (p *SkillPrereq) Clone(parent *PrereqList) Prereq
- func (p *SkillPrereq) FillWithNameableKeys(m, existing map[string]string)
- func (p *SkillPrereq) Hash(h hash.Hash)
- func (p *SkillPrereq) ParentList() *PrereqList
- func (p *SkillPrereq) PrereqType() prereq.Type
- func (p *SkillPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type SkillSyncData
- type Source
- type SourcedID
- type Spell
- func (s *Spell) AdjustedPoints(tooltip *xio.ByteBuffer) fxp.Int
- func (s *Spell) AdjustedRelativeLevel() fxp.Int
- func (s *Spell) ApplyNameableKeys(m map[string]string)
- func (s *Spell) CalculateLevel() Level
- func (s *Spell) CastingCostWithReplacements() string
- func (s *Spell) CastingTimeWithReplacements() string
- func (s *Spell) CellData(columnID int, data *CellData)
- func (s *Spell) ClassWithReplacements() string
- func (s *Spell) ClearSource()
- func (s *Spell) ClearUnusedFieldsForType()
- func (s *Spell) Clone(from LibraryFile, owner DataOwner, parent *Spell, preserveID bool) *Spell
- func (s *Spell) CollegeWithReplacements() []string
- func (s *Spell) Container() bool
- func (s *Spell) DataOwner() DataOwner
- func (s *Spell) DecrementSkillLevel()
- func (s *Spell) Depth() int
- func (s *Spell) Description() string
- func (s *Spell) DurationWithReplacements() string
- func (s *Spell) Enabled() bool
- func (s *Spell) FeatureList() Features
- func (s *Spell) FillWithNameableKeys(m, existing map[string]string)
- func (s *Spell) GetSource() Source
- func (s *Spell) HasChildren() bool
- func (s *Spell) Hash(h hash.Hash)
- func (s *Spell) ID() tid.TID
- func (s *Spell) IncrementSkillLevel()
- func (s *Spell) IsOpen() bool
- func (s *Spell) IsRitualMagic() bool
- func (s *Spell) Kind() string
- func (s *Spell) LocalNotesWithReplacements() string
- func (s *Spell) MaintenanceCostWithReplacements() string
- func (s *Spell) MarshalJSON() ([]byte, error)
- func (s *Spell) NameWithReplacements() string
- func (s *Spell) NameableReplacements() map[string]string
- func (s *Spell) NodeChildren() []*Spell
- func (s *Spell) Notes() string
- func (s *Spell) Parent() *Spell
- func (s *Spell) PowerSourceWithReplacements() string
- func (s *Spell) RatedStrength() fxp.Int
- func (s *Spell) RawPoints() fxp.Int
- func (s *Spell) RelativeLevel() string
- func (s *Spell) RequiresTL() bool
- func (s *Spell) ResistWithReplacements() string
- func (s *Spell) RitualMagicSatisfied(tooltip *xio.ByteBuffer, prefix string) bool
- func (s *Spell) RitualSkillNameWithReplacements() string
- func (s *Spell) Rituals() string
- func (s *Spell) SecondaryText(optionChecker func(display.Option) bool) string
- func (s *Spell) SetChildren(children []*Spell)
- func (s *Spell) SetDataOwner(owner DataOwner)
- func (s *Spell) SetOpen(open bool)
- func (s *Spell) SetParent(parent *Spell)
- func (s *Spell) SetRawPoints(points fxp.Int) bool
- func (s *Spell) SetTL(tl string)
- func (s *Spell) String() string
- func (s *Spell) SyncWithSource()
- func (s *Spell) TL() string
- func (s *Spell) TagList() []string
- func (s *Spell) TemplatePickerData() *TemplatePicker
- func (s *Spell) UnmarshalJSON(data []byte) error
- func (s *Spell) UpdateLevel() bool
- type SpellBonus
- func (s *SpellBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (s *SpellBonus) Clone() Feature
- func (s *SpellBonus) FeatureType() feature.Type
- func (s *SpellBonus) FillWithNameableKeys(m, existing map[string]string)
- func (s *SpellBonus) Hash(h hash.Hash)
- func (s *SpellBonus) MatchForType(replacements map[string]string, name, powerSource string, colleges []string) bool
- func (s *SpellBonus) SetLevel(level fxp.Int)
- type SpellData
- type SpellEditData
- type SpellListProvider
- type SpellNonContainerOnlyEditData
- type SpellNonContainerOnlySyncData
- type SpellPointBonus
- func (s *SpellPointBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (s *SpellPointBonus) Clone() Feature
- func (s *SpellPointBonus) FeatureType() feature.Type
- func (s *SpellPointBonus) FillWithNameableKeys(m, existing map[string]string)
- func (s *SpellPointBonus) Hash(h hash.Hash)
- func (s *SpellPointBonus) MatchForType(replacements map[string]string, name, powerSource string, colleges []string) bool
- func (s *SpellPointBonus) SetLevel(level fxp.Int)
- type SpellPrereq
- func (p *SpellPrereq) Clone(parent *PrereqList) Prereq
- func (p *SpellPrereq) FillWithNameableKeys(m, existing map[string]string)
- func (p *SpellPrereq) Hash(h hash.Hash)
- func (p *SpellPrereq) ParentList() *PrereqList
- func (p *SpellPrereq) PrereqType() prereq.Type
- func (p *SpellPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type SpellSyncData
- type SrcMatcher
- type SrcProvider
- type Study
- type TechLevelProvider
- type Template
- func (t *Template) CarriedEquipmentList() []*Equipment
- func (t *Template) DataOwner() DataOwner
- func (t *Template) EnsureAttachments()
- func (t *Template) Hash(h hash.Hash)
- func (t *Template) MarshalJSON() ([]byte, error)
- func (t *Template) NoteList() []*Note
- func (t *Template) OtherEquipmentList() []*Equipment
- func (t *Template) OwningEntity() *Entity
- func (t *Template) Save(filePath string) error
- func (t *Template) SetCarriedEquipmentList(list []*Equipment)
- func (t *Template) SetNoteList(list []*Note)
- func (t *Template) SetOtherEquipmentList(_ []*Equipment)
- func (t *Template) SetSkillList(list []*Skill)
- func (t *Template) SetSpellList(list []*Spell)
- func (t *Template) SetTraitList(list []*Trait)
- func (t *Template) SkillList() []*Skill
- func (t *Template) SourceMatcher() *SrcMatcher
- func (t *Template) SpellList() []*Spell
- func (t *Template) SyncWithLibrarySources()
- func (t *Template) TraitList() []*Trait
- func (t *Template) UnmarshalJSON(data []byte) error
- type TemplateData
- type TemplatePicker
- type TemplatePickerProvider
- type TrainingData
- type Trait
- func (t *Trait) ActiveModifierFor(name string) *TraitModifier
- func (t *Trait) AdjustedPoints() fxp.Int
- func (t *Trait) AllModifiers() []*TraitModifier
- func (t *Trait) ApplyNameableKeys(m map[string]string)
- func (t *Trait) CellData(columnID int, data *CellData)
- func (t *Trait) ClearSource()
- func (t *Trait) ClearUnusedFieldsForType()
- func (t *Trait) Clone(from LibraryFile, owner DataOwner, parent *Trait, preserveID bool) *Trait
- func (t *Trait) Container() bool
- func (t *Trait) CurrentLevel() fxp.Int
- func (t *Trait) DataOwner() DataOwner
- func (t *Trait) Depth() int
- func (t *Trait) Description() string
- func (t *Trait) EffectivelyDisabled() bool
- func (t *Trait) Enabled() bool
- func (t *Trait) FeatureList() Features
- func (t *Trait) FillWithNameableKeys(m, existing map[string]string)
- func (t *Trait) GetSource() Source
- func (t *Trait) HasChildren() bool
- func (t *Trait) Hash(h hash.Hash)
- func (t *Trait) ID() tid.TID
- func (t *Trait) IsLeveled() bool
- func (t *Trait) IsOpen() bool
- func (t *Trait) Kind() string
- func (t *Trait) LocalNotesWithReplacements() string
- func (t *Trait) MarshalJSON() ([]byte, error)
- func (t *Trait) ModifierNotes() string
- func (t *Trait) NameWithReplacements() string
- func (t *Trait) NameableReplacements() map[string]string
- func (t *Trait) NodeChildren() []*Trait
- func (t *Trait) Notes() string
- func (t *Trait) Parent() *Trait
- func (t *Trait) RatedStrength() fxp.Int
- func (t *Trait) SecondaryText(optionChecker func(display.Option) bool) string
- func (t *Trait) SetChildren(children []*Trait)
- func (t *Trait) SetDataOwner(owner DataOwner)
- func (t *Trait) SetOpen(open bool)
- func (t *Trait) SetParent(parent *Trait)
- func (t *Trait) String() string
- func (t *Trait) SyncWithSource()
- func (t *Trait) TagList() []string
- func (t *Trait) TemplatePickerData() *TemplatePicker
- func (t *Trait) UnmarshalJSON(data []byte) error
- func (t *Trait) UserDescWithReplacements() string
- type TraitContainerSyncData
- type TraitData
- type TraitEditData
- type TraitListProvider
- type TraitModifier
- func (t *TraitModifier) ApplyNameableKeys(m map[string]string)
- func (t *TraitModifier) CellData(columnID int, data *CellData)
- func (t *TraitModifier) ClearSource()
- func (t *TraitModifier) ClearUnusedFieldsForType()
- func (t *TraitModifier) Clone(from LibraryFile, owner DataOwner, parent *TraitModifier, preserveID bool) *TraitModifier
- func (t *TraitModifier) Container() bool
- func (t *TraitModifier) CostDescription() string
- func (t *TraitModifier) CostModifier() fxp.Int
- func (t *TraitModifier) CostMultiplier() fxp.Int
- func (t *TraitModifier) CurrentLevel() fxp.Int
- func (t *TraitModifier) DataOwner() DataOwner
- func (t *TraitModifier) Depth() int
- func (t *TraitModifier) Enabled() bool
- func (t *TraitModifier) FillWithNameableKeys(m, existing map[string]string)
- func (t *TraitModifier) FullCostDescription() string
- func (t *TraitModifier) FullDescription() string
- func (t *TraitModifier) GetSource() Source
- func (t *TraitModifier) HasChildren() bool
- func (t *TraitModifier) Hash(h hash.Hash)
- func (t *TraitModifier) ID() tid.TID
- func (t *TraitModifier) IsLeveled() bool
- func (t *TraitModifier) IsOpen() bool
- func (t *TraitModifier) Kind() string
- func (t *TraitModifier) LocalNotesWithReplacements() string
- func (t *TraitModifier) MarshalJSON() ([]byte, error)
- func (t *TraitModifier) NameWithReplacements() string
- func (t *TraitModifier) NameableReplacements() map[string]string
- func (t *TraitModifier) NodeChildren() []*TraitModifier
- func (t *TraitModifier) OwningTrait() *Trait
- func (t *TraitModifier) Parent() *TraitModifier
- func (t *TraitModifier) SecondaryText(optionChecker func(display.Option) bool) string
- func (t *TraitModifier) SetChildren(children []*TraitModifier)
- func (t *TraitModifier) SetDataOwner(owner DataOwner)
- func (t *TraitModifier) SetEnabled(enabled bool)
- func (t *TraitModifier) SetOpen(open bool)
- func (t *TraitModifier) SetParent(parent *TraitModifier)
- func (t *TraitModifier) String() string
- func (t *TraitModifier) SyncWithSource()
- func (t *TraitModifier) TagList() []string
- func (t *TraitModifier) UnmarshalJSON(data []byte) error
- type TraitModifierData
- type TraitModifierEditData
- type TraitModifierEditDataNonContainerOnly
- type TraitModifierListProvider
- type TraitModifierNonContainerSyncData
- type TraitModifierSyncData
- type TraitNonContainerOnlyEditData
- type TraitNonContainerSyncData
- type TraitPrereq
- func (p *TraitPrereq) Clone(parent *PrereqList) Prereq
- func (p *TraitPrereq) FillWithNameableKeys(m, existing map[string]string)
- func (p *TraitPrereq) Hash(h hash.Hash)
- func (p *TraitPrereq) ParentList() *PrereqList
- func (p *TraitPrereq) PrereqType() prereq.Type
- func (p *TraitPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type TraitSyncData
- type Weapon
- func (w *Weapon) ApplyNameableKeys(_ map[string]string)
- func (w *Weapon) ApplyTo(t *Weapon)
- func (w *Weapon) CellData(columnID int, data *CellData)
- func (w *Weapon) ClearSource()
- func (w *Weapon) Clone(_ LibraryFile, _ DataOwner, _ *Weapon, preserveID bool) *Weapon
- func (w *Weapon) Compare(other *Weapon) int
- func (w *Weapon) Container() bool
- func (w *Weapon) CopyFrom(t *Weapon)
- func (w *Weapon) DataOwner() DataOwner
- func (w *Weapon) Enabled() bool
- func (w *Weapon) EncumbrancePenalty(e *Entity, tooltip *xio.ByteBuffer) fxp.Int
- func (w *Weapon) Entity() *Entity
- func (w *Weapon) FillWithNameableKeys(m, existing map[string]string)
- func (w *Weapon) GetSource() Source
- func (w *Weapon) HasChildren() bool
- func (w *Weapon) HashResolved() uint64
- func (w *Weapon) ID() tid.TID
- func (w *Weapon) IsMelee() bool
- func (w *Weapon) IsOpen() bool
- func (w *Weapon) IsRanged() bool
- func (w *Weapon) Kind() string
- func (w *Weapon) MarshalJSON() ([]byte, error)
- func (w *Weapon) NameableReplacements() map[string]string
- func (w *Weapon) NodeChildren() []*Weapon
- func (w *Weapon) Notes() string
- func (w *Weapon) Parent() *Weapon
- func (w *Weapon) ResolveBoolFlag(switchType wswitch.Type, initial bool) bool
- func (w *Weapon) SetChildren(_ []*Weapon)
- func (w *Weapon) SetDataOwner(_ DataOwner)
- func (w *Weapon) SetOpen(_ bool)
- func (w *Weapon) SetOwner(owner WeaponOwner)
- func (w *Weapon) SetParent(_ *Weapon)
- func (w *Weapon) SkillLevel(tooltip *xio.ByteBuffer) fxp.Int
- func (w *Weapon) String() string
- func (w *Weapon) SyncWithSource()
- func (w *Weapon) UnmarshalJSON(data []byte) error
- func (w *Weapon) UsageNotesWithReplacements() string
- func (w *Weapon) UsageWithReplacements() string
- func (w *Weapon) Validate()
- type WeaponAccuracy
- func (wa WeaponAccuracy) Hash(h hash.Hash)
- func (wa WeaponAccuracy) MarshalJSON() ([]byte, error)
- func (wa WeaponAccuracy) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponAccuracy
- func (wa WeaponAccuracy) ShouldOmit() bool
- func (wa WeaponAccuracy) String() string
- func (wa *WeaponAccuracy) UnmarshalJSON(data []byte) error
- func (wa *WeaponAccuracy) Validate()
- type WeaponBlock
- func (wb WeaponBlock) Hash(h hash.Hash)
- func (wb WeaponBlock) MarshalJSON() ([]byte, error)
- func (wb WeaponBlock) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponBlock
- func (wb WeaponBlock) ShouldOmit() bool
- func (wb WeaponBlock) String() string
- func (wb *WeaponBlock) UnmarshalJSON(data []byte) error
- func (wb *WeaponBlock) Validate()
- type WeaponBonus
- func NewWeaponAccBonus() *WeaponBonus
- func NewWeaponBlockBonus() *WeaponBonus
- func NewWeaponBulkBonus() *WeaponBonus
- func NewWeaponChamberShotsBonus() *WeaponBonus
- func NewWeaponDRDivisorBonus() *WeaponBonus
- func NewWeaponDamageBonus() *WeaponBonus
- func NewWeaponEffectiveSTBonus() *WeaponBonus
- func NewWeaponHalfDamageRangeBonus() *WeaponBonus
- func NewWeaponMaxRangeBonus() *WeaponBonus
- func NewWeaponMaxReachBonus() *WeaponBonus
- func NewWeaponMinRangeBonus() *WeaponBonus
- func NewWeaponMinReachBonus() *WeaponBonus
- func NewWeaponMinSTBonus() *WeaponBonus
- func NewWeaponNonChamberShotsBonus() *WeaponBonus
- func NewWeaponParryBonus() *WeaponBonus
- func NewWeaponRecoilBonus() *WeaponBonus
- func NewWeaponReloadTimeBonus() *WeaponBonus
- func NewWeaponRofMode1SecondaryBonus() *WeaponBonus
- func NewWeaponRofMode1ShotsBonus() *WeaponBonus
- func NewWeaponRofMode2SecondaryBonus() *WeaponBonus
- func NewWeaponRofMode2ShotsBonus() *WeaponBonus
- func NewWeaponScopeAccBonus() *WeaponBonus
- func NewWeaponShotDurationBonus() *WeaponBonus
- func NewWeaponSwitchBonus() *WeaponBonus
- func (w *WeaponBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (w *WeaponBonus) AdjustedAmountForWeapon(wpn *Weapon) fxp.Int
- func (w *WeaponBonus) Clone() Feature
- func (w *WeaponBonus) FeatureType() feature.Type
- func (w *WeaponBonus) FillWithNameableKeys(m, existing map[string]string)
- func (w *WeaponBonus) Hash(h hash.Hash)
- func (w *WeaponBonus) SetLevel(level fxp.Int)
- type WeaponBulk
- func (wb WeaponBulk) Hash(h hash.Hash)
- func (wb WeaponBulk) MarshalJSON() ([]byte, error)
- func (wb WeaponBulk) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponBulk
- func (wb WeaponBulk) ShouldOmit() bool
- func (wb WeaponBulk) String() string
- func (wb WeaponBulk) Tooltip(w *Weapon) string
- func (wb *WeaponBulk) UnmarshalJSON(data []byte) error
- func (wb *WeaponBulk) Validate()
- type WeaponDamage
- func (w *WeaponDamage) BaseDamageDice() *dice.Dice
- func (w *WeaponDamage) Clone(owner *Weapon) *WeaponDamage
- func (w *WeaponDamage) DamageTooltip() string
- func (w *WeaponDamage) Hash(h hash.Hash)
- func (w *WeaponDamage) MarshalJSON() ([]byte, error)
- func (w *WeaponDamage) ResolvedDamage(tooltip *xio.ByteBuffer) string
- func (w *WeaponDamage) String() string
- func (w *WeaponDamage) UnmarshalJSON(data []byte) error
- type WeaponDamageData
- type WeaponData
- type WeaponLeveledAmount
- type WeaponListProvider
- type WeaponOwner
- type WeaponParry
- func (wp WeaponParry) Hash(h hash.Hash)
- func (wp WeaponParry) MarshalJSON() ([]byte, error)
- func (wp WeaponParry) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponParry
- func (wp WeaponParry) ShouldOmit() bool
- func (wp WeaponParry) String() string
- func (wp WeaponParry) Tooltip() string
- func (wp *WeaponParry) UnmarshalJSON(data []byte) error
- func (wp *WeaponParry) Validate()
- type WeaponRange
- func (wr WeaponRange) Hash(h hash.Hash)
- func (wr WeaponRange) MarshalJSON() ([]byte, error)
- func (wr WeaponRange) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponRange
- func (wr WeaponRange) ShouldOmit() bool
- func (wr WeaponRange) String(musclePowerIsResolved bool) string
- func (wr *WeaponRange) UnmarshalJSON(data []byte) error
- func (wr *WeaponRange) Validate()
- type WeaponReach
- func (wr WeaponReach) Hash(h hash.Hash)
- func (wr WeaponReach) MarshalJSON() ([]byte, error)
- func (wr WeaponReach) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponReach
- func (wr WeaponReach) ShouldOmit() bool
- func (wr WeaponReach) String() string
- func (wr WeaponReach) Tooltip() string
- func (wr *WeaponReach) UnmarshalJSON(data []byte) error
- func (wr *WeaponReach) Validate()
- type WeaponRecoil
- func (wr WeaponRecoil) Hash(h hash.Hash)
- func (wr WeaponRecoil) MarshalJSON() ([]byte, error)
- func (wr WeaponRecoil) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponRecoil
- func (wr WeaponRecoil) ShouldOmit() bool
- func (wr WeaponRecoil) String() string
- func (wr WeaponRecoil) Tooltip() string
- func (wr *WeaponRecoil) UnmarshalJSON(data []byte) error
- func (wr *WeaponRecoil) Validate()
- type WeaponRoF
- func (wr WeaponRoF) Hash(h hash.Hash)
- func (wr WeaponRoF) MarshalJSON() ([]byte, error)
- func (wr WeaponRoF) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponRoF
- func (wr WeaponRoF) ShouldOmit() bool
- func (wr WeaponRoF) String() string
- func (wr WeaponRoF) Tooltip() string
- func (wr *WeaponRoF) UnmarshalJSON(data []byte) error
- func (wr *WeaponRoF) Validate()
- type WeaponRoFMode
- type WeaponShots
- func (ws WeaponShots) Hash(h hash.Hash)
- func (ws WeaponShots) MarshalJSON() ([]byte, error)
- func (ws WeaponShots) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponShots
- func (ws WeaponShots) ShouldOmit() bool
- func (ws WeaponShots) String() string
- func (ws WeaponShots) Tooltip() string
- func (ws *WeaponShots) UnmarshalJSON(data []byte) error
- func (ws *WeaponShots) Validate()
- type WeaponStrength
- func (ws WeaponStrength) Hash(h hash.Hash)
- func (ws WeaponStrength) MarshalJSON() ([]byte, error)
- func (ws WeaponStrength) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponStrength
- func (ws WeaponStrength) ShouldOmit() bool
- func (ws WeaponStrength) String() string
- func (ws WeaponStrength) Tooltip(w *Weapon) string
- func (ws *WeaponStrength) UnmarshalJSON(data []byte) error
- func (ws *WeaponStrength) Validate()
- type WeightedAncestryOptions
- type WeightedStringOption
Constants ¶
const ( BlockLayoutReactionsKey = "reactions" BlockLayoutConditionalModifiersKey = "conditional_modifiers" BlockLayoutMeleeKey = "melee" BlockLayoutRangedKey = "ranged" BlockLayoutTraitsKey = "traits" BlockLayoutSkillsKey = "skills" BlockLayoutSpellsKey = "spells" BlockLayoutEquipmentKey = "equipment" BlockLayoutOtherEquipmentKey = "other_equipment" BlockLayoutNotesKey = "notes" )
Valid block layout keys
const ( HeaderCheckmark = "checkmark" HeaderCoins = "coins" HeaderWeight = "weight" HeaderBookmark = "bookmark" HeaderDatabase = "database" HeaderStackedCoins = "stacked-coins" HeaderStackedWeight = "stacked-weight" )
These constants are used to specify images to use in column headers.
const ( ConditionalModifierValueColumn = iota ConditionalModifierDescriptionColumn )
Columns that can be used with the conditional modifier method .CellData()
const ( EquipmentEquippedColumn = iota EquipmentQuantityColumn EquipmentDescriptionColumn EquipmentUsesColumn EquipmentTLColumn EquipmentLCColumn EquipmentCostColumn EquipmentExtendedCostColumn EquipmentWeightColumn EquipmentExtendedWeightColumn EquipmentTagsColumn EquipmentReferenceColumn EquipmentLibSrcColumn )
Columns that can be used with the equipment method .CellData()
const ( EquipmentModifierEnabledColumn = iota EquipmentModifierDescriptionColumn EquipmentModifierTechLevelColumn EquipmentModifierCostColumn EquipmentModifierWeightColumn EquipmentModifierTagsColumn EquipmentModifierReferenceColumn EquipmentModifierLibSrcColumn )
Columns that can be used with the equipment modifier method .CellData()
const ( GenericFile = "file" ClosedFolder = ".folder-closed" OpenFolder = ".folder-open" )
Some special "extension" values.
const ( CampaignExt = ".campaign" EquipmentExt = ".eqp" EquipmentModifiersExt = ".eqm" NotesExt = ".not" SheetExt = ".gcs" SkillsExt = ".skl" SpellsExt = ".spl" TemplatesExt = ".gct" TraitModifiersExt = ".adm" TraitsExt = ".adq" MarkdownExt = ".md" )
Primary GCS file extensions.
const ( AncestryExt = ".ancestry" AttributesExt = ".attr" AttributesExtAlt1 = ".attributes" AttributesExtAlt2 = ".gas" BodyExt = ".body" BodyExtAlt = ".ghl" CalendarExt = ".calendar" ColorSettingsExt = ".colors" FontSettingsExt = ".fonts" GeneralSettingsExt = ".general" KeySettingsExt = ".keys" NamesExt = ".names" PageRefSettingsExt = ".refs" SheetSettingsExt = ".sheet" WebSettingsExt = ".web" )
Secondary GCS file extensions (no visible display for these, since you don't open them into a view).
const ( MonitorResolutionMin = 72 MonitorResolutionMax = 300 ImageResolutionDef = 200 ImageResolutionMin = 50 ImageResolutionMax = 400 InitialUIScaleMin = 50 InitialUIScaleMax = 400 InitialListUIScaleDef = 100 InitialEditorUIScaleDef = 100 InitialSheetUIScaleDef = 150 InitialPDFUIScaleDef = 100 InitialMarkdownUIScaleDef = 100 InitialImageUIScaleDef = 100 InitialPDFAutoScaling = autoscale.No AutoColWidthMin = 50 AutoColWidthMax = 9999 MaximumAutoColWidthDef = 800 )
Default, minimum & maximum values for the general numeric settings that can be constants
const ( AllID = "all" BasicMoveID = "basic_move" BasicSpeedID = "basic_speed" BlockID = "block" DexterityID = "dx" DodgeID = "dodge" LiftingStrengthID = "lifting_st" MoveID = "move" ParryID = "parry" RitualMagicSpellID = "ritual_magic_spell" SizeModifierID = "sm" SkillID = "skill" SpellID = "spell" StrengthID = "st" StrikingStrengthID = "striking_st" TechniqueID = "technique" ThrowingStrengthID = "throwing_st" TorsoID = "torso" )
Various commonly used IDs
const ( NoteTextColumn = iota NoteReferenceColumn NoteLibSrcColumn )
Columns that can be used with the note method .CellData()
const ( DefaultLastDirKey = "default" ImagesLastDirKey = "images" SettingsLastDirKey = "settings" )
Last directory keys
const ( SkillDescriptionColumn = iota SkillDifficultyColumn SkillTagsColumn SkillReferenceColumn SkillLevelColumn SkillRelativeLevelColumn SkillPointsColumn SkillLibSrcColumn )
Columns that can be used with the skill method .CellData()
const ( SpellDescriptionColumn = iota SpellResistColumn SpellClassColumn SpellCollegeColumn SpellCastCostColumn SpellMaintainCostColumn SpellCastTimeColumn SpellDurationColumn SpellDifficultyColumn SpellPrereqCountColumn SpellTagsColumn SpellReferenceColumn SpellLevelColumn SpellRelativeLevelColumn SpellPointsColumn SpellDescriptionForPageColumn SpellLibSrcColumn )
Columns that can be used with the spell method .CellData()
const ( TraitDescriptionColumn = iota TraitPointsColumn TraitTagsColumn TraitReferenceColumn TraitLibSrcColumn )
Columns that can be used with the trait method .CellData()
const ( TraitModifierEnabledColumn = iota TraitModifierDescriptionColumn TraitModifierCostColumn TraitModifierTagsColumn TraitModifierReferenceColumn TraitModifierLibSrcColumn )
Columns that can be used with the trait modifier method .CellData()
const ( WeaponDescriptionColumn = iota WeaponUsageColumn WeaponSLColumn WeaponParryColumn WeaponBlockColumn WeaponDamageColumn WeaponReachColumn WeaponSTColumn WeaponAccColumn WeaponRangeColumn WeaponRoFColumn WeaponShotsColumn WeaponBulkColumn WeaponRecoilColumn )
Columns that can be used with the weapon method .CellData()
const DefaultAncestry = "Human"
DefaultAncestry holds the name of the default ancestry.
const EventRootSync = 0xFFFFFFFF
EventRootSync the event code used when the root path being monitored has been changed to a new path. Also occurs as the first event received.
const PageRefCellAlias = -10
PageRefCellAlias is used an alias to request the page reference cell, if any.
Variables ¶
var ( InitialPointsDef = fxp.OneHundredFifty InitialPointsMin fxp.Int InitialPointsMax = fxp.TenMillionMinusOne TooltipDelayDef = fxp.ThreeQuarters TooltipDelayMin fxp.Int TooltipDelayMax = fxp.Thirty TooltipDismissalDef = fxp.Sixty TooltipDismissalMin = fxp.One TooltipDismissalMax = fxp.ThirtySixHundred ScrollWheelMultiplierDef = fxp.From(unison.MouseWheelMultiplier) ScrollWheelMultiplierMin = fxp.One ScrollWheelMultiplierMax = fxp.TenThousandMinusOne )
Default, minimum & maximum values for the general numeric settings
var EvalEmbeddedRegex = regexp.MustCompile(`\|\|[^|]+\|\|`)
EvalEmbeddedRegex is aa regex for extracting embedded expressions.
var ( // KnownFileTypes holds the registered file types. KnownFileTypes []*FileInfo )
var NotifyOfLibraryChangeFunc func()
NotifyOfLibraryChangeFunc will be called to notify of library changes.
var ReservedIDs = []string{SkillID, ParryID, BlockID, SizeModifierID, "10"}
ReservedIDs holds a list of IDs that are reserved for internal use.
var ( // SettingsPath holds the path to our settings file. SettingsPath string )
Functions ¶
func AcceptableExtensions ¶ added in v5.9.0
func AcceptableExtensions() []string
AcceptableExtensions returns the file extensions that we should be able to open.
func AdjustTechLevel ¶
AdjustTechLevel returns a new string with the adjusted tech level.
func AdjustedPoints ¶
func AdjustedPoints(entity *Entity, trait *Trait, canLevel bool, basePoints, levels, pointsPerLevel fxp.Int, cr selfctrl.Roll, modifiers []*TraitModifier, roundCostDown bool) fxp.Int
AdjustedPoints returns the total points, taking levels and modifiers into account. 'entity' and 'dataOwner' may be nil.
func AdjustedPointsForNonContainerSkillOrTechnique ¶
func AdjustedPointsForNonContainerSkillOrTechnique(e *Entity, points fxp.Int, name, specialization string, tags []string, tooltip *xio.ByteBuffer) fxp.Int
AdjustedPointsForNonContainerSkillOrTechnique returns the points, adjusted for any bonuses.
func AdjustedPointsForNonContainerSpell ¶
func AdjustedPointsForNonContainerSpell(e *Entity, points fxp.Int, name, powerSource string, colleges, tags []string, tooltip *xio.ByteBuffer) fxp.Int
AdjustedPointsForNonContainerSpell returns the points, adjusted for any bonuses.
func AppendBufferOntoNewLine ¶ added in v5.19.0
func AppendBufferOntoNewLine(to, from LineBuilder)
AppendBufferOntoNewLine appends the contents of the 'from' buffer onto the 'to' buffer, starting on a new line.
func AppendStringOntoNewLine ¶ added in v5.19.0
func AppendStringOntoNewLine(to LineBuilder, from string)
AppendStringOntoNewLine appends the contents of the 'from' string onto the 'to' buffer, starting on a new line.
func AttributeChoices ¶
func AttributeChoices(entity *Entity, prefix string, flags AttributeFlags, currentKey string) (choices []*AttributeChoice, current *AttributeChoice)
AttributeChoices collects the available choices for attributes for the given entity, or nil.
func AttributeIDFor ¶
AttributeIDFor looks up the preferred ID and if it cannot be found, falls back to a default. 'entity' may be nil.
func ChooseWeightedStringOption ¶ added in v5.9.0
func ChooseWeightedStringOption(options []*WeightedStringOption, not string) string
ChooseWeightedStringOption selects a string option from the available set.
func CombineTags ¶
CombineTags combines multiple tags into a single string.
func Convert ¶ added in v5.9.0
Convert the GCS files found in the given paths to the current file format.
func CostMultiplierForTraitModifier ¶ added in v5.26.0
func CostMultiplierForTraitModifier(baseLevels fxp.Int, trait *Trait, useLevelFromTrait bool) fxp.Int
CostMultiplierForTraitModifier returns the amount to multiply the cost by.
func CountPrereqsForSpell ¶ added in v5.13.0
func CountPrereqsForSpell(spell *Spell, availableSpells []*Spell, nonSpellsCountAs int, useHighestInOr bool) int
CountPrereqsForSpell returns the number of prerequisites for the specified spell.
func CountThresholdOpMet ¶
func CountThresholdOpMet(op threshold.Op, attributes *Attributes) int
CountThresholdOpMet counts the number of times the given ThresholdOp is met.
func CreateFullKeySet ¶
CreateFullKeySet creates a map that contains each of the possible block layout keys.
func DeepSearchableExtensions ¶ added in v5.14.0
func DeepSearchableExtensions() []string
DeepSearchableExtensions returns the file extensions that are deep searchable by the navigator.
func DefaultAttributeIDFor ¶
DefaultAttributeIDFor returns the default attribute ID to use for the given Entity, which may be nil.
func DefaultMasterLibraryPath ¶ added in v5.9.0
func DefaultMasterLibraryPath() string
DefaultMasterLibraryPath returns the default master library path.
func DefaultRootLibraryPath ¶ added in v5.9.0
func DefaultRootLibraryPath() string
DefaultRootLibraryPath returns the default root library path.
func DefaultTypeIsSkillBased ¶ added in v5.9.0
DefaultTypeIsSkillBased returns true if the SkillDefault type is Skill-based.
func DefaultUserLibraryPath ¶ added in v5.9.0
func DefaultUserLibraryPath() string
DefaultUserLibraryPath returns the default user library path.
func Export ¶ added in v5.15.0
Export an Entity to exportPath using the template found at templatePath.
func ExportSheets ¶ added in v5.15.0
ExportSheets exports the files to a text representation.
func ExtendedWeightAdjustedForModifiers ¶
func ExtendedWeightAdjustedForModifiers(equipment *Equipment, defUnits fxp.WeightUnit, qty fxp.Int, baseWeight fxp.Weight, modifiers []*EquipmentModifier, features Features, children []*Equipment, forSkills, weightIgnoredForSkills bool) fxp.Weight
ExtendedWeightAdjustedForModifiers calculates the extended weight.
func ExtractContainedWeightReduction ¶ added in v5.9.0
func ExtractContainedWeightReduction(s string, defUnits fxp.WeightUnit) (string, error)
ExtractContainedWeightReduction extracts the weight reduction (which may be a weight or a percentage) and returns a sanitized result. If 'err' is not nil, then the input was bad. Even in that case, however, a valid string is returned.
func ExtractTechLevel ¶
ExtractTechLevel extracts the first number it finds in the string and returns that as the tech level. The start and end (inclusive) indexes within the string where the number resided are returned, but will be -1 if the string didn't contain a resolvable number. The returned tech level will be clamped to the range 0 to 12.
func FormatRelativeSkill ¶
FormatRelativeSkill formats the relative skill for display.
func GCSExtensions ¶ added in v5.9.0
func GCSExtensions() []string
GCSExtensions returns the file extensions that are owned by GCS.
func GCSSecondaryExtensions ¶ added in v5.9.0
func GCSSecondaryExtensions() []string
GCSSecondaryExtensions returns the file extensions that are owned by GCS but are not directly openable file types.
func HasTag ¶
HasTag returns true if 'tag' is present in 'tags'. This check both ignores case and can check for subsets that are colon-separated.
func IDForNavNode ¶ added in v5.24.0
IDForNavNode returns the ID for the specified navigator node.
func IDForPDFTOC ¶ added in v5.24.0
IDForPDFTOC returns the ID for the specified PDF TOC entry.
func IncludesModifiersFrom ¶
func IncludesModifiersFrom() string
IncludesModifiersFrom returns a message indicating that the current modifiers include modifiers from another source.
func InstallEvaluatorFunctions ¶
InstallEvaluatorFunctions installs additional functions for the evaluator.
func InvalidFileData ¶ added in v5.24.0
func InvalidFileData() string
InvalidFileData returns a message indicating that the file contains invalid data.
func IsNodeOpen ¶ added in v5.24.0
IsNodeOpen returns true if the node is currently open.
func IsThresholdOpMet ¶
func IsThresholdOpMet(op threshold.Op, attributes *Attributes) bool
IsThresholdOpMet if the given ThresholdOp is met.
func LibSrcTooltip ¶ added in v5.24.0
func LibSrcTooltip() string
LibSrcTooltip returns the standard tooltip text for the library source indicator.
func ModifierEnabledTooltip ¶ added in v5.24.0
func ModifierEnabledTooltip() string
ModifierEnabledTooltip returns the standard tooltip text for the modifier enabled indicator.
func MultiplierForEquipmentModifier ¶ added in v5.26.0
MultiplierForEquipmentModifier returns the amount to multiply the cost or weight by.
func NoAdditionalModifiers ¶
func NoAdditionalModifiers() string
NoAdditionalModifiers returns a message indicating that there are no additional modifiers.
func NodesToHashesByID ¶ added in v5.24.0
func NodesToHashesByID[T NodeTypes](result map[tid.TID]HashAndData, data ...T)
NodesToHashesByID traverses the provided nodes and generates hashes.
func PageRefTooltip ¶ added in v5.24.0
func PageRefTooltip() string
PageRefTooltip returns the standard tooltip text for a page reference.
func RegisterKeyBinding ¶ added in v5.9.0
RegisterKeyBinding register a keybinding.
func RegisteredMimeTypes ¶ added in v5.9.0
func RegisteredMimeTypes() []string
RegisteredMimeTypes returns the mime types that we should be able to open.
func ReplaceTechLevel ¶
ReplaceTechLevel replaces the tech level (as found by a call to ExtractTechLevel) with a new value.
func ResolveAttributeName ¶
ResolveAttributeName returns the name of the attribute, if possible.
func ResolveStudyHours ¶ added in v5.3.0
ResolveStudyHours returns the resolved total study hours.
func SanitizeDockableGroups ¶ added in v5.10.0
SanitizeDockableGroups returns the list of valid dockable groups from the passed-in list, in sorted order.
func SanitizeID ¶ added in v5.9.0
SanitizeID ensures the ID is not empty and consists of only lowercase alphanumeric characters. If permitLeadingDigits is false, then leading digits are stripped. A list of reserved values can be passed in to disallow specific IDs.
func SaveEquipment ¶
SaveEquipment writes the Equipment list to the file as JSON.
func SaveEquipmentModifiers ¶
func SaveEquipmentModifiers(modifiers []*EquipmentModifier, filePath string) error
SaveEquipmentModifiers writes the EquipmentModifier list to the file as JSON.
func SaveSkills ¶
SaveSkills writes the Skill list to the file as JSON.
func SaveSpells ¶
SaveSpells writes the Spell list to the file as JSON.
func SaveTraitModifiers ¶
func SaveTraitModifiers(modifiers []*TraitModifier, filePath string) error
SaveTraitModifiers writes the TraitModifier list to the file as JSON.
func SaveTraits ¶
SaveTraits writes the Trait list to the file as JSON.
func SetNodeOpen ¶ added in v5.24.0
SetNodeOpen sets the current open state for a node. Returns true if a change was made.
func StudyHoursProgressText ¶ added in v5.3.0
StudyHoursProgressText returns the progress text or an empty string.
func SyncSheetsAndTemplates ¶ added in v5.26.0
SyncSheetsAndTemplates syncs GCS sheet and template files found in the given paths with their source libraries.
func TechLevelInfo ¶
func TechLevelInfo() string
TechLevelInfo returns a string describing the various tech levels.
func ToColumnCutoff ¶ added in v5.27.0
ToColumnCutoff converts a unix timestamp (in seconds) to a column cutoff value.
func Traverse ¶
Traverse calls the function 'f' for each node and its children in the input list, recursively. Return true from the function to abort early. If excludeContainers is true, then nodes that are containers will not be passed to 'f', although their children will still be processed as usual.
func ValueAdjustedForModifiers ¶
func ValueAdjustedForModifiers(equipment *Equipment, value fxp.Int, modifiers []*EquipmentModifier) fxp.Int
ValueAdjustedForModifiers returns the value after adjusting it for a set of modifiers.
func WeaponSVG ¶ added in v5.24.0
WeaponSVG returns the SVG that should be used for the weapon type.
func WeightAdjustedForModifiers ¶
func WeightAdjustedForModifiers(equipment *Equipment, weight fxp.Weight, modifiers []*EquipmentModifier, defUnits fxp.WeightUnit) fxp.Weight
WeightAdjustedForModifiers returns the weight after adjusting it for a set of modifiers.
Types ¶
type Ancestry ¶ added in v5.9.0
type Ancestry struct { Name string `json:"name,omitempty"` CommonOptions *AncestryOptions `json:"common_options,omitempty"` GenderOptions []*WeightedAncestryOptions `json:"gender_options,omitempty"` }
Ancestry holds details necessary to generate ancestry-specific customizations.
func ActiveAncestries ¶ added in v5.11.0
ActiveAncestries returns a list of Ancestry nodes that are enabled in the given Trait nodes and their descendants.
func LookupAncestry ¶ added in v5.9.0
LookupAncestry an Ancestry by name.
func NewAncestryFromFile ¶ added in v5.9.0
NewAncestryFromFile creates a new Ancestry from a file.
func (*Ancestry) GenderedOptions ¶ added in v5.9.0
func (a *Ancestry) GenderedOptions(gender string) *AncestryOptions
GenderedOptions returns the options for the specified gender, or nil.
func (*Ancestry) RandomEyes ¶ added in v5.9.0
RandomEyes returns a randomized eyes.
func (*Ancestry) RandomGender ¶ added in v5.9.0
RandomGender returns a randomized gender.
func (*Ancestry) RandomHair ¶ added in v5.9.0
RandomHair returns a randomized hair.
func (*Ancestry) RandomHandedness ¶ added in v5.9.0
RandomHandedness returns a randomized handedness.
func (*Ancestry) RandomHeight ¶ added in v5.9.0
func (a *Ancestry) RandomHeight(resolver eval.VariableResolver, gender string, not fxp.Length) fxp.Length
RandomHeight returns a randomized height.
func (*Ancestry) RandomName ¶ added in v5.9.0
func (a *Ancestry) RandomName(nameGeneratorRefs []*NameGeneratorRef, gender string) string
RandomName returns a randomized name.
func (*Ancestry) RandomSkin ¶ added in v5.9.0
RandomSkin returns a randomized skin.
func (*Ancestry) RandomWeight ¶ added in v5.9.0
func (a *Ancestry) RandomWeight(resolver eval.VariableResolver, gender string, not fxp.Weight) fxp.Weight
RandomWeight returns a randomized weight.
type AncestryOptions ¶ added in v5.9.0
type AncestryOptions struct { Name string `json:"name,omitempty"` HeightFormula string `json:"height_formula,omitempty"` WeightFormula string `json:"weight_formula,omitempty"` AgeFormula string `json:"age_formula,omitempty"` HairOptions []*WeightedStringOption `json:"hair_options,omitempty"` EyeOptions []*WeightedStringOption `json:"eye_options,omitempty"` SkinOptions []*WeightedStringOption `json:"skin_options,omitempty"` HandednessOptions []*WeightedStringOption `json:"handedness_options,omitempty"` NameGenerators []string `json:"name_generators,omitempty"` }
AncestryOptions holds options that may be randomized for an Entity's ancestry.
func ChooseWeightedAncestryOptions ¶ added in v5.9.0
func ChooseWeightedAncestryOptions(options []*WeightedAncestryOptions, omitter func(*AncestryOptions) bool) *AncestryOptions
ChooseWeightedAncestryOptions selects a string option from the available set.
func (*AncestryOptions) RandomAge ¶ added in v5.9.0
func (o *AncestryOptions) RandomAge(resolver eval.VariableResolver, not int) int
RandomAge returns a randomized age.
func (*AncestryOptions) RandomEye ¶ added in v5.9.0
func (o *AncestryOptions) RandomEye(not string) string
RandomEye returns a randomized eye.
func (*AncestryOptions) RandomHair ¶ added in v5.9.0
func (o *AncestryOptions) RandomHair(not string) string
RandomHair returns a randomized hair.
func (*AncestryOptions) RandomHandedness ¶ added in v5.9.0
func (o *AncestryOptions) RandomHandedness(not string) string
RandomHandedness returns a randomized handedness.
func (*AncestryOptions) RandomHeight ¶ added in v5.9.0
func (o *AncestryOptions) RandomHeight(resolver eval.VariableResolver, not fxp.Length) fxp.Length
RandomHeight returns a randomized height.
func (*AncestryOptions) RandomName ¶ added in v5.9.0
func (o *AncestryOptions) RandomName(nameGeneratorRefs []*NameGeneratorRef) string
RandomName returns a randomized name.
func (*AncestryOptions) RandomSkin ¶ added in v5.9.0
func (o *AncestryOptions) RandomSkin(not string) string
RandomSkin returns a randomized skin.
func (*AncestryOptions) RandomWeight ¶ added in v5.9.0
func (o *AncestryOptions) RandomWeight(resolver eval.VariableResolver, not fxp.Weight) fxp.Weight
RandomWeight returns a randomized weight.
type Attribute ¶
type Attribute struct { AttributeData Entity *Entity `json:"-"` Bonus fxp.Int `json:"-"` CostReduction fxp.Int `json:"-"` Order int `json:"-"` }
Attribute holds the current state of an AttributeDef.
func NewAttribute ¶
NewAttribute creates a new Attribute.
func (*Attribute) AttributeDef ¶
func (a *Attribute) AttributeDef() *AttributeDef
AttributeDef looks up the AttributeDef this Attribute references from the Entity. May return nil.
func (*Attribute) CurrentThreshold ¶
func (a *Attribute) CurrentThreshold() *PoolThreshold
CurrentThreshold return the current PoolThreshold, if any.
func (*Attribute) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Attribute) Maximum ¶
Maximum returns the maximum value of a pool or the adjusted attribute value for other types.
func (*Attribute) SetID ¶
SetID sets the ID, sanitizing it in the process (i.e. it may be changed from what you set -- read it back if you want to be sure of what it gets set to.
func (*Attribute) SetMaximum ¶
SetMaximum sets the maximum value.
func (*Attribute) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type AttributeBonus ¶ added in v5.9.0
type AttributeBonus struct { Type feature.Type `json:"type"` Limitation stlimit.Option `json:"limitation,omitempty"` Attribute string `json:"attribute"` LeveledAmount BonusOwner }
AttributeBonus holds the data for a bonus to an attribute.
func NewAttributeBonus ¶ added in v5.9.0
func NewAttributeBonus(attrID string) *AttributeBonus
NewAttributeBonus creates a new AttributeBonus.
func (*AttributeBonus) ActualLimitation ¶ added in v5.13.0
func (a *AttributeBonus) ActualLimitation() stlimit.Option
ActualLimitation returns the actual limitation, if any. This is needed in case the limitation is set to something other than none when the attribute is not ST.
func (*AttributeBonus) AddToTooltip ¶ added in v5.9.0
func (a *AttributeBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*AttributeBonus) Clone ¶ added in v5.9.0
func (a *AttributeBonus) Clone() Feature
Clone implements Feature.
func (*AttributeBonus) FeatureType ¶ added in v5.9.0
func (a *AttributeBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*AttributeBonus) FillWithNameableKeys ¶ added in v5.9.0
func (a *AttributeBonus) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys implements Feature.
func (*AttributeBonus) Hash ¶ added in v5.24.0
func (a *AttributeBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*AttributeBonus) SetLevel ¶ added in v5.9.0
func (a *AttributeBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type AttributeChoice ¶
AttributeChoice holds a single attribute choice.
func (*AttributeChoice) String ¶
func (c *AttributeChoice) String() string
type AttributeData ¶
type AttributeData struct { AttrID string `json:"attr_id"` Adjustment fxp.Int `json:"adj"` Damage fxp.Int `json:"damage,omitempty"` }
AttributeData holds the Attribute data that is written to disk.
type AttributeDef ¶
type AttributeDef struct { AttributeDefData Order int KeyPrefix string }
AttributeDef holds the definition of an attribute.
func (*AttributeDef) AllowsDecimal ¶ added in v5.9.0
func (a *AttributeDef) AllowsDecimal() bool
AllowsDecimal returns true if the value can have a decimal point in it.
func (*AttributeDef) BaseValue ¶
func (a *AttributeDef) BaseValue(resolver eval.VariableResolver) fxp.Int
BaseValue returns the resolved base value.
func (*AttributeDef) CombinedName ¶
func (a *AttributeDef) CombinedName() string
CombinedName returns the combined FullName and Name, as appropriate.
func (*AttributeDef) ComputeCost ¶
func (a *AttributeDef) ComputeCost(entity *Entity, value, costReduction fxp.Int, sizeModifier int) fxp.Int
ComputeCost returns the value adjusted for a cost reduction.
func (*AttributeDef) Hash ¶ added in v5.28.0
func (a *AttributeDef) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*AttributeDef) IsSeparator ¶
func (a *AttributeDef) IsSeparator() bool
IsSeparator returns true if this is actually just a separator.
func (*AttributeDef) MarshalJSON ¶
func (a *AttributeDef) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AttributeDef) Pool ¶
func (a *AttributeDef) Pool() bool
Pool returns true if the base value is a pool value.
func (*AttributeDef) Primary ¶
func (a *AttributeDef) Primary() bool
Primary returns true if the base value is a non-derived value.
func (*AttributeDef) ResolveFullName ¶
func (a *AttributeDef) ResolveFullName() string
ResolveFullName returns the full name, using the short name if full name is empty.
func (*AttributeDef) Secondary ¶
func (a *AttributeDef) Secondary() bool
Secondary returns true if the base value is a derived value.
func (*AttributeDef) SetID ¶
func (a *AttributeDef) SetID(value string)
SetID sets the ID, sanitizing it in the process (i.e. it may be changed from what you set -- read it back if you want to be sure of what it gets set to.
func (*AttributeDef) UnmarshalJSON ¶
func (a *AttributeDef) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AttributeDefData ¶
type AttributeDefData struct { DefID string `json:"id"` Type attribute.Type `json:"type"` Placement attribute.Placement `json:"placement,omitempty"` Name string `json:"name"` FullName string `json:"full_name,omitempty"` AttributeBase string `json:"attribute_base,omitempty"` CostPerPoint fxp.Int `json:"cost_per_point,omitempty"` CostAdjPercentPerSM fxp.Int `json:"cost_adj_percent_per_sm,omitempty"` Thresholds []*PoolThreshold `json:"thresholds,omitempty"` }
AttributeDefData holds the data that will be serialized for the AttributeDef.
type AttributeDefs ¶
type AttributeDefs struct {
Set map[string]*AttributeDef
}
AttributeDefs holds a set of AttributeDef objects.
func AttributeDefsFor ¶
func AttributeDefsFor(entity *Entity) *AttributeDefs
AttributeDefsFor returns the AttributeDefs for the given Entity, or the global settings if the Entity is nil.
func FactoryAttributeDefs ¶
func FactoryAttributeDefs() *AttributeDefs
FactoryAttributeDefs returns the factory AttributeDef set.
func NewAttributeDefsFromFile ¶
func NewAttributeDefsFromFile(fileSystem fs.FS, filePath string) (*AttributeDefs, error)
NewAttributeDefsFromFile loads an AttributeDef set from a file.
func (*AttributeDefs) Hash ¶ added in v5.28.0
func (a *AttributeDefs) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*AttributeDefs) List ¶
func (a *AttributeDefs) List(omitSeparators bool) []*AttributeDef
List returns the map of AttributeDef objects as an ordered list.
func (*AttributeDefs) MarshalJSON ¶
func (a *AttributeDefs) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AttributeDefs) ResetTargetKeyPrefixes ¶
func (a *AttributeDefs) ResetTargetKeyPrefixes(prefixProvider func() string)
ResetTargetKeyPrefixes assigns new key prefixes for all data within these AttributeDefs.
func (*AttributeDefs) Save ¶
func (a *AttributeDefs) Save(filePath string) error
Save writes the AttributeDefs to the file as JSON.
func (*AttributeDefs) UnmarshalJSON ¶
func (a *AttributeDefs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AttributeDifficulty ¶
type AttributeDifficulty struct { Attribute string Difficulty difficulty.Level // contains filtered or unexported fields }
AttributeDifficulty holds an attribute ID and a difficulty.
func (*AttributeDifficulty) Description ¶
func (a *AttributeDifficulty) Description(entity *Entity) string
Description returns a formatted description.
func (*AttributeDifficulty) Hash ¶ added in v5.24.0
func (a *AttributeDifficulty) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*AttributeDifficulty) Key ¶
func (a *AttributeDifficulty) Key() string
Key returns the value that will be serialized.
func (*AttributeDifficulty) MarshalJSON ¶
func (a *AttributeDifficulty) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AttributeDifficulty) Normalize ¶
func (a *AttributeDifficulty) Normalize(entity *Entity)
Normalize the data. Should be called after loading from disk or the user.
func (AttributeDifficulty) ShouldOmit ¶
func (a AttributeDifficulty) ShouldOmit() bool
ShouldOmit implements json.Omitter.
func (*AttributeDifficulty) UnmarshalJSON ¶
func (a *AttributeDifficulty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AttributeFlags ¶
type AttributeFlags byte
AttributeFlags provides flags that can be set to extend the defined attribute choice list.
const ( BlankFlag AttributeFlags = 1 << iota TenFlag SizeFlag DodgeFlag ParryFlag BlockFlag SkillFlag )
Possible AttributeFlags.
type AttributePrereq ¶
type AttributePrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` Has bool `json:"has"` CombinedWith string `json:"combined_with,omitempty"` QualifierCriteria criteria.Number `json:"qualifier,omitempty"` Which string `json:"which"` }
AttributePrereq holds a prerequisite for an attribute.
func NewAttributePrereq ¶
func NewAttributePrereq(entity *Entity) *AttributePrereq
NewAttributePrereq creates a new AttributePrereq. 'entity' may be nil.
func (*AttributePrereq) Clone ¶
func (p *AttributePrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*AttributePrereq) FillWithNameableKeys ¶
func (p *AttributePrereq) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys implements Prereq.
func (*AttributePrereq) Hash ¶ added in v5.24.0
func (p *AttributePrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*AttributePrereq) ParentList ¶
func (p *AttributePrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*AttributePrereq) PrereqType ¶
func (p *AttributePrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*AttributePrereq) Satisfied ¶
func (p *AttributePrereq) Satisfied(entity *Entity, _ any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type Attributes ¶
Attributes holds a set of Attribute objects.
func NewAttributes ¶
func NewAttributes(entity *Entity) *Attributes
NewAttributes creates a new Attributes.
func (*Attributes) Clone ¶
func (a *Attributes) Clone(entity *Entity) *Attributes
Clone a copy of this.
func (*Attributes) Cost ¶
func (a *Attributes) Cost(attrID string) fxp.Int
Cost returns the points spent for the specified Attribute.
func (*Attributes) Current ¶
func (a *Attributes) Current(attrID string) fxp.Int
Current resolves the given attribute ID to its current value, or fxp.Min.
func (*Attributes) Hash ¶ added in v5.28.0
func (a *Attributes) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*Attributes) List ¶
func (a *Attributes) List() []*Attribute
List returns the map of Attribute objects as an ordered list.
func (*Attributes) MarshalJSON ¶
func (a *Attributes) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*Attributes) Maximum ¶
func (a *Attributes) Maximum(attrID string) fxp.Int
Maximum resolves the given attribute ID to its maximum value, or fxp.Min.
func (*Attributes) PoolThreshold ¶
func (a *Attributes) PoolThreshold(attrID, state string) fxp.Int
PoolThreshold resolves the given attribute ID and state to the value for its pool threshold, or fxp.Min.
func (*Attributes) UnmarshalJSON ¶
func (a *Attributes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Binding ¶ added in v5.9.0
type Binding struct { ID string KeyBinding unison.KeyBinding Action *unison.Action }
Binding holds a single key binding.
func CurrentBindings ¶ added in v5.9.0
func CurrentBindings() []*Binding
CurrentBindings returns a sorted list with the current bindings.
type BlockLayout ¶
type BlockLayout struct {
Layout []string
}
BlockLayout holds the sheet's block layout.
func NewBlockLayout ¶
func NewBlockLayout() *BlockLayout
NewBlockLayout creates a new default BlockLayout.
func NewBlockLayoutFromString ¶
func NewBlockLayoutFromString(str string) (blockLayout *BlockLayout, inputWasValid bool)
NewBlockLayoutFromString creates a new BlockLayout from an input string.
func (*BlockLayout) ByRow ¶
func (b *BlockLayout) ByRow() [][]string
ByRow breaks the layout down into rows.
func (*BlockLayout) EnsureValidity ¶
func (b *BlockLayout) EnsureValidity()
EnsureValidity checks the current settings for validity and if they aren't valid, makes them so.
func (*BlockLayout) HTMLGridTemplate ¶
func (b *BlockLayout) HTMLGridTemplate() string
HTMLGridTemplate returns the text for the HTML grid layout.
func (*BlockLayout) MarshalJSON ¶
func (b *BlockLayout) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BlockLayout) Reset ¶
func (b *BlockLayout) Reset()
Reset returns the BlockLayout to factory settings.
func (*BlockLayout) String ¶
func (b *BlockLayout) String() string
func (*BlockLayout) UnmarshalJSON ¶
func (b *BlockLayout) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Body ¶
Body holds a set of hit locations.
func BodyFor ¶
BodyFor returns the Body for the given Entity, or the global settings if the Entity is nil.
func FactoryBody ¶
func FactoryBody() *Body
FactoryBody returns a new copy of the default factory Body.
func NewBodyFromFile ¶
NewBodyFromFile loads a Body from a file.
func (*Body) AddLocation ¶
func (b *Body) AddLocation(loc *HitLocation)
AddLocation adds a HitLocation to the end of list.
func (*Body) Clone ¶
func (b *Body) Clone(entity *Entity, owningLocation *HitLocation) *Body
Clone a copy of this.
func (*Body) LookupLocationByID ¶
func (b *Body) LookupLocationByID(entity *Entity, idStr string) *HitLocation
LookupLocationByID returns the HitLocation that matches the given ID.
func (*Body) MarshalJSON ¶ added in v5.17.0
MarshalJSON implements json.Marshaler.
func (*Body) OwningLocation ¶
func (b *Body) OwningLocation() *HitLocation
OwningLocation returns the owning hit location, or nil if this is the top-level body.
func (*Body) RemoveLocation ¶
func (b *Body) RemoveLocation(loc *HitLocation)
RemoveLocation removes a HitLocation.
func (*Body) ResetTargetKeyPrefixes ¶
ResetTargetKeyPrefixes assigns new key prefixes for all data within this Body.
func (*Body) Rewrap ¶
func (b *Body) Rewrap()
Rewrap the description field. Should only be called for older data (prior to noNeedForRewrapVersion)
func (*Body) SetOwningLocation ¶
func (b *Body) SetOwningLocation(loc *HitLocation)
SetOwningLocation sets the owning HitLocation.
func (*Body) UniqueHitLocations ¶
func (b *Body) UniqueHitLocations(entity *Entity) []*HitLocation
UniqueHitLocations returns the list of unique hit locations.
func (*Body) UnmarshalJSON ¶ added in v5.17.0
UnmarshalJSON implements json.Unmarshaler.
type BodyData ¶ added in v5.17.0
type BodyData struct { Name string `json:"name,omitempty"` Roll *dice.Dice `json:"roll"` Locations []*HitLocation `json:"locations,omitempty"` }
BodyData holds the Body data that gets written to disk.
type Bonus ¶ added in v5.9.0
type Bonus interface { Feature // Owner returns the owner that is currently set. Owner() fmt.Stringer // SetOwner sets the owner to use. SetOwner(owner fmt.Stringer) // SubOwner returns the sub-owner that is currently set. SubOwner() fmt.Stringer // SetSubOwner sets the sub-owner to use. SetSubOwner(owner fmt.Stringer) // SetLevel sets the level. SetLevel(level fxp.Int) // AdjustedAmount returns the amount, adjusted for level, if requested. AdjustedAmount() fxp.Int // AddToTooltip adds this Bonus's details to the tooltip. 'buffer' may be nil. AddToTooltip(buffer *xio.ByteBuffer) }
Bonus is an extension of a Feature, which provides a numerical bonus or penalty.
type BonusOwner ¶ added in v5.11.0
type BonusOwner struct {
// contains filtered or unexported fields
}
BonusOwner provides a convenience for implementing the owner & sub-owner methods of Bonus.
func (*BonusOwner) DerivedLevel ¶ added in v5.19.0
func (b *BonusOwner) DerivedLevel() fxp.Int
DerivedLevel returns the level of the sub-owner or owner, if they are LeveledOwners.
func (*BonusOwner) Owner ¶ added in v5.11.0
func (b *BonusOwner) Owner() fmt.Stringer
Owner returns the owner that is currently set.
func (*BonusOwner) SetOwner ¶ added in v5.11.0
func (b *BonusOwner) SetOwner(owner fmt.Stringer)
SetOwner sets the owner to use.
func (*BonusOwner) SetSubOwner ¶ added in v5.11.0
func (b *BonusOwner) SetSubOwner(subOwner fmt.Stringer)
SetSubOwner sets the sub-owner to use.
func (*BonusOwner) SubOwner ¶ added in v5.11.0
func (b *BonusOwner) SubOwner() fmt.Stringer
SubOwner returns the sub-owner that is currently set.
type CalendarRef ¶ added in v5.9.0
CalendarRef holds a named reference to a calendar.
func LookupCalendarRef ¶ added in v5.9.0
func LookupCalendarRef(name string, libraries Libraries) *CalendarRef
LookupCalendarRef a CalendarRef by name.
func NewCalendarRefFromFS ¶ added in v5.9.0
func NewCalendarRefFromFS(fileSystem fs.FS, filePath string) (*CalendarRef, error)
NewCalendarRefFromFS creates a new CalendarRef from a file.
func (*CalendarRef) RandomBirthday ¶ added in v5.9.0
func (c *CalendarRef) RandomBirthday(not string) string
RandomBirthday generates a random birthday month and day.
type Campaign ¶ added in v5.16.2
type Campaign struct {
CampaignData
}
Campaign holds the data set to be used for a campaign.
func NewCampaign ¶ added in v5.16.2
func NewCampaign() *Campaign
NewCampaign creates a new Campaign.
func NewCampaignFromFile ¶ added in v5.16.2
NewCampaignFromFile loads a Campaign from a file.
func (*Campaign) MarshalJSON ¶ added in v5.16.2
MarshalJSON implements json.Marshaler.
type CampaignData ¶ added in v5.16.2
type CampaignData struct { Version int `json:"version"` ID tid.TID `json:"id"` SheetSettings *SheetSettings `json:"settings,omitempty"` Traits []*Trait `json:"traits,omitempty"` Skills []*Skill `json:"skills,omitempty"` Spells []*Spell `json:"spells,omitempty"` Equipment []*Equipment `json:"equipment,omitempty"` Notes []*Note `json:"notes,omitempty"` Templates []*Template `json:"templates,omitempty"` Characters []*Entity `json:"characters,omitempty"` Documents []*Document `json:"documents,omitempty"` }
CampaignData holds the campaign file data.
type CellData ¶
type CellData struct { Type cell.Type Disabled bool Dim bool Checked bool Alignment align.Enum Primary string Secondary string Tooltip string UnsatisfiedReason string TemplateInfo string InlineTag string }
CellData holds data for creating a cell's visual representation.
type CollegeList ¶
type CollegeList []string
CollegeList holds a list of college names. This exists solely due to legacy file formats that stored this as a single string with ' or ' or '/' separating the colleges. We need to be able to load both types.
func (*CollegeList) UnmarshalJSON ¶
func (c *CollegeList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConditionalModifier ¶
ConditionalModifier holds data for a reaction or conditional modifier.
func NewConditionalModifier ¶ added in v5.9.0
func NewConditionalModifier(source, from string, amt fxp.Int) *ConditionalModifier
NewConditionalModifier creates a new ConditionalModifier.
func (*ConditionalModifier) Add ¶
func (c *ConditionalModifier) Add(source string, amt fxp.Int)
Add another source.
func (*ConditionalModifier) ApplyNameableKeys ¶
func (c *ConditionalModifier) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*ConditionalModifier) CellData ¶
func (c *ConditionalModifier) CellData(columnID int, data *CellData)
CellData returns the cell data information for the given column.
func (*ConditionalModifier) ClearSource ¶ added in v5.24.0
func (c *ConditionalModifier) ClearSource()
ClearSource clears the source of this data.
func (*ConditionalModifier) Clone ¶
func (c *ConditionalModifier) Clone(_ LibraryFile, _ DataOwner, _ *ConditionalModifier, preserveID bool) *ConditionalModifier
Clone implements Node.
func (*ConditionalModifier) Compare ¶ added in v5.19.0
func (c *ConditionalModifier) Compare(other *ConditionalModifier) int
Compare returns -1, 0, 1 if this is less than, equal to, or greater than the other.
func (*ConditionalModifier) Container ¶
func (c *ConditionalModifier) Container() bool
Container returns true if this is a container.
func (*ConditionalModifier) DataOwner ¶ added in v5.24.0
func (c *ConditionalModifier) DataOwner() DataOwner
DataOwner always returns nil.
func (*ConditionalModifier) Enabled ¶
func (c *ConditionalModifier) Enabled() bool
Enabled returns true if this node is enabled.
func (*ConditionalModifier) FillWithNameableKeys ¶
func (c *ConditionalModifier) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*ConditionalModifier) GetSource ¶ added in v5.24.0
func (c *ConditionalModifier) GetSource() Source
GetSource returns the source of this data.
func (*ConditionalModifier) HasChildren ¶
func (c *ConditionalModifier) HasChildren() bool
HasChildren returns true if this node has children.
func (*ConditionalModifier) Hash ¶ added in v5.24.0
func (c *ConditionalModifier) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*ConditionalModifier) ID ¶
func (c *ConditionalModifier) ID() tid.TID
ID returns the local ID of this data.
func (*ConditionalModifier) IsOpen ¶ added in v5.24.0
func (c *ConditionalModifier) IsOpen() bool
IsOpen returns true if this node is currently open.
func (*ConditionalModifier) Kind ¶
func (c *ConditionalModifier) Kind() string
Kind returns the kind of data.
func (*ConditionalModifier) NameableReplacements ¶ added in v5.25.0
func (c *ConditionalModifier) NameableReplacements() map[string]string
NameableReplacements returns the replacements to be used with Nameables.
func (*ConditionalModifier) NodeChildren ¶
func (c *ConditionalModifier) NodeChildren() []*ConditionalModifier
NodeChildren returns the children of this node, if any.
func (*ConditionalModifier) Parent ¶
func (c *ConditionalModifier) Parent() *ConditionalModifier
Parent returns the parent.
func (*ConditionalModifier) SetChildren ¶
func (c *ConditionalModifier) SetChildren(_ []*ConditionalModifier)
SetChildren sets the children of this node.
func (*ConditionalModifier) SetDataOwner ¶ added in v5.24.0
func (c *ConditionalModifier) SetDataOwner(_ DataOwner)
SetDataOwner does nothing.
func (*ConditionalModifier) SetOpen ¶
func (c *ConditionalModifier) SetOpen(_ bool)
SetOpen sets the current open state for this node.
func (*ConditionalModifier) SetParent ¶
func (c *ConditionalModifier) SetParent(_ *ConditionalModifier)
SetParent sets the parent.
func (*ConditionalModifier) String ¶ added in v5.9.0
func (c *ConditionalModifier) String() string
func (*ConditionalModifier) SyncWithSource ¶ added in v5.24.0
func (c *ConditionalModifier) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*ConditionalModifier) Total ¶
func (c *ConditionalModifier) Total() fxp.Int
Total returns the total of all amounts.
type ConditionalModifierBonus ¶ added in v5.9.0
type ConditionalModifierBonus struct { Type feature.Type `json:"type"` Situation string `json:"situation,omitempty"` LeveledAmount BonusOwner }
ConditionalModifierBonus holds the data for a conditional modifier bonus.
func NewConditionalModifierBonus ¶ added in v5.9.0
func NewConditionalModifierBonus() *ConditionalModifierBonus
NewConditionalModifierBonus creates a new ConditionalModifierBonus.
func (*ConditionalModifierBonus) AddToTooltip ¶ added in v5.9.0
func (c *ConditionalModifierBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*ConditionalModifierBonus) Clone ¶ added in v5.9.0
func (c *ConditionalModifierBonus) Clone() Feature
Clone implements Feature.
func (*ConditionalModifierBonus) FeatureType ¶ added in v5.9.0
func (c *ConditionalModifierBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*ConditionalModifierBonus) FillWithNameableKeys ¶ added in v5.9.0
func (c *ConditionalModifierBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*ConditionalModifierBonus) Hash ¶ added in v5.25.0
func (c *ConditionalModifierBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*ConditionalModifierBonus) SetLevel ¶ added in v5.9.0
func (c *ConditionalModifierBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type ConditionalModifierListProvider ¶
type ConditionalModifierListProvider interface { DataOwnerProvider ConditionalModifiers() []*ConditionalModifier }
ConditionalModifierListProvider defines the methods needed to access the conditional modifier list data.
type ContainedQuantityPrereq ¶
type ContainedQuantityPrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` Has bool `json:"has"` QualifierCriteria criteria.Number `json:"qualifier,omitempty"` }
ContainedQuantityPrereq holds a prerequisite for an equipment contained quantity.
func NewContainedQuantityPrereq ¶
func NewContainedQuantityPrereq() *ContainedQuantityPrereq
NewContainedQuantityPrereq creates a new ContainedQuantityPrereq.
func (*ContainedQuantityPrereq) Clone ¶
func (p *ContainedQuantityPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*ContainedQuantityPrereq) FillWithNameableKeys ¶
func (p *ContainedQuantityPrereq) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys implements Prereq.
func (*ContainedQuantityPrereq) Hash ¶ added in v5.24.0
func (p *ContainedQuantityPrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*ContainedQuantityPrereq) ParentList ¶
func (p *ContainedQuantityPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*ContainedQuantityPrereq) PrereqType ¶
func (p *ContainedQuantityPrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*ContainedQuantityPrereq) Satisfied ¶
func (p *ContainedQuantityPrereq) Satisfied(_ *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type ContainedWeightPrereq ¶
type ContainedWeightPrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` Has bool `json:"has"` WeightCriteria criteria.Weight `json:"qualifier,omitempty"` }
ContainedWeightPrereq holds a prerequisite for an equipment contained weight.
func NewContainedWeightPrereq ¶
func NewContainedWeightPrereq(entity *Entity) *ContainedWeightPrereq
NewContainedWeightPrereq creates a new ContainedWeightPrereq.
func (*ContainedWeightPrereq) Clone ¶
func (p *ContainedWeightPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*ContainedWeightPrereq) FillWithNameableKeys ¶
func (p *ContainedWeightPrereq) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys implements Prereq.
func (*ContainedWeightPrereq) Hash ¶ added in v5.24.0
func (p *ContainedWeightPrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*ContainedWeightPrereq) ParentList ¶
func (p *ContainedWeightPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*ContainedWeightPrereq) PrereqType ¶
func (p *ContainedWeightPrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*ContainedWeightPrereq) Satisfied ¶
func (p *ContainedWeightPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type ContainedWeightReduction ¶ added in v5.9.0
type ContainedWeightReduction struct { Type feature.Type `json:"type"` Reduction string `json:"reduction"` }
ContainedWeightReduction holds the data for a weight reduction that can be applied to a container's contents.
func NewContainedWeightReduction ¶ added in v5.9.0
func NewContainedWeightReduction() *ContainedWeightReduction
NewContainedWeightReduction creates a new ContainedWeightReduction.
func (*ContainedWeightReduction) Clone ¶ added in v5.9.0
func (c *ContainedWeightReduction) Clone() Feature
Clone implements Feature.
func (*ContainedWeightReduction) FeatureType ¶ added in v5.9.0
func (c *ContainedWeightReduction) FeatureType() feature.Type
FeatureType implements Feature.
func (*ContainedWeightReduction) FillWithNameableKeys ¶ added in v5.9.0
func (c *ContainedWeightReduction) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys implements Feature.
func (*ContainedWeightReduction) FixedReduction ¶ added in v5.9.0
func (c *ContainedWeightReduction) FixedReduction(defUnits fxp.WeightUnit) fxp.Weight
FixedReduction returns the fixed amount the weight should be reduced by. Will return 0 if this is a percentage.
func (*ContainedWeightReduction) Hash ¶ added in v5.24.0
func (c *ContainedWeightReduction) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*ContainedWeightReduction) IsPercentageReduction ¶ added in v5.9.0
func (c *ContainedWeightReduction) IsPercentageReduction() bool
IsPercentageReduction returns true if this is a percentage reduction and not a fixed amount.
func (*ContainedWeightReduction) PercentageReduction ¶ added in v5.9.0
func (c *ContainedWeightReduction) PercentageReduction() fxp.Int
PercentageReduction returns the percentage (where 1% is 1, not 0.01) the weight should be reduced by. Will return 0 if this is not a percentage.
type CostReduction ¶ added in v5.9.0
type CostReduction struct { Type feature.Type `json:"type"` Attribute string `json:"attribute,omitempty"` Percentage fxp.Int `json:"percentage,omitempty"` }
CostReduction holds the data for a cost reduction.
func NewCostReduction ¶ added in v5.9.0
func NewCostReduction(attrID string) *CostReduction
NewCostReduction creates a new CostReduction.
func (*CostReduction) Clone ¶ added in v5.9.0
func (c *CostReduction) Clone() Feature
Clone implements Feature.
func (*CostReduction) FeatureType ¶ added in v5.9.0
func (c *CostReduction) FeatureType() feature.Type
FeatureType implements Feature.
func (*CostReduction) FillWithNameableKeys ¶ added in v5.9.0
func (c *CostReduction) FillWithNameableKeys(_, _ map[string]string)
FillWithNameableKeys implements Feature.
func (*CostReduction) Hash ¶ added in v5.24.0
func (c *CostReduction) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
type DRBonus ¶ added in v5.9.0
type DRBonus struct { DRBonusData BonusOwner }
DRBonus holds the data for a DR adjustment.
func (*DRBonus) AddToTooltip ¶ added in v5.9.0
func (d *DRBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*DRBonus) FeatureType ¶ added in v5.9.0
FeatureType implements Feature.
func (*DRBonus) FillWithNameableKeys ¶ added in v5.9.0
FillWithNameableKeys implements Feature.
func (*DRBonus) MarshalJSON ¶ added in v5.9.0
MarshalJSON implements json.Marshaler.
func (*DRBonus) Normalize ¶ added in v5.9.0
func (d *DRBonus) Normalize()
Normalize adjusts the data to it preferred representation.
func (*DRBonus) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements json.Unmarshaler.
type DRBonusData ¶ added in v5.9.0
type DRBonusData struct { Type feature.Type `json:"type"` Locations []string `json:"locations,omitempty"` Specialization string `json:"specialization,omitempty"` LeveledAmount }
DRBonusData is split out so that it can be adjusted before and after being serialized.
type DataOwner ¶ added in v5.24.0
type DataOwner interface { OwningEntity() *Entity SourceMatcher() *SrcMatcher }
DataOwner defines the methods required of data owners.
type DataOwnerProvider ¶ added in v5.24.0
type DataOwnerProvider interface {
DataOwner() DataOwner
}
DataOwnerProvider provides a way to retrieve a (possibly nil) data owner.
type Document ¶ added in v5.16.2
type Document struct { Name string `json:"name"` Ext string `json:"ext"` Content []byte `json:"content"` Compressed bool `json:"compressed,omitempty"` }
Document holds the raw data for a document.
func NewDocument ¶ added in v5.16.2
NewDocument creates a new document.
func (*Document) UncompressedContent ¶ added in v5.16.2
UncompressedContent expands the content, if needed, and returns the uncompressed data.
type EditorData ¶
type EditorData[T NodeTypes] interface { // CopyFrom copies the corresponding data from the node into this editor data. CopyFrom(T) // ApplyTo copies the editor data into the provided node. ApplyTo(T) }
EditorData defines the methods required of editor data.
type Entity ¶
type Entity struct { EntityData LiftingStrengthBonus fxp.Int StrikingStrengthBonus fxp.Int ThrowingStrengthBonus fxp.Int DodgeBonus fxp.Int ParryBonus fxp.Int ParryBonusTooltip string BlockBonus fxp.Int BlockBonusTooltip string // contains filtered or unexported fields }
Entity holds the base information for various types of entities: PC, NPC, Creature, etc.
func EntityFromNode ¶ added in v5.24.0
EntityFromNode returns the owning entity of the node, or nil.
func NewEntityFromFile ¶
NewEntityFromFile loads an Entity from a file.
func (*Entity) AddDRBonusesFor ¶
func (e *Entity) AddDRBonusesFor(locationID string, tooltip *xio.ByteBuffer, drMap map[string]int) map[string]int
AddDRBonusesFor locates any active DR bonuses and adds them to the map. If 'drMap' is nil, it will be created. The provided map (or the newly created one) will be returned.
func (*Entity) AddNamedWeaponBonusesFor ¶ added in v5.2.0
func (e *Entity) AddNamedWeaponBonusesFor(nameQualifier, usageQualifier string, tagsQualifier []string, dieCount int, tooltip *xio.ByteBuffer, m map[*WeaponBonus]bool, allowedFeatureTypes map[feature.Type]bool) map[*WeaponBonus]bool
AddNamedWeaponBonusesFor adds the bonuses for matching weapons that match to the map. If 'm' is nil, it will be created. The provided map (or the newly created one) will be returned.
func (*Entity) AddWeaponWithSkillBonusesFor ¶ added in v5.9.0
func (e *Entity) AddWeaponWithSkillBonusesFor(name, specialization, usage string, tags []string, dieCount int, tooltip *xio.ByteBuffer, m map[*WeaponBonus]bool, allowedFeatureTypes map[feature.Type]bool) map[*WeaponBonus]bool
AddWeaponWithSkillBonusesFor adds the bonuses for matching weapons that match to the map. If 'm' is nil, it will be created. The provided map (or the newly created one) will be returned.
func (*Entity) AttributeBonusFor ¶ added in v5.9.0
func (e *Entity) AttributeBonusFor(attributeID string, limitation stlimit.Option, tooltip *xio.ByteBuffer) fxp.Int
AttributeBonusFor returns the bonus for the given attribute.
func (*Entity) BasicLiftForST ¶ added in v5.9.0
BasicLiftForST returns the entity's Basic Lift as if their base ST was the given value.
func (*Entity) BestSkillNamed ¶
func (e *Entity) BestSkillNamed(name, specialization string, requirePoints bool, excludes map[string]bool) *Skill
BestSkillNamed returns the best skill that matches.
func (*Entity) CarriedEquipmentList ¶
CarriedEquipmentList implements ListProvider
func (*Entity) CarryOnBack ¶
CarryOnBack returns the carry on back value.
func (*Entity) ConditionalModifiers ¶
func (e *Entity) ConditionalModifiers() []*ConditionalModifier
ConditionalModifiers returns the current set of conditional modifiers.
func (*Entity) CostReductionFor ¶
CostReductionFor returns the total cost reduction for the given ID.
func (*Entity) DiscardCaches ¶ added in v5.2.0
func (e *Entity) DiscardCaches()
DiscardCaches discards the internal caches.
func (*Entity) Dodge ¶
func (e *Entity) Dodge(enc encumbrance.Level) int
Dodge returns the current Dodge value for the given Encumbrance.
func (*Entity) EmbeddedEval ¶ added in v5.16.0
EmbeddedEval resolves an embedded expression.
func (*Entity) EncumbranceLevel ¶
func (e *Entity) EncumbranceLevel(forSkills bool) encumbrance.Level
EncumbranceLevel returns the current Encumbrance level.
func (*Entity) EquippedWeapons ¶
EquippedWeapons returns a sorted list of equipped weapons.
func (*Entity) LiftingStrength ¶ added in v5.9.0
LiftingStrength returns the adjusted ST for lifting purposes.
func (*Entity) LiftingSwing ¶ added in v5.22.0
LiftingSwing returns the lifting swing value for the current strength.
func (*Entity) LiftingThrust ¶ added in v5.22.0
LiftingThrust returns the lifting thrust value for the current strength.
func (*Entity) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Entity) MaximumCarry ¶
func (e *Entity) MaximumCarry(enc encumbrance.Level) fxp.Weight
MaximumCarry returns the maximum amount the Entity can carry for the specified encumbrance level.
func (*Entity) Move ¶
func (e *Entity) Move(enc encumbrance.Level) int
Move returns the current Move value for the given Encumbrance.
func (*Entity) NamedWeaponSkillBonusesFor ¶
func (e *Entity) NamedWeaponSkillBonusesFor(name, usage string, tags []string, tooltip *xio.ByteBuffer) []*SkillBonus
NamedWeaponSkillBonusesFor returns the bonuses for matching weapons.
func (*Entity) OneHandedLift ¶
OneHandedLift returns the one-handed lift value.
func (*Entity) OtherEquipmentList ¶
OtherEquipmentList implements ListProvider
func (*Entity) OwningEntity ¶ added in v5.24.0
OwningEntity returns the Entity.
func (*Entity) PointsBreakdown ¶ added in v5.9.0
func (e *Entity) PointsBreakdown() *PointsBreakdown
PointsBreakdown returns the point breakdown for spent points.
func (*Entity) PreservesUserDesc ¶
PreservesUserDesc returns true if the user description widget should be preserved when written to disk. Normally, only character sheets should return true for this.
func (*Entity) Reactions ¶
func (e *Entity) Reactions() []*ConditionalModifier
Reactions returns the current set of reactions.
func (*Entity) ResolveAttribute ¶
ResolveAttribute resolves the given attribute ID to its Attribute, or nil.
func (*Entity) ResolveAttributeCurrent ¶
ResolveAttributeCurrent resolves the given attribute ID to its current value, or fxp.Min.
func (*Entity) ResolveAttributeDef ¶
func (e *Entity) ResolveAttributeDef(attrID string) *AttributeDef
ResolveAttributeDef resolves the given attribute ID to its AttributeDef, or nil.
func (*Entity) ResolveAttributeName ¶
ResolveAttributeName resolves the given attribute ID to its name, or <unknown>.
func (*Entity) ResolveVariable ¶
ResolveVariable implements eval.VariableResolver.
func (*Entity) RunningShoveAndKnockOver ¶
RunningShoveAndKnockOver returns the running shove & knock over value.
func (*Entity) SetCarriedEquipmentList ¶
SetCarriedEquipmentList implements ListProvider
func (*Entity) SetNoteList ¶
SetNoteList implements ListProvider
func (*Entity) SetOtherEquipmentList ¶
SetOtherEquipmentList implements ListProvider
func (*Entity) SetPointsRecord ¶ added in v5.3.0
func (e *Entity) SetPointsRecord(record []*PointsRecord)
SetPointsRecord sets a new points record list, adjusting the total points.
func (*Entity) SetSkillList ¶
SetSkillList implements ListProvider
func (*Entity) SetSpellList ¶
SetSpellList implements ListProvider
func (*Entity) SetTraitList ¶
SetTraitList implements ListProvider
func (*Entity) SetUnspentPoints ¶
SetUnspentPoints sets the number of unspent points.
func (*Entity) SetWeapons ¶
SetWeapons implements WeaponListProvider.
func (*Entity) ShiftSlightly ¶
ShiftSlightly returns the shift slightly value.
func (*Entity) ShoveAndKnockOver ¶
ShoveAndKnockOver returns the shove & knock over value.
func (*Entity) SkillBonusFor ¶ added in v5.9.0
func (e *Entity) SkillBonusFor(name, specialization string, tags []string, tooltip *xio.ByteBuffer) fxp.Int
SkillBonusFor returns the total bonus for the matching skill bonuses.
func (*Entity) SkillNamed ¶
func (e *Entity) SkillNamed(name, specialization string, requirePoints bool, excludes map[string]bool) []*Skill
SkillNamed returns a list of skills that match.
func (*Entity) SkillPointBonusFor ¶ added in v5.9.0
func (e *Entity) SkillPointBonusFor(name, specialization string, tags []string, tooltip *xio.ByteBuffer) fxp.Int
SkillPointBonusFor returns the total point bonus for the matching skill point bonuses.
func (*Entity) SourceMatcher ¶ added in v5.24.0
func (e *Entity) SourceMatcher() *SrcMatcher
SourceMatcher returns the SourceMatcher.
func (*Entity) SpellBonusFor ¶ added in v5.9.0
func (e *Entity) SpellBonusFor(name, powerSource string, colleges, tags []string, tooltip *xio.ByteBuffer) fxp.Int
SpellBonusFor returns the total bonus for the matching spell bonuses.
func (*Entity) SpellPointBonusFor ¶ added in v5.9.0
func (e *Entity) SpellPointBonusFor(name, powerSource string, colleges, tags []string, tooltip *xio.ByteBuffer) fxp.Int
SpellPointBonusFor returns the total point bonus for the matching spell point bonuses.
func (*Entity) StrikingStrength ¶ added in v5.9.0
StrikingStrength returns the adjusted ST for striking purposes.
func (*Entity) SyncWithLibrarySources ¶ added in v5.26.0
func (e *Entity) SyncWithLibrarySources()
SyncWithLibrarySources syncs the entity with the library sources.
func (*Entity) TelekineticStrength ¶ added in v5.22.0
TelekineticStrength returns the total telekinetic strength.
func (*Entity) ThrowingStrength ¶ added in v5.9.0
ThrowingStrength returns the adjusted ST for throwing purposes.
func (*Entity) TwoHandedLift ¶
TwoHandedLift returns the two-handed lift value.
func (*Entity) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Entity) UnspentPoints ¶
UnspentPoints returns the number of unspent points.
func (*Entity) UpdateSkills ¶
UpdateSkills updates the levels of all skills.
func (*Entity) UpdateSpells ¶
UpdateSpells updates the levels of all spells.
func (*Entity) WealthCarried ¶
WealthCarried returns the current wealth being carried.
func (*Entity) WealthNotCarried ¶
WealthNotCarried returns the current wealth not being carried.
func (*Entity) WeaponOwner ¶
func (e *Entity) WeaponOwner() WeaponOwner
WeaponOwner implements WeaponListProvider. In the case of an Entity, always returns nil, as entities rely on sub-components for their weapons and don't allow them to be created directly.
type EntityData ¶
type EntityData struct { Version int `json:"version"` ID tid.TID `json:"id"` TotalPoints fxp.Int `json:"total_points"` PointsRecord []*PointsRecord `json:"points_record,omitempty"` Profile Profile `json:"profile"` SheetSettings *SheetSettings `json:"settings,omitempty"` Attributes *Attributes `json:"attributes,omitempty"` Traits []*Trait `json:"traits,alt=advantages,omitempty"` Skills []*Skill `json:"skills,omitempty"` Spells []*Spell `json:"spells,omitempty"` CarriedEquipment []*Equipment `json:"equipment,omitempty"` OtherEquipment []*Equipment `json:"other_equipment,omitempty"` Notes []*Note `json:"notes,omitempty"` CreatedOn jio.Time `json:"created_date"` ModifiedOn jio.Time `json:"modified_date"` ThirdParty map[string]any `json:"third_party,omitempty"` }
EntityData holds the Entity data that is written to disk.
type Equipment ¶
type Equipment struct { EquipmentData UnsatisfiedReason string // contains filtered or unexported fields }
Equipment holds a piece of equipment.
func NewEquipment ¶
NewEquipment creates a new Equipment.
func NewEquipmentFromFile ¶
NewEquipmentFromFile loads an Equipment list from a file.
func (*Equipment) ActiveModifierFor ¶
func (e *Equipment) ActiveModifierFor(name string) *EquipmentModifier
ActiveModifierFor returns the first modifier that matches the name (case-insensitive).
func (*Equipment) AdjustedValue ¶
AdjustedValue returns the value after adjustments for any modifiers. Does not include the value of children.
func (*Equipment) AdjustedWeight ¶
AdjustedWeight returns the weight after adjustments for any modifiers. Does not include the weight of children.
func (*Equipment) ApplyNameableKeys ¶
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*Equipment) CanConvertToFromContainer ¶ added in v5.24.0
CanConvertToFromContainer returns true if this node can be converted to/from a container.
func (*Equipment) ClearSource ¶ added in v5.24.0
func (e *Equipment) ClearSource()
ClearSource clears the source of this data.
func (*Equipment) ClearUnusedFieldsForType ¶ added in v5.24.0
func (e *Equipment) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*Equipment) Clone ¶
func (e *Equipment) Clone(from LibraryFile, owner DataOwner, parent *Equipment, preserveID bool) *Equipment
Clone implements Node.
func (*Equipment) ConvertToContainer ¶ added in v5.24.0
func (e *Equipment) ConvertToContainer()
ConvertToContainer converts this node to a container.
func (*Equipment) ConvertToNonContainer ¶ added in v5.24.0
func (e *Equipment) ConvertToNonContainer()
ConvertToNonContainer converts this node to a non-container.
func (*Equipment) CurrentLevel ¶ added in v5.26.0
CurrentLevel returns the current level of the equipment or zero if it is not leveled.
func (*Equipment) Description ¶
Description returns a description, which doesn't include any levels.
func (*Equipment) DisplayLegalityClass ¶
DisplayLegalityClass returns a display version of the LegalityClass.
func (*Equipment) ExtendedValue ¶
ExtendedValue returns the extended value.
func (*Equipment) ExtendedWeight ¶
ExtendedWeight returns the extended weight.
func (*Equipment) FeatureList ¶
FeatureList returns the list of Features.
func (*Equipment) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Equipment) HasChildren ¶ added in v5.24.0
HasChildren returns true if this node has children.
func (*Equipment) Hash ¶ added in v5.24.0
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*Equipment) IsLeveled ¶ added in v5.26.0
IsLeveled returns true if the equipment is capable of having levels.
func (*Equipment) LocalNotesWithReplacements ¶ added in v5.25.0
LocalNotesWithReplacements returns the local notes with any replacements applied.
func (*Equipment) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Equipment) ModifierNotes ¶
ModifierNotes returns the notes due to modifiers.
func (*Equipment) NameWithReplacements ¶ added in v5.25.0
NameWithReplacements returns the name with any replacements applied.
func (*Equipment) NameableReplacements ¶ added in v5.25.0
NameableReplacements returns the replacements to be used with Nameables.
func (*Equipment) NodeChildren ¶ added in v5.24.0
NodeChildren returns the children of this node, if any.
func (*Equipment) RatedStrength ¶ added in v5.11.0
RatedStrength always return 0 for traits.
func (*Equipment) RequiresTL ¶
RequiresTL implements TechLevelProvider.
func (*Equipment) SecondaryText ¶
SecondaryText returns the "secondary" text: the text display below the description.
func (*Equipment) SetChildren ¶ added in v5.24.0
SetChildren sets the children of this node.
func (*Equipment) SetDataOwner ¶ added in v5.24.0
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*Equipment) SyncWithSource ¶ added in v5.24.0
func (e *Equipment) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*Equipment) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type EquipmentData ¶
type EquipmentData struct { SourcedID EquipmentEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*Equipment `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
EquipmentData holds the Equipment data that is written to disk.
type EquipmentEditData ¶
type EquipmentEditData struct { EquipmentSyncData VTTNotes string `json:"vtt_notes,omitempty"` Replacements map[string]string `json:"replacements,omitempty"` Modifiers []*EquipmentModifier `json:"modifiers,omitempty"` RatedST fxp.Int `json:"rated_strength,omitempty"` Quantity fxp.Int `json:"quantity,omitempty"` Level fxp.Int `json:"level,omitempty"` Uses int `json:"uses,omitempty"` Equipped bool `json:"equipped,omitempty"` }
EquipmentEditData holds the Equipment data that can be edited by the UI detail editor.
func (*EquipmentEditData) ApplyTo ¶
func (e *EquipmentEditData) ApplyTo(other *Equipment)
ApplyTo implements node.EditorData.
func (*EquipmentEditData) CopyFrom ¶
func (e *EquipmentEditData) CopyFrom(other *Equipment)
CopyFrom implements node.EditorData.
type EquipmentListProvider ¶
type EquipmentListProvider interface { DataOwnerProvider CarriedEquipmentList() []*Equipment SetCarriedEquipmentList(list []*Equipment) OtherEquipmentList() []*Equipment SetOtherEquipmentList(list []*Equipment) }
EquipmentListProvider defines the methods needed to access the equipment list data.
type EquipmentModifier ¶
type EquipmentModifier struct { EquipmentModifierData // contains filtered or unexported fields }
EquipmentModifier holds a modifier to a piece of Equipment.
func NewEquipmentModifier ¶
func NewEquipmentModifier(owner DataOwner, parent *EquipmentModifier, container bool) *EquipmentModifier
NewEquipmentModifier creates an EquipmentModifier.
func NewEquipmentModifiersFromFile ¶
func NewEquipmentModifiersFromFile(fileSystem fs.FS, filePath string) ([]*EquipmentModifier, error)
NewEquipmentModifiersFromFile loads an EquipmentModifier list from a file.
func (*EquipmentModifier) ApplyNameableKeys ¶
func (e *EquipmentModifier) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys replaces any nameable keys found in this EquipmentModifier with the corresponding values in the provided map.
func (*EquipmentModifier) CellData ¶
func (e *EquipmentModifier) CellData(columnID int, data *CellData)
CellData returns the cell data information for the given column.
func (*EquipmentModifier) ClearSource ¶ added in v5.24.0
func (e *EquipmentModifier) ClearSource()
ClearSource clears the source of this data.
func (*EquipmentModifier) ClearUnusedFieldsForType ¶ added in v5.24.0
func (e *EquipmentModifier) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*EquipmentModifier) Clone ¶
func (e *EquipmentModifier) Clone(from LibraryFile, owner DataOwner, parent *EquipmentModifier, preserveID bool) *EquipmentModifier
Clone implements Node.
func (*EquipmentModifier) Container ¶ added in v5.24.0
func (e *EquipmentModifier) Container() bool
Container returns true if this is a container.
func (*EquipmentModifier) CostDescription ¶
func (e *EquipmentModifier) CostDescription() string
CostDescription returns the formatted cost.
func (*EquipmentModifier) CostMultiplier ¶ added in v5.26.0
func (e *EquipmentModifier) CostMultiplier() fxp.Int
CostMultiplier returns the amount to multiply the cost by.
func (*EquipmentModifier) DataOwner ¶ added in v5.24.0
func (e *EquipmentModifier) DataOwner() DataOwner
DataOwner returns the data owner.
func (*EquipmentModifier) Depth ¶
func (e *EquipmentModifier) Depth() int
Depth returns the number of parents this node has.
func (*EquipmentModifier) Enabled ¶
func (e *EquipmentModifier) Enabled() bool
Enabled returns true if this node is enabled.
func (*EquipmentModifier) FillWithNameableKeys ¶
func (e *EquipmentModifier) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys adds any nameable keys found in this EquipmentModifier to the provided map.
func (*EquipmentModifier) FullCostDescription ¶ added in v5.2.0
func (e *EquipmentModifier) FullCostDescription() string
FullCostDescription returns a combination of the cost and weight descriptions.
func (*EquipmentModifier) FullDescription ¶
func (e *EquipmentModifier) FullDescription() string
FullDescription returns a full description.
func (*EquipmentModifier) GetSource ¶ added in v5.24.0
func (e *EquipmentModifier) GetSource() Source
GetSource returns the source of this data.
func (*EquipmentModifier) HasChildren ¶ added in v5.24.0
func (e *EquipmentModifier) HasChildren() bool
HasChildren returns true if this node has children.
func (*EquipmentModifier) Hash ¶ added in v5.24.0
func (e *EquipmentModifier) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*EquipmentModifier) ID ¶ added in v5.24.0
func (e *EquipmentModifier) ID() tid.TID
ID returns the local ID of this data.
func (*EquipmentModifier) IsOpen ¶ added in v5.24.0
func (e *EquipmentModifier) IsOpen() bool
IsOpen returns true if this node is currently open.
func (*EquipmentModifier) Kind ¶ added in v5.24.0
func (e *EquipmentModifier) Kind() string
Kind returns the kind of data.
func (*EquipmentModifier) LocalNotesWithReplacements ¶ added in v5.25.0
func (e *EquipmentModifier) LocalNotesWithReplacements() string
LocalNotesWithReplacements returns the local notes with any replacements applied.
func (*EquipmentModifier) MarshalJSON ¶
func (e *EquipmentModifier) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*EquipmentModifier) NameWithReplacements ¶ added in v5.25.0
func (e *EquipmentModifier) NameWithReplacements() string
NameWithReplacements returns the name with any replacements applied.
func (*EquipmentModifier) NameableReplacements ¶ added in v5.25.0
func (e *EquipmentModifier) NameableReplacements() map[string]string
NameableReplacements returns the replacements to be used with Nameables.
func (*EquipmentModifier) NodeChildren ¶ added in v5.24.0
func (e *EquipmentModifier) NodeChildren() []*EquipmentModifier
NodeChildren returns the children of this node, if any.
func (*EquipmentModifier) OwningEquipment ¶ added in v5.26.0
func (e *EquipmentModifier) OwningEquipment() *Equipment
OwningEquipment returns the owning equipment.
func (*EquipmentModifier) Parent ¶ added in v5.24.0
func (e *EquipmentModifier) Parent() *EquipmentModifier
Parent returns the parent.
func (*EquipmentModifier) SecondaryText ¶
func (e *EquipmentModifier) SecondaryText(optionChecker func(display.Option) bool) string
SecondaryText returns the "secondary" text: the text display below an Trait.
func (*EquipmentModifier) SetChildren ¶ added in v5.24.0
func (e *EquipmentModifier) SetChildren(children []*EquipmentModifier)
SetChildren sets the children of this node.
func (*EquipmentModifier) SetDataOwner ¶ added in v5.24.0
func (e *EquipmentModifier) SetDataOwner(owner DataOwner)
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*EquipmentModifier) SetEnabled ¶
func (e *EquipmentModifier) SetEnabled(enabled bool)
SetEnabled makes the node enabled, if possible.
func (*EquipmentModifier) SetOpen ¶ added in v5.24.0
func (e *EquipmentModifier) SetOpen(open bool)
SetOpen sets the current open state for this node.
func (*EquipmentModifier) SetParent ¶ added in v5.24.0
func (e *EquipmentModifier) SetParent(parent *EquipmentModifier)
SetParent sets the parent.
func (*EquipmentModifier) String ¶
func (e *EquipmentModifier) String() string
func (*EquipmentModifier) SyncWithSource ¶ added in v5.24.0
func (e *EquipmentModifier) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*EquipmentModifier) TagList ¶ added in v5.2.0
func (e *EquipmentModifier) TagList() []string
TagList returns the list of tags.
func (*EquipmentModifier) UnmarshalJSON ¶
func (e *EquipmentModifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*EquipmentModifier) WeightDescription ¶
func (e *EquipmentModifier) WeightDescription() string
WeightDescription returns the formatted weight.
func (*EquipmentModifier) WeightMultiplier ¶ added in v5.26.0
func (e *EquipmentModifier) WeightMultiplier() fxp.Int
WeightMultiplier returns the amount to multiply the weight by.
type EquipmentModifierData ¶
type EquipmentModifierData struct { SourcedID EquipmentModifierEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*EquipmentModifier `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
EquipmentModifierData holds the EquipmentModifier data that is written to disk.
type EquipmentModifierEditData ¶
type EquipmentModifierEditData struct { EquipmentModifierSyncData VTTNotes string `json:"vtt_notes,omitempty"` Replacements map[string]string `json:"replacements,omitempty"` EquipmentModifierEditDataNonContainerOnly }
EquipmentModifierEditData holds the EquipmentModifier data that can be edited by the UI detail editor.
func (*EquipmentModifierEditData) ApplyTo ¶
func (e *EquipmentModifierEditData) ApplyTo(other *EquipmentModifier)
ApplyTo implements node.EditorData.
func (*EquipmentModifierEditData) CopyFrom ¶
func (e *EquipmentModifierEditData) CopyFrom(other *EquipmentModifier)
CopyFrom implements node.EditorData.
type EquipmentModifierEditDataNonContainerOnly ¶ added in v5.21.0
type EquipmentModifierEditDataNonContainerOnly struct { EquipmentModifierNonContainerSyncData Disabled bool `json:"disabled,omitempty"` }
EquipmentModifierEditDataNonContainerOnly holds the EquipmentModifier data that is only applicable to EquipmentModifiers that aren't containers.
type EquipmentModifierListProvider ¶
type EquipmentModifierListProvider interface { DataOwnerProvider EquipmentModifierList() []*EquipmentModifier SetEquipmentModifierList(list []*EquipmentModifier) }
EquipmentModifierListProvider defines the methods needed to access the equipment modifier list data.
type EquipmentModifierNonContainerSyncData ¶ added in v5.26.0
type EquipmentModifierNonContainerSyncData struct { CostType emcost.Type `json:"cost_type,omitempty"` CostIsPerLevel bool `json:"cost_is_per_level,omitempty"` WeightType emweight.Type `json:"weight_type,omitempty"` WeightIsPerLevel bool `json:"weight_is_per_level,omitempty"` TechLevel string `json:"tech_level,omitempty"` CostAmount string `json:"cost,omitempty"` WeightAmount string `json:"weight,omitempty"` Features Features `json:"features,omitempty"` }
EquipmentModifierNonContainerSyncData holds the EquipmentModifier sync data that is only applicable to Equipment Modifiers that aren't containers.
type EquipmentModifierSyncData ¶ added in v5.26.0
type EquipmentModifierSyncData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` LocalNotes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` }
EquipmentModifierSyncData holds the EquipmentModifier sync data that is common to both containers and non-containers.
type EquipmentSyncData ¶ added in v5.26.0
type EquipmentSyncData struct { Name string `json:"description,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` LocalNotes string `json:"notes,omitempty"` TechLevel string `json:"tech_level,omitempty"` LegalityClass string `json:"legality_class,omitempty"` Tags []string `json:"tags,omitempty"` Value fxp.Int `json:"value,omitempty"` Weight fxp.Weight `json:"weight,omitempty"` MaxUses int `json:"max_uses,omitempty"` Prereq *PrereqList `json:"prereqs,omitempty"` Weapons []*Weapon `json:"weapons,omitempty"` Features Features `json:"features,omitempty"` WeightIgnoredForSkills bool `json:"ignore_weight_for_skills,omitempty"` }
EquipmentSyncData holds the equipment sync data that is common to both containers and non-containers.
type EquippedEquipmentPrereq ¶ added in v5.9.0
type EquippedEquipmentPrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` NameCriteria criteria.Text `json:"name,omitempty"` TagsCriteria criteria.Text `json:"tags,omitempty"` }
EquippedEquipmentPrereq holds a prerequisite for an equipped piece of equipment.
func NewEquippedEquipmentPrereq ¶ added in v5.9.0
func NewEquippedEquipmentPrereq() *EquippedEquipmentPrereq
NewEquippedEquipmentPrereq creates a new EquippedEquipmentPrereq.
func (*EquippedEquipmentPrereq) Clone ¶ added in v5.9.0
func (p *EquippedEquipmentPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*EquippedEquipmentPrereq) FillWithNameableKeys ¶ added in v5.9.0
func (p *EquippedEquipmentPrereq) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Prereq.
func (*EquippedEquipmentPrereq) Hash ¶ added in v5.24.0
func (p *EquippedEquipmentPrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*EquippedEquipmentPrereq) ParentList ¶ added in v5.9.0
func (p *EquippedEquipmentPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*EquippedEquipmentPrereq) PrereqType ¶ added in v5.9.0
func (p *EquippedEquipmentPrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*EquippedEquipmentPrereq) Satisfied ¶ added in v5.9.0
func (p *EquippedEquipmentPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, hasEquipmentPenalty *bool) bool
Satisfied implements Prereq.
type Feature ¶ added in v5.9.0
type Feature interface { nameable.Filler FeatureType() feature.Type Clone() Feature Hash(hash.Hash) }
Feature holds data that affects another object.
type Features ¶ added in v5.9.0
type Features []Feature
Features holds a list of features.
func FeaturesForSelfControlRoll ¶ added in v5.19.0
func FeaturesForSelfControlRoll(cr selfctrl.Roll, adj selfctrl.Adjustment) Features
FeaturesForSelfControlRoll returns the set of features to apply for the given self control roll.
func (*Features) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements the json.Unmarshaler interface.
type FileInfo ¶ added in v5.9.0
type FileInfo struct { Name string UTI string ConformsTo []string Extensions []string GroupWith []string MimeTypes []string SVG *unison.SVG Load func(filePath string, initialPage int) (unison.Dockable, error) IsSpecial bool IsGCSData bool IsImage bool IsPDF bool IsExportable bool IsDeepSearchable bool }
FileInfo contains some static information about a given file type.
func FileInfoFor ¶ added in v5.9.0
FileInfoFor returns the FileInfo for the given file path's extension.
type GeneralModifier ¶
type GeneralModifier interface { Container() bool Depth() int FullDescription() string FullCostDescription() string Enabled() bool SetEnabled(enabled bool) }
GeneralModifier is used for common access to modifiers.
type GeneralSettings ¶ added in v5.9.0
type GeneralSettings struct { DefaultPlayerName string `json:"default_player_name,omitempty"` DefaultTechLevel string `json:"default_tech_level,omitempty"` CalendarName string `json:"calendar_ref,omitempty"` ExternalPDFCmdLine string `json:"external_pdf_cmd_line,omitempty"` InitialPoints fxp.Int `json:"initial_points"` TooltipDelay fxp.Int `json:"tooltip_delay"` TooltipDismissal fxp.Int `json:"tooltip_dismissal"` ScrollWheelMultiplier fxp.Int `json:"scroll_wheel_multiplier"` InitialListUIScale int `json:"initial_list_scale"` InitialEditorUIScale int `json:"initial_editor_scale"` InitialSheetUIScale int `json:"initial_sheet_scale"` InitialPDFUIScale int `json:"initial_pdf_scale"` InitialMarkdownUIScale int `json:"initial_md_scale"` InitialImageUIScale int `json:"initial_img_scale"` MaximumAutoColWidth int `json:"maximum_auto_col_width"` ImageResolution int `json:"image_resolution"` MonitorResolution int `json:"monitor_resolution,omitempty"` PDFAutoScaling autoscale.Option `json:"pdf_auto_scaling,omitempty"` AutoFillProfile bool `json:"auto_fill_profile"` AutoAddNaturalAttacks bool `json:"add_natural_attacks"` GroupContainersOnSort bool `json:"group_containers_on_sort"` InitialFieldClickSelectsAll bool `json:"initial_field_click_selects_all"` }
GeneralSettings holds general settings for a sheet.
func NewGeneralSettings ¶ added in v5.9.0
func NewGeneralSettings() *GeneralSettings
NewGeneralSettings creates settings with factory defaults.
func NewGeneralSettingsFromFile ¶ added in v5.9.0
func NewGeneralSettingsFromFile(fileSystem fs.FS, filePath string) (*GeneralSettings, error)
NewGeneralSettingsFromFile loads new settings from a file.
func (*GeneralSettings) CalendarRef ¶ added in v5.9.0
func (s *GeneralSettings) CalendarRef(libraries Libraries) *CalendarRef
CalendarRef returns the CalendarRef these settings refer to.
func (*GeneralSettings) EnsureValidity ¶ added in v5.9.0
func (s *GeneralSettings) EnsureValidity()
EnsureValidity checks the current settings for validity and if they aren't valid, makes them so.
func (*GeneralSettings) Save ¶ added in v5.9.0
func (s *GeneralSettings) Save(filePath string) error
Save writes the settings to the file as JSON.
func (*GeneralSettings) UpdateToolTipTiming ¶ added in v5.9.0
func (s *GeneralSettings) UpdateToolTipTiming()
UpdateToolTipTiming updates the default tooltip theme to use the timing values from this object.
type HashAndData ¶ added in v5.24.0
HashAndData is a combination of a hash and some data.
type HeaderData ¶ added in v5.21.0
HeaderData holds data for creating a column header's visual representation.
func ConditionalModifiersHeaderData ¶ added in v5.21.0
func ConditionalModifiersHeaderData(columnID int) HeaderData
ConditionalModifiersHeaderData returns the header data information for the given conditional modifier column.
func EquipmentHeaderData ¶ added in v5.21.0
func EquipmentHeaderData(columnID int, entity *Entity, carried, forPage bool) HeaderData
EquipmentHeaderData returns the header data information for the given equipment column.
func EquipmentModifierHeaderData ¶ added in v5.21.0
func EquipmentModifierHeaderData(columnID int) HeaderData
EquipmentModifierHeaderData returns the header data information for the given equipment modifier column.
func NotesHeaderData ¶ added in v5.21.0
func NotesHeaderData(columnID int) HeaderData
NotesHeaderData returns the header data information for the given note column.
func ReactionModifiersHeaderData ¶ added in v5.21.0
func ReactionModifiersHeaderData(columnID int) HeaderData
ReactionModifiersHeaderData returns the header data information for the given reaction modifier column.
func SkillsHeaderData ¶ added in v5.21.0
func SkillsHeaderData(columnID int) HeaderData
SkillsHeaderData returns the header data information for the given skill column.
func SpellsHeaderData ¶ added in v5.21.0
func SpellsHeaderData(columnID int) HeaderData
SpellsHeaderData returns the header data information for the given spell column.
func TraitModifierHeaderData ¶ added in v5.24.0
func TraitModifierHeaderData(columnID int) HeaderData
TraitModifierHeaderData returns the header data information for the given trait modifier column.
func TraitsHeaderData ¶ added in v5.21.0
func TraitsHeaderData(columnID int) HeaderData
TraitsHeaderData returns the header data information for the given trait column.
func WeaponHeaderData ¶ added in v5.21.0
func WeaponHeaderData(columnID int, melee, forPage bool) HeaderData
WeaponHeaderData returns the header data information for the given weapon column.
type HitLocation ¶
type HitLocation struct { HitLocationData Entity *Entity RollRange string KeyPrefix string // contains filtered or unexported fields }
HitLocation holds a single hit location.
func NewHitLocation ¶
func NewHitLocation(entity *Entity, keyPrefix string) *HitLocation
NewHitLocation creates a new hit location.
func (*HitLocation) Clone ¶
func (h *HitLocation) Clone(entity *Entity, owningTable *Body) *HitLocation
Clone a copy of this.
func (*HitLocation) DR ¶
func (h *HitLocation) DR(entity *Entity, tooltip *xio.ByteBuffer, drMap map[string]int) map[string]int
DR computes the DR coverage for this HitLocation. If 'tooltip' isn't nil, the buffer will be updated with details on how the DR was calculated. If 'drMap' isn't nil, it will be returned.
func (*HitLocation) DisplayDR ¶
func (h *HitLocation) DisplayDR(entity *Entity, tooltip *xio.ByteBuffer) string
DisplayDR returns the DR for this location, formatted as a string.
func (*HitLocation) Hash ¶ added in v5.28.0
func (h *HitLocation) Hash(hasher hash.Hash)
Hash writes this object's contents into the hasher.
func (*HitLocation) MarshalJSON ¶
func (h *HitLocation) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*HitLocation) OwningTable ¶
func (h *HitLocation) OwningTable() *Body
OwningTable returns the owning table.
func (*HitLocation) ResetTargetKeyPrefixes ¶
func (h *HitLocation) ResetTargetKeyPrefixes(prefixProvider func() string)
ResetTargetKeyPrefixes assigns new key prefixes for all data within this HitLocation.
func (*HitLocation) SetID ¶
func (h *HitLocation) SetID(value string)
SetID sets the ID, sanitizing it in the process (i.e. it may be changed from what you set -- read it back if you want to be sure of what it gets set to.
func (*HitLocation) SetSubTable ¶
func (h *HitLocation) SetSubTable(bodyType *Body)
SetSubTable sets the Body as a sub-table.
func (*HitLocation) UnmarshalJSON ¶
func (h *HitLocation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type HitLocationData ¶
type HitLocationData struct { LocID string `json:"id"` ChoiceName string `json:"choice_name"` TableName string `json:"table_name"` Slots int `json:"slots,omitempty"` HitPenalty int `json:"hit_penalty,omitempty"` DRBonus int `json:"dr_bonus,omitempty"` Description string `json:"description,omitempty"` Notes string `json:"notes,omitempty"` SubTable *Body `json:"sub_table,omitempty"` }
HitLocationData holds the Hitlocation data that gets written to disk.
type KeyBindings ¶ added in v5.9.0
type KeyBindings struct {
// contains filtered or unexported fields
}
KeyBindings holds a set of key bindings.
func NewKeyBindingsFromFS ¶ added in v5.9.0
func NewKeyBindingsFromFS(fileSystem fs.FS, filePath string) (*KeyBindings, error)
NewKeyBindingsFromFS creates a new set of key bindings from a file. Any missing values will be filled in with defaults.
func (*KeyBindings) Current ¶ added in v5.9.0
func (b *KeyBindings) Current(id string) unison.KeyBinding
Current returns the binding for the given ID.
func (*KeyBindings) MakeCurrent ¶ added in v5.9.0
func (b *KeyBindings) MakeCurrent()
MakeCurrent applies these key bindings to the current key bindings set.
func (*KeyBindings) MarshalJSON ¶ added in v5.9.0
func (b *KeyBindings) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*KeyBindings) Reset ¶ added in v5.9.0
func (b *KeyBindings) Reset()
Reset to factory defaults.
func (*KeyBindings) ResetOne ¶ added in v5.9.0
func (b *KeyBindings) ResetOne(id string)
ResetOne resets one font by ID to factory defaults.
func (*KeyBindings) Save ¶ added in v5.9.0
func (b *KeyBindings) Save(filePath string) error
Save writes the Fonts to the file as JSON.
func (*KeyBindings) Set ¶ added in v5.9.0
func (b *KeyBindings) Set(id string, binding unison.KeyBinding)
Set the binding for the given ID.
func (*KeyBindings) ShouldOmit ¶ added in v5.9.0
func (b *KeyBindings) ShouldOmit() bool
ShouldOmit implements json.Omitter.
func (*KeyBindings) UnmarshalJSON ¶ added in v5.9.0
func (b *KeyBindings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Level ¶ added in v5.9.0
Level provides a level & relative level pair, plus a tooltip.
func CalculateRitualMagicSpellLevel ¶
func CalculateRitualMagicSpellLevel(e *Entity, name, powerSource, ritualSkillName string, ritualPrereqCount int, colleges, tags []string, diff AttributeDifficulty, points fxp.Int) Level
CalculateRitualMagicSpellLevel returns the calculated spell level.
func CalculateSkillLevel ¶
func CalculateSkillLevel(e *Entity, name, specialization string, tags []string, def *SkillDefault, attrDiff AttributeDifficulty, points, encumbrancePenaltyMultiplier fxp.Int) Level
CalculateSkillLevel returns the calculated level for a skill.
func CalculateSpellLevel ¶
func CalculateSpellLevel(e *Entity, name, powerSource string, colleges, tags []string, attrDiff AttributeDifficulty, pts fxp.Int) Level
CalculateSpellLevel returns the calculated spell level.
func CalculateTechniqueLevel ¶
func CalculateTechniqueLevel(e *Entity, replacements map[string]string, name, specialization string, tags []string, def *SkillDefault, diffLevel difficulty.Level, points fxp.Int, requirePoints bool, limitModifier *fxp.Int, excludes map[string]bool) Level
CalculateTechniqueLevel returns the calculated level for a technique.
func (Level) LevelAsString ¶ added in v5.9.0
LevelAsString returns the level as a string.
type LeveledAmount ¶ added in v5.9.0
type LeveledAmount struct { Level fxp.Int `json:"-"` Amount fxp.Int `json:"amount"` PerLevel bool `json:"per_level,omitempty"` }
LeveledAmount holds an amount that can be either a fixed amount, or an amount per level.
func (*LeveledAmount) AdjustedAmount ¶ added in v5.9.0
func (l *LeveledAmount) AdjustedAmount() fxp.Int
AdjustedAmount returns the amount, adjusted for level, if requested.
func (*LeveledAmount) Format ¶ added in v5.9.0
func (l *LeveledAmount) Format(asPercentage bool) string
Format the value.
func (*LeveledAmount) Hash ¶ added in v5.24.0
func (l *LeveledAmount) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
type LeveledOwner ¶ added in v5.19.0
LeveledOwner is an owner that has a level.
type Libraries ¶ added in v5.9.0
Libraries holds a Library set.
func NewLibraries ¶ added in v5.9.0
func NewLibraries() Libraries
NewLibraries creates a new, empty, Libraries object.
func (Libraries) PerformUpdateChecks ¶ added in v5.9.0
func (l Libraries) PerformUpdateChecks()
PerformUpdateChecks checks each of the libraries for updates.
func (*Libraries) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements json.Unmarshaler.
type Library ¶ added in v5.9.0
type Library struct { Title string `json:"title,omitempty"` GitHubAccountName string `json:"-"` AccessToken string `json:"access_token,omitempty"` RepoName string `json:"-"` PathOnDisk string `json:"path,omitempty"` Favorites []string `json:"favorites,omitempty"` // contains filtered or unexported fields }
Library holds information about a library of data files.
func NewLibrary ¶ added in v5.9.0
NewLibrary creates a new library.
func (*Library) AvailableReleases ¶ added in v5.15.0
AvailableReleases returns the available releases.
func (*Library) CheckForAvailableUpgrade ¶ added in v5.9.0
CheckForAvailableUpgrade returns releases that can be upgraded to.
func (*Library) CleanupFavorites ¶ added in v5.12.0
func (l *Library) CleanupFavorites()
CleanupFavorites prunes out any favorites that can no longer be read.
func (*Library) ConfigureForKey ¶ added in v5.9.0
ConfigureForKey configures the GitHubAccountName and RepoName from the given key.
func (*Library) Path ¶ added in v5.9.0
Path returns the path on disk to this Library, creating any necessary directories.
func (*Library) SetPath ¶ added in v5.9.0
SetPath updates the path to the Library as well as the version.
func (*Library) StopAllWatches ¶ added in v5.9.0
func (l *Library) StopAllWatches()
StopAllWatches that were previously established.
func (*Library) Valid ¶ added in v5.9.0
Valid returns true if the library has a path on disk and a title.
func (*Library) VersionOnDisk ¶ added in v5.9.0
VersionOnDisk returns the version of the data on disk, if it can be determined.
type LibraryFile ¶ added in v5.24.0
LibraryFile holds the library and path to a file.
func (LibraryFile) String ¶ added in v5.24.0
func (l LibraryFile) String() string
type LineBuilder ¶ added in v5.19.0
type LineBuilder interface { Len() int WriteByte(ch byte) error WriteString(s string) (int, error) String() string }
LineBuilder is an interface that can be used to build a line of text.
type ListProvider ¶
type ListProvider interface { TraitListProvider EquipmentListProvider NoteListProvider SkillListProvider SpellListProvider }
ListProvider defines the methods needed to access list data.
type MonitorToken ¶ added in v5.9.0
type MonitorToken struct {
// contains filtered or unexported fields
}
MonitorToken holds a token that can be used to stop a library watch.
func (*MonitorToken) AddSubPath ¶ added in v5.9.0
func (m *MonitorToken) AddSubPath(relativePath string)
AddSubPath adds a sub-path within the library to watch. Should only be called for symlinks, since the native OS monitoring typically does not traverse those on its own.
func (*MonitorToken) Library ¶ added in v5.9.0
func (m *MonitorToken) Library() *Library
Library returns the library this token is attached to.
type NameGenerator ¶ added in v5.9.0
type NameGenerator struct { Type namegen.Type `json:"type"` NoLowered bool `json:"no_lowered,omitempty"` NoFirstToUpper bool `json:"no_first_to_upper,omitempty"` Separator string `json:"separator,omitempty"` // Only valid for namegen.Compound Depth int `json:"depth,omitempty"` // Only valid for namegen.MarkovLetter Compound []*NameGenerator `json:"compound,omitempty"` // Only valid for namegen.Compound TrainingData // contains filtered or unexported fields }
NameGenerator holds the data necessary to create a Namer.
func NewNameGeneratorFromFS ¶ added in v5.9.0
func NewNameGeneratorFromFS(fileSystem fs.FS, filePath string) (*NameGenerator, error)
NewNameGeneratorFromFS creates a new NameGenerator from a file.
func (*NameGenerator) GenerateName ¶ added in v5.9.0
func (n *NameGenerator) GenerateName() string
GenerateName generates a new random name.
func (*NameGenerator) GenerateNameWithRandomizer ¶ added in v5.9.0
func (n *NameGenerator) GenerateNameWithRandomizer(rnd rand.Randomizer) string
GenerateNameWithRandomizer generates a new random name using the specified randomizer.
type NameGeneratorRef ¶ added in v5.9.0
type NameGeneratorRef struct { FileRef *NamedFileRef // contains filtered or unexported fields }
NameGeneratorRef holds a reference to a NameGenerator.
func AvailableNameGenerators ¶ added in v5.9.0
func AvailableNameGenerators(libraries Libraries) []*NameGeneratorRef
AvailableNameGenerators scans the libraries and returns the available name generators.
func (*NameGeneratorRef) Generator ¶ added in v5.9.0
func (n *NameGeneratorRef) Generator() (*NameGenerator, error)
Generator returns the NameGenerator, loading it if needed.
type NamedFileRef ¶ added in v5.9.0
NamedFileRef holds a reference to a file.
func (*NamedFileRef) String ¶ added in v5.9.0
func (n *NamedFileRef) String() string
type NamedFileSet ¶ added in v5.9.0
type NamedFileSet struct { Name string List []*NamedFileRef }
NamedFileSet holds a named list of file references.
func AvailableAncestries ¶ added in v5.9.0
func AvailableAncestries(libraries Libraries) []*NamedFileSet
AvailableAncestries scans the libraries and returns the available ancestries.
func AvailableCalendarRefs ¶ added in v5.9.0
func AvailableCalendarRefs(libraries Libraries) []*NamedFileSet
AvailableCalendarRefs scans the libraries and returns the available calendars.
func ScanForNamedFileSets ¶ added in v5.9.0
func ScanForNamedFileSets(builtIn fs.FS, builtInDir string, omitDuplicateNames bool, libraries Libraries, extensions ...string) []*NamedFileSet
ScanForNamedFileSets scans for settings files of a particular type.
type NavNodeInfo ¶ added in v5.24.0
type NavNodeInfo struct {}
NavNodeInfo holds the ID and last used timestamp for a navigator node.
type NavigatorSettings ¶ added in v5.9.0
type NavigatorSettings struct {}
NavigatorSettings holds settings for the navigator view.
type Node ¶
type Node[T NodeTypes] interface { fmt.Stringer Openable Hashable nameable.Applier Clone(from LibraryFile, owner DataOwner, newParent T, preserveID bool) T GetSource() Source ClearSource() SyncWithSource() DataOwner() DataOwner SetDataOwner(owner DataOwner) Kind() string Parent() T SetParent(parent T) HasChildren() bool NodeChildren() []T SetChildren(children []T) Enabled() bool CellData(columnID int, data *CellData) }
Node defines the methods required of nodes in our tables.
type NodeTypes ¶
type NodeTypes interface { *ConditionalModifier | *Equipment | *EquipmentModifier | *Note | *Skill | *Spell | *Trait | *TraitModifier | *Weapon nameable.Applier fmt.Stringer }
NodeTypes is a constraint that defines the types that may be nodes.
type Note ¶
type Note struct { NoteData // contains filtered or unexported fields }
Note holds a note.
func NewNotesFromFile ¶
NewNotesFromFile loads an Note list from a file.
func (*Note) ApplyNameableKeys ¶
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*Note) CanConvertToFromContainer ¶ added in v5.24.0
CanConvertToFromContainer returns true if this node can be converted to/from a container.
func (*Note) ClearSource ¶ added in v5.24.0
func (n *Note) ClearSource()
ClearSource clears the source of this data.
func (*Note) ClearUnusedFieldsForType ¶ added in v5.24.0
func (n *Note) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*Note) ConvertToContainer ¶ added in v5.24.0
func (n *Note) ConvertToContainer()
ConvertToContainer converts this node to a container.
func (*Note) ConvertToNonContainer ¶ added in v5.24.0
func (n *Note) ConvertToNonContainer()
ConvertToNonContainer converts this node to a non-container.
func (*Note) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Note) HasChildren ¶ added in v5.24.0
HasChildren returns true if this node has children.
func (*Note) Hash ¶ added in v5.24.0
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*Note) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Note) NameableReplacements ¶ added in v5.25.0
NameableReplacements returns the replacements to be used with Nameables.
func (*Note) NodeChildren ¶ added in v5.24.0
NodeChildren returns the children of this node, if any.
func (*Note) SetChildren ¶ added in v5.24.0
SetChildren sets the children of this node.
func (*Note) SetDataOwner ¶ added in v5.24.0
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*Note) SyncWithSource ¶ added in v5.24.0
func (n *Note) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*Note) TextWithReplacements ¶ added in v5.25.0
TextWithReplacements returns the text with any replacements applied.
func (*Note) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type NoteData ¶
type NoteData struct { SourcedID NoteEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*Note `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
NoteData holds the Note data that is written to disk.
type NoteEditData ¶
type NoteEditData struct { NoteSyncData Replacements map[string]string `json:"replacements,omitempty"` }
NoteEditData holds the Note data that can be edited by the UI detail editor.
func (*NoteEditData) ApplyTo ¶
func (n *NoteEditData) ApplyTo(other *Note)
ApplyTo implements node.EditorData.
func (*NoteEditData) CopyFrom ¶
func (n *NoteEditData) CopyFrom(other *Note)
CopyFrom implements node.EditorData.
type NoteListProvider ¶
type NoteListProvider interface { DataOwnerProvider NoteList() []*Note SetNoteList(list []*Note) }
NoteListProvider defines the methods needed to access the note list data.
type NoteSyncData ¶ added in v5.26.0
type NoteSyncData struct { Text string `json:"text,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` }
NoteSyncData holds the note sync data that is common to both containers and non-containers.
type PDFInfo ¶ added in v5.24.0
type PDFInfo struct { TOC map[string]map[int]tid.TID `json:"toc,omitempty"` LastOpened int64 `json:"last"` }
PDFInfo holds IDs and last opened timestamp for a PDF's table of contents.
type PageRef ¶
type PageRef struct { ID string `json:"-"` Path string `json:"path,omitempty"` Offset int `json:"offset,omitempty"` }
PageRef holds a path to a file and an offset for all page references within that file.
type PageRefs ¶ added in v5.9.0
type PageRefs struct {
// contains filtered or unexported fields
}
PageRefs holds a set of page references.
func NewPageRefsFromFS ¶ added in v5.9.0
NewPageRefsFromFS creates a new set of page references from a file.
func (*PageRefs) Lookup ¶ added in v5.9.0
Lookup the PageRef for the given ID. If not found or if the path it points to isn't a readable file, returns nil.
func (*PageRefs) MarshalJSON ¶ added in v5.9.0
MarshalJSON implements json.Marshaler.
func (*PageRefs) ShouldOmit ¶ added in v5.9.0
ShouldOmit implements json.Omitter.
func (*PageRefs) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements json.Unmarshaler.
type PageSettings ¶ added in v5.9.0
type PageSettings struct { Size paper.Size `json:"paper_size"` Orientation paper.Orientation `json:"orientation"` TopMargin paper.Length `json:"top_margin"` LeftMargin paper.Length `json:"left_margin"` BottomMargin paper.Length `json:"bottom_margin"` RightMargin paper.Length `json:"right_margin"` }
PageSettings holds page settings.
func NewPageSettings ¶ added in v5.9.0
func NewPageSettings() *PageSettings
NewPageSettings returns new settings with factory defaults.
func (*PageSettings) Clone ¶ added in v5.9.0
func (p *PageSettings) Clone() *PageSettings
Clone a copy of this.
func (*PageSettings) EnsureValidity ¶ added in v5.9.0
func (p *PageSettings) EnsureValidity()
EnsureValidity checks the current settings for validity and if they aren't valid, makes them so.
type PageSettingsOverrides ¶ added in v5.9.0
type PageSettingsOverrides struct { Size *paper.Size Orientation *paper.Orientation TopMargin *paper.Length LeftMargin *paper.Length BottomMargin *paper.Length RightMargin *paper.Length }
PageSettingsOverrides holds page setting overrides.
func (*PageSettingsOverrides) Apply ¶ added in v5.9.0
func (p *PageSettingsOverrides) Apply(page *PageSettings)
Apply the overrides to a Page.
func (*PageSettingsOverrides) ParseBottomMargin ¶ added in v5.9.0
func (p *PageSettingsOverrides) ParseBottomMargin(in string)
ParseBottomMargin and set the override, if applicable.
func (*PageSettingsOverrides) ParseLeftMargin ¶ added in v5.9.0
func (p *PageSettingsOverrides) ParseLeftMargin(in string)
ParseLeftMargin and set the override, if applicable.
func (*PageSettingsOverrides) ParseOrientation ¶ added in v5.9.0
func (p *PageSettingsOverrides) ParseOrientation(in string)
ParseOrientation and set the override, if applicable.
func (*PageSettingsOverrides) ParseRightMargin ¶ added in v5.9.0
func (p *PageSettingsOverrides) ParseRightMargin(in string)
ParseRightMargin and set the override, if applicable.
func (*PageSettingsOverrides) ParseSize ¶ added in v5.9.0
func (p *PageSettingsOverrides) ParseSize(in string)
ParseSize and set the override, if applicable.
func (*PageSettingsOverrides) ParseTopMargin ¶ added in v5.9.0
func (p *PageSettingsOverrides) ParseTopMargin(in string)
ParseTopMargin and set the override, if applicable.
type PointsBreakdown ¶ added in v5.9.0
type PointsBreakdown struct { Ancestry fxp.Int Attributes fxp.Int Advantages fxp.Int Disadvantages fxp.Int Quirks fxp.Int Skills fxp.Int Spells fxp.Int }
PointsBreakdown holds the points spent on a character.
func (*PointsBreakdown) Total ¶ added in v5.9.0
func (pb *PointsBreakdown) Total() fxp.Int
Total returns the total number of points spent on a character.
type PointsRecord ¶ added in v5.3.0
type PointsRecord struct { When jio.Time `json:"when"` Points fxp.Int `json:"points"` Reason string `json:"reason,omitempty"` }
PointsRecord holds information about when and why points were adjusted.
func ClonePointsRecordList ¶ added in v5.3.0
func ClonePointsRecordList(list []*PointsRecord) []*PointsRecord
ClonePointsRecordList creates a clone of the provided PointsRecord list.
type PoolThreshold ¶
type PoolThreshold struct { PoolThresholdData KeyPrefix string }
PoolThreshold holds a point within an attribute pool where changes in state occur.
func (*PoolThreshold) AddOp ¶
func (p *PoolThreshold) AddOp(op threshold.Op)
AddOp adds the specified ThresholdOp.
func (*PoolThreshold) ContainsOp ¶
func (p *PoolThreshold) ContainsOp(op threshold.Op) bool
ContainsOp returns true if this PoolThreshold contains the specified ThresholdOp.
func (*PoolThreshold) Hash ¶ added in v5.28.0
func (p *PoolThreshold) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*PoolThreshold) MarshalJSON ¶
func (p *PoolThreshold) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*PoolThreshold) RemoveOp ¶
func (p *PoolThreshold) RemoveOp(op threshold.Op)
RemoveOp removes the specified ThresholdOp.
func (*PoolThreshold) String ¶
func (p *PoolThreshold) String() string
func (*PoolThreshold) Threshold ¶
func (p *PoolThreshold) Threshold(resolver eval.VariableResolver) fxp.Int
Threshold returns the threshold value for the given maximum.
func (*PoolThreshold) UnmarshalJSON ¶
func (p *PoolThreshold) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PoolThresholdData ¶
type PoolThresholdData struct { State string `json:"state"` Expression string `json:"expression"` Explanation string `json:"explanation,omitempty"` Ops []threshold.Op `json:"ops,omitempty"` }
PoolThresholdData holds the data that will be serialized for the PoolThreshold.
type Prereq ¶
type Prereq interface { nameable.Filler PrereqType() prereq.Type // ParentList returns the owning parent list, if any. ParentList() *PrereqList // Clone creates a new copy of this Prereq. Clone(parent *PrereqList) Prereq // Satisfied returns true if this Prereq is satisfied by the specified Entity. 'buffer' will be used, if not nil, to // write a description of what was unsatisfied. 'prefix' will be appended to each line of the description. Satisfied(entity *Entity, exclude any, buffer *xio.ByteBuffer, prefix string, hasEquipmentPenalty *bool) bool // Hash writes this object's contents into the hasher. Hash(h hash.Hash) }
Prereq holds data necessary to track a prerequisite.
type PrereqList ¶
type PrereqList struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` All bool `json:"all"` WhenTL criteria.Number `json:"when_tl,omitempty"` Prereqs Prereqs `json:"prereqs,omitempty"` }
PrereqList holds a prereq that contains a list of prerequisites.
func (*PrereqList) Clone ¶
func (p *PrereqList) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*PrereqList) CloneAsPrereqList ¶
func (p *PrereqList) CloneAsPrereqList(parent *PrereqList) *PrereqList
CloneAsPrereqList clones this prereq list.
func (*PrereqList) CloneResolvingEmpty ¶
func (p *PrereqList) CloneResolvingEmpty(isContainer, pruneIfEmpty bool) *PrereqList
CloneResolvingEmpty clones this prereq list. If the result would be nil and it isn't a container, a new, empty, list is created. If the result would not be nil but pruneIfEmpty is true and calling ShouldOmit() on it would return true, then nil is returned.
func (*PrereqList) FillWithNameableKeys ¶
func (p *PrereqList) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Prereq.
func (*PrereqList) Hash ¶ added in v5.24.0
func (p *PrereqList) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*PrereqList) ParentList ¶
func (p *PrereqList) ParentList() *PrereqList
ParentList implements Prereq.
func (*PrereqList) PrereqType ¶
func (p *PrereqList) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*PrereqList) Satisfied ¶
func (p *PrereqList) Satisfied(entity *Entity, exclude any, buffer *xio.ByteBuffer, prefix string, hasEquipmentPenalty *bool) bool
Satisfied implements Prereq.
func (*PrereqList) ShouldOmit ¶
func (p *PrereqList) ShouldOmit() bool
ShouldOmit implements json.Omitter.
type Prereqs ¶
type Prereqs []Prereq
Prereqs holds a list of prerequisites.
func (*Prereqs) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Profile ¶
type Profile struct { ProfileRandom PlayerName string `json:"player_name,omitempty"` Title string `json:"title,omitempty"` Organization string `json:"organization,omitempty"` Religion string `json:"religion,omitempty"` TechLevel string `json:"tech_level,omitempty"` PortraitData []byte `json:"portrait,omitempty"` PortraitImage *unison.Image `json:"-"` SizeModifier int `json:"SM,omitempty"` SizeModifierBonus fxp.Int `json:"-"` }
Profile holds the profile information for an NPC.
func (*Profile) AdjustedSizeModifier ¶
AdjustedSizeModifier returns the adjusted size modifier.
func (*Profile) ApplyRandomizers ¶ added in v5.11.0
ApplyRandomizers to all randomizable fields, ignoring what may have been there before.
func (*Profile) CanExportPortrait ¶ added in v5.28.0
CanExportPortrait returns true if the portrait can be exported.
func (*Profile) ExportPortrait ¶ added in v5.28.0
ExportPortrait exports the portrait image.
func (*Profile) PortraitExtension ¶ added in v5.28.0
PortraitExtension returns the extension for the portrait image.
func (*Profile) SetAdjustedSizeModifier ¶
SetAdjustedSizeModifier sets the adjusted size modifier.
type ProfileRandom ¶ added in v5.11.0
type ProfileRandom struct { Name string `json:"name,omitempty"` Age string `json:"age,omitempty"` Birthday string `json:"birthday,omitempty"` Eyes string `json:"eyes,omitempty"` Hair string `json:"hair,omitempty"` Skin string `json:"skin,omitempty"` Handedness string `json:"handedness,omitempty"` Gender string `json:"gender,omitempty"` Height fxp.Length `json:"height,omitempty"` Weight fxp.Weight `json:"weight,omitempty"` }
ProfileRandom holds the portion of the profile that is affected by the randomizer.
type RawPointsAdjuster ¶
type RawPointsAdjuster[T NodeTypes] interface { Node[T] RawPoints() fxp.Int SetRawPoints(points fxp.Int) bool }
RawPointsAdjuster defines methods for nodes that can have their raw points adjusted must implement.
type ReactionBonus ¶ added in v5.9.0
type ReactionBonus struct { Type feature.Type `json:"type"` Situation string `json:"situation,omitempty"` LeveledAmount BonusOwner }
ReactionBonus holds a modifier due to a reaction.
func NewReactionBonus ¶ added in v5.9.0
func NewReactionBonus() *ReactionBonus
NewReactionBonus creates a new ReactionBonus.
func (*ReactionBonus) AddToTooltip ¶ added in v5.9.0
func (r *ReactionBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*ReactionBonus) Clone ¶ added in v5.9.0
func (r *ReactionBonus) Clone() Feature
Clone implements Feature.
func (*ReactionBonus) FeatureType ¶ added in v5.9.0
func (r *ReactionBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*ReactionBonus) FillWithNameableKeys ¶ added in v5.9.0
func (r *ReactionBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*ReactionBonus) Hash ¶ added in v5.25.0
func (r *ReactionBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*ReactionBonus) SetLevel ¶ added in v5.9.0
func (r *ReactionBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type ReactionModifierListProvider ¶
type ReactionModifierListProvider interface { DataOwnerProvider Reactions() []*ConditionalModifier }
ReactionModifierListProvider defines the methods needed to access the reaction modifier list data.
type Release ¶ added in v5.9.0
Release holds information about a single release of a GitHub repo.
func LoadReleases ¶ added in v5.9.0
func LoadReleases(ctx context.Context, client *http.Client, githubAccountName, accessToken, repoName, currentVersion string, filter func(version, notes string) bool) ([]Release, error)
LoadReleases loads the list of releases available from a given GitHub repo.
func (*Release) HasReleaseNotes ¶ added in v5.9.0
HasReleaseNotes returns true if there are release notes available.
type Settings ¶ added in v5.9.0
type Settings struct { LastSeenGCSVersion string `json:"last_seen_gcs_version,omitempty"` General *GeneralSettings `json:"general,omitempty"` LibrarySet Libraries `json:"libraries,omitempty"` LibraryExplorer NavigatorSettings `json:"library_explorer"` ThemeMode thememode.Enum `json:"theme_mode,alt=color_mode"` RecentFiles []string `json:"recent_files,omitempty"` DeepSearch []string `json:"deep_search,omitempty"` LastDirs map[string]string `json:"last_dirs,omitempty"` ColumnSizing map[string]map[int]float32 `json:"column_sizing,omitempty"` PageRefs PageRefs `json:"page_refs,omitempty"` KeyBindings KeyBindings `json:"key_bindings,omitempty"` WorkspaceFrame *unison.Rect `json:"workspace_frame,omitempty"` Colors colors.Colors `json:"theme_colors"` Fonts fonts.Fonts `json:"fonts"` Sheet *SheetSettings `json:"sheet_settings,omitempty"` OpenInWindow []dgroup.Group `json:"open_in_window,omitempty"` WebServer *websettings.Settings `json:"web,omitempty"` // Do not use "web_server" as the key, as an earlier release used that name and it will cause a failure to load the settings file. OpenNodes map[tid.TID]int64 `json:"open_nodes,omitempty"` PDFs map[string]*PDFInfo `json:"pdfs,omitempty"` }
Settings holds the application settings.
func GlobalSettings ¶ added in v5.9.0
func GlobalSettings() *Settings
GlobalSettings returns the global settings.
func (*Settings) AddRecentFile ¶ added in v5.9.0
AddRecentFile adds a file path to the list of recently opened files.
func (*Settings) EnsureValidity ¶ added in v5.9.0
func (s *Settings) EnsureValidity()
EnsureValidity checks the current settings for validity and if they aren't valid, makes them so.
func (*Settings) GeneralSettings ¶ added in v5.9.0
func (s *Settings) GeneralSettings() *GeneralSettings
GeneralSettings implements gurps.SettingsProvider.
func (*Settings) LastDir ¶ added in v5.9.0
LastDir returns the last directory used for the given key.
func (*Settings) ListRecentFiles ¶ added in v5.9.0
ListRecentFiles returns the current list of recently opened files. Files that are no longer readable for any reason are omitted.
func (*Settings) SetLastDir ¶ added in v5.9.0
SetLastDir sets the last directory used for the given key. Ignores attempts to set it to an empty string.
func (*Settings) SheetSettings ¶ added in v5.9.0
func (s *Settings) SheetSettings() *SheetSettings
SheetSettings implements gurps.SettingsProvider.
type SheetSettings ¶
type SheetSettings struct { SheetSettingsData Entity *Entity `json:"-"` }
SheetSettings holds sheet settings.
func FactorySheetSettings ¶
func FactorySheetSettings() *SheetSettings
FactorySheetSettings returns a new SheetSettings with factory defaults.
func NewSheetSettingsFromFile ¶
func NewSheetSettingsFromFile(fileSystem fs.FS, filePath string) (*SheetSettings, error)
NewSheetSettingsFromFile loads new settings from a file.
func SheetSettingsFor ¶
func SheetSettingsFor(entity *Entity) *SheetSettings
SheetSettingsFor returns the SheetSettings for the given Entity, or the global settings if the Entity is nil.
func (*SheetSettings) Clone ¶
func (s *SheetSettings) Clone(entity *Entity) *SheetSettings
Clone creates a copy of this.
func (*SheetSettings) EnsureValidity ¶
func (s *SheetSettings) EnsureValidity()
EnsureValidity checks the current settings for validity and if they aren't valid, makes them so.
func (*SheetSettings) MarshalJSON ¶
func (s *SheetSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SheetSettings) Save ¶
func (s *SheetSettings) Save(filePath string) error
Save writes the settings to the file as JSON.
func (*SheetSettings) SetOwningEntity ¶
func (s *SheetSettings) SetOwningEntity(entity *Entity)
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*SheetSettings) UnmarshalJSON ¶
func (s *SheetSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SheetSettingsData ¶
type SheetSettingsData struct { Page *PageSettings `json:"page,omitempty"` BlockLayout *BlockLayout `json:"block_layout,omitempty"` Attributes *AttributeDefs `json:"attributes,omitempty"` BodyType *Body `json:"body_type,alt=hit_locations,omitempty"` DamageProgression progression.Option `json:"damage_progression"` DefaultLengthUnits fxp.LengthUnit `json:"default_length_units"` DefaultWeightUnits fxp.WeightUnit `json:"default_weight_units"` UserDescriptionDisplay display.Option `json:"user_description_display"` ModifiersDisplay display.Option `json:"modifiers_display"` NotesDisplay display.Option `json:"notes_display"` SkillLevelAdjDisplay display.Option `json:"skill_level_adj_display"` UseMultiplicativeModifiers bool `json:"use_multiplicative_modifiers,omitempty"` UseModifyingDicePlusAdds bool `json:"use_modifying_dice_plus_adds,omitempty"` UseHalfStatDefaults bool `json:"use_half_stat_defaults,omitempty"` ShowTraitModifierAdj bool `json:"show_trait_modifier_adj,alt=show_advantage_modifier_adj,omitempty"` ShowEquipmentModifierAdj bool `json:"show_equipment_modifier_adj,omitempty"` ShowSpellAdj bool `json:"show_spell_adj,omitempty"` HideSourceMismatch bool `json:"hide_source_mismatch,omitempty"` ExcludeUnspentPointsFromTotal bool `json:"exclude_unspent_points_from_total"` }
SheetSettingsData holds the SheetSettings data that is written to disk.
type SheetSettingsResponder ¶
type SheetSettingsResponder interface { // SheetSettingsUpdated will be called when the SheetSettings have been updated. The provided Entity will be nil if // it was the default SheetSettings that was updated rather than one attached to a specific entity. blockLayout will // be true if the BlockLayout was altered, which usually requires a full rebuild. SheetSettingsUpdated(entity *Entity, blockLayout bool) }
SheetSettingsResponder defines the method required to be notified of updates to the SheetSettings.
type Skill ¶
type Skill struct { SkillData LevelData Level UnsatisfiedReason string // contains filtered or unexported fields }
Skill holds the data for a skill.
func NewSkillsFromFile ¶
NewSkillsFromFile loads an Skill list from a file.
func NewTechnique ¶
NewTechnique creates a new technique (i.e. a specialized use of a Skill). All parameters may be nil or empty.
func (*Skill) AdjustedPoints ¶
func (s *Skill) AdjustedPoints(tooltip *xio.ByteBuffer) fxp.Int
AdjustedPoints returns the points, adjusted for any bonuses.
func (*Skill) AdjustedRelativeLevel ¶
AdjustedRelativeLevel returns the relative skill level.
func (*Skill) ApplyNameableKeys ¶
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*Skill) BaseSkill ¶ added in v5.25.0
func (s *Skill) BaseSkill(e *Entity, def *SkillDefault, requirePoints bool) *Skill
BaseSkill returns the best skill for the given default, or nil.
func (*Skill) BestSwappableSkill ¶
BestSwappableSkill returns the best skill to swap with.
func (*Skill) CalculateLevel ¶
CalculateLevel returns the computed level without updating it.
func (*Skill) CanSwapDefaults ¶
CanSwapDefaults returns true if this skill's default can be swapped.
func (*Skill) CanSwapDefaultsWith ¶
CanSwapDefaultsWith returns true if this skill's default can be swapped with the other skill.
func (*Skill) ClearSource ¶ added in v5.24.0
func (s *Skill) ClearSource()
ClearSource clears the source of this data.
func (*Skill) ClearUnusedFieldsForType ¶ added in v5.24.0
func (s *Skill) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*Skill) DecrementSkillLevel ¶
func (s *Skill) DecrementSkillLevel()
DecrementSkillLevel removes enough points to decrement the skill level to the previous level.
func (*Skill) DefaultSkill ¶
DefaultSkill returns the skill currently defaulted to, or nil.
func (*Skill) Description ¶
Description implements WeaponOwner.
func (*Skill) FeatureList ¶
FeatureList returns the list of Features.
func (*Skill) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Skill) HasChildren ¶ added in v5.24.0
HasChildren returns true if this node has children.
func (*Skill) HasDefaultTo ¶
HasDefaultTo returns true if the set of possible defaults includes the other skill.
func (*Skill) Hash ¶ added in v5.24.0
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*Skill) IncrementSkillLevel ¶
func (s *Skill) IncrementSkillLevel()
IncrementSkillLevel adds enough points to increment the skill level to the next level.
func (*Skill) IsTechnique ¶ added in v5.24.0
IsTechnique returns true if this is a technique.
func (*Skill) LocalNotesWithReplacements ¶ added in v5.25.0
LocalNotesWithReplacements returns the local notes with any replacements applied.
func (*Skill) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Skill) ModifierNotes ¶
ModifierNotes returns the notes due to modifiers.
func (*Skill) NameWithReplacements ¶ added in v5.25.0
NameWithReplacements returns the name with any replacements applied.
func (*Skill) NameableReplacements ¶ added in v5.25.0
NameableReplacements returns the replacements to be used with Nameables.
func (*Skill) NodeChildren ¶ added in v5.24.0
NodeChildren returns the children of this node, if any.
func (*Skill) RatedStrength ¶ added in v5.11.0
RatedStrength always return 0 for skills.
func (*Skill) RelativeLevel ¶
RelativeLevel returns the adjusted relative level as a string.
func (*Skill) RequiresTL ¶
RequiresTL implements TechLevelProvider.
func (*Skill) SecondaryText ¶
SecondaryText returns the less important information that should be displayed with the description.
func (*Skill) SetChildren ¶ added in v5.24.0
SetChildren sets the children of this node.
func (*Skill) SetDataOwner ¶ added in v5.24.0
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*Skill) SetRawPoints ¶
SetRawPoints sets the unadjusted points and updates the level. Returns true if the level changed.
func (*Skill) SpecializationWithReplacements ¶ added in v5.25.0
SpecializationWithReplacements returns the specialization with any replacements applied.
func (*Skill) SwapDefaults ¶
func (s *Skill) SwapDefaults()
SwapDefaults causes this skill's default to be swapped.
func (*Skill) SyncWithSource ¶ added in v5.24.0
func (s *Skill) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*Skill) TechniqueSatisfied ¶
func (s *Skill) TechniqueSatisfied(tooltip *xio.ByteBuffer, prefix string) bool
TechniqueSatisfied returns true if the Technique is satisfied.
func (*Skill) TemplatePickerData ¶ added in v5.3.0
func (s *Skill) TemplatePickerData() *TemplatePicker
TemplatePickerData returns the TemplatePicker data, if any.
func (*Skill) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Skill) UpdateLevel ¶
UpdateLevel updates the level of the skill, returning true if it has changed.
type SkillAdjustmentProvider ¶
type SkillAdjustmentProvider[T NodeTypes] interface { RawPointsAdjuster[T] IncrementSkillLevel() DecrementSkillLevel() }
SkillAdjustmentProvider defines methods for nodes that can have their skill level adjusted must implement.
type SkillBonus ¶ added in v5.9.0
type SkillBonus struct { Type feature.Type `json:"type"` SelectionType skillsel.Type `json:"selection_type"` NameCriteria criteria.Text `json:"name,omitempty"` SpecializationCriteria criteria.Text `json:"specialization,omitempty"` TagsCriteria criteria.Text `json:"tags,alt=category,omitempty"` LeveledAmount BonusOwner }
SkillBonus holds an adjustment to a skill.
func NewSkillBonus ¶ added in v5.9.0
func NewSkillBonus() *SkillBonus
NewSkillBonus creates a new SkillBonus.
func (*SkillBonus) AddToTooltip ¶ added in v5.9.0
func (s *SkillBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*SkillBonus) Clone ¶ added in v5.9.0
func (s *SkillBonus) Clone() Feature
Clone implements Feature.
func (*SkillBonus) FeatureType ¶ added in v5.9.0
func (s *SkillBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*SkillBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SkillBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*SkillBonus) Hash ¶ added in v5.25.0
func (s *SkillBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*SkillBonus) SetLevel ¶ added in v5.9.0
func (s *SkillBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type SkillContainerOnlySyncData ¶ added in v5.26.0
type SkillContainerOnlySyncData struct {
TemplatePicker *TemplatePicker `json:"template_picker,omitempty"`
}
SkillContainerOnlySyncData holds the skill sync data that is only applicable to traits that are containers.
type SkillData ¶
type SkillData struct { SourcedID SkillEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*Skill `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
SkillData holds the Skill data that is written to disk.
type SkillDefault ¶
type SkillDefault struct { DefaultType string `json:"type"` Name string `json:"name,omitempty"` Specialization string `json:"specialization,omitempty"` Modifier fxp.Int `json:"modifier,omitempty"` Level fxp.Int `json:"level,omitempty"` AdjLevel fxp.Int `json:"adjusted_level,omitempty"` Points fxp.Int `json:"points,omitempty"` }
SkillDefault holds data for a Skill default.
func (*SkillDefault) CloneWithoutLevelOrPoints ¶
func (s *SkillDefault) CloneWithoutLevelOrPoints() *SkillDefault
CloneWithoutLevelOrPoints creates a copy, but without the level or points set.
func (*SkillDefault) Equivalent ¶
func (s *SkillDefault) Equivalent(replacements map[string]string, other *SkillDefault) bool
Equivalent returns true if this can be considered equivalent to other.
func (*SkillDefault) FillWithNameableKeys ¶
func (s *SkillDefault) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys adds any nameable keys found in this SkillDefault to the provided map.
func (*SkillDefault) FullName ¶
func (s *SkillDefault) FullName(entity *Entity, replacements map[string]string) string
FullName returns the full name of the skill to default from.
func (*SkillDefault) Hash ¶ added in v5.24.0
func (s *SkillDefault) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*SkillDefault) ModifierAsString ¶
func (s *SkillDefault) ModifierAsString() string
ModifierAsString returns the modifier as a string suitable for appending.
func (*SkillDefault) NameWithReplacements ¶ added in v5.25.0
func (s *SkillDefault) NameWithReplacements(replacements map[string]string) string
NameWithReplacements returns the name of the skill to default from with any nameable keys replaced.
func (*SkillDefault) SetType ¶
func (s *SkillDefault) SetType(t string)
SetType sets the type of the SkillDefault.
func (*SkillDefault) SkillBased ¶
func (s *SkillDefault) SkillBased() bool
SkillBased returns true if the Type() is Skill-based.
func (*SkillDefault) SkillLevel ¶
func (s *SkillDefault) SkillLevel(entity *Entity, replacements map[string]string, requirePoints bool, excludes map[string]bool, ruleOf20 bool) fxp.Int
SkillLevel returns the base skill level for this SkillDefault.
func (*SkillDefault) SkillLevelFast ¶
func (s *SkillDefault) SkillLevelFast(entity *Entity, replacements map[string]string, requirePoints bool, excludes map[string]bool, ruleOf20 bool) fxp.Int
SkillLevelFast returns the base skill level for this SkillDefault.
func (*SkillDefault) SpecializationWithReplacements ¶ added in v5.25.0
func (s *SkillDefault) SpecializationWithReplacements(replacements map[string]string) string
SpecializationWithReplacements returns the specialization of the skill to default from with any nameable keys replaced.
func (*SkillDefault) Type ¶
func (s *SkillDefault) Type() string
Type returns the type of the SkillDefault.
type SkillEditData ¶
type SkillEditData struct { SkillSyncData VTTNotes string `json:"vtt_notes,omitempty"` Replacements map[string]string `json:"replacements,omitempty"` SkillNonContainerOnlyEditData SkillContainerOnlySyncData }
SkillEditData holds the Skill data that can be edited by the UI detail editor.
func (*SkillEditData) ApplyTo ¶
func (s *SkillEditData) ApplyTo(other *Skill)
ApplyTo implements node.EditorData.
func (*SkillEditData) CopyFrom ¶
func (s *SkillEditData) CopyFrom(other *Skill)
CopyFrom implements node.EditorData.
type SkillListProvider ¶
type SkillListProvider interface { DataOwnerProvider SkillList() []*Skill SetSkillList(list []*Skill) }
SkillListProvider defines the methods needed to access the skill list data.
type SkillNonContainerOnlyEditData ¶ added in v5.21.0
type SkillNonContainerOnlyEditData struct { SkillNonContainerOnlySyncData TechLevel *string `json:"tech_level,omitempty"` Points fxp.Int `json:"points,omitempty"` DefaultedFrom *SkillDefault `json:"defaulted_from,omitempty"` Study []*Study `json:"study,omitempty"` StudyHoursNeeded study.Level `json:"study_hours_needed,omitempty"` }
SkillNonContainerOnlyEditData holds the Skill data that is only applicable to skills that aren't containers.
type SkillNonContainerOnlySyncData ¶ added in v5.26.0
type SkillNonContainerOnlySyncData struct { Specialization string `json:"specialization,omitempty"` Difficulty AttributeDifficulty `json:"difficulty,omitempty"` EncumbrancePenaltyMultiplier fxp.Int `json:"encumbrance_penalty_multiplier,omitempty"` Defaults []*SkillDefault `json:"defaults,omitempty"` TechniqueDefault *SkillDefault `json:"default,omitempty"` TechniqueLimitModifier *fxp.Int `json:"limit,omitempty"` Prereq *PrereqList `json:"prereqs,omitempty"` Weapons []*Weapon `json:"weapons,omitempty"` Features Features `json:"features,omitempty"` }
SkillNonContainerOnlySyncData holds the sskll sync data that is only applicable to traits that aren't containers.
type SkillPointBonus ¶ added in v5.9.0
type SkillPointBonus struct { Type feature.Type `json:"type"` NameCriteria criteria.Text `json:"name,omitempty"` SpecializationCriteria criteria.Text `json:"specialization,omitempty"` TagsCriteria criteria.Text `json:"tags,alt=category,omitempty"` LeveledAmount BonusOwner }
SkillPointBonus holds an adjustment to a skill's points.
func NewSkillPointBonus ¶ added in v5.9.0
func NewSkillPointBonus() *SkillPointBonus
NewSkillPointBonus creates a new SkillPointBonus.
func (*SkillPointBonus) AddToTooltip ¶ added in v5.9.0
func (s *SkillPointBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*SkillPointBonus) Clone ¶ added in v5.9.0
func (s *SkillPointBonus) Clone() Feature
Clone implements Feature.
func (*SkillPointBonus) FeatureType ¶ added in v5.9.0
func (s *SkillPointBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*SkillPointBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SkillPointBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*SkillPointBonus) Hash ¶ added in v5.25.0
func (s *SkillPointBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*SkillPointBonus) SetLevel ¶ added in v5.9.0
func (s *SkillPointBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type SkillPrereq ¶
type SkillPrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` Has bool `json:"has"` NameCriteria criteria.Text `json:"name,omitempty"` LevelCriteria criteria.Number `json:"level,omitempty"` SpecializationCriteria criteria.Text `json:"specialization,omitempty"` }
SkillPrereq holds a prerequisite for a skill.
func (*SkillPrereq) Clone ¶
func (p *SkillPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*SkillPrereq) FillWithNameableKeys ¶
func (p *SkillPrereq) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Prereq.
func (*SkillPrereq) Hash ¶ added in v5.24.0
func (p *SkillPrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*SkillPrereq) ParentList ¶
func (p *SkillPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*SkillPrereq) PrereqType ¶
func (p *SkillPrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*SkillPrereq) Satisfied ¶
func (p *SkillPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type SkillSyncData ¶ added in v5.26.0
type SkillSyncData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` LocalNotes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` }
SkillSyncData holds the skill sync data that is common to both containers and non-containers.
type Source ¶ added in v5.24.0
type Source struct { LibraryFile TID tid.TID `json:"id"` }
Source holds a reference to the source of a particular piece of data.
func (Source) ShouldOmit ¶ added in v5.24.0
ShouldOmit implements json.Omitter.
type SourcedID ¶ added in v5.24.0
SourcedID holds a TID and an optional Source.
func (*SourcedID) AdjustSource ¶ added in v5.24.0
func (s *SourcedID) AdjustSource(from LibraryFile, original SourcedID, preserve bool)
AdjustSource adjusts the source of a SourcedID to match the given LibraryFile.
type Spell ¶
type Spell struct { SpellData LevelData Level UnsatisfiedReason string // contains filtered or unexported fields }
Spell holds the data for a spell.
func NewRitualMagicSpell ¶
NewRitualMagicSpell creates a new Ritual Magic Spell.
func NewSpellsFromFile ¶
NewSpellsFromFile loads an Spell list from a file.
func (*Spell) AdjustedPoints ¶
func (s *Spell) AdjustedPoints(tooltip *xio.ByteBuffer) fxp.Int
AdjustedPoints returns the points, adjusted for any bonuses.
func (*Spell) AdjustedRelativeLevel ¶
AdjustedRelativeLevel returns the relative skill level.
func (*Spell) ApplyNameableKeys ¶
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*Spell) CalculateLevel ¶
CalculateLevel returns the computed level without updating it.
func (*Spell) CastingCostWithReplacements ¶ added in v5.25.0
CastingCostWithReplacements returns the casting cost with any replacements applied.
func (*Spell) CastingTimeWithReplacements ¶ added in v5.25.0
CastingTimeWithReplacements returns the casting time with any replacements applied.
func (*Spell) ClassWithReplacements ¶ added in v5.25.0
ClassWithReplacements returns the class with any replacements applied.
func (*Spell) ClearSource ¶ added in v5.24.0
func (s *Spell) ClearSource()
ClearSource clears the source of this data.
func (*Spell) ClearUnusedFieldsForType ¶ added in v5.24.0
func (s *Spell) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*Spell) CollegeWithReplacements ¶ added in v5.25.0
CollegeWithReplacements returns the college(s) with any replacements applied.
func (*Spell) DecrementSkillLevel ¶
func (s *Spell) DecrementSkillLevel()
DecrementSkillLevel removes enough points to decrement the skill level to the previous level.
func (*Spell) Description ¶
Description implements WeaponOwner.
func (*Spell) DurationWithReplacements ¶ added in v5.25.0
DurationWithReplacements returns the duration with any replacements applied.
func (*Spell) FeatureList ¶
FeatureList returns the list of Features.
func (*Spell) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Spell) HasChildren ¶ added in v5.24.0
HasChildren returns true if this node has children.
func (*Spell) Hash ¶ added in v5.24.0
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*Spell) IncrementSkillLevel ¶
func (s *Spell) IncrementSkillLevel()
IncrementSkillLevel adds enough points to increment the skill level to the next level.
func (*Spell) IsRitualMagic ¶ added in v5.24.0
IsRitualMagic returns true if this is a Ritual Magic Spell.
func (*Spell) LocalNotesWithReplacements ¶ added in v5.25.0
LocalNotesWithReplacements returns the local notes with any replacements applied.
func (*Spell) MaintenanceCostWithReplacements ¶ added in v5.25.0
MaintenanceCostWithReplacements returns the maintenance cost with any replacements applied.
func (*Spell) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Spell) NameWithReplacements ¶ added in v5.25.0
NameWithReplacements returns the name with any replacements applied.
func (*Spell) NameableReplacements ¶ added in v5.25.0
NameableReplacements returns the replacements to be used with Nameables.
func (*Spell) NodeChildren ¶ added in v5.24.0
NodeChildren returns the children of this node, if any.
func (*Spell) PowerSourceWithReplacements ¶ added in v5.25.0
PowerSourceWithReplacements returns the power source with any replacements applied.
func (*Spell) RatedStrength ¶ added in v5.11.0
RatedStrength always return 0 for spells.
func (*Spell) RelativeLevel ¶
RelativeLevel returns the adjusted relative level as a string.
func (*Spell) RequiresTL ¶
RequiresTL implements TechLevelProvider.
func (*Spell) ResistWithReplacements ¶ added in v5.25.0
ResistWithReplacements returns the resist with any replacements applied.
func (*Spell) RitualMagicSatisfied ¶
func (s *Spell) RitualMagicSatisfied(tooltip *xio.ByteBuffer, prefix string) bool
RitualMagicSatisfied returns true if the Ritual Magic Spell is satisfied.
func (*Spell) RitualSkillNameWithReplacements ¶ added in v5.25.0
RitualSkillNameWithReplacements returns the ritual skill name with any replacements applied.
func (*Spell) SecondaryText ¶
SecondaryText returns the less important information that should be displayed with the description.
func (*Spell) SetChildren ¶ added in v5.24.0
SetChildren sets the children of this node.
func (*Spell) SetDataOwner ¶ added in v5.24.0
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*Spell) SetRawPoints ¶
SetRawPoints sets the unadjusted points and updates the level. Returns true if the level changed.
func (*Spell) SyncWithSource ¶ added in v5.24.0
func (s *Spell) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*Spell) TemplatePickerData ¶ added in v5.3.0
func (s *Spell) TemplatePickerData() *TemplatePicker
TemplatePickerData returns the TemplatePicker data, if any.
func (*Spell) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Spell) UpdateLevel ¶
UpdateLevel updates the level of the spell, returning true if it has changed.
type SpellBonus ¶ added in v5.9.0
type SpellBonus struct { Type feature.Type `json:"type"` SpellMatchType spellmatch.Type `json:"match"` NameCriteria criteria.Text `json:"name,omitempty"` TagsCriteria criteria.Text `json:"tags,alt=category,omitempty"` LeveledAmount BonusOwner }
SpellBonus holds the data for a bonus to a spell.
func NewSpellBonus ¶ added in v5.9.0
func NewSpellBonus() *SpellBonus
NewSpellBonus creates a new SpellBonus.
func (*SpellBonus) AddToTooltip ¶ added in v5.9.0
func (s *SpellBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*SpellBonus) Clone ¶ added in v5.9.0
func (s *SpellBonus) Clone() Feature
Clone implements Feature.
func (*SpellBonus) FeatureType ¶ added in v5.9.0
func (s *SpellBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*SpellBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SpellBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*SpellBonus) Hash ¶ added in v5.25.0
func (s *SpellBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*SpellBonus) MatchForType ¶ added in v5.9.0
func (s *SpellBonus) MatchForType(replacements map[string]string, name, powerSource string, colleges []string) bool
MatchForType returns true if this spell bonus matches the data for its match type.
func (*SpellBonus) SetLevel ¶ added in v5.9.0
func (s *SpellBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type SpellData ¶
type SpellData struct { SourcedID SpellEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*Spell `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
SpellData holds the Spell data that is written to disk.
type SpellEditData ¶
type SpellEditData struct { SpellSyncData VTTNotes string `json:"vtt_notes,omitempty"` Replacements map[string]string `json:"replacements,omitempty"` SpellNonContainerOnlyEditData SkillContainerOnlySyncData }
SpellEditData holds the Spell data that can be edited by the UI detail editor.
func (*SpellEditData) ApplyTo ¶
func (s *SpellEditData) ApplyTo(other *Spell)
ApplyTo implements node.EditorData.
func (*SpellEditData) CopyFrom ¶
func (s *SpellEditData) CopyFrom(other *Spell)
CopyFrom implements node.EditorData.
type SpellListProvider ¶
type SpellListProvider interface { DataOwnerProvider SpellList() []*Spell SetSpellList(list []*Spell) }
SpellListProvider defines the methods needed to access the spell list data.
type SpellNonContainerOnlyEditData ¶ added in v5.21.0
type SpellNonContainerOnlyEditData struct { SpellNonContainerOnlySyncData TechLevel *string `json:"tech_level,omitempty"` Points fxp.Int `json:"points,omitempty"` Study []*Study `json:"study,omitempty"` StudyHoursNeeded study.Level `json:"study_hours_needed,omitempty"` }
SpellNonContainerOnlyEditData holds the Spell data that is only applicable to spells that aren't containers.
type SpellNonContainerOnlySyncData ¶ added in v5.26.0
type SpellNonContainerOnlySyncData struct { Difficulty AttributeDifficulty `json:"difficulty,omitempty"` College CollegeList `json:"college,omitempty"` PowerSource string `json:"power_source,omitempty"` Class string `json:"spell_class,omitempty"` Resist string `json:"resist,omitempty"` CastingCost string `json:"casting_cost,omitempty"` MaintenanceCost string `json:"maintenance_cost,omitempty"` CastingTime string `json:"casting_time,omitempty"` Duration string `json:"duration,omitempty"` RitualSkillName string `json:"base_skill,omitempty"` RitualPrereqCount int `json:"prereq_count,omitempty"` Prereq *PrereqList `json:"prereqs,omitempty"` Weapons []*Weapon `json:"weapons,omitempty"` }
SpellNonContainerOnlySyncData holds the spell sync data that is only applicable to traits that aren't containers.
type SpellPointBonus ¶ added in v5.9.0
type SpellPointBonus struct { Type feature.Type `json:"type"` SpellMatchType spellmatch.Type `json:"match"` NameCriteria criteria.Text `json:"name,omitempty"` TagsCriteria criteria.Text `json:"tags,alt=category,omitempty"` LeveledAmount BonusOwner }
SpellPointBonus holds an adjustment to a spell's points.
func NewSpellPointBonus ¶ added in v5.9.0
func NewSpellPointBonus() *SpellPointBonus
NewSpellPointBonus creates a new SpellPointBonus.
func (*SpellPointBonus) AddToTooltip ¶ added in v5.9.0
func (s *SpellPointBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*SpellPointBonus) Clone ¶ added in v5.9.0
func (s *SpellPointBonus) Clone() Feature
Clone implements Feature.
func (*SpellPointBonus) FeatureType ¶ added in v5.9.0
func (s *SpellPointBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*SpellPointBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SpellPointBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*SpellPointBonus) Hash ¶ added in v5.25.0
func (s *SpellPointBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*SpellPointBonus) MatchForType ¶ added in v5.9.0
func (s *SpellPointBonus) MatchForType(replacements map[string]string, name, powerSource string, colleges []string) bool
MatchForType returns true if this spell bonus matches the data for its match type.
func (*SpellPointBonus) SetLevel ¶ added in v5.9.0
func (s *SpellPointBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type SpellPrereq ¶
type SpellPrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` SubType spellcmp.Type `json:"sub_type"` Has bool `json:"has"` QualifierCriteria criteria.Text `json:"qualifier,omitempty"` QuantityCriteria criteria.Number `json:"quantity,omitempty"` }
SpellPrereq holds a prerequisite for a spell.
func (*SpellPrereq) Clone ¶
func (p *SpellPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*SpellPrereq) FillWithNameableKeys ¶
func (p *SpellPrereq) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Prereq.
func (*SpellPrereq) Hash ¶ added in v5.24.0
func (p *SpellPrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*SpellPrereq) ParentList ¶
func (p *SpellPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*SpellPrereq) PrereqType ¶
func (p *SpellPrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*SpellPrereq) Satisfied ¶
func (p *SpellPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type SpellSyncData ¶ added in v5.26.0
type SpellSyncData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` LocalNotes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` }
SpellSyncData holds the spell sync data that is common to both containers and non-containers.
type SrcMatcher ¶ added in v5.24.0
type SrcMatcher struct {
// contains filtered or unexported fields
}
SrcMatcher provides Source matching for a given ListProvider.
func (*SrcMatcher) Match ¶ added in v5.24.0
func (sm *SrcMatcher) Match(data SrcProvider) (state srcstate.Value, match any)
Match returns the source state of the given data.
func (*SrcMatcher) PrepareHashes ¶ added in v5.24.0
func (sm *SrcMatcher) PrepareHashes(provider ListProvider)
PrepareHashes for the given ListProvider.
type SrcProvider ¶ added in v5.24.0
SrcProvider defines the methods needed for a source provider that can be used with the SrcMatcher.Match() function.
type Study ¶ added in v5.3.0
type Study struct { Type study.Type `json:"type"` Hours fxp.Int `json:"hours"` Note string `json:"note,omitempty"` }
Study holds data about a single study session.
type TechLevelProvider ¶
type TechLevelProvider[T NodeTypes] interface { Node[T] RequiresTL() bool TL() string SetTL(tl string) }
TechLevelProvider defines methods that a TechLevel provider must implement.
type Template ¶
type Template struct { TemplateData // contains filtered or unexported fields }
Template holds the GURPS Template data that is written to disk.
func NewTemplateFromFile ¶
NewTemplateFromFile loads a Template from a file.
func (*Template) CarriedEquipmentList ¶
CarriedEquipmentList implements ListProvider
func (*Template) EnsureAttachments ¶ added in v5.24.0
func (t *Template) EnsureAttachments()
EnsureAttachments ensures that all attachments have their data owner set to the Template.
func (*Template) MarshalJSON ¶ added in v5.24.0
MarshalJSON implements json.Marshaler.
func (*Template) OtherEquipmentList ¶
OtherEquipmentList implements ListProvider
func (*Template) OwningEntity ¶ added in v5.24.0
OwningEntity returns nil.
func (*Template) SetCarriedEquipmentList ¶
SetCarriedEquipmentList implements ListProvider
func (*Template) SetNoteList ¶
SetNoteList implements ListProvider
func (*Template) SetOtherEquipmentList ¶
SetOtherEquipmentList implements ListProvider
func (*Template) SetSkillList ¶
SetSkillList implements ListProvider
func (*Template) SetSpellList ¶
SetSpellList implements ListProvider
func (*Template) SetTraitList ¶
SetTraitList implements ListProvider
func (*Template) SourceMatcher ¶ added in v5.24.0
func (t *Template) SourceMatcher() *SrcMatcher
SourceMatcher returns the SourceMatcher.
func (*Template) SyncWithLibrarySources ¶ added in v5.26.0
func (t *Template) SyncWithLibrarySources()
SyncWithLibrarySources syncs the template with the library sources.
func (*Template) UnmarshalJSON ¶ added in v5.24.0
UnmarshalJSON implements json.Unmarshaler.
type TemplateData ¶ added in v5.24.0
type TemplateData struct { Version int `json:"version"` ID tid.TID `json:"id"` Traits []*Trait `json:"traits,alt=advantages,omitempty"` Skills []*Skill `json:"skills,omitempty"` Spells []*Spell `json:"spells,omitempty"` Equipment []*Equipment `json:"equipment,omitempty"` Notes []*Note `json:"notes,omitempty"` }
TemplateData holds the GURPS Template data that is written to disk.
type TemplatePicker ¶ added in v5.3.0
type TemplatePicker struct { Type picker.Type `json:"type"` Qualifier criteria.Number `json:"qualifier"` }
TemplatePicker holds the data necessary to allow a template choice to be made.
func (*TemplatePicker) Clone ¶ added in v5.3.0
func (t *TemplatePicker) Clone() *TemplatePicker
Clone creates a copy of the TemplatePicker.
func (*TemplatePicker) Description ¶ added in v5.3.0
func (t *TemplatePicker) Description() string
Description returns a description of the picker action.
func (*TemplatePicker) Hash ¶ added in v5.24.0
func (t *TemplatePicker) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*TemplatePicker) ShouldOmit ¶ added in v5.3.0
func (t *TemplatePicker) ShouldOmit() bool
ShouldOmit implements json.Omitter.
type TemplatePickerProvider ¶ added in v5.3.0
type TemplatePickerProvider interface {
TemplatePickerData() *TemplatePicker
}
TemplatePickerProvider defines the methods a TemplatePicker provider has.
type TrainingData ¶ added in v5.9.0
type TrainingData struct { BuiltIn namegen.Builtin `json:"built_in_training_data,omitempty"` Weighted map[string]int `json:"weighted_training_data,omitempty"` Unweighted []string `json:"training_data,omitempty"` }
TrainingData is only valid when Type is not namegen.Compound. Only one will be used, and they are checked in the order listed here.
type Trait ¶
Trait holds an advantage, disadvantage, quirk, or perk.
func ActiveAncestryTraits ¶ added in v5.11.0
ActiveAncestryTraits returns the Traits that have Ancestry data and are enabled within the given traits or their descendants.
func NewNaturalAttacks ¶
NewNaturalAttacks creates a new "Natural Attacks" trait.
func NewTraitsFromFile ¶
NewTraitsFromFile loads an Trait list from a file.
func (*Trait) ActiveModifierFor ¶
func (t *Trait) ActiveModifierFor(name string) *TraitModifier
ActiveModifierFor returns the first modifier that matches the name (case-insensitive).
func (*Trait) AdjustedPoints ¶
AdjustedPoints returns the total points, taking levels and modifiers into account.
func (*Trait) AllModifiers ¶
func (t *Trait) AllModifiers() []*TraitModifier
AllModifiers returns the modifiers plus any inherited from parents.
func (*Trait) ApplyNameableKeys ¶
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*Trait) ClearSource ¶ added in v5.24.0
func (t *Trait) ClearSource()
ClearSource clears the source of this data.
func (*Trait) ClearUnusedFieldsForType ¶ added in v5.24.0
func (t *Trait) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*Trait) CurrentLevel ¶ added in v5.19.0
CurrentLevel returns the current level of the trait or zero if it is not leveled.
func (*Trait) Description ¶
Description returns a description, which doesn't include any levels.
func (*Trait) EffectivelyDisabled ¶ added in v5.1.0
EffectivelyDisabled returns true if this node or a parent is disabled.
func (*Trait) FeatureList ¶
FeatureList returns the list of Features.
func (*Trait) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Trait) HasChildren ¶ added in v5.24.0
HasChildren returns true if this node has children.
func (*Trait) Hash ¶ added in v5.24.0
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*Trait) LocalNotesWithReplacements ¶ added in v5.25.0
LocalNotesWithReplacements returns the local notes with any replacements applied.
func (*Trait) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Trait) ModifierNotes ¶
ModifierNotes returns the notes due to modifiers.
func (*Trait) NameWithReplacements ¶ added in v5.25.0
NameWithReplacements returns the name with any replacements applied.
func (*Trait) NameableReplacements ¶ added in v5.25.0
NameableReplacements returns the replacements to be used with Nameables.
func (*Trait) NodeChildren ¶ added in v5.24.0
NodeChildren returns the children of this node, if any.
func (*Trait) RatedStrength ¶ added in v5.11.0
RatedStrength always return 0 for traits.
func (*Trait) SecondaryText ¶
SecondaryText returns the "secondary" text: the text display below an Trait.
func (*Trait) SetChildren ¶ added in v5.24.0
SetChildren sets the children of this node.
func (*Trait) SetDataOwner ¶ added in v5.24.0
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*Trait) SyncWithSource ¶ added in v5.24.0
func (t *Trait) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*Trait) TemplatePickerData ¶ added in v5.3.0
func (t *Trait) TemplatePickerData() *TemplatePicker
TemplatePickerData returns the TemplatePicker data, if any.
func (*Trait) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Trait) UserDescWithReplacements ¶ added in v5.25.0
UserDescWithReplacements returns the user description with any replacements applied.
type TraitContainerSyncData ¶ added in v5.26.0
type TraitContainerSyncData struct { Ancestry string `json:"ancestry,omitempty"` TemplatePicker *TemplatePicker `json:"template_picker,omitempty"` ContainerType container.Type `json:"container_type,omitempty"` }
TraitContainerSyncData holds the Trait sync data that is only applicable to traits that are containers.
type TraitData ¶
type TraitData struct { SourcedID TraitEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*Trait `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
TraitData holds the Trait data that is written to disk.
type TraitEditData ¶
type TraitEditData struct { TraitSyncData VTTNotes string `json:"vtt_notes,omitempty"` UserDesc string `json:"userdesc,omitempty"` Replacements map[string]string `json:"replacements,omitempty"` Modifiers []*TraitModifier `json:"modifiers,omitempty"` CR selfctrl.Roll `json:"cr,omitempty"` Disabled bool `json:"disabled,omitempty"` TraitNonContainerOnlyEditData TraitContainerSyncData }
TraitEditData holds the Trait data that can be edited by the UI detail editor.
func (*TraitEditData) ApplyTo ¶
func (t *TraitEditData) ApplyTo(other *Trait)
ApplyTo implements node.EditorData.
func (*TraitEditData) CopyFrom ¶
func (t *TraitEditData) CopyFrom(other *Trait)
CopyFrom implements node.EditorData.
type TraitListProvider ¶
type TraitListProvider interface { DataOwnerProvider TraitList() []*Trait SetTraitList(list []*Trait) }
TraitListProvider defines the methods needed to access the trait list data.
type TraitModifier ¶
type TraitModifier struct { TraitModifierData // contains filtered or unexported fields }
TraitModifier holds a modifier to an Trait.
func NewTraitModifier ¶
func NewTraitModifier(owner DataOwner, parent *TraitModifier, container bool) *TraitModifier
NewTraitModifier creates a TraitModifier.
func NewTraitModifiersFromFile ¶
func NewTraitModifiersFromFile(fileSystem fs.FS, filePath string) ([]*TraitModifier, error)
NewTraitModifiersFromFile loads a TraitModifier list from a file.
func (*TraitModifier) ApplyNameableKeys ¶
func (t *TraitModifier) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys replaces any nameable keys found in this TraitModifier with the corresponding values in the provided map.
func (*TraitModifier) CellData ¶
func (t *TraitModifier) CellData(columnID int, data *CellData)
CellData returns the cell data information for the given column.
func (*TraitModifier) ClearSource ¶ added in v5.24.0
func (t *TraitModifier) ClearSource()
ClearSource clears the source of this data.
func (*TraitModifier) ClearUnusedFieldsForType ¶ added in v5.24.0
func (t *TraitModifier) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*TraitModifier) Clone ¶
func (t *TraitModifier) Clone(from LibraryFile, owner DataOwner, parent *TraitModifier, preserveID bool) *TraitModifier
Clone implements Node.
func (*TraitModifier) Container ¶ added in v5.24.0
func (t *TraitModifier) Container() bool
Container returns true if this is a container.
func (*TraitModifier) CostDescription ¶
func (t *TraitModifier) CostDescription() string
CostDescription returns the formatted cost.
func (*TraitModifier) CostModifier ¶
func (t *TraitModifier) CostModifier() fxp.Int
CostModifier returns the total cost modifier.
func (*TraitModifier) CostMultiplier ¶ added in v5.26.0
func (t *TraitModifier) CostMultiplier() fxp.Int
CostMultiplier returns the amount to multiply the cost by.
func (*TraitModifier) CurrentLevel ¶ added in v5.19.0
func (t *TraitModifier) CurrentLevel() fxp.Int
CurrentLevel returns the current level of the modifier or zero if it is not leveled.
func (*TraitModifier) DataOwner ¶ added in v5.24.0
func (t *TraitModifier) DataOwner() DataOwner
DataOwner returns the data owner.
func (*TraitModifier) Depth ¶
func (t *TraitModifier) Depth() int
Depth returns the number of parents this node has.
func (*TraitModifier) Enabled ¶
func (t *TraitModifier) Enabled() bool
Enabled returns true if this node is enabled.
func (*TraitModifier) FillWithNameableKeys ¶
func (t *TraitModifier) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys adds any nameable keys found in this TraitModifier to the provided map.
func (*TraitModifier) FullCostDescription ¶ added in v5.2.0
func (t *TraitModifier) FullCostDescription() string
FullCostDescription is the same as CostDescription().
func (*TraitModifier) FullDescription ¶
func (t *TraitModifier) FullDescription() string
FullDescription returns a full description.
func (*TraitModifier) GetSource ¶ added in v5.24.0
func (t *TraitModifier) GetSource() Source
GetSource returns the source of this data.
func (*TraitModifier) HasChildren ¶ added in v5.24.0
func (t *TraitModifier) HasChildren() bool
HasChildren returns true if this node has children.
func (*TraitModifier) Hash ¶ added in v5.24.0
func (t *TraitModifier) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
func (*TraitModifier) ID ¶ added in v5.24.0
func (t *TraitModifier) ID() tid.TID
ID returns the local ID of this data.
func (*TraitModifier) IsLeveled ¶ added in v5.19.0
func (t *TraitModifier) IsLeveled() bool
IsLeveled returns true if this TraitModifier is leveled.
func (*TraitModifier) IsOpen ¶ added in v5.24.0
func (t *TraitModifier) IsOpen() bool
IsOpen returns true if this node is currently open.
func (*TraitModifier) Kind ¶ added in v5.24.0
func (t *TraitModifier) Kind() string
Kind returns the kind of data.
func (*TraitModifier) LocalNotesWithReplacements ¶ added in v5.25.0
func (t *TraitModifier) LocalNotesWithReplacements() string
LocalNotesWithReplacements returns the local notes with any replacements applied.
func (*TraitModifier) MarshalJSON ¶
func (t *TraitModifier) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*TraitModifier) NameWithReplacements ¶ added in v5.25.0
func (t *TraitModifier) NameWithReplacements() string
NameWithReplacements returns the name with any replacements applied.
func (*TraitModifier) NameableReplacements ¶ added in v5.25.0
func (t *TraitModifier) NameableReplacements() map[string]string
NameableReplacements returns the replacements to be used with Nameables.
func (*TraitModifier) NodeChildren ¶ added in v5.24.0
func (t *TraitModifier) NodeChildren() []*TraitModifier
NodeChildren returns the children of this node, if any.
func (*TraitModifier) OwningTrait ¶ added in v5.26.0
func (t *TraitModifier) OwningTrait() *Trait
OwningTrait returns the owning trait.
func (*TraitModifier) Parent ¶ added in v5.24.0
func (t *TraitModifier) Parent() *TraitModifier
Parent returns the parent.
func (*TraitModifier) SecondaryText ¶
func (t *TraitModifier) SecondaryText(optionChecker func(display.Option) bool) string
SecondaryText returns the "secondary" text: the text display below an Trait.
func (*TraitModifier) SetChildren ¶ added in v5.24.0
func (t *TraitModifier) SetChildren(children []*TraitModifier)
SetChildren sets the children of this node.
func (*TraitModifier) SetDataOwner ¶ added in v5.24.0
func (t *TraitModifier) SetDataOwner(owner DataOwner)
SetDataOwner sets the data owner and configures any sub-components as needed.
func (*TraitModifier) SetEnabled ¶
func (t *TraitModifier) SetEnabled(enabled bool)
SetEnabled makes the node enabled, if possible.
func (*TraitModifier) SetOpen ¶ added in v5.24.0
func (t *TraitModifier) SetOpen(open bool)
SetOpen sets the current open state for this node.
func (*TraitModifier) SetParent ¶ added in v5.24.0
func (t *TraitModifier) SetParent(parent *TraitModifier)
SetParent sets the parent.
func (*TraitModifier) String ¶
func (t *TraitModifier) String() string
func (*TraitModifier) SyncWithSource ¶ added in v5.24.0
func (t *TraitModifier) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*TraitModifier) TagList ¶ added in v5.2.0
func (t *TraitModifier) TagList() []string
TagList returns the list of tags.
func (*TraitModifier) UnmarshalJSON ¶
func (t *TraitModifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TraitModifierData ¶
type TraitModifierData struct { SourcedID TraitModifierEditData ThirdParty map[string]any `json:"third_party,omitempty"` Children []*TraitModifier `json:"children,omitempty"` // Only for containers // contains filtered or unexported fields }
TraitModifierData holds the TraitModifier data that is written to disk.
type TraitModifierEditData ¶
type TraitModifierEditData struct { TraitModifierSyncData VTTNotes string `json:"vtt_notes,omitempty"` Replacements map[string]string `json:"replacements,omitempty"` TraitModifierEditDataNonContainerOnly }
TraitModifierEditData holds the TraitModifier data that can be edited by the UI detail editor.
func (*TraitModifierEditData) ApplyTo ¶
func (t *TraitModifierEditData) ApplyTo(other *TraitModifier)
ApplyTo implements node.EditorData.
func (*TraitModifierEditData) CopyFrom ¶
func (t *TraitModifierEditData) CopyFrom(other *TraitModifier)
CopyFrom implements node.EditorData.
type TraitModifierEditDataNonContainerOnly ¶ added in v5.21.0
type TraitModifierEditDataNonContainerOnly struct { TraitModifierNonContainerSyncData Levels fxp.Int `json:"levels,omitempty"` Disabled bool `json:"disabled,omitempty"` }
TraitModifierEditDataNonContainerOnly holds the TraitModifier data that is only applicable to TraitModifiers that aren't containers.
type TraitModifierListProvider ¶
type TraitModifierListProvider interface { DataOwnerProvider TraitModifierList() []*TraitModifier SetTraitModifierList(list []*TraitModifier) }
TraitModifierListProvider defines the methods needed to access the trait modifier list data.
type TraitModifierNonContainerSyncData ¶ added in v5.26.0
type TraitModifierNonContainerSyncData struct { Cost fxp.Int `json:"cost,omitempty"` CostType tmcost.Type `json:"cost_type,omitempty"` UseLevelFromTrait bool `json:"use_level_from_trait,omitempty"` Affects affects.Option `json:"affects,omitempty"` Features Features `json:"features,omitempty"` }
TraitModifierNonContainerSyncData holds the TraitModifier sync data that is only applicable to TraitModifiers that aren't containers.
type TraitModifierSyncData ¶ added in v5.26.0
type TraitModifierSyncData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` LocalNotes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` }
TraitModifierSyncData holds the TraitModifier sync data that is common to both containers and non-containers.
type TraitNonContainerOnlyEditData ¶ added in v5.21.0
type TraitNonContainerOnlyEditData struct { TraitNonContainerSyncData Levels fxp.Int `json:"levels,omitempty"` Study []*Study `json:"study,omitempty"` StudyHoursNeeded study.Level `json:"study_hours_needed,omitempty"` }
TraitNonContainerOnlyEditData holds the Trait data that is only applicable to traits that aren't containers.
type TraitNonContainerSyncData ¶ added in v5.26.0
type TraitNonContainerSyncData struct { BasePoints fxp.Int `json:"base_points,omitempty"` PointsPerLevel fxp.Int `json:"points_per_level,omitempty"` Weapons []*Weapon `json:"weapons,omitempty"` Features Features `json:"features,omitempty"` RoundCostDown bool `json:"round_down,omitempty"` CanLevel bool `json:"can_level,omitempty"` }
TraitNonContainerSyncData holds the Trait sync data that is only applicable to traits that aren't containers.
type TraitPrereq ¶
type TraitPrereq struct { Parent *PrereqList `json:"-"` Type prereq.Type `json:"type"` Has bool `json:"has"` NameCriteria criteria.Text `json:"name,omitempty"` LevelCriteria criteria.Number `json:"level,omitempty"` NotesCriteria criteria.Text `json:"notes,omitempty"` }
TraitPrereq holds a prereq against a Trait.
func (*TraitPrereq) Clone ¶
func (p *TraitPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*TraitPrereq) FillWithNameableKeys ¶
func (p *TraitPrereq) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Prereq.
func (*TraitPrereq) Hash ¶ added in v5.24.0
func (p *TraitPrereq) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*TraitPrereq) ParentList ¶
func (p *TraitPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*TraitPrereq) PrereqType ¶
func (p *TraitPrereq) PrereqType() prereq.Type
PrereqType implements Prereq.
func (*TraitPrereq) Satisfied ¶
func (p *TraitPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type TraitSyncData ¶ added in v5.26.0
type TraitSyncData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` PageRefHighlight string `json:"reference_highlight,omitempty"` LocalNotes string `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` Prereq *PrereqList `json:"prereqs,omitempty"` CRAdj selfctrl.Adjustment `json:"cr_adj,omitempty"` }
TraitSyncData holds the Trait sync data that is common to both containers and non-containers.
type Weapon ¶
type Weapon struct { WeaponData Owner WeaponOwner }
Weapon holds the stats for a weapon.
func CloneWeapons ¶ added in v5.24.0
CloneWeapons clones the input list of weapons.
func ExtractWeaponsOfType ¶
ExtractWeaponsOfType filters the input list down to only those weapons of the given type.
func NewWeapon ¶
func NewWeapon(owner WeaponOwner, melee bool) *Weapon
NewWeapon creates a new weapon of the given type.
func SeparateWeapons ¶
SeparateWeapons returns separate lists for melee and ranged weapons found in the input list.
func (*Weapon) ApplyNameableKeys ¶
ApplyNameableKeys replaces any nameable keys found in this Weapon with the corresponding values in the provided map.
func (*Weapon) ClearSource ¶ added in v5.24.0
func (w *Weapon) ClearSource()
ClearSource clears the source of this data.
func (*Weapon) Compare ¶ added in v5.19.0
Compare returns an integer indicating the sort order of this weapon compared to the other weapon.
func (*Weapon) EncumbrancePenalty ¶
EncumbrancePenalty returns the current encumbrance penalty.
func (*Weapon) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found in this Weapon to the provided map.
func (*Weapon) HasChildren ¶
HasChildren returns true if this node has children.
func (*Weapon) HashResolved ¶ added in v5.24.0
HashResolved returns a hash value for this weapon's resolved state.
func (*Weapon) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Weapon) NameableReplacements ¶ added in v5.25.0
NameableReplacements returns the replacements to be used with this weapon.
func (*Weapon) NodeChildren ¶
NodeChildren returns the children of this node, if any.
func (*Weapon) ResolveBoolFlag ¶ added in v5.19.0
ResolveBoolFlag returns the resolved value of the given bool flag.
func (*Weapon) SetChildren ¶
SetChildren sets the children of this node.
func (*Weapon) SetDataOwner ¶ added in v5.24.0
SetDataOwner does nothing.
func (*Weapon) SetOwner ¶
func (w *Weapon) SetOwner(owner WeaponOwner)
SetOwner sets the owner and ensures sub-components have their owners set.
func (*Weapon) SkillLevel ¶
func (w *Weapon) SkillLevel(tooltip *xio.ByteBuffer) fxp.Int
SkillLevel returns the resolved skill level.
func (*Weapon) SyncWithSource ¶ added in v5.24.0
func (w *Weapon) SyncWithSource()
SyncWithSource synchronizes this data with the source.
func (*Weapon) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Weapon) UsageNotesWithReplacements ¶ added in v5.26.0
UsageNotesWithReplacements returns the usage notes of the weapon with any nameable keys replaced.
func (*Weapon) UsageWithReplacements ¶ added in v5.26.0
UsageWithReplacements returns the usage of the weapon with any nameable keys replaced.
type WeaponAccuracy ¶ added in v5.19.0
WeaponAccuracy holds the accuracy data for a weapon.
func ParseWeaponAccuracy ¶ added in v5.19.0
func ParseWeaponAccuracy(s string) WeaponAccuracy
ParseWeaponAccuracy parses a string into a WeaponAccuracy.
func (WeaponAccuracy) Hash ¶ added in v5.24.0
func (wa WeaponAccuracy) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponAccuracy) MarshalJSON ¶ added in v5.19.0
func (wa WeaponAccuracy) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponAccuracy) Resolve ¶ added in v5.19.0
func (wa WeaponAccuracy) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponAccuracy
Resolve any bonuses that apply.
func (WeaponAccuracy) ShouldOmit ¶ added in v5.19.0
func (wa WeaponAccuracy) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponAccuracy) String ¶ added in v5.19.0
func (wa WeaponAccuracy) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (*WeaponAccuracy) UnmarshalJSON ¶ added in v5.19.0
func (wa *WeaponAccuracy) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponAccuracy) Validate ¶ added in v5.19.0
func (wa *WeaponAccuracy) Validate()
Validate ensures that the data is valid.
type WeaponBlock ¶ added in v5.19.0
WeaponBlock holds the block data for a weapon.
func ParseWeaponBlock ¶ added in v5.19.0
func ParseWeaponBlock(s string) WeaponBlock
ParseWeaponBlock parses a string into a WeaponBlock.
func (WeaponBlock) Hash ¶ added in v5.24.0
func (wb WeaponBlock) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponBlock) MarshalJSON ¶ added in v5.19.0
func (wb WeaponBlock) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponBlock) Resolve ¶ added in v5.19.0
func (wb WeaponBlock) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponBlock
Resolve any bonuses that apply.
func (WeaponBlock) ShouldOmit ¶ added in v5.19.0
func (wb WeaponBlock) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponBlock) String ¶ added in v5.19.0
func (wb WeaponBlock) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (*WeaponBlock) UnmarshalJSON ¶ added in v5.19.0
func (wb *WeaponBlock) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponBlock) Validate ¶ added in v5.19.0
func (wb *WeaponBlock) Validate()
Validate ensures that the data is valid.
type WeaponBonus ¶ added in v5.9.0
type WeaponBonus struct { Type feature.Type `json:"type"` Percent bool `json:"percent,omitempty"` SelectionType wsel.Type `json:"selection_type"` SwitchType wswitch.Type `json:"switch_type,omitempty"` SwitchTypeValue bool `json:"switch_type_value,omitempty"` NameCriteria criteria.Text `json:"name,omitempty"` SpecializationCriteria criteria.Text `json:"specialization,omitempty"` RelativeLevelCriteria criteria.Number `json:"level,omitempty"` UsageCriteria criteria.Text `json:"usage,omitempty"` TagsCriteria criteria.Text `json:"tags,alt=category,omitempty"` WeaponLeveledAmount BonusOwner }
WeaponBonus holds the data for an adjustment to weapon damage.
func NewWeaponAccBonus ¶ added in v5.19.0
func NewWeaponAccBonus() *WeaponBonus
NewWeaponAccBonus creates a new weapon accuracy bonus.
func NewWeaponBlockBonus ¶ added in v5.19.0
func NewWeaponBlockBonus() *WeaponBonus
NewWeaponBlockBonus creates a new weapon block bonus.
func NewWeaponBulkBonus ¶ added in v5.19.0
func NewWeaponBulkBonus() *WeaponBonus
NewWeaponBulkBonus creates a new weapon bulk bonus.
func NewWeaponChamberShotsBonus ¶ added in v5.19.0
func NewWeaponChamberShotsBonus() *WeaponBonus
NewWeaponChamberShotsBonus creates a new weapon chamber shots bonus.
func NewWeaponDRDivisorBonus ¶ added in v5.9.0
func NewWeaponDRDivisorBonus() *WeaponBonus
NewWeaponDRDivisorBonus creates a new weapon DR divisor bonus.
func NewWeaponDamageBonus ¶ added in v5.9.0
func NewWeaponDamageBonus() *WeaponBonus
NewWeaponDamageBonus creates a new weapon damage bonus.
func NewWeaponEffectiveSTBonus ¶ added in v5.23.0
func NewWeaponEffectiveSTBonus() *WeaponBonus
NewWeaponEffectiveSTBonus creates a new weapon effective ST bonus.
func NewWeaponHalfDamageRangeBonus ¶ added in v5.19.0
func NewWeaponHalfDamageRangeBonus() *WeaponBonus
NewWeaponHalfDamageRangeBonus creates a new weapon half-damage range bonus.
func NewWeaponMaxRangeBonus ¶ added in v5.19.0
func NewWeaponMaxRangeBonus() *WeaponBonus
NewWeaponMaxRangeBonus creates a new weapon maximum range bonus.
func NewWeaponMaxReachBonus ¶ added in v5.19.0
func NewWeaponMaxReachBonus() *WeaponBonus
NewWeaponMaxReachBonus creates a new weapon maximum reach bonus.
func NewWeaponMinRangeBonus ¶ added in v5.19.0
func NewWeaponMinRangeBonus() *WeaponBonus
NewWeaponMinRangeBonus creates a new weapon minimum range bonus.
func NewWeaponMinReachBonus ¶ added in v5.19.0
func NewWeaponMinReachBonus() *WeaponBonus
NewWeaponMinReachBonus creates a new weapon minimum reach bonus.
func NewWeaponMinSTBonus ¶ added in v5.19.0
func NewWeaponMinSTBonus() *WeaponBonus
NewWeaponMinSTBonus creates a new weapon minimum ST bonus.
func NewWeaponNonChamberShotsBonus ¶ added in v5.19.0
func NewWeaponNonChamberShotsBonus() *WeaponBonus
NewWeaponNonChamberShotsBonus creates a new weapon non-chamber shots bonus.
func NewWeaponParryBonus ¶ added in v5.19.0
func NewWeaponParryBonus() *WeaponBonus
NewWeaponParryBonus creates a new weapon parry bonus.
func NewWeaponRecoilBonus ¶ added in v5.19.0
func NewWeaponRecoilBonus() *WeaponBonus
NewWeaponRecoilBonus creates a new weapon recoil bonus.
func NewWeaponReloadTimeBonus ¶ added in v5.19.0
func NewWeaponReloadTimeBonus() *WeaponBonus
NewWeaponReloadTimeBonus creates a new weapon reload time bonus.
func NewWeaponRofMode1SecondaryBonus ¶ added in v5.19.0
func NewWeaponRofMode1SecondaryBonus() *WeaponBonus
NewWeaponRofMode1SecondaryBonus creates a new weapon rate of fire mode 1 secondary projectile bonus.
func NewWeaponRofMode1ShotsBonus ¶ added in v5.19.0
func NewWeaponRofMode1ShotsBonus() *WeaponBonus
NewWeaponRofMode1ShotsBonus creates a new weapon rate of fire mode 1 shots per attack bonus.
func NewWeaponRofMode2SecondaryBonus ¶ added in v5.19.0
func NewWeaponRofMode2SecondaryBonus() *WeaponBonus
NewWeaponRofMode2SecondaryBonus creates a new weapon rate of fire mode 2 secondary projectile bonus.
func NewWeaponRofMode2ShotsBonus ¶ added in v5.19.0
func NewWeaponRofMode2ShotsBonus() *WeaponBonus
NewWeaponRofMode2ShotsBonus creates a new weapon rate of fire mode 2 shots per attack bonus.
func NewWeaponScopeAccBonus ¶ added in v5.19.0
func NewWeaponScopeAccBonus() *WeaponBonus
NewWeaponScopeAccBonus creates a new weapon scope accuracy bonus.
func NewWeaponShotDurationBonus ¶ added in v5.19.0
func NewWeaponShotDurationBonus() *WeaponBonus
NewWeaponShotDurationBonus creates a new weapon shot duration bonus.
func NewWeaponSwitchBonus ¶ added in v5.19.0
func NewWeaponSwitchBonus() *WeaponBonus
NewWeaponSwitchBonus creates a new weapon switch bonus.
func (*WeaponBonus) AddToTooltip ¶ added in v5.9.0
func (w *WeaponBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*WeaponBonus) AdjustedAmountForWeapon ¶ added in v5.19.0
func (w *WeaponBonus) AdjustedAmountForWeapon(wpn *Weapon) fxp.Int
AdjustedAmountForWeapon returns the adjusted amount for the given weapon.
func (*WeaponBonus) Clone ¶ added in v5.9.0
func (w *WeaponBonus) Clone() Feature
Clone implements Feature.
func (*WeaponBonus) FeatureType ¶ added in v5.9.0
func (w *WeaponBonus) FeatureType() feature.Type
FeatureType implements Feature.
func (*WeaponBonus) FillWithNameableKeys ¶ added in v5.9.0
func (w *WeaponBonus) FillWithNameableKeys(m, existing map[string]string)
FillWithNameableKeys implements Feature.
func (*WeaponBonus) Hash ¶ added in v5.24.0
func (w *WeaponBonus) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*WeaponBonus) SetLevel ¶ added in v5.9.0
func (w *WeaponBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
type WeaponBulk ¶ added in v5.19.0
WeaponBulk holds the bulk data for a weapon.
func ParseWeaponBulk ¶ added in v5.19.0
func ParseWeaponBulk(s string) WeaponBulk
ParseWeaponBulk parses a string into a WeaponBulk.
func (WeaponBulk) Hash ¶ added in v5.24.0
func (wb WeaponBulk) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponBulk) MarshalJSON ¶ added in v5.19.0
func (wb WeaponBulk) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponBulk) Resolve ¶ added in v5.19.0
func (wb WeaponBulk) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponBulk
Resolve any bonuses that apply.
func (WeaponBulk) ShouldOmit ¶ added in v5.19.0
func (wb WeaponBulk) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponBulk) String ¶ added in v5.19.0
func (wb WeaponBulk) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponBulk) Tooltip ¶ added in v5.19.0
func (wb WeaponBulk) Tooltip(w *Weapon) string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponBulk) UnmarshalJSON ¶ added in v5.19.0
func (wb *WeaponBulk) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponBulk) Validate ¶ added in v5.19.0
func (wb *WeaponBulk) Validate()
Validate ensures that the data is valid.
type WeaponDamage ¶
type WeaponDamage struct { WeaponDamageData Owner *Weapon }
WeaponDamage holds the damage information for a weapon.
func (*WeaponDamage) BaseDamageDice ¶ added in v5.19.0
func (w *WeaponDamage) BaseDamageDice() *dice.Dice
BaseDamageDice returns the base damage dice for this weapon (i.e. the dice before any bonuses are applied).
func (*WeaponDamage) Clone ¶
func (w *WeaponDamage) Clone(owner *Weapon) *WeaponDamage
Clone creates a copy of this data.
func (*WeaponDamage) DamageTooltip ¶
func (w *WeaponDamage) DamageTooltip() string
DamageTooltip returns a formatted tooltip for the damage.
func (*WeaponDamage) Hash ¶ added in v5.24.0
func (w *WeaponDamage) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*WeaponDamage) MarshalJSON ¶
func (w *WeaponDamage) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*WeaponDamage) ResolvedDamage ¶
func (w *WeaponDamage) ResolvedDamage(tooltip *xio.ByteBuffer) string
ResolvedDamage returns the damage, fully resolved for the user's sw or thr, if possible.
func (*WeaponDamage) String ¶
func (w *WeaponDamage) String() string
func (*WeaponDamage) UnmarshalJSON ¶
func (w *WeaponDamage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type WeaponDamageData ¶
type WeaponDamageData struct { Type string `json:"type"` StrengthType stdmg.Option `json:"st,omitempty"` Leveled bool `json:"leveled,omitempty"` StrengthMultiplier fxp.Int `json:"st_mul,omitempty"` Base *dice.Dice `json:"base,omitempty"` ArmorDivisor fxp.Int `json:"armor_divisor,omitempty"` Fragmentation *dice.Dice `json:"fragmentation,omitempty"` FragmentationArmorDivisor fxp.Int `json:"fragmentation_armor_divisor,omitempty"` FragmentationType string `json:"fragmentation_type,omitempty"` ModifierPerDie fxp.Int `json:"modifier_per_die,omitempty"` }
WeaponDamageData holds the WeaponDamage data that is written to disk.
type WeaponData ¶
type WeaponData struct { TID tid.TID `json:"id"` Damage WeaponDamage `json:"damage"` Strength WeaponStrength `json:"strength,omitempty"` Usage string `json:"usage,omitempty"` UsageNotes string `json:"usage_notes,omitempty"` Reach WeaponReach `json:"reach,omitempty"` Parry WeaponParry `json:"parry,omitempty"` Block WeaponBlock `json:"block,omitempty"` Accuracy WeaponAccuracy `json:"accuracy,omitempty"` Range WeaponRange `json:"range,omitempty"` RateOfFire WeaponRoF `json:"rate_of_fire,omitempty"` Shots WeaponShots `json:"shots,omitempty"` Bulk WeaponBulk `json:"bulk,omitempty"` Recoil WeaponRecoil `json:"recoil,omitempty"` Defaults []*SkillDefault `json:"defaults,omitempty"` }
WeaponData holds the Weapon data that is written to disk.
func (*WeaponData) Hash ¶ added in v5.24.0
func (w *WeaponData) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
type WeaponLeveledAmount ¶ added in v5.19.0
type WeaponLeveledAmount struct { Level fxp.Int `json:"-"` DieCount fxp.Int `json:"-"` Amount fxp.Int `json:"amount"` PerLevel bool `json:"leveled,omitempty"` PerDie bool `json:"per_die,alt=per_level,omitempty"` }
WeaponLeveledAmount holds an amount that can be either a fixed amount, or an amount per level and/or per die.
func (*WeaponLeveledAmount) AdjustedAmount ¶ added in v5.19.0
func (w *WeaponLeveledAmount) AdjustedAmount() fxp.Int
AdjustedAmount returns the amount, adjusted for level, if requested.
func (*WeaponLeveledAmount) Format ¶ added in v5.19.0
func (w *WeaponLeveledAmount) Format(asPercentage bool) string
Format the value.
func (*WeaponLeveledAmount) Hash ¶ added in v5.24.0
func (w *WeaponLeveledAmount) Hash(h hash.Hash)
Hash writes this object's contents into the hasher. Note that this only hashes the data that is considered to be "source" data, i.e. not expected to be modified by the user after copying from a library.
type WeaponListProvider ¶
type WeaponListProvider interface { DataOwnerProvider WeaponOwner() WeaponOwner Weapons(melee bool) []*Weapon SetWeapons(melee bool, list []*Weapon) }
WeaponListProvider defines the methods needed to access the weapon list data.
type WeaponOwner ¶
type WeaponOwner interface { fmt.Stringer nameable.Accesser DataOwner() DataOwner Description() string Notes() string FeatureList() Features TagList() []string RatedStrength() fxp.Int }
WeaponOwner defines the methods required of a Weapon owner.
type WeaponParry ¶ added in v5.19.0
WeaponParry holds the parry data for a weapon.
func ParseWeaponParry ¶ added in v5.19.0
func ParseWeaponParry(s string) WeaponParry
ParseWeaponParry parses a string into a WeaponParry.
func (WeaponParry) Hash ¶ added in v5.24.0
func (wp WeaponParry) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponParry) MarshalJSON ¶ added in v5.19.0
func (wp WeaponParry) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponParry) Resolve ¶ added in v5.19.0
func (wp WeaponParry) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponParry
Resolve any bonuses that apply.
func (WeaponParry) ShouldOmit ¶ added in v5.19.0
func (wp WeaponParry) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponParry) String ¶ added in v5.19.0
func (wp WeaponParry) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponParry) Tooltip ¶ added in v5.19.0
func (wp WeaponParry) Tooltip() string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponParry) UnmarshalJSON ¶ added in v5.19.0
func (wp *WeaponParry) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponParry) Validate ¶ added in v5.19.0
func (wp *WeaponParry) Validate()
Validate ensures that the data is valid.
type WeaponRange ¶ added in v5.19.0
type WeaponRange struct { HalfDamage fxp.Int Min fxp.Int Max fxp.Int MusclePowered bool InMiles bool }
WeaponRange holds the range data for a weapon.
func ParseWeaponRange ¶ added in v5.19.0
func ParseWeaponRange(s string) WeaponRange
ParseWeaponRange parses a string into a WeaponRange.
func (WeaponRange) Hash ¶ added in v5.24.0
func (wr WeaponRange) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponRange) MarshalJSON ¶ added in v5.19.0
func (wr WeaponRange) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponRange) Resolve ¶ added in v5.19.0
func (wr WeaponRange) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponRange
Resolve any bonuses that apply.
func (WeaponRange) ShouldOmit ¶ added in v5.19.0
func (wr WeaponRange) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponRange) String ¶ added in v5.19.0
func (wr WeaponRange) String(musclePowerIsResolved bool) string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (*WeaponRange) UnmarshalJSON ¶ added in v5.19.0
func (wr *WeaponRange) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponRange) Validate ¶ added in v5.19.0
func (wr *WeaponRange) Validate()
Validate ensures that the data is valid.
type WeaponReach ¶ added in v5.19.0
WeaponReach holds the reach data for a weapon.
func ParseWeaponReach ¶ added in v5.19.0
func ParseWeaponReach(s string) WeaponReach
ParseWeaponReach parses a string into a WeaponReach.
func (WeaponReach) Hash ¶ added in v5.24.0
func (wr WeaponReach) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponReach) MarshalJSON ¶ added in v5.19.0
func (wr WeaponReach) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponReach) Resolve ¶ added in v5.19.0
func (wr WeaponReach) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponReach
Resolve any bonuses that apply.
func (WeaponReach) ShouldOmit ¶ added in v5.19.0
func (wr WeaponReach) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponReach) String ¶ added in v5.19.0
func (wr WeaponReach) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponReach) Tooltip ¶ added in v5.19.0
func (wr WeaponReach) Tooltip() string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponReach) UnmarshalJSON ¶ added in v5.19.0
func (wr *WeaponReach) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponReach) Validate ¶ added in v5.19.0
func (wr *WeaponReach) Validate()
Validate ensures that the data is valid.
type WeaponRecoil ¶ added in v5.19.0
WeaponRecoil holds the recoil data for a weapon.
func ParseWeaponRecoil ¶ added in v5.19.0
func ParseWeaponRecoil(s string) WeaponRecoil
ParseWeaponRecoil parses a string into a WeaponRecoil.
func (WeaponRecoil) Hash ¶ added in v5.24.0
func (wr WeaponRecoil) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponRecoil) MarshalJSON ¶ added in v5.19.0
func (wr WeaponRecoil) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponRecoil) Resolve ¶ added in v5.19.0
func (wr WeaponRecoil) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponRecoil
Resolve any bonuses that apply.
func (WeaponRecoil) ShouldOmit ¶ added in v5.19.0
func (wr WeaponRecoil) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponRecoil) String ¶ added in v5.19.0
func (wr WeaponRecoil) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponRecoil) Tooltip ¶ added in v5.19.0
func (wr WeaponRecoil) Tooltip() string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponRecoil) UnmarshalJSON ¶ added in v5.19.0
func (wr *WeaponRecoil) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponRecoil) Validate ¶ added in v5.19.0
func (wr *WeaponRecoil) Validate()
Validate ensures that the data is valid.
type WeaponRoF ¶ added in v5.19.0
type WeaponRoF struct { Mode1 WeaponRoFMode Mode2 WeaponRoFMode Jet bool }
WeaponRoF holds the rate of fire data for a weapon.
func ParseWeaponRoF ¶ added in v5.19.0
ParseWeaponRoF parses a string into a WeaponRoF.
func (WeaponRoF) MarshalJSON ¶ added in v5.19.0
MarshalJSON marshals the data to JSON.
func (WeaponRoF) Resolve ¶ added in v5.19.0
func (wr WeaponRoF) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponRoF
Resolve any bonuses that apply.
func (WeaponRoF) ShouldOmit ¶ added in v5.19.0
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponRoF) String ¶ added in v5.19.0
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponRoF) Tooltip ¶ added in v5.19.0
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponRoF) UnmarshalJSON ¶ added in v5.19.0
UnmarshalJSON unmarshals the data from JSON.
type WeaponRoFMode ¶ added in v5.19.0
type WeaponRoFMode struct { ShotsPerAttack fxp.Int SecondaryProjectiles fxp.Int FullAutoOnly bool HighCyclicControlledBursts bool }
WeaponRoFMode holds the rate of fire data for one firing mode of a weapon.
func ParseWeaponRoFMode ¶ added in v5.19.0
func ParseWeaponRoFMode(s string) WeaponRoFMode
ParseWeaponRoFMode parses a string into a WeaponRoFMode.
func (WeaponRoFMode) Hash ¶ added in v5.24.0
func (wr WeaponRoFMode) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponRoFMode) Resolve ¶ added in v5.19.0
func (wr WeaponRoFMode) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer, firstMode bool) WeaponRoFMode
Resolve any bonuses that apply.
func (WeaponRoFMode) String ¶ added in v5.19.0
func (wr WeaponRoFMode) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponRoFMode) Tooltip ¶ added in v5.19.0
func (wr WeaponRoFMode) Tooltip() string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponRoFMode) Validate ¶ added in v5.19.0
func (wr *WeaponRoFMode) Validate()
Validate ensures that the data is valid.
type WeaponShots ¶ added in v5.19.0
type WeaponShots struct { Count fxp.Int InChamber fxp.Int Duration fxp.Int ReloadTime fxp.Int ReloadTimeIsPerShot bool Thrown bool }
WeaponShots holds the shots data for a weapon.
func ParseWeaponShots ¶ added in v5.19.0
func ParseWeaponShots(s string) WeaponShots
ParseWeaponShots parses a string into a WeaponShots.
func (WeaponShots) Hash ¶ added in v5.24.0
func (ws WeaponShots) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponShots) MarshalJSON ¶ added in v5.19.0
func (ws WeaponShots) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponShots) Resolve ¶ added in v5.19.0
func (ws WeaponShots) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponShots
Resolve any bonuses that apply.
func (WeaponShots) ShouldOmit ¶ added in v5.19.0
func (ws WeaponShots) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponShots) String ¶ added in v5.19.0
func (ws WeaponShots) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponShots) Tooltip ¶ added in v5.19.0
func (ws WeaponShots) Tooltip() string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponShots) UnmarshalJSON ¶ added in v5.19.0
func (ws *WeaponShots) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponShots) Validate ¶ added in v5.19.0
func (ws *WeaponShots) Validate()
Validate ensures that the data is valid.
type WeaponStrength ¶ added in v5.19.0
type WeaponStrength struct { Min fxp.Int Bipod bool Mounted bool MusketRest bool TwoHanded bool TwoHandedUnready bool }
WeaponStrength holds the minimum strength data for a weapon.
func ParseWeaponStrength ¶ added in v5.19.0
func ParseWeaponStrength(s string) WeaponStrength
ParseWeaponStrength parses a string into a WeaponStrength.
func (WeaponStrength) Hash ¶ added in v5.24.0
func (ws WeaponStrength) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (WeaponStrength) MarshalJSON ¶ added in v5.19.0
func (ws WeaponStrength) MarshalJSON() ([]byte, error)
MarshalJSON marshals the data to JSON.
func (WeaponStrength) Resolve ¶ added in v5.19.0
func (ws WeaponStrength) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) WeaponStrength
Resolve any bonuses that apply.
func (WeaponStrength) ShouldOmit ¶ added in v5.19.0
func (ws WeaponStrength) ShouldOmit() bool
ShouldOmit returns true if the data should be omitted from JSON output.
func (WeaponStrength) String ¶ added in v5.19.0
func (ws WeaponStrength) String() string
String returns a string suitable for presentation, matching the standard GURPS weapon table entry format for this data. Call .Resolve() prior to calling this method if you want the resolved values.
func (WeaponStrength) Tooltip ¶ added in v5.19.0
func (ws WeaponStrength) Tooltip(w *Weapon) string
Tooltip returns a tooltip for the data, if any. Call .Resolve() prior to calling this method if you want the tooltip to be based on the resolved values.
func (*WeaponStrength) UnmarshalJSON ¶ added in v5.19.0
func (ws *WeaponStrength) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the data from JSON.
func (*WeaponStrength) Validate ¶ added in v5.19.0
func (ws *WeaponStrength) Validate()
Validate ensures that the data is valid.
type WeightedAncestryOptions ¶ added in v5.9.0
type WeightedAncestryOptions struct { Weight int `json:"weight"` Value *AncestryOptions `json:"value"` }
WeightedAncestryOptions is a string that has a weight associated with it.
func (*WeightedAncestryOptions) Valid ¶ added in v5.9.0
func (o *WeightedAncestryOptions) Valid() bool
Valid returns true if this option has a valid weight.
type WeightedStringOption ¶ added in v5.9.0
WeightedStringOption is a string that has a weight associated with it.
func (*WeightedStringOption) Valid ¶ added in v5.9.0
func (o *WeightedStringOption) Valid() bool
Valid returns true if this option has a valid weight.
Source Files ¶
- ancestry.go
- ancestry_options.go
- attribute.go
- attribute_bonus.go
- attribute_choice.go
- attribute_def.go
- attribute_defs.go
- attribute_difficulty.go
- attribute_prereq.go
- attributes.go
- block_layout.go
- body.go
- bonus_owner.go
- calendar_ref.go
- campaign.go
- cell.go
- college_list.go
- conditional_modifier.go
- conditional_modifier_bonus.go
- contained_quantity_prereq.go
- contained_weight_prereq.go
- contained_weight_reduction.go
- convert.go
- cost_reduction.go
- document.go
- dr_bonus.go
- entity.go
- equipment.go
- equipment_modifier.go
- equipped_equipment_prereq.go
- eval.go
- export.go
- export_legacy.go
- feature.go
- features.go
- file_type.go
- general_settings.go
- hashable.go
- hit_location.go
- ids.go
- key_bindings.go
- level.go
- leveled_amount.go
- libraries.go
- library.go
- list_provider.go
- messages.go
- monitor.go
- name_generator.go
- natural_attacks.go
- node.go
- note.go
- page_references.go
- page_settings.go
- page_settings_overrides.go
- paths.go
- points_record.go
- pool_threshold.go
- prereq.go
- prereq_list.go
- prereqs.go
- profile.go
- reaction_bonus.go
- release.go
- scanner.go
- settings.go
- sheet_settings.go
- skill.go
- skill_bonus.go
- skill_default.go
- skill_point_bonus.go
- skill_prereq.go
- source.go
- spell.go
- spell_bonus.go
- spell_point_bonus.go
- spell_prereq.go
- spell_prereq_count.go
- study.go
- sync_sheets_and_templates.go
- tech_level.go
- template.go
- template_picker.go
- trait.go
- trait_modifier.go
- trait_prereq.go
- traverse.go
- txtutil.go
- weapon.go
- weapon_accuracy.go
- weapon_block.go
- weapon_bonus.go
- weapon_bulk.go
- weapon_damage.go
- weapon_leveled_amount.go
- weapon_parry.go
- weapon_range.go
- weapon_reach.go
- weapon_recoil.go
- weapon_rof.go
- weapon_rof_mode.go
- weapon_shots.go
- weapon_strength.go
- weighted_ancestry_options.go
- weighted_string_option.go