public static void CalculateInventoryCapacity(ref MobileParty mobileParty, ref bool includeDescriptions, ref int additionalTroops, ref int additionalSpareMounts, ref int additionalPackAnimals, ref bool includeFollowers, ref ExplainedNumber __result)
 {
     try
     {
         if (mobileParty.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.ExtraInventoryCapacity > 0)
         {
             __result.Add(BannerlordCheatsSettings.Instance.ExtraInventoryCapacity);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(ExtraInventoryCapacity));
     }
 }
 public static void HearthChange(ref Village __instance, ref float __result)
 {
     try
     {
         if (__instance.IsPlayerVillage() &&
             BannerlordCheatsSettings.Instance?.DailyHearthsBonus > 0)
         {
             __result += BannerlordCheatsSettings.Instance.DailyHearthsBonus;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(DailyHearthsBonus));
     }
 }
Esempio n. 3
0
 public static void GetRelation(Hero otherHero, ref Hero __instance, ref int __result)
 {
     try
     {
         if ((__instance.IsPlayer() || otherHero.IsPlayer()) &&
             BannerlordCheatsSettings.Instance?.PerfectRelationships == true)
         {
             __result = 100;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(PerfectRelationships));
     }
 }
 public static void GetGoldCostForUpgrade(ref PartyBase party, ref CharacterObject characterObject, ref CharacterObject upgradeTarget, ref int __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.FreeTroopUpgrades == true)
         {
             __result = 0;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(FreeTroopUpgrades));
     }
 }
Esempio n. 5
0
 public static void SimulateHit(ref CharacterObject strikerTroop, ref CharacterObject struckTroop, ref PartyBase strikerParty, ref PartyBase struckParty, ref float strikerAdvantage, ref MapEvent battle, ref int __result)
 {
     try
     {
         if (struckParty.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.AlwaysWinBattleSimulation == true)
         {
             __result = 0;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(AlwaysWinBattleSimulation));
     }
 }
 public static void GetPartySpottingRange(ref MobileParty party, ref bool includeDescriptions, ref ExplainedNumber __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.MapVisibilityMultiplier > 1f)
         {
             __result.AddMultiplier(BannerlordCheatsSettings.Instance.MapVisibilityMultiplier);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(MapVisibilityMultiplier));
     }
 }
 public static void GetPartyMemberSizeLimit(ref PartyBase party, ref bool includeDescriptions, ref ExplainedNumber __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.ExtraPartyMemberSize > 0)
         {
             __result.Add(BannerlordCheatsSettings.Instance.ExtraPartyMemberSize);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(ExtraPartyMemberSize));
     }
 }
Esempio n. 8
0
 public static void GetCompanionLimit(ref TaleWorlds.CampaignSystem.Clan clan, ref int __result)
 {
     try
     {
         if (clan.IsPlayerClan() &&
             BannerlordCheatsSettings.Instance?.ExtraCompanionLimit > 0)
         {
             __result += BannerlordCheatsSettings.Instance.ExtraCompanionLimit;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(ExtraCompanionLimit));
     }
 }
 public static void CalculateFinalSpeed(ref MobileParty mobileParty, ref ExplainedNumber finalSpeed, ref ExplainedNumber __result)
 {
     try
     {
         if (mobileParty.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.MapSpeedMultiplier > 1f)
         {
             __result.AddMultiplier(BannerlordCheatsSettings.Instance.MapSpeedMultiplier);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(MapSpeedMultiplier));
     }
 }
Esempio n. 10
0
 public static void GetXpMultiplier(Hero hero, ref float __result)
 {
     try
     {
         if (hero.IsPlayer() &&
             BannerlordCheatsSettings.Instance?.ExperienceMultiplier > 1f)
         {
             __result *= BannerlordCheatsSettings.Instance.ExperienceMultiplier;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(ExperienceMultiplier));
     }
 }
Esempio n. 11
0
 public static void CalculateFinalSpeed(ref MobileParty mobileParty, ref ExplainedNumber finalSpeed, ref ExplainedNumber __result)
 {
     try
     {
         if (!mobileParty.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.NpcMapSpeedPercentage > 100f)
         {
             __result.AddPercentage(BannerlordCheatsSettings.Instance.NpcMapSpeedPercentage);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(NpcMapSpeedPercentage));
     }
 }
 public static void GetLostTroopCountForBreakingInBesiegedSettlement(MobileParty party, SiegeEvent siegeEvent, ref int __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.NoTroopSacrifice == true)
         {
             __result = 0;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(NoTroopSacrificeBreakIn));
     }
 }
Esempio n. 13
0
 public static void ShouldBeIgnored(ref MobileParty __instance, ref bool __result)
 {
     try
     {
         if (__instance.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.PartyInvisibleOnMap == true)
         {
             __result = true;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(PartyInvisibleOnMap));
     }
 }
Esempio n. 14
0
 public static void GetTotalWage(ref MobileParty mobileParty, ref bool includeDescriptions, ref ExplainedNumber __result)
 {
     try
     {
         if (mobileParty.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.TroopWagesPercentage < 100f)
         {
             __result.AddPercentage(BannerlordCheatsSettings.Instance.TroopWagesPercentage);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(TroopWagesPercentage));
     }
 }
Esempio n. 15
0
 public static void GetDailyHealingForRegulars(ref MobileParty party, ref bool includeDescriptions, ref ExplainedNumber __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.PartyHealingMultiplier > 1f)
         {
             __result.AddMultiplier(BannerlordCheatsSettings.Instance.PartyHealingMultiplier);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(PartyHealingMultiplierTroops));
     }
 }
 public static void CalculateLearningRate(ref Hero hero, SkillObject skill, ref float __result)
 {
     try
     {
         if (hero.IsPlayer() &&
             BannerlordCheatsSettings.Instance?.LearningRateMultiplier > 1f)
         {
             __result *= BannerlordCheatsSettings.Instance.LearningRateMultiplier;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(LearningRateMultiplier));
     }
 }
Esempio n. 17
0
 public static void GetAgentStateProbability(Agent affectorAgent, Agent effectedAgent, DamageTypes damageType, float useSurgeryProbability, ref float __result)
 {
     try
     {
         if (effectedAgent.IsPlayerEnemy() &&
             BannerlordCheatsSettings.Instance?.EnemyOnlyKnockout == true)
         {
             __result = 0f;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(EnemyOnlyKnockout));
     }
 }
 public static void GetTroopRecruitmentCost(CharacterObject troop, Hero buyerHero, bool withoutItemCost, ref int __result)
 {
     try
     {
         if (buyerHero.IsPlayer() &&
             BannerlordCheatsSettings.Instance?.FreeTroopRecruitment == true)
         {
             __result = 1;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(FreeTroopRecruitment));
     }
 }
 public static void CalculateDailyFoodConsumptionf(ref MobileParty party, ref bool includeDescription, ref ExplainedNumber __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             BannerlordCheatsSettings.Instance?.FoodConsumptionPercentage < 100f)
         {
             __result.AddPercentage(BannerlordCheatsSettings.Instance.FoodConsumptionPercentage);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(FoodConsumptionPercentage));
     }
 }
Esempio n. 20
0
 public static void Invulnerable(ref Agent __instance, ref bool __result)
 {
     try
     {
         if (__instance.IsPlayer() &&
             BannerlordCheatsSettings.Instance?.Invincible == true)
         {
             __result = true;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(Invincible));
     }
 }
Esempio n. 21
0
 public static void LoyaltyChange(ref Town __instance, ref float __result)
 {
     try
     {
         if (__instance.IsPlayerTown() &&
             BannerlordCheatsSettings.Instance?.DailyLoyaltyBonus > 0)
         {
             __result += BannerlordCheatsSettings.Instance.DailyLoyaltyBonus;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(DailyLoyaltyBonus));
     }
 }
Esempio n. 22
0
 public static void DecideCrushedThrough(Agent attackerAgent, Agent defenderAgent, float totalAttackEnergy, Agent.UsageDirection attackDirection, StrikeType strikeType, WeaponComponentData defendItem, bool isPassiveUsage, ref bool __result)
 {
     try
     {
         if (attackerAgent.IsPlayer() &&
             BannerlordCheatsSettings.Instance?.AlwaysCrushThroughShields == true)
         {
             __result = true;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(AlwaysCrushThroughShields));
     }
 }
Esempio n. 23
0
 public static void CalculateDamage(ref AttackInformation attackInformation, ref AttackCollisionData collisionData, WeaponComponentData weapon, ref float __result)
 {
     try
     {
         if (attackInformation.AttackerAgentCharacter.IsPlayer() &&
             !attackInformation.IsFriendlyFire &&
             BannerlordCheatsSettings.Instance?.OneHitKill == true)
         {
             __result = 10000;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(OneHitKill));
     }
 }
        public static void GetUpgradeCost(ref int currentLevel, ref int __result)
        {
            try
            {
                if (BannerlordCheatsSettings.Instance?.WorkshopUpgradeCostPercentage < 100f)
                {
                    var factor = BannerlordCheatsSettings.Instance.WorkshopUpgradeCostPercentage / 100f;

                    __result = (int)(__result * factor);
                }
            }
            catch (Exception e)
            {
                SubModule.LogError(e, typeof(WorkshopUpgradeCostPercentage));
            }
        }
 public static void GetNumberOfTroopsSacrificedForTryingToGetAway(BattleSideEnum battleSide, MapEvent mapEvent, ref int __result)
 {
     try
     {
         if (mapEvent.IsPlayerMapEvent &&
             battleSide == mapEvent.PlayerSide &&
             BannerlordCheatsSettings.Instance?.NoTroopSacrifice == true)
         {
             __result = 0;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(NoTroopSacrificeRunaway));
     }
 }
        public static void GetDailyExpense(ref int level, ref int __result)
        {
            try
            {
                if (BannerlordCheatsSettings.Instance?.WorkshopDailyExpensePercentage < 100f)
                {
                    var factor = BannerlordCheatsSettings.Instance.WorkshopDailyExpensePercentage / 100f;

                    __result = (int)(__result * factor);
                }
            }
            catch (Exception e)
            {
                SubModule.LogError(e, typeof(WorkshopDailyExpensePercentage));
            }
        }
Esempio n. 27
0
        public static void GetMaximumBet(ref int __result)
        {
            try
            {
                if (BannerlordCheatsSettings.Instance?.TournamentMaximumBetMultiplier > 1)
                {
                    var newValue = (int)Math.Round(__result * BannerlordCheatsSettings.Instance.TournamentMaximumBetMultiplier);

                    __result = newValue;
                }
            }
            catch (Exception e)
            {
                SubModule.LogError(e, typeof(TournamentMaximumBetMultiplier));
            }
        }
 public static void GetAgentStateProbability(Agent affectorAgent, Agent effectedAgent, DamageTypes damageType, float useSurgeryProbability, ref float __result)
 {
     try
     {
         if (effectedAgent.IsHero() &&
             effectedAgent.IsPlayerEnemy() &&
             BannerlordCheatsSettings.Instance?.EnemyLordCombatDeathChanceMultiplier > 1.0f)
         {
             __result *= BannerlordCheatsSettings.Instance.EnemyLordCombatDeathChanceMultiplier;
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(EnemyLordCombatDeathChanceMultiplier));
     }
 }
        public static void GetBuyingCostForPlayer(ref Workshop workshop, ref int __result)
        {
            try
            {
                if (BannerlordCheatsSettings.Instance?.WorkshopBuyingCostPercentage < 100f)
                {
                    var factor = BannerlordCheatsSettings.Instance.WorkshopBuyingCostPercentage / 100f;

                    __result = (int)(__result * factor);
                }
            }
            catch (Exception e)
            {
                SubModule.LogError(e, typeof(WorkshopBuyingCostPercentage));
            }
        }
 public static void  CalculateRecruitableNumber(ref PartyBase party, ref CharacterObject character, ref int __result)
 {
     try
     {
         if (party.IsPlayerParty() &&
             !character.IsHero() &&
             BannerlordCheatsSettings.Instance?.InstantPrisonerRecruitment == true)
         {
             __result = party.PrisonRoster.GetTroopCount(character);
         }
     }
     catch (Exception e)
     {
         SubModule.LogError(e, typeof(InstantPrisonerRecruitment));
     }
 }