266 lines
12 KiB
C#
266 lines
12 KiB
C#
namespace Harmony.ProgressionPatches
|
|
{
|
|
[HarmonyPatch(typeof(global::Progression))]
|
|
[HarmonyPatch("AddLevelExp")]
|
|
public class AddLevelExpPatches
|
|
{
|
|
static void Postfix(global::Progression __instance, int _exp, string _cvarXPName, global::Progression.XPTypes _xpType, bool useBonus,
|
|
global::EntityAlive ___parent)
|
|
{
|
|
//Log.Out("AddLevelExpPatches-AddLevelExp POSTFIX START");
|
|
|
|
bool isAscensionOn = RebirthVariables.customAscension;
|
|
|
|
if (isAscensionOn && ___parent as EntityPlayerLocal != null)
|
|
{
|
|
EntityPlayerLocal entityPlayerLocal = ___parent as EntityPlayerLocal;
|
|
|
|
float miseryPlayerLevel01 = RebirthVariables.localConstants["$varFuriousRamsayAscension01_Cst"];
|
|
float miseryPlayerLevel02 = RebirthVariables.localConstants["$varFuriousRamsayAscension02_Cst"];
|
|
float miseryPlayerLevel03 = RebirthVariables.localConstants["$varFuriousRamsayAscension03_Cst"];
|
|
float miseryPlayerLevel04 = RebirthVariables.localConstants["$varFuriousRamsayAscension04_Cst"];
|
|
float miseryPlayerLevel05 = RebirthVariables.localConstants["$varFuriousRamsayAscension05_Cst"];
|
|
float miseryPlayerLevel06 = RebirthVariables.localConstants["$varFuriousRamsayAscension06_Cst"];
|
|
float miseryPlayerLevel07 = RebirthVariables.localConstants["$varFuriousRamsayAscension07_Cst"];
|
|
float miseryPlayerLevel08 = RebirthVariables.localConstants["$varFuriousRamsayAscension08_Cst"];
|
|
float miseryPlayerLevel09 = RebirthVariables.localConstants["$varFuriousRamsayAscension09_Cst"];
|
|
float miseryPlayerLevel10 = RebirthVariables.localConstants["$varFuriousRamsayAscension10_Cst"];
|
|
|
|
int playerlevel = entityPlayerLocal.Progression.GetLevel();
|
|
|
|
bool playSound = false;
|
|
int progressionLevel = 0;
|
|
|
|
ProgressionValue progressionValue = entityPlayerLocal.Progression.GetProgressionValue("FuriousRamsayAscension");
|
|
if (progressionValue != null)
|
|
{
|
|
progressionLevel = progressionValue.Level;
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (__instance.Level >= miseryPlayerLevel01 && __instance.Level < miseryPlayerLevel02)
|
|
{
|
|
if (progressionLevel < 1)
|
|
{
|
|
progressionLevel = 1;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel02 && __instance.Level < miseryPlayerLevel03)
|
|
{
|
|
if (progressionLevel < 2)
|
|
{
|
|
progressionLevel = 2;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel03 && __instance.Level < miseryPlayerLevel04)
|
|
{
|
|
if (progressionLevel < 3)
|
|
{
|
|
progressionLevel = 3;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel04 && __instance.Level < miseryPlayerLevel05)
|
|
{
|
|
if (progressionLevel < 4)
|
|
{
|
|
progressionLevel = 4;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel05 && __instance.Level < miseryPlayerLevel06)
|
|
{
|
|
if (progressionLevel < 5)
|
|
{
|
|
progressionLevel = 5;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel06 && __instance.Level < miseryPlayerLevel07)
|
|
{
|
|
if (progressionLevel < 6)
|
|
{
|
|
progressionLevel = 6;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel07 && __instance.Level < miseryPlayerLevel08)
|
|
{
|
|
if (progressionLevel < 7)
|
|
{
|
|
progressionLevel = 7;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel08 && __instance.Level < miseryPlayerLevel09)
|
|
{
|
|
if (progressionLevel < 8)
|
|
{
|
|
progressionLevel = 8;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel09 && __instance.Level < miseryPlayerLevel10)
|
|
{
|
|
if (progressionLevel < 9)
|
|
{
|
|
progressionLevel = 9;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel10)
|
|
{
|
|
if (progressionLevel < 10)
|
|
{
|
|
progressionLevel = 10;
|
|
playSound = true;
|
|
}
|
|
}
|
|
|
|
//Log.Out("AddLevelExpPatches-AddLevelExp progressionLevel: " + progressionLevel);
|
|
|
|
if (playSound)
|
|
{
|
|
//Log.Out("AddLevelExpPatches-AddLevelExp playSound: " + playSound);
|
|
GameManager.Instance.StartCoroutine(RebirthUtilities.messageHUD(entityPlayerLocal as EntityPlayerLocal, 2f, "miseryPlayerLevel"));
|
|
|
|
progressionValue.Level = progressionLevel;
|
|
entityPlayerLocal.Progression.bProgressionStatsChanged = true;
|
|
entityPlayerLocal.bPlayerStatsChanged = true;
|
|
}
|
|
}
|
|
|
|
bool isRebirthOn = RebirthVariables.customRebirth;
|
|
|
|
if (isRebirthOn && ___parent as EntityPlayerLocal != null)
|
|
{
|
|
EntityPlayerLocal entityPlayerLocal = ___parent as EntityPlayerLocal;
|
|
|
|
float miseryPlayerLevel01 = RebirthVariables.localConstants["$varFuriousRamsayRebirth01_Cst"];
|
|
float miseryPlayerLevel02 = RebirthVariables.localConstants["$varFuriousRamsayRebirth02_Cst"];
|
|
float miseryPlayerLevel03 = RebirthVariables.localConstants["$varFuriousRamsayRebirth03_Cst"];
|
|
float miseryPlayerLevel04 = RebirthVariables.localConstants["$varFuriousRamsayRebirth04_Cst"];
|
|
float miseryPlayerLevel05 = RebirthVariables.localConstants["$varFuriousRamsayRebirth05_Cst"];
|
|
float miseryPlayerLevel06 = RebirthVariables.localConstants["$varFuriousRamsayRebirth06_Cst"];
|
|
float miseryPlayerLevel07 = RebirthVariables.localConstants["$varFuriousRamsayRebirth07_Cst"];
|
|
float miseryPlayerLevel08 = RebirthVariables.localConstants["$varFuriousRamsayRebirth08_Cst"];
|
|
float miseryPlayerLevel09 = RebirthVariables.localConstants["$varFuriousRamsayRebirth09_Cst"];
|
|
float miseryPlayerLevel10 = RebirthVariables.localConstants["$varFuriousRamsayRebirth10_Cst"];
|
|
|
|
int playerlevel = entityPlayerLocal.Progression.GetLevel();
|
|
|
|
bool playSound = false;
|
|
int progressionLevel = 0;
|
|
|
|
ProgressionValue progressionValue = entityPlayerLocal.Progression.GetProgressionValue("FuriousRamsayRebirth");
|
|
if (progressionValue != null)
|
|
{
|
|
progressionLevel = progressionValue.Level;
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (__instance.Level >= miseryPlayerLevel01 && __instance.Level < miseryPlayerLevel02)
|
|
{
|
|
if (progressionLevel < 1)
|
|
{
|
|
progressionLevel = 1;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel02 && __instance.Level < miseryPlayerLevel03)
|
|
{
|
|
if (progressionLevel < 2)
|
|
{
|
|
progressionLevel = 2;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel03 && __instance.Level < miseryPlayerLevel04)
|
|
{
|
|
if (progressionLevel < 3)
|
|
{
|
|
progressionLevel = 3;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel04 && __instance.Level < miseryPlayerLevel05)
|
|
{
|
|
if (progressionLevel < 4)
|
|
{
|
|
progressionLevel = 4;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel05 && __instance.Level < miseryPlayerLevel06)
|
|
{
|
|
if (progressionLevel < 5)
|
|
{
|
|
progressionLevel = 5;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel06 && __instance.Level < miseryPlayerLevel07)
|
|
{
|
|
if (progressionLevel < 6)
|
|
{
|
|
progressionLevel = 6;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel07 && __instance.Level < miseryPlayerLevel08)
|
|
{
|
|
if (progressionLevel < 7)
|
|
{
|
|
progressionLevel = 7;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel08 && __instance.Level < miseryPlayerLevel09)
|
|
{
|
|
if (progressionLevel < 8)
|
|
{
|
|
progressionLevel = 8;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel09 && __instance.Level < miseryPlayerLevel10)
|
|
{
|
|
if (progressionLevel < 9)
|
|
{
|
|
progressionLevel = 9;
|
|
playSound = true;
|
|
}
|
|
}
|
|
else if (__instance.Level >= miseryPlayerLevel10)
|
|
{
|
|
if (progressionLevel < 10)
|
|
{
|
|
progressionLevel = 10;
|
|
playSound = true;
|
|
}
|
|
}
|
|
|
|
//Log.Out("AddLevelExpPatches-AddLevelExp progressionLevel: " + progressionLevel);
|
|
|
|
if (playSound)
|
|
{
|
|
//Log.Out("AddLevelExpPatches-AddLevelExp playSound: " + playSound);
|
|
GameManager.Instance.StartCoroutine(RebirthUtilities.messageHUD(entityPlayerLocal as EntityPlayerLocal, 2f, "miseryRebirth"));
|
|
|
|
progressionValue.Level = progressionLevel;
|
|
entityPlayerLocal.Progression.bProgressionStatsChanged = true;
|
|
entityPlayerLocal.bPlayerStatsChanged = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|