Changes so that blind effects like those in Flash of Light work.

This commit is contained in:
Paul Coene
2014-09-27 13:00:07 -04:00
parent 1170b57fd5
commit 73a23e9f9d
5 changed files with 16 additions and 5 deletions
+7 -1
View File
@@ -130,7 +130,7 @@ void Mob::ProcessFlee() {
}
float Mob::GetFearSpeed() {
if(flee_mode) {
if(flee_mode || is_blind) {
//we know ratio < FLEE_HP_RATIO
float speed = GetBaseRunspeed();
float ratio = GetHPRatio();
@@ -141,6 +141,12 @@ float Mob::GetFearSpeed() {
speed = speed * ratio * multiplier / 100;
// A blinded mob should be pretty slow when running amuck.
if (is_blind)
{
speed = speed/3.0;
}
//NPC will eventually stop. Snares speeds this up.
if(speed < 0.09)
speed = 0.0001f;