protected override ThoughtState CurrentStateInternal(Pawn p)
        {
            switch ((p.GetHashCode() ^ (GenLocalDate.DayOfYear(p) + GenLocalDate.Year(p) * 60) * 391) % 10)
            {
            case 0:
                return(ThoughtState.ActiveAtStage(0));

            case 1:
                return(ThoughtState.ActiveAtStage(1));

            case 2:
                return(ThoughtState.ActiveAtStage(1));

            case 3:
                return(ThoughtState.ActiveAtStage(1));

            case 4:
                return(ThoughtState.Inactive);

            case 5:
                return(ThoughtState.Inactive);

            case 6:
                return(ThoughtState.ActiveAtStage(2));

            case 7:
                return(ThoughtState.ActiveAtStage(2));

            case 8:
                return(ThoughtState.ActiveAtStage(2));

            case 9:
                return(ThoughtState.ActiveAtStage(3));

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
 public static void SetFallShaderGlobals(Map map)
 {
     if (GenPlant.FallIntensityOverride)
     {
         Shader.SetGlobalFloat(ShaderPropertyIDs.FallIntensity, GenPlant.FallIntensity);
     }
     else
     {
         Vector2 vector = Find.WorldGrid.LongLatOf(map.Tile);
         Shader.SetGlobalFloat(ShaderPropertyIDs.FallIntensity, GenPlant.GetFallColorFactor(vector.y, GenLocalDate.DayOfYear(map)));
     }
     Shader.SetGlobalInt("_FallGlobalControls", (!GenPlant.FallGlobalControls) ? 0 : 1);
     if (GenPlant.FallGlobalControls)
     {
         Shader.SetGlobalVector("_FallSrc", new Vector3(GenPlant.FallSrcR, GenPlant.FallSrcG, GenPlant.FallSrcB));
         Shader.SetGlobalVector("_FallDst", new Vector3(GenPlant.FallDstR, GenPlant.FallDstG, GenPlant.FallDstB));
         Shader.SetGlobalVector("_FallRange", new Vector3(GenPlant.FallRangeBegin, GenPlant.FallRangeEnd));
     }
 }
Exemplo n.º 3
0
 public static int DayOfYear(Map map)
 {
     return(GenLocalDate.DayOfYear(map.Tile));
 }
Exemplo n.º 4
0
 public static void SetFallShaderGlobals(Map map)
 {
     if (!FallIntensityOverride)
     {
         Shader.SetGlobalFloat(value: GetFallColorFactor(Find.WorldGrid.LongLatOf(map.Tile).y, GenLocalDate.DayOfYear(map)), nameID: ShaderPropertyIDs.FallIntensity);
     }
     else
     {
         Shader.SetGlobalFloat(ShaderPropertyIDs.FallIntensity, FallIntensity);
     }
     Shader.SetGlobalInt("_FallGlobalControls", FallGlobalControls ? 1 : 0);
     if (FallGlobalControls)
     {
         Shader.SetGlobalVector("_FallSrc", new Vector3(FallSrcR, FallSrcG, FallSrcB));
         Shader.SetGlobalVector("_FallDst", new Vector3(FallDstR, FallDstG, FallDstB));
         Shader.SetGlobalVector("_FallRange", new Vector3(FallRangeBegin, FallRangeEnd));
     }
 }