-
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.
Add Parachutes; Import ModuleManager definitions
- Loading branch information
Showing
9 changed files
with
300 additions
and
0 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,69 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using ippo; | ||
using UnityEngine; | ||
using KSP; | ||
|
||
namespace coffeeman | ||
{ | ||
public class ModuleParachuteReliability : ippo.FailureModule | ||
{ | ||
ModuleParachute chute; | ||
bool canFail; | ||
|
||
public override string DebugName { get { return "Canopy_stock_chutes"; } } | ||
public override string ScreenName { get { return "Canopy"; } } | ||
public override string FailureMessage { get { return "The Canopy of a Parachute has degraded"; } } | ||
public override string RepairMessage { get { return "You have repaired Canopy"; } } | ||
public override string FailGuiName { get { return "Fail Canopy"; } } | ||
public override string EvaRepairGuiName { get { return "Patch hole"; } } | ||
public override string MaintenanceString { get { return "Patch Canopy"; } } | ||
|
||
public override bool PartIsActive() | ||
{ | ||
// A chute is active if its not stowed | ||
return chute.deploymentState != ModuleParachute.deploymentStates.STOWED; | ||
} | ||
|
||
protected override void DI_Start(StartState state) | ||
{ | ||
chute = this.part.Modules.OfType<ModuleParachute>().Single(); | ||
|
||
foreach ( Part part_each in this.part.vessel.Parts){ //Make sure that there is at least one other chute on the craft! | ||
if (part_each != this.part) { | ||
foreach (PartModule module_each in part_each.Modules) { | ||
if (module_each is ModuleParachute) { | ||
this.canFail = true; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
protected override bool DI_FailBegin() | ||
{ | ||
return canFail; | ||
} | ||
|
||
protected override void DI_Disable() | ||
{ | ||
; | ||
} | ||
|
||
|
||
protected override void DI_EvaRepair() | ||
{ | ||
; | ||
} | ||
|
||
protected override void DI_Update(){ | ||
if (this.HasFailed) { | ||
chute.deploymentState = ModuleParachute.deploymentStates.SEMIDEPLOYED; | ||
chute.Deploy (); | ||
} | ||
} | ||
} | ||
} | ||
|
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,36 @@ | ||
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[SolidFuel],!PROPELLANT[XenonGas]]]:FOR[Entropy] | ||
{ | ||
MODULE | ||
{ | ||
name = ModuleCoolantReliability | ||
|
||
// Annual Failure Rate: 100% | ||
MTBF = 8760 | ||
|
||
// Engines must decay *VERY* quickly compared to other parts | ||
LifeTime = 1 | ||
|
||
// Amount of spare parts needed to repair the part | ||
RepairCost = 10 | ||
// Fraction of the age that is discounted when repairing (from 0 to 1) | ||
RepairBonus = 0.1 | ||
|
||
// Amount of spare parts needed for preemptive maintenance | ||
MaintenanceCost = 2 | ||
|
||
// Fraction of the age that is discounted when doing maintenance (from 0 to 1) | ||
MaintenanceBonus = 0.3 | ||
|
||
// Duration of the inspection bonus, in seconds | ||
InspectionBonus = 120 | ||
|
||
// Set to true to suppress all notifications about this module | ||
Silent = false | ||
|
||
DANGIT_PERKS | ||
{ | ||
perk = Mechanic:Skilled | ||
perk = Electrician:Normal | ||
} | ||
} | ||
} |
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,36 @@ | ||
@PART[*]:HAS[@MODULE[ModuleResourceIntake]]:FOR[Entropy]:NEEDS[DangIt] | ||
{ | ||
MODULE | ||
{ | ||
name = ModuleIntakeReliability | ||
|
||
// Annual Failure Rate: 100% | ||
MTBF = 1 | ||
|
||
// Engines must decay *VERY* quickly compared to other parts | ||
LifeTime = 1 | ||
|
||
// Amount of spare parts needed to repair the part | ||
RepairCost = 1 | ||
// Fraction of the age that is discounted when repairing (from 0 to 1) | ||
RepairBonus = 1 | ||
|
||
// Amount of spare parts needed for preemptive maintenance | ||
MaintenanceCost = 1 | ||
|
||
// Fraction of the age that is discounted when doing maintenance (from 0 to 1) | ||
MaintenanceBonus = 0.3 | ||
|
||
// Duration of the inspection bonus, in seconds | ||
InspectionBonus = 120 | ||
|
||
// Set to true to suppress all notifications about this module | ||
Silent = false | ||
|
||
DANGIT_PERKS | ||
{ | ||
perk = Mechanic:Unskilled | ||
perk = Electrician:Unskilled | ||
} | ||
} | ||
} |
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,36 @@ | ||
@PART[*]:HAS[@MODULE[ModuleParachute]]:FOR[Entropy]:NEEDS[DangIt&!RealChute] | ||
{ | ||
MODULE | ||
{ | ||
name = ModuleParachuteReliability | ||
|
||
// Two years | ||
MTBF = 17520 | ||
|
||
// Engines must decay *VERY* quickly compared to other parts | ||
LifeTime = 20 | ||
|
||
// Amount of spare parts needed to repair the part | ||
RepairCost = 1 | ||
// Fraction of the age that is discounted when repairing (from 0 to 1) | ||
RepairBonus = 1 | ||
|
||
// Amount of spare parts needed for preemptive maintenance | ||
MaintenanceCost = 1 | ||
|
||
// Fraction of the age that is discounted when doing maintenance (from 0 to 1) | ||
MaintenanceBonus = 0.3 | ||
|
||
// Duration of the inspection bonus, in seconds | ||
InspectionBonus = 3600 | ||
|
||
// Set to true to suppress all notifications about this module | ||
Silent = false | ||
|
||
DANGIT_PERKS | ||
{ | ||
perk = Mechanic:Unskilled | ||
perk = Electrician:Unskilled | ||
} | ||
} | ||
} |
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,36 @@ | ||
@PART[*]:HAS[@MODULE[ModuleEngines]:HAS[@PROPELLANT[SolidFuel]],!MODULE[NoSRBFailures],]:NEEDS[DangIt]:FOR[Entropy] | ||
{ | ||
MODULE | ||
{ | ||
name = ModuleSRBReliability | ||
|
||
// Annual Failure Rate: 100% | ||
MTBF = 8000; | ||
|
||
// Engines must decay *VERY* quickly compared to other parts | ||
LifeTime = 1 | ||
|
||
// Amount of spare parts needed to repair the part | ||
RepairCost = 10 | ||
// Fraction of the age that is discounted when repairing (from 0 to 1) | ||
RepairBonus = 1 | ||
|
||
// Amount of spare parts needed for preemptive maintenance | ||
MaintenanceCost = 5 | ||
|
||
// Fraction of the age that is discounted when doing maintenance (from 0 to 1) | ||
MaintenanceBonus = 0.3 | ||
|
||
// Duration of the inspection bonus, in seconds | ||
InspectionBonus = 600 | ||
|
||
// Set to true to suppress all notifications about this module | ||
Silent = false | ||
|
||
DANGIT_PERKS | ||
{ | ||
perk = Mechanic:Skilled | ||
perk = Electrician:Normal | ||
} | ||
} | ||
} |
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,36 @@ | ||
@PART[*]:HAS[@RESOURCE[MonoPropellant]]:NEEDS[DangIt]:FOR[Entropy] | ||
{ | ||
MODULE | ||
{ | ||
name = ModuleSmallTankExploder | ||
|
||
// Annual Failure Rate: 100% | ||
MTBF = 32000; | ||
|
||
// Engines must decay *VERY* quickly compared to other parts | ||
LifeTime = 320 | ||
|
||
// Amount of spare parts needed to repair the part | ||
RepairCost = 10 | ||
// Fraction of the age that is discounted when repairing (from 0 to 1) | ||
RepairBonus = 1 | ||
|
||
// Amount of spare parts needed for preemptive maintenance | ||
MaintenanceCost = 2 | ||
|
||
// Fraction of the age that is discounted when doing maintenance (from 0 to 1) | ||
MaintenanceBonus = 0.3 | ||
|
||
// Duration of the inspection bonus, in seconds | ||
InspectionBonus = 600 | ||
|
||
// Set to true to suppress all notifications about this module | ||
Silent = false | ||
|
||
DANGIT_PERKS | ||
{ | ||
perk = Mechanic:Skilled | ||
perk = Electrician:Normal | ||
} | ||
} | ||
} |
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,36 @@ | ||
@PART[*]:HAS[@MODULE[ModuleDeployableSolarPanel]]:FOR[Entropy] | ||
{ | ||
MODULE | ||
{ | ||
name = ModuleSolarReliability | ||
|
||
// Two years | ||
MTBF = 17520 | ||
|
||
// Engines must decay *VERY* quickly compared to other parts | ||
LifeTime = 17520 | ||
|
||
// Amount of spare parts needed to repair the part | ||
RepairCost = 2 | ||
// Fraction of the age that is discounted when repairing (from 0 to 1) | ||
RepairBonus = 0.8 | ||
|
||
// Amount of spare parts needed for preemptive maintenance | ||
MaintenanceCost = 1 | ||
|
||
// Fraction of the age that is discounted when doing maintenance (from 0 to 1) | ||
MaintenanceBonus = 0.3 | ||
|
||
// Duration of the inspection bonus, in seconds | ||
InspectionBonus = 86400 | ||
|
||
// Set to true to suppress all notifications about this module | ||
Silent = false | ||
|
||
DANGIT_PERKS | ||
{ | ||
perk = Mechanic:Normal | ||
perk = Electrician:Skilled | ||
} | ||
} | ||
} |
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,14 @@ | ||
@PART[sepMotor1]:BEFORE[Entropy] | ||
{ | ||
MODULE | ||
{ | ||
name = NoSRBFailures | ||
} | ||
} | ||
@PART[LaunchEscapeSystem]:BEFORE[Entropy] | ||
{ | ||
MODULE | ||
{ | ||
name = NoSRBFailures | ||
} | ||
} |