-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
224 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Make sure you have read and understood the contributing guidelines! | ||
------------------------------------------------------------------- | ||
|
||
Pull Requests that don't follow the guidelines will be rejected. If you need help or are confused just ask, and we will be glad to help. | ||
|
||
-[ ] PR being applied to the correct **Feature Branch** or **dev** | ||
-[ ] PR is **not** being sent to **master** |
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 @@ | ||
Contributing Information | ||
======================== | ||
|
||
To better coordinate multiple developers as well as community additions, the TestFlight project now uses the [Gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) style workflow. You can read more nerdy details about this [here](http://nvie.com/posts/a-successful-git-branching-model/). | ||
|
||
The short of it is that we use multiple branches to better manage the code coming in. All contributions to TestFlight, including those by core team members, need to follow these rules, the most important of which is... | ||
|
||
Don't ever commit anything to Master | ||
------------------------------------ | ||
No code change or pull request should ever be directly to master. Any PR opened against master will be rejected. Full stop. Any code directly commited to master outside of the normal process of merging changes in for release will be froned upon and most likely reverted. | ||
|
||
At any given moment in time the master branch is expected to be ready for release opn a moment's notice. | ||
|
||
Pull Requests and normal development commits either go to the dev branch or to a feature branch | ||
----------------------------------------------------------------------------------------------- | ||
In general you shoud have a branch specifically for any feature you are adding. This branch should be branched off of **dev** and will be merged back into dev once complete. If you are making a small quick fix, then it is ok to commit to, or make a PR against, the dev branch directly. | ||
|
||
When in doubt, ASK | ||
------------------- | ||
Seriously I understand this can be confusing, especially if you don't know Git very well. Don't be afraid to ask if you are unsure. PReferabbly before you start your work as it is easier to start on the right foot than it is to try and change after the fact. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
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
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,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using UnityEngine; | ||
using KSPPluginFramework; | ||
using TestFlightAPI; | ||
|
||
namespace TestFlight | ||
{ | ||
public class TestFlightFailure_EnginePerformanceLoss : TestFlightFailure_Engine | ||
{ | ||
[KSPField] | ||
public float ispMultiplier = 0.7f; | ||
[KSPField] | ||
public float ispMultiplierJitter = 0.1f; | ||
|
||
public override void OnStart(StartState state) | ||
{ | ||
base.OnStart(state); | ||
base.Startup(); | ||
} | ||
/// <summary> | ||
/// Triggers the failure controlled by the failure module | ||
/// </summary> | ||
public override void DoFailure() | ||
{ | ||
base.DoFailure(); | ||
// for each engine change its fuelFlow which will affect thrust | ||
foreach (EngineHandler engine in engines) | ||
{ | ||
float jitter = ispMultiplierJitter - ((float)TestFlightUtil.GetCore(this.part).RandomGenerator.NextDouble() * (ispMultiplierJitter * 2)); | ||
float actualMultiplier = ispMultiplier + jitter; | ||
engine.engine.SetFuelIspMult(actualMultiplier); | ||
} | ||
} | ||
|
||
public override float DoRepair() | ||
{ | ||
base.DoRepair(); | ||
// for each engine restore its fuell flow back to 1.0 | ||
foreach (EngineHandler engine in engines) | ||
{ | ||
engine.engine.SetFuelFlowMult(1.0f); | ||
} | ||
return 0; | ||
} | ||
} | ||
} | ||
|
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