Documentation ¶
Index ¶
- Constants
- func AttrModifier(attrVal int) int
- func XPAtLevel(lvl int) int
- type AttrKind
- type Character
- func (c *Character) AddBuff(b string) error
- func (c *Character) AutoBuffs() map[string]int
- func (c *Character) CastSpell(name string, castingLevel int) (string, error)
- func (c *Character) GetArmorClass() (int, string)
- func (c Character) GetAttr(k AttrKind) int
- func (c Character) GetAttrAndModifier(k AttrKind) (int, int)
- func (c *Character) GetCastableSpells() spells.Set
- func (c *Character) GetMagicAttackModifier() (int, string)
- func (c Character) GetModifier(k AttrKind) int
- func (c *Character) GetSpellcastingAbilityAttr() AttrKind
- func (c *Character) GetWeaponAbilityModifier(w rules.Item) (int, string)
- func (c *Character) GetWeaponAttackModifier(w rules.Item) (int, string)
- func (c *Character) GetWeaponDamageModifier(w rules.Item) (int, string)
- func (c *Character) GetWeaponDamageRoll(w rules.Item) string
- func (c *Character) HasBuff(b string) bool
- func (c *Character) IsSpellCaster() bool
- func (c *Character) MagicString() string
- func (c *Character) MaxSpellLevel() int
- func (c *Character) NextLevelAt() int
- func (c *Character) ProficiencyBonus() int
- func (c *Character) RemoveBuff(b string) error
- func (c *Character) SpellsAlwaysMemorized() spells.Set
- func (c *Character) String() string
- func (c *Character) Summary() string
- type Inventory
- type Item
Constants ¶
const ( // This list is for buffs that we make use of elsewhere in the bot; keys match the JSON objects BuffClericDivineDomainSpells = "domain-spells-1" BuffFighterChampionImprovedCritical = "improved-critical" // Fighting styles apply to multiple classes BuffFightingStyleDefense = "fighting-style-defense" BuffFightingStyleDueling = "fighting-style-dueling" )
Variables ¶
This section is empty.
Functions ¶
func AttrModifier ¶
Types ¶
type Character ¶
type Character struct { Name string Race string Class string Subclass string Level int Alignment string Str, Int, Wis, Con, Cha, Dex, Per int MaxHitpoints int CurrHitpoints int XP int Weapons map[string]int Armor string CurrWeapon string Shield bool SpellsMemorized spells.Set Slots spells.Slots Buffs map[string]int Inventory }
A Character holds info about a typical RPG character
func NewCharacter ¶
func NewCharacter() Character
func (*Character) AutoBuffs ¶
Autobuffs returns a list of the buffs you get automatically just because of class/subclass/level/race.
func (*Character) CastSpell ¶
CastSpell verifies the spellname, consumes a spell slot, and returns a string with the spell description in. if `castingLevel` is zero, it's taken as the base level of the spell.
func (*Character) GetArmorClass ¶
Compute a character's AC. The string returns a description.
func (*Character) GetCastableSpells ¶
GetSpellsMemorized returns a set of all the spells that can be cast right now
func (*Character) GetMagicAttackModifier ¶
For when the character casts a spell, and needs a 'magic attack roll'
func (Character) GetModifier ¶
func (*Character) GetSpellcastingAbilityAttr ¶
func (*Character) GetWeaponAbilityModifier ¶
GetWeaponAbilityModifier computes the modifier deriving from the character's ability for the given weapon.
func (*Character) GetWeaponAttackModifier ¶
func (*Character) GetWeaponDamageModifier ¶
func (*Character) GetWeaponDamageRoll ¶
func (*Character) IsSpellCaster ¶
func (*Character) MagicString ¶
func (*Character) MaxSpellLevel ¶
func (*Character) NextLevelAt ¶
func (*Character) ProficiencyBonus ¶
func (*Character) RemoveBuff ¶
func (*Character) SpellsAlwaysMemorized ¶
SpellsAlwaysMemorized lists whatever spells the character has hardwired for whatever reason
type Inventory ¶
type Inventory struct {
Items []Item
}
func NewInventory ¶
func NewInventory() Inventory
func (*Inventory) ParseIndex ¶
Returns a 0-indexed, range-checked index for the slice - or an error