rpg

package
v0.0.0-...-2271788 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CharacterRaceDefault = "Human"

	CharacterSexualityHeterosexual = 0
	CharacterSexualityHomosexual   = 2
	CharacterSexualityBisexual     = 3
	CharacterSexualityAsexual      = 4
)
View Source
const (
	LocationTypeWorld     = 0
	LocationTypeContinent = 1
	LocationTypeCountry   = 2
	LocationTypeProvince  = 3
	LocationTypeCity      = 4
	LocationTypeTown      = 5
	LocationTypeVillage   = 6
	LocationTypeHamlet    = 7
	LocationTypeThorp     = 8
	LocationTypeDistrict  = 9
	LocationTypeUnit      = 10
)

Variables

View Source
var (
	CharacterSexualities = []uint8{
		CharacterSexualityHeterosexual,
		CharacterSexualityHomosexual,
		CharacterSexualityBisexual,
		CharacterSexualityAsexual,
	}

	CharacterSexualitiesWeights = []uint{10, 4, 1, 1}
)

Functions

func GenerateCityLocationType

func GenerateCityLocationType() uint8

func GenerateLargeLocationType

func GenerateLargeLocationType() uint8

func GenerateLocalLocationType

func GenerateLocalLocationType() uint8

func NextSmallestLocationType

func NextSmallestLocationType(locType uint8) uint8

Types

type Campaign

type Campaign struct {
	Name             string
	ID               primitive.ObjectID `bson:"_id,omitempty"`
	StartDate        uint
	PlayerCharacters []*Character
}

func NewCampaign

func NewCampaign(name string) *Campaign

type Character

type Character struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"`
	Name            string
	Race            string
	Culture         string
	Profession      string
	Gender          string
	Sexuality       uint8
	Religion        string
	Characteristics map[string]EntityTag `json:"-"`
	Level           uint64
	GenerationDelta int                `json:"Generation Delta,omitempty"`
	YOBDelta        int                `json:"Year of Birth Delta,omitempty"`
	YODDelta        int                `json:"Year of Death Delta,omitempty"`
	DateDeltas      []Date             `json:"Date Deltas,omitempty"`
	MotherID        primitive.ObjectID `json:"Mother ID,omitempty"`
	FatherID        primitive.ObjectID `json:"Father ID,omitempty"`
	LocationID      primitive.ObjectID `json:"Location ID,omitempty"`
	PC              bool               `json:"-"`
}

func NewCharacter

func NewCharacter(name, gender string) *Character

type Date

type Date struct {
	Delta                uint
	AddSpouseID          uint `json:",omitempty" bson:",omitempty"`
	RemoveSpouseID       uint `json:",omitempty" bson:",omitempty"`
	EmployerID           uint `json:",omitempty" bson:",omitempty"`
	AddCharacteristic    uint `json:",omitempty" bson:",omitempty"`
	RemoveCharacteristic uint `json:",omitempty" bson:",omitempty"`
}

type EntityTag

type EntityTag struct {
	ID    primitive.ObjectID `bson:"_id,omitempty"`
	Name  string
	Value string
}

type Location

type Location struct {
	Name string
	ID   primitive.ObjectID `bson:"_id,omitempty"`
	Tags []EntityTag        `json:",omitempty" bson:",omitempty"`
	Type uint8
}

type Region

type Region struct {
	Location
	Connections []*Region `json:"-" bson:"-"`
	Subregions  []Region  `json:",omitempty" bson:",omitempty"`
}

func MakeRegion

func MakeRegion(name string, locType uint8) Region

func (*Region) IsLargeLocation

func (r *Region) IsLargeLocation() bool

type Settlement

type Settlement struct {
	Location
	Size      uint8
	Locations []Location
}

type World

type World struct {
	Location
	Regions []Region
}

func NewWorld

func NewWorld(name string) *World

Jump to

Keyboard shortcuts

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