Upload from upload_mods.ps1
This commit is contained in:
35
Harmony/Harmony_Party.cs
Normal file
35
Harmony/Harmony_Party.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace Harmony.BlockPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(Party))]
|
||||
[HarmonyPatch("GetPartyXP")]
|
||||
public class GetPartyXPPatch
|
||||
{
|
||||
public static bool Prefix(Party __instance, ref int __result, EntityPlayer player, int startingXP)
|
||||
{
|
||||
int num = __instance.MemberCountInRange(player);
|
||||
|
||||
// Parse the party multiplier option
|
||||
float partyMultiplierOption = float.Parse(RebirthVariables.customPartyXPMultiplier) / 100;
|
||||
|
||||
// Calculate the result based on the multiplier
|
||||
if (partyMultiplierOption == 0)
|
||||
{
|
||||
__result = startingXP;
|
||||
}
|
||||
else
|
||||
{
|
||||
float baseMultiplier = 1.0f - 0.1f * num; // Original multiplier logic
|
||||
float adjustedMultiplier = partyMultiplierOption + (1 - partyMultiplierOption) * baseMultiplier;
|
||||
Log.Out("GetPartyXP baseMultiplier: " + baseMultiplier);
|
||||
Log.Out("GetPartyXP adjustedMultiplier: " + adjustedMultiplier);
|
||||
__result = (int)(startingXP * adjustedMultiplier);
|
||||
}
|
||||
|
||||
Log.Out("GetPartyXP startingXP: " + startingXP);
|
||||
|
||||
Log.Out("GetPartyXP XP: " + __result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user