Skip to content

Commit

Permalink
fix: paralyze logic
Browse files Browse the repository at this point in the history
  • Loading branch information
luan committed Jan 1, 2024
1 parent 1f5b87c commit 2abc298
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/creatures/combat/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2150,13 +2150,8 @@ bool ConditionSpeed::startCondition(std::shared_ptr<Creature> creature) {
int32_t max;
auto baseSpeed = creature->getBaseSpeed();
getFormulaValues(baseSpeed, min, max);
speedDelta = uniform_random(min, max);

if (conditionType == CONDITION_HASTE) {
speedDelta = speedDelta - baseSpeed;
}

if (conditionType == CONDITION_PARALYZE && speedDelta < baseSpeed - 40) {
speedDelta = uniform_random(min, max) - baseSpeed;
if (conditionType == CONDITION_PARALYZE && speedDelta < 40 - baseSpeed) {
speedDelta = 40 - baseSpeed;
}
}
Expand Down Expand Up @@ -2197,13 +2192,9 @@ void ConditionSpeed::addCondition(std::shared_ptr<Creature> creature, const std:
int32_t max;
auto baseSpeed = creature->getBaseSpeed();
getFormulaValues(baseSpeed, min, max);
speedDelta = uniform_random(min, max);

if (conditionType == CONDITION_HASTE) {
speedDelta = speedDelta - baseSpeed;
}
speedDelta = uniform_random(min, max) - baseSpeed;

if (conditionType == CONDITION_PARALYZE && speedDelta < baseSpeed - 40) {
if (conditionType == CONDITION_PARALYZE && speedDelta < 40 - baseSpeed) {
speedDelta = 40 - baseSpeed;
}
}
Expand Down

0 comments on commit 2abc298

Please sign in to comment.