selfctrl

package
v5.25.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	NoCR = Roll(0)
	CR6  = Roll(6)
	CR7  = Roll(7)
	CR8  = Roll(8)
	CR9  = Roll(9)
	CR10 = Roll(10)
	CR11 = Roll(11)
	CR12 = Roll(12)
	CR13 = Roll(13)
	CR14 = Roll(14)
	CR15 = Roll(15)
)

Possible Roll values.

Variables

Adjustments holds all possible values.

View Source
var Rolls = []Roll{
	NoCR,
	CR6,
	CR7,
	CR8,
	CR9,
	CR10,
	CR11,
	CR12,
	CR13,
	CR14,
	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 byte

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) Penalty added in v5.21.0

func (s Roll) Penalty() int

Penalty returns the general penalty for this roll.

func (Roll) String

func (s Roll) String() string

String implements fmt.Stringer.

func (Roll) TreatAs added in v5.21.0

func (s Roll) TreatAs() Roll

TreatAs returns the standard CR equivalent value for this roll.

Jump to

Keyboard shortcuts

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