1
0

Revert "fix resistibility factor for higher tiers"

This reverts commit e1a02a3ef73106484c3063910bcc2d9e21645315.
This commit is contained in:
Emagi 2025-01-14 13:59:30 -05:00
parent ff7753528d
commit cd64a84d40

View File

@ -31,8 +31,6 @@
#include "Rules/Rules.h" #include "Rules/Rules.h"
#include "SpellProcess.h" #include "SpellProcess.h"
#include "World.h" #include "World.h"
#include <cmath>
#include <algorithm>
#include <math.h> #include <math.h>
extern Classes classes; extern Classes classes;
@ -806,18 +804,8 @@ int8 Entity::DetermineHit(Spawn* victim, int8 type, int8 damage_type, float ToHi
bonus += (skill->current_val+skillAddedByWeapon) / 25; bonus += (skill->current_val+skillAddedByWeapon) / 25;
if(is_caster_spell && lua_spell) { if(is_caster_spell && lua_spell) {
if(lua_spell->spell->GetSpellData()->resistibility > 0) { if(lua_spell->spell->GetSpellData()->resistibility > 0)
float pivot = 0.7f; // Central resistibility point (we seem to have .65 - .75 for our resistability usually) bonus -= (1.0f - lua_spell->spell->GetSpellData()->resistibility)*100.0f;
float scale_factor = 2.0f; // steepness control
// Clamps to avoid extreme values
float resistibility = std::clamp(resistibility, 0.0f, 1.0f);
// Calculate marginalized resistibility
float marginalized_resistibility = 1.0f - exp(-scale_factor * (lua_spell->spell->GetSpellData()->resistibility - pivot));
// Adjust bonus based on marginalized resistibility
bonus -= marginalized_resistibility * 100.0f;
}
LogWrite(COMBAT__DEBUG, 9, "Combat", "SpellResist: resistibility %f, bonus %f", lua_spell->spell->GetSpellData()->resistibility, bonus); LogWrite(COMBAT__DEBUG, 9, "Combat", "SpellResist: resistibility %f, bonus %f", lua_spell->spell->GetSpellData()->resistibility, bonus);
// Here we take into account Subjugation, Disruption and Ordination (debuffs) // Here we take into account Subjugation, Disruption and Ordination (debuffs)