selfctrl

package
v5.20.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoCR = Roll(0)
	CR6  = Roll(6)
	CR9  = Roll(9)
	CR12 = Roll(12)
	CR15 = Roll(15)
)

Possible Roll values.

Variables

Adjustments holds all possible values.

View Source
var Rolls = []Roll{
	NoCR,
	CR6,
	CR9,
	CR12,
	CR15,
}

Rolls is the complete set of Roll values.

Functions

This section is empty.

Types

type Adjustment

type Adjustment byte

Adjustment holds an Adjustment for a self-control roll.

const (
	NoCRAdj Adjustment = iota
	ActionPenalty
	ReactionPenalty
	FrightCheckPenalty
	FrightCheckBonus
	MinorCostOfLivingIncrease
	MajorCostOfLivingIncrease
)

Possible values.

const LastAdjustment Adjustment = MajorCostOfLivingIncrease

LastAdjustment is the last valid value.

func ExtractAdjustment

func ExtractAdjustment(str string) Adjustment

ExtractAdjustment extracts the value from a string.

func (Adjustment) Adjustment

func (enum Adjustment) Adjustment(cr Roll) int

Adjustment returns the adjustment amount.

func (Adjustment) AltString

func (enum Adjustment) AltString() string

AltString returns the alternate string.

func (Adjustment) Description

func (enum Adjustment) Description(cr Roll) string

Description returns a formatted description.

func (Adjustment) EnsureValid

func (enum Adjustment) EnsureValid() Adjustment

EnsureValid ensures this is of a known value.

func (Adjustment) Key

func (enum Adjustment) Key() string

Key returns the key used in serialization.

func (Adjustment) MarshalText

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

MarshalText implements the encoding.TextMarshaler interface.

func (Adjustment) String

func (enum Adjustment) String() string

String implements fmt.Stringer.

func (*Adjustment) UnmarshalText

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

UnmarshalText implements the encoding.TextUnmarshaler interface.

type Roll

type Roll int

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

func (Roll) DescriptionWithCost

func (s Roll) DescriptionWithCost() string

DescriptionWithCost returns a formatted description that includes the cost multiplier.

func (Roll) EnsureValid

func (s Roll) EnsureValid() Roll

EnsureValid ensures this is of a known value.

func (Roll) Index

func (s Roll) Index() int

Index returns of the Roll within Rolls.

func (Roll) MinimumRoll

func (s Roll) MinimumRoll() int

MinimumRoll returns the minimum roll to retain control.

func (Roll) Multiplier

func (s Roll) Multiplier() fxp.Int

Multiplier returns the cost multiplier.

func (Roll) String

func (s Roll) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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