51 lines
1.9 KiB
C#
51 lines
1.9 KiB
C#
using Jotunn.Managers;
|
|
using System.Collections.Generic;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
public static class BossProgressionManager
|
|
{
|
|
public static int DebugState = -1; // [DEBUG] Da rimuovere in seguito
|
|
|
|
// Valheim Global Keys for bosses
|
|
public const string Eikthyr = "defeated_eikthyr";
|
|
public const string TheElder = "defeated_gdking";
|
|
public const string Bonemass = "defeated_bonemass";
|
|
public const string Moder = "defeated_dragon";
|
|
public const string Yagluth = "defeated_goblinking";
|
|
public const string TheQueen = "defeated_queen";
|
|
public const string Fader = "defeated_fader";
|
|
|
|
/// <summary>
|
|
/// Returns the current progression state of the world based on defeated bosses.
|
|
/// 1 = No bosses defeated
|
|
/// 2 = Eikthyr defeated
|
|
/// 3 = The Elder defeated
|
|
/// 4 = Bonemass defeated
|
|
/// 5 = Moder defeated
|
|
/// 6 = Yagluth defeated
|
|
/// 7 = The Queen defeated
|
|
/// 8 = Fader defeated
|
|
/// </summary>
|
|
public static int GetCurrentProgressionState()
|
|
{
|
|
if (DebugState != -1) return DebugState; // [DEBUG]
|
|
|
|
if (ZoneSystem.instance == null)
|
|
{
|
|
return 1; // Default to 1 if ZoneSystem isn't ready
|
|
}
|
|
|
|
// We check in reverse order (highest tier first)
|
|
if (ZoneSystem.instance.GetGlobalKey(Fader)) return 8;
|
|
if (ZoneSystem.instance.GetGlobalKey(TheQueen)) return 7;
|
|
if (ZoneSystem.instance.GetGlobalKey(Yagluth)) return 6;
|
|
if (ZoneSystem.instance.GetGlobalKey(Moder)) return 5;
|
|
if (ZoneSystem.instance.GetGlobalKey(Bonemass)) return 4;
|
|
if (ZoneSystem.instance.GetGlobalKey(TheElder)) return 3;
|
|
if (ZoneSystem.instance.GetGlobalKey(Eikthyr)) return 2;
|
|
|
|
return 1; // No bosses defeated
|
|
}
|
|
}
|
|
}
|