Documentation ¶
Index ¶
- Constants
- Variables
- func AcceptableExtensions() []string
- func AdjustTechLevel(str string, delta fxp.Int) (s string, changed bool)
- func AdjustedPoints(entity *Entity, canLevel bool, basePoints, levels, pointsPerLevel fxp.Int, ...) fxp.Int
- func AdjustedPointsForNonContainerSkillOrTechnique(entity *Entity, points fxp.Int, name, specialization string, tags []string, ...) fxp.Int
- func AdjustedPointsForNonContainerSpell(entity *Entity, points fxp.Int, name, powerSource string, ...) fxp.Int
- func Apply(str string, set map[string]string) string
- func AttributeChoices(entity *Entity, prefix string, flags AttributeFlags, currentKey string) (choices []*AttributeChoice, current *AttributeChoice)
- func AttributeIDFor(entity *Entity, preferred string) string
- func CheckVersion(version int) error
- func ChooseWeightedStringOption(options []*WeightedStringOption, not string) string
- func CloneNodes[T NodeTypes](newEntity *Entity, newParent T, preserveID bool, nodes []Node[T]) []T
- func CombineTags(tags []string) string
- func Convert(paths ...string) error
- func CountThresholdOpMet(op ThresholdOp, attributes *Attributes) int
- func CreateFullKeySet() map[string]bool
- func CreateImageFromSVG(fi *FileInfo, size int) (image.Image, error)
- func DefaultAttributeIDFor(entity *Entity) string
- func DefaultMasterLibraryPath() string
- func DefaultRootLibraryPath() string
- func DefaultTypeIsSkillBased(skillDefaultType string) bool
- func DefaultUserLibraryPath() string
- func Extract(str string, set map[string]string)
- func ExtractContainedWeightReduction(s string, defUnits WeightUnits) (string, error)
- func ExtractNumericCompareTypeIndex(str string) int
- func ExtractStringCompareTypeIndex(str string) int
- func ExtractTags(tags string) []string
- func ExtractTechLevel(str string) (techLevel fxp.Int, start, end int)
- func FormatRelativeSkill(entity *Entity, typ string, difficulty AttributeDifficulty, rsl fxp.Int) string
- func GCSExtensions() []string
- func GCSSecondaryExtensions() []string
- func HasTag(tag string, tags []string) bool
- func HasText(has bool) string
- func HitLocationChoices(entity *Entity, prefix, currentKey string) (choices []*HitLocationChoice, current *HitLocationChoice)
- func InstallEvaluatorFunctions(m map[string]eval.Function)
- func IsThresholdOpMet(op ThresholdOp, attributes *Attributes) bool
- func LegacyExport(entity *Entity, templatePath, exportPath string) (err error)
- func LegacyExportMultiple(tmplPath string, fileList []string) error
- func NewUUID() uuid.UUID
- func PrefixedNumericCompareTypeChoices(prefix string) []string
- func PrefixedStringCompareTypeChoices(prefix, notPrefix string) []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(study []*Study) fxp.Int
- 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 StudyHoursProgressText(hours fxp.Int) string
- func Traverse[T NodeTypes](f func(T) bool, onlyEnabled, excludeContainers bool, in ...T)
- func ValueAdjustedForModifiers(value fxp.Int, modifiers []*EquipmentModifier) fxp.Int
- type Affects
- 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 Length) 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 Weight) 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 Length) Length
- func (o *AncestryOptions) RandomName(nameGeneratorRefs []*NameGeneratorRef) string
- func (o *AncestryOptions) RandomSkin(not string) string
- func (o *AncestryOptions) RandomWeight(resolver eval.VariableResolver, not Weight) 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) 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) AddToTooltip(buffer *xio.ByteBuffer)
- func (a *AttributeBonus) ApplyNameableKeys(_ map[string]string)
- func (a *AttributeBonus) Clone() Feature
- func (a *AttributeBonus) FeatureType() FeatureType
- func (a *AttributeBonus) FillWithNameableKeys(_ map[string]string)
- func (a *AttributeBonus) Owner() fmt.Stringer
- func (a *AttributeBonus) SetLevel(level fxp.Int)
- func (a *AttributeBonus) SetOwner(owner fmt.Stringer)
- 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) 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) CRC64() uint64
- func (a *AttributeDefs) Clone() *AttributeDefs
- 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) 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 (a *AttributePrereq) ApplyNameableKeys(_ map[string]string)
- func (a *AttributePrereq) Clone(parent *PrereqList) Prereq
- func (a *AttributePrereq) FillWithNameableKeys(_ map[string]string)
- func (a *AttributePrereq) ParentList() *PrereqList
- func (a *AttributePrereq) PrereqType() PrereqType
- func (a *AttributePrereq) Satisfied(entity *Entity, _ any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type AttributeType
- type Attributes
- func (a *Attributes) CRC64() uint64
- 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) 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) CRC64() uint64
- func (b *Body) Clone(entity *Entity, owningLocation *HitLocation) *Body
- func (b *Body) LookupLocationByID(entity *Entity, idStr string) *HitLocation
- 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) Update(entity *Entity)
- type Bonus
- type BonusLimitation
- type CalendarRef
- type CellData
- type CellType
- type CollegeList
- type Colors
- type ConditionalModifier
- func (m *ConditionalModifier) Add(source string, amt fxp.Int)
- func (m *ConditionalModifier) ApplyNameableKeys(_ map[string]string)
- func (m *ConditionalModifier) CellData(columnID int, data *CellData)
- func (m *ConditionalModifier) Clone(_ *Entity, _ *ConditionalModifier, preserveID bool) *ConditionalModifier
- func (m *ConditionalModifier) Container() bool
- func (m *ConditionalModifier) Enabled() bool
- func (m *ConditionalModifier) FillWithNameableKeys(_ map[string]string)
- func (m *ConditionalModifier) HasChildren() bool
- func (m *ConditionalModifier) Kind() string
- func (m *ConditionalModifier) Less(other *ConditionalModifier) bool
- func (m *ConditionalModifier) NodeChildren() []*ConditionalModifier
- func (m *ConditionalModifier) Open() bool
- func (m *ConditionalModifier) OwningEntity() *Entity
- func (m *ConditionalModifier) Parent() *ConditionalModifier
- func (m *ConditionalModifier) SetChildren(_ []*ConditionalModifier)
- func (m *ConditionalModifier) SetOpen(_ bool)
- func (m *ConditionalModifier) SetOwningEntity(_ *Entity)
- func (m *ConditionalModifier) SetParent(_ *ConditionalModifier)
- func (m *ConditionalModifier) String() string
- func (m *ConditionalModifier) Total() fxp.Int
- func (m *ConditionalModifier) UUID() uuid.UUID
- type ConditionalModifierBonus
- func (c *ConditionalModifierBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (c *ConditionalModifierBonus) ApplyNameableKeys(m map[string]string)
- func (c *ConditionalModifierBonus) Clone() Feature
- func (c *ConditionalModifierBonus) FeatureType() FeatureType
- func (c *ConditionalModifierBonus) FillWithNameableKeys(m map[string]string)
- func (c *ConditionalModifierBonus) Owner() fmt.Stringer
- func (c *ConditionalModifierBonus) SetLevel(level fxp.Int)
- func (c *ConditionalModifierBonus) SetOwner(owner fmt.Stringer)
- type ConditionalModifierListProvider
- type ContainedQuantityPrereq
- func (c *ContainedQuantityPrereq) ApplyNameableKeys(_ map[string]string)
- func (c *ContainedQuantityPrereq) Clone(parent *PrereqList) Prereq
- func (c *ContainedQuantityPrereq) FillWithNameableKeys(_ map[string]string)
- func (c *ContainedQuantityPrereq) ParentList() *PrereqList
- func (c *ContainedQuantityPrereq) PrereqType() PrereqType
- func (c *ContainedQuantityPrereq) Satisfied(_ *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type ContainedWeightPrereq
- func (c *ContainedWeightPrereq) ApplyNameableKeys(_ map[string]string)
- func (c *ContainedWeightPrereq) Clone(parent *PrereqList) Prereq
- func (c *ContainedWeightPrereq) FillWithNameableKeys(_ map[string]string)
- func (c *ContainedWeightPrereq) ParentList() *PrereqList
- func (c *ContainedWeightPrereq) PrereqType() PrereqType
- func (c *ContainedWeightPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type ContainedWeightReduction
- func (c *ContainedWeightReduction) ApplyNameableKeys(_ map[string]string)
- func (c *ContainedWeightReduction) Clone() Feature
- func (c *ContainedWeightReduction) FeatureType() FeatureType
- func (c *ContainedWeightReduction) FillWithNameableKeys(_ map[string]string)
- func (c *ContainedWeightReduction) FixedReduction(defUnits WeightUnits) Weight
- func (c *ContainedWeightReduction) IsPercentageReduction() bool
- func (c *ContainedWeightReduction) PercentageReduction() fxp.Int
- type ContainerBase
- func (c *ContainerBase[T]) Container() bool
- func (c *ContainerBase[T]) GetType() string
- func (c *ContainerBase[T]) HasChildren() bool
- func (c *ContainerBase[T]) NodeChildren() []T
- func (c *ContainerBase[T]) Open() bool
- func (c *ContainerBase[T]) Parent() T
- func (c *ContainerBase[T]) SetChildren(children []T)
- func (c *ContainerBase[T]) SetOpen(open bool)
- func (c *ContainerBase[T]) SetParent(parent T)
- func (c *ContainerBase[T]) SetType(t string)
- func (c *ContainerBase[T]) UUID() uuid.UUID
- type ContainerType
- type CostReduction
- type DRBonus
- func (d *DRBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (d *DRBonus) ApplyNameableKeys(_ map[string]string)
- func (d *DRBonus) Clone() Feature
- func (d *DRBonus) FeatureType() FeatureType
- func (d *DRBonus) FillWithNameableKeys(_ map[string]string)
- func (d *DRBonus) MarshalJSON() ([]byte, error)
- func (d *DRBonus) Normalize()
- func (d *DRBonus) Owner() fmt.Stringer
- func (d *DRBonus) SetLevel(level fxp.Int)
- func (d *DRBonus) SetOwner(owner fmt.Stringer)
- func (d *DRBonus) UnmarshalJSON(data []byte) error
- type DRBonusData
- type DamageProgression
- func (enum DamageProgression) AltString() string
- func (enum DamageProgression) EnsureValid() DamageProgression
- func (enum DamageProgression) Key() string
- func (enum DamageProgression) MarshalText() (text []byte, err error)
- func (enum DamageProgression) String() string
- func (enum DamageProgression) Swing(strength int) *dice.Dice
- func (enum DamageProgression) Thrust(strength int) *dice.Dice
- func (enum *DamageProgression) UnmarshalText(text []byte) error
- type Difficulty
- type DisplayOption
- func (enum DisplayOption) EnsureValid() DisplayOption
- func (enum DisplayOption) Inline() bool
- func (enum DisplayOption) Key() string
- func (enum DisplayOption) MarshalText() (text []byte, err error)
- func (enum DisplayOption) String() string
- func (enum DisplayOption) Tooltip() bool
- func (enum *DisplayOption) UnmarshalText(text []byte) error
- type DockableGroup
- type EditorData
- type Encumbrance
- func (enum Encumbrance) EnsureValid() Encumbrance
- func (enum Encumbrance) Key() string
- func (enum Encumbrance) MarshalText() (text []byte, err error)
- func (enum Encumbrance) Penalty() fxp.Int
- func (enum Encumbrance) String() string
- func (enum *Encumbrance) UnmarshalText(text []byte) error
- func (enum Encumbrance) WeightMultiplier() fxp.Int
- 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 string, tags []string, dieCount int, levels fxp.Int, ...) map[*WeaponBonus]bool
- func (e *Entity) Ancestry() *Ancestry
- func (e *Entity) AttributeBonusFor(attributeID string, limitation BonusLimitation, tooltip *xio.ByteBuffer) fxp.Int
- func (e *Entity) BaseSkill(def *SkillDefault, requirePoints bool) *Skill
- func (e *Entity) BasicLift() Weight
- func (e *Entity) BasicLiftForST(st fxp.Int) Weight
- func (e *Entity) BestSkillNamed(name, specialization string, requirePoints bool, excludes map[string]bool) *Skill
- func (e *Entity) CRC64() uint64
- func (e *Entity) CarriedEquipmentList() []*Equipment
- func (e *Entity) CarryOnBack() Weight
- func (e *Entity) ConditionalModifiers() []*ConditionalModifier
- func (e *Entity) CostReductionFor(attributeID string) fxp.Int
- func (e *Entity) DiscardCaches()
- func (e *Entity) Dodge(enc Encumbrance) int
- func (e *Entity) EncumbranceLevel(forSkills bool) Encumbrance
- func (e *Entity) Entity() *Entity
- func (e *Entity) EquippedWeapons(weaponType WeaponType) []*Weapon
- func (e *Entity) LiftingStrength() fxp.Int
- func (e *Entity) MarshalJSON() ([]byte, error)
- func (e *Entity) MaximumCarry(encumbrance Encumbrance) Weight
- func (e *Entity) Move(enc Encumbrance) int
- func (e *Entity) NamedWeaponSkillBonusesFor(name, usage string, tags []string, tooltip *xio.ByteBuffer) []*SkillBonus
- func (e *Entity) NoteList() []*Note
- func (e *Entity) OneHandedLift() Weight
- func (e *Entity) OtherEquipmentList() []*Equipment
- 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() 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(_ WeaponType, _ []*Weapon)
- func (e *Entity) ShiftSlightly() Weight
- func (e *Entity) ShoveAndKnockOver() 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) 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) 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() 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(weaponType WeaponType) []*Weapon
- func (e *Entity) WeightCarried(forSkills bool) Weight
- type EntityData
- type EntityProvider
- type EntityType
- type Equipment
- func (e *Equipment) ActiveModifierFor(name string) *EquipmentModifier
- func (e *Equipment) AdjustedValue() fxp.Int
- func (e *Equipment) AdjustedWeight(forSkills bool, defUnits WeightUnits) Weight
- func (e *Equipment) ApplyNameableKeys(m map[string]string)
- func (e *Equipment) CellData(columnID int, data *CellData)
- func (e *Equipment) Clone(entity *Entity, parent *Equipment, preserveID bool) *Equipment
- 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 WeightUnits) Weight
- func (e *Equipment) FeatureList() Features
- func (e *Equipment) FillWithNameableKeys(m map[string]string)
- func (e *Equipment) MarshalJSON() ([]byte, error)
- func (e *Equipment) ModifierNotes() string
- func (e *Equipment) Notes() string
- func (e *Equipment) OwningEntity() *Entity
- func (e *Equipment) RequiresTL() bool
- func (e *Equipment) SecondaryText(optionChecker func(DisplayOption) bool) string
- func (e *Equipment) SetOwningEntity(entity *Entity)
- func (e *Equipment) SetTL(tl string)
- func (e *Equipment) String() string
- 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 (m *EquipmentModifier) ApplyNameableKeys(keyMap map[string]string)
- func (m *EquipmentModifier) CellData(columnID int, data *CellData)
- func (m *EquipmentModifier) Clone(entity *Entity, parent *EquipmentModifier, preserveID bool) *EquipmentModifier
- func (m *EquipmentModifier) CostDescription() string
- func (m *EquipmentModifier) Depth() int
- func (m *EquipmentModifier) Enabled() bool
- func (m *EquipmentModifier) FillWithNameableKeys(keyMap map[string]string)
- func (m *EquipmentModifier) FullCostDescription() string
- func (m *EquipmentModifier) FullDescription() string
- func (m *EquipmentModifier) MarshalJSON() ([]byte, error)
- func (m *EquipmentModifier) OwningEntity() *Entity
- func (m *EquipmentModifier) SecondaryText(optionChecker func(DisplayOption) bool) string
- func (m *EquipmentModifier) SetEnabled(enabled bool)
- func (m *EquipmentModifier) SetOwningEntity(entity *Entity)
- func (m *EquipmentModifier) String() string
- func (m *EquipmentModifier) TagList() []string
- func (m *EquipmentModifier) UnmarshalJSON(data []byte) error
- func (m *EquipmentModifier) WeightDescription() string
- type EquipmentModifierCostType
- func (enum EquipmentModifierCostType) AltString() string
- func (enum EquipmentModifierCostType) EnsureValid() EquipmentModifierCostType
- func (enum EquipmentModifierCostType) ExtractValue(s string) fxp.Int
- func (enum EquipmentModifierCostType) Format(s string) string
- func (enum EquipmentModifierCostType) FromString(s string) EquipmentModifierCostValueType
- func (enum EquipmentModifierCostType) Key() string
- func (enum EquipmentModifierCostType) MarshalText() (text []byte, err error)
- func (enum EquipmentModifierCostType) Permitted() []EquipmentModifierCostValueType
- func (enum EquipmentModifierCostType) String() string
- func (enum EquipmentModifierCostType) StringWithExample() string
- func (enum *EquipmentModifierCostType) UnmarshalText(text []byte) error
- type EquipmentModifierCostValueType
- func (enum EquipmentModifierCostValueType) EnsureValid() EquipmentModifierCostValueType
- func (enum EquipmentModifierCostValueType) ExtractValue(s string) fxp.Int
- func (enum EquipmentModifierCostValueType) Format(value fxp.Int) string
- func (enum EquipmentModifierCostValueType) FromString(s string) EquipmentModifierCostValueType
- func (enum EquipmentModifierCostValueType) Key() string
- func (enum EquipmentModifierCostValueType) MarshalText() (text []byte, err error)
- func (enum EquipmentModifierCostValueType) String() string
- func (enum *EquipmentModifierCostValueType) UnmarshalText(text []byte) error
- type EquipmentModifierData
- type EquipmentModifierEditData
- type EquipmentModifierListProvider
- type EquipmentModifierWeightType
- func (enum EquipmentModifierWeightType) AltString() string
- func (enum EquipmentModifierWeightType) DetermineModifierWeightValueTypeFromString(s string) EquipmentModifierWeightValueType
- func (enum EquipmentModifierWeightType) EnsureValid() EquipmentModifierWeightType
- func (enum EquipmentModifierWeightType) ExtractFraction(s string) fxp.Fraction
- func (enum EquipmentModifierWeightType) Format(s string, defUnits WeightUnits) string
- func (enum EquipmentModifierWeightType) Key() string
- func (enum EquipmentModifierWeightType) MarshalText() (text []byte, err error)
- func (enum EquipmentModifierWeightType) Permitted() []EquipmentModifierWeightValueType
- func (enum EquipmentModifierWeightType) String() string
- func (enum EquipmentModifierWeightType) StringWithExample() string
- func (enum *EquipmentModifierWeightType) UnmarshalText(text []byte) error
- type EquipmentModifierWeightValueType
- func (enum EquipmentModifierWeightValueType) EnsureValid() EquipmentModifierWeightValueType
- func (enum EquipmentModifierWeightValueType) ExtractFraction(s string) fxp.Fraction
- func (enum EquipmentModifierWeightValueType) Format(fraction fxp.Fraction) string
- func (enum EquipmentModifierWeightValueType) FromString(s string) EquipmentModifierWeightValueType
- func (enum EquipmentModifierWeightValueType) Key() string
- func (enum EquipmentModifierWeightValueType) MarshalText() (text []byte, err error)
- func (enum EquipmentModifierWeightValueType) String() string
- func (enum *EquipmentModifierWeightValueType) UnmarshalText(text []byte) error
- type EquippedEquipmentPrereq
- func (e *EquippedEquipmentPrereq) ApplyNameableKeys(m map[string]string)
- func (e *EquippedEquipmentPrereq) Clone(parent *PrereqList) Prereq
- func (e *EquippedEquipmentPrereq) FillWithNameableKeys(m map[string]string)
- func (e *EquippedEquipmentPrereq) ParentList() *PrereqList
- func (e *EquippedEquipmentPrereq) PrereqType() PrereqType
- func (e *EquippedEquipmentPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, ...) bool
- type ExportInfo
- type Feature
- type FeatureType
- type Features
- type FileInfo
- type Fonts
- type GeneralModifier
- type GeneralSettings
- 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) 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 HitLocationChoice
- type HitLocationData
- 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 Length
- type LengthUnits
- func (enum LengthUnits) EnsureValid() LengthUnits
- func (enum LengthUnits) Format(length Length) string
- func (enum LengthUnits) Key() string
- func (enum LengthUnits) MarshalText() (text []byte, err error)
- func (enum LengthUnits) String() string
- func (enum LengthUnits) ToInches(length fxp.Int) fxp.Int
- func (enum *LengthUnits) UnmarshalText(text []byte) error
- type Level
- func CalculateRitualMagicSpellLevel(entity *Entity, name, powerSource, ritualSkillName string, ...) Level
- func CalculateSkillLevel(entity *Entity, name, specialization string, tags []string, def *SkillDefault, ...) Level
- func CalculateSpellLevel(entity *Entity, name, powerSource string, colleges, tags []string, ...) Level
- func CalculateTechniqueLevel(entity *Entity, name, specialization string, tags []string, def *SkillDefault, ...) Level
- type LeveledAmount
- type Libraries
- type Library
- func (l *Library) AvailableUpdate() *Release
- func (l *Library) CheckForAvailableUpgrade(ctx context.Context, client *http.Client)
- 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) Less(other *Library) bool
- 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 ListProvider
- type MonitorToken
- type NameData
- type NameGenerationType
- type NameGenerator
- type NameGeneratorRef
- type Nameables
- type NamedFileRef
- type NamedFileSet
- type NavigatorSettings
- type Node
- type NodeTypes
- type Note
- func (n *Note) ApplyNameableKeys(m map[string]string)
- func (n *Note) CellData(columnID int, data *CellData)
- func (n *Note) Clone(entity *Entity, parent *Note, preserveID bool) *Note
- func (n *Note) Depth() int
- func (n *Note) Enabled() bool
- func (n *Note) FillWithNameableKeys(m map[string]string)
- func (n *Note) MarshalJSON() ([]byte, error)
- func (n *Note) OwningEntity() *Entity
- func (n *Note) SetOwningEntity(entity *Entity)
- func (n *Note) String() string
- func (n *Note) UnmarshalJSON(data []byte) error
- type NoteData
- type NoteEditData
- type NoteListProvider
- type NumericCompareType
- func (n NumericCompareType) AltDescribe(qualifier fxp.Int) string
- func (n NumericCompareType) AltString() string
- func (n NumericCompareType) Describe(qualifier fxp.Int) string
- func (n NumericCompareType) EnsureValid() NumericCompareType
- func (n NumericCompareType) Matches(qualifier, data fxp.Int) bool
- func (n NumericCompareType) String() string
- type NumericCriteria
- type NumericCriteriaData
- 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 PaperLength
- type PaperOrientation
- func (enum PaperOrientation) Dimensions(width, height PaperLength) (adjustedWidth, adjustedHeight PaperLength)
- func (enum PaperOrientation) EnsureValid() PaperOrientation
- func (enum PaperOrientation) Key() string
- func (enum PaperOrientation) MarshalText() (text []byte, err error)
- func (enum PaperOrientation) String() string
- func (enum *PaperOrientation) UnmarshalText(text []byte) error
- type PaperSize
- type PaperUnits
- type PointsBreakdown
- type PointsRecord
- type PoolThreshold
- func (p *PoolThreshold) AddOp(op ThresholdOp)
- func (p *PoolThreshold) Clone() *PoolThreshold
- func (p *PoolThreshold) ContainsOp(op ThresholdOp) bool
- func (p *PoolThreshold) MarshalJSON() ([]byte, error)
- func (p *PoolThreshold) RemoveOp(op ThresholdOp)
- 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) ApplyNameableKeys(m map[string]string)
- 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 map[string]string)
- func (p *PrereqList) ParentList() *PrereqList
- func (p *PrereqList) PrereqType() PrereqType
- func (p *PrereqList) Satisfied(entity *Entity, exclude any, buffer *xio.ByteBuffer, prefix string, ...) bool
- func (p *PrereqList) ShouldOmit() bool
- type PrereqType
- type Prereqs
- type Profile
- type QuickExports
- type QuickExportsData
- type RawPointsAdjuster
- type ReactionBonus
- func (r *ReactionBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (r *ReactionBonus) ApplyNameableKeys(m map[string]string)
- func (r *ReactionBonus) Clone() Feature
- func (r *ReactionBonus) FeatureType() FeatureType
- func (r *ReactionBonus) FillWithNameableKeys(m map[string]string)
- func (r *ReactionBonus) Owner() fmt.Stringer
- func (r *ReactionBonus) SetLevel(level fxp.Int)
- func (r *ReactionBonus) SetOwner(owner fmt.Stringer)
- type ReactionModifierListProvider
- type Release
- type SelfControlRoll
- type SelfControlRollAdj
- func (enum SelfControlRollAdj) Adjustment(cr SelfControlRoll) int
- func (enum SelfControlRollAdj) AltString() string
- func (enum SelfControlRollAdj) Description(cr SelfControlRoll) string
- func (enum SelfControlRollAdj) EnsureValid() SelfControlRollAdj
- func (enum SelfControlRollAdj) Features(cr SelfControlRoll) Features
- func (enum SelfControlRollAdj) Key() string
- func (enum SelfControlRollAdj) MarshalText() (text []byte, err error)
- func (enum SelfControlRollAdj) String() string
- func (enum *SelfControlRollAdj) UnmarshalText(text []byte) error
- 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) BestSwappableSkill() *Skill
- func (s *Skill) CalculateLevel() Level
- func (s *Skill) CanSwapDefaults() bool
- func (s *Skill) CanSwapDefaultsWith(other *Skill) bool
- func (s *Skill) CellData(columnID int, data *CellData)
- func (s *Skill) Clone(entity *Entity, parent *Skill, preserveID bool) *Skill
- 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 map[string]string)
- func (s *Skill) HasDefaultTo(other *Skill) bool
- func (s *Skill) IncrementSkillLevel()
- func (s *Skill) MarshalJSON() ([]byte, error)
- func (s *Skill) ModifierNotes() string
- func (s *Skill) Notes() string
- func (s *Skill) OwningEntity() *Entity
- func (s *Skill) RawPoints() fxp.Int
- func (s *Skill) RelativeLevel() string
- func (s *Skill) RequiresTL() bool
- func (s *Skill) SecondaryText(optionChecker func(DisplayOption) bool) string
- func (s *Skill) SetOwningEntity(entity *Entity)
- func (s *Skill) SetRawPoints(points fxp.Int) bool
- func (s *Skill) SetTL(tl string)
- func (s *Skill) String() string
- func (s *Skill) SwapDefaults()
- 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
- func (s *SkillBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (s *SkillBonus) ApplyNameableKeys(m map[string]string)
- func (s *SkillBonus) Clone() Feature
- func (s *SkillBonus) FeatureType() FeatureType
- func (s *SkillBonus) FillWithNameableKeys(m map[string]string)
- func (s *SkillBonus) Owner() fmt.Stringer
- func (s *SkillBonus) SetLevel(level fxp.Int)
- func (s *SkillBonus) SetOwner(owner fmt.Stringer)
- type SkillData
- type SkillDefault
- func (s *SkillDefault) ApplyNameableKeys(m map[string]string)
- func (s *SkillDefault) CloneWithoutLevelOrPoints() *SkillDefault
- func (s *SkillDefault) Equivalent(other *SkillDefault) bool
- func (s *SkillDefault) FillWithNameableKeys(m map[string]string)
- func (s *SkillDefault) FullName(entity *Entity) string
- func (s *SkillDefault) ModifierAsString() string
- func (s *SkillDefault) SetType(t string)
- func (s *SkillDefault) SkillBased() bool
- func (s *SkillDefault) SkillLevel(entity *Entity, requirePoints bool, excludes map[string]bool, ruleOf20 bool) fxp.Int
- func (s *SkillDefault) SkillLevelFast(entity *Entity, requirePoints bool, excludes map[string]bool, ruleOf20 bool) fxp.Int
- func (s *SkillDefault) Type() string
- type SkillEditData
- type SkillListProvider
- type SkillPointBonus
- func (s *SkillPointBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (s *SkillPointBonus) ApplyNameableKeys(m map[string]string)
- func (s *SkillPointBonus) Clone() Feature
- func (s *SkillPointBonus) FeatureType() FeatureType
- func (s *SkillPointBonus) FillWithNameableKeys(m map[string]string)
- func (s *SkillPointBonus) Owner() fmt.Stringer
- func (s *SkillPointBonus) SetLevel(level fxp.Int)
- func (s *SkillPointBonus) SetOwner(owner fmt.Stringer)
- type SkillPrereq
- func (s *SkillPrereq) ApplyNameableKeys(m map[string]string)
- func (s *SkillPrereq) Clone(parent *PrereqList) Prereq
- func (s *SkillPrereq) FillWithNameableKeys(m map[string]string)
- func (s *SkillPrereq) ParentList() *PrereqList
- func (s *SkillPrereq) PrereqType() PrereqType
- func (s *SkillPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type SkillSelectionType
- 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) CellData(columnID int, data *CellData)
- func (s *Spell) Clone(entity *Entity, parent *Spell, preserveID bool) *Spell
- func (s *Spell) DecrementSkillLevel()
- func (s *Spell) Depth() int
- func (s *Spell) Description() string
- func (s *Spell) Enabled() bool
- func (s *Spell) FeatureList() Features
- func (s *Spell) FillWithNameableKeys(m map[string]string)
- func (s *Spell) IncrementSkillLevel()
- func (s *Spell) MarshalJSON() ([]byte, error)
- func (s *Spell) Notes() string
- func (s *Spell) OwningEntity() *Entity
- func (s *Spell) RawPoints() fxp.Int
- func (s *Spell) RelativeLevel() string
- func (s *Spell) RequiresTL() bool
- func (s *Spell) RitualMagicSatisfied(tooltip *xio.ByteBuffer, prefix string) bool
- func (s *Spell) Rituals() string
- func (s *Spell) SecondaryText(optionChecker func(DisplayOption) bool) string
- func (s *Spell) SetOwningEntity(entity *Entity)
- func (s *Spell) SetRawPoints(points fxp.Int) bool
- func (s *Spell) SetTL(tl string)
- func (s *Spell) String() string
- 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) ApplyNameableKeys(m map[string]string)
- func (s *SpellBonus) Clone() Feature
- func (s *SpellBonus) FeatureType() FeatureType
- func (s *SpellBonus) FillWithNameableKeys(m map[string]string)
- func (s *SpellBonus) MatchForType(name, powerSource string, colleges []string) bool
- func (s *SpellBonus) Owner() fmt.Stringer
- func (s *SpellBonus) SetLevel(level fxp.Int)
- func (s *SpellBonus) SetOwner(owner fmt.Stringer)
- type SpellComparisonType
- func (enum SpellComparisonType) EnsureValid() SpellComparisonType
- func (enum SpellComparisonType) Key() string
- func (enum SpellComparisonType) MarshalText() (text []byte, err error)
- func (enum SpellComparisonType) String() string
- func (enum *SpellComparisonType) UnmarshalText(text []byte) error
- func (enum SpellComparisonType) UsesStringCriteria() bool
- type SpellData
- type SpellEditData
- type SpellListProvider
- type SpellMatchType
- func (enum SpellMatchType) EnsureValid() SpellMatchType
- func (enum SpellMatchType) Key() string
- func (enum SpellMatchType) MarshalText() (text []byte, err error)
- func (enum SpellMatchType) MatchForType(matcher StringCriteria, name, powerSource string, colleges []string) bool
- func (enum SpellMatchType) String() string
- func (enum *SpellMatchType) UnmarshalText(text []byte) error
- type SpellPointBonus
- func (s *SpellPointBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (s *SpellPointBonus) ApplyNameableKeys(m map[string]string)
- func (s *SpellPointBonus) Clone() Feature
- func (s *SpellPointBonus) FeatureType() FeatureType
- func (s *SpellPointBonus) FillWithNameableKeys(m map[string]string)
- func (s *SpellPointBonus) MatchForType(name, powerSource string, colleges []string) bool
- func (s *SpellPointBonus) Owner() fmt.Stringer
- func (s *SpellPointBonus) SetLevel(level fxp.Int)
- func (s *SpellPointBonus) SetOwner(owner fmt.Stringer)
- type SpellPrereq
- func (s *SpellPrereq) ApplyNameableKeys(m map[string]string)
- func (s *SpellPrereq) Clone(parent *PrereqList) Prereq
- func (s *SpellPrereq) FillWithNameableKeys(m map[string]string)
- func (s *SpellPrereq) ParentList() *PrereqList
- func (s *SpellPrereq) PrereqType() PrereqType
- func (s *SpellPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type StrengthDamage
- type StringCompareType
- type StringCriteria
- type StringCriteriaData
- type Study
- type StudyType
- func (enum StudyType) EnsureValid() StudyType
- func (enum StudyType) Key() string
- func (enum StudyType) Limitations() []string
- func (enum StudyType) MarshalText() (text []byte, err error)
- func (enum StudyType) Multiplier() fxp.Int
- func (enum StudyType) String() string
- func (enum *StudyType) UnmarshalText(text []byte) error
- type TechLevelProvider
- type Template
- func (t *Template) CRC64() uint64
- func (t *Template) CarriedEquipmentList() []*Equipment
- func (t *Template) Entity() *Entity
- func (t *Template) NoteList() []*Note
- func (t *Template) OtherEquipmentList() []*Equipment
- 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) SpellList() []*Spell
- func (t *Template) TraitList() []*Trait
- type TemplatePicker
- type TemplatePickerProvider
- type TemplatePickerType
- type ThemedColor
- type ThemedFont
- type ThresholdOp
- type TrainingData
- type Trait
- func (a *Trait) ActiveModifierFor(name string) *TraitModifier
- func (a *Trait) AdjustedPoints() fxp.Int
- func (a *Trait) AllModifiers() []*TraitModifier
- func (a *Trait) ApplyNameableKeys(m map[string]string)
- func (a *Trait) CellData(columnID int, data *CellData)
- func (a *Trait) Clone(entity *Entity, parent *Trait, preserveID bool) *Trait
- func (a *Trait) Depth() int
- func (a *Trait) Description() string
- func (a *Trait) EffectivelyDisabled() bool
- func (a *Trait) Enabled() bool
- func (a *Trait) FeatureList() Features
- func (a *Trait) FillWithNameableKeys(m map[string]string)
- func (a *Trait) IsLeveled() bool
- func (a *Trait) MarshalJSON() ([]byte, error)
- func (a *Trait) ModifierNotes() string
- func (a *Trait) Notes() string
- func (a *Trait) OwningEntity() *Entity
- func (a *Trait) SecondaryText(optionChecker func(DisplayOption) bool) string
- func (a *Trait) SetOwningEntity(entity *Entity)
- func (a *Trait) String() string
- func (a *Trait) TagList() []string
- func (a *Trait) TemplatePickerData() *TemplatePicker
- func (a *Trait) UnmarshalJSON(data []byte) error
- type TraitData
- type TraitEditData
- type TraitListProvider
- type TraitModifier
- func (m *TraitModifier) ApplyNameableKeys(keyMap map[string]string)
- func (m *TraitModifier) CellData(columnID int, data *CellData)
- func (m *TraitModifier) Clone(entity *Entity, parent *TraitModifier, preserveID bool) *TraitModifier
- func (m *TraitModifier) CostDescription() string
- func (m *TraitModifier) CostModifier() fxp.Int
- func (m *TraitModifier) Depth() int
- func (m *TraitModifier) Enabled() bool
- func (m *TraitModifier) FillWithNameableKeys(keyMap map[string]string)
- func (m *TraitModifier) FullCostDescription() string
- func (m *TraitModifier) FullDescription() string
- func (m *TraitModifier) HasLevels() bool
- func (m *TraitModifier) MarshalJSON() ([]byte, error)
- func (m *TraitModifier) OwningEntity() *Entity
- func (m *TraitModifier) SecondaryText(optionChecker func(DisplayOption) bool) string
- func (m *TraitModifier) SetEnabled(enabled bool)
- func (m *TraitModifier) SetOwningEntity(entity *Entity)
- func (m *TraitModifier) String() string
- func (m *TraitModifier) TagList() []string
- func (m *TraitModifier) UnmarshalJSON(data []byte) error
- type TraitModifierCostType
- func (enum TraitModifierCostType) EnsureValid() TraitModifierCostType
- func (enum TraitModifierCostType) Key() string
- func (enum TraitModifierCostType) MarshalText() (text []byte, err error)
- func (enum TraitModifierCostType) String() string
- func (enum *TraitModifierCostType) UnmarshalText(text []byte) error
- type TraitModifierData
- type TraitModifierEditData
- type TraitModifierListProvider
- type TraitPrereq
- func (a *TraitPrereq) ApplyNameableKeys(m map[string]string)
- func (a *TraitPrereq) Clone(parent *PrereqList) Prereq
- func (a *TraitPrereq) FillWithNameableKeys(m map[string]string)
- func (a *TraitPrereq) ParentList() *PrereqList
- func (a *TraitPrereq) PrereqType() PrereqType
- func (a *TraitPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
- type Weapon
- func (w *Weapon) ApplyNameableKeys(m map[string]string)
- func (w *Weapon) ApplyTo(t *Weapon)
- func (w *Weapon) CellData(columnID int, data *CellData)
- func (w *Weapon) Clone(_ *Entity, _ *Weapon, preserveID bool) *Weapon
- func (w *Weapon) Container() bool
- func (w *Weapon) CopyFrom(t *Weapon)
- func (w *Weapon) Enabled() bool
- func (w *Weapon) EncumbrancePenalty(entity *Entity, tooltip *xio.ByteBuffer) fxp.Int
- func (w *Weapon) Entity() *Entity
- func (w *Weapon) FillWithNameableKeys(m map[string]string)
- func (w *Weapon) HasChildren() bool
- func (w *Weapon) HashCode() uint32
- func (w *Weapon) Kind() string
- func (w *Weapon) Less(other *Weapon) bool
- func (w *Weapon) MarshalJSON() ([]byte, error)
- func (w *Weapon) NodeChildren() []*Weapon
- func (w *Weapon) Notes() string
- func (w *Weapon) Open() bool
- func (w *Weapon) OwningEntity() *Entity
- func (w *Weapon) PC() *Entity
- func (w *Weapon) Parent() *Weapon
- func (w *Weapon) ResolvedBlock(tooltip *xio.ByteBuffer) string
- func (w *Weapon) ResolvedMinimumStrength() fxp.Int
- func (w *Weapon) ResolvedParry(tooltip *xio.ByteBuffer) string
- func (w *Weapon) ResolvedRange() string
- func (w *Weapon) SetChildren(_ []*Weapon)
- func (w *Weapon) SetOpen(_ bool)
- func (w *Weapon) SetOwner(owner WeaponOwner)
- func (w *Weapon) SetOwningEntity(_ *Entity)
- func (w *Weapon) SetParent(_ *Weapon)
- func (w *Weapon) SkillLevel(tooltip *xio.ByteBuffer) fxp.Int
- func (w *Weapon) String() string
- func (w *Weapon) UUID() uuid.UUID
- func (w *Weapon) UnmarshalJSON(data []byte) error
- type WeaponBonus
- func (w *WeaponBonus) AddToTooltip(buffer *xio.ByteBuffer)
- func (w *WeaponBonus) ApplyNameableKeys(m map[string]string)
- func (w *WeaponBonus) Clone() Feature
- func (w *WeaponBonus) FeatureType() FeatureType
- func (w *WeaponBonus) FillWithNameableKeys(m map[string]string)
- func (w *WeaponBonus) Owner() fmt.Stringer
- func (w *WeaponBonus) SetLevel(level fxp.Int)
- func (w *WeaponBonus) SetOwner(owner fmt.Stringer)
- type WeaponDamage
- func (w *WeaponDamage) Clone(owner *Weapon) *WeaponDamage
- func (w *WeaponDamage) DamageTooltip() string
- 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 WeaponListProvider
- type WeaponOwner
- type WeaponSelectionType
- type WeaponType
- func (enum WeaponType) AltString() string
- func (enum WeaponType) EnsureValid() WeaponType
- func (enum WeaponType) Key() string
- func (enum WeaponType) MarshalText() (text []byte, err error)
- func (enum WeaponType) SVG() *unison.SVG
- func (enum WeaponType) String() string
- func (enum *WeaponType) UnmarshalText(text []byte) error
- type Weight
- func ExtendedWeightAdjustedForModifiers(defUnits WeightUnits, qty fxp.Int, baseWeight Weight, ...) Weight
- func WeightAdjustedForModifiers(weight Weight, modifiers []*EquipmentModifier, defUnits WeightUnits) Weight
- func WeightFromInteger[T constraints.Integer](value T, unit WeightUnits) Weight
- func WeightFromString(text string, defaultUnits WeightUnits) (Weight, error)
- func WeightFromStringForced(text string, defaultUnits WeightUnits) Weight
- type WeightCriteria
- type WeightCriteriaData
- type WeightUnits
- func (enum WeightUnits) EnsureValid() WeightUnits
- func (enum WeightUnits) Format(weight Weight) string
- func (enum WeightUnits) Key() string
- func (enum WeightUnits) MarshalText() (text []byte, err error)
- func (enum WeightUnits) String() string
- func (enum WeightUnits) ToPounds(weight fxp.Int) fxp.Int
- func (enum *WeightUnits) UnmarshalText(text []byte) error
- 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 ( ConditionalModifierValueColumn = iota ConditionalModifierDescriptionColumn )
Columns that can be used with the conditional modifier method .CellData()
const ( EquipmentEquippedColumn = iota EquipmentQuantityColumn EquipmentDescriptionColumn EquipmentUsesColumn EquipmentMaxUsesColumn EquipmentTLColumn EquipmentLCColumn EquipmentCostColumn EquipmentExtendedCostColumn EquipmentWeightColumn EquipmentExtendedWeightColumn EquipmentTagsColumn EquipmentReferenceColumn )
Columns that can be used with the equipment method .CellData()
const ( EquipmentModifierEnabledColumn = iota EquipmentModifierDescriptionColumn EquipmentModifierTechLevelColumn EquipmentModifierCostColumn EquipmentModifierWeightColumn EquipmentModifierTagsColumn EquipmentModifierReferenceColumn )
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 ( 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" )
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 = 133 AutoColWidthMin = 50 AutoColWidthMax = 9999 MaximumAutoColWidthDef = 800 )
Default, min & max 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" )
Various commonly used IDs
const ( NoteTextColumn = iota NoteReferenceColumn )
Columns that can be used with the note method .CellData()
const ( AnyNumber = NumericCompareType("") EqualsNumber = NumericCompareType("is") NotEqualsNumber = NumericCompareType("is_not") AtLeastNumber = NumericCompareType("at_least") AtMostNumber = NumericCompareType("at_most") )
Possible NumericCompareType values.
const ( PortraitHeight = 96 PortraitWidth = 3 * PortraitHeight / 4 )
Standard height and width for the portrait
const ( NoCR = SelfControlRoll(0) CR6 = SelfControlRoll(6) CR9 = SelfControlRoll(9) CR12 = SelfControlRoll(12) CR15 = SelfControlRoll(15) )
Possible SelfControlRoll values.
const ( DefaultLastDirKey = "default" ImagesLastDirKey = "images" SettingsLastDirKey = "settings" )
Last directory keys
const ( SkillDescriptionColumn = iota SkillDifficultyColumn SkillTagsColumn SkillReferenceColumn SkillLevelColumn SkillRelativeLevelColumn SkillPointsColumn )
Columns that can be used with the skill method .CellData()
const ( SpellDescriptionColumn = iota SpellResistColumn SpellClassColumn SpellCollegeColumn SpellCastCostColumn SpellMaintainCostColumn SpellCastTimeColumn SpellDurationColumn SpellDifficultyColumn SpellTagsColumn SpellReferenceColumn SpellLevelColumn SpellRelativeLevelColumn SpellPointsColumn SpellDescriptionForPageColumn )
Columns that can be used with the spell method .CellData()
const ( AnyString = StringCompareType("") IsString = StringCompareType("is") IsNotString = StringCompareType("is_not") ContainsString = StringCompareType("contains") DoesNotContainString = StringCompareType("does_not_contain") StartsWithString = StringCompareType("starts_with") DoesNotStartWithString = StringCompareType("does_not_start_with") EndsWithString = StringCompareType("ends_with") DoesNotEndWithString = StringCompareType("does_not_end_with") )
Possible StringCompareType values.
const ( TraitDescriptionColumn = iota TraitPointsColumn TraitTagsColumn TraitReferenceColumn )
Columns that can be used with the trait method .CellData()
const ( TraitModifierEnabledColumn = iota TraitModifierDescriptionColumn TraitModifierCostColumn TraitModifierTagsColumn TraitModifierReferenceColumn )
Columns that can be used with the trait modifier method .CellData()
const ( // CurrentDataVersion holds the current version for data files written with the current release. Note that this is // intentionally the same for all data files that GCS processes. CurrentDataVersion = 4 // First version for the Go version of GCS // MinimumDataVersion holds the oldest version for data files that can be loaded. Note that this is intentionally // the same for all data files that GCS processes. MinimumDataVersion = 2 MinimumLibraryVersion = 3 // Note that as of the Go version of GCS, the data and library version are the same. )
These version numbers are used both as the version of the data files written to disk as well as the major version number for GCS library compatibility checking. The Go release of GCS is the first release to synchronize the data version and the library major version.
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 ContainerKeyPostfix = "_container"
ContainerKeyPostfix is the key postfix used to identify containers.
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 ( HeaderColor = &unison.ThemeColor{Light: unison.RGB(43, 43, 43), Dark: unison.RGB(64, 64, 64)} HintColor = &unison.ThemeColor{Light: unison.Grey, Dark: unison.RGB(64, 64, 64)} MarkerColor = &unison.ThemeColor{Light: unison.RGB(252, 242, 196), Dark: unison.RGB(0, 51, 0)} OnHeaderColor = &unison.ThemeColor{Light: unison.White, Dark: unison.Silver} OnMarkerColor = &unison.ThemeColor{Light: unison.Black, Dark: unison.RGB(221, 221, 221)} OnOverloadedColor = &unison.ThemeColor{Light: unison.White, Dark: unison.RGB(221, 221, 221)} OnPageColor = &unison.ThemeColor{Light: unison.Black, Dark: unison.RGB(160, 160, 160)} OnPageStandoutColor = &unison.ThemeColor{Light: unison.Black, Dark: unison.RGB(160, 160, 160)} OnSearchListColor = &unison.ThemeColor{Light: unison.Black, Dark: unison.RGB(204, 204, 204)} OverloadedColor = &unison.ThemeColor{Light: unison.RGB(192, 64, 64), Dark: unison.RGB(115, 37, 37)} PDFLinkHighlightColor = &unison.ThemeColor{Light: unison.SpringGreen, Dark: unison.SpringGreen} PDFMarkerHighlightColor = &unison.ThemeColor{Light: unison.Yellow, Dark: unison.Yellow} PageColor = &unison.ThemeColor{Light: unison.White, Dark: unison.RGB(16, 16, 16)} PageStandoutColor = &unison.ThemeColor{Light: unison.RGB(221, 221, 221), Dark: unison.RGB(64, 64, 64)} PageVoidColor = &unison.ThemeColor{Light: unison.Grey, Dark: unison.Black} SearchListColor = &unison.ThemeColor{Light: unison.LightCyan, Dark: unison.RGB(0, 43, 43)} )
Additional colors over and above what unison provides by default.
var ( FieldSecondaryFont = &unison.IndirectFont{Font: unison.FieldFont.Face().Font(unison.FieldFont.Size() - 1)} PageFieldPrimaryFont = &unison.IndirectFont{Font: unison.MatchFontFace(unison.DefaultSystemFamilyName, unison.MediumFontWeight, unison.StandardSpacing, unison.NoSlant).Font(7)} PageFieldSecondaryFont = &unison.IndirectFont{Font: unison.MatchFontFace(unison.DefaultSystemFamilyName, unison.NormalFontWeight, unison.StandardSpacing, unison.NoSlant).Font(6)} PageLabelPrimaryFont = &unison.IndirectFont{Font: unison.MatchFontFace(unison.DefaultSystemFamilyName, unison.NormalFontWeight, unison.StandardSpacing, unison.NoSlant).Font(7)} PageLabelSecondaryFont = &unison.IndirectFont{Font: unison.MatchFontFace(unison.DefaultSystemFamilyName, unison.NormalFontWeight, unison.StandardSpacing, unison.NoSlant).Font(6)} BaseMarkdownFont = &unison.IndirectFont{Font: unison.LabelFont.Face().Font(unison.LabelFont.Size())} )
Additional fonts over and above what unison provides by default.
var ( InitialPointsDef = fxp.From(150) InitialPointsMin fxp.Int InitialPointsMax = fxp.From(9999999) TooltipDelayDef = fxp.FromStringForced("0.75") TooltipDelayMin fxp.Int TooltipDelayMax = fxp.Thirty TooltipDismissalDef = fxp.From(60) TooltipDismissalMin = fxp.One TooltipDismissalMax = fxp.From(3600) ScrollWheelMultiplierDef = fxp.From(unison.MouseWheelMultiplier) ScrollWheelMultiplierMin = fxp.Int(1) ScrollWheelMultiplierMax = fxp.From(9999) )
Default, min & max values for the general numeric settings
var AllAffects = []Affects{ TotalAffects, BaseOnlyAffects, LevelsOnlyAffects, }
AllAffects holds all possible values.
var AllAttributeType = []AttributeType{ IntegerAttributeType, IntegerRefAttributeType, DecimalAttributeType, DecimalRefAttributeType, PoolAttributeType, PrimarySeparatorAttributeType, SecondarySeparatorAttributeType, PoolSeparatorAttributeType, }
AllAttributeType holds all possible values.
var AllBonusLimitation = []BonusLimitation{ NoneBonusLimitation, StrikingOnlyBonusLimitation, LiftingOnlyBonusLimitation, ThrowingOnlyBonusLimitation, }
AllBonusLimitation holds all possible values.
var AllCellType = []CellType{ TextCellType, TagsCellType, ToggleCellType, PageRefCellType, MarkdownCellType, }
AllCellType holds all possible values.
var AllContainerType = []ContainerType{ GroupContainerType, MetaTraitContainerType, RaceContainerType, AlternativeAbilitiesContainerType, AttributesContainerType, }
AllContainerType holds all possible values.
var AllDamageProgression = []DamageProgression{ BasicSet, KnowingYourOwnStrength, NoSchoolGrognardDamage, ThrustEqualsSwingMinus2, SwingEqualsThrustPlus2, Tbone1, Tbone1Clean, Tbone2, Tbone2Clean, PhoenixFlameD3, }
AllDamageProgression holds all possible values.
var AllDifficulty = []Difficulty{ Easy, Average, Hard, VeryHard, Wildcard, }
AllDifficulty holds all possible values.
var AllDisplayOption = []DisplayOption{ NotShownDisplayOption, InlineDisplayOption, TooltipDisplayOption, InlineAndTooltipDisplayOption, }
AllDisplayOption holds all possible values.
var AllDockableGroup = []DockableGroup{ CharacterSheetsDockableGroup, CharacterTemplatesDockableGroup, EditorsDockableGroup, ImagesDockableGroup, LibrariesDockableGroup, MarkdownDockableGroup, PDFsDockableGroup, SettingsDockableGroup, SubEditorsDockableGroup, }
AllDockableGroup holds all possible values.
var AllEncumbrance = []Encumbrance{ NoEncumbrance, LightEncumbrance, MediumEncumbrance, HeavyEncumbrance, ExtraHeavyEncumbrance, }
AllEncumbrance holds all possible values.
var AllEntityType = []EntityType{ PC, }
AllEntityType holds all possible values.
var AllEquipmentModifierCostType = []EquipmentModifierCostType{ OriginalEquipmentModifierCostType, BaseEquipmentModifierCostType, FinalBaseEquipmentModifierCostType, FinalEquipmentModifierCostType, }
AllEquipmentModifierCostType holds all possible values.
var AllEquipmentModifierCostValueType = []EquipmentModifierCostValueType{ AdditionEquipmentModifierCostValueType, PercentageEquipmentModifierCostValueType, MultiplierEquipmentModifierCostValueType, CostFactorEquipmentModifierCostValueType, }
AllEquipmentModifierCostValueType holds all possible values.
var AllEquipmentModifierWeightType = []EquipmentModifierWeightType{ OriginalEquipmentModifierWeightType, BaseEquipmentModifierWeightType, FinalBaseEquipmentModifierWeightType, FinalEquipmentModifierWeightType, }
AllEquipmentModifierWeightType holds all possible values.
var AllEquipmentModifierWeightValueType = []EquipmentModifierWeightValueType{ AdditionEquipmentModifierWeightValueType, PercentageAdderEquipmentModifierWeightValueType, PercentageMultiplierEquipmentModifierWeightValueType, MultiplierEquipmentModifierWeightValueType, }
AllEquipmentModifierWeightValueType holds all possible values.
var AllFeatureType = []FeatureType{ AttributeBonusFeatureType, ConditionalModifierFeatureType, DRBonusFeatureType, ReactionBonusFeatureType, SkillBonusFeatureType, SkillPointBonusFeatureType, SpellBonusFeatureType, SpellPointBonusFeatureType, WeaponBonusFeatureType, WeaponDRDivisorBonusFeatureType, CostReductionFeatureType, ContainedWeightReductionFeatureType, }
AllFeatureType holds all possible values.
var AllFeatureTypesWithoutContainedWeightType []FeatureType
AllFeatureTypesWithoutContainedWeightType holds the possible FeatureType values, minus the ContainedWeightReductionFeatureType.
var AllLengthUnits = []LengthUnits{ FeetAndInches, Inch, Feet, Yard, Mile, Centimeter, Kilometer, Meter, }
AllLengthUnits holds all possible values.
var AllNameData = []NameData{ NoneNameData, AmericanMaleNameData, AmericanFemaleNameData, AmericanLastNameData, UnweightedAmericanMaleNameData, UnweightedAmericanFemaleNameData, UnweightedAmericanLastNameData, }
AllNameData holds all possible values.
var AllNameGenerationType = []NameGenerationType{ SimpleNameGenerationType, MarkovLetterNameGenerationType, MarkovRunNameGenerationType, CompoundNameGenerationType, }
AllNameGenerationType holds all possible values.
var AllNumericCompareTypes = []NumericCompareType{ AnyNumber, EqualsNumber, NotEqualsNumber, AtLeastNumber, AtMostNumber, }
AllNumericCompareTypes is the complete set of NumericCompareType values.
var AllPaperOrientation = []PaperOrientation{ Portrait, Landscape, }
AllPaperOrientation holds all possible values.
var AllPaperSize = []PaperSize{ LetterPaperSize, LegalPaperSize, TabloidPaperSize, A0PaperSize, A1PaperSize, A2PaperSize, A3PaperSize, A4PaperSize, A5PaperSize, A6PaperSize, }
AllPaperSize holds all possible values.
var AllPaperUnits = []PaperUnits{ InchPaperUnits, CentimeterPaperUnits, MillimeterPaperUnits, }
AllPaperUnits holds all possible values.
var AllPrereqType = []PrereqType{ ListPrereqType, TraitPrereqType, AttributePrereqType, ContainedQuantityPrereqType, ContainedWeightPrereqType, EquippedEquipmentPrereqType, SkillPrereqType, SpellPrereqType, }
AllPrereqType holds all possible values.
var AllSelfControlRollAdj = []SelfControlRollAdj{ NoCRAdj, ActionPenalty, ReactionPenalty, FrightCheckPenalty, FrightCheckBonus, MinorCostOfLivingIncrease, MajorCostOfLivingIncrease, }
AllSelfControlRollAdj holds all possible values.
var AllSelfControlRolls = []SelfControlRoll{ NoCR, CR6, CR9, CR12, CR15, }
AllSelfControlRolls is the complete set of SelfControlRoll values.
var AllSkillSelectionType = []SkillSelectionType{ NameSkillSelectionType, ThisWeaponSkillSelectionType, WeaponsWithNameSkillSelectionType, }
AllSkillSelectionType holds all possible values.
var AllSpellComparisonType = []SpellComparisonType{ NameSpellComparisonType, TagSpellComparisonType, CollegeSpellComparisonType, CollegeCountSpellComparisonType, AnySpellComparisonType, }
AllSpellComparisonType holds all possible values.
var AllSpellMatchType = []SpellMatchType{ AllCollegesSpellMatchType, CollegeNameSpellMatchType, PowerSourceSpellMatchType, NameSpellMatchType, }
AllSpellMatchType holds all possible values.
var AllStrengthDamage = []StrengthDamage{ NoneStrengthDamage, ThrustStrengthDamage, LeveledThrustStrengthDamage, SwingStrengthDamage, LeveledSwingStrengthDamage, }
AllStrengthDamage holds all possible values.
var AllStringCompareTypes = []StringCompareType{ AnyString, IsString, IsNotString, ContainsString, DoesNotContainString, StartsWithString, DoesNotStartWithString, EndsWithString, DoesNotEndWithString, }
AllStringCompareTypes is the complete set of StringCompareType values.
var AllStudyType = []StudyType{ SelfStudyType, JobStudyType, TeacherStudyType, IntensiveStudyType, }
AllStudyType holds all possible values.
var AllTechniqueDifficulty = []Difficulty{ Average, Hard, }
AllTechniqueDifficulty holds all possible values when used with Techniques.
var AllTemplatePickerType = []TemplatePickerType{ NotApplicableTemplatePickerType, CountTemplatePickerType, PointsTemplatePickerType, }
AllTemplatePickerType holds all possible values.
var AllThresholdOp = []ThresholdOp{ UnknownThresholdOp, HalveMoveThresholdOp, HalveDodgeThresholdOp, HalveSTThresholdOp, }
AllThresholdOp holds all possible values.
var AllTraitModifierCostType = []TraitModifierCostType{ PercentageTraitModifierCostType, PointsTraitModifierCostType, MultiplierTraitModifierCostType, }
AllTraitModifierCostType holds all possible values.
var AllWeaponSelectionType = []WeaponSelectionType{ WithRequiredSkillWeaponSelectionType, ThisWeaponWeaponSelectionType, WithNameWeaponSelectionType, }
AllWeaponSelectionType holds all possible values.
var AllWeaponType = []WeaponType{ MeleeWeaponType, RangedWeaponType, }
AllWeaponType holds all possible values.
var AllWeightUnits = []WeightUnits{ Pound, PoundAlt, Ounce, Ton, TonAlt, Kilogram, Gram, }
AllWeightUnits holds all possible values.
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 string
SettingsPath holds the path to our settings file.
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, canLevel bool, basePoints, levels, pointsPerLevel fxp.Int, cr SelfControlRoll, modifiers []*TraitModifier, roundCostDown bool) fxp.Int
AdjustedPoints returns the total points, taking levels and modifiers into account. 'entity' may be nil.
func AdjustedPointsForNonContainerSkillOrTechnique ¶
func AdjustedPointsForNonContainerSkillOrTechnique(entity *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(entity *Entity, points fxp.Int, name, powerSource string, colleges, tags []string, tooltip *xio.ByteBuffer) fxp.Int
AdjustedPointsForNonContainerSpell returns the points, adjusted for any bonuses.
func Apply ¶ added in v5.9.0
Apply replaces the matching nameable sections with the values from the set.
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 CheckVersion ¶ added in v5.9.0
CheckVersion returns an error if the data version is out of the acceptable range.
func ChooseWeightedStringOption ¶ added in v5.9.0
func ChooseWeightedStringOption(options []*WeightedStringOption, not string) string
ChooseWeightedStringOption selects a string option from the available set.
func CloneNodes ¶
CloneNodes creates clones of the provided nodes.
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 CountThresholdOpMet ¶
func CountThresholdOpMet(op ThresholdOp, 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 CreateImageFromSVG ¶ added in v5.9.0
CreateImageFromSVG turns one of our svg-as-a-path objects into an actual SVG document, then renders it into an image at the specified square size. Note that this is not currently GPU accelerated, as I haven't added the necessary bits to unison to support scribbling into arbitrary offscreen images yet.
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 ExtractContainedWeightReduction ¶ added in v5.9.0
func ExtractContainedWeightReduction(s string, defUnits WeightUnits) (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 ExtractNumericCompareTypeIndex ¶ added in v5.9.0
ExtractNumericCompareTypeIndex extracts the index from a string.
func ExtractStringCompareTypeIndex ¶ added in v5.9.0
ExtractStringCompareTypeIndex extracts the index from a string.
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 ¶
func FormatRelativeSkill(entity *Entity, typ string, difficulty AttributeDifficulty, rsl fxp.Int) string
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 HitLocationChoices ¶
func HitLocationChoices(entity *Entity, prefix, currentKey string) (choices []*HitLocationChoice, current *HitLocationChoice)
HitLocationChoices collects the available choices for hit locations for the given entity, or nil.
func InstallEvaluatorFunctions ¶
InstallEvaluatorFunctions installs additional functions for the evaluator.
func IsThresholdOpMet ¶
func IsThresholdOpMet(op ThresholdOp, attributes *Attributes) bool
IsThresholdOpMet if the given ThresholdOp is met.
func LegacyExport ¶ added in v5.9.0
LegacyExport performs the text template export function that matches the old Java code base.
func LegacyExportMultiple ¶ added in v5.9.0
LegacyExportMultiple exports the files to a text representation.
func PrefixedNumericCompareTypeChoices ¶ added in v5.9.0
PrefixedNumericCompareTypeChoices returns the set of NumericCompareType choices as strings with a prefix.
func PrefixedStringCompareTypeChoices ¶ added in v5.9.0
PrefixedStringCompareTypeChoices returns the set of StringCompareType choices as strings with a prefix.
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 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 StudyHoursProgressText ¶ added in v5.3.0
StudyHoursProgressText returns the progress text or an empty string.
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(value fxp.Int, modifiers []*EquipmentModifier) fxp.Int
ValueAdjustedForModifiers returns the value after adjusting it for a set of modifiers.
Types ¶
type Affects ¶ added in v5.9.0
type Affects byte
Affects describes how a TraitModifier affects the point cost.
const ( TotalAffects Affects = iota BaseOnlyAffects LevelsOnlyAffects LastAffects = LevelsOnlyAffects )
Possible values.
func ExtractAffects ¶ added in v5.9.0
ExtractAffects extracts the value from a string.
func (Affects) EnsureValid ¶ added in v5.9.0
EnsureValid ensures this is of a known value.
func (Affects) MarshalText ¶ added in v5.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (*Affects) UnmarshalText ¶ added in v5.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
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 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
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
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 Length) 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 Weight) 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 FeatureType `json:"type"` Limitation BonusLimitation `json:"limitation,omitempty"` Attribute string `json:"attribute"` LeveledAmount // contains filtered or unexported fields }
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) AddToTooltip ¶ added in v5.9.0
func (a *AttributeBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*AttributeBonus) ApplyNameableKeys ¶ added in v5.9.0
func (a *AttributeBonus) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*AttributeBonus) FillWithNameableKeys ¶ added in v5.9.0
func (a *AttributeBonus) FillWithNameableKeys(_ map[string]string)
FillWithNameableKeys implements Feature.
func (*AttributeBonus) Owner ¶ added in v5.9.0
func (a *AttributeBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*AttributeBonus) SetLevel ¶ added in v5.9.0
func (a *AttributeBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*AttributeBonus) SetOwner ¶ added in v5.9.0
func (a *AttributeBonus) SetOwner(owner fmt.Stringer)
SetOwner 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) 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 AttributeType `json:"type"` 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) CRC64 ¶
func (a *AttributeDefs) CRC64() uint64
CRC64 calculates a CRC-64 for this data.
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 // 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) 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 PrereqType `json:"type"` Has bool `json:"has"` CombinedWith string `json:"combined_with,omitempty"` QualifierCriteria NumericCriteria `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) ApplyNameableKeys ¶
func (a *AttributePrereq) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys implements Prereq.
func (*AttributePrereq) Clone ¶
func (a *AttributePrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*AttributePrereq) FillWithNameableKeys ¶
func (a *AttributePrereq) FillWithNameableKeys(_ map[string]string)
FillWithNameableKeys implements Prereq.
func (*AttributePrereq) ParentList ¶
func (a *AttributePrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*AttributePrereq) PrereqType ¶
func (a *AttributePrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*AttributePrereq) Satisfied ¶
func (a *AttributePrereq) Satisfied(entity *Entity, _ any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type AttributeType ¶ added in v5.9.0
type AttributeType byte
AttributeType holds the type of an attribute definition.
const ( IntegerAttributeType AttributeType = iota IntegerRefAttributeType DecimalAttributeType DecimalRefAttributeType PoolAttributeType PrimarySeparatorAttributeType SecondarySeparatorAttributeType PoolSeparatorAttributeType LastAttributeType = PoolSeparatorAttributeType )
Possible values.
func ExtractAttributeType ¶ added in v5.9.0
func ExtractAttributeType(str string) AttributeType
ExtractAttributeType extracts the value from a string.
func (AttributeType) EnsureValid ¶ added in v5.9.0
func (enum AttributeType) EnsureValid() AttributeType
EnsureValid ensures this is of a known value.
func (AttributeType) Key ¶ added in v5.9.0
func (enum AttributeType) Key() string
Key returns the key used in serialization.
func (AttributeType) MarshalText ¶ added in v5.9.0
func (enum AttributeType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (AttributeType) String ¶ added in v5.9.0
func (enum AttributeType) String() string
String implements fmt.Stringer.
func (*AttributeType) UnmarshalText ¶ added in v5.9.0
func (enum *AttributeType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Attributes ¶
Attributes holds a set of Attribute objects.
func NewAttributes ¶
func NewAttributes(entity *Entity) *Attributes
NewAttributes creates a new Attributes.
func (*Attributes) CRC64 ¶
func (a *Attributes) CRC64() uint64
CRC64 calculates a CRC-64 for this data.
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) 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 ¶
type Body struct { Name string `json:"name,omitempty"` Roll *dice.Dice `json:"roll"` Locations []*HitLocation `json:"locations,omitempty"` KeyPrefix string `json:"-"` // contains filtered or unexported fields }
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) 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.
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) // 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 BonusLimitation ¶ added in v5.9.0
type BonusLimitation byte
BonusLimitation holds a limitation for an AttributeBonus.
const ( NoneBonusLimitation BonusLimitation = iota StrikingOnlyBonusLimitation LiftingOnlyBonusLimitation ThrowingOnlyBonusLimitation LastBonusLimitation = ThrowingOnlyBonusLimitation )
Possible values.
func ExtractBonusLimitation ¶ added in v5.9.0
func ExtractBonusLimitation(str string) BonusLimitation
ExtractBonusLimitation extracts the value from a string.
func (BonusLimitation) EnsureValid ¶ added in v5.9.0
func (enum BonusLimitation) EnsureValid() BonusLimitation
EnsureValid ensures this is of a known value.
func (BonusLimitation) Key ¶ added in v5.9.0
func (enum BonusLimitation) Key() string
Key returns the key used in serialization.
func (BonusLimitation) MarshalText ¶ added in v5.9.0
func (enum BonusLimitation) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (BonusLimitation) String ¶ added in v5.9.0
func (enum BonusLimitation) String() string
String implements fmt.Stringer.
func (*BonusLimitation) UnmarshalText ¶ added in v5.9.0
func (enum *BonusLimitation) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
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 CellData ¶
type CellData struct { Type CellType Disabled bool Dim bool Checked bool Alignment unison.Alignment Primary string Secondary string Tooltip string UnsatisfiedReason string TemplateInfo string }
CellData holds data for creating a cell's visual representation.
type CellType ¶
type CellType byte
CellType holds the type of table cell.
const ( TextCellType CellType = iota TagsCellType ToggleCellType PageRefCellType MarkdownCellType LastCellType = MarkdownCellType )
Possible values.
func ExtractCellType ¶
ExtractCellType extracts the value from a string.
func (CellType) EnsureValid ¶
EnsureValid ensures this is of a known value.
func (CellType) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*CellType) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
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 Colors ¶ added in v5.9.0
type Colors struct {
// contains filtered or unexported fields
}
Colors holds a set of themed colors.
func NewColorsFromFS ¶ added in v5.9.0
NewColorsFromFS creates a new set of colors from a file. Any missing values will be filled in with defaults.
func (*Colors) MakeCurrent ¶ added in v5.9.0
func (c *Colors) MakeCurrent()
MakeCurrent applies these colors to the current theme color set and updates all windows.
func (*Colors) MarshalJSON ¶ added in v5.9.0
MarshalJSON implements json.Marshaler.
func (*Colors) UnmarshalJSON ¶ added in v5.9.0
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 (m *ConditionalModifier) Add(source string, amt fxp.Int)
Add another source.
func (*ConditionalModifier) ApplyNameableKeys ¶
func (m *ConditionalModifier) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys replaces any nameable keys found with the corresponding values in the provided map.
func (*ConditionalModifier) CellData ¶
func (m *ConditionalModifier) CellData(columnID int, data *CellData)
CellData returns the cell data information for the given column.
func (*ConditionalModifier) Clone ¶
func (m *ConditionalModifier) Clone(_ *Entity, _ *ConditionalModifier, preserveID bool) *ConditionalModifier
Clone implements Node.
func (*ConditionalModifier) Container ¶
func (m *ConditionalModifier) Container() bool
Container returns true if this is a container.
func (*ConditionalModifier) Enabled ¶
func (m *ConditionalModifier) Enabled() bool
Enabled returns true if this node is enabled.
func (*ConditionalModifier) FillWithNameableKeys ¶
func (m *ConditionalModifier) FillWithNameableKeys(_ map[string]string)
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*ConditionalModifier) HasChildren ¶
func (m *ConditionalModifier) HasChildren() bool
HasChildren returns true if this node has children.
func (*ConditionalModifier) Kind ¶
func (m *ConditionalModifier) Kind() string
Kind returns the kind of data.
func (*ConditionalModifier) Less ¶
func (m *ConditionalModifier) Less(other *ConditionalModifier) bool
Less returns true if this should be sorted above the other.
func (*ConditionalModifier) NodeChildren ¶
func (m *ConditionalModifier) NodeChildren() []*ConditionalModifier
NodeChildren returns the children of this node, if any.
func (*ConditionalModifier) Open ¶
func (m *ConditionalModifier) Open() bool
Open returns true if this node is currently open.
func (*ConditionalModifier) OwningEntity ¶
func (m *ConditionalModifier) OwningEntity() *Entity
OwningEntity returns the owning Entity.
func (*ConditionalModifier) Parent ¶
func (m *ConditionalModifier) Parent() *ConditionalModifier
Parent returns the parent.
func (*ConditionalModifier) SetChildren ¶
func (m *ConditionalModifier) SetChildren(_ []*ConditionalModifier)
SetChildren sets the children of this node.
func (*ConditionalModifier) SetOpen ¶
func (m *ConditionalModifier) SetOpen(_ bool)
SetOpen sets the current open state for this node.
func (*ConditionalModifier) SetOwningEntity ¶
func (m *ConditionalModifier) SetOwningEntity(_ *Entity)
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*ConditionalModifier) SetParent ¶
func (m *ConditionalModifier) SetParent(_ *ConditionalModifier)
SetParent sets the parent.
func (*ConditionalModifier) String ¶ added in v5.9.0
func (m *ConditionalModifier) String() string
func (*ConditionalModifier) Total ¶
func (m *ConditionalModifier) Total() fxp.Int
Total returns the total of all amounts.
func (*ConditionalModifier) UUID ¶
func (m *ConditionalModifier) UUID() uuid.UUID
UUID returns the UUID of this data.
type ConditionalModifierBonus ¶ added in v5.9.0
type ConditionalModifierBonus struct { Type FeatureType `json:"type"` Situation string `json:"situation,omitempty"` LeveledAmount // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
func (c *ConditionalModifierBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*ConditionalModifierBonus) FillWithNameableKeys ¶ added in v5.9.0
func (c *ConditionalModifierBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*ConditionalModifierBonus) Owner ¶ added in v5.9.0
func (c *ConditionalModifierBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*ConditionalModifierBonus) SetLevel ¶ added in v5.9.0
func (c *ConditionalModifierBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*ConditionalModifierBonus) SetOwner ¶ added in v5.9.0
func (c *ConditionalModifierBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type ConditionalModifierListProvider ¶
type ConditionalModifierListProvider interface { EntityProvider ConditionalModifiers() []*ConditionalModifier }
ConditionalModifierListProvider defines the method needed to access the conditional modifier list data.
type ContainedQuantityPrereq ¶
type ContainedQuantityPrereq struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` Has bool `json:"has"` QualifierCriteria NumericCriteria `json:"qualifier,omitempty"` }
ContainedQuantityPrereq holds a prerequisite for an equipment contained quantity.
func NewContainedQuantityPrereq ¶
func NewContainedQuantityPrereq() *ContainedQuantityPrereq
NewContainedQuantityPrereq creates a new ContainedQuantityPrereq.
func (*ContainedQuantityPrereq) ApplyNameableKeys ¶
func (c *ContainedQuantityPrereq) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys implements Prereq.
func (*ContainedQuantityPrereq) Clone ¶
func (c *ContainedQuantityPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*ContainedQuantityPrereq) FillWithNameableKeys ¶
func (c *ContainedQuantityPrereq) FillWithNameableKeys(_ map[string]string)
FillWithNameableKeys implements Prereq.
func (*ContainedQuantityPrereq) ParentList ¶
func (c *ContainedQuantityPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*ContainedQuantityPrereq) PrereqType ¶
func (c *ContainedQuantityPrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*ContainedQuantityPrereq) Satisfied ¶
func (c *ContainedQuantityPrereq) Satisfied(_ *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type ContainedWeightPrereq ¶
type ContainedWeightPrereq struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` Has bool `json:"has"` WeightCriteria WeightCriteria `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) ApplyNameableKeys ¶
func (c *ContainedWeightPrereq) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys implements Prereq.
func (*ContainedWeightPrereq) Clone ¶
func (c *ContainedWeightPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*ContainedWeightPrereq) FillWithNameableKeys ¶
func (c *ContainedWeightPrereq) FillWithNameableKeys(_ map[string]string)
FillWithNameableKeys implements Prereq.
func (*ContainedWeightPrereq) ParentList ¶
func (c *ContainedWeightPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*ContainedWeightPrereq) PrereqType ¶
func (c *ContainedWeightPrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*ContainedWeightPrereq) Satisfied ¶
func (c *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 FeatureType `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) ApplyNameableKeys ¶ added in v5.9.0
func (c *ContainedWeightReduction) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
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 WeightUnits) Weight
FixedReduction returns the fixed amount the weight should be reduced by. Will return 0 if this is a percentage.
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 ContainerBase ¶
type ContainerBase[T NodeTypes] struct { ID uuid.UUID `json:"id"` Type string `json:"type"` IsOpen bool `json:"open,omitempty"` // Container only Children []T `json:"children,omitempty"` // Container only // contains filtered or unexported fields }
ContainerBase holds the type and ID of the data.
func (*ContainerBase[T]) Container ¶
func (c *ContainerBase[T]) Container() bool
Container returns true if this is a container.
func (*ContainerBase[T]) GetType ¶ added in v5.9.0
func (c *ContainerBase[T]) GetType() string
GetType returns the type.
func (*ContainerBase[T]) HasChildren ¶
func (c *ContainerBase[T]) HasChildren() bool
HasChildren returns true if this node has children.
func (*ContainerBase[T]) NodeChildren ¶
func (c *ContainerBase[T]) NodeChildren() []T
NodeChildren returns the children of this node, if any.
func (*ContainerBase[T]) Open ¶
func (c *ContainerBase[T]) Open() bool
Open returns true if this node is currently open.
func (*ContainerBase[T]) SetChildren ¶
func (c *ContainerBase[T]) SetChildren(children []T)
SetChildren sets the children of this node.
func (*ContainerBase[T]) SetOpen ¶
func (c *ContainerBase[T]) SetOpen(open bool)
SetOpen sets the current open state for this node.
func (*ContainerBase[T]) SetParent ¶
func (c *ContainerBase[T]) SetParent(parent T)
SetParent sets the parent.
func (*ContainerBase[T]) SetType ¶ added in v5.9.0
func (c *ContainerBase[T]) SetType(t string)
SetType sets the type.
func (*ContainerBase[T]) UUID ¶
func (c *ContainerBase[T]) UUID() uuid.UUID
UUID returns the UUID of this data.
type ContainerType ¶ added in v5.9.0
type ContainerType byte
ContainerType holds the type of a trait container.
const ( GroupContainerType ContainerType = iota MetaTraitContainerType RaceContainerType AlternativeAbilitiesContainerType AttributesContainerType LastContainerType = AttributesContainerType )
Possible values.
func ExtractContainerType ¶ added in v5.9.0
func ExtractContainerType(str string) ContainerType
ExtractContainerType extracts the value from a string.
func (ContainerType) EnsureValid ¶ added in v5.9.0
func (enum ContainerType) EnsureValid() ContainerType
EnsureValid ensures this is of a known value.
func (ContainerType) Key ¶ added in v5.9.0
func (enum ContainerType) Key() string
Key returns the key used in serialization.
func (ContainerType) MarshalText ¶ added in v5.9.0
func (enum ContainerType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (ContainerType) String ¶ added in v5.9.0
func (enum ContainerType) String() string
String implements fmt.Stringer.
func (*ContainerType) UnmarshalText ¶ added in v5.9.0
func (enum *ContainerType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type CostReduction ¶ added in v5.9.0
type CostReduction struct { Type FeatureType `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) ApplyNameableKeys ¶ added in v5.9.0
func (c *CostReduction) ApplyNameableKeys(_ map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*CostReduction) FillWithNameableKeys ¶ added in v5.9.0
func (c *CostReduction) FillWithNameableKeys(_ map[string]string)
FillWithNameableKeys implements Feature.
type DRBonus ¶ added in v5.9.0
type DRBonus struct { DRBonusData // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
ApplyNameableKeys implements Feature.
func (*DRBonus) FeatureType ¶ added in v5.9.0
func (d *DRBonus) FeatureType() FeatureType
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 FeatureType `json:"type"` Location string `json:"location"` Specialization string `json:"specialization,omitempty"` LeveledAmount }
DRBonusData is split out so that it can be adjusted before and after being serialized.
type DamageProgression ¶ added in v5.9.0
type DamageProgression byte
DamageProgression controls how Thrust and Swing are calculated.
const ( BasicSet DamageProgression = iota KnowingYourOwnStrength NoSchoolGrognardDamage ThrustEqualsSwingMinus2 SwingEqualsThrustPlus2 Tbone1 Tbone1Clean Tbone2 Tbone2Clean PhoenixFlameD3 LastDamageProgression = PhoenixFlameD3 )
Possible values.
func ExtractDamageProgression ¶ added in v5.9.0
func ExtractDamageProgression(str string) DamageProgression
ExtractDamageProgression extracts the value from a string.
func (DamageProgression) AltString ¶ added in v5.9.0
func (enum DamageProgression) AltString() string
AltString returns the alternate string.
func (DamageProgression) EnsureValid ¶ added in v5.9.0
func (enum DamageProgression) EnsureValid() DamageProgression
EnsureValid ensures this is of a known value.
func (DamageProgression) Key ¶ added in v5.9.0
func (enum DamageProgression) Key() string
Key returns the key used in serialization.
func (DamageProgression) MarshalText ¶ added in v5.9.0
func (enum DamageProgression) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (DamageProgression) String ¶ added in v5.9.0
func (enum DamageProgression) String() string
String implements fmt.Stringer.
func (DamageProgression) Swing ¶ added in v5.9.0
func (enum DamageProgression) Swing(strength int) *dice.Dice
Swing returns the swing damage for the given strength.
func (DamageProgression) Thrust ¶ added in v5.9.0
func (enum DamageProgression) Thrust(strength int) *dice.Dice
Thrust returns the thrust damage for the given strength.
func (*DamageProgression) UnmarshalText ¶ added in v5.9.0
func (enum *DamageProgression) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Difficulty ¶ added in v5.9.0
type Difficulty byte
Difficulty holds the difficulty level of a skill.
const ( Easy Difficulty = iota Average Hard VeryHard Wildcard LastDifficulty = Wildcard )
Possible values.
func ExtractDifficulty ¶ added in v5.9.0
func ExtractDifficulty(str string) Difficulty
ExtractDifficulty extracts the value from a string.
func (Difficulty) BaseRelativeLevel ¶ added in v5.9.0
func (enum Difficulty) BaseRelativeLevel() fxp.Int
BaseRelativeLevel returns the base relative skill level at 0 points.
func (Difficulty) EnsureValid ¶ added in v5.9.0
func (enum Difficulty) EnsureValid() Difficulty
EnsureValid ensures this is of a known value.
func (Difficulty) Key ¶ added in v5.9.0
func (enum Difficulty) Key() string
Key returns the key used in serialization.
func (Difficulty) MarshalText ¶ added in v5.9.0
func (enum Difficulty) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (Difficulty) String ¶ added in v5.9.0
func (enum Difficulty) String() string
String implements fmt.Stringer.
func (*Difficulty) UnmarshalText ¶ added in v5.9.0
func (enum *Difficulty) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type DisplayOption ¶ added in v5.9.0
type DisplayOption byte
DisplayOption holds a display option.
const ( NotShownDisplayOption DisplayOption = iota InlineDisplayOption TooltipDisplayOption InlineAndTooltipDisplayOption LastDisplayOption = InlineAndTooltipDisplayOption )
Possible values.
func ExtractDisplayOption ¶ added in v5.9.0
func ExtractDisplayOption(str string) DisplayOption
ExtractDisplayOption extracts the value from a string.
func (DisplayOption) EnsureValid ¶ added in v5.9.0
func (enum DisplayOption) EnsureValid() DisplayOption
EnsureValid ensures this is of a known value.
func (DisplayOption) Inline ¶ added in v5.9.0
func (enum DisplayOption) Inline() bool
Inline returns true if inline notes should be shown.
func (DisplayOption) Key ¶ added in v5.9.0
func (enum DisplayOption) Key() string
Key returns the key used in serialization.
func (DisplayOption) MarshalText ¶ added in v5.9.0
func (enum DisplayOption) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (DisplayOption) String ¶ added in v5.9.0
func (enum DisplayOption) String() string
String implements fmt.Stringer.
func (DisplayOption) Tooltip ¶ added in v5.9.0
func (enum DisplayOption) Tooltip() bool
Tooltip returns true if tooltips should be shown.
func (*DisplayOption) UnmarshalText ¶ added in v5.9.0
func (enum *DisplayOption) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type DockableGroup ¶ added in v5.10.0
type DockableGroup byte
DockableGroup holds the set of dockable groupings.
const ( CharacterSheetsDockableGroup DockableGroup = iota CharacterTemplatesDockableGroup EditorsDockableGroup ImagesDockableGroup LibrariesDockableGroup MarkdownDockableGroup PDFsDockableGroup SettingsDockableGroup SubEditorsDockableGroup LastDockableGroup = SubEditorsDockableGroup )
Possible values.
func ExtractDockableGroup ¶ added in v5.10.0
func ExtractDockableGroup(str string) DockableGroup
ExtractDockableGroup extracts the value from a string.
func SanitizeDockableGroups ¶ added in v5.10.0
func SanitizeDockableGroups(groups []DockableGroup) []DockableGroup
SanitizeDockableGroups returns the list of valid dockable groups from the passed-in list, in sorted order.
func (DockableGroup) EnsureValid ¶ added in v5.10.0
func (enum DockableGroup) EnsureValid() DockableGroup
EnsureValid ensures this is of a known value.
func (DockableGroup) Key ¶ added in v5.10.0
func (enum DockableGroup) Key() string
Key returns the key used in serialization.
func (DockableGroup) MarshalText ¶ added in v5.10.0
func (enum DockableGroup) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (DockableGroup) String ¶ added in v5.10.0
func (enum DockableGroup) String() string
String implements fmt.Stringer.
func (*DockableGroup) UnmarshalText ¶ added in v5.10.0
func (enum *DockableGroup) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type EditorData ¶
type EditorData[T NodeTypes] interface { // CopyFrom copies the corresponding data from the node into this editor data. CopyFrom(T) // ApplyTo copes he editor data into the provided node. ApplyTo(T) }
EditorData defines the methods required of editor data.
type Encumbrance ¶ added in v5.9.0
type Encumbrance byte
Encumbrance holds the encumbrance level.
const ( NoEncumbrance Encumbrance = iota LightEncumbrance MediumEncumbrance HeavyEncumbrance ExtraHeavyEncumbrance LastEncumbrance = ExtraHeavyEncumbrance )
Possible values.
func ExtractEncumbrance ¶ added in v5.9.0
func ExtractEncumbrance(str string) Encumbrance
ExtractEncumbrance extracts the value from a string.
func (Encumbrance) EnsureValid ¶ added in v5.9.0
func (enum Encumbrance) EnsureValid() Encumbrance
EnsureValid ensures this is of a known value.
func (Encumbrance) Key ¶ added in v5.9.0
func (enum Encumbrance) Key() string
Key returns the key used in serialization.
func (Encumbrance) MarshalText ¶ added in v5.9.0
func (enum Encumbrance) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (Encumbrance) Penalty ¶ added in v5.9.0
func (enum Encumbrance) Penalty() fxp.Int
Penalty returns the penalty associated with the Encumbrance level.
func (Encumbrance) String ¶ added in v5.9.0
func (enum Encumbrance) String() string
String implements fmt.Stringer.
func (*Encumbrance) UnmarshalText ¶ added in v5.9.0
func (enum *Encumbrance) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (Encumbrance) WeightMultiplier ¶ added in v5.9.0
func (enum Encumbrance) WeightMultiplier() fxp.Int
WeightMultiplier returns the weight multiplier associated with the Encumbrance level.
type Entity ¶
type Entity struct { EntityData LiftingStrengthBonus fxp.Int StrikingStrengthBonus fxp.Int ThrowingStrengthBonus fxp.Int DodgeBonus fxp.Int ParryBonus fxp.Int BlockBonus fxp.Int // contains filtered or unexported fields }
Entity holds the base information for various types of entities: PC, NPC, Creature, etc.
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, levels fxp.Int, tooltip *xio.ByteBuffer, m map[*WeaponBonus]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 string, tags []string, dieCount int, levels fxp.Int, tooltip *xio.ByteBuffer, m map[*WeaponBonus]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 BonusLimitation, tooltip *xio.ByteBuffer) fxp.Int
AttributeBonusFor returns the bonus for the given attribute.
func (*Entity) BaseSkill ¶
func (e *Entity) BaseSkill(def *SkillDefault, requirePoints bool) *Skill
BaseSkill returns the best skill for the given default, or nil.
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) CRC64 ¶
CRC64 computes a CRC-64 value for the canonical disk format of the data. The ModifiedOn field is ignored for this calculation.
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) int
Dodge returns the current Dodge value for the given Encumbrance.
func (*Entity) EncumbranceLevel ¶
func (e *Entity) EncumbranceLevel(forSkills bool) Encumbrance
EncumbranceLevel returns the current Encumbrance level.
func (*Entity) EquippedWeapons ¶
func (e *Entity) EquippedWeapons(weaponType WeaponType) []*Weapon
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) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Entity) MaximumCarry ¶
func (e *Entity) MaximumCarry(encumbrance Encumbrance) Weight
MaximumCarry returns the maximum amount the Entity can carry for the specified encumbrance level.
func (*Entity) Move ¶
func (e *Entity) Move(enc Encumbrance) 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) 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 ¶
func (e *Entity) SetWeapons(_ WeaponType, _ []*Weapon)
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) 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) 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.
func (*Entity) Weapons ¶
func (e *Entity) Weapons(weaponType WeaponType) []*Weapon
Weapons implements WeaponListProvider.
func (*Entity) WeightCarried ¶
WeightCarried returns the carried weight.
type EntityData ¶
type EntityData struct { Type EntityType `json:"type"` Version int `json:"version"` ID uuid.UUID `json:"id"` TotalPoints fxp.Int `json:"total_points"` PointsRecord []*PointsRecord `json:"points_record,omitempty"` Profile *Profile `json:"profile,omitempty"` 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 EntityProvider ¶
type EntityProvider interface {
Entity() *Entity
}
EntityProvider provides a way to retrieve a (possibly nil) Entity.
type EntityType ¶ added in v5.9.0
type EntityType byte
EntityType holds the type of an Entity.
const ( PC EntityType = iota LastEntityType = PC )
Possible values.
func ExtractEntityType ¶ added in v5.9.0
func ExtractEntityType(str string) EntityType
ExtractEntityType extracts the value from a string.
func (EntityType) EnsureValid ¶ added in v5.9.0
func (enum EntityType) EnsureValid() EntityType
EnsureValid ensures this is of a known value.
func (EntityType) Key ¶ added in v5.9.0
func (enum EntityType) Key() string
Key returns the key used in serialization.
func (EntityType) MarshalText ¶ added in v5.9.0
func (enum EntityType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (EntityType) String ¶ added in v5.9.0
func (enum EntityType) String() string
String implements fmt.Stringer.
func (*EntityType) UnmarshalText ¶ added in v5.9.0
func (enum *EntityType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Equipment ¶
type Equipment struct { EquipmentData Entity *Entity UnsatisfiedReason string }
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 ¶
func (e *Equipment) AdjustedWeight(forSkills bool, defUnits WeightUnits) Weight
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) Description ¶
Description returns a description.
func (*Equipment) DisplayLegalityClass ¶
DisplayLegalityClass returns a display version of the LegalityClass.
func (*Equipment) ExtendedValue ¶
ExtendedValue returns the extended value.
func (*Equipment) ExtendedWeight ¶
func (e *Equipment) ExtendedWeight(forSkills bool, defUnits WeightUnits) Weight
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) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Equipment) ModifierNotes ¶
ModifierNotes returns the notes due to modifiers.
func (*Equipment) OwningEntity ¶
OwningEntity returns the owning Entity.
func (*Equipment) RequiresTL ¶
RequiresTL implements TechLevelProvider.
func (*Equipment) SecondaryText ¶
func (e *Equipment) SecondaryText(optionChecker func(DisplayOption) bool) string
SecondaryText returns the "secondary" text: the text display below the description.
func (*Equipment) SetOwningEntity ¶
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*Equipment) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type EquipmentData ¶
type EquipmentData struct { ContainerBase[*Equipment] EquipmentEditData }
EquipmentData holds the Equipment data that is written to disk.
func (*EquipmentData) ClearUnusedFieldsForType ¶
func (d *EquipmentData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
type EquipmentEditData ¶
type EquipmentEditData struct { Name string `json:"description,omitempty"` PageRef string `json:"reference,omitempty"` LocalNotes string `json:"notes,omitempty"` VTTNotes string `json:"vtt_notes,omitempty"` TechLevel string `json:"tech_level,omitempty"` LegalityClass string `json:"legality_class,omitempty"` Tags []string `json:"tags,omitempty"` Modifiers []*EquipmentModifier `json:"modifiers,omitempty"` Quantity fxp.Int `json:"quantity,omitempty"` Value fxp.Int `json:"value,omitempty"` Weight Weight `json:"weight,omitempty"` MaxUses int `json:"max_uses,omitempty"` Uses int `json:"uses,omitempty"` Prereq *PrereqList `json:"prereqs,omitempty"` Weapons []*Weapon `json:"weapons,omitempty"` Features Features `json:"features,omitempty"` Equipped bool `json:"equipped,omitempty"` WeightIgnoredForSkills bool `json:"ignore_weight_for_skills,omitempty"` }
EquipmentEditData holds the Equipment data that can be edited by the UI detail editor.
func (*EquipmentEditData) ApplyTo ¶
func (d *EquipmentEditData) ApplyTo(e *Equipment)
ApplyTo implements node.EditorData.
func (*EquipmentEditData) CopyFrom ¶
func (d *EquipmentEditData) CopyFrom(e *Equipment)
CopyFrom implements node.EditorData.
type EquipmentListProvider ¶
type EquipmentListProvider interface { EntityProvider CarriedEquipmentList() []*Equipment SetCarriedEquipmentList(list []*Equipment) OtherEquipmentList() []*Equipment SetOtherEquipmentList(list []*Equipment) }
EquipmentListProvider defines the method needed to access the equipment list data.
type EquipmentModifier ¶
type EquipmentModifier struct { EquipmentModifierData Entity *Entity }
EquipmentModifier holds a modifier to a piece of Equipment.
func NewEquipmentModifier ¶
func NewEquipmentModifier(entity *Entity, 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 (m *EquipmentModifier) ApplyNameableKeys(keyMap map[string]string)
ApplyNameableKeys replaces any nameable keys found in this EquipmentModifier with the corresponding values in the provided map.
func (*EquipmentModifier) CellData ¶
func (m *EquipmentModifier) CellData(columnID int, data *CellData)
CellData returns the cell data information for the given column.
func (*EquipmentModifier) Clone ¶
func (m *EquipmentModifier) Clone(entity *Entity, parent *EquipmentModifier, preserveID bool) *EquipmentModifier
Clone implements Node.
func (*EquipmentModifier) CostDescription ¶
func (m *EquipmentModifier) CostDescription() string
CostDescription returns the formatted cost.
func (*EquipmentModifier) Depth ¶
func (m *EquipmentModifier) Depth() int
Depth returns the number of parents this node has.
func (*EquipmentModifier) Enabled ¶
func (m *EquipmentModifier) Enabled() bool
Enabled returns true if this node is enabled.
func (*EquipmentModifier) FillWithNameableKeys ¶
func (m *EquipmentModifier) FillWithNameableKeys(keyMap 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 (m *EquipmentModifier) FullCostDescription() string
FullCostDescription returns a combination of the cost and weight descriptions.
func (*EquipmentModifier) FullDescription ¶
func (m *EquipmentModifier) FullDescription() string
FullDescription returns a full description.
func (*EquipmentModifier) MarshalJSON ¶
func (m *EquipmentModifier) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*EquipmentModifier) OwningEntity ¶
func (m *EquipmentModifier) OwningEntity() *Entity
OwningEntity returns the owning Entity.
func (*EquipmentModifier) SecondaryText ¶
func (m *EquipmentModifier) SecondaryText(optionChecker func(DisplayOption) bool) string
SecondaryText returns the "secondary" text: the text display below an Trait.
func (*EquipmentModifier) SetEnabled ¶
func (m *EquipmentModifier) SetEnabled(enabled bool)
SetEnabled makes the node enabled, if possible.
func (*EquipmentModifier) SetOwningEntity ¶
func (m *EquipmentModifier) SetOwningEntity(entity *Entity)
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*EquipmentModifier) String ¶
func (m *EquipmentModifier) String() string
func (*EquipmentModifier) TagList ¶ added in v5.2.0
func (m *EquipmentModifier) TagList() []string
TagList returns the list of tags.
func (*EquipmentModifier) UnmarshalJSON ¶
func (m *EquipmentModifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*EquipmentModifier) WeightDescription ¶
func (m *EquipmentModifier) WeightDescription() string
WeightDescription returns the formatted weight.
type EquipmentModifierCostType ¶ added in v5.9.0
type EquipmentModifierCostType byte
EquipmentModifierCostType describes how an Equipment Modifier's cost is applied.
const ( OriginalEquipmentModifierCostType EquipmentModifierCostType = iota BaseEquipmentModifierCostType FinalBaseEquipmentModifierCostType FinalEquipmentModifierCostType LastEquipmentModifierCostType = FinalEquipmentModifierCostType )
Possible values.
func ExtractEquipmentModifierCostType ¶ added in v5.9.0
func ExtractEquipmentModifierCostType(str string) EquipmentModifierCostType
ExtractEquipmentModifierCostType extracts the value from a string.
func (EquipmentModifierCostType) AltString ¶ added in v5.9.0
func (enum EquipmentModifierCostType) AltString() string
AltString returns the alternate string.
func (EquipmentModifierCostType) EnsureValid ¶ added in v5.9.0
func (enum EquipmentModifierCostType) EnsureValid() EquipmentModifierCostType
EnsureValid ensures this is of a known value.
func (EquipmentModifierCostType) ExtractValue ¶ added in v5.9.0
func (enum EquipmentModifierCostType) ExtractValue(s string) fxp.Int
ExtractValue from the string.
func (EquipmentModifierCostType) Format ¶ added in v5.9.0
func (enum EquipmentModifierCostType) Format(s string) string
Format returns a formatted version of the value.
func (EquipmentModifierCostType) FromString ¶ added in v5.9.0
func (enum EquipmentModifierCostType) FromString(s string) EquipmentModifierCostValueType
FromString examines a string to determine what type it is, but restricts the result to those allowed for this EquipmentModifierCostValueType.
func (EquipmentModifierCostType) Key ¶ added in v5.9.0
func (enum EquipmentModifierCostType) Key() string
Key returns the key used in serialization.
func (EquipmentModifierCostType) MarshalText ¶ added in v5.9.0
func (enum EquipmentModifierCostType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (EquipmentModifierCostType) Permitted ¶ added in v5.9.0
func (enum EquipmentModifierCostType) Permitted() []EquipmentModifierCostValueType
Permitted returns the permitted EquipmentModifierCostValueType values.
func (EquipmentModifierCostType) String ¶ added in v5.9.0
func (enum EquipmentModifierCostType) String() string
String implements fmt.Stringer.
func (EquipmentModifierCostType) StringWithExample ¶ added in v5.9.0
func (enum EquipmentModifierCostType) StringWithExample() string
StringWithExample returns an example along with the normal String() content.
func (*EquipmentModifierCostType) UnmarshalText ¶ added in v5.9.0
func (enum *EquipmentModifierCostType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type EquipmentModifierCostValueType ¶ added in v5.9.0
type EquipmentModifierCostValueType byte
EquipmentModifierCostValueType describes how an Equipment Modifier's cost value is applied.
const ( AdditionEquipmentModifierCostValueType EquipmentModifierCostValueType = iota PercentageEquipmentModifierCostValueType MultiplierEquipmentModifierCostValueType CostFactorEquipmentModifierCostValueType LastEquipmentModifierCostValueType = CostFactorEquipmentModifierCostValueType )
Possible values.
func ExtractEquipmentModifierCostValueType ¶ added in v5.9.0
func ExtractEquipmentModifierCostValueType(str string) EquipmentModifierCostValueType
ExtractEquipmentModifierCostValueType extracts the value from a string.
func (EquipmentModifierCostValueType) EnsureValid ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) EnsureValid() EquipmentModifierCostValueType
EnsureValid ensures this is of a known value.
func (EquipmentModifierCostValueType) ExtractValue ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) ExtractValue(s string) fxp.Int
ExtractValue from the string.
func (EquipmentModifierCostValueType) Format ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) Format(value fxp.Int) string
Format returns a formatted version of the value.
func (EquipmentModifierCostValueType) FromString ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) FromString(s string) EquipmentModifierCostValueType
FromString examines a string to determine what type it is.
func (EquipmentModifierCostValueType) Key ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) Key() string
Key returns the key used in serialization.
func (EquipmentModifierCostValueType) MarshalText ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (EquipmentModifierCostValueType) String ¶ added in v5.9.0
func (enum EquipmentModifierCostValueType) String() string
String implements fmt.Stringer.
func (*EquipmentModifierCostValueType) UnmarshalText ¶ added in v5.9.0
func (enum *EquipmentModifierCostValueType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type EquipmentModifierData ¶
type EquipmentModifierData struct { ContainerBase[*EquipmentModifier] EquipmentModifierEditData }
EquipmentModifierData holds the EquipmentModifier data that is written to disk.
func (*EquipmentModifierData) ClearUnusedFieldsForType ¶
func (d *EquipmentModifierData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*EquipmentModifierData) Kind ¶
func (d *EquipmentModifierData) Kind() string
Kind returns the kind of data.
type EquipmentModifierEditData ¶
type EquipmentModifierEditData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` LocalNotes string `json:"notes,omitempty"` VTTNotes string `json:"vtt_notes,omitempty"` Tags []string `json:"tags,omitempty"` CostType EquipmentModifierCostType `json:"cost_type,omitempty"` // Non-container only WeightType EquipmentModifierWeightType `json:"weight_type,omitempty"` // Non-container only Disabled bool `json:"disabled,omitempty"` // Non-container only TechLevel string `json:"tech_level,omitempty"` // Non-container only CostAmount string `json:"cost,omitempty"` // Non-container only WeightAmount string `json:"weight,omitempty"` // Non-container only Features Features `json:"features,omitempty"` // Non-container only }
EquipmentModifierEditData holds the EquipmentModifier data that can be edited by the UI detail editor.
func (*EquipmentModifierEditData) ApplyTo ¶
func (d *EquipmentModifierEditData) ApplyTo(mod *EquipmentModifier)
ApplyTo implements node.EditorData.
func (*EquipmentModifierEditData) CopyFrom ¶
func (d *EquipmentModifierEditData) CopyFrom(mod *EquipmentModifier)
CopyFrom implements node.EditorData.
type EquipmentModifierListProvider ¶
type EquipmentModifierListProvider interface { EntityProvider EquipmentModifierList() []*EquipmentModifier SetEquipmentModifierList(list []*EquipmentModifier) }
EquipmentModifierListProvider defines the method needed to access the equipment modifier list data.
type EquipmentModifierWeightType ¶ added in v5.9.0
type EquipmentModifierWeightType byte
EquipmentModifierWeightType describes how an Equipment Modifier's weight is applied.
const ( OriginalEquipmentModifierWeightType EquipmentModifierWeightType = iota BaseEquipmentModifierWeightType FinalBaseEquipmentModifierWeightType FinalEquipmentModifierWeightType LastEquipmentModifierWeightType = FinalEquipmentModifierWeightType )
Possible values.
func ExtractEquipmentModifierWeightType ¶ added in v5.9.0
func ExtractEquipmentModifierWeightType(str string) EquipmentModifierWeightType
ExtractEquipmentModifierWeightType extracts the value from a string.
func (EquipmentModifierWeightType) AltString ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) AltString() string
AltString returns the alternate string.
func (EquipmentModifierWeightType) DetermineModifierWeightValueTypeFromString ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) DetermineModifierWeightValueTypeFromString(s string) EquipmentModifierWeightValueType
DetermineModifierWeightValueTypeFromString examines a string to determine what type it is, but restricts the result to those allowed for this EquipmentModifierWeightType.
func (EquipmentModifierWeightType) EnsureValid ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) EnsureValid() EquipmentModifierWeightType
EnsureValid ensures this is of a known value.
func (EquipmentModifierWeightType) ExtractFraction ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) ExtractFraction(s string) fxp.Fraction
ExtractFraction from the string.
func (EquipmentModifierWeightType) Format ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) Format(s string, defUnits WeightUnits) string
Format returns a formatted version of the value.
func (EquipmentModifierWeightType) Key ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) Key() string
Key returns the key used in serialization.
func (EquipmentModifierWeightType) MarshalText ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (EquipmentModifierWeightType) Permitted ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) Permitted() []EquipmentModifierWeightValueType
Permitted returns the permitted EquipmentModifierCostValueType values.
func (EquipmentModifierWeightType) String ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) String() string
String implements fmt.Stringer.
func (EquipmentModifierWeightType) StringWithExample ¶ added in v5.9.0
func (enum EquipmentModifierWeightType) StringWithExample() string
StringWithExample returns an example along with the normal String() content.
func (*EquipmentModifierWeightType) UnmarshalText ¶ added in v5.9.0
func (enum *EquipmentModifierWeightType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type EquipmentModifierWeightValueType ¶ added in v5.9.0
type EquipmentModifierWeightValueType byte
EquipmentModifierWeightValueType describes how an Equipment Modifier's weight value is applied.
const ( AdditionEquipmentModifierWeightValueType EquipmentModifierWeightValueType = iota PercentageAdderEquipmentModifierWeightValueType PercentageMultiplierEquipmentModifierWeightValueType MultiplierEquipmentModifierWeightValueType LastEquipmentModifierWeightValueType = MultiplierEquipmentModifierWeightValueType )
Possible values.
func ExtractEquipmentModifierWeightValueType ¶ added in v5.9.0
func ExtractEquipmentModifierWeightValueType(str string) EquipmentModifierWeightValueType
ExtractEquipmentModifierWeightValueType extracts the value from a string.
func (EquipmentModifierWeightValueType) EnsureValid ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) EnsureValid() EquipmentModifierWeightValueType
EnsureValid ensures this is of a known value.
func (EquipmentModifierWeightValueType) ExtractFraction ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) ExtractFraction(s string) fxp.Fraction
ExtractFraction from the string.
func (EquipmentModifierWeightValueType) Format ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) Format(fraction fxp.Fraction) string
Format returns a formatted version of the value.
func (EquipmentModifierWeightValueType) FromString ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) FromString(s string) EquipmentModifierWeightValueType
FromString examines a string to determine what type it is.
func (EquipmentModifierWeightValueType) Key ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) Key() string
Key returns the key used in serialization.
func (EquipmentModifierWeightValueType) MarshalText ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (EquipmentModifierWeightValueType) String ¶ added in v5.9.0
func (enum EquipmentModifierWeightValueType) String() string
String implements fmt.Stringer.
func (*EquipmentModifierWeightValueType) UnmarshalText ¶ added in v5.9.0
func (enum *EquipmentModifierWeightValueType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type EquippedEquipmentPrereq ¶ added in v5.9.0
type EquippedEquipmentPrereq struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` NameCriteria StringCriteria `json:"name,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) ApplyNameableKeys ¶ added in v5.9.0
func (e *EquippedEquipmentPrereq) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Prereq.
func (*EquippedEquipmentPrereq) Clone ¶ added in v5.9.0
func (e *EquippedEquipmentPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*EquippedEquipmentPrereq) FillWithNameableKeys ¶ added in v5.9.0
func (e *EquippedEquipmentPrereq) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Prereq.
func (*EquippedEquipmentPrereq) ParentList ¶ added in v5.9.0
func (e *EquippedEquipmentPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*EquippedEquipmentPrereq) PrereqType ¶ added in v5.9.0
func (e *EquippedEquipmentPrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*EquippedEquipmentPrereq) Satisfied ¶ added in v5.9.0
func (e *EquippedEquipmentPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, hasEquipmentPenalty *bool) bool
Satisfied implements Prereq.
type ExportInfo ¶
type ExportInfo struct { FilePath string `json:"file_path"` TemplatePath string `json:"template_path"` ExportPath string `json:"export_path"` LastUsed jio.Time `json:"last_used"` }
ExportInfo holds information about a recent export so that it can be redone quickly.
type Feature ¶ added in v5.9.0
type Feature interface { Nameables FeatureType() FeatureType Clone() Feature }
Feature holds data that affects another object.
type FeatureType ¶ added in v5.9.0
type FeatureType byte
FeatureType holds the type of a Feature.
const ( AttributeBonusFeatureType FeatureType = iota ConditionalModifierFeatureType DRBonusFeatureType ReactionBonusFeatureType SkillBonusFeatureType SkillPointBonusFeatureType SpellBonusFeatureType SpellPointBonusFeatureType WeaponBonusFeatureType WeaponDRDivisorBonusFeatureType CostReductionFeatureType ContainedWeightReductionFeatureType LastFeatureType = ContainedWeightReductionFeatureType )
Possible values.
func ExtractFeatureType ¶ added in v5.9.0
func ExtractFeatureType(str string) FeatureType
ExtractFeatureType extracts the value from a string.
func (FeatureType) EnsureValid ¶ added in v5.9.0
func (enum FeatureType) EnsureValid() FeatureType
EnsureValid ensures this is of a known value.
func (FeatureType) Key ¶ added in v5.9.0
func (enum FeatureType) Key() string
Key returns the key used in serialization.
func (FeatureType) MarshalText ¶ added in v5.9.0
func (enum FeatureType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (FeatureType) String ¶ added in v5.9.0
func (enum FeatureType) String() string
String implements fmt.Stringer.
func (*FeatureType) UnmarshalText ¶ added in v5.9.0
func (enum *FeatureType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Features ¶ added in v5.9.0
type Features []Feature
Features holds a list of features.
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) (unison.Dockable, error) IsSpecial bool IsGCSData bool IsImage bool IsPDF bool IsExportable 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 Fonts ¶ added in v5.9.0
type Fonts struct {
// contains filtered or unexported fields
}
Fonts holds a set of themed fonts.
func NewFontsFromFS ¶ added in v5.9.0
NewFontsFromFS creates a new set of fonts from a file. Any missing values will be filled in with defaults.
func (*Fonts) MakeCurrent ¶ added in v5.9.0
func (f *Fonts) MakeCurrent()
MakeCurrent applies these fonts to the current theme font set and updates all windows.
func (*Fonts) MarshalJSON ¶ added in v5.9.0
MarshalJSON implements json.Marshaler.
func (*Fonts) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements json.Unmarshaler.
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"` MaximumAutoColWidth int `json:"maximum_auto_col_width"` ImageResolution int `json:"image_resolution"` MonitorResolution int `json:"monitor_resolution,omitempty"` AutoFillProfile bool `json:"auto_fill_profile"` AutoAddNaturalAttacks bool `json:"add_natural_attacks"` GroupContainersOnSort bool `json:"group_containers_on_sort"` }
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 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) 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 HitLocationChoice ¶
HitLocationChoice holds a single hit location choice.
func (*HitLocationChoice) String ¶
func (c *HitLocationChoice) String() string
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"` 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 Length ¶ added in v5.9.0
Length contains a fixed-point value in inches. Conversions to/from metric are done using the simplified Length metric conversion of 1 yd = 1 meter. For consistency, all metric lengths are converted to meters, then to yards, rather than the variations at different lengths that the Length rules suggest.
func LengthFromInteger ¶ added in v5.9.0
func LengthFromInteger[T constraints.Integer](value T, unit LengthUnits) Length
LengthFromInteger creates a new Length.
func LengthFromString ¶ added in v5.9.0
func LengthFromString(text string, defaultUnits LengthUnits) (Length, error)
LengthFromString creates a new Length. May have any of the known Units suffixes, a feet and inches format (e.g. 6'2"), or no notation at all, in which case defaultUnits is used.
func LengthFromStringForced ¶ added in v5.9.0
func LengthFromStringForced(text string, defaultUnits LengthUnits) Length
LengthFromStringForced creates a new Length. May have any of the known Units suffixes, a feet and inches format (e.g. 6'2"), or no notation at all, in which case defaultUnits is used.
func (Length) MarshalJSON ¶ added in v5.9.0
MarshalJSON implements json.Marshaler.
func (*Length) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements json.Unmarshaler.
type LengthUnits ¶ added in v5.9.0
type LengthUnits byte
LengthUnits holds the length unit type. Note that conversions to/from metric are done using the simplified GURPS metric conversion of 1 yd = 1 meter. For consistency, all metric lengths are converted to meters, then to yards, rather than the variations at different lengths that the GURPS rules suggest.
const ( FeetAndInches LengthUnits = iota Inch Feet Yard Mile Centimeter Kilometer Meter LastLengthUnits = Meter )
Possible values.
func ExtractLengthUnits ¶ added in v5.9.0
func ExtractLengthUnits(str string) LengthUnits
ExtractLengthUnits extracts the value from a string.
func (LengthUnits) EnsureValid ¶ added in v5.9.0
func (enum LengthUnits) EnsureValid() LengthUnits
EnsureValid ensures this is of a known value.
func (LengthUnits) Format ¶ added in v5.9.0
func (enum LengthUnits) Format(length Length) string
Format the length for this LengthUnits.
func (LengthUnits) Key ¶ added in v5.9.0
func (enum LengthUnits) Key() string
Key returns the key used in serialization.
func (LengthUnits) MarshalText ¶ added in v5.9.0
func (enum LengthUnits) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (LengthUnits) String ¶ added in v5.9.0
func (enum LengthUnits) String() string
String implements fmt.Stringer.
func (LengthUnits) ToInches ¶ added in v5.9.0
func (enum LengthUnits) ToInches(length fxp.Int) fxp.Int
ToInches converts the length in this LengthUnits to inches.
func (*LengthUnits) UnmarshalText ¶ added in v5.9.0
func (enum *LengthUnits) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Level ¶ added in v5.9.0
Level provides a level & relative level pair, plus a tooltip.
func CalculateRitualMagicSpellLevel ¶
func CalculateRitualMagicSpellLevel(entity *Entity, name, powerSource, ritualSkillName string, ritualPrereqCount int, colleges, tags []string, difficulty AttributeDifficulty, points fxp.Int) Level
CalculateRitualMagicSpellLevel returns the calculated spell level.
func CalculateSkillLevel ¶
func CalculateSkillLevel(entity *Entity, name, specialization string, tags []string, def *SkillDefault, difficulty AttributeDifficulty, points, encumbrancePenaltyMultiplier fxp.Int) Level
CalculateSkillLevel returns the calculated level for a skill.
func CalculateSpellLevel ¶
func CalculateSpellLevel(entity *Entity, name, powerSource string, colleges, tags []string, difficulty AttributeDifficulty, pts fxp.Int) Level
CalculateSpellLevel returns the calculated spell level.
func CalculateTechniqueLevel ¶
func CalculateTechniqueLevel(entity *Entity, name, specialization string, tags []string, def *SkillDefault, difficulty Difficulty, points fxp.Int, requirePoints bool, limitModifier *fxp.Int) 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, what string) string
Format the value.
func (*LeveledAmount) FormatWithLevel ¶ added in v5.9.0
func (l *LeveledAmount) FormatWithLevel(asPercentage bool) string
FormatWithLevel calls Format(asPercentage, "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 NewLibrariesFromFS ¶ added in v5.9.0
NewLibrariesFromFS creates a new set of libraries from a file.
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"` CachedVersion string `json:"-"` // 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) AvailableUpdate ¶ added in v5.9.0
AvailableUpdate returns the available release that can be updated to.
func (*Library) CheckForAvailableUpgrade ¶ added in v5.9.0
CheckForAvailableUpgrade returns releases that can be upgraded to.
func (*Library) ConfigureForKey ¶ added in v5.9.0
ConfigureForKey configures the GitHubAccountName and RepoName from the given key.
func (*Library) Less ¶ added in v5.9.0
Less returns true if this Library should be placed before the other Library.
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 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 NameData ¶ added in v5.9.0
type NameData byte
NameData holds a built-in name data type.
const ( NoneNameData NameData = iota AmericanMaleNameData AmericanFemaleNameData AmericanLastNameData UnweightedAmericanMaleNameData UnweightedAmericanFemaleNameData UnweightedAmericanLastNameData LastNameData = UnweightedAmericanLastNameData )
Possible values.
func ExtractNameData ¶ added in v5.9.0
ExtractNameData extracts the value from a string.
func (NameData) EnsureValid ¶ added in v5.9.0
EnsureValid ensures this is of a known value.
func (NameData) MarshalText ¶ added in v5.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (*NameData) UnmarshalText ¶ added in v5.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
type NameGenerationType ¶ added in v5.9.0
type NameGenerationType byte
NameGenerationType holds a name generation type.
const ( SimpleNameGenerationType NameGenerationType = iota MarkovLetterNameGenerationType MarkovRunNameGenerationType CompoundNameGenerationType LastNameGenerationType = CompoundNameGenerationType )
Possible values.
func ExtractNameGenerationType ¶ added in v5.9.0
func ExtractNameGenerationType(str string) NameGenerationType
ExtractNameGenerationType extracts the value from a string.
func (NameGenerationType) EnsureValid ¶ added in v5.9.0
func (enum NameGenerationType) EnsureValid() NameGenerationType
EnsureValid ensures this is of a known value.
func (NameGenerationType) Key ¶ added in v5.9.0
func (enum NameGenerationType) Key() string
Key returns the key used in serialization.
func (NameGenerationType) MarshalText ¶ added in v5.9.0
func (enum NameGenerationType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (NameGenerationType) String ¶ added in v5.9.0
func (enum NameGenerationType) String() string
String implements fmt.Stringer.
func (*NameGenerationType) UnmarshalText ¶ added in v5.9.0
func (enum *NameGenerationType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type NameGenerator ¶ added in v5.9.0
type NameGenerator struct { Type NameGenerationType `json:"type"` Lower bool `json:"lower,omitempty"` // Only valid for CompoundNameGenerationType Separator string `json:"separator,omitempty"` // Only valid for CompoundNameGenerationType Depth int `json:"depth,omitempty"` // Only valid for MarkovLetterNameGenerationType Compound []*NameGenerator `json:"compound,omitempty"` // Only valid for CompoundNameGenerationType 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 Nameables ¶ added in v5.9.0
type Nameables interface { // FillWithNameableKeys fills the map with nameable keys. FillWithNameableKeys(m map[string]string) // ApplyNameableKeys applies the nameable keys to this object. ApplyNameableKeys(m map[string]string) }
Nameables defines methods types that want to participate the nameable adjustments should implement.
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 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 UUID() uuid.UUID Clone(newEntity *Entity, newParent T, preserveID bool) T OwningEntity() *Entity SetOwningEntity(entity *Entity) Kind() string Container() bool Parent() T SetParent(parent T) HasChildren() bool NodeChildren() []T SetChildren(children []T) Enabled() bool Open() bool SetOpen(open bool) CellData(columnID int, data *CellData) FillWithNameableKeys(m map[string]string) ApplyNameableKeys(m map[string]string) }
Node defines the methods required of nodes in our tables.
type NodeTypes ¶
type NodeTypes interface { *ConditionalModifier | *Equipment | *EquipmentModifier | *Note | *Skill | *Spell | *Trait | *TraitModifier | *Weapon }
NodeTypes is a constraint that defines the types that may be nodes.
type Note ¶
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) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Note) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Note) OwningEntity ¶
OwningEntity returns the owning Entity.
func (*Note) SetOwningEntity ¶
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*Note) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type NoteData ¶
type NoteData struct { ContainerBase[*Note] NoteEditData }
NoteData holds the Note data that is written to disk.
func (*NoteData) ClearUnusedFieldsForType ¶
func (d *NoteData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
type NoteEditData ¶
type NoteEditData struct { Text string `json:"text,omitempty"` PageRef string `json:"reference,omitempty"` }
NoteEditData holds the Note data that can be edited by the UI detail editor.
func (*NoteEditData) ApplyTo ¶
func (d *NoteEditData) ApplyTo(note *Note)
ApplyTo implements node.EditorData.
func (*NoteEditData) CopyFrom ¶
func (d *NoteEditData) CopyFrom(note *Note)
CopyFrom implements node.EditorData.
type NoteListProvider ¶
type NoteListProvider interface { EntityProvider NoteList() []*Note SetNoteList(list []*Note) }
NoteListProvider defines the method needed to access the note list data.
type NumericCompareType ¶ added in v5.9.0
type NumericCompareType string
NumericCompareType holds the type for a numeric comparison.
func (NumericCompareType) AltDescribe ¶ added in v5.9.0
func (n NumericCompareType) AltDescribe(qualifier fxp.Int) string
AltDescribe returns an alternate description of this NumericCompareType using a qualifier.
func (NumericCompareType) AltString ¶ added in v5.9.0
func (n NumericCompareType) AltString() string
AltString returns an alternate string for this.
func (NumericCompareType) Describe ¶ added in v5.9.0
func (n NumericCompareType) Describe(qualifier fxp.Int) string
Describe returns a description of this NumericCompareType using a qualifier.
func (NumericCompareType) EnsureValid ¶ added in v5.9.0
func (n NumericCompareType) EnsureValid() NumericCompareType
EnsureValid ensures this is of a known value.
func (NumericCompareType) Matches ¶ added in v5.9.0
func (n NumericCompareType) Matches(qualifier, data fxp.Int) bool
Matches performs a comparison and returns true if the data matches.
func (NumericCompareType) String ¶ added in v5.9.0
func (n NumericCompareType) String() string
String implements fmt.Stringer.
type NumericCriteria ¶ added in v5.9.0
type NumericCriteria struct {
NumericCriteriaData
}
NumericCriteria holds the criteria for matching a number.
func (NumericCriteria) AltString ¶ added in v5.9.0
func (n NumericCriteria) AltString() string
AltString returns the alternate description.
func (NumericCriteria) Matches ¶ added in v5.9.0
func (n NumericCriteria) Matches(value fxp.Int) bool
Matches performs a comparison and returns true if the data matches.
func (NumericCriteria) ShouldOmit ¶ added in v5.9.0
func (n NumericCriteria) ShouldOmit() bool
ShouldOmit implements json.Omitter.
func (NumericCriteria) String ¶ added in v5.9.0
func (n NumericCriteria) String() string
func (*NumericCriteria) UnmarshalJSON ¶ added in v5.9.0
func (n *NumericCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NumericCriteriaData ¶ added in v5.9.0
type NumericCriteriaData struct { Compare NumericCompareType `json:"compare,omitempty"` Qualifier fxp.Int `json:"qualifier,omitempty"` }
NumericCriteriaData holds the criteria for matching a number that should be written to disk.
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 PaperSize `json:"paper_size"` Orientation PaperOrientation `json:"orientation"` TopMargin PaperLength `json:"top_margin"` LeftMargin PaperLength `json:"left_margin"` BottomMargin PaperLength `json:"bottom_margin"` RightMargin PaperLength `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 *PaperSize Orientation *PaperOrientation TopMargin *PaperLength LeftMargin *PaperLength BottomMargin *PaperLength RightMargin *PaperLength }
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 PaperLength ¶ added in v5.9.0
type PaperLength struct { Length float64 Units PaperUnits }
PaperLength contains a real-world length value with an attached units.
func PaperLengthFromString ¶ added in v5.9.0
func PaperLengthFromString(text string) PaperLength
PaperLengthFromString creates a new PaperLength. May have any of the known unit suffixes or no notation at all, in which case inch is used.
func ParsePaperLengthFromString ¶ added in v5.9.0
func ParsePaperLengthFromString(text string) (length PaperLength, err error)
ParsePaperLengthFromString parses a PaperLength from the text. May have any of the known unit suffixes or no notation at all, in which case inch is used.
func (*PaperLength) EnsureValidity ¶ added in v5.9.0
func (l *PaperLength) EnsureValidity()
EnsureValidity checks the current settings for validity and if they aren't valid, makes them so.
func (PaperLength) MarshalJSON ¶ added in v5.9.0
func (l PaperLength) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (PaperLength) Pixels ¶ added in v5.9.0
func (l PaperLength) Pixels() float32
Pixels returns the number of 72-pixels-per-inch pixels this represents.
func (PaperLength) String ¶ added in v5.9.0
func (l PaperLength) String() string
func (*PaperLength) UnmarshalJSON ¶ added in v5.9.0
func (l *PaperLength) UnmarshalJSON(in []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PaperOrientation ¶ added in v5.9.0
type PaperOrientation byte
PaperOrientation holds the orientation of the page.
const ( Portrait PaperOrientation = iota Landscape LastPaperOrientation = Landscape )
Possible values.
func ExtractPaperOrientation ¶ added in v5.9.0
func ExtractPaperOrientation(str string) PaperOrientation
ExtractPaperOrientation extracts the value from a string.
func (PaperOrientation) Dimensions ¶ added in v5.9.0
func (enum PaperOrientation) Dimensions(width, height PaperLength) (adjustedWidth, adjustedHeight PaperLength)
Dimensions returns the paper dimensions after orienting the paper.
func (PaperOrientation) EnsureValid ¶ added in v5.9.0
func (enum PaperOrientation) EnsureValid() PaperOrientation
EnsureValid ensures this is of a known value.
func (PaperOrientation) Key ¶ added in v5.9.0
func (enum PaperOrientation) Key() string
Key returns the key used in serialization.
func (PaperOrientation) MarshalText ¶ added in v5.9.0
func (enum PaperOrientation) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (PaperOrientation) String ¶ added in v5.9.0
func (enum PaperOrientation) String() string
String implements fmt.Stringer.
func (*PaperOrientation) UnmarshalText ¶ added in v5.9.0
func (enum *PaperOrientation) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type PaperSize ¶ added in v5.9.0
type PaperSize byte
PaperSize holds a standard paper dimension.
const ( LetterPaperSize PaperSize = iota LegalPaperSize TabloidPaperSize A0PaperSize A1PaperSize A2PaperSize A3PaperSize A4PaperSize A5PaperSize A6PaperSize LastPaperSize = A6PaperSize )
Possible values.
func ExtractPaperSize ¶ added in v5.9.0
ExtractPaperSize extracts the value from a string.
func (PaperSize) Dimensions ¶ added in v5.9.0
func (enum PaperSize) Dimensions() (width, height PaperLength)
Dimensions returns the paper dimensions.
func (PaperSize) EnsureValid ¶ added in v5.9.0
EnsureValid ensures this is of a known value.
func (PaperSize) MarshalText ¶ added in v5.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (*PaperSize) UnmarshalText ¶ added in v5.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
type PaperUnits ¶ added in v5.9.0
type PaperUnits byte
PaperUnits holds the real-world length unit type.
const ( InchPaperUnits PaperUnits = iota CentimeterPaperUnits MillimeterPaperUnits LastPaperUnits = MillimeterPaperUnits )
Possible values.
func ExtractPaperUnits ¶ added in v5.9.0
func ExtractPaperUnits(str string) PaperUnits
ExtractPaperUnits extracts the value from a string.
func (PaperUnits) EnsureValid ¶ added in v5.9.0
func (enum PaperUnits) EnsureValid() PaperUnits
EnsureValid ensures this is of a known value.
func (PaperUnits) Key ¶ added in v5.9.0
func (enum PaperUnits) Key() string
Key returns the key used in serialization.
func (PaperUnits) MarshalText ¶ added in v5.9.0
func (enum PaperUnits) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (PaperUnits) String ¶ added in v5.9.0
func (enum PaperUnits) String() string
String implements fmt.Stringer.
func (PaperUnits) ToPixels ¶ added in v5.9.0
func (enum PaperUnits) ToPixels(length float64) float32
ToPixels converts the given length in this PaperUnits to the number of 72-pixels-per-inch pixels it represents.
func (*PaperUnits) UnmarshalText ¶ added in v5.9.0
func (enum *PaperUnits) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type PointsBreakdown ¶ added in v5.9.0
type PointsBreakdown struct { Race 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 ThresholdOp)
AddOp adds the specified ThresholdOp.
func (*PoolThreshold) ContainsOp ¶
func (p *PoolThreshold) ContainsOp(op ThresholdOp) bool
ContainsOp returns true if this PoolThreshold contains the specified ThresholdOp.
func (*PoolThreshold) MarshalJSON ¶
func (p *PoolThreshold) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*PoolThreshold) RemoveOp ¶
func (p *PoolThreshold) RemoveOp(op ThresholdOp)
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 []ThresholdOp `json:"ops,omitempty"` }
PoolThresholdData holds the data that will be serialized for the PoolThreshold.
type Prereq ¶
type Prereq interface { Nameables PrereqType() PrereqType // 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 }
Prereq holds data necessary to track a prerequisite.
type PrereqList ¶
type PrereqList struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` All bool `json:"all"` WhenTL NumericCriteria `json:"when_tl,omitempty"` Prereqs Prereqs `json:"prereqs,omitempty"` }
PrereqList holds a prereq that contains a list of prerequisites.
func (*PrereqList) ApplyNameableKeys ¶
func (p *PrereqList) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Prereq.
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 map[string]string)
FillWithNameableKeys implements Prereq.
func (*PrereqList) ParentList ¶
func (p *PrereqList) ParentList() *PrereqList
ParentList implements Prereq.
func (*PrereqList) PrereqType ¶
func (p *PrereqList) PrereqType() PrereqType
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 PrereqType ¶ added in v5.9.0
type PrereqType byte
PrereqType holds the type of a Prereq.
const ( ListPrereqType PrereqType = iota TraitPrereqType AttributePrereqType ContainedQuantityPrereqType ContainedWeightPrereqType EquippedEquipmentPrereqType SkillPrereqType SpellPrereqType LastPrereqType = SpellPrereqType )
Possible values.
func ExtractPrereqType ¶ added in v5.9.0
func ExtractPrereqType(str string) PrereqType
ExtractPrereqType extracts the value from a string.
func (PrereqType) EnsureValid ¶ added in v5.9.0
func (enum PrereqType) EnsureValid() PrereqType
EnsureValid ensures this is of a known value.
func (PrereqType) Key ¶ added in v5.9.0
func (enum PrereqType) Key() string
Key returns the key used in serialization.
func (PrereqType) MarshalText ¶ added in v5.9.0
func (enum PrereqType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (PrereqType) String ¶ added in v5.9.0
func (enum PrereqType) String() string
String implements fmt.Stringer.
func (*PrereqType) UnmarshalText ¶ added in v5.9.0
func (enum *PrereqType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
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 { PlayerName string `json:"player_name,omitempty"` Name string `json:"name,omitempty"` Title string `json:"title,omitempty"` Organization string `json:"organization,omitempty"` Religion string `json:"religion,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"` TechLevel string `json:"tech_level,omitempty"` PortraitData []byte `json:"portrait,omitempty"` PortraitImage *unison.Image `json:"-"` Height Length `json:"height,omitempty"` Weight Weight `json:"weight,omitempty"` 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) SetAdjustedSizeModifier ¶
SetAdjustedSizeModifier sets the adjusted size modifier.
type QuickExports ¶
type QuickExports struct {
QuickExportsData
}
QuickExports holds a list containing information about previous exports.
func NewQuickExports ¶
func NewQuickExports() *QuickExports
NewQuickExports creates a new, empty, QuickExports object.
func (*QuickExports) MarshalJSON ¶
func (q *QuickExports) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*QuickExports) UnmarshalJSON ¶
func (q *QuickExports) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type QuickExportsData ¶
type QuickExportsData struct { Max int `json:"max"` Exports []*ExportInfo `json:"exports,omitempty"` }
QuickExportsData holds the QuickExports data that is written to disk.
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 FeatureType `json:"type"` Situation string `json:"situation,omitempty"` LeveledAmount // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
func (r *ReactionBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*ReactionBonus) FillWithNameableKeys ¶ added in v5.9.0
func (r *ReactionBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*ReactionBonus) Owner ¶ added in v5.9.0
func (r *ReactionBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*ReactionBonus) SetLevel ¶ added in v5.9.0
func (r *ReactionBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*ReactionBonus) SetOwner ¶ added in v5.9.0
func (r *ReactionBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type ReactionModifierListProvider ¶
type ReactionModifierListProvider interface { EntityProvider Reactions() []*ConditionalModifier }
ReactionModifierListProvider defines the method 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 SelfControlRoll ¶ added in v5.9.0
type SelfControlRoll int
SelfControlRoll holds the information about a self-control roll, from B121.
func (SelfControlRoll) DescriptionWithCost ¶ added in v5.9.0
func (s SelfControlRoll) DescriptionWithCost() string
DescriptionWithCost returns a formatted description that includes the cost multiplier.
func (SelfControlRoll) EnsureValid ¶ added in v5.9.0
func (s SelfControlRoll) EnsureValid() SelfControlRoll
EnsureValid ensures this is of a known value.
func (SelfControlRoll) Index ¶ added in v5.9.0
func (s SelfControlRoll) Index() int
Index returns of the SelfControlRoll within AllSelfControlRolls.
func (SelfControlRoll) MinimumRoll ¶ added in v5.9.0
func (s SelfControlRoll) MinimumRoll() int
MinimumRoll returns the minimum roll to retain control.
func (SelfControlRoll) Multiplier ¶ added in v5.9.0
func (s SelfControlRoll) Multiplier() fxp.Int
Multiplier returns the cost multiplier.
func (SelfControlRoll) String ¶ added in v5.9.0
func (s SelfControlRoll) String() string
String implements fmt.Stringer.
type SelfControlRollAdj ¶
type SelfControlRollAdj byte
SelfControlRollAdj holds an Adjustment for a self-control roll.
const ( NoCRAdj SelfControlRollAdj = iota ActionPenalty ReactionPenalty FrightCheckPenalty FrightCheckBonus MinorCostOfLivingIncrease MajorCostOfLivingIncrease LastSelfControlRollAdj = MajorCostOfLivingIncrease )
Possible values.
func ExtractSelfControlRollAdj ¶
func ExtractSelfControlRollAdj(str string) SelfControlRollAdj
ExtractSelfControlRollAdj extracts the value from a string.
func (SelfControlRollAdj) Adjustment ¶
func (enum SelfControlRollAdj) Adjustment(cr SelfControlRoll) int
Adjustment returns the adjustment amount.
func (SelfControlRollAdj) AltString ¶
func (enum SelfControlRollAdj) AltString() string
AltString returns the alternate string.
func (SelfControlRollAdj) Description ¶
func (enum SelfControlRollAdj) Description(cr SelfControlRoll) string
Description returns a formatted description.
func (SelfControlRollAdj) EnsureValid ¶
func (enum SelfControlRollAdj) EnsureValid() SelfControlRollAdj
EnsureValid ensures this is of a known value.
func (SelfControlRollAdj) Features ¶
func (enum SelfControlRollAdj) Features(cr SelfControlRoll) Features
Features returns the set of features to apply.
func (SelfControlRollAdj) Key ¶
func (enum SelfControlRollAdj) Key() string
Key returns the key used in serialization.
func (SelfControlRollAdj) MarshalText ¶
func (enum SelfControlRollAdj) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (SelfControlRollAdj) String ¶
func (enum SelfControlRollAdj) String() string
String implements fmt.Stringer.
func (*SelfControlRollAdj) UnmarshalText ¶
func (enum *SelfControlRollAdj) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
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"` RecentFiles []string `json:"recent_files,omitempty"` LastDirs map[string]string `json:"last_dirs,omitempty"` PageRefs PageRefs `json:"page_refs,omitempty"` KeyBindings KeyBindings `json:"key_bindings,omitempty"` WorkspaceFrame *unison.Rect `json:"workspace_frame,omitempty"` Colors Colors `json:"colors"` Fonts Fonts `json:"fonts"` QuickExports *QuickExports `json:"quick_exports,omitempty"` Sheet *SheetSettings `json:"sheet_settings,omitempty"` OpenInWindow []DockableGroup `json:"open_in_window,omitempty"` ColorMode unison.ColorMode `json:"color_mode"` }
Settings holds the application settings.
func DefaultSettings ¶ added in v5.9.0
func DefaultSettings() *Settings
DefaultSettings returns new default 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 DamageProgression `json:"damage_progression"` DefaultLengthUnits LengthUnits `json:"default_length_units"` DefaultWeightUnits WeightUnits `json:"default_weight_units"` UserDescriptionDisplay DisplayOption `json:"user_description_display"` ModifiersDisplay DisplayOption `json:"modifiers_display"` NotesDisplay DisplayOption `json:"notes_display"` SkillLevelAdjDisplay DisplayOption `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"` 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 ¶
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) 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) 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) HasDefaultTo ¶
HasDefaultTo returns true if the set of possible defaults includes the other skill.
func (*Skill) IncrementSkillLevel ¶
func (s *Skill) IncrementSkillLevel()
IncrementSkillLevel adds enough points to increment the skill level to the next level.
func (*Skill) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Skill) ModifierNotes ¶
ModifierNotes returns the notes due to modifiers.
func (*Skill) OwningEntity ¶
OwningEntity returns the owning Entity.
func (*Skill) RelativeLevel ¶
RelativeLevel returns the adjusted relative level as a string.
func (*Skill) RequiresTL ¶
RequiresTL implements TechLevelProvider.
func (*Skill) SecondaryText ¶
func (s *Skill) SecondaryText(optionChecker func(DisplayOption) bool) string
SecondaryText returns the less important information that should be displayed with the description.
func (*Skill) SetOwningEntity ¶
SetOwningEntity sets the owning entity 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) SwapDefaults ¶
func (s *Skill) SwapDefaults()
SwapDefaults causes this skill's default to be swapped.
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 FeatureType `json:"type"` SelectionType SkillSelectionType `json:"selection_type"` NameCriteria StringCriteria `json:"name,omitempty"` SpecializationCriteria StringCriteria `json:"specialization,omitempty"` TagsCriteria StringCriteria `json:"tags,alt=category,omitempty"` LeveledAmount // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
func (s *SkillBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*SkillBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SkillBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*SkillBonus) Owner ¶ added in v5.9.0
func (s *SkillBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*SkillBonus) SetLevel ¶ added in v5.9.0
func (s *SkillBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*SkillBonus) SetOwner ¶ added in v5.9.0
func (s *SkillBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type SkillData ¶
type SkillData struct { ContainerBase[*Skill] SkillEditData }
SkillData holds the Skill data that is written to disk.
func (*SkillData) ClearUnusedFieldsForType ¶
func (d *SkillData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
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) ApplyNameableKeys ¶
func (s *SkillDefault) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys replaces any nameable keys found in this SkillDefault with the corresponding values in the provided map.
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(other *SkillDefault) bool
Equivalent returns true if this can be considered equivalent to other.
func (*SkillDefault) FillWithNameableKeys ¶
func (s *SkillDefault) FillWithNameableKeys(m 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) string
FullName returns the full name of the skill to default from.
func (*SkillDefault) ModifierAsString ¶
func (s *SkillDefault) ModifierAsString() string
ModifierAsString returns the modifier as a string suitable for appending.
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, 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, requirePoints bool, excludes map[string]bool, ruleOf20 bool) fxp.Int
SkillLevelFast returns the base skill level for this SkillDefault.
func (*SkillDefault) Type ¶
func (s *SkillDefault) Type() string
Type returns the type of the SkillDefault.
type SkillEditData ¶
type SkillEditData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` LocalNotes string `json:"notes,omitempty"` VTTNotes string `json:"vtt_notes,omitempty"` Tags []string `json:"tags,omitempty"` Specialization string `json:"specialization,omitempty"` // Non-container only TechLevel *string `json:"tech_level,omitempty"` // Non-container only Difficulty AttributeDifficulty `json:"difficulty,omitempty"` // Non-container only Points fxp.Int `json:"points,omitempty"` // Non-container only EncumbrancePenaltyMultiplier fxp.Int `json:"encumbrance_penalty_multiplier,omitempty"` // Non-container only DefaultedFrom *SkillDefault `json:"defaulted_from,omitempty"` // Non-container only Defaults []*SkillDefault `json:"defaults,omitempty"` // Non-container only TechniqueDefault *SkillDefault `json:"default,omitempty"` // Non-container only TechniqueLimitModifier *fxp.Int `json:"limit,omitempty"` // Non-container only Prereq *PrereqList `json:"prereqs,omitempty"` // Non-container only Weapons []*Weapon `json:"weapons,omitempty"` // Non-container only Features Features `json:"features,omitempty"` // Non-container only Study []*Study `json:"study,omitempty"` // Non-container only TemplatePicker *TemplatePicker `json:"template_picker,omitempty"` // Container only }
SkillEditData holds the Skill data that can be edited by the UI detail editor.
func (*SkillEditData) ApplyTo ¶
func (d *SkillEditData) ApplyTo(s *Skill)
ApplyTo implements node.EditorData.
func (*SkillEditData) CopyFrom ¶
func (d *SkillEditData) CopyFrom(s *Skill)
CopyFrom implements node.EditorData.
type SkillListProvider ¶
type SkillListProvider interface { EntityProvider SkillList() []*Skill SetSkillList(list []*Skill) }
SkillListProvider defines the method needed to access the skill list data.
type SkillPointBonus ¶ added in v5.9.0
type SkillPointBonus struct { Type FeatureType `json:"type"` NameCriteria StringCriteria `json:"name,omitempty"` SpecializationCriteria StringCriteria `json:"specialization,omitempty"` TagsCriteria StringCriteria `json:"tags,alt=category,omitempty"` LeveledAmount // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
func (s *SkillPointBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*SkillPointBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SkillPointBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*SkillPointBonus) Owner ¶ added in v5.9.0
func (s *SkillPointBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*SkillPointBonus) SetLevel ¶ added in v5.9.0
func (s *SkillPointBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*SkillPointBonus) SetOwner ¶ added in v5.9.0
func (s *SkillPointBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type SkillPrereq ¶
type SkillPrereq struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` Has bool `json:"has"` NameCriteria StringCriteria `json:"name,omitempty"` LevelCriteria NumericCriteria `json:"level,omitempty"` SpecializationCriteria StringCriteria `json:"specialization,omitempty"` }
SkillPrereq holds a prerequisite for a skill.
func (*SkillPrereq) ApplyNameableKeys ¶
func (s *SkillPrereq) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Prereq.
func (*SkillPrereq) Clone ¶
func (s *SkillPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*SkillPrereq) FillWithNameableKeys ¶
func (s *SkillPrereq) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Prereq.
func (*SkillPrereq) ParentList ¶
func (s *SkillPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*SkillPrereq) PrereqType ¶
func (s *SkillPrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*SkillPrereq) Satisfied ¶
func (s *SkillPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type SkillSelectionType ¶ added in v5.9.0
type SkillSelectionType byte
SkillSelectionType holds the type of a selection.
const ( NameSkillSelectionType SkillSelectionType = iota ThisWeaponSkillSelectionType WeaponsWithNameSkillSelectionType LastSkillSelectionType = WeaponsWithNameSkillSelectionType )
Possible values.
func ExtractSkillSelectionType ¶ added in v5.9.0
func ExtractSkillSelectionType(str string) SkillSelectionType
ExtractSkillSelectionType extracts the value from a string.
func (SkillSelectionType) EnsureValid ¶ added in v5.9.0
func (enum SkillSelectionType) EnsureValid() SkillSelectionType
EnsureValid ensures this is of a known value.
func (SkillSelectionType) Key ¶ added in v5.9.0
func (enum SkillSelectionType) Key() string
Key returns the key used in serialization.
func (SkillSelectionType) MarshalText ¶ added in v5.9.0
func (enum SkillSelectionType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (SkillSelectionType) String ¶ added in v5.9.0
func (enum SkillSelectionType) String() string
String implements fmt.Stringer.
func (*SkillSelectionType) UnmarshalText ¶ added in v5.9.0
func (enum *SkillSelectionType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Spell ¶
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) 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) FeatureList ¶
FeatureList returns the list of Features.
func (*Spell) FillWithNameableKeys ¶
FillWithNameableKeys adds any nameable keys found to the provided map.
func (*Spell) IncrementSkillLevel ¶
func (s *Spell) IncrementSkillLevel()
IncrementSkillLevel adds enough points to increment the skill level to the next level.
func (*Spell) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Spell) OwningEntity ¶
OwningEntity returns the owning Entity.
func (*Spell) RelativeLevel ¶
RelativeLevel returns the adjusted relative level as a string.
func (*Spell) RequiresTL ¶
RequiresTL implements TechLevelProvider.
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) SecondaryText ¶
func (s *Spell) SecondaryText(optionChecker func(DisplayOption) bool) string
SecondaryText returns the less important information that should be displayed with the description.
func (*Spell) SetOwningEntity ¶
SetOwningEntity sets the owning entity 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) 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 FeatureType `json:"type"` SpellMatchType SpellMatchType `json:"match"` NameCriteria StringCriteria `json:"name,omitempty"` TagsCriteria StringCriteria `json:"tags,alt=category,omitempty"` LeveledAmount // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
func (s *SpellBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*SpellBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SpellBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*SpellBonus) MatchForType ¶ added in v5.9.0
func (s *SpellBonus) MatchForType(name, powerSource string, colleges []string) bool
MatchForType returns true if this spell bonus matches the data for its match type.
func (*SpellBonus) Owner ¶ added in v5.9.0
func (s *SpellBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*SpellBonus) SetLevel ¶ added in v5.9.0
func (s *SpellBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*SpellBonus) SetOwner ¶ added in v5.9.0
func (s *SpellBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type SpellComparisonType ¶ added in v5.9.0
type SpellComparisonType byte
SpellComparisonType holds the type of a comparison.
const ( NameSpellComparisonType SpellComparisonType = iota TagSpellComparisonType CollegeSpellComparisonType CollegeCountSpellComparisonType AnySpellComparisonType LastSpellComparisonType = AnySpellComparisonType )
Possible values.
func ExtractSpellComparisonType ¶ added in v5.9.0
func ExtractSpellComparisonType(str string) SpellComparisonType
ExtractSpellComparisonType extracts the value from a string.
func (SpellComparisonType) EnsureValid ¶ added in v5.9.0
func (enum SpellComparisonType) EnsureValid() SpellComparisonType
EnsureValid ensures this is of a known value.
func (SpellComparisonType) Key ¶ added in v5.9.0
func (enum SpellComparisonType) Key() string
Key returns the key used in serialization.
func (SpellComparisonType) MarshalText ¶ added in v5.9.0
func (enum SpellComparisonType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (SpellComparisonType) String ¶ added in v5.9.0
func (enum SpellComparisonType) String() string
String implements fmt.Stringer.
func (*SpellComparisonType) UnmarshalText ¶ added in v5.9.0
func (enum *SpellComparisonType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (SpellComparisonType) UsesStringCriteria ¶ added in v5.9.0
func (enum SpellComparisonType) UsesStringCriteria() bool
UsesStringCriteria returns true if the comparison uses a string value.
type SpellData ¶
type SpellData struct { ContainerBase[*Spell] SpellEditData }
SpellData holds the Spell data that is written to disk.
func (*SpellData) ClearUnusedFieldsForType ¶
func (d *SpellData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
type SpellEditData ¶
type SpellEditData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` LocalNotes string `json:"notes,omitempty"` VTTNotes string `json:"vtt_notes,omitempty"` Tags []string `json:"tags,omitempty"` TechLevel *string `json:"tech_level,omitempty"` // Non-container only Difficulty AttributeDifficulty `json:"difficulty,omitempty"` // Non-container only College CollegeList `json:"college,omitempty"` // Non-container only PowerSource string `json:"power_source,omitempty"` // Non-container only Class string `json:"spell_class,omitempty"` // Non-container only Resist string `json:"resist,omitempty"` // Non-container only CastingCost string `json:"casting_cost,omitempty"` // Non-container only MaintenanceCost string `json:"maintenance_cost,omitempty"` // Non-container only CastingTime string `json:"casting_time,omitempty"` // Non-container only Duration string `json:"duration,omitempty"` // Non-container only RitualSkillName string `json:"base_skill,omitempty"` // Non-container only RitualPrereqCount int `json:"prereq_count,omitempty"` // Non-container only Points fxp.Int `json:"points,omitempty"` // Non-container only Prereq *PrereqList `json:"prereqs,omitempty"` // Non-container only Weapons []*Weapon `json:"weapons,omitempty"` // Non-container only Study []*Study `json:"study,omitempty"` // Non-container only TemplatePicker *TemplatePicker `json:"template_picker,omitempty"` // Container only }
SpellEditData holds the Spell data that can be edited by the UI detail editor.
func (*SpellEditData) ApplyTo ¶
func (d *SpellEditData) ApplyTo(s *Spell)
ApplyTo implements node.EditorData.
func (*SpellEditData) CopyFrom ¶
func (d *SpellEditData) CopyFrom(s *Spell)
CopyFrom implements node.EditorData.
type SpellListProvider ¶
type SpellListProvider interface { EntityProvider SpellList() []*Spell SetSpellList(list []*Spell) }
SpellListProvider defines the method needed to access the spell list data.
type SpellMatchType ¶ added in v5.9.0
type SpellMatchType byte
SpellMatchType holds the type of a match.
const ( AllCollegesSpellMatchType SpellMatchType = iota CollegeNameSpellMatchType PowerSourceSpellMatchType NameSpellMatchType LastSpellMatchType = NameSpellMatchType )
Possible values.
func ExtractSpellMatchType ¶ added in v5.9.0
func ExtractSpellMatchType(str string) SpellMatchType
ExtractSpellMatchType extracts the value from a string.
func (SpellMatchType) EnsureValid ¶ added in v5.9.0
func (enum SpellMatchType) EnsureValid() SpellMatchType
EnsureValid ensures this is of a known value.
func (SpellMatchType) Key ¶ added in v5.9.0
func (enum SpellMatchType) Key() string
Key returns the key used in serialization.
func (SpellMatchType) MarshalText ¶ added in v5.9.0
func (enum SpellMatchType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (SpellMatchType) MatchForType ¶ added in v5.9.0
func (enum SpellMatchType) MatchForType(matcher StringCriteria, name, powerSource string, colleges []string) bool
MatchForType applies the matcher and returns the result.
func (SpellMatchType) String ¶ added in v5.9.0
func (enum SpellMatchType) String() string
String implements fmt.Stringer.
func (*SpellMatchType) UnmarshalText ¶ added in v5.9.0
func (enum *SpellMatchType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type SpellPointBonus ¶ added in v5.9.0
type SpellPointBonus struct { Type FeatureType `json:"type"` SpellMatchType SpellMatchType `json:"match"` NameCriteria StringCriteria `json:"name,omitempty"` TagsCriteria StringCriteria `json:"tags,alt=category,omitempty"` LeveledAmount // contains filtered or unexported fields }
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) ApplyNameableKeys ¶ added in v5.9.0
func (s *SpellPointBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*SpellPointBonus) FillWithNameableKeys ¶ added in v5.9.0
func (s *SpellPointBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*SpellPointBonus) MatchForType ¶ added in v5.9.0
func (s *SpellPointBonus) MatchForType(name, powerSource string, colleges []string) bool
MatchForType returns true if this spell bonus matches the data for its match type.
func (*SpellPointBonus) Owner ¶ added in v5.9.0
func (s *SpellPointBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*SpellPointBonus) SetLevel ¶ added in v5.9.0
func (s *SpellPointBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*SpellPointBonus) SetOwner ¶ added in v5.9.0
func (s *SpellPointBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type SpellPrereq ¶
type SpellPrereq struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` SubType SpellComparisonType `json:"sub_type"` Has bool `json:"has"` QualifierCriteria StringCriteria `json:"qualifier,omitempty"` QuantityCriteria NumericCriteria `json:"quantity,omitempty"` }
SpellPrereq holds a prerequisite for a spell.
func (*SpellPrereq) ApplyNameableKeys ¶
func (s *SpellPrereq) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Prereq.
func (*SpellPrereq) Clone ¶
func (s *SpellPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*SpellPrereq) FillWithNameableKeys ¶
func (s *SpellPrereq) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Prereq.
func (*SpellPrereq) ParentList ¶
func (s *SpellPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*SpellPrereq) PrereqType ¶
func (s *SpellPrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*SpellPrereq) Satisfied ¶
func (s *SpellPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type StrengthDamage ¶ added in v5.9.0
type StrengthDamage byte
StrengthDamage holds the type of strength dice to add to damage.
const ( NoneStrengthDamage StrengthDamage = iota ThrustStrengthDamage LeveledThrustStrengthDamage SwingStrengthDamage LeveledSwingStrengthDamage LastStrengthDamage = LeveledSwingStrengthDamage )
Possible values.
func ExtractStrengthDamage ¶ added in v5.9.0
func ExtractStrengthDamage(str string) StrengthDamage
ExtractStrengthDamage extracts the value from a string.
func (StrengthDamage) EnsureValid ¶ added in v5.9.0
func (enum StrengthDamage) EnsureValid() StrengthDamage
EnsureValid ensures this is of a known value.
func (StrengthDamage) Key ¶ added in v5.9.0
func (enum StrengthDamage) Key() string
Key returns the key used in serialization.
func (StrengthDamage) MarshalText ¶ added in v5.9.0
func (enum StrengthDamage) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (StrengthDamage) String ¶ added in v5.9.0
func (enum StrengthDamage) String() string
String implements fmt.Stringer.
func (*StrengthDamage) UnmarshalText ¶ added in v5.9.0
func (enum *StrengthDamage) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type StringCompareType ¶ added in v5.9.0
type StringCompareType string
StringCompareType holds the type for a string comparison.
func (StringCompareType) AltString ¶ added in v5.9.0
func (s StringCompareType) AltString() string
AltString provides a variant of String() for the not cases.
func (StringCompareType) Describe ¶ added in v5.9.0
func (s StringCompareType) Describe(qualifier string) string
Describe returns a description of this StringCompareType using a qualifier.
func (StringCompareType) EnsureValid ¶ added in v5.9.0
func (s StringCompareType) EnsureValid() StringCompareType
EnsureValid ensures this is of a known value.
func (StringCompareType) Matches ¶ added in v5.9.0
func (s StringCompareType) Matches(qualifier, data string) bool
Matches performs a comparison and returns true if the data matches.
func (StringCompareType) String ¶ added in v5.9.0
func (s StringCompareType) String() string
String implements fmt.Stringer.
type StringCriteria ¶ added in v5.9.0
type StringCriteria struct {
StringCriteriaData
}
StringCriteria holds the criteria for matching a string.
func (StringCriteria) Matches ¶ added in v5.9.0
func (s StringCriteria) Matches(value string) bool
Matches performs a comparison and returns true if the data matches.
func (StringCriteria) MatchesList ¶ added in v5.9.0
func (s StringCriteria) MatchesList(value ...string) bool
MatchesList performs a comparison and returns true if the data matches.
func (StringCriteria) ShouldOmit ¶ added in v5.9.0
func (s StringCriteria) ShouldOmit() bool
ShouldOmit implements json.Omitter.
func (StringCriteria) String ¶ added in v5.9.0
func (s StringCriteria) String() string
func (*StringCriteria) UnmarshalJSON ¶ added in v5.9.0
func (s *StringCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type StringCriteriaData ¶ added in v5.9.0
type StringCriteriaData struct { Compare StringCompareType `json:"compare,omitempty"` Qualifier string `json:"qualifier,omitempty"` }
StringCriteriaData holds the criteria for matching a string that should be written to disk.
type Study ¶ added in v5.3.0
type Study struct { Type StudyType `json:"type"` Hours fxp.Int `json:"hours"` Note string `json:"note,omitempty"` }
Study holds data about a single study session.
type StudyType ¶ added in v5.3.0
type StudyType byte
StudyType holds the type of study.
const ( SelfStudyType StudyType = iota JobStudyType TeacherStudyType IntensiveStudyType LastStudyType = IntensiveStudyType )
Possible values.
func ExtractStudyType ¶ added in v5.3.0
ExtractStudyType extracts the value from a string.
func (StudyType) EnsureValid ¶ added in v5.3.0
EnsureValid ensures this is of a known value.
func (StudyType) Limitations ¶ added in v5.3.0
Limitations returns a list of strings describing the limitations when doing this type of study.
func (StudyType) MarshalText ¶ added in v5.3.0
MarshalText implements the encoding.TextMarshaler interface.
func (StudyType) Multiplier ¶ added in v5.3.0
Multiplier returns the amount to multiply hours spent by for effective study hours.
func (*StudyType) UnmarshalText ¶ added in v5.3.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
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 { Type string `json:"type"` Version int `json:"version"` ID uuid.UUID `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"` }
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) OtherEquipmentList ¶
OtherEquipmentList implements ListProvider
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
type TemplatePicker ¶ added in v5.3.0
type TemplatePicker struct { Type TemplatePickerType `json:"type"` Qualifier NumericCriteria `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) 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 TemplatePickerType ¶ added in v5.3.0
type TemplatePickerType byte
TemplatePickerType holds the type of template picker.
const ( NotApplicableTemplatePickerType TemplatePickerType = iota CountTemplatePickerType PointsTemplatePickerType LastTemplatePickerType = PointsTemplatePickerType )
Possible values.
func ExtractTemplatePickerType ¶ added in v5.3.0
func ExtractTemplatePickerType(str string) TemplatePickerType
ExtractTemplatePickerType extracts the value from a string.
func (TemplatePickerType) EnsureValid ¶ added in v5.3.0
func (enum TemplatePickerType) EnsureValid() TemplatePickerType
EnsureValid ensures this is of a known value.
func (TemplatePickerType) Key ¶ added in v5.3.0
func (enum TemplatePickerType) Key() string
Key returns the key used in serialization.
func (TemplatePickerType) MarshalText ¶ added in v5.3.0
func (enum TemplatePickerType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (TemplatePickerType) String ¶ added in v5.3.0
func (enum TemplatePickerType) String() string
String implements fmt.Stringer.
func (*TemplatePickerType) UnmarshalText ¶ added in v5.3.0
func (enum *TemplatePickerType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type ThemedColor ¶ added in v5.9.0
type ThemedColor struct { ID string Title string Color *unison.ThemeColor }
ThemedColor holds a themed color.
func CurrentColors ¶ added in v5.9.0
func CurrentColors() []*ThemedColor
CurrentColors returns the current theme.
func FactoryColors ¶ added in v5.9.0
func FactoryColors() []*ThemedColor
FactoryColors returns the original theme before any modifications.
type ThemedFont ¶ added in v5.9.0
type ThemedFont struct { ID string Title string Font *unison.IndirectFont }
ThemedFont holds a themed font.
func CurrentFonts ¶ added in v5.9.0
func CurrentFonts() []*ThemedFont
CurrentFonts returns the current theme fonts.
func FactoryFonts ¶ added in v5.9.0
func FactoryFonts() []*ThemedFont
FactoryFonts returns the original theme before any modifications.
type ThresholdOp ¶ added in v5.9.0
type ThresholdOp byte
ThresholdOp holds an operation to apply when a pool threshold is hit.
const ( UnknownThresholdOp ThresholdOp = iota HalveMoveThresholdOp HalveDodgeThresholdOp HalveSTThresholdOp LastThresholdOp = HalveSTThresholdOp )
Possible values.
func ExtractThresholdOp ¶ added in v5.9.0
func ExtractThresholdOp(str string) ThresholdOp
ExtractThresholdOp extracts the value from a string.
func (ThresholdOp) AltString ¶ added in v5.9.0
func (enum ThresholdOp) AltString() string
AltString returns the alternate string.
func (ThresholdOp) EnsureValid ¶ added in v5.9.0
func (enum ThresholdOp) EnsureValid() ThresholdOp
EnsureValid ensures this is of a known value.
func (ThresholdOp) Key ¶ added in v5.9.0
func (enum ThresholdOp) Key() string
Key returns the key used in serialization.
func (ThresholdOp) MarshalText ¶ added in v5.9.0
func (enum ThresholdOp) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (ThresholdOp) String ¶ added in v5.9.0
func (enum ThresholdOp) String() string
String implements fmt.Stringer.
func (*ThresholdOp) UnmarshalText ¶ added in v5.9.0
func (enum *ThresholdOp) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type TrainingData ¶ added in v5.9.0
type TrainingData struct { BuiltIn NameData `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 CompoundNameGenerationType. 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 NewNaturalAttacks ¶
NewNaturalAttacks creates a new "Natural Attacks" trait.
func NewTraitsFromFile ¶
NewTraitsFromFile loads an Trait list from a file.
func (*Trait) ActiveModifierFor ¶
func (a *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 (a *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) 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) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Trait) ModifierNotes ¶
ModifierNotes returns the notes due to modifiers.
func (*Trait) OwningEntity ¶
OwningEntity returns the owning Entity.
func (*Trait) SecondaryText ¶
func (a *Trait) SecondaryText(optionChecker func(DisplayOption) bool) string
SecondaryText returns the "secondary" text: the text display below an Trait.
func (*Trait) SetOwningEntity ¶
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*Trait) TemplatePickerData ¶ added in v5.3.0
func (a *Trait) TemplatePickerData() *TemplatePicker
TemplatePickerData returns the TemplatePicker data, if any.
func (*Trait) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type TraitData ¶
type TraitData struct { ContainerBase[*Trait] TraitEditData }
TraitData holds the Trait data that is written to disk.
func (*TraitData) ClearUnusedFieldsForType ¶
func (d *TraitData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
type TraitEditData ¶
type TraitEditData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` LocalNotes string `json:"notes,omitempty"` VTTNotes string `json:"vtt_notes,omitempty"` Ancestry string `json:"ancestry,omitempty"` // Container only UserDesc string `json:"userdesc,omitempty"` Tags []string `json:"tags,omitempty"` Modifiers []*TraitModifier `json:"modifiers,omitempty"` BasePoints fxp.Int `json:"base_points,omitempty"` // Non-container only Levels fxp.Int `json:"levels,omitempty"` // Non-container only PointsPerLevel fxp.Int `json:"points_per_level,omitempty"` // Non-container only Prereq *PrereqList `json:"prereqs,omitempty"` // Non-container only Weapons []*Weapon `json:"weapons,omitempty"` // Non-container only Features Features `json:"features,omitempty"` // Non-container only Study []*Study `json:"study,omitempty"` // Non-container only TemplatePicker *TemplatePicker `json:"template_picker,omitempty"` // Container only CR SelfControlRoll `json:"cr,omitempty"` CRAdj SelfControlRollAdj `json:"cr_adj,omitempty"` ContainerType ContainerType `json:"container_type,omitempty"` // Container only Disabled bool `json:"disabled,omitempty"` RoundCostDown bool `json:"round_down,omitempty"` // Non-container only CanLevel bool `json:"can_level,omitempty"` // Non-container only }
TraitEditData holds the Trait data that can be edited by the UI detail editor.
func (*TraitEditData) ApplyTo ¶
func (d *TraitEditData) ApplyTo(t *Trait)
ApplyTo implements node.EditorData.
func (*TraitEditData) CopyFrom ¶
func (d *TraitEditData) CopyFrom(t *Trait)
CopyFrom implements node.EditorData.
type TraitListProvider ¶
type TraitListProvider interface { EntityProvider TraitList() []*Trait SetTraitList(list []*Trait) }
TraitListProvider defines the method needed to access the trait list data.
type TraitModifier ¶
type TraitModifier struct { TraitModifierData Entity *Entity }
TraitModifier holds a modifier to an Trait.
func NewTraitModifier ¶
func NewTraitModifier(entity *Entity, 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 (m *TraitModifier) ApplyNameableKeys(keyMap map[string]string)
ApplyNameableKeys replaces any nameable keys found in this TraitModifier with the corresponding values in the provided map.
func (*TraitModifier) CellData ¶
func (m *TraitModifier) CellData(columnID int, data *CellData)
CellData returns the cell data information for the given column.
func (*TraitModifier) Clone ¶
func (m *TraitModifier) Clone(entity *Entity, parent *TraitModifier, preserveID bool) *TraitModifier
Clone implements Node.
func (*TraitModifier) CostDescription ¶
func (m *TraitModifier) CostDescription() string
CostDescription returns the formatted cost.
func (*TraitModifier) CostModifier ¶
func (m *TraitModifier) CostModifier() fxp.Int
CostModifier returns the total cost modifier.
func (*TraitModifier) Depth ¶
func (m *TraitModifier) Depth() int
Depth returns the number of parents this node has.
func (*TraitModifier) Enabled ¶
func (m *TraitModifier) Enabled() bool
Enabled returns true if this node is enabled.
func (*TraitModifier) FillWithNameableKeys ¶
func (m *TraitModifier) FillWithNameableKeys(keyMap 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 (m *TraitModifier) FullCostDescription() string
FullCostDescription is the same as CostDescription().
func (*TraitModifier) FullDescription ¶
func (m *TraitModifier) FullDescription() string
FullDescription returns a full description.
func (*TraitModifier) HasLevels ¶
func (m *TraitModifier) HasLevels() bool
HasLevels returns true if this TraitModifier has levels.
func (*TraitModifier) MarshalJSON ¶
func (m *TraitModifier) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*TraitModifier) OwningEntity ¶
func (m *TraitModifier) OwningEntity() *Entity
OwningEntity returns the owning Entity.
func (*TraitModifier) SecondaryText ¶
func (m *TraitModifier) SecondaryText(optionChecker func(DisplayOption) bool) string
SecondaryText returns the "secondary" text: the text display below an Trait.
func (*TraitModifier) SetEnabled ¶
func (m *TraitModifier) SetEnabled(enabled bool)
SetEnabled makes the node enabled, if possible.
func (*TraitModifier) SetOwningEntity ¶
func (m *TraitModifier) SetOwningEntity(entity *Entity)
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*TraitModifier) String ¶
func (m *TraitModifier) String() string
func (*TraitModifier) TagList ¶ added in v5.2.0
func (m *TraitModifier) TagList() []string
TagList returns the list of tags.
func (*TraitModifier) UnmarshalJSON ¶
func (m *TraitModifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TraitModifierCostType ¶ added in v5.9.0
type TraitModifierCostType byte
TraitModifierCostType describes how a TraitModifier's point cost is applied.
const ( PercentageTraitModifierCostType TraitModifierCostType = iota PointsTraitModifierCostType MultiplierTraitModifierCostType LastTraitModifierCostType = MultiplierTraitModifierCostType )
Possible values.
func ExtractTraitModifierCostType ¶ added in v5.9.0
func ExtractTraitModifierCostType(str string) TraitModifierCostType
ExtractTraitModifierCostType extracts the value from a string.
func (TraitModifierCostType) EnsureValid ¶ added in v5.9.0
func (enum TraitModifierCostType) EnsureValid() TraitModifierCostType
EnsureValid ensures this is of a known value.
func (TraitModifierCostType) Key ¶ added in v5.9.0
func (enum TraitModifierCostType) Key() string
Key returns the key used in serialization.
func (TraitModifierCostType) MarshalText ¶ added in v5.9.0
func (enum TraitModifierCostType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (TraitModifierCostType) String ¶ added in v5.9.0
func (enum TraitModifierCostType) String() string
String implements fmt.Stringer.
func (*TraitModifierCostType) UnmarshalText ¶ added in v5.9.0
func (enum *TraitModifierCostType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type TraitModifierData ¶
type TraitModifierData struct { ContainerBase[*TraitModifier] TraitModifierEditData }
TraitModifierData holds the TraitModifier data that is written to disk.
func (*TraitModifierData) ClearUnusedFieldsForType ¶
func (d *TraitModifierData) ClearUnusedFieldsForType()
ClearUnusedFieldsForType zeroes out the fields that are not applicable to this type (container vs not-container).
func (*TraitModifierData) Kind ¶
func (d *TraitModifierData) Kind() string
Kind returns the kind of data.
type TraitModifierEditData ¶
type TraitModifierEditData struct { Name string `json:"name,omitempty"` PageRef string `json:"reference,omitempty"` LocalNotes string `json:"notes,omitempty"` VTTNotes string `json:"vtt_notes,omitempty"` Tags []string `json:"tags,omitempty"` Cost fxp.Int `json:"cost,omitempty"` // Non-container only Levels fxp.Int `json:"levels,omitempty"` // Non-container only Affects Affects `json:"affects,omitempty"` // Non-container only CostType TraitModifierCostType `json:"cost_type,omitempty"` // Non-container only Disabled bool `json:"disabled,omitempty"` // Non-container only Features Features `json:"features,omitempty"` // Non-container only }
TraitModifierEditData holds the TraitModifier data that can be edited by the UI detail editor.
func (*TraitModifierEditData) ApplyTo ¶
func (d *TraitModifierEditData) ApplyTo(mod *TraitModifier)
ApplyTo implements node.EditorData.
func (*TraitModifierEditData) CopyFrom ¶
func (d *TraitModifierEditData) CopyFrom(mod *TraitModifier)
CopyFrom implements node.EditorData.
type TraitModifierListProvider ¶
type TraitModifierListProvider interface { EntityProvider TraitModifierList() []*TraitModifier SetTraitModifierList(list []*TraitModifier) }
TraitModifierListProvider defines the method needed to access the trait modifier list data.
type TraitPrereq ¶
type TraitPrereq struct { Parent *PrereqList `json:"-"` Type PrereqType `json:"type"` Has bool `json:"has"` NameCriteria StringCriteria `json:"name,omitempty"` LevelCriteria NumericCriteria `json:"level,omitempty"` NotesCriteria StringCriteria `json:"notes,omitempty"` }
TraitPrereq holds a prereq against a Trait.
func (*TraitPrereq) ApplyNameableKeys ¶
func (a *TraitPrereq) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Prereq.
func (*TraitPrereq) Clone ¶
func (a *TraitPrereq) Clone(parent *PrereqList) Prereq
Clone implements Prereq.
func (*TraitPrereq) FillWithNameableKeys ¶
func (a *TraitPrereq) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Prereq.
func (*TraitPrereq) ParentList ¶
func (a *TraitPrereq) ParentList() *PrereqList
ParentList implements Prereq.
func (*TraitPrereq) PrereqType ¶
func (a *TraitPrereq) PrereqType() PrereqType
PrereqType implements Prereq.
func (*TraitPrereq) Satisfied ¶
func (a *TraitPrereq) Satisfied(entity *Entity, exclude any, tooltip *xio.ByteBuffer, prefix string, _ *bool) bool
Satisfied implements Prereq.
type Weapon ¶
type Weapon struct { WeaponData Owner WeaponOwner }
Weapon holds the stats for a weapon.
func ExtractWeaponsOfType ¶
func ExtractWeaponsOfType(desiredType WeaponType, list []*Weapon) []*Weapon
ExtractWeaponsOfType filters the input list down to only those weapons of the given type.
func NewWeapon ¶
func NewWeapon(owner WeaponOwner, weaponType WeaponType) *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) 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) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Weapon) NodeChildren ¶
NodeChildren returns the children of this node, if any.
func (*Weapon) OwningEntity ¶
OwningEntity returns the owning Entity.
func (*Weapon) ResolvedBlock ¶
func (w *Weapon) ResolvedBlock(tooltip *xio.ByteBuffer) string
ResolvedBlock returns the resolved block level.
func (*Weapon) ResolvedMinimumStrength ¶
ResolvedMinimumStrength returns the resolved minimum strength required to use this weapon, or 0 if there is none.
func (*Weapon) ResolvedParry ¶
func (w *Weapon) ResolvedParry(tooltip *xio.ByteBuffer) string
ResolvedParry returns the resolved parry level.
func (*Weapon) ResolvedRange ¶
ResolvedRange returns the range, fully resolved for the user's ST, if possible.
func (*Weapon) SetChildren ¶
SetChildren sets the children of this node.
func (*Weapon) SetOwner ¶
func (w *Weapon) SetOwner(owner WeaponOwner)
SetOwner sets the owner and ensures sub-components have their owners set.
func (*Weapon) SetOwningEntity ¶
SetOwningEntity sets the owning entity and configures any sub-components as needed.
func (*Weapon) SkillLevel ¶
func (w *Weapon) SkillLevel(tooltip *xio.ByteBuffer) fxp.Int
SkillLevel returns the resolved skill level.
func (*Weapon) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type WeaponBonus ¶ added in v5.9.0
type WeaponBonus struct { Type FeatureType `json:"type"` Percent bool `json:"percent,omitempty"` SelectionType WeaponSelectionType `json:"selection_type"` NameCriteria StringCriteria `json:"name,omitempty"` SpecializationCriteria StringCriteria `json:"specialization,omitempty"` RelativeLevelCriteria NumericCriteria `json:"level,omitempty"` TagsCriteria StringCriteria `json:"tags,alt=category,omitempty"` LeveledAmount // contains filtered or unexported fields }
WeaponBonus holds the data for an adjustment to weapon damage.
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 (*WeaponBonus) AddToTooltip ¶ added in v5.9.0
func (w *WeaponBonus) AddToTooltip(buffer *xio.ByteBuffer)
AddToTooltip implements Bonus.
func (*WeaponBonus) ApplyNameableKeys ¶ added in v5.9.0
func (w *WeaponBonus) ApplyNameableKeys(m map[string]string)
ApplyNameableKeys implements Feature.
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() FeatureType
FeatureType implements Feature.
func (*WeaponBonus) FillWithNameableKeys ¶ added in v5.9.0
func (w *WeaponBonus) FillWithNameableKeys(m map[string]string)
FillWithNameableKeys implements Feature.
func (*WeaponBonus) Owner ¶ added in v5.9.0
func (w *WeaponBonus) Owner() fmt.Stringer
Owner implements Bonus.
func (*WeaponBonus) SetLevel ¶ added in v5.9.0
func (w *WeaponBonus) SetLevel(level fxp.Int)
SetLevel implements Bonus.
func (*WeaponBonus) SetOwner ¶ added in v5.9.0
func (w *WeaponBonus) SetOwner(owner fmt.Stringer)
SetOwner implements Bonus.
type WeaponDamage ¶
type WeaponDamage struct { WeaponDamageData Owner *Weapon }
WeaponDamage holds the damage information for a weapon.
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) 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 StrengthDamage `json:"st,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 { ID uuid.UUID `json:"id"` Type WeaponType `json:"type"` Damage WeaponDamage `json:"damage"` MinimumStrength string `json:"strength,omitempty"` Usage string `json:"usage,omitempty"` UsageNotes string `json:"usage_notes,omitempty"` Reach string `json:"reach,omitempty"` Parry string `json:"parry,omitempty"` Block string `json:"block,omitempty"` Accuracy string `json:"accuracy,omitempty"` Range string `json:"range,omitempty"` RateOfFire string `json:"rate_of_fire,omitempty"` Shots string `json:"shots,omitempty"` Bulk string `json:"bulk,omitempty"` Recoil string `json:"recoil,omitempty"` Defaults []*SkillDefault `json:"defaults,omitempty"` }
WeaponData holds the Weapon data that is written to disk.
type WeaponListProvider ¶
type WeaponListProvider interface { EntityProvider WeaponOwner() WeaponOwner Weapons(weaponType WeaponType) []*Weapon SetWeapons(weaponType WeaponType, list []*Weapon) }
WeaponListProvider defines the method needed to access the weapon list data.
type WeaponOwner ¶
type WeaponOwner interface { fmt.Stringer OwningEntity() *Entity Description() string Notes() string FeatureList() Features TagList() []string }
WeaponOwner defines the methods required of a Weapon owner.
type WeaponSelectionType ¶ added in v5.9.0
type WeaponSelectionType byte
WeaponSelectionType holds the type of a weapon selection.
const ( WithRequiredSkillWeaponSelectionType WeaponSelectionType = iota ThisWeaponWeaponSelectionType WithNameWeaponSelectionType LastWeaponSelectionType = WithNameWeaponSelectionType )
Possible values.
func ExtractWeaponSelectionType ¶ added in v5.9.0
func ExtractWeaponSelectionType(str string) WeaponSelectionType
ExtractWeaponSelectionType extracts the value from a string.
func (WeaponSelectionType) EnsureValid ¶ added in v5.9.0
func (enum WeaponSelectionType) EnsureValid() WeaponSelectionType
EnsureValid ensures this is of a known value.
func (WeaponSelectionType) Key ¶ added in v5.9.0
func (enum WeaponSelectionType) Key() string
Key returns the key used in serialization.
func (WeaponSelectionType) MarshalText ¶ added in v5.9.0
func (enum WeaponSelectionType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (WeaponSelectionType) String ¶ added in v5.9.0
func (enum WeaponSelectionType) String() string
String implements fmt.Stringer.
func (*WeaponSelectionType) UnmarshalText ¶ added in v5.9.0
func (enum *WeaponSelectionType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type WeaponType ¶ added in v5.9.0
type WeaponType byte
WeaponType holds the type of an weapon definition.
const ( MeleeWeaponType WeaponType = iota RangedWeaponType LastWeaponType = RangedWeaponType )
Possible values.
func ExtractWeaponType ¶ added in v5.9.0
func ExtractWeaponType(str string) WeaponType
ExtractWeaponType extracts the value from a string.
func (WeaponType) AltString ¶ added in v5.9.0
func (enum WeaponType) AltString() string
AltString returns the alternate string.
func (WeaponType) EnsureValid ¶ added in v5.9.0
func (enum WeaponType) EnsureValid() WeaponType
EnsureValid ensures this is of a known value.
func (WeaponType) Key ¶ added in v5.9.0
func (enum WeaponType) Key() string
Key returns the key used in serialization.
func (WeaponType) MarshalText ¶ added in v5.9.0
func (enum WeaponType) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (WeaponType) SVG ¶ added in v5.9.0
func (enum WeaponType) SVG() *unison.SVG
SVG returns the SVG that should be used for this type.
func (WeaponType) String ¶ added in v5.9.0
func (enum WeaponType) String() string
String implements fmt.Stringer.
func (*WeaponType) UnmarshalText ¶ added in v5.9.0
func (enum *WeaponType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Weight ¶ added in v5.9.0
Weight contains a fixed-point value in pounds.
func ExtendedWeightAdjustedForModifiers ¶
func ExtendedWeightAdjustedForModifiers(defUnits WeightUnits, qty fxp.Int, baseWeight Weight, modifiers []*EquipmentModifier, features Features, children []*Equipment, forSkills, weightIgnoredForSkills bool) Weight
ExtendedWeightAdjustedForModifiers calculates the extended weight.
func WeightAdjustedForModifiers ¶
func WeightAdjustedForModifiers(weight Weight, modifiers []*EquipmentModifier, defUnits WeightUnits) Weight
WeightAdjustedForModifiers returns the weight after adjusting it for a set of modifiers.
func WeightFromInteger ¶ added in v5.9.0
func WeightFromInteger[T constraints.Integer](value T, unit WeightUnits) Weight
WeightFromInteger creates a new Weight.
func WeightFromString ¶ added in v5.9.0
func WeightFromString(text string, defaultUnits WeightUnits) (Weight, error)
WeightFromString creates a new Weight. May have any of the known Weight suffixes or no notation at all, in which case defaultUnits is used.
func WeightFromStringForced ¶ added in v5.9.0
func WeightFromStringForced(text string, defaultUnits WeightUnits) Weight
WeightFromStringForced creates a new Weight. May have any of the known Weight suffixes or no notation at all, in which case defaultUnits is used.
func (Weight) MarshalJSON ¶ added in v5.9.0
MarshalJSON implements json.Marshaler.
func (*Weight) UnmarshalJSON ¶ added in v5.9.0
UnmarshalJSON implements json.Unmarshaler.
type WeightCriteria ¶ added in v5.9.0
type WeightCriteria struct {
WeightCriteriaData
}
WeightCriteria holds the criteria for matching a number.
func (WeightCriteria) Matches ¶ added in v5.9.0
func (w WeightCriteria) Matches(value Weight) bool
Matches performs a comparison and returns true if the data matches.
func (WeightCriteria) ShouldOmit ¶ added in v5.9.0
func (w WeightCriteria) ShouldOmit() bool
ShouldOmit implements json.Omitter.
func (WeightCriteria) String ¶ added in v5.9.0
func (w WeightCriteria) String() string
func (*WeightCriteria) UnmarshalJSON ¶ added in v5.9.0
func (w *WeightCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type WeightCriteriaData ¶ added in v5.9.0
type WeightCriteriaData struct { Compare NumericCompareType `json:"compare,omitempty"` Qualifier Weight `json:"qualifier,omitempty"` }
WeightCriteriaData holds the criteria for matching a number that should be written to disk.
type WeightUnits ¶ added in v5.9.0
type WeightUnits byte
WeightUnits holds the weight unit type. Note that conversions to/from metric are done using the simplified GURPS metric conversion of 1 lb = 0.5kg. For consistency, all metric weights are converted to kilograms, then to pounds, rather than the variations at different weights that the GURPS rules suggest.
const ( Pound WeightUnits = iota PoundAlt Ounce Ton TonAlt Kilogram Gram LastWeightUnits = Gram )
Possible values.
func ExtractWeightUnits ¶ added in v5.9.0
func ExtractWeightUnits(str string) WeightUnits
ExtractWeightUnits extracts the value from a string.
func TrailingWeightUnitsFromString ¶ added in v5.9.0
func TrailingWeightUnitsFromString(s string, defUnits WeightUnits) WeightUnits
TrailingWeightUnitsFromString extracts a trailing WeightUnits from a string.
func (WeightUnits) EnsureValid ¶ added in v5.9.0
func (enum WeightUnits) EnsureValid() WeightUnits
EnsureValid ensures this is of a known value.
func (WeightUnits) Format ¶ added in v5.9.0
func (enum WeightUnits) Format(weight Weight) string
Format the weight for this WeightUnits.
func (WeightUnits) Key ¶ added in v5.9.0
func (enum WeightUnits) Key() string
Key returns the key used in serialization.
func (WeightUnits) MarshalText ¶ added in v5.9.0
func (enum WeightUnits) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (WeightUnits) String ¶ added in v5.9.0
func (enum WeightUnits) String() string
String implements fmt.Stringer.
func (WeightUnits) ToPounds ¶ added in v5.9.0
func (enum WeightUnits) ToPounds(weight fxp.Int) fxp.Int
ToPounds the weight for this WeightUnits.
func (*WeightUnits) UnmarshalText ¶ added in v5.9.0
func (enum *WeightUnits) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
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 ¶
- affects_gen.go
- ancestry.go
- ancestry_options.go
- attribute.go
- attribute_bonus.go
- attribute_choice.go
- attribute_def.go
- attribute_defs.go
- attribute_prereq.go
- attribute_type_gen.go
- attributes.go
- block_layout.go
- body.go
- bonus_limitation_gen.go
- calendar_ref.go
- cell.go
- cell_type_gen.go
- college_list.go
- colors.go
- common.go
- conditional_modifier.go
- conditional_modifier_bonus.go
- contained_quantity_prereq.go
- contained_weight_prereq.go
- contained_weight_reduction.go
- container_base.go
- container_type_gen.go
- convert.go
- cost_reduction.go
- damage_progression.go
- damage_progression_gen.go
- difficulty.go
- difficulty_gen.go
- difficulty_with_attr.go
- display_option.go
- display_option_gen.go
- dockable_group_gen.go
- dr_bonus.go
- encumbrance.go
- encumbrance_gen.go
- entity.go
- entity_type_gen.go
- equipment.go
- equipment_data.go
- equipment_edit_data.go
- equipment_modifier.go
- equipment_modifier_cost_type.go
- equipment_modifier_cost_type_gen.go
- equipment_modifier_cost_value_type.go
- equipment_modifier_cost_value_type_gen.go
- equipment_modifier_data.go
- equipment_modifier_edit_data.go
- equipment_modifier_weight_type.go
- equipment_modifier_weight_type_gen.go
- equipment_modifier_weight_value_type.go
- equipment_modifier_weight_value_type_gen.go
- equipped_equipment_prereq.go
- eval.go
- feature.go
- feature_type.go
- feature_type_gen.go
- features.go
- file_type.go
- fonts.go
- general_settings.go
- hit_location.go
- hit_location_choice.go
- ids.go
- key_bindings.go
- legacy_text_export.go
- length.go
- length_units.go
- length_units_gen.go
- level.go
- leveled_amount.go
- libraries.go
- library.go
- list_provider.go
- monitor.go
- name_data_gen.go
- name_generation_type_gen.go
- name_generator.go
- nameables.go
- natural_attacks.go
- node.go
- note.go
- note_data.go
- note_edit_data.go
- numeric_compare_type.go
- numeric_criteria.go
- page_references.go
- page_settings.go
- page_settings_overrides.go
- paper_length.go
- paper_orientation.go
- paper_orientation_gen.go
- paper_size.go
- paper_size_gen.go
- paper_units.go
- paper_units_gen.go
- paths.go
- points_record.go
- pool_threshold.go
- prereq.go
- prereq_list.go
- prereq_type_gen.go
- prereqs.go
- profile.go
- quick_exports.go
- reaction_bonus.go
- release.go
- scanner.go
- self_control_roll.go
- self_control_roll_adj.go
- self_control_roll_adj_gen.go
- settings.go
- settings_linux.go
- sheet_settings.go
- skill.go
- skill_bonus.go
- skill_data.go
- skill_default.go
- skill_edit_data.go
- skill_point_bonus.go
- skill_prereq.go
- skill_selection_type_gen.go
- spell.go
- spell_bonus.go
- spell_comparison_type.go
- spell_comparison_type_gen.go
- spell_data.go
- spell_edit_data.go
- spell_match_type.go
- spell_match_type_gen.go
- spell_point_bonus.go
- spell_prereq.go
- strength_damage_gen.go
- string_compare_type.go
- string_criteria.go
- study.go
- study_type.go
- study_type_gen.go
- svg_image.go
- tech_level.go
- template.go
- template_picker.go
- template_picker_type_gen.go
- threshold_op_gen.go
- trait.go
- trait_data.go
- trait_edit_data.go
- trait_modifier.go
- trait_modifier_cost_type_gen.go
- trait_modifier_data.go
- trait_modifier_edit_data.go
- trait_prereq.go
- traverse.go
- version.go
- weapon.go
- weapon_bonus.go
- weapon_damage.go
- weapon_selection_type_gen.go
- weapon_type.go
- weapon_type_gen.go
- weight.go
- weight_criteria.go
- weight_units.go
- weight_units_gen.go
- weighted_ancestry_options.go
- weighted_string_option.go