forked from IAmBatby/Tremor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInvasionSky.cs
72 lines (63 loc) · 1.41 KB
/
InvasionSky.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
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ModLoader;
using Tremor.Invasion;
namespace Tremor
{
public class InvasionSky : CustomSky
{
private bool isActive;
private float intensity;
private int invasionI;
public override void Update(GameTime gameTime)
{
if (isActive && intensity < 1f)
{
intensity += 0.01f;
}
else if (!isActive && intensity > 0f)
{
intensity -= 0.01f;
}
}
private bool UpdatePuritySpiritIndex()
{
CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer<CyberWrathInvasion>();
if (InvasionWorld.CyberWrath)
{
return true;
}
invasionI = -1;
return invasionI >= 0;
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (maxDepth >= 0 && minDepth < 0)
{
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(200, 200, 200) * 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 isActive || intensity > 0f;
}
}
}