Skip to content
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

Merged
merged 10 commits into from
Dec 28, 2024

Conversation

Pospelove
Copy link
Contributor

@Pospelove Pospelove commented Dec 4, 2024

Important

Add SweetPieSpellDamageFormula to modify spell damage based on item multipliers, configurable via JSON, and integrate it into the server's damage calculation.

  • Behavior:
    • Adds SweetPieSpellDamageFormula to modify spell damage based on item multipliers in ScampServer.cpp.
    • Configurable via sweetPieSpellDamageFormulaSettings in JSON.
  • Implementation:
    • New class SweetPieSpellDamageFormula in SweetPieSpellDamageFormula.cpp and SweetPieSpellDamageFormula.h.
    • Implements CalculateDamage() for SpellCastData and HitData.
    • Parses configuration using SweetPieSpellDamageFormulaSettings::FromJson().
  • Misc:
    • Updates comment in SweetPieDamageFormula.h to specify it modifies weapon damage.

This description was created by Ellipsis for 262de48. It will automatically update as commits are pushed.

@ellipsis-dev ellipsis-dev bot changed the title . feat: add SweetPieSpellDamageFormula for spell damage modification Dec 4, 2024
Copy link

@ellipsis-dev ellipsis-dev bot left a 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 in 4 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:
    Add override keyword to CalculateDamage 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 of settings to std::nullopt is redundant and can be omitted.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The SweetPieSpellDamageFormula constructor initializes settings to std::nullopt, but it is not clear if this is necessary since settings is already an std::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) {
Copy link

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)
Copy link

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.

#include <limits>
#include <sstream>

namespace SweetPieSpellDamageFormulaPrivate {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anonymous namespace?

@Pospelove Pospelove merged commit 6e6ec77 into skyrim-multiplayer:main Dec 28, 2024
14 checks passed
@Pospelove Pospelove deleted the spelldamageformula branch December 28, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants