character

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Human = iota + 1
	Elf
	Dwarf
)
View Source
const (
	Empirial = iota + 1
	Nord
	Vardisan
	Lumdrani
	Nimalese
	Minskite
)

Variables

View Source
var BoxData *packr.Box

Functions

func CalcAttrBonus

func CalcAttrBonus(a int) int

Calculates Attribute Bonus

func KeepHighestRolls

func KeepHighestRolls(h int, rs []int) []int

func KeepLowestRolls

func KeepLowestRolls(l int, rs []int) []int

func MultiRollSum

func MultiRollSum(n, d int) int

func MultiRolls

func MultiRolls(n, d int) []int

func ReadCSV

func ReadCSV(filename string) ([][]string, error)

ReadCSV reads in csv file to be used

func Roll

func Roll(d int) int

func RollString

func RollString(s string) (numberOfDice, typeOfDice int)

func SumRolls

func SumRolls(r []int) int

Types

type AgeGroup

type AgeGroup int
const (
	Young AgeGroup = iota + 1
	Adult
	MiddleAge
	Elderly
)

func (AgeGroup) Len

func (a AgeGroup) Len() int

func (AgeGroup) String

func (a AgeGroup) String() string

type Attributes

type Attributes struct {
	Strength     int `json:"strength"`
	Dexterity    int `json:"dexterity"`
	Constitution int `json:"constitution"`
	Perception   int `json:"perception"`
	Intelligence int `json:"intelligence"`
	Willpower    int `json:"willpower"`
	Charisma     int `json:"charisma"`
	Movement     int `json:"movement"`
}

func NewAttributes

func NewAttributes() Attributes

type Bonuses

type Bonuses struct {
	SB           int `json:"sb"`
	DB           int `json:"db"`
	CB           int `json:"cb"`
	PB           int `json:"pb"`
	IB           int `json:"ib"`
	WB           int `json:"wb"`
	ChB          int `json:"ch_b"`
	CombatBonus  int `json:"combat_bonus"`
	Initiative   int `json:"initiative"`
	Encumburance int `json:"encumburance"`
}

type Character

type Character struct {
	Name                 string   `json:"name"`
	Gender               string   `json:"gender"`
	Race                 string   `json:"race"`
	Ancestry             string   `json:"ancestry"`
	Age                  string   `json:"age"`
	DamageThreshold      int      `json:"damage_threshold"`
	DamageConditionState string   `json:"damage_condition_state"`
	Injuries             []string `json:"injuries"`
	PerilsThreshold      int      `json:"perils_threshold"`
	PerilsConditionState string   `json:"perils_condition_state"`
	Bonuses
	Attributes
	DistinguishingMarks []string `json:"distinguishing_marks"`
	BodyType            string   `json:"body_type"`
	Complexion          string   `json:"complexion"`
	Season              string   `json:"season"`
	Upbringing          string   `json:"upbringing"`
	SocialClass         string   `json:"social_class"`
	EyeColor            string   `json:"eye_color"`
	HairColor           string   `json:"hair_color"`
	Languages           []string `json:"languages"`
	Height              string   `json:"height"`
	Weight              int      `json:"weight"`
	Professions         []string `json:"professions"`
	Skills              []Skill  `json:"skills"`
	ProfessionSelection string   `json:"profession_selection"`
	Money
	Items []InventoryItem `json:"items"`
}

Character is the fields of information

func NewCharacter

func NewCharacter() Character

type CoinTypes

type CoinTypes int
const (
	GoldCrown CoinTypes = iota
	SilverShilling
	CopperPenny
)

func (CoinTypes) Shorthand

func (c CoinTypes) Shorthand() string

func (CoinTypes) String

func (c CoinTypes) String() string

type CopperPennies

type CopperPennies struct {
	Name      string `json:"name"`
	ShortHand string `json:"short_hand"`
	Count     int    `json:"count"`
}

type DamageConditionState

type DamageConditionState int
const (
	Unharmed DamageConditionState = iota
	LightlyWounded
	ModeratelyWounded
	SeriouslyWounded
	GreivouslyWounded
	Slain
)

func (DamageConditionState) Len

func (d DamageConditionState) Len() int

func (DamageConditionState) String

func (d DamageConditionState) String() string

type DwarvenHeritage

type DwarvenHeritage int
const (
	IronHills DwarvenHeritage = iota + 1
	Mountain
	Deep
)

func (DwarvenHeritage) Len

func (d DwarvenHeritage) Len() int

func (DwarvenHeritage) String

func (d DwarvenHeritage) String() string

type ElvenHeritage

type ElvenHeritage int
const (
	High ElvenHeritage = iota + 1
	Drow
	Wood
)

func (ElvenHeritage) Len

func (e ElvenHeritage) Len() int

func (ElvenHeritage) String

func (e ElvenHeritage) String() string

type Enum

type Enum interface {
	String() string
	Len() int
}

type Focus

type Focus struct {
	Name  string `json:"name"`
	Level int    `json:"level"`
}

type Gender

type Gender int

func (Gender) String

func (g Gender) String() string

type GoldCrowns

type GoldCrowns struct {
	Name      string `json:"name"`
	ShortHand string `json:"short_hand"`
	Count     int    `json:"count"`
}

type HumanHeritage

type HumanHeritage int

func (HumanHeritage) Len

func (h HumanHeritage) Len() int

func (HumanHeritage) String

func (h HumanHeritage) String() string

type HumanHeritageRange

type HumanHeritageRange struct {
	HumanHeritage
	Min int `json:"min"`
	Max int `json:"max"`
}

type HumanHeritageWeighted

type HumanHeritageWeighted struct {
	HumanHeritage
	Weight int `json:"weight"`
}

type InventoryItem added in v0.2.0

type InventoryItem interface {
	GetValue() string
	GetCount() int
}

type Item added in v0.2.0

type Item struct {
	Name        string `json:"name"`
	Value       string `json:"value"`
	Description string `json:"description"`
	WeightLbs   int    `json:"weight_lbs"`
}

func (*Item) GetValue added in v0.2.0

func (i *Item) GetValue() string

type ItemWithCount added in v0.2.0

type ItemWithCount struct {
	Item
	Count int `json:"count"`
}

func (*ItemWithCount) GetCount added in v0.2.0

func (i *ItemWithCount) GetCount() int

type Languages

type Languages int
const (
	Common Languages = iota + 1
	Undercommon
	Elvish
	Dwarvish
	Orcish
)

func (Languages) Len

func (l Languages) Len() int

func (Languages) String

func (l Languages) String() string

type MeleeWeapon added in v0.2.0

type MeleeWeapon struct {
	Item
	ReachInch     int           `json:"reach_inch"`
	InitBonusNear int           `json:"init_bonus_near"`
	InitBonusFar  int           `json:"init_bonus_far"`
	HandsUsed     []int         `json:"hands_used"`
	MeleeType     string        `json:"melee_type"`
	WeaponTraits  []WeaponTrait `json:"weapon_traits"`
}

type MeleeWeaponWithCount added in v0.2.0

type MeleeWeaponWithCount struct {
	MeleeWeapon
	Count int `json:"count"`
}

func (*MeleeWeaponWithCount) GetCount added in v0.2.0

func (i *MeleeWeaponWithCount) GetCount() int

type Money

type Money struct {
	GoldCrowns
	SilverShillings
	CopperPennies
}

func NewMoney

func NewMoney() Money

type PerilsConditonState

type PerilsConditonState int
const (
	Unhindered PerilsConditonState = iota
	Imperiled
	IgnoreOneSkill
	IgnoreTwoSkills
	IgnoreThreeSkills
	Incapacitated
)

func (PerilsConditonState) Len

func (p PerilsConditonState) Len() int

func (PerilsConditonState) String

func (p PerilsConditonState) String() string

type Profession

type Profession struct {
	Name                   string            `json:"name"`
	Description            string            `json:"description"`
	BonusAdvances          []string          `json:"bonus_advances"`
	AttributeBonusAdvances []string          `json:"attribute_bonus_advances"`
	SkillAdvances          []string          `json:"skill_advances"`
	Talents                []string          `json:"talents"`
	StartingMoney          map[string]string `json:"starting_money"`
	StartingEquip          [][]string        `json:"starting_equip"`
	UniqueTrait            Trait             `json:"unique_trait"`
}

Profession is the object for the professions with advance description

type ProfessionType

type ProfessionType int
const (
	Agriculture ProfessionType = iota + 1
	Arts
	BusinessTrade
	Communications
	Construction
	Craftman
	Crime
	Government
	Health
	Labor
	Magic
	Military
	Outcast
	Religion
	Scholars
	Transportation
)

func (ProfessionType) Len

func (p ProfessionType) Len() int

func (ProfessionType) String

func (p ProfessionType) String() string

type Race

type Race int

func (Race) String

func (r Race) String() string

type RangeWeapon added in v0.2.0

type RangeWeapon struct {
	Item
	OptimalRangeYds int           `json:"optimal_range_yds"`
	FallOffYds      int           `json:"fall_off_yds"`
	MaxRangeYds     int           `json:"max_range_yds"`
	AmmunitionType  string        `json:"ammunition_type"`
	ReloadTimeMS    int           `json:"reload_time_ms"`
	DrawTimeMS      int           `json:"draw_time_ms"`
	WeaponTraits    []WeaponTrait `json:"weapon_traits"`
}

type RangeWeaponWithCount added in v0.2.0

type RangeWeaponWithCount struct {
	RangeWeapon
	Count int `json:"count"`
}

func (*RangeWeaponWithCount) GetCount added in v0.2.0

func (i *RangeWeaponWithCount) GetCount() int

type SilverShillings

type SilverShillings struct {
	Name      string `json:"name"`
	ShortHand string `json:"short_hand"`
	Count     int    `json:"count"`
}

type Skill

type Skill struct {
	Name      string  `json:"name"`
	BonusUsed string  `json:"bonus_used"`
	Focuses   []Focus `json:"focuses"`
	Level     int     `json:"level"`
}

type ThrownWeapon added in v0.2.0

type ThrownWeapon struct {
	Item
	ReachInch       int           `json:"reach_inch"`
	InitBonusNear   int           `json:"init_bonus_near"`
	InitBonusFar    int           `json:"init_bonus_far"`
	HandsUsed       []int         `json:"hands_used"`
	MeleeType       string        `json:"melee_type"`
	WeaponTraits    []WeaponTrait `json:"weapon_traits"`
	OptimalRangeYds int           `json:"optimal_range_yds"`
	FallOffYds      int           `json:"fall_off_yds"`
	MaxRangeYds     int           `json:"max_range_yds"`
}

type ThrownWeaponWithCount added in v0.2.0

type ThrownWeaponWithCount struct {
	ThrownWeapon
	Count int `json:"count"`
}

func (*ThrownWeaponWithCount) GetCount added in v0.2.0

func (i *ThrownWeaponWithCount) GetCount() int

type Trait

type Trait struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Effect      string `json:"effect"`
}

Talent is a modifier to a character with a special ability

type WeaponTrait added in v0.2.0

type WeaponTrait struct {
	Name   string `json:"name"`
	Effect string `json:"effect"`
}

type WeightedRow

type WeightedRow struct {
	Enum   int `json:"enum"`
	Weight int `json:"weight"`
	Min    int `json:"min"`
	Max    int `json:"max"`
}

type WeightedTable

type WeightedTable []WeightedRow

func NewWeightedTable

func NewWeightedTable(enum Enum, w []int) WeightedTable

func (*WeightedTable) Roll

func (wt *WeightedTable) Roll() int

Jump to

Keyboard shortcuts

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