-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Totem of Invigorating Flame + Vanilla Blood Fury #129
Conversation
sim/core/racials.go
Outdated
OnGain: func(aura *Aura, sim *Simulation) { | ||
apBonus := (character.GetBaseStats()[stats.AttackPower] + (character.GetStat(stats.Strength) * 2)) * 0.25 | ||
character.AddStatDynamic(sim, stats.AttackPower, apBonus) | ||
}, | ||
|
||
OnExpire: func(aura *Aura, sim *Simulation) { | ||
apBonus := (character.GetBaseStats()[stats.AttackPower] + (character.GetStat(stats.Strength) * 2)) * 0.25 | ||
character.AddStatDynamic(sim, stats.AttackPower, -apBonus) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to cache the added value when you add it, then remove the cached value. How you've done it right now if your strength stat changes during this auras duration the expire will remove the new value instead of what it originally added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I see, what's the best way to store the apBonus value between ongain and expire?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyler-cb you can just declare it as a variable outside of the aura and then assign it in the onGain
sim/core/racials.go
Outdated
Duration: time.Second * 15, | ||
// Tooltip is misleading; ap bonus is base AP plus AP from current strength, does not include +attackpower on items/buffs | ||
OnGain: func(aura *Aura, sim *Simulation) { | ||
bloodFuryAP := (character.GetBaseStats()[stats.AttackPower] + (character.GetStat(stats.Strength) * 2)) * 0.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to change this to =
as :=
creates a new value instead of assigning i think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. What do you think @Horatio27 ?
No description provided.