abilities

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Strength means the StrengthModifier has to used.
	Strength = "strength"
	// Dexterity means the DexterityModifier has to be used.
	Dexterity = "dexterity"
	// Constitution means the ConstitutionModifier has to be used.
	Constitution = "constitution"
	// Intelligence means the IntelligenceModifier has to be used.
	Intelligence = "intelligence"
	// Wisdom means the WisdomModifier has to be used.
	Wisdom = "wisdom"
	// Charisma means the CharismaModifier has to be used.
	Charisma = "charisma"
)

Variables

View Source
var AbilityScoresAndModifiers = map[int]int{
	1:  -5,
	2:  -4,
	3:  -4,
	4:  -3,
	5:  -3,
	6:  -2,
	7:  -2,
	8:  -1,
	9:  -1,
	10: 0,
	11: 0,
	12: 1,
	13: 1,
	14: 2,
	15: 2,
	16: 3,
	17: 3,
	18: 4,
	19: 4,
	20: 5,
	21: 5,
	22: 6,
	23: 6,
	24: 7,
	25: 7,
	26: 8,
	27: 8,
	28: 9,
	29: 9,
	30: 10,
}

AbilityScoresAndModifiers maps an ability score to an ability modifier.

Functions

func OutOfRange

func OutOfRange(v int) bool

OutOfRange checks whether the provided value is withing the acceptable range.

Types

type Abilities

type Abilities struct {
	Strength     int `json:"strength" bson:"strength"`
	Dexterity    int `json:"dexterity" bson:"dexterity"`
	Constitution int `json:"constitution" bson:"constitution"`
	Intelligence int `json:"intelligence" bson:"intelligence"`
	Wisdom       int `json:"wisdom" bson:"wisdom"`
	Charisma     int `json:"charisma" bson:"charisma"`

	StrengthModifier     int `json:"strength_modifier" bson:"strength_modifier"`
	DexterityModifier    int `json:"dexterity_modifier" bson:"dexterity_modifier"`
	ConstitutionModifier int `json:"constitution_modifier" bson:"constitution_modifier"`
	IntelligenceModifier int `json:"intelligence_modifier" bson:"intelligence_modifier"`
	WisdomModifier       int `json:"wisdom_modifier" bson:"wisdom_modifier"`
	CharismaModifier     int `json:"charisma_modifier" bson:"charisma_modifier"`
}

Abilities indicates a creature's basic abilities.

type OutOfRangeError

type OutOfRangeError struct {
	// contains filtered or unexported fields
}

OutOfRangeError is the error that gets returned when an out of range value is provided to a setter.

func (OutOfRangeError) Error

func (e OutOfRangeError) Error() string

Jump to

Keyboard shortcuts

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