Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶
type Class int
Class is a low-specificity delineation of item. Within each Class is a collection of more specific types of that class captured as a Code. BowClass might contain a long bow and a short bow. The SwordClass might contain a fast sword and a slow sword.
type Equipment ¶
type Equipment struct { Weapon *Instance Helm *Instance Amulet *Instance Armor *Instance Ring1 *Instance Ring2 *Instance Belt *Instance Gloves *Instance Boots *Instance }
Equipment is a Component that stores the equipped items of a Character.
func (*Equipment) SumModifiers ¶
SumModifiers returns the sum of all modifiers present on all items in this Equipment.
func (*Equipment) WeaponActionPoints ¶
func (*Equipment) WeaponBaseChanceToHit ¶
func (*Equipment) WeaponClass ¶
WeaponClass returns the inferred ItemClass of the Weapon that is equipped (if one is equipped), otherwise it returns Unarmed.
func (*Equipment) WeaponPreparation ¶
type Instance ¶
type Instance struct { Class Class // Code represents a more specific implementation of the ItemClass. If an item's // name in English is Short Sword, the Code might be "short_sword". Codes // should be configured in separate game data, and loaded into the game at // runtime. Code string // Name is rendered at recipe execution time and might be something like "Deadly // Axe of Iciness" Name string BaseChanceToHit float64 Modifiers map[Modifier]float64 // base damage, or base armor, or any other modifier Skills []skill.ID }
Instance is a rolled item that can be equipped.
type Modifier ¶
type Modifier int
Modifier enumerates the stat modifiers that appear on items and effects in the game.
const ( // BaseMinDamageModifier should typically appear only on weapons. It is a // value, not a multiplier BaseMinDamageModifier Modifier = iota // BaseMaxDamageModifier should typically appear only on weapons. It is a // value, not a multiplier BaseMaxDamageModifier // BaseDamageModifier multiplies the base damage before it is multiplied by // DamageMultiplierModifier. Should typically only appear on Weapons. Maybe // should never go past 99%? BaseDamageModifier // DamageMultiplierModifier is accumulated from modifiers present on // non-weapon items and also core stats. DamageMultiplierModifier // PreparationModifier is added to the Character's PreparationThreshold. PreparationModifier //ActionPointModifier is added to the Character's ActionPoint maximum. ActionPointModifier // ChanceToHitModifier multiplies the base chance to hit of Attacks. // A value of zero does not modify the chance to hit. A value of 0.1 // improves the chance to hit by 10%. A value of -0.5 halves the chance to // hit. ChanceToHitModifier )