Skip to content

Commit

Permalink
SolidFuel will no longer fail
Browse files Browse the repository at this point in the history
  • Loading branch information
severedsolo committed May 21, 2017
1 parent c3bc151 commit d4fe3db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions UPFM/Untitled Part Failure Mod/BaseFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ bool FailCheck(bool recalcChance)
{
chanceOfFailure = chanceOfFailure / generation;
if (SYP.TimesRecovered > 0) chanceOfFailure = chanceOfFailure * ((SYP.TimesRecovered / expectedLifetime));

}
Debug.Log("[UPFM]: Chances of "+part.name+" failing calculated to be " + chanceOfFailure * 100 + "%");
if (UnityEngine.Random.value < chanceOfFailure) return true;
Expand Down
5 changes: 5 additions & 0 deletions UPFM/Untitled Part Failure Mod/EngineFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ protected override bool FailureAllowed()

protected override void FailPart()
{
if (part.Resources.Contains("SolidFuel")) return;
engine = part.FindModuleImplementing<ModuleEngines>();
if (engine.currentThrottle == 0) return;
SetFailedHighlight();
Expand Down Expand Up @@ -93,6 +94,10 @@ protected override void RepairPart()
engine.thrustPercentage = 100;
Debug.Log("[UPFM]: Reset Thrust on " + part.name);
break;
case "Gimbal Failure":
gimbal.gimbalLock = false;
break;

default:
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ BLACKLISTED
BLACKLISTED
{
name = IntakeAir
}

BLACKLISTED
{
name = SolidFuel
}

0 comments on commit d4fe3db

Please sign in to comment.