sotdlgen

package module
v0.0.0-...-7da3162 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

README

Character Generator for Shаdow of the Demоn Lоrd

Go Report Card

Documentation

Overview

Package sotdlgen implements a character generator for the SotDL RPG.

Index

Constants

View Source
const VERSION = "0.2.2"

VERSION number.

Variables

This section is empty.

Functions

func PDFToText

func PDFToText(fn string, out io.Writer) error

PDFToText processes a PDF file with pdftotext. Adapted from <https://github.com/plimble/gika>.

Types

type Armor

type Armor struct {
	// TODO: Implement armor.
	Name         string `json:"name"`
	Type         string `json:"type"`
	DefenseBonus int    `json:"defense"`
}

Armor represents properties of a given suit of armor.

type Attributes

type Attributes struct {
	Strength    int    `json:"strength"`
	Agility     int    `json:"agility"`
	Intellect   int    `json:"intellect"`
	Will        int    `json:"will"`
	Speed       int    `json:"speed"`
	Power       int    `json:"power"`
	Health      int    `json:"health"`
	Size        string `json:"size"`
	Insanity    int    `json:"insanity"`
	Corruption  int    `json:"corruption"`
	Defense     int    `json:"defense"`
	Perception  int    `json:"perception"`
	HealingRate int    `json:"healing_rate"`
	// contains filtered or unexported fields
}

Attributes represents character statistics.

type CharDB

type CharDB struct {
	Paths map[string]Levels `json:"paths"`
	Names []NameList        `json:"names"`
}

CharDB represents path data extracted from the core rules PDF, along with a list of names for random character naming.

func NewCharDB

func NewCharDB(pdfFn string, analyze bool) (db CharDB, err error)

NewCharDB creates a new SotDL character database.

type Character

type Character struct {
	Name        string     `json:"name"`
	Gender      string     `json:"gender"`
	Ancestry    string     `json:"ancestry"`
	LangAndProf []string   `json:"languages_and_professions"`
	NovicePath  string     `json:"novice_path"`
	ExpertPath  string     `json:"expert_path"`
	MasterPath  string     `json:"master_path"`
	Talents     []string   `json:"talents"`
	Level       int        `json:"level"`
	Attributes  Attributes `json:"attributes"`
	Seed        string     `json:"seed"`
}

Character represents the primary features of the character.

func NewCharacter

func NewCharacter(opts Opts) (c Character, err error)

NewCharacter generates a SotDL character given a set of user options.

func (Character) Print

func (c Character) Print()

Print writes tab-delimited character details to STDOUT.

func (Character) ToJSON

func (c Character) ToJSON(pretty bool) string

ToJSON writes JSON character details to STDOUT.

type Die

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

Die represents a single die of the form <code>D6+<pips>.

type Level

type Level struct {
	Strength      int      `json:"strength"`
	Agility       int      `json:"agility"`
	Intellect     int      `json:"intellect"`
	Will          int      `json:"will"`
	PerceptionMod int      `json:"perception_mod"`
	DefenseMod    int      `json:"defense_mod"`
	HealthMod     int      `json:"health_mod"`
	HealingRate   float64  `json:"healing_rate"`
	Speed         int      `json:"speed"`
	Power         int      `json:"power"`
	Damage        int      `json:"damage"`
	Insanity      int      `json:"insanity"`
	Corruption    int      `json:"corruption"`
	Size          string   `json:"size"`
	LangAndProf   []string `json:"lang_and_prof"`
	Talents       []string `json:"talents"`
}

Level contains attributes and characteristics, as well as narrative talents and professions/languages extracted from the core rules. A single level represents an ancestry or path at a given character level.

type Levels

type Levels map[int]*Level

Levels is a map of Level structs.

type NameList

type NameList struct {
	Ancestry  string   `json:"ancestry"`
	Ethnicity string   `json:"ethnicity"`
	Type      string   `json:"type"`
	Names     []string `json:"names"`
}

NameList represents the list of names for a given ancestry, ethnicity, and type.

type Opts

type Opts struct {
	Age         string
	Ancestry    string `docopt:"--ancestry"`
	Background  string
	Description string
	ExpertPath  string `docopt:"--expert-path"`
	Gender      string `docopt:"--gender"`
	Languages   string
	Level       string `docopt:"--level"`
	LogLevel    string `docopt:"--log-level"`
	MasterPath  string `docopt:"--master-path"`
	Name        string `docopt:"--name"`
	NovicePath  string `docopt:"--novice-path"`
	Professions string
	Seed        string `docopt:"--seed"`
	DataFile    string `docopt:"--data-file"`
}

Opts contains user input optionsr; used in CLI implementations.

type Patterns

type Patterns map[int]*regexp.Regexp

Patterns is a map of compiled regular expressions.

type Spell

type Spell struct {
	// TODO: Implement spells.
	Name         string `json:"name"`
	Type         string `json:"type"`
	Rank         int    `json:"rank"`
	Target       string `json:"target"`
	Area         string `json:"area"`
	Duration     string `json:"duration"`
	Triggered    bool   `json:"triggered"`
	Sacrifice    bool   `json:"sacrifice"`
	Permanence   bool   `json:"permanence"`
	AttackRoll20 string `json:"attack_20+"`
	Description  string `json:"description"`
}

Spell represents properties of a given spell.

type Weapon

type Weapon struct {
	// TODO: Implement weapons.
	Name         string `json:"name"`
	Type         string `json:"type"`
	Hands        string `json:"hands"`
	Cumbersome   bool   `json:"cumbersome"`
	Finesse      bool   `json:"finesse"`
	DefenseBonus int    `json:"defense_bonus"`
	Misfire      bool   `json:"misfire"`
	Range        string `json:"range"`
	Reach        int    `json:"reach"`
	Reload       bool   `json:"reload"`
	Size         int    `json:"size"`
	Uses         string `json:"uses"`
	Thrown       bool   `json:"thrown"`
	Damage       Die    `json:"damage"`
}

Weapon represents properties of a given weapon.

Directories

Path Synopsis
cmd
sotdlgen
Package main implements a simple CLI for sotdlgen.
Package main implements a simple CLI for sotdlgen.

Jump to

Keyboard shortcuts

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