microdungeon

package module
v0.0.0-...-f684b4e Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

README

microdungeon

A D&D style protocol buffer type structure with advanced logic written in Go.

Contributing

Feel like something is missing that we haven't added, or feel like just messing with the code? Then feel free to fork this project and type away.

Clone this project locally,
either with the git command line (git clone git@github.com:JustAnotherOrganization/microdungeon),
go get (go get github.com/justanotherorganization/microdungeon),
or with the Github for Desktop application.

After you're done making the changes, please then make sure that your pull request to the branch master references an open issue. If there is not one open already, then please make a new one describing the lack of feature, or the need for the change. After that we should get back to you and after discussing the change, and we may merge it.

Please be aware of the Apache-2 Licence, and read through it, as the code here and any other versions of it carries this license.

Documentation

Overview

Package microdungeon is a generated protocol buffer package.

It is generated from these files:

ability_scores.proto
alignment.proto
armour.proto
character.proto
class.proto
damage.proto
race.proto
skill.proto
types.proto
weapon.proto

It has these top-level messages:

Ability
Score
Modifier
Alignment
Armour
Character
Class
Race
Skill
Calculator
Ammunition
Weapon

Index

Constants

View Source
const (
	// LawfulGood alignment.
	LawfulGood = "Lawful Good"
	// NeutralGood alignment.
	NeutralGood = "Neutral Good"
	// ChaoticGood alignment.
	ChaoticGood = "Chaotic Good"
	// LawfulNeutral alignment
	LawfulNeutral = "Lawful Neutral"
	// Neutral alignment
	Neutral = "Neutral"
	// ChaoticNeutral alignment
	ChaoticNeutral = "Chaotic Neutral"
	// LawfulEvil alignment
	LawfulEvil = "Lawful Evil"
	// NeutralEvil alignment
	NeutralEvil = "Neutral Evil"
	// ChaoticEvil alignment
	ChaoticEvil = "Chaotic Evil"
)

Variables

View Source
var (
	// MaxRings is the max number of rings a character can wear.
	// TODO: make this dependent on race (we may want to support a race with
	// 3 hands for example).
	MaxRings = 2
	// MaxUnknown is the max number of unknown items a character can wear.
	MaxUnknown = 3
)
View Source
var AbilityType_name = map[int32]string{
	0: "UNKNOWN",
	1: "STRENGTH",
	2: "DEXTERITY",
	3: "CONSTITION",
	4: "INTELLIGENCE",
	5: "WISDOM",
	6: "CHARISMA",
}
View Source
var AbilityType_value = map[string]int32{
	"UNKNOWN":      0,
	"STRENGTH":     1,
	"DEXTERITY":    2,
	"CONSTITION":   3,
	"INTELLIGENCE": 4,
	"WISDOM":       5,
	"CHARISMA":     6,
}
View Source
var Ammunition_Type_name = map[int32]string{
	0: "UNKNOWN_TYPE",
	1: "ARROW",
	2: "BOLT",
	3: "PEBBLE",
}
View Source
var Ammunition_Type_value = map[string]int32{
	"UNKNOWN_TYPE": 0,
	"ARROW":        1,
	"BOLT":         2,
	"PEBBLE":       3,
}
View Source
var Armour_Type_name = map[int32]string{
	0: "UNKNOWN",
	1: "HEADGEAR",
	2: "MAIN",
	3: "GLOVES",
	4: "BOOTS",
	5: "RING",
	6: "BELT",
	7: "CLOAK",
	8: "SHIELD",
	9: "GLASSES",
}
View Source
var Armour_Type_value = map[string]int32{
	"UNKNOWN":  0,
	"HEADGEAR": 1,
	"MAIN":     2,
	"GLOVES":   3,
	"BOOTS":    4,
	"RING":     5,
	"BELT":     6,
	"CLOAK":    7,
	"SHIELD":   8,
	"GLASSES":  9,
}
View Source
var Character_Gender_name = map[int32]string{
	0: "NEUTER",
	1: "MALE",
	2: "FEMALE",
}
View Source
var Character_Gender_value = map[string]int32{
	"NEUTER": 0,
	"MALE":   1,
	"FEMALE": 2,
}
View Source
var DamageType_name = map[int32]string{
	0: "UNKNOWN_DAMAGE_TYPE",
	1: "BLUDGEONING",
	2: "PIERCING",
	3: "SLASHING",
}
View Source
var DamageType_value = map[string]int32{
	"UNKNOWN_DAMAGE_TYPE": 0,
	"BLUDGEONING":         1,
	"PIERCING":            2,
	"SLASHING":            3,
}
View Source
var Weapon_Type_name = map[int32]string{
	0:   "UNKNOWN_TYPE",
	1:   "DAGGER",
	2:   "SHORT_BLADE",
	3:   "LONG_BLADE",
	4:   "HAMMER",
	5:   "AXE",
	6:   "POLE_ARM",
	50:  "BOW",
	51:  "CROSSBOW",
	100: "BLACK_POWDER_PISTOL",
	101: "BLACK_POWDER_RIFLE",
	102: "PISTOL",
	103: "RIFLE",
	150: "CANNON",
}
View Source
var Weapon_Type_value = map[string]int32{
	"UNKNOWN_TYPE":        0,
	"DAGGER":              1,
	"SHORT_BLADE":         2,
	"LONG_BLADE":          3,
	"HAMMER":              4,
	"AXE":                 5,
	"POLE_ARM":            6,
	"BOW":                 50,
	"CROSSBOW":            51,
	"BLACK_POWDER_PISTOL": 100,
	"BLACK_POWDER_RIFLE":  101,
	"PISTOL":              102,
	"RIFLE":               103,
	"CANNON":              150,
}
View Source
var WeightClass_name = map[int32]string{
	0: "UNKNOWN_WEIGHT_CLASS",
	1: "LIGHT",
	2: "MEDIUM",
	3: "HEAVY",
}
View Source
var WeightClass_value = map[string]int32{
	"UNKNOWN_WEIGHT_CLASS": 0,
	"LIGHT":                1,
	"MEDIUM":               2,
	"HEAVY":                3,
}

Functions

This section is empty.

Types

type Ability

type Ability struct {
	Type  AbilityType `protobuf:"varint,1,opt,name=type,proto3,enum=microdungeon.AbilityType" json:"type,omitempty"`
	Value int32       `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

Ability is a standard D&D ability.

func (*Ability) Descriptor

func (*Ability) Descriptor() ([]byte, []int)

func (*Ability) GetType

func (m *Ability) GetType() AbilityType

func (*Ability) GetValue

func (m *Ability) GetValue() int32

func (*Ability) ProtoMessage

func (*Ability) ProtoMessage()

func (*Ability) Reset

func (m *Ability) Reset()

func (*Ability) String

func (m *Ability) String() string

type AbilityType

type AbilityType int32
const (
	AbilityType_UNKNOWN      AbilityType = 0
	AbilityType_STRENGTH     AbilityType = 1
	AbilityType_DEXTERITY    AbilityType = 2
	AbilityType_CONSTITION   AbilityType = 3
	AbilityType_INTELLIGENCE AbilityType = 4
	AbilityType_WISDOM       AbilityType = 5
	AbilityType_CHARISMA     AbilityType = 6
)

func (AbilityType) EnumDescriptor

func (AbilityType) EnumDescriptor() ([]byte, []int)

func (AbilityType) String

func (x AbilityType) String() string

type Alignment

type Alignment struct {
	Ethical int32 `protobuf:"varint,1,opt,name=ethical,proto3" json:"ethical,omitempty"`
	Moral   int32 `protobuf:"varint,2,opt,name=moral,proto3" json:"moral,omitempty"`
}

Alignment is a standard alignment state.

func ChaoticEvilAlignment

func ChaoticEvilAlignment() *Alignment

ChaoticEvilAlignment returns a starting ChaoticEvil Alignment.

func ChaoticGoodAlignment

func ChaoticGoodAlignment() *Alignment

ChaoticGoodAlignment returns a starting ChaoticGood Alignment.

func ChaoticNeutralAlignment

func ChaoticNeutralAlignment() *Alignment

ChaoticNeutralAlignment returns a starting ChaoticNeutral Alignment.

func LawfulEvilAlignment

func LawfulEvilAlignment() *Alignment

LawfulEvilAlignment returns a starting LawfulEvil Alignment.

func LawfulGoodAlignment

func LawfulGoodAlignment() *Alignment

LawfulGoodAlignment returns a starting LawfulGood Alignment.

func LawfulNeutralAlignment

func LawfulNeutralAlignment() *Alignment

LawfulNeutralAlignment returns a starting LawfulNeutral Alignment.

func NeutralAlignment

func NeutralAlignment() *Alignment

NeutralAlignment returns a true Neutral Alignment.

func NeutralEvilAlignment

func NeutralEvilAlignment() *Alignment

NeutralEvilAlignment returns a starting NeutralEvilAlignment.

func NeutralGoodAlignment

func NeutralGoodAlignment() *Alignment

NeutralGoodAlignment returns a starting NeutralGood Alignment.

func (*Alignment) Descriptor

func (*Alignment) Descriptor() ([]byte, []int)

func (*Alignment) GetEthical

func (m *Alignment) GetEthical() int32

func (*Alignment) GetMoral

func (m *Alignment) GetMoral() int32

func (*Alignment) ProtoMessage

func (*Alignment) ProtoMessage()

func (*Alignment) Reset

func (m *Alignment) Reset()

func (*Alignment) String

func (a *Alignment) String() string

String returns the recognized string name of the given Alignment.

type Ammunition

type Ammunition struct {
	Name          string          `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Aliases       []string        `protobuf:"bytes,2,rep,name=aliases" json:"aliases,omitempty"`
	Description   string          `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	DamageType    DamageType      `protobuf:"varint,4,opt,name=damage_type,json=damageType,proto3,enum=microdungeon.DamageType" json:"damage_type,omitempty"`
	Type          Ammunition_Type `protobuf:"varint,5,opt,name=type,proto3,enum=microdungeon.Ammunition_Type" json:"type,omitempty"`
	Wc            *Calculator     `protobuf:"bytes,6,opt,name=wc" json:"wc,omitempty"`
	Modifiers     []*Modifier     `protobuf:"bytes,7,rep,name=modifiers" json:"modifiers,omitempty"`
	Weight        uint32          `protobuf:"varint,8,opt,name=weight,proto3" json:"weight,omitempty"`
	RangeModifier uint32          `protobuf:"varint,9,opt,name=range_modifier,json=rangeModifier,proto3" json:"range_modifier,omitempty"`
}

Ammunition implements ammunition for projectile weapons.

func (*Ammunition) Descriptor

func (*Ammunition) Descriptor() ([]byte, []int)

func (*Ammunition) GetAliases

func (m *Ammunition) GetAliases() []string

func (*Ammunition) GetDamageType

func (m *Ammunition) GetDamageType() DamageType

func (*Ammunition) GetDescription

func (m *Ammunition) GetDescription() string

func (*Ammunition) GetModifiers

func (m *Ammunition) GetModifiers() []*Modifier

func (*Ammunition) GetName

func (m *Ammunition) GetName() string

func (*Ammunition) GetRangeModifier

func (m *Ammunition) GetRangeModifier() uint32

func (*Ammunition) GetType

func (m *Ammunition) GetType() Ammunition_Type

func (*Ammunition) GetWc

func (m *Ammunition) GetWc() *Calculator

func (*Ammunition) GetWeight

func (m *Ammunition) GetWeight() uint32

func (*Ammunition) ProtoMessage

func (*Ammunition) ProtoMessage()

func (*Ammunition) Reset

func (m *Ammunition) Reset()

func (*Ammunition) String

func (m *Ammunition) String() string

type Ammunition_Type

type Ammunition_Type int32
const (
	Ammunition_UNKNOWN_TYPE Ammunition_Type = 0
	Ammunition_ARROW        Ammunition_Type = 1
	Ammunition_BOLT         Ammunition_Type = 2
	Ammunition_PEBBLE       Ammunition_Type = 3
)

func (Ammunition_Type) EnumDescriptor

func (Ammunition_Type) EnumDescriptor() ([]byte, []int)

func (Ammunition_Type) String

func (x Ammunition_Type) String() string

type Armour

type Armour struct {
	Name             string      `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Aliases          []string    `protobuf:"bytes,2,rep,name=aliases" json:"aliases,omitempty"`
	Description      string      `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	WeightClass      WeightClass `protobuf:"varint,4,opt,name=weight_class,json=weightClass,proto3,enum=microdungeon.WeightClass" json:"weight_class,omitempty"`
	Type             Armour_Type `protobuf:"varint,5,opt,name=type,proto3,enum=microdungeon.Armour_Type" json:"type,omitempty"`
	Ac               *Calculator `protobuf:"bytes,6,opt,name=ac" json:"ac,omitempty"`
	Modifiers        []*Modifier `protobuf:"bytes,7,rep,name=modifiers" json:"modifiers,omitempty"`
	StealthAdvantage bool        `protobuf:"varint,8,opt,name=stealth_advantage,json=stealthAdvantage,proto3" json:"stealth_advantage,omitempty"`
	Weight           uint32      `protobuf:"varint,9,opt,name=weight,proto3" json:"weight,omitempty"`
	Worn             bool        `protobuf:"varint,100,opt,name=worn,proto3" json:"worn,omitempty"`
}

Armour is the basis for all armour.

func (*Armour) Descriptor

func (*Armour) Descriptor() ([]byte, []int)

func (*Armour) GetAc

func (m *Armour) GetAc() *Calculator

func (*Armour) GetAliases

func (m *Armour) GetAliases() []string

func (*Armour) GetDescription

func (m *Armour) GetDescription() string

func (*Armour) GetModifiers

func (m *Armour) GetModifiers() []*Modifier

func (*Armour) GetName

func (m *Armour) GetName() string

func (*Armour) GetStealthAdvantage

func (m *Armour) GetStealthAdvantage() bool

func (*Armour) GetType

func (m *Armour) GetType() Armour_Type

func (*Armour) GetWeight

func (m *Armour) GetWeight() uint32

func (*Armour) GetWeightClass

func (m *Armour) GetWeightClass() WeightClass

func (*Armour) GetWorn

func (m *Armour) GetWorn() bool

func (*Armour) ProtoMessage

func (*Armour) ProtoMessage()

func (*Armour) Reset

func (m *Armour) Reset()

func (*Armour) String

func (m *Armour) String() string

func (*Armour) Wear

func (a *Armour) Wear(c *Character) error

Wear a piece of armour.

type Armour_Type

type Armour_Type int32
const (
	Armour_UNKNOWN  Armour_Type = 0
	Armour_HEADGEAR Armour_Type = 1
	Armour_MAIN     Armour_Type = 2
	Armour_GLOVES   Armour_Type = 3
	Armour_BOOTS    Armour_Type = 4
	Armour_RING     Armour_Type = 5
	Armour_BELT     Armour_Type = 6
	Armour_CLOAK    Armour_Type = 7
	Armour_SHIELD   Armour_Type = 8
	Armour_GLASSES  Armour_Type = 9
)

func (Armour_Type) EnumDescriptor

func (Armour_Type) EnumDescriptor() ([]byte, []int)

func (Armour_Type) String

func (x Armour_Type) String() string

type Calculator

type Calculator struct {
	Base      uint32      `protobuf:"varint,1,opt,name=base,proto3" json:"base,omitempty"`
	Modifiers []*Modifier `protobuf:"bytes,2,rep,name=modifiers" json:"modifiers,omitempty"`
}

Calculator implements a simple method of using ability modifiers to calculate things such as WC and AC.

func (*Calculator) Descriptor

func (*Calculator) Descriptor() ([]byte, []int)

func (*Calculator) GetBase

func (m *Calculator) GetBase() uint32

func (*Calculator) GetModifiers

func (m *Calculator) GetModifiers() []*Modifier

func (*Calculator) ProtoMessage

func (*Calculator) ProtoMessage()

func (*Calculator) Reset

func (m *Calculator) Reset()

func (*Calculator) String

func (m *Calculator) String() string

type Character

type Character struct {
	Name       string           `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	PlayerName string           `protobuf:"bytes,2,opt,name=player_name,json=playerName,proto3" json:"player_name,omitempty"`
	Gender     Character_Gender `protobuf:"varint,3,opt,name=gender,proto3,enum=microdungeon.Character_Gender" json:"gender,omitempty"`
	Race       *Race            `protobuf:"bytes,4,opt,name=race" json:"race,omitempty"`
	// Class class = 5;
	Level      uint32     `protobuf:"varint,6,opt,name=level,proto3" json:"level,omitempty"`
	Alignment  *Alignment `protobuf:"bytes,7,opt,name=alignment" json:"alignment,omitempty"`
	Experience uint32     `protobuf:"varint,8,opt,name=experience,proto3" json:"experience,omitempty"`
	Score      *Score     `protobuf:"bytes,9,opt,name=score" json:"score,omitempty"`
	Wielding   *Weapon    `protobuf:"bytes,100,opt,name=wielding" json:"wielding,omitempty"`
	Armour     []*Armour  `protobuf:"bytes,101,rep,name=armour" json:"armour,omitempty"`
}

Character is a playable D&D character.

func (*Character) Descriptor

func (*Character) Descriptor() ([]byte, []int)

func (*Character) GetAlignment

func (m *Character) GetAlignment() *Alignment

func (*Character) GetArmour

func (m *Character) GetArmour() []*Armour

func (*Character) GetExperience

func (m *Character) GetExperience() uint32

func (*Character) GetGender

func (m *Character) GetGender() Character_Gender

func (*Character) GetLevel

func (m *Character) GetLevel() uint32

func (*Character) GetName

func (m *Character) GetName() string

func (*Character) GetPlayerName

func (m *Character) GetPlayerName() string

func (*Character) GetRace

func (m *Character) GetRace() *Race

func (*Character) GetScore

func (m *Character) GetScore() *Score

func (*Character) GetWielding

func (m *Character) GetWielding() *Weapon

func (*Character) ProtoMessage

func (*Character) ProtoMessage()

func (*Character) Reset

func (m *Character) Reset()

func (*Character) String

func (m *Character) String() string

type Character_Gender

type Character_Gender int32
const (
	Character_NEUTER Character_Gender = 0
	Character_MALE   Character_Gender = 1
	Character_FEMALE Character_Gender = 2
)

func (Character_Gender) EnumDescriptor

func (Character_Gender) EnumDescriptor() ([]byte, []int)

func (Character_Gender) String

func (x Character_Gender) String() string

type Class

type Class struct {
	Name             string        `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	HitDie           uint32        `protobuf:"varint,2,opt,name=hit_die,json=hitDie,proto3" json:"hit_die,omitempty"`
	PrimaryAbilities []AbilityType `` /* 140-byte string literal not displayed */
}

Class is a playable D&D class.

func (*Class) Descriptor

func (*Class) Descriptor() ([]byte, []int)

func (*Class) GetHitDie

func (m *Class) GetHitDie() uint32

func (*Class) GetName

func (m *Class) GetName() string

func (*Class) GetPrimaryAbilities

func (m *Class) GetPrimaryAbilities() []AbilityType

func (*Class) ProtoMessage

func (*Class) ProtoMessage()

func (*Class) Reset

func (m *Class) Reset()

func (*Class) String

func (m *Class) String() string

type DamageType

type DamageType int32

DamageType helps define types of damage.

const (
	DamageType_UNKNOWN_DAMAGE_TYPE DamageType = 0
	DamageType_BLUDGEONING         DamageType = 1
	DamageType_PIERCING            DamageType = 2
	DamageType_SLASHING            DamageType = 3
)

func (DamageType) EnumDescriptor

func (DamageType) EnumDescriptor() ([]byte, []int)

func (DamageType) String

func (x DamageType) String() string

type Modifier

type Modifier struct {
	Type AbilityType `protobuf:"varint,1,opt,name=type,proto3,enum=microdungeon.AbilityType" json:"type,omitempty"`
	Max  int32       `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	Die  int32       `protobuf:"varint,3,opt,name=die,proto3" json:"die,omitempty"`
}

Modifier is a standard D&D ability modifier.

func (*Modifier) Descriptor

func (*Modifier) Descriptor() ([]byte, []int)

func (*Modifier) Get

func (m *Modifier) Get(sc *Score) (int32, error)

Get the final modifier value from the given modifier.

func (*Modifier) GetDie

func (m *Modifier) GetDie() int32

func (*Modifier) GetMax

func (m *Modifier) GetMax() int32

func (*Modifier) GetType

func (m *Modifier) GetType() AbilityType

func (*Modifier) ProtoMessage

func (*Modifier) ProtoMessage()

func (*Modifier) Reset

func (m *Modifier) Reset()

func (*Modifier) String

func (m *Modifier) String() string

type Race

type Race struct {
	Name           string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Genus          string   `protobuf:"bytes,2,opt,name=genus,proto3" json:"genus,omitempty"`
	Description    string   `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Score          *Score   `protobuf:"bytes,4,opt,name=score" json:"score,omitempty"`
	NightVision    bool     `protobuf:"varint,5,opt,name=night_vision,json=nightVision,proto3" json:"night_vision,omitempty"`
	KnownLanguages []string `protobuf:"bytes,6,rep,name=known_languages,json=knownLanguages" json:"known_languages,omitempty"`
	Undead         bool     `protobuf:"varint,7,opt,name=undead,proto3" json:"undead,omitempty"`
}

Race is a playable D&D race.

func (*Race) Descriptor

func (*Race) Descriptor() ([]byte, []int)

func (*Race) GetDescription

func (m *Race) GetDescription() string

func (*Race) GetGenus

func (m *Race) GetGenus() string

func (*Race) GetKnownLanguages

func (m *Race) GetKnownLanguages() []string

func (*Race) GetName

func (m *Race) GetName() string

func (*Race) GetNightVision

func (m *Race) GetNightVision() bool

func (*Race) GetScore

func (m *Race) GetScore() *Score

func (*Race) GetUndead

func (m *Race) GetUndead() bool

func (*Race) ProtoMessage

func (*Race) ProtoMessage()

func (*Race) Reset

func (m *Race) Reset()

func (*Race) String

func (m *Race) String() string

type Score

type Score struct {
	Set []*Ability `protobuf:"bytes,1,rep,name=set" json:"set,omitempty"`
}

Score houses all the ability scores of a given object.

func (*Score) Charisma

func (sc *Score) Charisma() int32

Charisma returns the total Charisma of the given score set.

func (*Score) Constitution

func (sc *Score) Constitution() int32

Constitution returns the total Constitution of the given score set.

func (*Score) Descriptor

func (*Score) Descriptor() ([]byte, []int)

func (*Score) Dexterity

func (sc *Score) Dexterity() int32

Dexterity returns the total Dexterity of the given score set.

func (*Score) GetSet

func (m *Score) GetSet() []*Ability

func (*Score) Intelligence

func (sc *Score) Intelligence() int32

Intelligence returns the total Intelligence of the given score set.

func (*Score) ProtoMessage

func (*Score) ProtoMessage()

func (*Score) Reset

func (m *Score) Reset()

func (*Score) Strength

func (sc *Score) Strength() int32

Strength returns the total Strength of the given score set.

func (*Score) String

func (m *Score) String() string

func (*Score) Wisdom

func (sc *Score) Wisdom() int32

Wisdom returns the total Wisdom of the given score set.

type Skill

type Skill struct {
	Name            string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description     string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	DifficultyClass uint32 `protobuf:"varint,3,opt,name=DifficultyClass,proto3" json:"DifficultyClass,omitempty"`
	// armour_check_penalty = 4; // Determine type...
	Modifiers []*Modifier `protobuf:"bytes,5,rep,name=modifiers" json:"modifiers,omitempty"`
	Trained   bool        `protobuf:"varint,6,opt,name=trained,proto3" json:"trained,omitempty"`
}

Skill is a usable D&D skill.

func (*Skill) Descriptor

func (*Skill) Descriptor() ([]byte, []int)

func (*Skill) Do

func (sk *Skill) Do(roll int32, char *Character) (int32, bool, error)

Do the skill.

func (*Skill) GetDescription

func (m *Skill) GetDescription() string

func (*Skill) GetDifficultyClass

func (m *Skill) GetDifficultyClass() uint32

func (*Skill) GetModifiers

func (m *Skill) GetModifiers() []*Modifier

func (*Skill) GetName

func (m *Skill) GetName() string

func (*Skill) GetTrained

func (m *Skill) GetTrained() bool

func (*Skill) ProtoMessage

func (*Skill) ProtoMessage()

func (*Skill) Reset

func (m *Skill) Reset()

func (*Skill) String

func (m *Skill) String() string

type Weapon

type Weapon struct {
	Name             string      `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Aliases          []string    `protobuf:"bytes,2,rep,name=aliases" json:"aliases,omitempty"`
	Description      string      `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	WeightClass      WeightClass `protobuf:"varint,4,opt,name=weight_class,json=weightClass,proto3,enum=microdungeon.WeightClass" json:"weight_class,omitempty"`
	Type             Weapon_Type `protobuf:"varint,5,opt,name=type,proto3,enum=microdungeon.Weapon_Type" json:"type,omitempty"`
	Wc               *Calculator `protobuf:"bytes,6,opt,name=wc" json:"wc,omitempty"`
	Modifiers        []*Modifier `protobuf:"bytes,7,rep,name=modifiers" json:"modifiers,omitempty"`
	StealthAdvantage bool        `protobuf:"varint,8,opt,name=stealth_advantage,json=stealthAdvantage,proto3" json:"stealth_advantage,omitempty"`
	Weight           uint32      `protobuf:"varint,9,opt,name=weight,proto3" json:"weight,omitempty"`
	Thrown           bool        `protobuf:"varint,10,opt,name=thrown,proto3" json:"thrown,omitempty"`
	Reach            bool        `protobuf:"varint,12,opt,name=reach,proto3" json:"reach,omitempty"`
	TwoHanded        bool        `protobuf:"varint,13,opt,name=two_handed,json=twoHanded,proto3" json:"two_handed,omitempty"`
	Versatile        bool        `protobuf:"varint,14,opt,name=versatile,proto3" json:"versatile,omitempty"`
	// Types that are valid to be assigned to Attributes:
	//	*Weapon_DamageType
	//	*Weapon_ProjectileAttributes_
	Attributes isWeapon_Attributes `protobuf_oneof:"attributes"`
	// TODO: reduce this number once we have a better idea of used fields.
	Wielded bool `protobuf:"varint,100,opt,name=wielded,proto3" json:"wielded,omitempty"`
}

Weapon is the basis for all weapons.

func (*Weapon) Descriptor

func (*Weapon) Descriptor() ([]byte, []int)

func (*Weapon) GetAliases

func (m *Weapon) GetAliases() []string

func (*Weapon) GetAttributes

func (m *Weapon) GetAttributes() isWeapon_Attributes

func (*Weapon) GetDamageType

func (m *Weapon) GetDamageType() DamageType

func (*Weapon) GetDescription

func (m *Weapon) GetDescription() string

func (*Weapon) GetModifiers

func (m *Weapon) GetModifiers() []*Modifier

func (*Weapon) GetName

func (m *Weapon) GetName() string

func (*Weapon) GetProjectileAttributes

func (m *Weapon) GetProjectileAttributes() *Weapon_ProjectileAttributes

func (*Weapon) GetReach

func (m *Weapon) GetReach() bool

func (*Weapon) GetStealthAdvantage

func (m *Weapon) GetStealthAdvantage() bool

func (*Weapon) GetThrown

func (m *Weapon) GetThrown() bool

func (*Weapon) GetTwoHanded

func (m *Weapon) GetTwoHanded() bool

func (*Weapon) GetType

func (m *Weapon) GetType() Weapon_Type

func (*Weapon) GetVersatile

func (m *Weapon) GetVersatile() bool

func (*Weapon) GetWc

func (m *Weapon) GetWc() *Calculator

func (*Weapon) GetWeight

func (m *Weapon) GetWeight() uint32

func (*Weapon) GetWeightClass

func (m *Weapon) GetWeightClass() WeightClass

func (*Weapon) GetWielded

func (m *Weapon) GetWielded() bool

func (*Weapon) ProtoMessage

func (*Weapon) ProtoMessage()

func (*Weapon) Reset

func (m *Weapon) Reset()

func (*Weapon) String

func (m *Weapon) String() string

func (*Weapon) Unwield

func (w *Weapon) Unwield(c *Character) error

Unwield a weapon.

func (*Weapon) Wield

func (w *Weapon) Wield(c *Character) error

Wield a weapon.

func (*Weapon) XXX_OneofFuncs

func (*Weapon) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Weapon_DamageType

type Weapon_DamageType struct {
	DamageType DamageType `protobuf:"varint,15,opt,name=damage_type,json=damageType,proto3,enum=microdungeon.DamageType,oneof"`
}

type Weapon_ProjectileAttributes

type Weapon_ProjectileAttributes struct {
	Type         Ammunition_Type `protobuf:"varint,1,opt,name=type,proto3,enum=microdungeon.Ammunition_Type" json:"type,omitempty"`
	PerShot      uint32          `protobuf:"varint,2,opt,name=per_shot,json=perShot,proto3" json:"per_shot,omitempty"`
	RangeMin     uint32          `protobuf:"varint,3,opt,name=range_min,json=rangeMin,proto3" json:"range_min,omitempty"`
	RangeMax     uint32          `protobuf:"varint,4,opt,name=range_max,json=rangeMax,proto3" json:"range_max,omitempty"`
	MagazineSize uint32          `protobuf:"varint,5,opt,name=magazine_size,json=magazineSize,proto3" json:"magazine_size,omitempty"`
	ReloadTime   uint32          `protobuf:"varint,6,opt,name=reload_time,json=reloadTime,proto3" json:"reload_time,omitempty"`
}

func (*Weapon_ProjectileAttributes) Descriptor

func (*Weapon_ProjectileAttributes) Descriptor() ([]byte, []int)

func (*Weapon_ProjectileAttributes) GetMagazineSize

func (m *Weapon_ProjectileAttributes) GetMagazineSize() uint32

func (*Weapon_ProjectileAttributes) GetPerShot

func (m *Weapon_ProjectileAttributes) GetPerShot() uint32

func (*Weapon_ProjectileAttributes) GetRangeMax

func (m *Weapon_ProjectileAttributes) GetRangeMax() uint32

func (*Weapon_ProjectileAttributes) GetRangeMin

func (m *Weapon_ProjectileAttributes) GetRangeMin() uint32

func (*Weapon_ProjectileAttributes) GetReloadTime

func (m *Weapon_ProjectileAttributes) GetReloadTime() uint32

func (*Weapon_ProjectileAttributes) GetType

func (*Weapon_ProjectileAttributes) ProtoMessage

func (*Weapon_ProjectileAttributes) ProtoMessage()

func (*Weapon_ProjectileAttributes) Reset

func (m *Weapon_ProjectileAttributes) Reset()

func (*Weapon_ProjectileAttributes) String

func (m *Weapon_ProjectileAttributes) String() string

type Weapon_ProjectileAttributes_

type Weapon_ProjectileAttributes_ struct {
	ProjectileAttributes *Weapon_ProjectileAttributes `protobuf:"bytes,16,opt,name=projectile_attributes,json=projectileAttributes,oneof"`
}

type Weapon_Type

type Weapon_Type int32
const (
	Weapon_UNKNOWN_TYPE        Weapon_Type = 0
	Weapon_DAGGER              Weapon_Type = 1
	Weapon_SHORT_BLADE         Weapon_Type = 2
	Weapon_LONG_BLADE          Weapon_Type = 3
	Weapon_HAMMER              Weapon_Type = 4
	Weapon_AXE                 Weapon_Type = 5
	Weapon_POLE_ARM            Weapon_Type = 6
	Weapon_BOW                 Weapon_Type = 50
	Weapon_CROSSBOW            Weapon_Type = 51
	Weapon_BLACK_POWDER_PISTOL Weapon_Type = 100
	Weapon_BLACK_POWDER_RIFLE  Weapon_Type = 101
	Weapon_PISTOL              Weapon_Type = 102
	Weapon_RIFLE               Weapon_Type = 103
	Weapon_CANNON              Weapon_Type = 150
)

func (Weapon_Type) EnumDescriptor

func (Weapon_Type) EnumDescriptor() ([]byte, []int)

func (Weapon_Type) String

func (x Weapon_Type) String() string

type WeightClass

type WeightClass int32

WeightClass defines a common set of weight classes for weapons and armour.

const (
	WeightClass_UNKNOWN_WEIGHT_CLASS WeightClass = 0
	WeightClass_LIGHT                WeightClass = 1
	WeightClass_MEDIUM               WeightClass = 2
	WeightClass_HEAVY                WeightClass = 3
)

func (WeightClass) EnumDescriptor

func (WeightClass) EnumDescriptor() ([]byte, []int)

func (WeightClass) String

func (x WeightClass) String() string

Jump to

Keyboard shortcuts

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