Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 0 additions & 97 deletions skymp5-server/cpp/server_guest_lib/ActiveMagicEffectsMap.cpp

This file was deleted.

42 changes: 0 additions & 42 deletions skymp5-server/cpp/server_guest_lib/ActiveMagicEffectsMap.h

This file was deleted.

44 changes: 21 additions & 23 deletions skymp5-server/cpp/server_guest_lib/AnimationSystem.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "AnimationSystem.h"
#include "ActiveMagicEffectsMap.h"
#include "AnimationData.h"
#include "MathUtils.h"
#include "MpActor.h"
Expand All @@ -9,28 +8,27 @@

AnimationSystem::AnimationSystem()
{
animationCallbacks = {
{
"blockStart",
[this](MpActor* actor) {
constexpr float newRate = 0.f;
actor->SetIsBlockActive(true);
if (hasSweetpie) {
actor->SetActorValue(espm::ActorValue::StaminaRate, newRate);
}
},
},
{
"blockStop",
[this](MpActor* actor) {
actor->SetIsBlockActive(false);
if (hasSweetpie) {
actor->SetActorValue(espm::ActorValue::StaminaRate,
actor->GetBaseValues().staminaRate);
}
},
}
};
animationCallbacks = { {
"blockStart",
[this](MpActor* actor) {
// constexpr float newRate = 0.f;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Commented-out code inside blockStart callback remains. If magic effect modifications are removed permanently, consider deleting obsolete code instead of commenting it out.

Suggested change
// constexpr float newRate = 0.f;

actor->SetIsBlockActive(true);
// if (hasSweetpie) {
// actor->SetActorValue(espm::ActorValue::StaminaRate,
// newRate);
// }
},
},
{
"blockStop",
[this](MpActor* actor) {
actor->SetIsBlockActive(false);
// if (hasSweetpie) {
// actor->SetActorValue(espm::ActorValue::StaminaRate,
// actor->GetBaseValues().staminaRate);
// }
},
} };
}

void AnimationSystem::Init(WorldState* pWorldState)
Expand Down
16 changes: 6 additions & 10 deletions skymp5-server/cpp/server_guest_lib/CropRegeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ BaseActorValues GetValues(MpActor* actor)

float CropRegeneration(float newAttributeValue, float secondsAfterLastRegen,
float attributeRate, float attributeRateMult,
float oldAttributeValue, bool hasActiveMagicEffects)
float oldAttributeValue)
{
spdlog::trace(
"[crop]: args=(newAttributeValue={}, secondsAfterLastRegen={}, "
"attributerate={}, attributeRateMult={}, oldAttributeValue={}, "
"hasActiveMagicEffects={})",
"attributerate={}, attributeRateMult={}, oldAttributeValue={})",
newAttributeValue, secondsAfterLastRegen, attributeRate, attributeRateMult,
oldAttributeValue, hasActiveMagicEffects);
oldAttributeValue);

float validRegenerationPercentage =
MathUtils::PercentToFloat(attributeRate) *
Expand Down Expand Up @@ -74,9 +73,8 @@ float CropHealthRegeneration(float newAttributeValue,
const float rateMult =
std::max(baseValues.healRateMult, actorValues.healRateMult);
const float oldPercentage = actorValues.healthPercentage;
const bool hasActiveMagicEffects = !actor->GetActiveMagicEffects().Empty();
return CropRegeneration(newAttributeValue, secondsAfterLastRegen, rate,
rateMult, oldPercentage, hasActiveMagicEffects);
rateMult, oldPercentage);
}

float CropMagickaRegeneration(float newAttributeValue,
Expand All @@ -88,9 +86,8 @@ float CropMagickaRegeneration(float newAttributeValue,
const float rateMult =
std::max(baseValues.magickaRateMult, actorValues.magickaRateMult);
const float oldPercentage = actorValues.magickaPercentage;
const bool hasActiveMagicEffects = !actor->GetActiveMagicEffects().Empty();
return CropRegeneration(newAttributeValue, secondsAfterLastRegen, rate,
rateMult, oldPercentage, hasActiveMagicEffects);
rateMult, oldPercentage);
}

float CropStaminaRegeneration(float newAttributeValue,
Expand All @@ -104,9 +101,8 @@ float CropStaminaRegeneration(float newAttributeValue,
const float rateMult =
std::max(baseValues.staminaRateMult, actorValues.staminaRateMult);
const float oldPercentage = actorValues.staminaPercentage;
const bool hasActiveMagicEffects = !actor->GetActiveMagicEffects().Empty();
return CropRegeneration(newAttributeValue, secondsAfterLastRegen, rate,
rateMult, oldPercentage, hasActiveMagicEffects);
rateMult, oldPercentage);
}

float CropPeriodAfterLastRegen(float secondsAfterLastRegen,
Expand Down
Loading