-
Notifications
You must be signed in to change notification settings - Fork 0
/
NightmareSky.cs
71 lines (60 loc) · 1.91 KB
/
NightmareSky.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics.Effects;
namespace Thinf
{
public class NightmareSky : CustomSky
{
private readonly Random _random = new Random();
private bool _isActive;
public override void OnLoad()
{
}
public override void Update(GameTime gameTime)
{
}
private float GetIntensity()
{
return 0.9f;
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (maxDepth >= 0f && minDepth < 0f)
{
float intensity = GetIntensity();
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity);
}
if (maxDepth >= 0f && minDepth < 0f && (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight))
{
float intensity = GetIntensity();
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity * 1.5f);
}
}
public override Color OnTileColor(Color inColor)
{
return Color.DarkRed * 1.3f;
}
public override float GetCloudAlpha()
{
return 0f;
}
public override void Activate(Vector2 position, params object[] args)
{
_isActive = true;
}
public override void Deactivate(params object[] args)
{
_isActive = false;
}
public override void Reset()
{
_isActive = false;
}
public override bool IsActive()
{
return _isActive;
}
}
}