Ejemplo n.º 1
0
 public void BaseBoatDecay(float decayTickRate, float timeSinceLastUsed, float outsideDecayMinutes, float deepWaterDecayMinutes)
 {
     if (!(timeSinceLastUsed < 2700f))
     {
         float overallWaterDepth = WaterLevel.GetOverallWaterDepth(base.transform.position);
         float num = (IsOutside() ? outsideDecayMinutes : float.PositiveInfinity);
         if (overallWaterDepth > 4f)
         {
             float t    = Mathf.InverseLerp(4f, 12f, overallWaterDepth);
             float num2 = Mathf.Lerp(0.1f, 1f, t);
             num = Mathf.Min(num, deepWaterDecayMinutes / num2);
         }
         if (!float.IsPositiveInfinity(num))
         {
             float num3 = decayTickRate / 60f / num;
             Hurt(MaxHealth() * num3, DamageType.Decay, this, false);
         }
     }
 }
Ejemplo n.º 2
0
 public bool IsAcceptableWaterDepth(Vector3 pos)
 {
     return(WaterLevel.GetOverallWaterDepth(pos) <= MaxWaterDepth);
 }