-
Notifications
You must be signed in to change notification settings - Fork 3
/
BlueMoonSky.cs
79 lines (66 loc) · 1.44 KB
/
BlueMoonSky.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
72
73
74
75
76
77
78
79
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics;
using Terraria.Graphics.Effects;
using Terraria.ModLoader;
using SpiritMod;
namespace SpiritMod
{
public class BlueMoonSky : CustomSky
{
private float intensity = 0f;
private int BlueMoonIndex = -1;
public override void Update(GameTime gameTime)
{
}
private float GetIntensity()
{
return 1f;
}
public override Color OnTileColor(Color inColor)
{
float intensity = this.GetIntensity();
return new Color(Vector4.Lerp(new Vector4(0f, 0.3f, 1f, 1f), inColor.ToVector4(), 1f - intensity));
}
private bool UpdateBlueMoonIndex()
{
if (MyWorld.BlueMoon)
{
return true;
}
else
{
return false;
}
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (maxDepth >= 0 && minDepth < 0)
{
float intensity = this.GetIntensity();
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity);
}
}
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 MyWorld.BlueMoon;
}
}
}