// Token: 0x06000157 RID: 343 RVA: 0x0000A81C File Offset: 0x00008A1C
    public void GetColorChanges(out float hue, out float saturation, out float value)
    {
        int level = this.m_character.GetLevel();

        if (level > 1 && this.m_levelSetups.Count >= level - 1)
        {
            LevelEffects.LevelSetup levelSetup = this.m_levelSetups[level - 2];
            hue        = levelSetup.m_hue;
            saturation = levelSetup.m_saturation;
            value      = levelSetup.m_value;
            return;
        }
        hue        = 0f;
        saturation = 0f;
        value      = 0f;
    }
Exemple #2
0
            static void Prefix(ref LevelEffects __instance)
            {
                if (Settings.isDefaultDifficulty)
                {
                    return;
                }

                var count = __instance.m_levelSetups.Count;

                if (count == 0)
                {
                    var levelSetup = new LevelEffects.LevelSetup();
                    levelSetup.m_scale      = 1f + Settings.mobScale.Value / 100f;
                    levelSetup.m_hue        = 0.3f;
                    levelSetup.m_saturation = 0.3f;
                    levelSetup.m_value      = 0.1f;
                    __instance.m_levelSetups.Add(levelSetup);

                    var levelSetup2 = new LevelEffects.LevelSetup();
                    levelSetup.m_scale      = 1f + 2 * Settings.mobScale.Value / 100f;;
                    levelSetup.m_hue        = 0.4f;
                    levelSetup.m_saturation = 0.35f;
                    levelSetup.m_value      = 0.15f;
                    __instance.m_levelSetups.Add(levelSetup2);
                    count = __instance.m_levelSetups.Count;
                }
                if (count < Settings.maxMobLevel.Value)
                {
                    for (int i = count; i <= Settings.maxMobLevel.Value; i++)
                    {
                        var levelSetup = new LevelEffects.LevelSetup();
                        var prev       = __instance.m_levelSetups[i - 1];
                        var prev2      = __instance.m_levelSetups[i - 2];

                        var scaleFactor = Settings.mobScale.Value / 100f;
                        levelSetup.m_scale        = prev.m_scale + scaleFactor;
                        levelSetup.m_hue          = prev.m_hue * 2 - prev2.m_hue;
                        levelSetup.m_saturation   = prev.m_saturation * 2 - prev2.m_saturation;
                        levelSetup.m_value        = prev.m_value * 2 - prev2.m_value;
                        levelSetup.m_enableObject = prev.m_enableObject;
                        __instance.m_levelSetups.Add(levelSetup);
                    }
                }
            }
 // Token: 0x06000156 RID: 342 RVA: 0x0000A6CC File Offset: 0x000088CC
 private void SetupLevelVisualization(int level)
 {
     if (level <= 1)
     {
         return;
     }
     if (this.m_levelSetups.Count >= level - 1)
     {
         LevelEffects.LevelSetup levelSetup = this.m_levelSetups[level - 2];
         base.transform.localScale = new Vector3(levelSetup.m_scale, levelSetup.m_scale, levelSetup.m_scale);
         if (this.m_mainRender)
         {
             string   key = this.m_character.m_name + level.ToString();
             Material material;
             if (LevelEffects.m_materials.TryGetValue(key, out material))
             {
                 Material[] sharedMaterials = this.m_mainRender.sharedMaterials;
                 sharedMaterials[0] = material;
                 this.m_mainRender.sharedMaterials = sharedMaterials;
             }
             else
             {
                 Material[] sharedMaterials2 = this.m_mainRender.sharedMaterials;
                 sharedMaterials2[0] = new Material(sharedMaterials2[0]);
                 sharedMaterials2[0].SetFloat("_Hue", levelSetup.m_hue);
                 sharedMaterials2[0].SetFloat("_Saturation", levelSetup.m_saturation);
                 sharedMaterials2[0].SetFloat("_Value", levelSetup.m_value);
                 this.m_mainRender.sharedMaterials = sharedMaterials2;
                 LevelEffects.m_materials[key]     = sharedMaterials2[0];
             }
         }
         if (this.m_baseEnableObject)
         {
             this.m_baseEnableObject.SetActive(false);
         }
         if (levelSetup.m_enableObject)
         {
             levelSetup.m_enableObject.SetActive(true);
         }
     }
 }