示例#1
0
        static void Postfix(PartyBase party, float renownValueOfBattle, float contributionShare, ref ExplainedNumber result, ref float __result)
        {
            if ((BannerlordTweaksSettings.Instance is { } settings&& party.LeaderHero != null) && (settings.BattleRewardApplyToAI || party.LeaderHero == Hero.MainHero))
            {
                float battleRenownMultiplier = settings.BattleRenownMultiplier;
                battleRenownMultiplier -= 1f;
                if (party.LeaderHero == Hero.MainHero && settings.BattleRewardShowDebug)
                {
                    String BTTweak = "";

                    if ((float)Math.Round((double)battleRenownMultiplier * 100f, 2) > 0f)
                    {
                        BTTweak = "+";
                    }

                    DebugHelpers.DebugMessage("Renown Value = " + (float)Math.Round((double)renownValueOfBattle, 2) + "| Your share = " + (float)Math.Round((double)renownValueOfBattle * contributionShare, 2) + "(" + (float)Math.Round((double)contributionShare * 100f, 1) + "%)" +
                                              "\nPerkBonus = " + (float)Math.Round((double)result.ResultNumber - result.BaseNumber, 2) +
                                              "(" + (float)Math.Round((double)(result.ResultNumber / result.BaseNumber - 1f) * 100f, 1) + "%)" +
                                              "\nSum = " + (float)Math.Round((double)result.ResultNumber, 2) +
                                              "\nBT Tweak = " + (float)Math.Round((double)battleRenownMultiplier * result.ResultNumber, 2) + "(" + BTTweak + (float)Math.Round((double)battleRenownMultiplier * 100f, 1) + "%)" +
                                              "\n\n");
                }
                __result = result.ResultNumber + (battleRenownMultiplier * result.ResultNumber);
                result.Add(battleRenownMultiplier * result.ResultNumber, new TextObject("BT Renown Tweak"), null);
            }
        }