character

package
v0.0.0-...-a30bc99 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package character provides fictional character generation tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	FirstName      string                    `json:"first_name"`
	LastName       string                    `json:"last_name"`
	Title          string                    `json:"title"`  // Title is the character's primary title
	Titles         []string                  `json:"titles"` // Titles is a list of all of the character's titles
	Heraldry       heraldry.SimplifiedDevice `json:"heraldry"`
	Gender         gender.Gender             `json:"gender"`
	Age            int                       `json:"age"`
	AgeCategory    age.Category              `json:"age_category"`
	Orientation    string                    `json:"orientation"`
	Height         int                       `json:"height"`
	Weight         int                       `json:"weight"`
	Profession     profession.Profession     `json:"profession"`
	Hobby          Hobby                     `json:"hobby"`
	NegativeTraits []string                  `json:"negative_traits"`
	PositiveTraits []string                  `json:"positive_traits"`
	Motivation     string                    `json:"motivation"`
	PhysicalTraits []trait.Trait             `json:"physical_traits"`
	Culture        culture.Culture           `json:"culture"`
	Race           species.Species           `json:"race"`
}

Character is a character

func Generate

func Generate(originCulture culture.Culture) (Character, error)

Generate generates a random character

func GenerateAdultDescendent

func GenerateAdultDescendent(couple Couple) (Character, error)

GenerateAdultDescendent generates an adult character based on a couple

func GenerateChild

func GenerateChild(couple Couple) (Character, error)

GenerateChild generates a child character for a couple

func GenerateCompatibleMate

func GenerateCompatibleMate(char Character) (Character, error)

GenerateCompatibleMate generates a character appropriate as a mate for another

func Random

func Random() (Character, error)

Random generates a completely random character

func (Character) ChangeAge

func (character Character) ChangeAge(newAge int) Character

ChangeAge changes the age and age category of a character

func (Character) Describe

func (character Character) Describe() (string, error)

Describe returns a prose description of a character based on his or her traits and attributes

func (Character) Simplify

func (character Character) Simplify() (SimplifiedCharacter, error)

Simplify returns a simplified version of a character

type Couple

type Couple struct {
	Partner1        Character
	Partner2        Character
	CanHaveChildren bool
}

Couple is a pair of partners

func GenerateCouple

func GenerateCouple() (Couple, error)

GenerateCouple generates a couple

func MarryCouple

func MarryCouple(partner1 Character, partner2 Character) Couple

MarryCouple returns a couple from two characters

type Description

type Description struct {
	Age               string
	Culture           string
	FirstName         string
	FullName          string
	GenderNoun        string
	Height            string
	Heraldry          string
	Hobby             string
	LastName          string
	Motivation        string
	NegativeTraits    string
	PositiveTraits    string
	PossessivePronoun string
	Profession        string
	Race              string
	SubjectPronoun    string
	Traits            string
	Weight            string
}

Description is a description object of a character

type Family

type Family struct {
	FamilyName string
	Parents    Couple
	Children   []Character
}

Family is a family of characters

func GenerateFamily

func GenerateFamily() (Family, error)

GenerateFamily generates a random family

type Hobby

type Hobby struct {
	Name                  string
	RequiresOthers        bool
	PossibleAgeCategories []string
}

Hobby is a pasttime

type SimplifiedCharacter

type SimplifiedCharacter struct {
	Name        string `json:"name"`
	Titles      string `json:"titles"`
	Blazon      string `json:"blazon"`
	Device      string `json:"device"`
	Description string `json:"description"`
}

SimplifiedCharacter is a simplified version of a character

func RandomSimplified

func RandomSimplified() (SimplifiedCharacter, error)

RandomSimplified returns a random simplified character

Jump to

Keyboard shortcuts

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