780 lines
48 KiB
C#
780 lines
48 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Harmony.XUiC_SkillCraftingInfoEntryPatches
|
|
{
|
|
[HarmonyPatch(typeof(XUiC_SkillCraftingInfoEntry))]
|
|
[HarmonyPatch("GetBindingValue")]
|
|
public class GetBindingValuePatch
|
|
{
|
|
public static bool Prefix(XUiC_SkillCraftingInfoEntry __instance, ref bool __result,
|
|
ref string _value, string _bindingName,
|
|
string ___color_lbl_available,
|
|
string ___color_bg_locked,
|
|
string ___color_lbl_locked,
|
|
ProgressionClass.DisplayData ___data,
|
|
CachedStringFormatterXuiRgbaColor ___durabilitycolorFormatter,
|
|
CachedStringFormatterXuiRgbaColor ___nextdurabilitycolorFormatter,
|
|
bool ___isSelected
|
|
)
|
|
{
|
|
bool flag = ___data != null;
|
|
EntityPlayerLocal entityPlayer = __instance.xui.playerUI.entityPlayer;
|
|
|
|
if (_bindingName == "notcomplete")
|
|
{
|
|
if (flag)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue (nextpoints) ___data.Owner.Name: " + ___data.Owner.Name);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue (nextpoints) progressionLevel: " + entityPlayer.Progression.GetProgressionValue(___data.Owner.Name).Level);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue (nextpoints) ___data.IsComplete: " + ___data.IsComplete(entityPlayer.Progression.GetProgressionValue(___data.Owner.Name).Level));
|
|
}
|
|
|
|
_value = flag ? (!___data.IsComplete(entityPlayer.Progression.GetProgressionValue(___data.Owner.Name).Level)).ToString() : "false";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else if (_bindingName == "nextpoints")
|
|
{
|
|
if (flag)
|
|
{
|
|
int currentLevel = entityPlayer.Progression.GetProgressionValue(___data.Owner.Name).Level;
|
|
int nextLevel = ___data.GetNextPoints(currentLevel);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue ___data.Owner.Name: " + ___data.Owner.Name);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentLevel: " + currentLevel);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue nextLevel: " + nextLevel);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue ___data.ItemName: " + ___data.ItemName);
|
|
|
|
float currentFloor = 99999f;
|
|
float currentCeiling = 0f;
|
|
int numLevels = 0;
|
|
|
|
for (int i = 0; i < ___data.QualityStarts.Length; i++)
|
|
{
|
|
numLevels++;
|
|
if (___data.QualityStarts[i] < currentFloor)
|
|
{
|
|
currentFloor = ___data.QualityStarts[i];
|
|
}
|
|
if (___data.QualityStarts[i] > currentCeiling)
|
|
{
|
|
currentCeiling = ___data.QualityStarts[i];
|
|
}
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue ___data.QualityStarts[i]: " + ___data.QualityStarts[i]);
|
|
}
|
|
|
|
foreach (var key in RebirthVariables.localOtherCrafting.Keys)
|
|
{
|
|
////Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue key: " + key);
|
|
|
|
List<categoryCrafting> CategoryCraftingList = RebirthVariables.localOtherCrafting[key];
|
|
foreach (var craftingList in CategoryCraftingList)
|
|
{
|
|
if (craftingList.craftingPerk.ToLower() == ___data.Owner.Name.ToLower())
|
|
{
|
|
float number = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
|
|
float currentCategoryCeiling = RebirthUtilities.GetCraftingOtherCategoryValue(___data.Owner.Name, currentCeiling);
|
|
float currentCategoryFloor = RebirthUtilities.GetCraftingOtherCategoryValue(___data.Owner.Name, currentFloor);
|
|
|
|
List<craftingLevels> craftingLevelsList = craftingList.levels;
|
|
|
|
float categoryCeiling = 0f;
|
|
float craftingCeiling = 0f;
|
|
float categoryFloor = 99999f;
|
|
float craftingFloor = 99999;
|
|
|
|
foreach (var craftingLevel in craftingLevelsList)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingLevel.categoryLevel: " + craftingLevel.categoryLevel);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingLevel.craftingLevel: " + craftingLevel.craftingLevel);
|
|
// CATEGORY
|
|
if (craftingLevel.categoryLevel > categoryCeiling)
|
|
{
|
|
categoryCeiling = craftingLevel.categoryLevel;
|
|
}
|
|
if (craftingLevel.categoryLevel < categoryFloor)
|
|
{
|
|
categoryFloor = craftingLevel.categoryLevel;
|
|
}
|
|
// CRAFTING
|
|
if (craftingLevel.craftingLevel > craftingCeiling)
|
|
{
|
|
craftingCeiling = craftingLevel.craftingLevel;
|
|
}
|
|
if (craftingLevel.craftingLevel < craftingFloor)
|
|
{
|
|
craftingFloor = craftingLevel.craftingLevel;
|
|
}
|
|
}
|
|
|
|
craftingFloor = craftingFloor - 10f;
|
|
|
|
if (craftingFloor < 0)
|
|
{
|
|
craftingFloor = 0f;
|
|
}
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue BEFORE categoryFloor: " + categoryFloor);
|
|
categoryFloor = RebirthUtilities.GetCraftingOtherCategoryValue(___data.Owner.Name, craftingFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue AFTER categoryFloor: " + categoryFloor);
|
|
|
|
float tempNumber = number - categoryFloor;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue tempNumber: " + tempNumber);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryFloor: " + categoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingFloor: " + craftingFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingCeiling: " + craftingCeiling);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryCeiling: " + currentCategoryCeiling);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue numLevels: " + numLevels);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentLevel: " + currentLevel);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue nextLevel: " + nextLevel);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentFloor: " + currentFloor);
|
|
|
|
float perc = (float)(Math.Truncate((tempNumber / currentCategoryCeiling) * 100 * 100) / 100);
|
|
|
|
if ((nextLevel - 1) >= craftingFloor &&
|
|
(nextLevel - 1) < craftingCeiling ||
|
|
(numLevels == 1 && (currentFloor == nextLevel))
|
|
)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C-A");
|
|
|
|
if (currentLevel >= craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue CC1-A");
|
|
if (currentLevel >= currentFloor)
|
|
{
|
|
perc = (float)(Math.Truncate(((tempNumber - currentCategoryFloor) / (currentCategoryCeiling - currentCategoryFloor)) * 100 * 100) / 100);
|
|
}
|
|
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
float xp = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue xp: " + xp);
|
|
|
|
float diffXP = currentCategoryFloor - xp;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffXP: " + diffXP);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
|
|
categoryCeiling = RebirthUtilities.GetOtherCategoryCeilingFromNetFloor(key, xp);
|
|
|
|
float diffCategory = currentCategoryFloor - categoryCeiling;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffCategory: " + diffCategory);
|
|
|
|
perc = (float)(Math.Truncate((1 - (diffXP / (currentCategoryFloor - categoryCeiling))) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue perc: " + perc);
|
|
|
|
_value = "[d1cd84]" + perc.ToString() + "[-]%";
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue CC2-A");
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentFloor <= nextLevel && numLevels > 1)
|
|
{
|
|
if (currentFloor < nextLevel)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B2-A");
|
|
|
|
perc = (float)(Math.Truncate(((tempNumber - currentCategoryFloor) / (currentCategoryCeiling - currentCategoryFloor)) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B2-A, perc: " + perc);
|
|
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B3-A");
|
|
|
|
if (currentLevel == (currentFloor - 10))
|
|
{
|
|
float xp = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue xp: " + xp);
|
|
|
|
float diffXP = currentCategoryFloor - xp;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffXP: " + diffXP);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
|
|
categoryCeiling = RebirthUtilities.GetOtherCategoryCeilingFromNetFloor(key, xp);
|
|
|
|
float diffCategory = currentCategoryFloor - categoryCeiling;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffCategory: " + diffCategory);
|
|
|
|
perc = (float)(Math.Truncate((1 - (diffXP / (currentCategoryFloor - categoryCeiling))) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue perc: " + perc);
|
|
|
|
_value = "[d1cd84]" + perc.ToString() + "[-]%";
|
|
}
|
|
else
|
|
{
|
|
_value = "";
|
|
}
|
|
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentLevel == craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C1-B");
|
|
|
|
if (craftingCeiling > currentFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C2-B");
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C3-B");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentLevel < craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue D-B");
|
|
if (nextLevel == craftingFloor && numLevels == 1)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue E-B");
|
|
|
|
tempNumber = categoryFloor - number;
|
|
|
|
float percDiff = 100 - (tempNumber / categoryFloor) * 100;
|
|
percDiff = (float)Math.Truncate(percDiff * 100) / 100;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue percDiff: " + percDiff);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryFloor: " + categoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue tempNumber: " + tempNumber);
|
|
|
|
_value = "[8fbd84]" + percDiff.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue F-B");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
foreach (var key in RebirthVariables.localGeneticsCrafting.Keys)
|
|
{
|
|
////Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue key: " + key);
|
|
|
|
List<categoryCrafting> CategoryCraftingList = RebirthVariables.localGeneticsCrafting[key];
|
|
foreach (var craftingList in CategoryCraftingList)
|
|
{
|
|
if (craftingList.craftingPerk.ToLower() == ___data.Owner.Name.ToLower())
|
|
{
|
|
float number = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
|
|
float currentCategoryCeiling = RebirthUtilities.GetCraftingGeneticsCategoryValue(___data.Owner.Name, currentCeiling);
|
|
float currentCategoryFloor = RebirthUtilities.GetCraftingGeneticsCategoryValue(___data.Owner.Name, currentFloor);
|
|
|
|
List<craftingLevels> craftingLevelsList = craftingList.levels;
|
|
|
|
float categoryCeiling = 0f;
|
|
float craftingCeiling = 0f;
|
|
float categoryFloor = 99999f;
|
|
float craftingFloor = 99999;
|
|
|
|
foreach (var craftingLevel in craftingLevelsList)
|
|
{
|
|
////Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingLevel.categoryLevel: " + craftingLevel.categoryLevel);
|
|
////Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingLevel.craftingLevel: " + craftingLevel.craftingLevel);
|
|
// CATEGORY
|
|
if (craftingLevel.categoryLevel > categoryCeiling)
|
|
{
|
|
categoryCeiling = craftingLevel.categoryLevel;
|
|
}
|
|
if (craftingLevel.categoryLevel < categoryFloor)
|
|
{
|
|
categoryFloor = craftingLevel.categoryLevel;
|
|
}
|
|
// CRAFTING
|
|
if (craftingLevel.craftingLevel > craftingCeiling)
|
|
{
|
|
craftingCeiling = craftingLevel.craftingLevel;
|
|
}
|
|
if (craftingLevel.craftingLevel < craftingFloor)
|
|
{
|
|
craftingFloor = craftingLevel.craftingLevel;
|
|
}
|
|
}
|
|
|
|
//craftingFloor = craftingFloor - 10f;
|
|
|
|
if (craftingFloor < 0)
|
|
{
|
|
craftingFloor = 0f;
|
|
}
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue BEFORE categoryFloor: " + categoryFloor);
|
|
categoryFloor = RebirthUtilities.GetCraftingGeneticsCategoryValue(___data.Owner.Name, craftingFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue AFTER categoryFloor: " + categoryFloor);
|
|
|
|
float tempNumber = number - categoryFloor;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue tempNumber: " + tempNumber);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryFloor: " + categoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingFloor: " + craftingFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingCeiling: " + craftingCeiling);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryCeiling: " + currentCategoryCeiling);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue numLevels: " + numLevels);
|
|
|
|
float perc = (float)(Math.Truncate((tempNumber / currentCategoryCeiling) * 100 * 100) / 100);
|
|
|
|
if ((nextLevel - 1) >= craftingFloor &&
|
|
(nextLevel - 1) < craftingCeiling ||
|
|
(numLevels == 1 && (currentFloor == nextLevel))
|
|
)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C-C");
|
|
|
|
if (currentLevel >= craftingFloor && ___data.HasQuality)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue CC1-C");
|
|
if (currentLevel >= currentFloor)
|
|
{
|
|
perc = (float)(Math.Truncate(((tempNumber - currentCategoryFloor) / (currentCategoryCeiling - currentCategoryFloor)) * 100 * 100) / 100);
|
|
}
|
|
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue CC2-C");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentFloor <= nextLevel && numLevels > 1)
|
|
{
|
|
if (currentFloor < nextLevel)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B2-C");
|
|
|
|
perc = (float)(Math.Truncate(((tempNumber - currentCategoryFloor) / (currentCategoryCeiling - currentCategoryFloor)) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B2-C, perc: " + perc);
|
|
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B3-C");
|
|
|
|
if (currentLevel == (currentFloor - 10))
|
|
{
|
|
float xp = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue xp: " + xp);
|
|
|
|
float diffXP = currentCategoryFloor - xp;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffXP: " + diffXP);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
|
|
categoryCeiling = RebirthUtilities.GetGeneticsCategoryCeilingFromNetFloor(key, xp);
|
|
|
|
float diffCategory = currentCategoryFloor - categoryCeiling;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffCategory: " + diffCategory);
|
|
|
|
perc = (float)(Math.Truncate((1 - (diffXP / (currentCategoryFloor - categoryCeiling))) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue perc: " + perc);
|
|
|
|
_value = "[d1cd84]" + perc.ToString() + "[-]%";
|
|
}
|
|
else
|
|
{
|
|
_value = "";
|
|
}
|
|
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentLevel == craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C1-C");
|
|
|
|
if (craftingCeiling > currentFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C2-C");
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C3-C");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentLevel < craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue D-C");
|
|
if (nextLevel == craftingFloor && numLevels == 1)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue E-C");
|
|
|
|
tempNumber = categoryFloor - number;
|
|
|
|
float percDiff = 100 - (tempNumber / categoryFloor) * 100;
|
|
percDiff = (float)Math.Truncate(percDiff * 100) / 100;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue percDiff: " + percDiff);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryFloor: " + categoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue tempNumber: " + tempNumber);
|
|
|
|
_value = "[8fbd84]" + percDiff.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue F-C");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
foreach (var key in RebirthVariables.localExpertiseCrafting.Keys)
|
|
{
|
|
////Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue key: " + key);
|
|
List<categoryCrafting> CategoryCraftingList = RebirthVariables.localExpertiseCrafting[key];
|
|
foreach (var craftingList in CategoryCraftingList)
|
|
{
|
|
////Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingList.craftingPerk: " + craftingList.craftingPerk.ToLower());
|
|
if (craftingList.craftingPerk.ToLower() == ___data.Owner.Name.ToLower())
|
|
{
|
|
float number = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
|
|
float currentCategoryCeiling = RebirthUtilities.GetCraftingPerksCategoryValue(___data.Owner.Name, currentCeiling);
|
|
float currentCategoryFloor = RebirthUtilities.GetCraftingPerksCategoryValue(___data.Owner.Name, currentFloor);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue key: " + key);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
|
|
List<craftingLevels> craftingLevelsList = craftingList.levels;
|
|
|
|
float categoryCeiling = 0f;
|
|
float craftingCeiling = 0f;
|
|
float categoryFloor = 99999f;
|
|
float craftingFloor = 99999;
|
|
|
|
foreach (var craftingLevel in craftingLevelsList)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingLevel.categoryLevel: " + craftingLevel.categoryLevel);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingLevel.craftingLevel: " + craftingLevel.craftingLevel);
|
|
// CATEGORY
|
|
if (craftingLevel.categoryLevel > categoryCeiling)
|
|
{
|
|
categoryCeiling = craftingLevel.categoryLevel;
|
|
}
|
|
if (craftingLevel.categoryLevel < categoryFloor)
|
|
{
|
|
categoryFloor = craftingLevel.categoryLevel;
|
|
}
|
|
// CRAFTING
|
|
if (craftingLevel.craftingLevel > craftingCeiling)
|
|
{
|
|
craftingCeiling = craftingLevel.craftingLevel;
|
|
}
|
|
if (craftingLevel.craftingLevel < craftingFloor)
|
|
{
|
|
craftingFloor = craftingLevel.craftingLevel;
|
|
}
|
|
}
|
|
|
|
craftingFloor = craftingFloor - 10f;
|
|
|
|
if (craftingFloor < 0)
|
|
{
|
|
craftingFloor = 0f;
|
|
}
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingFloor: " + craftingFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue craftingCeiling: " + craftingCeiling);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue BEFORE categoryFloor: " + categoryFloor);
|
|
categoryFloor = RebirthUtilities.GetCraftingPerksCategoryValue(___data.Owner.Name, craftingFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue AFTER categoryFloor: " + categoryFloor);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
|
|
float tempNumber = number - categoryFloor;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue tempNumber: " + tempNumber);
|
|
|
|
//float perc = (float)(Math.Truncate((tempNumber / categoryCeiling) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue nextLevel - 1 (" + (nextLevel - 1) + ") >= craftingFloor (" + craftingFloor + ")");
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue nextLevel - 1 (" + (nextLevel - 1) + ") < craftingCeiling (" + craftingCeiling + ")");
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentLevel (" + currentLevel + ") < craftingFloor (" + craftingFloor + ")");
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentFloor: " + currentFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCeiling: " + currentCeiling);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryCeiling: " + currentCategoryCeiling);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue numLevels: " + numLevels);
|
|
|
|
float perc = (float)(Math.Truncate((tempNumber / currentCategoryCeiling) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue perc: " + perc);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B-D");
|
|
if ((nextLevel - 1) >= craftingFloor &&
|
|
(nextLevel - 1) < craftingCeiling ||
|
|
(numLevels == 1 && (currentFloor == nextLevel))
|
|
)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C-D");
|
|
|
|
if (currentLevel >= craftingFloor && ___data.HasQuality)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue CC1-D");
|
|
if (currentLevel >= currentFloor)
|
|
{
|
|
perc = (float)(Math.Truncate(((tempNumber - currentCategoryFloor) / (currentCategoryCeiling - currentCategoryFloor)) * 100 * 100) / 100);
|
|
|
|
string className = RebirthUtilities.GetClassFromPerk(key);
|
|
|
|
if (className != "")
|
|
{
|
|
float expertiseLevel = RebirthVariables.localConstants["$varFuriousRamsay" + key + "Lvl"];
|
|
float classLevel = RebirthVariables.localConstants["$varFuriousRamsay" + className + "Lvl"];
|
|
|
|
if (classLevel == expertiseLevel)
|
|
{
|
|
float classPerc = RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
|
|
|
perc = (float)(Math.Truncate((classPerc - classLevel) * 100 * 100) / 100);
|
|
|
|
_value = "[d1cd84]" + "CLASS" + "[-]: " + perc + "%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue CC2-D");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentFloor <= nextLevel && numLevels > 1)
|
|
{
|
|
if (currentFloor < nextLevel)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B2-D");
|
|
|
|
perc = (float)(Math.Truncate(((tempNumber - currentCategoryFloor) / (currentCategoryCeiling - currentCategoryFloor)) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B2-D, perc: " + perc);
|
|
|
|
string className = RebirthUtilities.GetClassFromPerk(key);
|
|
|
|
if (className != "")
|
|
{
|
|
float expertiseLevel = RebirthVariables.localConstants["$varFuriousRamsay" + key + "Lvl"];
|
|
float classLevel = RebirthVariables.localConstants["$varFuriousRamsay" + className + "Lvl"];
|
|
|
|
if (classLevel == expertiseLevel)
|
|
{
|
|
float classPerc = RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
|
|
|
perc = (float)(Math.Truncate((classPerc - classLevel) * 100 * 100) / 100);
|
|
|
|
_value = "[d1cd84]" + "CLASS" + "[-]: " + perc + "%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue B3-D");
|
|
|
|
string className = RebirthUtilities.GetClassFromPerk(key);
|
|
|
|
if (className != "")
|
|
{
|
|
float expertiseLevel = RebirthVariables.localConstants["$varFuriousRamsay" + key + "Lvl"];
|
|
float classLevel = RebirthVariables.localConstants["$varFuriousRamsay" + className + "Lvl"];
|
|
|
|
if (classLevel == expertiseLevel && currentLevel == (currentFloor - 10))
|
|
{
|
|
float classPerc = RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
|
|
|
perc = (float)(Math.Truncate((classPerc - classLevel) * 100 * 100) / 100);
|
|
|
|
_value = "[d1cd84]" + "CLASS" + "[-]: " + perc + "%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if (currentLevel == (currentFloor - 10))
|
|
{
|
|
float xp = RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"];
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue xp: " + xp);
|
|
|
|
float diffXP = currentCategoryFloor - xp;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffXP: " + diffXP);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue currentCategoryFloor: " + currentCategoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryCeiling: " + categoryCeiling);
|
|
|
|
categoryCeiling = RebirthUtilities.GetExpertiseCategoryCeilingFromNetFloor(key, xp);
|
|
|
|
float diffCategory = currentCategoryFloor - categoryCeiling;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue diffCategory: " + diffCategory);
|
|
|
|
perc = (float)(Math.Truncate((1 - (diffXP / (currentCategoryFloor - categoryCeiling))) * 100 * 100) / 100);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue perc: " + perc);
|
|
|
|
_value = "[d1cd84]" + perc.ToString() + "[-]%";
|
|
}
|
|
else
|
|
{
|
|
_value = "";
|
|
}
|
|
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentLevel == craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C1-D");
|
|
|
|
if (craftingCeiling > currentFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C2-D");
|
|
_value = "[8fbd84]" + perc.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue C3-D");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
else if (currentLevel < craftingFloor)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue D-D");
|
|
if (nextLevel == craftingFloor && numLevels == 1)
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue E-D");
|
|
|
|
tempNumber = categoryFloor - number;
|
|
|
|
float percDiff = 100 - (tempNumber / categoryFloor) * 100;
|
|
percDiff = (float)Math.Truncate(percDiff * 100) / 100;
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue percDiff: " + percDiff);
|
|
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue number: " + number);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue categoryFloor: " + categoryFloor);
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue tempNumber: " + tempNumber);
|
|
|
|
_value = "[8fbd84]" + percDiff.ToString() + "[-]%";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_SkillCraftingInfoEntryPatches-GetBindingValue F-D");
|
|
_value = "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
_value = flag ? string.Format("{0}/{1}", (object)entityPlayer.Progression.GetProgressionValue(___data.Owner.Name).Level, (object)___data.GetNextPoints(entityPlayer.Progression.GetProgressionValue(___data.Owner.Name).Level).ToString()) : "";
|
|
__result = true;
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|