forked from gardenappl/BossExpertise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBossExpertiseSystem.cs
41 lines (37 loc) · 913 Bytes
/
BossExpertiseSystem.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
using System;
using Terraria;
using Terraria.ModLoader;
namespace BossExpertise
{
class BossExpertiseSystem : ModSystem
{
public override void OnWorldLoad()
{
if (Main.masterMode)
BossExpertise.ActualDifficulty = 2;
else if (Main.expertMode)
BossExpertise.ActualDifficulty = 1;
else
BossExpertise.ActualDifficulty = 0;
}
public override void PostUpdateTime()
{
if (Main.GameModeInfo.IsJourneyMode)
if (Main.masterMode)
BossExpertise.ActualDifficulty = 2;
else if (Main.expertMode)
BossExpertise.ActualDifficulty = 1;
else
BossExpertise.ActualDifficulty = 0;
else
return;
}
public override void PreSaveAndQuit()
{
if (BossExpertise.CurrentDifficulty != BossExpertise.ActualDifficulty) //an extra check just in case
{
BossExpertise.HookDifficultyMode(BossExpertise.ActualDifficulty);
}
}
}
}