Documentation
¶
Index ¶
- Variables
- type Bonuses
- type DefenseTypeIndex
- type PseudoStats
- type SchoolIndex
- type SchoolValueArray
- type SchoolValueArrayValues
- type Stat
- type StatDependency
- type StatDependencyManager
- func (sdm *StatDependencyManager) AddStatDependency(src Stat, dst Stat, amount float64)
- func (sdm *StatDependencyManager) ApplyStatDependencies(s Stats) Stats
- func (sdm *StatDependencyManager) DisableDynamicStatDep(dep *StatDependency) bool
- func (sdm *StatDependencyManager) EnableDynamicStatDep(dep *StatDependency) bool
- func (sdm *StatDependencyManager) FinalizeStatDeps()
- func (sdm *StatDependencyManager) IsFinalized() bool
- func (sdm *StatDependencyManager) MultiplyStat(s Stat, amount float64)
- func (sdm *StatDependencyManager) NewDynamicMultiplyStat(s Stat, amount float64) *StatDependency
- func (sdm *StatDependencyManager) NewDynamicStatDependency(src Stat, dst Stat, amount float64) *StatDependency
- func (sdm *StatDependencyManager) ResetStatDeps()
- func (sdm *StatDependencyManager) SortAndApplyStatDependencies(s Stats) Stats
- type Stats
- func (stats Stats) Add(other Stats) Stats
- func (stats *Stats) AddInplace(other *Stats)
- func (stats Stats) DotProduct(other Stats) Stats
- func (stats Stats) Equals(other Stats) bool
- func (stats Stats) EqualsWithTolerance(other Stats, tolerance float64) bool
- func (stats Stats) FlatString() string
- func (stats Stats) Floor() Stats
- func (stats Stats) Invert() Stats
- func (stats Stats) Multiply(multiplier float64) Stats
- func (stats Stats) String() string
- func (stats Stats) Subtract(other Stats) Stats
- func (stats Stats) ToFloatArray() []float64
- type UnitStat
- func (s UnitStat) AddToStatsProto(p *proto.UnitStats, value float64)
- func (s UnitStat) EqualsPseudoStat(other proto.PseudoStat) bool
- func (s UnitStat) EqualsStat(other Stat) bool
- func (s UnitStat) IsPseudoStat() bool
- func (s UnitStat) IsStat() bool
- func (s UnitStat) PseudoStatIdx() int
- func (s UnitStat) StatIdx() int
- type WeaponSkill
- type WeaponSkills
Constants ¶
This section is empty.
Variables ¶
View Source
var PseudoStatsLen = len(proto.PseudoStat_name)
View Source
var UnitStatsLen = int(Len) + PseudoStatsLen
Functions ¶
This section is empty.
Types ¶
type Bonuses ¶
type Bonuses struct {
Multiplier float64 // multiplier added to all stat gains from this stat.
Deps map[Stat]float64 // multiplier added to Stat when this stat is changed.
}
Bonuses for a single stat
type DefenseTypeIndex ¶
type DefenseTypeIndex byte
const ( DefenseTypeIndexNone DefenseTypeIndex = 0 DefenseTypeIndexMagic DefenseTypeIndex = iota DefenseTypeIndexMelee DefenseTypeIndexRanged DefenseTypeLen )
type PseudoStats ¶
type PseudoStats struct {
SchoolCostMultiplier SchoolValueArray[int32] // Multipliers for spell costs stored as ints
CastSpeedMultiplier float64
MeleeSpeedMultiplier float64
RangedSpeedMultiplier float64
MeleeCritMultiplier float64
FiveSecondRuleRefreshTime time.Duration // last time a spell was cast
SpiritRegenRateCasting float64 // percentage of spirit regen allowed during casting. Spell effect MOD_MANA_REGEN_INTERRUPT (134)
// Both of these are currently only used for innervate.
ForceFullSpiritRegen bool // If set, automatically uses full spirit regen regardless of FSR refresh time.
SpiritRegenMultiplier float64 // Multiplier on spirit portion of mana regen. For spell effect MOD_POWER_REGEN_PERCENT (110)
// If true, allows block/parry.
InFrontOfTarget bool
// "Apply Aura: Mod Damage Done (Physical)", applies to abilities with EffectSpellCoefficient > 0.
// This includes almost all "(Normalized) Weapon Damage", but also some "School Damage (Physical)" abilities.
BonusPhysicalDamage float64 // Comes from '+X Weapon Damage' effects
BonusMHDps float64
BonusOHDps float64
BonusRangedDps float64
DisableDWMissPenalty bool // Used by Heroic Strike and Cleave
IncreasedMissChance float64 // Insect Swarm and Scorpid Sting
DodgeReduction float64 // Target dodge reduction effects e.g. "reduces its target's chance to Dodge by X%"
ThreatMultiplier float64 // Modulates the threat generated. Affected by things like salv.
DamageDealtMultiplier float64 // All damage
SchoolDamageDealtMultiplier SchoolValueArray[float64] // For specific spell schools. DO NOT use with multi school idices! See helper functions on Unit!
HealingDealtMultiplier float64 // All healing
ShieldDealtMultiplier float64 // Increases the effectiveness of your shielding spells.
// Important when unit is attacker or target
BlockValueMultiplier float64
// BlockValue per Strength has to be calculated independently.
BlockValuePerStrength float64
// Only used for NPCs, governs variance in enemy auto-attack damage
DamageSpread float64
// Weapon Skills
UnarmedSkill float64
DaggersSkill float64
SwordsSkill float64
MacesSkill float64
AxesSkill float64
TwoHandedSwordsSkill float64
TwoHandedMacesSkill float64
TwoHandedAxesSkill float64
PolearmsSkill float64
StavesSkill float64
// Ranged Skills
BowsSkill float64
CrossbowsSkill float64
GunsSkill float64
ThrownSkill float64
// Special Feral Weapon Skill
FeralCombatEnabled bool
FeralCombatSkill float64
CanBlock bool
CanParry bool
CanCrush bool
Stunned bool // prevents blocks, dodges, and parries
ParryHaste bool
ReducedCritTakenChance float64 // Reduces chance to be crit.
BonusMeleeHitRatingTaken float64 // Formerly Imp FF and SW Radiance;
BonusSpellHitRatingTaken float64 // Imp FF
BonusHealingTaken float64 // Talisman of Troll Divinity
BonusDamageTakenBeforeModifiers [DefenseTypeLen]float64 // Flat damage reduction values BEFORE Modifiers like Blessing of Sanctuary
BonusDamageTakenAfterModifiers [DefenseTypeLen]float64 // Flat damage reduction values AFTER Modifiers like Stoneskin Totem, Windwall Totem, etc.
DamageTakenMultiplier float64 // All damage
SchoolDamageTakenMultiplier SchoolValueArray[float64] // For specific spell schools. DO NOT use with multi school index! See helper functions on Unit!
SchoolCritTakenChance SchoolValueArray[float64] // For spell school crit. DO NOT use with multi school index! See helper functions on Unit!
SchoolBonusDamageTaken SchoolValueArray[float64] // For spell school bonus damage taken. DO NOT use with multi school index! See helper functions on Unit!
SchoolBonusHitChance SchoolValueArray[float64] // Spell school-specific hit bonuses such as ring runes
SchoolBonusCritChance SchoolValueArray[float64] // Spell school-specific cit bonuses such as Holy Paladin talent - Holy Power
BleedDamageTakenMultiplier float64 // Modifies damage taken from bleed effects
PoisonDamageTakenMultiplier float64 // Modifies damage taken from poison effects
ArmorMultiplier float64 // Major/minor/special multiplicative armor modifiers
HealingTakenMultiplier float64
}
func NewPseudoStats ¶
func NewPseudoStats() PseudoStats
type SchoolIndex ¶
type SchoolIndex byte
const ( SchoolIndexNone SchoolIndex = 0 SchoolIndexPhysical SchoolIndex = iota SchoolIndexArcane SchoolIndexFire SchoolIndexFrost SchoolIndexHoly SchoolIndexNature SchoolIndexShadow SchoolLen // School is composed of multiple base schools. SchoolIndexMultischool SchoolIndex = iota - 1 // This is deliberately set this way to be a continuous sequence. )
func (SchoolIndex) IsMultiSchool ¶
func (schoolIndex SchoolIndex) IsMultiSchool() bool
Check if school index is a multi-school.
type SchoolValueArray ¶
type SchoolValueArray[T SchoolValueArrayValues] [SchoolLen]T
func NewSchoolValueArray ¶
func NewSchoolValueArray[T SchoolValueArrayValues](defaultVal T) SchoolValueArray[T]
func (*SchoolValueArray[T]) AddToAllSchools ¶
func (sfa *SchoolValueArray[T]) AddToAllSchools(change T)
func (*SchoolValueArray[T]) AddToMagicSchools ¶
func (sfa *SchoolValueArray[T]) AddToMagicSchools(change T)
func (*SchoolValueArray[T]) MultiplyAllSchools ¶
func (sfa *SchoolValueArray[T]) MultiplyAllSchools(mult T)
func (*SchoolValueArray[T]) MultiplyMagicSchools ¶
func (sfa *SchoolValueArray[T]) MultiplyMagicSchools(mult T)
type SchoolValueArrayValues ¶
type Stat ¶
type Stat byte
const ( Strength Stat = iota Agility Stamina Intellect Spirit SpellPower ArcanePower FirePower FrostPower HolyPower NaturePower ShadowPower MP5 SpellHit SpellCrit SpellHaste SpellPenetration AttackPower MeleeHit MeleeCrit MeleeHaste ArmorPenetration Expertise Mana Energy Rage Armor RangedAttackPower Defense Block BlockValue Dodge Parry Resilience Health ArcaneResistance FireResistance FrostResistance NatureResistance ShadowResistance BonusArmor HealingPower SpellDamage FeralAttackPower Len )
Use internal representation instead of proto.Stat so we can add functions and use 'byte' as the data type.
This needs to stay synced with proto.Stat.
func ProtoArrayToStatsList ¶
type StatDependency ¶
type StatDependency struct {
// contains filtered or unexported fields
}
func (StatDependency) String ¶
func (sd StatDependency) String() string
type StatDependencyManager ¶
type StatDependencyManager struct {
// contains filtered or unexported fields
}
Manages dependencies between stats.
Some examples: Increases your AP by 30% of your Int Increases agility by X% Reduces armor by 50%
func NewStatDependencyManager ¶
func NewStatDependencyManager() StatDependencyManager
func (*StatDependencyManager) AddStatDependency ¶
func (sdm *StatDependencyManager) AddStatDependency(src Stat, dst Stat, amount float64)
func (*StatDependencyManager) ApplyStatDependencies ¶
func (sdm *StatDependencyManager) ApplyStatDependencies(s Stats) Stats
func (*StatDependencyManager) DisableDynamicStatDep ¶
func (sdm *StatDependencyManager) DisableDynamicStatDep(dep *StatDependency) bool
Returns whether the state changed.
func (*StatDependencyManager) EnableDynamicStatDep ¶
func (sdm *StatDependencyManager) EnableDynamicStatDep(dep *StatDependency) bool
Returns whether the state changed.
func (*StatDependencyManager) FinalizeStatDeps ¶
func (sdm *StatDependencyManager) FinalizeStatDeps()
func (*StatDependencyManager) IsFinalized ¶
func (sdm *StatDependencyManager) IsFinalized() bool
func (*StatDependencyManager) MultiplyStat ¶
func (sdm *StatDependencyManager) MultiplyStat(s Stat, amount float64)
func (*StatDependencyManager) NewDynamicMultiplyStat ¶
func (sdm *StatDependencyManager) NewDynamicMultiplyStat(s Stat, amount float64) *StatDependency
func (*StatDependencyManager) NewDynamicStatDependency ¶
func (sdm *StatDependencyManager) NewDynamicStatDependency(src Stat, dst Stat, amount float64) *StatDependency
func (*StatDependencyManager) ResetStatDeps ¶
func (sdm *StatDependencyManager) ResetStatDeps()
func (*StatDependencyManager) SortAndApplyStatDependencies ¶
func (sdm *StatDependencyManager) SortAndApplyStatDependencies(s Stats) Stats
type Stats ¶
func FromFloatArray ¶
func (*Stats) AddInplace ¶
Adds another to Stats to this, in-place. For performance, only.
func (Stats) DotProduct ¶
Multiplies two Stats together by multiplying the values of corresponding stats, like a dot product operation.
func (Stats) EqualsWithTolerance ¶
func (Stats) FlatString ¶
Like String() but without the newlines.
func (Stats) ToFloatArray ¶
type UnitStat ¶
type UnitStat int
func UnitStatFromIdx ¶
func UnitStatFromPseudoStat ¶
func UnitStatFromPseudoStat(s proto.PseudoStat) UnitStat
func UnitStatFromStat ¶
func (UnitStat) AddToStatsProto ¶
func (UnitStat) EqualsPseudoStat ¶
func (s UnitStat) EqualsPseudoStat(other proto.PseudoStat) bool
func (UnitStat) EqualsStat ¶
func (UnitStat) IsPseudoStat ¶
func (UnitStat) PseudoStatIdx ¶
type WeaponSkill ¶
type WeaponSkill byte
const ( WeaponSkillUnknown WeaponSkill = iota WeaponSkillAxes WeaponSkillSwords WeaponSkillMaces WeaponSkillDaggers WeaponSkillUnarmed WeaponSkillTwoHandedAxes WeaponSkillTwoHandedSwords WeaponSkillTwoHandedMaces WeaponSkillPolearms WeaponSkillStaves WeaponSkillThrown WeaponSkillBows WeaponSkillCrossbows WeaponSkillGuns WeaponSkillFeralCombat WeaponSkillLen )
type WeaponSkills ¶
type WeaponSkills [WeaponSkillLen]float64
func WeaponSkillsFloatArray ¶
func WeaponSkillsFloatArray(values []float64) WeaponSkills
Click to show internal directories.
Click to hide internal directories.