Skip to content

Commit

Permalink
fixed more than annoying release problem
Browse files Browse the repository at this point in the history
  • Loading branch information
rheirman committed Jan 27, 2019
1 parent cc9b60f commit a60de23
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Binary file modified Assemblies/WhatTheHack.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions Source/WhatTheHack/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ where isHackingFaction(td)
powerChargeModifier.CustomDrawer = rect => GUIDrawUtility.CustomDrawer_Filter(rect, powerChargeModifier, false, 0.05f, 5f, highlight1);
powerChargeModifier.VisibilityPredicate = delegate { return settingsGroup_Balance; };

deathOnDownedChance = Settings.GetHandle<float>("deathOnDownedChance", "WTH_DeathOnDownedChance_Title".Translate(), "WTH_DeathOnDownedChance_Description".Translate(), 50f, Validators.FloatRangeValidator(0f, 100f));
deathOnDownedChance.CustomDrawer = rect => GUIDrawUtility.CustomDrawer_Filter(rect, deathOnDownedChance, false, 0f, 100f, highlight1);
deathOnDownedChance.VisibilityPredicate = delegate { return settingsGroup_Balance; };
//deathOnDownedChance = Settings.GetHandle<float>("deathOnDownedChance", "WTH_DeathOnDownedChance_Title".Translate(), "WTH_DeathOnDownedChance_Description".Translate(), 50f, Validators.FloatRangeValidator(0f, 100f));
//deathOnDownedChance.CustomDrawer = rect => GUIDrawUtility.CustomDrawer_Filter(rect, deathOnDownedChance, false, 0f, 100f, highlight1);
//deathOnDownedChance.VisibilityPredicate = delegate { return settingsGroup_Balance; };

downedOnDeathThresholdChance = Settings.GetHandle<float>("downedOnDeathThresholdChance", "WTH_DownedOnDeathThresholdChance_Title".Translate(), "WTH_DownedOnDeathThresholdChance_Description".Translate(), 25f, Validators.FloatRangeValidator(0f, 100f));
downedOnDeathThresholdChance.CustomDrawer = rect => GUIDrawUtility.CustomDrawer_Filter(rect, downedOnDeathThresholdChance, false, 0f, 100f, highlight1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
namespace WhatTheHack.Harmony
{
[HarmonyPatch]
class CE_JobGiver_TakeAndEquip_TryGiveJob
public class CE_JobGiver_TakeAndEquip_TryGiveJob
{
static MethodBase TargetMethod()
public static MethodBase TargetMethod()
{
Assembly assemblyCE = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly assembly) => assembly.FullName.StartsWith("CombatExtended"));
MethodInfo stub = typeof(CE_JobGiver_TakeAndEquip_TryGiveJob).GetMethod("Stub");
Expand Down
4 changes: 2 additions & 2 deletions Source/WhatTheHack/Harmony/Pawn_HealthTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
if(flag && instruction.opcode == OpCodes.Ldc_R4)
{
//yield return new CodeInstruction(OpCodes.Call, typeof(Pawn_HealthTracker_CheckForStateChange).GetMethod(""))
yield return new CodeInstruction(OpCodes.Ldc_R4,Base.deathOnDownedChance);//TODO: no magic number?
yield return new CodeInstruction(OpCodes.Ldc_R4, 0.5f);//TODO: no magic number?
flag = false;
}
else
Expand Down Expand Up @@ -77,7 +77,7 @@ static void Postfix(Pawn_HealthTracker __instance, ref bool __result)
__result = false;
return;
}
if (Rand.Chance(Base.downedOnDeathThresholdChance))//Chance mech goes down instead of dying when lethal threshold is achieved.
if (Rand.Chance(Base.downedOnDeathThresholdChance.Value/100f))//Chance mech goes down instead of dying when lethal threshold is achieved.
{
__instance.AddHediff(WTH_DefOf.WTH_HeavilyDamaged);
if (pawn.mindState == null)
Expand Down

0 comments on commit a60de23

Please sign in to comment.