Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
474 lines (455 sloc) 9.01 KB
//Cryo patch for switching existing tank fuel types, adapted and attributed from/to Nertea's CryoTanks
// Lifting tanks
@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch],!MODULE[WBIConvertibleStorage],!MODULE[WBIResourceSwitcher]]:NEEDS[B9PartSwitch&!modularFuelTanks&!RealFuels]:BEFORE[zzz_CryoTanks]
{
%LF = #$RESOURCE[LiquidFuel]/maxAmount$
%OX = #$RESOURCE[Oxidizer]/maxAmount$
%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$
%massOffset = #$totalCap$
@massOffset *= 0.000625 // standard dry mass per units of LF/OX
@massOffset *= -1
@LF *= #$@RESOURCE_DEFINITION[LiquidFuel]/unitCost$
@OX *= #$@RESOURCE_DEFINITION[Oxidizer]/unitCost$
%costOffset = #$LF$
@costOffset += #$OX$
@costOffset *= -1
!RESOURCE[LiquidFuel] {}
!RESOURCE[Oxidizer] {}
!MODULE[ModuleB9PartSwitch]:HAS[#moduleID[fuelSwitch]] {}
MODULE
{
name = ModuleB9PartSwitch
moduleID = KSPIE
switcherDescription = #LOC_CryoTanks_switcher_fuel_title
baseVolume = #$../totalCap$
SUBTYPE
{
name = LF/O
title = #LOC_CryoTanks_switcher_fuel_lfox
tankType = LFOX
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LH2/O
title = #LOC_CryoTanks_switcher_fuel_lh2ox
tankType = LH2O
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LH2
title = #LOC_CryoTanks_switcher_fuel_lh2
tankType = LH2
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = Oxidizer
title = #LOC_CryoTanks_switcher_fuel_ox
tankType = OX
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LiquidFuel
title = #LOC_CryoTanks_switcher_fuel_lf
tankType = LF
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = Hydrolox
title = Hydrolox
tankType = Hydrolox
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdAmmonia
title = Ammonia
tankType = LqdAmmonia
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = HTP
title = #LOC_CRP_HTP_DisplayName
tankType = HTP
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = Hydrazine
title = #LOC_CRP_Hydrazine_DisplayName
tankType = Hydrazine
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdMethane
title = Methane
tankType = LqdMethane
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
}
MODULE
{
name = ModuleCryoTank
CoolingCost = 0.09
CoolingEnabled = False
BOILOFFCONFIG
{
FuelName = LqdHydrogen
// in % per hr
BoiloffRate = 0.05
}
}
MODULE
{
name = ModuleCryoTank
CoolingCost = 0.002
CoolingEnabled = False
BOILOFFCONFIG
{
FuelName = LqdMethane
// in % per hr
BoiloffRate = 0.01
}
}
MODULE
{
name = ModuleCryoTank
CoolingCost = 0.001
CoolingEnabled = False
BOILOFFCONFIG
{
FuelName = LqdAmmonia
// in % per hr
BoiloffRate = 0.005
}
}
MODULE
{
name = ModuleCryoTank
CoolingCost = 0.001
CoolingEnabled = False
BOILOFFCONFIG
{
FuelName = HTP
// in % per hr
BoiloffRate = 0.005
}
}
}
// ZBO tanks
@PART[*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch],!MODULE[WBIConvertibleStorage],!MODULE[WBIResourceSwitcher]]:NEEDS[B9PartSwitch&!modularFuelTanks&!RealFuels]:BEFORE[zzz_CryoTanks]
{
%LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
%massOffset = #$LH2$
@massOffset *= 0.00001417 // <- EDIT HERE (dry mass per unit LH2 capacity)
@massOffset *= -1
%costOffset = #$LH2$
@costOffset *= #$@RESOURCE_DEFINITION[LqdHydrogen]/unitCost$
@costOffset *= -1
!RESOURCE[LqdHydrogen] {}
MODULE
{
name = ModuleB9PartSwitch
moduleID = fuelSwitch
switcherDescription = #LOC_CryoTanks_switcher_fuel_title
baseVolume = #$../LH2$
@baseVolume /= 7.5
SUBTYPE
{
name = LH2
title = #LOC_CryoTanks_switcher_fuel_lh2
tankType = LH2Cryo
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdArgon
title = Argon
tankType = LqdArgon
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdCO
title = CO
tankType = LqdCO
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdCO2
title = CO2
tankType = LqdCO2
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdDeuterium
title = Deuterium
tankType = LqdDeuterium
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdHelium
title = Helium
tankType = LqdHelium
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdHe3
title = Helium-3
tankType = LqdHe3
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdKrypton
title = Krypton
tankType = LqdKrypton
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdNeon
title = Neon
tankType = LqdNeon
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdNitrogen
title = Nitrogen
tankType = LqdNitrogen
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = Oxidizer
title = #LOC_CryoTanks_switcher_fuel_ox
tankType = OX
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdOxygen
title = Oxygen
tankType = LqdOxygen
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdTritium
title = Tritium
tankType = LqdTritium
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
SUBTYPE
{
name = LqdXenon
title = Xenon
tankType = LqdXenon
addedMass = #$../../massOffset$
addedCost = #$../../costOffset$
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.05
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdHydrogen
// in % per hr
BoiloffRate = 0.05
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.16
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdHelium
// in % per hr
BoiloffRate = 0.15
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.2
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdHe3
// in % per hr
BoiloffRate = 0.2
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.05
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdDeuterium
// in % per hr
BoiloffRate = 0.05
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.05
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdTritium
// in % per hr
BoiloffRate = 0.05
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.02
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdNitrogen
// in % per hr
BoiloffRate = 0.02
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.02
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdCO
// in % per hr
BoiloffRate = 0.02
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.02
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdArgon
// in % per hr
BoiloffRate = 0.02
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.02
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdNeon
// in % per hr
BoiloffRate = 0.02
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.02
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdKrypton
// in % per hr
BoiloffRate = 0.02
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.015
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdOxygen
// in % per hr
BoiloffRate = 0.02
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.015
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = Methane
// in % per hr
BoiloffRate = 0.15
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.01
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdXenon
// in % per hr
BoiloffRate = 0.1
}
}
MODULE
{
name = ModuleCryoTank // in Ec per 1000 units per second
CoolingCost = 0.01
CoolingEnabled = True
BOILOFFCONFIG
{
FuelName = LqdCO2
// in % per hr
BoiloffRate = 0.1
}
}
}
You can’t perform that action at this time.