trait

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = SelfControlRoll(0)
	CR6  = SelfControlRoll(6)
	CR9  = SelfControlRoll(9)
	CR12 = SelfControlRoll(12)
	CR15 = SelfControlRoll(15)
)

Possible SelfControlRoll values.

Variables

View Source
var (
	// AllAffects holds all possible values.
	AllAffects = []Affects{
		Total,
		BaseOnly,
		LevelsOnly,
	}
)
View Source
var (
	// AllContainerType holds all possible values.
	AllContainerType = []ContainerType{
		Group,
		MetaTrait,
		Race,
		AlternativeAbilities,
	}
)
View Source
var (
	// AllModifierCostType holds all possible values.
	AllModifierCostType = []ModifierCostType{
		Percentage,
		Points,
		Multiplier,
	}
)
View Source
var AllSelfControlRolls = []SelfControlRoll{
	None,
	CR6,
	CR9,
	CR12,
	CR15,
}

AllSelfControlRolls is the complete set of SelfControlRoll values.

Functions

This section is empty.

Types

type Affects

type Affects byte

Affects describes how a TraitModifier affects the point cost.

const (
	Total Affects = iota
	BaseOnly
	LevelsOnly
	LastAffects = LevelsOnly
)

Possible values.

func ExtractAffects

func ExtractAffects(str string) Affects

ExtractAffects extracts the value from a string.

func (Affects) AltString

func (enum Affects) AltString() string

AltString returns the alternate string.

func (Affects) EnsureValid

func (enum Affects) EnsureValid() Affects

EnsureValid ensures this is of a known value.

func (Affects) Key

func (enum Affects) Key() string

Key returns the key used in serialization.

func (Affects) MarshalText

func (enum Affects) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface.

func (Affects) String

func (enum Affects) String() string

String implements fmt.Stringer.

func (*Affects) UnmarshalText

func (enum *Affects) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type ContainerType

type ContainerType byte

ContainerType holds the type of a trait container.

const (
	Group ContainerType = iota
	MetaTrait
	Race
	AlternativeAbilities
	LastContainerType = AlternativeAbilities
)

Possible values.

func ExtractContainerType

func ExtractContainerType(str string) ContainerType

ExtractContainerType extracts the value from a string.

func (ContainerType) EnsureValid

func (enum ContainerType) EnsureValid() ContainerType

EnsureValid ensures this is of a known value.

func (ContainerType) Key

func (enum ContainerType) Key() string

Key returns the key used in serialization.

func (ContainerType) MarshalText

func (enum ContainerType) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface.

func (ContainerType) String

func (enum ContainerType) String() string

String implements fmt.Stringer.

func (*ContainerType) UnmarshalText

func (enum *ContainerType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type ModifierCostType

type ModifierCostType byte

ModifierCostType describes how a TraitModifier's point cost is applied.

const (
	Percentage ModifierCostType = iota
	Points
	Multiplier
	LastModifierCostType = Multiplier
)

Possible values.

func ExtractModifierCostType

func ExtractModifierCostType(str string) ModifierCostType

ExtractModifierCostType extracts the value from a string.

func (ModifierCostType) EnsureValid

func (enum ModifierCostType) EnsureValid() ModifierCostType

EnsureValid ensures this is of a known value.

func (ModifierCostType) Key

func (enum ModifierCostType) Key() string

Key returns the key used in serialization.

func (ModifierCostType) MarshalText

func (enum ModifierCostType) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface.

func (ModifierCostType) String

func (enum ModifierCostType) String() string

String implements fmt.Stringer.

func (*ModifierCostType) UnmarshalText

func (enum *ModifierCostType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type SelfControlRoll

type SelfControlRoll int

SelfControlRoll holds the information about a self-control roll, from B121.

func (SelfControlRoll) DescriptionWithCost

func (s SelfControlRoll) DescriptionWithCost() string

DescriptionWithCost returns a formatted description that includes the cost multiplier.

func (SelfControlRoll) EnsureValid

func (s SelfControlRoll) EnsureValid() SelfControlRoll

EnsureValid ensures this is of a known value.

func (SelfControlRoll) Index

func (s SelfControlRoll) Index() int

Index returns of the SelfControlRoll within AllSelfControlRolls.

func (SelfControlRoll) MinimumRoll

func (s SelfControlRoll) MinimumRoll() int

MinimumRoll returns the minimum roll to retain control.

func (SelfControlRoll) Multiplier

func (s SelfControlRoll) Multiplier() fxp.Int

Multiplier returns the cost multiplier.

func (SelfControlRoll) String

func (s SelfControlRoll) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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