Support SLOW item stat (percentage, ideally 1.0 - 100.0%). If enough slow stacks then it will immobilize the entity completely (could not find any classic limit).

This commit is contained in:
Emagi 2025-08-17 08:46:42 -04:00
parent fd2a9566fe
commit c5e9adc069

View File

@ -2540,6 +2540,17 @@ float Entity::GetSpeed() {
} }
} }
if (stats.count(ITEM_STAT_SLOW)) {
float slowPct = stats[ITEM_STAT_SLOW];
if(slowPct > 99.9f) {
ret = 0.0f;
}
else {
float slow_multiplier = 1.0f - (slowPct / 100.0f);
ret = ret * slow_multiplier;
}
}
MStats.unlock(); MStats.unlock();
ret *= speed_multiplier; ret *= speed_multiplier;
return ret; return ret;