//
//
//  Near Future Propulsion Tweak Patch, by Streetwind
//
//
//
//
//  This file is meant to provide a simple means of changing engine performance without having to write your own patch.
//
//  The only things you need to touch are the following three multipliers.
//  Please refer to the guide below for details on what exactly happens if you increase or decrease each multiplier.
//
//


NearFutureCustomSettings {
	nearFuturePowerMultiplier = 1.0
	nearFutureThrustMultiplier = 1.0
	nearFutureIspMultiplier = 1.0
}


//
//
//  Chapter 1 - "nearFuturePowerMultiplier"
//
//  A number larger than 1.0 will increase power consumption. A number smaller than 1.0 will decrease it.
//  If you pick 0.8, the engines will consume 20% less power. if you pick 0.5, the engines will consume only half as much power.
//  Similarly, if you choose 1.5, the engines will consume 50% more power.
//
//
//
//
//  Chapter 2 - "nearFutureThrustMultiplier"
//
//  A number larger than 1.0 will increase thrust output. A number smaller than 1.0 will decrease it.
//  If you pick 1.2, the engines will produce 20% more thrust. if you pick 2.0, the engines will produce twice as much thrust.
//  Similarly, if you choose 0.5, the engines will produce only half as much thrust.
//
//
//
//
//  Chapter 3 - "nearFutureIspMultiplier"
//
//  A number larger than 1.0 will increase specific impulse. A number smaller than 1.0 will decrease it.
//  If you pick 1.2, the engines will have 20% more Isp. if you pick 2.0, the engines will have twice as much.
//  Similarly, if you choose 0.5, the engines will have only half as much Isp.
//
//
//
//
//  Chapter 4 - "What if I want to change ALL THE THINGS?"
//
//  Then go ahead and change them! :) In KSP, the values for power, thrust, and Isp interact in complex ways. But this patch
//  is specifically set up in such a way that you get the correct result even if all three multipliers are given custom values.
//  It does all the required maths for you.
//
//
//
//
//  Chapter 5 - "I want to change individual engines in different ways!"
//
//  This file maintains the pre-set balance between all the different engines in the pack.
//  It changes the performance of all its electric engines, as well as the stock Dawn engine, in the same proportional ways.
//  If you want to break up this balance, this file will not be of much help. You will have to write your own patches.
//
//
//
//
//  Chapter 6 - "How can I change other engine parameters, like heat, cost, mass, and so on?"
//
//  That is out of scope for this simple tweak file. You will have to write your own patches.
//
//


@PART[ionEngine,ionArgon-*,ionXenon-*,mpdt-*,pit-*,vasimr-*]:AFTER[NearFuturePropulsion]
{
	@MODULE[ModuleEnginesFX],*
	{
		@maxThrust *= #$@NearFutureCustomSettings/nearFutureThrustMultiplier$
		@PROPELLANT[ElectricCharge]
		{
			@ratio *= #$@NearFutureCustomSettings/nearFuturePowerMultiplier$
			@ratio /= #$@NearFutureCustomSettings/nearFutureThrustMultiplier$
			@ratio *= #$@NearFutureCustomSettings/nearFutureIspMultiplier$
		}
		@atmosphereCurve
		{
			@key,*[1, ] *= #$@NearFutureCustomSettings/nearFutureIspMultiplier$
		}
	}
}

@PART[pit-*]:AFTER[NearFuturePropulsion]
{
	@MODULE[VariablePowerEngine]
	{
		@ConstantThrust *= #$@NearFutureCustomSettings/nearFutureThrustMultiplier$
		@PowerCurve
		{
			@key,*[1, ] *= #$@NearFutureCustomSettings/nearFuturePowerMultiplier$
		}
		@IspCurve
		{
			@key,*[1, ] *= #$@NearFutureCustomSettings/nearFutureIspMultiplier$
		}
	}
}

@PART[vasimr-*]:AFTER[NearFuturePropulsion]
{
	@MODULE[VariableISPEngine]
	{
		@EnergyUsage *= #$@NearFutureCustomSettings/nearFuturePowerMultiplier$
		@VARIABLEISPMODE[*],*
		{
			@IspThrustCurve
			{
				@key,*[0, ] *= #$@NearFutureCustomSettings/nearFutureIspMultiplier$
				@key,*[1, ] *= #$@NearFutureCustomSettings/nearFutureThrustMultiplier$
			}
		}
	}
}

@PART[rcsblock-*]:AFTER[NearFuturePropulsion]
{
	@MODULE[ModuleRCSFX],*
	{
		@thrusterPower *= #$@NearFutureCustomSettings/nearFutureThrustMultiplier$
		@PROPELLANT[ElectricCharge]
		{
			@ratio *= #$@NearFutureCustomSettings/nearFuturePowerMultiplier$
			@ratio /= #$@NearFutureCustomSettings/nearFutureThrustMultiplier$
			@ratio *= #$@NearFutureCustomSettings/nearFutureIspMultiplier$
		}
		@atmosphereCurve
		{
			@key,*[1, ] *= #$@NearFutureCustomSettings/nearFutureIspMultiplier$
		}
	}
}
