Exemplo n.º 1
0
        float GetFalloff()
        {
            float    timeFalloff = GetTimeFalloff();
            Creature player      = World.Player;

            if (player == null)
            {
                return(0.0f);
            }
            Vector2 dist   = player.VisualTarget - Position;
            float   length = dist.Length();

            if (length < FullRadius)
            {
                return(1.0f * timeFalloff);
            }
            else if (length < FullRadius + FalloffRadius)
            {
                return((float)LerpHelper.CubicIn(1, 0, (length - FullRadius) / FalloffRadius) * timeFalloff);
            }
            else
            {
                return(0.0f);
            }
        }
Exemplo n.º 2
0
 float GetTimeFalloff()
 {
     if (Frame.Time < Time)
     {
         return(1.0f);
     }
     else if (Frame.Time < Time + FalloffTime)
     {
         return((float)LerpHelper.CubicIn(1, 0, (Frame.Time - Time) / FalloffTime));
     }
     else
     {
         return(0.0f);
     }
 }