コード例 #1
0
        /// <summary>
        ///     Gets the temperature offset for a given game condition; returns false if we should use the
        ///     vanilla cacluatation instead
        /// </summary>
        /// <param name="condition">The condition to check for</param>
        /// <returns>True if we overwrote the value, false if we should use vanilla instead.</returns>
        public float GetBiomeConditionTemperatureOffset(GameCondition condition)
        {
            // Check if we have a value:
            if (!conditionOffsets.TryGetValue(condition.def, out var offsetMax) || offsetMax.HasDefaultValue())
            {
                return(condition.TemperatureOffset());
            }

            // Otherwise, do the thing:
            return(GameConditionUtility.LerpInOutValue(condition.TicksPassed, condition.TicksLeft, 12000f,
                                                       offsetMax));
        }
コード例 #2
0
        public override float TemperatureOffset()
        {
            Map map = Find.CurrentMap;

            if (GenLocalDate.HourInteger(map) >= 11 && GenLocalDate.HourInteger(map) <= 19)
            {
                return(GameConditionUtility.LerpInOutValue(this, 10000f, MaxTempOffset));
            }
            else if (GenLocalDate.HourInteger(map) >= 20 || GenLocalDate.HourInteger(map) <= 10)
            {
                return(GameConditionUtility.LerpInOutValue(this, 10000f, MinTempOffset));
            }

            return(GameConditionUtility.LerpInOutValue(this, 10000f, MaxTempOffset));
        }
コード例 #3
0
 public override float SkyTargetLerpFactor(Map map)
 {
     return(GameConditionUtility.LerpInOutValue(this, 200f));
 }
コード例 #4
0
 public override float SkyTargetLerpFactor(Map map)
 {
     return(GameConditionUtility.LerpInOutValue(TicksPassed, TicksLeft, LerpTicks));
 }
コード例 #5
0
 public override float TemperatureOffset()
 {
     return(GameConditionUtility.LerpInOutValue(this, 12000f, -20f));
 }
コード例 #6
0
 public override float SkyTargetLerpFactor(Map map)
 {
     return(GameConditionUtility.LerpInOutValue((float)base.TicksPassed, (float)base.TicksLeft, (float)lerpTicks, 1f));
 }
コード例 #7
0
 public override float TemperatureOffset()
 {
     return(GameConditionUtility.LerpInOutValue(this, TransitionTicks, 17f));
 }
コード例 #8
0
 public override float SkyTargetLerpFactor(Map map)
 {
     return(GameConditionUtility.LerpInOutValue(this, (float)this.TransitionTicks, 0.5f));
 }