Ejemplo n.º 1
0
        //Warns the player when the new percentage goes below a threshold (if not sleeping)
        public void Warn(float oldPercent, float newPercent, float[] thresholds, string[][] msgs, bool write = false)
        {
            //Don't warn when sleeping
            if (sleeping)
            {
                return;
            }

            for (int i = 0; i < thresholds.Length; ++i)
            {
                //If the new percent brings the player below a threshold then warn them
                if (oldPercent > thresholds[i] && newPercent <= thresholds[i])
                {
                    if (write)
                    {
                        Animations.Write(msgs[i], this);
                        break;
                    }
                    Animations.Warn(msgs[i], this);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 public static void Warn(string[] msgs, Body b = null)
 {
     Animations.Warn(Strings.RandString(msgs), b);
 }