-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: add SweetPieSpellDamageFormula for spell damage modification #2247
feat: add SweetPieSpellDamageFormula for spell damage modification #2247
Conversation
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.
❌ Changes requested. Reviewed everything up to 262de48 in 1 minute and 40 seconds
More details
- Looked at
187
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. skymp5-server/cpp/server_guest_lib/formulas/SweetPieSpellDamageFormula.h:48
- Draft comment:
Addoverride
keyword toCalculateDamage
function declaration for clarity and correctness. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. skymp5-server/cpp/server_guest_lib/formulas/SweetPieSpellDamageFormula.cpp:31
- Draft comment:
Initialization ofsettings
tostd::nullopt
is redundant and can be omitted. - Reason this comment was not posted:
Confidence changes required:50%
TheSweetPieSpellDamageFormula
constructor initializessettings
tostd::nullopt
, but it is not clear if this is necessary sincesettings
is already anstd::optional
. This initialization can be omitted for cleaner code.
Workflow ID: wflow_tIfhOZZuhUAf5b9u
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
const float baseDamage = | ||
baseFormula->CalculateDamage(aggressor, target, spellCastData); | ||
|
||
if (!setings) { |
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.
Typo in variable name: 'setings' should be 'settings'.
|
||
namespace SweetPieSpellDamageFormulaPrivate { | ||
template <class T> | ||
T Clamp(T value, T minValue, T maxValue) |
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.
This implements the same value clamping logic as the existing CropValue
function. Consider either using that function (if float is sufficient) or making it generic.
- function
CropValue
(CropRegeneration.cpp)
#include <limits> | ||
#include <sstream> | ||
|
||
namespace SweetPieSpellDamageFormulaPrivate { |
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.
Anonymous namespace?
Important
Add
SweetPieSpellDamageFormula
to modify spell damage based on item multipliers, configurable via JSON, and integrate it into the server's damage calculation.SweetPieSpellDamageFormula
to modify spell damage based on item multipliers inScampServer.cpp
.sweetPieSpellDamageFormulaSettings
in JSON.SweetPieSpellDamageFormula
inSweetPieSpellDamageFormula.cpp
andSweetPieSpellDamageFormula.h
.CalculateDamage()
forSpellCastData
andHitData
.SweetPieSpellDamageFormulaSettings::FromJson()
.SweetPieDamageFormula.h
to specify it modifies weapon damage.This description was created by for 262de48. It will automatically update as commits are pushed.