Skip to content

Commit

Permalink
- Adding option to disable Holdback as per BTA request
Browse files Browse the repository at this point in the history
  • Loading branch information
IceRaptor committed Sep 6, 2020
1 parent b6fb2b0 commit bff6f53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion LootMagnet/LootMagnet/ModConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class RepCfg {

public class HoldbackCfg {

public bool Enabled = true;

public int[] MechParts = new int[] { 1, 6 };

public int[] ReputationRange = new int[] { 2, 6 };
Expand Down Expand Up @@ -160,7 +162,7 @@ public void LogConfig() {
Mod.Log.Info?.Write($" Reputation:{factionCfg.Reputation} ComponentRollup:{factionCfg.RollupMultiComponent} MechRollup:{factionCfg.RollupMultiMech} HoldbackTrigger:{factionCfg.HoldbackTrigger}%");
}

Mod.Log.Info?.Write($"HOLDBACK VALUES");
Mod.Log.Info?.Write($"HOLDBACK - enabled? {Holdback.Enabled}");
Mod.Log.Info?.Write($" Holdback Picks: {Holdback.MechParts[0]} to {Holdback.MechParts[1]}");
Mod.Log.Info?.Write($" Rep Range: {Holdback.ReputationRange[0]} to {Holdback.ReputationRange[1]}");
Mod.Log.Info?.Write($" Dispute Picks: {Holdback.DisputePicks[0]} to {Holdback.DisputePicks[1]}");
Expand Down
2 changes: 1 addition & 1 deletion LootMagnet/LootMagnet/Patches/Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static bool Prefix(AAR_SalvageScreen __instance, Contract ___contract, re

// Check for holdback
bool hasMechParts = ModState.PotentialSalvage.FirstOrDefault(sd => sd.Type != SalvageDef.SalvageType.COMPONENT) != null;
bool canHoldback = ModState.Employer.DoesGainReputation;
bool canHoldback = Mod.Config.Holdback.Enabled && ModState.Employer.DoesGainReputation;
float triggerChance = Helper.GetHoldbackTriggerChance();
float holdbackRoll = Mod.Random.Next(101);
Mod.Log.Info?.Write($"Holdback roll:{holdbackRoll}% triggerChance:{triggerChance}% hasMechParts:{hasMechParts} canHoldback:{canHoldback}");
Expand Down
4 changes: 2 additions & 2 deletions LootMagnet/LootMagnet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.0.0.0")]
[assembly: AssemblyVersion("6.1.0.0")]
[assembly: AssemblyFileVersion("6.1.0.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down

0 comments on commit bff6f53

Please sign in to comment.