models

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 1 Imported by: 0

README

models

import "github.com/brittonhayes/dnd/models"

models defines data types available in the dnd package

Index

type APIReference

APIReference is the basic structure that defines where this resource resides and what it is called

type APIReference struct {
    // Index is the resource index for shorthand searching.
    Index string `json:"index"`

    // Name is the name of the referenced resource.
    Name string `json:"name"`

    // URL of the referenced resource.
    URL string `json:"url"`
}
func (*APIReference) GetIndex
func (a *APIReference) GetIndex() string

GetIndex returns the index of the APIReference

func (*APIReference) GetName
func (a *APIReference) GetName() string

GetName returns the name of the APIReference

func (*APIReference) GetURL
func (a *APIReference) GetURL() string

GetIndex returns the url of the APIReference

func (*APIReference) JSON
func (a *APIReference) JSON(data []byte) error

type AbilityBonus

AbilityBonus is the bonus modifier for an ability and its associated references

type AbilityBonus struct {
    // Bonus amount for this ability score.
    Bonus int `json:"bonus"`

    // AbilityScore for this bonus.
    AbilityScore APIReference `json:"ability_score"`
}
func (*AbilityBonus) JSON
func (a *AbilityBonus) JSON(data []byte) error

type AbilityScore

AbilityScore is a number that defines the magnitude of each creature’s abilities. An ability score is not just a measure of innate capabilities, but also encompasses a creature’s training and competence in activities related to that ability.

type AbilityScore struct {
    // Index is the ability score index for
    // shorthand searching.
    Index string `json:"index"`

    // Name is the abbreviated name for
    // this ability score.
    Name string `json:"name"`

    // FullName for this ability score.
    FullName string `json:"full_name"`

    // Desc is A brief description of this
    // ability score and its uses.
    Desc []string `json:"desc"`

    // Skills is a list of skills that
    // use this ability score.
    Skills []APIReference `json:"skills"`

    // The URL of the referenced resource
    URL string `json:"url"`
}
func (*AbilityScore) JSON
func (a *AbilityScore) JSON(data []byte) error

type Action

type Action struct {
    AttackBonus int             `json:"attack_bonus"`
    Damage      []*ActionDamage `json:"damage"`
    Options     *Options        `json:"options,omitempty"`
    Desc        string          `json:"desc"`
    Name        string          `json:"name"`
}

type ActionDamage

type ActionDamage struct {
    DamageDice string        `json:"damage_dice"`
    DamageType *APIReference `json:"damage_type"`
}

type AdventuringGear

AdventuringGear is the structure for adventuring gear obtained in the dungeons you explore.

type AdventuringGear struct {
    // Index is the damage type index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this equipment resource
    Name string `json:"name"`

    // EquipmentCategory is the category of equipment this falls into
    EquipmentCategory APIReference `json:"equipment_category"`

    // GearCategory is the category of gear this falls into
    GearCategory APIReference `json:"gear_category"`

    // Cost is the financial worth of this equipment
    Cost Cost `json:"cost"`

    // Weight is the numerical weight of this item
    Weight int `json:"weight"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*AdventuringGear) GetIndex
func (a *AdventuringGear) GetIndex() string

GetName returns the index of the gear

func (*AdventuringGear) GetName
func (a *AdventuringGear) GetName() string

GetName returns the name of the gear

func (*AdventuringGear) GetURL
func (a *AdventuringGear) GetURL() string

GetURL returns the URL of the gear

func (*AdventuringGear) JSON
func (a *AdventuringGear) JSON(data []byte) error

type Armor

Armor is the structure for armor obtained in the dungeons you explore.

type Armor struct {
    // Index is the damage type index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this equipment resource
    Name string `json:"name"`

    // EquipmentCategory is the category of equipment this falls into
    EquipmentCategory APIReference `json:"equipment_category"`

    // ArmorCategory is the category of armor this falls into
    ArmorCategory string `json:"armor_category"`

    // ArmorCategory is the details on how to calculate armor class.
    ArmorClass ArmorClass `json:"armor_class"`

    // StrengthMinumum is Minimum STR required to use this armor.
    StrengthMinimum int `json:"str_minimum"`

    // StealthDisadvantage is Whether the armor gives disadvantage for Stealth.
    StealthDisadvantage bool `json:"stealth_disadvantage"`

    // Weight is the numerical weight of this item
    Weight int `json:"weight"`

    // Cost is the financial worth of this equipment
    Cost Cost `json:"cost"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*Armor) GetIndex
func (a *Armor) GetIndex() string

GetName returns the index of the gear

func (*Armor) GetName
func (a *Armor) GetName() string

GetName returns the name of the gear

func (*Armor) GetURL
func (a *Armor) GetURL() string

GetURL returns the URL of the gear

func (*Armor) JSON
func (a *Armor) JSON(data []byte) error

type ArmorClass

ArmorClass is the details on how to calculate armor class.

type ArmorClass struct {
    Base     *int  `json:"base"`
    DexBonus *bool `json:"dex_bonus"`
    MaxBonus *bool `json:"max_bonus"`
}
func (*ArmorClass) JSON
func (a *ArmorClass) JSON(data []byte) error

type Choice

Choice provides a set of options related to a resource

type Choice struct {
    // Choose is the number of items to pick from the list.
    Choose int `json:"choose"`

    // Type of the resources to choose from.
    Type string `json:"type"`

    // From is a list of resources to choose from.
    From []APIReference `json:"from"`
}
func (*Choice) JSON
func (c *Choice) JSON(data []byte) error

type Class

Class is a fundamental part of the identity and nature of characters in the Dungeons & Dragons role-playing game. A character's capabilities, strengths, and weaknesses are largely defined by its class. A character's class affects a character's available skills and abilities.

type Class struct {
    // Index is the class index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this class resource.
    Name string `json:"name"`

    // HitDie is the hit die of the class. (ex: 12 == 1d12).
    HitDie int `json:"hit_die"`

    // ProficiencyChoices are starting proficiencies where
    // the player must choose a certain number from the given list of proficiencies.
    ProficiencyChoices []Choice `json:"proficiency_choices"`

    // Proficiencies are starting proficiencies all new characters of this class start with.
    Proficiencies []APIReference `json:"proficiencies"`

    // SavingThrows that the class is proficient in.
    SavingThrows []APIReference `json:"saving_throws"`

    // StartingEquipment is an object with the possible
    // choices of equipment for new characters of this class.
    StartingEquipment string `json:"starting_equipment"`

    // ClassLevels are all possible levels that this
    // class can obtain (excluding subclass-specific features)
    ClassLevels string `json:"class_levels"`

    // Spells is the URL of the class's spell Resource List.
    // Returns a list of all spells that can be learned or cast by the class.
    Spells []string `json:"spells"`

    // The URL reference of this resource
    URL string `json:"url"`
}
func (*Class) JSON
func (c *Class) JSON(data []byte) error

type ClassAPIResource

ClassAPIResource is very similar to APIReference but returns a class name rather than just a name

type ClassAPIResource struct {
    // Index is the resource index for shorthand searching.
    Index string `json:"index"`

    // Class of whom the resource belongs to.
    Class string `json:"class"`

    // URL of the referenced resource.
    URL string `json:"url"`
}
func (*ClassAPIResource) JSON
func (c *ClassAPIResource) JSON(data []byte) error

type Conditions

Conditions alter a creature’s capabilities in a variety of ways and can arise as a result of a spell, a class feature, a monster’s attack, or other effect. Most conditions, such as blinded, are impairments, but a few, such as invisible, can be advantageous.

type Conditions struct {
    // Index is the condition index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this condition resource.
    Name string `json:"name"`

    // Desc is a list of brief descriptions
    // of the condition.
    Desc []string `json:"desc"`

    // URL of the referenced resource.
    URL string `json:"url"`
}
func (*Conditions) JSON
func (c *Conditions) JSON(data []byte) error

type Cost

Cost is the basic structure of defining an item's financial worth in D&D

type Cost struct {
    // Quantity is the numerical amount of coins.
    Quantity int `json:"quantity"`

    // Unit of coinage
    Unit string `json:"unit"`
}
func (*Cost) JSON
func (c *Cost) JSON(data []byte) error

type DC

type DC struct {
    DcValue     int           `json:"dc_value"`
    SuccessType string        `json:"success_type"`
    DcType      *APIReference `json:"dc_type"`
}

type DamageType

DamageType defines the unique identifiers for this kind of damage

type DamageType struct {
    Index string `json:"index"`
    Name  string `json:"name"`
    URL   string `json:"url"`
}
func (*DamageType) JSON
func (d *DamageType) JSON(data []byte) error

type EquipmentPack

EquipmentPack is the structure for an equipment pack obtained in the dungeons you explore.

type EquipmentPack struct {
    // Index is the damage type index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this equipment resource
    Name string `json:"name"`

    // EquipmentCategory is the category of equipment this falls into
    EquipmentCategory APIReference `json:"equipment_category"`

    // GearCategory is the category of gear this falls into
    GearCategory APIReference `json:"gear_category"`

    // Contents is the list of items inside the pack
    Contents []PackContents `json:"contents"`

    // Cost is the financial worth of this equipment
    Cost Cost `json:"cost"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*EquipmentPack) GetIndex
func (e *EquipmentPack) GetIndex() string

GetName returns the index of the equipment

func (*EquipmentPack) GetName
func (e *EquipmentPack) GetName() string

GetName returns the name of the equipment

func (*EquipmentPack) GetURL
func (e *EquipmentPack) GetURL() string

GetURL returns the URL of the equipment

func (*EquipmentPack) JSON
func (e *EquipmentPack) JSON(data []byte) error

type Features

Features are the features of a class

type Features struct {
    // Index is the feature index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this feature resource.
    Name string `json:"name"`

    // Level is the level this feature
    // is gained
    Level int `json:"level"`

    // Class is the class that gains this feature.
    Class APIReference `json:"class"`

    // SubClass is the subclass that gains feature resource.
    SubClass APIReference `json:"sub_class"`

    // Desc is the description of the subclass resource.
    Desc string `json:"description"`

    // The URL reference of this resource
    URL string `json:"url"`
}
func (*Features) JSON
func (f *Features) JSON(data []byte) error

type Getter

Getter is the common interface for pulling fields out of a model

type Getter interface {
    GetName() string
    GetIndex() string
    GetURL() string
}

type Language

Language By virtue of your race, your character can speak, read, and write certain languages.

type Language struct {
    // Index is the language index for shorthand searching.
    Index string `json:"index"`

    // Name is the name of this language resource.
    Name string `json:"name"`

    // Type is whether the language is standard or exotic.
    Type string `json:"type"`

    // TypicalSpeakers are races that tend to speak this language.
    TypicalSpeakers []string `json:"typical_speakers"`

    // Script is the script used for writing in this language.
    Script string `json:"script"`

    // URL of the referenced resource.
    URL string `json:"url"`
}
func (*Language) JSON
func (l *Language) JSON(data []byte) error

type LegendaryAction

type LegendaryAction struct {
    AttackBonus int           `json:"attack_bonus,omitempty"`
    Desc        string        `json:"desc"`
    Name        string        `json:"name"`
    Damage      []interface{} `json:"damage"`
}

type MagicItem

MagicItem is the structure for a magic item obtained in the dungeons you explore.

type MagicItem struct {
    // Index is the damage type index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this equipment resource
    Name string `json:"name"`

    // EquipmentCategory is the category of equipment this falls into
    EquipmentCategory APIReference `json:"equipment_category"`

    // Desc is a list of descriptors for this item
    Desc []string `json:"desc"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*MagicItem) GetIndex
func (m *MagicItem) GetIndex() string

GetIndex gets the index of the magic item

func (*MagicItem) GetName
func (m *MagicItem) GetName() string

GetName gets the name of the magic item

func (*MagicItem) GetURL
func (m *MagicItem) GetURL() string

GetURL gets the url of the magic item

func (*MagicItem) JSON
func (m *MagicItem) JSON(data []byte) error

type MagicSchool

MagicSchool defines the unique identifiers for this school of magic

type MagicSchool struct {
    // Index is the magic school
    // index for shorthand searching.
    Index string `json:"index"`

    // Name is name for this magic
    // school resource.
    Name string `json:"name"`

    // URL of the referenced resource
    URL string `json:"url"`
}
func (*MagicSchool) JSON
func (m *MagicSchool) JSON(data []byte) error

type Monster

type Monster struct {
    // Index is the monster index for shorthand searching.
    Index string `json:"index"`

    // Name is the name of the monster.
    Name string `json:"name"`

    // Size is the size of the monster ranging from Tiny to Gargantuan.
    Size string `json:"size"`

    // Type is the type of monster.
    Type string `json:"type"`

    // SubType is the subtype of monster.
    SubType interface{} `json:"subtype"`

    // Alignment is а creature's general moral and personal attitudes.
    Alignment string `json:"alignment"`

    // ArmorClass is difficulty for a player to successfully deal damage to a monster.
    ArmorClass int `json:"armor_class"`

    // HitPoints is hit points of a monster determine how much
    // damage it is able to take before it can be defeated
    HitPoints int `json:"hit_points"`

    // HitDice of a monster can be used to make a version of the same monster whose hit points are determined by the roll of the die.
    // For _example: A monster with 2d6 would have its hit points determine by rolling a 6 sided die twice.
    HitDice string `json:"hit_dice"`

    // Forms applicable to Lycanthropes that have multiple forms. This links to the other related monster entries that are the same.
    Forms []*APIReference `json:"forms,omitempty"`

    // Speed for a monster determines how fast it can move per turn.
    Speed Speed `json:"speed"`

    // Strength of a monster. How hard a monster can hit a player.
    Strength int `json:"strength"`

    // Dexterity of a monster. The monster's ability for swift movement or stealth
    Dexterity int `json:"dexterity"`

    // Constitution of a monster. How sturdy a monster is.
    Constitution int `json:"constitution"`

    // Intelligence of a monster. The monster's ability to outsmart a player
    Intelligence int `json:"intelligence"`

    // Wisdom of a monster. A monster's ability to ascertain the player's plan.
    Wisdom int `json:"wisdom"`

    // Charisma of a monster. A monster's ability to charm or intimidate a player
    Charisma int `json:"charisma"`

    // Proficiencies is a list of proficiencies of a monster.
    Proficiencies []*MonsterProficiency `json:"proficiencies"`

    // DamageVulnerabilities is a list of damage types that a monster will take double damage from.
    DamageVulnerabilities []interface{} `json:"damage_vulnerabilities"`

    // DamageResistances is a list of damage types that a monster will take half damage from.
    DamageResistances []interface{} `json:"damage_resistances"`

    // DamageImmunities is a list of damage types that a monster will take zero damage from.
    DamageImmunities []interface{} `json:"damage_immunities"`

    // ConditionImmunities is a list of conditions that a monster is immune to.
    ConditionImmunities []*APIReference `json:"condition_immunities"`

    // Senses Monsters typically have a passive perception but they might also have other senses to detect players
    Senses *Sense `json:"senses"`

    // Languages are languages a monster is able to speak
    Languages string `json:"languages"`

    // ChallengeRating is monster's challenge rating is a guideline number that says when a monster
    // becomes an appropriate challenge against the party's average level.
    ChallengeRating int `json:"challenge_rating"`

    // XP is the experience points from defeating this monster
    XP  int `json:"xp"`

    // SpecialAbilities is a list of the monster's special abilities.
    SpecialAbilities []*SpecialAbility `json:"special_abilities"`

    // Actions is a list of actions that is available to the monster to take during combat.
    Actions []interface{} `json:"actions"`

    // LegendaryActions is a list of actions that can be used outside of the monster's initiative.
    LegendaryActions []interface{} `json:"legendary_actions,omitempty"`

    // URL of the referenced resource
    URL string `json:"url"`
}
func (*Monster) JSON
func (m *Monster) JSON(data []byte) error

type MonsterProficiency

type MonsterProficiency struct {
    Proficiency *APIReference `json:"proficiency"`
    Value       int           `json:"value,omitempty"`
}

type Options

type Options struct {
    Choose int             `json:"choose,omitempty"`
    From   [][]interface{} `json:"from,omitempty"`
}

type PackContents

type PackContents struct {
    // Item is the of item index details
    Item APIReference `json:"item"`

    // Quantity is the numerical amount of
    // this item present
    Quantity int `json:"quantity"`
}
func (*PackContents) JSON
func (p *PackContents) JSON(data []byte) error

type Proficiency

Proficiency By virtue of your race, your character can speak, read, and write certain Proficiencies.

type Proficiency struct {
    // Index is the proficiency index for shorthand searching.
    Index string `json:"index"`

    // Type is the general category of the proficiency.
    Type string `json:"type"`

    // Name is the name of this proficiency resource
    Name string `json:"name"`

    // Classes that start with this proficiency.
    Classes []APIReference `json:"classes"`

    // Races that start with this proficiency.
    Races []APIReference `json:"races"`

    // URL of the referenced resource.
    URL string `json:"url"`

    // References is a list of references
    References []APIReference `json:"references"`
}
func (*Proficiency) JSON
func (p *Proficiency) JSON(data []byte) error

type Race

Race Each race grants your character ability and skill bonuses as well as racial traits.

type Race struct {

    // Index is the race index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this race resource.
    Name string `json:"name"`

    // Speed is the base move speed for this race (in feet per round).
    Speed int `json:"speed"`

    // AbilityBonuses are racial bonuses to ability scores.
    AbilityBonuses []AbilityBonus `json:"ability_bonuses"`

    // Alignment is a flavor description of likely alignments this race takes.
    Alignment string `json:"alignment"`

    // Age is the flavor description of possible ages for this race.
    Age string `json:"age"`

    // Size is the size class of this race.
    Size string `json:"size"`

    // SizeDescription is the flavor description
    // of height and weight for this race.
    SizeDescription string `json:"size_description"`

    // StartingProficiencies for all new characters of this race.
    StartingProficiencies []*APIReference `json:"starting_proficiencies"`

    // StartingProficiencyOptions are the starting
    // proficiencies for all new characters of this race
    StartingProficiencyOptions interface{} `json:"starting_proficiency_options,omitempty"`

    // Languages are starting languages for all new characters of this race.
    Languages []*APIReference `json:"languages"`

    // LanguageDesc is a flavor description of the languages this race knows.
    LanguageDesc string `json:"language_desc"`

    // LanguageOptions is the list of languages available to this race
    LanguageOptions interface{} `json:"language_options,omitempty"`

    // Traits are racial traits that provide benefits to its members.
    Traits []APIReference `json:"traits"`

    // SubRaces is list of related subraces
    SubRaces []APIReference `json:"subraces"`

    // The URL of the referenced resource
    URL string `json:"url"`
}
func (*Race) JSON
func (r *Race) JSON(data []byte) error

type Range

type Range struct {
    Normal *int `json:"normal"`
    Long   *int `json:"long"`
}

type Reaction

type Reaction struct {
    Desc string `json:"desc"`
    Name string `json:"name"`
}

type Resource

Results is used for any API endpoint without a resource index or name. It return a list of available resources for that API

type Resource struct {
    // Count is the total
    // number of results returned
    Count int `json:"count"`

    // Results is the list of API references
    // return by the request
    Results []APIReference `json:"results"`
}
func (*Resource) JSON
func (r *Resource) JSON(data []byte) error
func (*Resource) ResultsNames
func (r *Resource) ResultsNames() []string

Names returns the list of names from the resource results

type Rules

type Rules struct {
    Name        string            `json:"name"`
    Index       string            `json:"index"`
    Desc        string            `json:"desc"`
    Subsections []RulesSubsection `json:"subsections"`
    URL         string            `json:"url"`
}
func (*Rules) GetIndex
func (r *Rules) GetIndex() string

GetName returns the index of the rule

func (*Rules) GetName
func (r *Rules) GetName() string

GetName returns the name of the rule

func (*Rules) GetURL
func (r *Rules) GetURL() string

GetURL returns the URL of the rule

func (*Rules) JSON
func (r *Rules) JSON(data []byte) error

type RulesSubsection

type RulesSubsection struct {
    Name  string `json:"name"`
    Index string `json:"index"`
    URL   string `json:"url"`
    Desc  string `json:"desc,omitempty"`
}
func (*RulesSubsection) JSON
func (r *RulesSubsection) JSON(data []byte) error

type Sense

type Sense struct {
    BlindSight        string `json:"blindsight,omitempty"`
    DarkVision        string `json:"darkvision,omitempty"`
    PassivePerception int    `json:"passive_perception,omitempty"`
    TremorSense       string `json:"tremorsense,omitempty"`
    TrueSight         string `json:"truesight,omitempty"`
}

type Sheriff

type Sheriff interface {
    JSON(data []byte) error
}

type Skill

Skill represents a skill that a character possesses

type Skill struct {
    // Index is the skill index for shorthand searching.
    Index string `json:"index"`

    // Name is the abbreviated name for this skill.
    Name string `json:"name"`

    // Desc is a brief description of this skill
    // and its uses.
    Desc []string `json:"desc"`

    // AbilityScore is the ability score associated
    // with this skill.
    AbilityScore AbilityScore `json:"ability_score"`

    // URL is the URL of the referenced resource
    URL string `json:"url"`
}
func (*Skill) JSON
func (s *Skill) JSON(data []byte) error

type SpecialAbility

type SpecialAbility struct {
    Desc string `json:"desc"`
    Name string `json:"name"`
    DC   *DC    `json:"dc,omitempty"`
}

type Speed

type Speed struct {
    Burrow string `json:"burrow,omitempty"`
    Climb  string `json:"climb,omitempty"`
    Fly    string `json:"fly,omitempty"`
    Hover  bool   `json:"hover,omitempty"`
    Swim   string `json:"swim,omitempty"`
    Walk   string `json:"walk,omitempty"`
}

type Spells

Spells are the spells of D&D

type Spells struct {
    // Index of the spell for shorthand searching
    Index string `json:"index"`

    // Name is the name of the spell
    Name string `json:"name"`

    // Desc is a description of the spell
    Desc []string `json:"desc"`

    // HigherLevel is a description for casting
    // the spell at a higher level
    HigherLevel []string `json:"higher_level,omitempty"`

    // Range of the spell
    Range string `json:"range"`

    // Components are the required components for a spell, shorthanded
    // to V,S, and M which stand for verbal, somatic, and material
    Components []string `json:"components"`

    // Material component for the spell to be cast
    Material string `json:"material"`

    // Ritual determines if a spell can be cast in a 10-min(in-game) ritual
    Ritual bool `json:"ritual"`

    // Duration determines how long the spell effect lasts
    Duration string `json:"duration"`

    // Concentration determines if a spell needs concentration to persist
    Concentration bool `json:"concentration"`

    // CastingTime is How long it takes for the spell to activate
    CastingTime string `json:"casting_time"`

    // Level of the spell
    Level int `json:"level"`

    // AttackType is the attack type of the spell
    AttackType string `json:"attack_type"`

    // Damage is the damage type and the damage dice
    // for the spell at each spell slot level
    Damage struct {
        DamageType        DamageType        `json:"damage_type"`
        DamageAtSlotLevel map[string]string `json:"damage_at_slot_level"`
    }   `json:"damage"`

    // School is the magic school this spell
    // belongs to
    School struct {
        Index string `json:"index"`
        Name  string `json:"name"`
        URL   string `json:"url"`
    }   `json:"school"`

    // Classes that are able to learn this spell
    Classes []struct {
        Index string `json:"index"`
        Name  string `json:"name"`
        URL   string `json:"url"`
    }   `json:"classes"`

    // Subclasses that have access to this spell.
    Subclasses []struct {
        Index string `json:"index"`
        Name  string `json:"name"`
        URL   string `json:"url"`
    }   `json:"subclasses"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*Spells) GetIndex
func (s *Spells) GetIndex() string

GetIndex returns the index of the spell

Example

Get the index address of a spell

{
	s := Spells{Index: "_example-index"}
	s.GetIndex()
}

func (*Spells) GetName
func (s *Spells) GetName() string

GetName returns the name of the spell

Example

Get the name of a spell

{
	s := Spells{Name: "_example spell name"}
	s.GetName()
}

func (*Spells) GetURL
func (s *Spells) GetURL() string

GetURL returns the URL of the spell

Example

Get the URL of a spell

{
	s := Spells{URL: "_example spell URL"}
	s.GetURL()
}

func (*Spells) JSON
func (s *Spells) JSON(data []byte) error

type StartingEquipment

StartingEquipment are the starting equipment of a class

type StartingEquipment struct {
    // Index is the class index for shorthand searching
    Index string `json:"index"`

    // Class is the class that gains this equipment.
    Class APIReference `json:"class"`

    // StartingEquipment is the starting equipment a character automatically gets.
    StartingEquipment []StartingEquipmentItem `json:"starting_equipment"`

    // StartingEquipmentOptions is the Starting equipment where the player must
    // choose a certain number from the given list of equipment.
    StartingEquipmentOptions []Choice `json:"starting_equipment_options"`

    // The URL reference of this resource
    URL string `json:"url"`
}
func (*StartingEquipment) JSON
func (s *StartingEquipment) JSON(data []byte) error

type StartingEquipmentItem

StartingEquipmentItem is a single item in a list of starting equipment

type StartingEquipmentItem struct {
    Equipment APIReference `json:"equipment"`
    Quantity  int          `json:"quantity"`
}
func (*StartingEquipmentItem) JSON
func (c *StartingEquipmentItem) JSON(data []byte) error

type SubRace

SubRace contains the details for a parent race's associated subrace

type SubRace struct {
    // Index is the subrace index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this subrace resource.
    Name string `json:"name"`

    // Race is the parent race for this subrace.
    Race interface{} `json:"race"`

    // Desc is a flavor description of this subrace
    Desc string `json:"desc"`

    // AbilityBonuses are ability bonuses granted by this sub race.
    AbilityBonuses []AbilityBonus `json:"ability_bonuses"`

    // StartingProficiencies for all new characters of this subrace.
    StartingProficiencies []APIReference `json:"starting_proficiencies"`

    // Languages are starting languages for all new characters of this subrace.
    Languages []APIReference `json:"languages"`

    // LanguageOptions is the list of languages available to this race
    LanguageOptions interface{} `json:"language_options,omitempty"`

    // Traits are racial traits that provide benefits to its members.
    Traits []*APIReference `json:"traits,omitempty"`

    // RacialTraits are racial traits that provide benefits to its members.
    RacialTraits []*APIReference `json:"racial_traits,omitempty"`

    // RacialTraitOptions are racial traits options available to this subrace
    RacialTraitOptions *Choice `json:"racial_trait_options,omitempty"`

    // The URL of the referenced resource
    URL string `json:"url"`
}
func (*SubRace) JSON
func (r *SubRace) JSON(data []byte) error

type Subclass

Subclass reflects the different paths a class may take as levels are gained

type Subclass struct {
    // Index is the class index for shorthand searching.
    Index string `json:"index"`

    // Class is the parent class for this subclass
    Class string `json:"class"`

    // Name is the name for this class resource.
    Name string `json:"name"`

    // SubclassFlavor is the lore-friendly
    // flavor text for a classes respective subclass.
    SubclassFlavor string `json:"subclass_flavor"`

    // Desc is the description of the subclass resource.
    Desc string `json:"description"`

    // SubClassLevels is a resource url that shows the subclass level progression
    SubClassLevels APIReference `json:"sub_class_levels"`

    // Spells is the URL of the class's spell Resource List.
    // Returns a list of all spells that can be learned or cast by the class.
    Spells []string `json:"spells"`

    // The URL reference of this resource
    URL string `json:"url"`
}
func (*Subclass) JSON
func (c *Subclass) JSON(data []byte) error

type Traits

Traits for races in D&D

type Traits struct {
    // Index is the trait index for
    // shorthand searching.
    Index string `json:"index"`

    // Races is the list of races that have access
    // to this trait
    Races []APIReference `json:"races"`

    // SubRaces is list of related subraces
    SubRaces []APIReference `json:"subraces"`

    // Name is the name of the trait
    Name string `json:"name"`

    // Desc is the description of
    // the trait
    Desc string `json:"desc"`

    // Proficiencies are Proficiencies
    // this trait grants.
    Proficiencies []APIReference `json:"proficiencies"`

    // ProficiencyChoices are choices of proficiencies
    // this trait grants.
    ProficiencyChoices []Choice `json:"proficiency_choices"`
}
func (*Traits) JSON
func (t *Traits) JSON(data []byte) error

type Weapon

Weapon is the structure for weapons obtained in the dungeons you explore.

type Weapon struct {
    // Index is the damage type index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this equipment resource
    Name string `json:"name"`

    // EquipmentCategory is the category of equipment this falls into
    EquipmentCategory APIReference `json:"equipment_category"`

    // WeaponCategory is the category of weapon this falls into
    WeaponCategory string `json:"weapon_category"`

    // WeaponRange is whether this is a Melee or Ranged weapon.
    WeaponRange string `json:"weapon_range"`

    // CategoryRange is a combination of weapon_category and weapon_range.
    CategoryRange string `json:"category_range"`

    // Cost is the financial worth of this equipment
    Cost Cost `json:"cost"`

    // Damage is the data on dice, bonus, and damage type
    Damage ActionDamage `json:"damage"`

    // TwoHandedDamage when wielded with two hands.
    // It includes data on dice, bonus, and damage type.
    TwoHandedDamage *ActionDamage `json:"two_handed_damage,omitempty"`

    // Range Includes the normal and long range for a weapon,
    // only pertains to Ranged weapons
    Range *Range `json:"range"`

    // Weight is the numerical weight of this item
    Weight int `json:"weight"`

    // Properties is a list of properties this weapon has
    Properties []APIReference `json:"properties"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*Weapon) GetIndex
func (w *Weapon) GetIndex() string

GetName returns the index of the weapon

func (*Weapon) GetName
func (w *Weapon) GetName() string

GetName returns the name of the weapon

func (*Weapon) GetURL
func (w *Weapon) GetURL() string

GetURL returns the URL of the weapon

func (*Weapon) JSON
func (w *Weapon) JSON(data []byte) error

type WeaponProperties

WeaponProperties is the structure for a weapon's properties

type WeaponProperties struct {
    // Index is the damage type index for shorthand searching.
    Index string `json:"index"`

    // Name is the name for this equipment resource
    Name string `json:"name"`

    // Desc is a list of descriptors for this item
    Desc []string `json:"desc"`

    // URL is the URL reference of this resource
    URL string `json:"url"`
}
func (*WeaponProperties) JSON
func (w *WeaponProperties) JSON(data []byte) error

Generated by gomarkdoc

Documentation

Overview

models defines data types available in the dnd package

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIReference

type APIReference struct {
	// Index is the resource index for shorthand searching.
	Index string `json:"index"`

	// Name is the name of the referenced resource.
	Name string `json:"name"`

	// URL of the referenced resource.
	URL string `json:"url"`
}

APIReference is the basic structure that defines where this resource resides and what it is called

func (*APIReference) GetIndex added in v0.1.0

func (a *APIReference) GetIndex() string

GetIndex returns the index of the APIReference

func (*APIReference) GetName added in v0.1.0

func (a *APIReference) GetName() string

GetName returns the name of the APIReference

func (*APIReference) GetURL added in v0.1.0

func (a *APIReference) GetURL() string

GetIndex returns the url of the APIReference

func (*APIReference) JSON added in v0.3.0

func (a *APIReference) JSON(data []byte) error

type AbilityBonus

type AbilityBonus struct {
	// Bonus amount for this ability score.
	Bonus int `json:"bonus"`

	// AbilityScore for this bonus.
	AbilityScore APIReference `json:"ability_score"`
}

AbilityBonus is the bonus modifier for an ability and its associated references

func (*AbilityBonus) JSON added in v0.3.0

func (a *AbilityBonus) JSON(data []byte) error

type AbilityScore added in v0.0.3

type AbilityScore struct {
	// Index is the ability score index for
	// shorthand searching.
	Index string `json:"index"`

	// Name is the abbreviated name for
	// this ability score.
	Name string `json:"name"`

	// FullName for this ability score.
	FullName string `json:"full_name"`

	// Desc is A brief description of this
	// ability score and its uses.
	Desc []string `json:"desc"`

	// Skills is a list of skills that
	// use this ability score.
	Skills []APIReference `json:"skills"`

	// The URL of the referenced resource
	URL string `json:"url"`
}

AbilityScore is a number that defines the magnitude of each creature’s abilities. An ability score is not just a measure of innate capabilities, but also encompasses a creature’s training and competence in activities related to that ability.

func (*AbilityScore) JSON added in v0.3.0

func (a *AbilityScore) JSON(data []byte) error

type Action added in v0.0.2

type Action struct {
	AttackBonus int             `json:"attack_bonus"`
	Damage      []*ActionDamage `json:"damage"`
	Options     *Options        `json:"options,omitempty"`
	Desc        string          `json:"desc"`
	Name        string          `json:"name"`
}

type ActionDamage added in v0.0.2

type ActionDamage struct {
	DamageDice string        `json:"damage_dice"`
	DamageType *APIReference `json:"damage_type"`
}

type AdventuringGear added in v0.0.3

type AdventuringGear struct {
	// Index is the damage type index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this equipment resource
	Name string `json:"name"`

	// EquipmentCategory is the category of equipment this falls into
	EquipmentCategory APIReference `json:"equipment_category"`

	// GearCategory is the category of gear this falls into
	GearCategory APIReference `json:"gear_category"`

	// Cost is the financial worth of this equipment
	Cost Cost `json:"cost"`

	// Weight is the numerical weight of this item
	Weight int `json:"weight"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

AdventuringGear is the structure for adventuring gear obtained in the dungeons you explore.

func (*AdventuringGear) GetIndex added in v0.1.0

func (a *AdventuringGear) GetIndex() string

GetName returns the index of the gear

func (*AdventuringGear) GetName added in v0.1.0

func (a *AdventuringGear) GetName() string

GetName returns the name of the gear

func (*AdventuringGear) GetURL added in v0.1.0

func (a *AdventuringGear) GetURL() string

GetURL returns the URL of the gear

func (*AdventuringGear) JSON added in v0.3.0

func (a *AdventuringGear) JSON(data []byte) error

type Armor added in v0.0.3

type Armor struct {
	// Index is the damage type index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this equipment resource
	Name string `json:"name"`

	// EquipmentCategory is the category of equipment this falls into
	EquipmentCategory APIReference `json:"equipment_category"`

	// ArmorCategory is the category of armor this falls into
	ArmorCategory string `json:"armor_category"`

	// ArmorCategory is the details on how to calculate armor class.
	ArmorClass ArmorClass `json:"armor_class"`

	// StrengthMinumum is Minimum STR required to use this armor.
	StrengthMinimum int `json:"str_minimum"`

	// StealthDisadvantage is Whether the armor gives disadvantage for Stealth.
	StealthDisadvantage bool `json:"stealth_disadvantage"`

	// Weight is the numerical weight of this item
	Weight int `json:"weight"`

	// Cost is the financial worth of this equipment
	Cost Cost `json:"cost"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

Armor is the structure for armor obtained in the dungeons you explore.

func (*Armor) GetIndex added in v0.1.0

func (a *Armor) GetIndex() string

GetName returns the index of the gear

func (*Armor) GetName added in v0.1.0

func (a *Armor) GetName() string

GetName returns the name of the gear

func (*Armor) GetURL added in v0.1.0

func (a *Armor) GetURL() string

GetURL returns the URL of the gear

func (*Armor) JSON added in v0.3.0

func (a *Armor) JSON(data []byte) error

type ArmorClass added in v0.0.3

type ArmorClass struct {
	Base     *int  `json:"base"`
	DexBonus *bool `json:"dex_bonus"`
	MaxBonus *bool `json:"max_bonus"`
}

ArmorClass is the details on how to calculate armor class.

func (*ArmorClass) JSON added in v0.3.0

func (a *ArmorClass) JSON(data []byte) error

type Choice

type Choice struct {
	// Choose is the number of items to pick from the list.
	Choose int `json:"choose"`

	// Type of the resources to choose from.
	Type string `json:"type"`

	// From is a list of resources to choose from.
	From []APIReference `json:"from"`
}

Choice provides a set of options related to a resource

func (*Choice) JSON added in v0.3.0

func (c *Choice) JSON(data []byte) error

type Class added in v0.0.3

type Class struct {
	// Index is the class index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this class resource.
	Name string `json:"name"`

	// HitDie is the hit die of the class. (ex: 12 == 1d12).
	HitDie int `json:"hit_die"`

	// ProficiencyChoices are starting proficiencies where
	// the player must choose a certain number from the given list of proficiencies.
	ProficiencyChoices []Choice `json:"proficiency_choices"`

	// Proficiencies are starting proficiencies all new characters of this class start with.
	Proficiencies []APIReference `json:"proficiencies"`

	// SavingThrows that the class is proficient in.
	SavingThrows []APIReference `json:"saving_throws"`

	// StartingEquipment is an object with the possible
	// choices of equipment for new characters of this class.
	StartingEquipment string `json:"starting_equipment"`

	// ClassLevels are all possible levels that this
	// class can obtain (excluding subclass-specific features)
	ClassLevels string `json:"class_levels"`

	// Spells is the URL of the class's spell Resource List.
	// Returns a list of all spells that can be learned or cast by the class.
	Spells []string `json:"spells"`

	// The URL reference of this resource
	URL string `json:"url"`
}

Class is a fundamental part of the identity and nature of characters in the Dungeons & Dragons role-playing game. A character's capabilities, strengths, and weaknesses are largely defined by its class. A character's class affects a character's available skills and abilities.

func (*Class) JSON added in v0.3.0

func (c *Class) JSON(data []byte) error

type ClassAPIResource

type ClassAPIResource struct {
	// Index is the resource index for shorthand searching.
	Index string `json:"index"`

	// Class of whom the resource belongs to.
	Class string `json:"class"`

	// URL of the referenced resource.
	URL string `json:"url"`
}

ClassAPIResource is very similar to APIReference but returns a class name rather than just a name

func (*ClassAPIResource) JSON added in v0.3.0

func (c *ClassAPIResource) JSON(data []byte) error

type Conditions

type Conditions struct {
	// Index is the condition index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this condition resource.
	Name string `json:"name"`

	// Desc is a list of brief descriptions
	// of the condition.
	Desc []string `json:"desc"`

	// URL of the referenced resource.
	URL string `json:"url"`
}

Conditions alter a creature’s capabilities in a variety of ways and can arise as a result of a spell, a class feature, a monster’s attack, or other effect. Most conditions, such as blinded, are impairments, but a few, such as invisible, can be advantageous.

func (*Conditions) JSON added in v0.3.0

func (c *Conditions) JSON(data []byte) error

type Cost

type Cost struct {
	// Quantity is the numerical amount of coins.
	Quantity int `json:"quantity"`

	// Unit of coinage
	Unit string `json:"unit"`
}

Cost is the basic structure of defining an item's financial worth in D&D

func (*Cost) JSON added in v0.3.0

func (c *Cost) JSON(data []byte) error

type DC added in v0.0.2

type DC struct {
	DcValue     int           `json:"dc_value"`
	SuccessType string        `json:"success_type"`
	DcType      *APIReference `json:"dc_type"`
}

type DamageType added in v0.0.2

type DamageType struct {
	Index string `json:"index"`
	Name  string `json:"name"`
	URL   string `json:"url"`
}

DamageType defines the unique identifiers for this kind of damage

func (*DamageType) JSON added in v0.3.0

func (d *DamageType) JSON(data []byte) error

type EquipmentPack added in v0.0.3

type EquipmentPack struct {
	// Index is the damage type index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this equipment resource
	Name string `json:"name"`

	// EquipmentCategory is the category of equipment this falls into
	EquipmentCategory APIReference `json:"equipment_category"`

	// GearCategory is the category of gear this falls into
	GearCategory APIReference `json:"gear_category"`

	// Contents is the list of items inside the pack
	Contents []PackContents `json:"contents"`

	// Cost is the financial worth of this equipment
	Cost Cost `json:"cost"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

EquipmentPack is the structure for an equipment pack obtained in the dungeons you explore.

func (*EquipmentPack) GetIndex added in v0.1.0

func (e *EquipmentPack) GetIndex() string

GetName returns the index of the equipment

func (*EquipmentPack) GetName added in v0.1.0

func (e *EquipmentPack) GetName() string

GetName returns the name of the equipment

func (*EquipmentPack) GetURL added in v0.1.0

func (e *EquipmentPack) GetURL() string

GetURL returns the URL of the equipment

func (*EquipmentPack) JSON added in v0.3.0

func (e *EquipmentPack) JSON(data []byte) error

type Features added in v0.0.3

type Features struct {
	// Index is the feature index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this feature resource.
	Name string `json:"name"`

	// Level is the level this feature
	// is gained
	Level int `json:"level"`

	// Class is the class that gains this feature.
	Class APIReference `json:"class"`

	// SubClass is the subclass that gains feature resource.
	SubClass APIReference `json:"sub_class"`

	// Desc is the description of the subclass resource.
	Desc string `json:"description"`

	// The URL reference of this resource
	URL string `json:"url"`
}

Features are the features of a class

func (*Features) JSON added in v0.3.0

func (f *Features) JSON(data []byte) error

type Getter added in v0.1.0

type Getter interface {
	GetName() string
	GetIndex() string
	GetURL() string
}

Getter is the common interface for pulling fields out of a model

type Language added in v0.0.3

type Language struct {
	// Index is the language index for shorthand searching.
	Index string `json:"index"`

	// Name is the name of this language resource.
	Name string `json:"name"`

	// Type is whether the language is standard or exotic.
	Type string `json:"type"`

	// TypicalSpeakers are races that tend to speak this language.
	TypicalSpeakers []string `json:"typical_speakers"`

	// Script is the script used for writing in this language.
	Script string `json:"script"`

	// URL of the referenced resource.
	URL string `json:"url"`
}

Language By virtue of your race, your character can speak, read, and write certain languages.

func (*Language) JSON added in v0.3.0

func (l *Language) JSON(data []byte) error

type LegendaryAction added in v0.0.2

type LegendaryAction struct {
	AttackBonus int           `json:"attack_bonus,omitempty"`
	Desc        string        `json:"desc"`
	Name        string        `json:"name"`
	Damage      []interface{} `json:"damage"`
}

type MagicItem added in v0.0.3

type MagicItem struct {
	// Index is the damage type index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this equipment resource
	Name string `json:"name"`

	// EquipmentCategory is the category of equipment this falls into
	EquipmentCategory APIReference `json:"equipment_category"`

	// Desc is a list of descriptors for this item
	Desc []string `json:"desc"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

MagicItem is the structure for a magic item obtained in the dungeons you explore.

func (*MagicItem) GetIndex added in v0.1.0

func (m *MagicItem) GetIndex() string

GetIndex gets the index of the magic item

func (*MagicItem) GetName added in v0.1.0

func (m *MagicItem) GetName() string

GetName gets the name of the magic item

func (*MagicItem) GetURL added in v0.1.0

func (m *MagicItem) GetURL() string

GetURL gets the url of the magic item

func (*MagicItem) JSON added in v0.3.0

func (m *MagicItem) JSON(data []byte) error

type MagicSchool added in v0.0.3

type MagicSchool struct {
	// Index is the magic school
	// index for shorthand searching.
	Index string `json:"index"`

	// Name is name for this magic
	// school resource.
	Name string `json:"name"`

	// URL of the referenced resource
	URL string `json:"url"`
}

MagicSchool defines the unique identifiers for this school of magic

func (*MagicSchool) JSON added in v0.3.0

func (m *MagicSchool) JSON(data []byte) error

type Monster

type Monster struct {
	// Index is the monster index for shorthand searching.
	Index string `json:"index"`

	// Name is the name of the monster.
	Name string `json:"name"`

	// Size is the size of the monster ranging from Tiny to Gargantuan.
	Size string `json:"size"`

	// Type is the type of monster.
	Type string `json:"type"`

	// SubType is the subtype of monster.
	SubType interface{} `json:"subtype"`

	// Alignment is а creature's general moral and personal attitudes.
	Alignment string `json:"alignment"`

	// ArmorClass is difficulty for a player to successfully deal damage to a monster.
	ArmorClass int `json:"armor_class"`

	// HitPoints is hit points of a monster determine how much
	// damage it is able to take before it can be defeated
	HitPoints int `json:"hit_points"`

	// HitDice of a monster can be used to make a version of the same monster whose hit points are determined by the roll of the die.
	// For _example: A monster with 2d6 would have its hit points determine by rolling a 6 sided die twice.
	HitDice string `json:"hit_dice"`

	// Forms applicable to Lycanthropes that have multiple forms. This links to the other related monster entries that are the same.
	Forms []*APIReference `json:"forms,omitempty"`

	// Speed for a monster determines how fast it can move per turn.
	Speed Speed `json:"speed"`

	// Strength of a monster. How hard a monster can hit a player.
	Strength int `json:"strength"`

	// Dexterity of a monster. The monster's ability for swift movement or stealth
	Dexterity int `json:"dexterity"`

	// Constitution of a monster. How sturdy a monster is.
	Constitution int `json:"constitution"`

	// Intelligence of a monster. The monster's ability to outsmart a player
	Intelligence int `json:"intelligence"`

	// Wisdom of a monster. A monster's ability to ascertain the player's plan.
	Wisdom int `json:"wisdom"`

	// Charisma of a monster. A monster's ability to charm or intimidate a player
	Charisma int `json:"charisma"`

	// Proficiencies is a list of proficiencies of a monster.
	Proficiencies []*MonsterProficiency `json:"proficiencies"`

	// DamageVulnerabilities is a list of damage types that a monster will take double damage from.
	DamageVulnerabilities []interface{} `json:"damage_vulnerabilities"`

	// DamageResistances is a list of damage types that a monster will take half damage from.
	DamageResistances []interface{} `json:"damage_resistances"`

	// DamageImmunities is a list of damage types that a monster will take zero damage from.
	DamageImmunities []interface{} `json:"damage_immunities"`

	// ConditionImmunities is a list of conditions that a monster is immune to.
	ConditionImmunities []*APIReference `json:"condition_immunities"`

	// Senses Monsters typically have a passive perception but they might also have other senses to detect players
	Senses *Sense `json:"senses"`

	// Languages are languages a monster is able to speak
	Languages string `json:"languages"`

	// ChallengeRating is monster's challenge rating is a guideline number that says when a monster
	// becomes an appropriate challenge against the party's average level.
	ChallengeRating int `json:"challenge_rating"`

	// XP is the experience points from defeating this monster
	XP int `json:"xp"`

	// SpecialAbilities is a list of the monster's special abilities.
	SpecialAbilities []*SpecialAbility `json:"special_abilities"`

	// Actions is a list of actions that is available to the monster to take during combat.
	Actions []interface{} `json:"actions"`

	// LegendaryActions is a list of actions that can be used outside of the monster's initiative.
	LegendaryActions []interface{} `json:"legendary_actions,omitempty"`

	// URL of the referenced resource
	URL string `json:"url"`
}

func (*Monster) JSON added in v0.3.0

func (m *Monster) JSON(data []byte) error

type MonsterProficiency added in v0.0.3

type MonsterProficiency struct {
	Proficiency *APIReference `json:"proficiency"`
	Value       int           `json:"value,omitempty"`
}

type Options added in v0.0.2

type Options struct {
	Choose int             `json:"choose,omitempty"`
	From   [][]interface{} `json:"from,omitempty"`
}

type PackContents added in v0.0.3

type PackContents struct {
	// Item is the of item index details
	Item APIReference `json:"item"`

	// Quantity is the numerical amount of
	// this item present
	Quantity int `json:"quantity"`
}

func (*PackContents) JSON added in v0.3.0

func (p *PackContents) JSON(data []byte) error

type Proficiency added in v0.0.2

type Proficiency struct {
	// Index is the proficiency index for shorthand searching.
	Index string `json:"index"`

	// Type is the general category of the proficiency.
	Type string `json:"type"`

	// Name is the name of this proficiency resource
	Name string `json:"name"`

	// Classes that start with this proficiency.
	Classes []APIReference `json:"classes"`

	// Races that start with this proficiency.
	Races []APIReference `json:"races"`

	// URL of the referenced resource.
	URL string `json:"url"`

	// References is a list of references
	References []APIReference `json:"references"`
}

Proficiency By virtue of your race, your character can speak, read, and write certain Proficiencies.

func (*Proficiency) JSON added in v0.3.0

func (p *Proficiency) JSON(data []byte) error

type Race added in v0.0.3

type Race struct {

	// Index is the race index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this race resource.
	Name string `json:"name"`

	// Speed is the base move speed for this race (in feet per round).
	Speed int `json:"speed"`

	// AbilityBonuses are racial bonuses to ability scores.
	AbilityBonuses []AbilityBonus `json:"ability_bonuses"`

	// Alignment is a flavor description of likely alignments this race takes.
	Alignment string `json:"alignment"`

	// Age is the flavor description of possible ages for this race.
	Age string `json:"age"`

	// Size is the size class of this race.
	Size string `json:"size"`

	// SizeDescription is the flavor description
	// of height and weight for this race.
	SizeDescription string `json:"size_description"`

	// StartingProficiencies for all new characters of this race.
	StartingProficiencies []*APIReference `json:"starting_proficiencies"`

	// StartingProficiencyOptions are the starting
	// proficiencies for all new characters of this race
	StartingProficiencyOptions interface{} `json:"starting_proficiency_options,omitempty"`

	// Languages are starting languages for all new characters of this race.
	Languages []*APIReference `json:"languages"`

	// LanguageDesc is a flavor description of the languages this race knows.
	LanguageDesc string `json:"language_desc"`

	// LanguageOptions is the list of languages available to this race
	LanguageOptions interface{} `json:"language_options,omitempty"`

	// Traits are racial traits that provide benefits to its members.
	Traits []APIReference `json:"traits"`

	// SubRaces is list of related subraces
	SubRaces []APIReference `json:"subraces"`

	// The URL of the referenced resource
	URL string `json:"url"`
}

Race Each race grants your character ability and skill bonuses as well as racial traits.

func (*Race) JSON added in v0.3.0

func (r *Race) JSON(data []byte) error

type Range added in v0.0.3

type Range struct {
	Normal *int `json:"normal"`
	Long   *int `json:"long"`
}

type Reaction added in v0.0.2

type Reaction struct {
	Desc string `json:"desc"`
	Name string `json:"name"`
}

type Resource

type Resource struct {
	// Count is the total
	// number of results returned
	Count int `json:"count"`

	// Results is the list of API references
	// return by the request
	Results []APIReference `json:"results"`
}

Results is used for any API endpoint without a resource index or name. It return a list of available resources for that API

func (*Resource) JSON added in v0.3.0

func (r *Resource) JSON(data []byte) error

func (*Resource) ResultsNames added in v0.1.1

func (r *Resource) ResultsNames() []string

Names returns the list of names from the resource results

type Rules

type Rules struct {
	Name        string            `json:"name"`
	Index       string            `json:"index"`
	Desc        string            `json:"desc"`
	Subsections []RulesSubsection `json:"subsections"`
	URL         string            `json:"url"`
}

func (*Rules) GetIndex added in v0.1.0

func (r *Rules) GetIndex() string

GetName returns the index of the rule

func (*Rules) GetName added in v0.1.0

func (r *Rules) GetName() string

GetName returns the name of the rule

func (*Rules) GetURL added in v0.1.0

func (r *Rules) GetURL() string

GetURL returns the URL of the rule

func (*Rules) JSON added in v0.3.0

func (r *Rules) JSON(data []byte) error

type RulesSubsection

type RulesSubsection struct {
	Name  string `json:"name"`
	Index string `json:"index"`
	URL   string `json:"url"`
	Desc  string `json:"desc,omitempty"`
}

func (*RulesSubsection) JSON added in v0.3.0

func (r *RulesSubsection) JSON(data []byte) error

type Sense added in v0.0.2

type Sense struct {
	BlindSight        string `json:"blindsight,omitempty"`
	DarkVision        string `json:"darkvision,omitempty"`
	PassivePerception int    `json:"passive_perception,omitempty"`
	TremorSense       string `json:"tremorsense,omitempty"`
	TrueSight         string `json:"truesight,omitempty"`
}

type Sheriff added in v0.3.0

type Sheriff interface {
	JSON(data []byte) error
}

type Skill added in v0.0.3

type Skill struct {
	// Index is the skill index for shorthand searching.
	Index string `json:"index"`

	// Name is the abbreviated name for this skill.
	Name string `json:"name"`

	// Desc is a brief description of this skill
	// and its uses.
	Desc []string `json:"desc"`

	// AbilityScore is the ability score associated
	// with this skill.
	AbilityScore AbilityScore `json:"ability_score"`

	// URL is the URL of the referenced resource
	URL string `json:"url"`
}

Skill represents a skill that a character possesses

func (*Skill) JSON added in v0.3.0

func (s *Skill) JSON(data []byte) error

type SpecialAbility added in v0.0.2

type SpecialAbility struct {
	Desc string `json:"desc"`
	Name string `json:"name"`
	DC   *DC    `json:"dc,omitempty"`
}

type Speed added in v0.0.2

type Speed struct {
	Burrow string `json:"burrow,omitempty"`
	Climb  string `json:"climb,omitempty"`
	Fly    string `json:"fly,omitempty"`
	Hover  bool   `json:"hover,omitempty"`
	Swim   string `json:"swim,omitempty"`
	Walk   string `json:"walk,omitempty"`
}

type Spells

type Spells struct {
	// Index of the spell for shorthand searching
	Index string `json:"index"`

	// Name is the name of the spell
	Name string `json:"name"`

	// Desc is a description of the spell
	Desc []string `json:"desc"`

	// HigherLevel is a description for casting
	// the spell at a higher level
	HigherLevel []string `json:"higher_level,omitempty"`

	// Range of the spell
	Range string `json:"range"`

	// Components are the required components for a spell, shorthanded
	// to V,S, and M which stand for verbal, somatic, and material
	Components []string `json:"components"`

	// Material component for the spell to be cast
	Material string `json:"material"`

	// Ritual determines if a spell can be cast in a 10-min(in-game) ritual
	Ritual bool `json:"ritual"`

	// Duration determines how long the spell effect lasts
	Duration string `json:"duration"`

	// Concentration determines if a spell needs concentration to persist
	Concentration bool `json:"concentration"`

	// CastingTime is How long it takes for the spell to activate
	CastingTime string `json:"casting_time"`

	// Level of the spell
	Level int `json:"level"`

	// AttackType is the attack type of the spell
	AttackType string `json:"attack_type"`

	// Damage is the damage type and the damage dice
	// for the spell at each spell slot level
	Damage struct {
		DamageType        DamageType        `json:"damage_type"`
		DamageAtSlotLevel map[string]string `json:"damage_at_slot_level"`
	} `json:"damage"`

	// School is the magic school this spell
	// belongs to
	School struct {
		Index string `json:"index"`
		Name  string `json:"name"`
		URL   string `json:"url"`
	} `json:"school"`

	// Classes that are able to learn this spell
	Classes []struct {
		Index string `json:"index"`
		Name  string `json:"name"`
		URL   string `json:"url"`
	} `json:"classes"`

	// Subclasses that have access to this spell.
	Subclasses []struct {
		Index string `json:"index"`
		Name  string `json:"name"`
		URL   string `json:"url"`
	} `json:"subclasses"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

Spells are the spells of D&D

func (*Spells) GetIndex added in v0.1.0

func (s *Spells) GetIndex() string

GetIndex returns the index of the spell

Example

Get the index address of a spell

s := Spells{Index: "_example-index"}
s.GetIndex()
Output:

func (*Spells) GetName added in v0.1.0

func (s *Spells) GetName() string

GetName returns the name of the spell

Example

Get the name of a spell

s := Spells{Name: "_example spell name"}
s.GetName()
Output:

func (*Spells) GetURL added in v0.1.0

func (s *Spells) GetURL() string

GetURL returns the URL of the spell

Example

Get the URL of a spell

s := Spells{URL: "_example spell URL"}
s.GetURL()
Output:

func (*Spells) JSON added in v0.3.0

func (s *Spells) JSON(data []byte) error

type StartingEquipment added in v0.0.3

type StartingEquipment struct {
	// Index is the class index for shorthand searching
	Index string `json:"index"`

	// Class is the class that gains this equipment.
	Class APIReference `json:"class"`

	// StartingEquipment is the starting equipment a character automatically gets.
	StartingEquipment []StartingEquipmentItem `json:"starting_equipment"`

	// StartingEquipmentOptions is the Starting equipment where the player must
	// choose a certain number from the given list of equipment.
	StartingEquipmentOptions []Choice `json:"starting_equipment_options"`

	// The URL reference of this resource
	URL string `json:"url"`
}

StartingEquipment are the starting equipment of a class

func (*StartingEquipment) JSON added in v0.3.0

func (s *StartingEquipment) JSON(data []byte) error

type StartingEquipmentItem added in v0.0.3

type StartingEquipmentItem struct {
	Equipment APIReference `json:"equipment"`
	Quantity  int          `json:"quantity"`
}

StartingEquipmentItem is a single item in a list of starting equipment

func (*StartingEquipmentItem) JSON added in v0.3.0

func (c *StartingEquipmentItem) JSON(data []byte) error

type SubRace added in v0.0.3

type SubRace struct {
	// Index is the subrace index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this subrace resource.
	Name string `json:"name"`

	// Race is the parent race for this subrace.
	Race interface{} `json:"race"`

	// Desc is a flavor description of this subrace
	Desc string `json:"desc"`

	// AbilityBonuses are ability bonuses granted by this sub race.
	AbilityBonuses []AbilityBonus `json:"ability_bonuses"`

	// StartingProficiencies for all new characters of this subrace.
	StartingProficiencies []APIReference `json:"starting_proficiencies"`

	// Languages are starting languages for all new characters of this subrace.
	Languages []APIReference `json:"languages"`

	// LanguageOptions is the list of languages available to this race
	LanguageOptions interface{} `json:"language_options,omitempty"`

	// Traits are racial traits that provide benefits to its members.
	Traits []*APIReference `json:"traits,omitempty"`

	// RacialTraits are racial traits that provide benefits to its members.
	RacialTraits []*APIReference `json:"racial_traits,omitempty"`

	// RacialTraitOptions are racial traits options available to this subrace
	RacialTraitOptions *Choice `json:"racial_trait_options,omitempty"`

	// The URL of the referenced resource
	URL string `json:"url"`
}

SubRace contains the details for a parent race's associated subrace

func (*SubRace) JSON added in v0.3.0

func (r *SubRace) JSON(data []byte) error

type Subclass added in v0.0.3

type Subclass struct {
	// Index is the class index for shorthand searching.
	Index string `json:"index"`

	// Class is the parent class for this subclass
	Class string `json:"class"`

	// Name is the name for this class resource.
	Name string `json:"name"`

	// SubclassFlavor is the lore-friendly
	// flavor text for a classes respective subclass.
	SubclassFlavor string `json:"subclass_flavor"`

	// Desc is the description of the subclass resource.
	Desc string `json:"description"`

	// SubClassLevels is a resource url that shows the subclass level progression
	SubClassLevels APIReference `json:"sub_class_levels"`

	// Spells is the URL of the class's spell Resource List.
	// Returns a list of all spells that can be learned or cast by the class.
	Spells []string `json:"spells"`

	// The URL reference of this resource
	URL string `json:"url"`
}

Subclass reflects the different paths a class may take as levels are gained

func (*Subclass) JSON added in v0.3.0

func (c *Subclass) JSON(data []byte) error

type Traits added in v0.0.3

type Traits struct {
	// Index is the trait index for
	// shorthand searching.
	Index string `json:"index"`

	// Races is the list of races that have access
	// to this trait
	Races []APIReference `json:"races"`

	// SubRaces is list of related subraces
	SubRaces []APIReference `json:"subraces"`

	// Name is the name of the trait
	Name string `json:"name"`

	// Desc is the description of
	// the trait
	Desc string `json:"desc"`

	// Proficiencies are Proficiencies
	// this trait grants.
	Proficiencies []APIReference `json:"proficiencies"`

	// ProficiencyChoices are choices of proficiencies
	// this trait grants.
	ProficiencyChoices []Choice `json:"proficiency_choices"`
}

Traits for races in D&D

func (*Traits) JSON added in v0.3.0

func (t *Traits) JSON(data []byte) error

type Weapon added in v0.0.3

type Weapon struct {
	// Index is the damage type index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this equipment resource
	Name string `json:"name"`

	// EquipmentCategory is the category of equipment this falls into
	EquipmentCategory APIReference `json:"equipment_category"`

	// WeaponCategory is the category of weapon this falls into
	WeaponCategory string `json:"weapon_category"`

	// WeaponRange is whether this is a Melee or Ranged weapon.
	WeaponRange string `json:"weapon_range"`

	// CategoryRange is a combination of weapon_category and weapon_range.
	CategoryRange string `json:"category_range"`

	// Cost is the financial worth of this equipment
	Cost Cost `json:"cost"`

	// Damage is the data on dice, bonus, and damage type
	Damage ActionDamage `json:"damage"`

	// TwoHandedDamage when wielded with two hands.
	// It includes data on dice, bonus, and damage type.
	TwoHandedDamage *ActionDamage `json:"two_handed_damage,omitempty"`

	// Range Includes the normal and long range for a weapon,
	// only pertains to Ranged weapons
	Range *Range `json:"range"`

	// Weight is the numerical weight of this item
	Weight int `json:"weight"`

	// Properties is a list of properties this weapon has
	Properties []APIReference `json:"properties"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

Weapon is the structure for weapons obtained in the dungeons you explore.

func (*Weapon) GetIndex added in v0.1.0

func (w *Weapon) GetIndex() string

GetName returns the index of the weapon

func (*Weapon) GetName added in v0.1.0

func (w *Weapon) GetName() string

GetName returns the name of the weapon

func (*Weapon) GetURL added in v0.1.0

func (w *Weapon) GetURL() string

GetURL returns the URL of the weapon

func (*Weapon) JSON added in v0.3.0

func (w *Weapon) JSON(data []byte) error

type WeaponProperties added in v0.0.3

type WeaponProperties struct {
	// Index is the damage type index for shorthand searching.
	Index string `json:"index"`

	// Name is the name for this equipment resource
	Name string `json:"name"`

	// Desc is a list of descriptors for this item
	Desc []string `json:"desc"`

	// URL is the URL reference of this resource
	URL string `json:"url"`
}

WeaponProperties is the structure for a weapon's properties

func (*WeaponProperties) JSON added in v0.3.0

func (w *WeaponProperties) JSON(data []byte) error

Jump to

Keyboard shortcuts

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