-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow SRB failures on EnginesFX modules
- Loading branch information
Showing
15 changed files
with
108 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entropy", "Entropy.csproj", "{7EFBE627-9945-4E79-8976-CC0C67FA6C18}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7EFBE627-9945-4E79-8976-CC0C67FA6C18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7EFBE627-9945-4E79-8976-CC0C67FA6C18}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7EFBE627-9945-4E79-8976-CC0C67FA6C18}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7EFBE627-9945-4E79-8976-CC0C67FA6C18}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(MonoDevelopProperties) = preSolution | ||
StartupItem = Entropy.csproj | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Linq; | ||
using System.Text; | ||
using ippo; | ||
using UnityEngine; | ||
using KSP; | ||
|
||
namespace coffeeman | ||
{ | ||
public class ModuleSRBFXReliability : ippo.FailureModule | ||
{ | ||
ModuleEnginesFX srb; | ||
|
||
public override string DebugName { get { return "O-Ring"; } } | ||
public override string ScreenName { get { return "O-Ring"; } } | ||
public override string FailureMessage { get { return "An O-Ring has cracked, Abort!"; } } | ||
public override string RepairMessage { get { return ""; } } | ||
public override string FailGuiName { get { return "Fail O-Ring"; } } | ||
public override string EvaRepairGuiName { get { return ""; } } | ||
public override string MaintenanceString { get { return "Replace O-Ring"; } } | ||
|
||
public bool overloading = false; | ||
public float overloadbonus = 0F; | ||
|
||
public override bool PartIsActive() | ||
{ | ||
// A SRB is active if it is running | ||
return srb.EngineIgnited & srb.CalculateThrust()>0; | ||
} | ||
|
||
protected override void DI_Start(StartState state) | ||
{ | ||
srb = this.part.Modules.OfType<ModuleEnginesFX>().Single(); | ||
} | ||
|
||
protected override bool DI_FailBegin() | ||
{ | ||
return true; | ||
} | ||
|
||
protected override void DI_Disable() | ||
{ | ||
srb.heatProduction += srb.part.maxTemp/4F; //Increase the heat so it explodes | ||
overloading = true; | ||
} | ||
|
||
protected override void DI_EvaRepair(){} | ||
|
||
protected override void DI_Update(){ | ||
if (overloading){ | ||
srb.rigidbody.AddRelativeForce(Vector3.forward * overloadbonus); //Increase thrust thru hack | ||
overloadbonus += srb.maxThrust / 60; //This is a considerable amount | ||
if (!PartIsActive ()) { | ||
overloading = false; //Stop if the part is disabled | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
4 changes: 2 additions & 2 deletions
4
...t/GameData/Entropy/ModuleManager/SRBs.cfg → .../Entropy/ModuleManager/SRBs_enginesFX.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.