Skip to content

Commit

Permalink
Release v2.1.2 - Stable
Browse files Browse the repository at this point in the history
  • Loading branch information
welles authored Apr 13, 2021
2 parents e70fee1 + 93bd759 commit c0e92be
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.1.1.0</Version>
<Version>2.1.2.0</Version>
<GameVersion>1.5.9</GameVersion>
<GameBranch>Stable</GameBranch>
<AdditionalInfo></AdditionalInfo>
Expand Down
2 changes: 1 addition & 1 deletion Patches/Army/NoArmyFoodConsumptionPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class NoArmyFoodConsumptionPatch
public static void CalculateDailyFoodConsumptionf(ref MobileParty party, ref bool includeDescription, ref ExplainedNumber __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.ArmyFoodConsumptionPercentage, out var armyFoodConsumptionPercentage)
&& party.Army.Parties.Any(x => x.IsPlayerParty()))
&& (party?.Army?.Parties?.Any(x => x.IsPlayerParty()) ?? false))
{
__result.AddPercentage(armyFoodConsumptionPercentage);
}
Expand Down
6 changes: 3 additions & 3 deletions Patches/Characters/PerfectRelationships.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public static class PerfectRelationships
[HarmonyPostfix]
public static void GetRelation(Hero otherHero, ref Hero __instance, ref int __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.PerfectRelationships, out var perfectRelationships)
&& perfectRelationships
&& (__instance.IsPlayer() || otherHero.IsPlayer()))
if ((__instance.IsPlayer() || otherHero.IsPlayer())
&& BannerlordCheatsSettings.TryGetModifiedValue(x => x.PerfectRelationships, out var perfectRelationships)
&& perfectRelationships)
{
__result = 100;
}
Expand Down
8 changes: 4 additions & 4 deletions Patches/General/AddTroopFromEncyclopediaPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public static class AddTroopFromEncyclopediaPatch
[HarmonyPostfix]
public static void OnTick(ref EncyclopediaPageVM __instance)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.EnableHotkeys, out var enableHotkeys)
&& enableHotkeys
&& __instance is EncyclopediaUnitPageVM
&& __instance.Obj is CharacterObject characterObject)
if (__instance is EncyclopediaUnitPageVM
&& __instance.Obj is CharacterObject characterObject
&& BannerlordCheatsSettings.TryGetModifiedValue(x => x.EnableHotkeys, out var enableHotkeys)
&& enableHotkeys)
{
if (Keys.IsKeyPressed(InputKey.H, InputKey.LeftShift, InputKey.LeftControl))
{
Expand Down
24 changes: 12 additions & 12 deletions Patches/General/CheatModeOverridePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace BannerlordCheats.Patches.General
{
[HarmonyPatch(typeof(Game), nameof(Game.CheatMode), MethodType.Getter)]
public static class CheatModeOverridePatch
{
[HarmonyPostfix]
public static void CheatMode(ref bool __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.OverrideCheatMode, out var overrideCheatMode))
{
__result |= overrideCheatMode;
}
}
}
// [HarmonyPatch(typeof(Game), nameof(Game.CheatMode), MethodType.Getter)]
// public static class CheatModeOverridePatch
// {
// [HarmonyPostfix]
// public static void CheatMode(ref bool __result)
// {
// if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.OverrideCheatMode, out var overrideCheatMode))
// {
// __result |= overrideCheatMode;
// }
// }
// }
}
4 changes: 2 additions & 2 deletions Patches/Map/DefaultMapVisibilityModelPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public static class DefaultMapVisibilityModelPatch
[HarmonyPostfix]
public static void GetPartySpottingRange(ref MobileParty party, ref bool includeDescriptions, ref ExplainedNumber __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.MapVisibilityMultiplier, out var mapVisibilityMultiplier)
&& party.IsPlayerParty())
if (party.IsPlayerParty()
&& BannerlordCheatsSettings.TryGetModifiedValue(x => x.MapVisibilityMultiplier, out var mapVisibilityMultiplier))
{
__result.AddMultiplier(mapVisibilityMultiplier);
}
Expand Down
4 changes: 2 additions & 2 deletions Patches/Map/DefaultPartySpeedCalculatingModelPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public static class DefaultPartySpeedCalculatingModelPatch
[HarmonyPostfix]
public static void CalculateFinalSpeed(ref MobileParty mobileParty, ref ExplainedNumber finalSpeed, ref ExplainedNumber __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.MapSpeedMultiplier, out var mapSpeedMultiplier)
&& mobileParty.IsPlayerParty())
if (mobileParty.IsPlayerParty()
&& BannerlordCheatsSettings.TryGetModifiedValue(x => x.MapSpeedMultiplier, out var mapSpeedMultiplier))
{
__result.AddMultiplier(mapSpeedMultiplier);
}
Expand Down
6 changes: 3 additions & 3 deletions Patches/Map/PartyInvisibleOnMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public static class PartyInvisibleOnMap
[HarmonyPostfix]
public static void ShouldBeIgnored(ref MobileParty __instance, ref bool __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.PartyInvisibleOnMap, out var partyInvisibleOnMap)
&& partyInvisibleOnMap
&& __instance.IsPlayerParty())
if (__instance.IsPlayerParty()
&& BannerlordCheatsSettings.TryGetModifiedValue(x => x.PartyInvisibleOnMap, out var partyInvisibleOnMap)
&& partyInvisibleOnMap)
{
__result = true;
}
Expand Down
4 changes: 2 additions & 2 deletions Patches/Map/SlowDownPartiesOnMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public static class SlowDownPartiesOnMap
[HarmonyPostfix]
public static void CalculateFinalSpeed(ref MobileParty mobileParty, ref ExplainedNumber finalSpeed, ref ExplainedNumber __result)
{
if (BannerlordCheatsSettings.TryGetModifiedValue(x => x.NpcMapSpeedPercentage, out var npcMapSpeedPercentage)
&& !mobileParty.IsPlayerParty())
if (!mobileParty.IsPlayerParty()
&& BannerlordCheatsSettings.TryGetModifiedValue(x => x.NpcMapSpeedPercentage, out var npcMapSpeedPercentage))
{
__result.AddPercentage(npcMapSpeedPercentage);
}
Expand Down
6 changes: 3 additions & 3 deletions Settings/BannerlordCheatsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public static bool TryGetModifiedValue<T>(Expression<Func<BannerlordCheatsSettin
[LocalizedSettingPropertyBool(nameof(EnableHotkeyTips), false)]
public bool EnableHotkeyTips { get; set; } = false;

[LocalizedSettingPropertyGroup(GeneralGroupName)]
[LocalizedSettingPropertyBool(nameof(OverrideCheatMode), false)]
public bool OverrideCheatMode { get; set; } = false;
// [LocalizedSettingPropertyGroup(GeneralGroupName)]
// [LocalizedSettingPropertyBool(nameof(OverrideCheatMode), false)]
// public bool OverrideCheatMode { get; set; } = false;

#endregion General

Expand Down

0 comments on commit c0e92be

Please sign in to comment.