-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRuinedCastle.cs
51 lines (45 loc) · 1.21 KB
/
RuinedCastle.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
using Celeste;
using Celeste.Mod;
using Microsoft.Xna.Framework;
using Monocle;
public class RuinedCastle : EverestModule
{
public static RuinedCastle Instance;
public RuinedCastle()
{
Instance = this;
}
public override void Load()
{
On.Celeste.Level.LoadLevel += OnLoadLevel;
ImpermanentCrumblePlatform.P_Crumble = new ParticleType
{
Color = Calc.HexToColor("847E87"),
FadeMode = ParticleType.FadeModes.Late,
Size = 1f,
Direction = 1.5707964f,
SpeedMin = 5f,
SpeedMax = 25f,
LifeMin = 0.8f,
LifeMax = 1f,
Acceleration = Vector2.UnitY * 20f
};
}
public override void Unload()
{
On.Celeste.Level.LoadLevel -= OnLoadLevel;
}
private void OnLoadLevel(On.Celeste.Level.orig_LoadLevel orig, Level self, Player.IntroTypes playerIntro, bool isFromLoader)
{
orig(self, playerIntro, isFromLoader);
LevelGen(self);
}
private void LevelGen(Level level)
{
if (level.Session.Area.GetSID() == "RuinedCastle/RuinedCastle/RuinedCastle")
{
ProceduralLevelGenerator generator = new(DateTime.Now.GetHashCode());
generator.GenerateLevel(level);
}
}
}