Esempio n. 1
0
        private void UpdateLightDecay()
        {
            LightMap workingLightMap = this._workingLightMap;

            workingLightMap.LightDecayThroughAir   = 0.91f;
            workingLightMap.LightDecayThroughSolid = 0.56f;
            workingLightMap.LightDecayThroughHoney = new Vector3(0.75f, 0.7f, 0.6f) * 0.91f;
            switch (Main.waterStyle)
            {
            case 0:
            case 1:
            case 7:
            case 8:
                workingLightMap.LightDecayThroughWater = new Vector3(0.88f, 0.96f, 1.015f) * 0.91f;
                break;

            case 2:
                workingLightMap.LightDecayThroughWater = new Vector3(0.94f, 0.85f, 1.01f) * 0.91f;
                break;

            case 3:
                workingLightMap.LightDecayThroughWater = new Vector3(0.84f, 0.95f, 1.015f) * 0.91f;
                break;

            case 4:
                workingLightMap.LightDecayThroughWater = new Vector3(0.9f, 0.86f, 1.01f) * 0.91f;
                break;

            case 5:
                workingLightMap.LightDecayThroughWater = new Vector3(0.84f, 0.99f, 1.01f) * 0.91f;
                break;

            case 6:
                workingLightMap.LightDecayThroughWater = new Vector3(0.83f, 0.93f, 0.98f) * 0.91f;
                break;

            case 9:
                workingLightMap.LightDecayThroughWater = new Vector3(1f, 0.88f, 0.84f) * 0.91f;
                break;

            case 10:
                workingLightMap.LightDecayThroughWater = new Vector3(0.83f, 1f, 1f) * 0.91f;
                break;

            case 12:
                workingLightMap.LightDecayThroughWater = new Vector3(0.95f, 0.98f, 0.85f) * 0.91f;
                break;
            }
            if (Main.player[Main.myPlayer].nightVision)
            {
                workingLightMap.LightDecayThroughAir   *= 1.03f;
                workingLightMap.LightDecayThroughSolid *= 1.03f;
            }
            if (Main.player[Main.myPlayer].blind)
            {
                workingLightMap.LightDecayThroughAir   *= 0.95f;
                workingLightMap.LightDecayThroughSolid *= 0.95f;
            }
            if (Main.player[Main.myPlayer].blackout)
            {
                workingLightMap.LightDecayThroughAir   *= 0.85f;
                workingLightMap.LightDecayThroughSolid *= 0.85f;
            }
            if (!Main.player[Main.myPlayer].headcovered)
            {
                return;
            }
            workingLightMap.LightDecayThroughAir   *= 0.85f;
            workingLightMap.LightDecayThroughSolid *= 0.85f;
        }