//SSI-Mining - SSI Aerospace: Mining Operations

CONTRACT_TYPE
{


//REQUIREMENTS FOR CONTRACT TO APPEAR

	REQUIREMENT
	{
		name = PartModuleUnlocked
		type = PartModuleUnlocked
		
		partModule = ModuleResourceHarvester
	}


//DATA NODES TO PROCESS FOR CONTRACT USE

//Contract Specific VesselParameterGroup Definition Key (to prevent conflict with other active contracts)
	DATA
	{
		type = string
		
		craft = GAPcraftSSIMining
		
	}
	

//CONTRACT DESCRIPTION

//Contract Descriptions
	name = SSI-Mining
	title = Mining Operations
	group = SSI Aerospace
	agent = SSI Aerospace
	
	description = Go mine some ore at the waypoint and return to the KSC Spaceplane Hangar.
	
	synopsis = Mining for profit.
	
	notes = This is a test mining contract.
	
	completedMessage = You returned some good quality ore. Here's payment for it.

//Contract Limits
  	maxCompletions = 0
   	maxSimultaneous = 1
	weight = 10.0

	autoAccept = false
	declinable = true
	cancellable = true
	
	minExpiry = 7.0
	maxExpiry = 7.0
	deadline = 0
 
//Contract Reward Modifiers
	prestige = Trivial
   	targetBody = Kerbin

//Contract Rewards
  	advanceFunds = 0.0
  	rewardFunds = 150000
  	rewardReputation = 0.0
 	rewardScience = 0.0

//Contract Penalties
  	failureFunds = 0.0
 	failureReputation = 0.0


//BEHAVIOURS TO DO WHEN CREATING CONTRACT

	BEHAVIOUR
	{
		name = WaypointGenerator
		type = WaypointGenerator

		PQS_CITY
		{
			name = Ore Deposit 
			icon = marker
			
			targetBody = Kerbin
			pqsCity = KSC
			pqsOffset = -845.191269829532, 31.9081307051865, 22.6626316594375
		
		}
		
	}
	
	
//PARAMETERS FOR CONTRACT COMPLETION

//Craft definition
	PARAMETER
	{
		name = VesselParameterGroup
		type = VesselParameterGroup
		title = Your mining rig must
		
		define = @/craft
		dissassociateVesselsOnContractCompletion = true

		PARAMETER
		{
			name = HasCrew
			type = HasCrew
			title = have a driver
			
			minCrew = 1
		
			disableOnStateChange = false
			hideChildren = true

		}

		PARAMETER
		{
			name = HasResourceCapacity
			type = HasResourceCapacity
			
			resource = Ore
			minQuantity = 75.0
			
			disableOnStateChange = false

		}
		
		disableOnStateChange = false

	}

//Contract Goals
	PARAMETER
	{
		name = All
		type = All
		
		PARAMETER
		{
			name = VesselParameterGroup
			type = VesselParameterGroup
			title = navigate to ore deposit
			
			vessel = @/craft
			
			PARAMETER
			{
				name = VisitWaypoint
				type = VisitWaypoint
				
				index = 0
				distance = 3000
	//			hideOnCompletion = true
				
				disableOnStateChange = false
				hideChildren = true
				
			}
		
			completeInSequence = true
			disableOnStateChange = false
			hideChildren = true
			
		}
		
		PARAMETER
		{
			name = VesselParameterGroup
			type = VesselParameterGroup
			title = load your ore
			
			vessel = @/craft
			
			PARAMETER
			{
				name = HasResource
				type = HasResource
				
				resource = Ore
				minQuantity = 75
				
				disableOnStateChange = false
				hideChildren = true
				
			}
		
			completeInSequence = true
			disableOnStateChange = false
			hideChildren = true
			
		}
		
		disableOnStateChange = true
		
	}

//Recovery Parameter - Landing
	PARAMETER
	{
		name = Any
		type = Any
		title = and then return your ore
		
		PARAMETER
		{
			name = Any
			type = Any
			title = at one of the following recovery areas

			PARAMETER
			{
				name = VesselParameterGroup
				type = VesselParameterGroup
				title = the KSC Runway
				
				vessel = @/craft

			PARAMETER
				{
					name = ReachState
					type = ReachState
					
					targetBody = Kerbin
					biome = Runway
					situation = LANDED
					maxSpeed = 0.0

					disableOnStateChange = false
					hideChildren = true

				}

				disableOnStateChange = false
				hideChildren = true		

			}
			
			PARAMETER
			{
				name = VesselParameterGroup
				type = VesselParameterGroup
				title = or the Spaceplane Hangar Air Terminal
				
				vessel = @/craft

			PARAMETER
				{
					name = ReachState
					type = ReachState
					
					targetBody = Kerbin
					biome = SPH
					situation = LANDED
					maxSpeed = 0.0

					disableOnStateChange = false
					hideChildren = true

				}
				
				disableOnStateChange = false
				hideChildren = true		

			}
		
			disableOnStateChange = false
		
		}
		
		completeInSequence = true
		disableOnStateChange = false

	}

//Recovery Parameter - Craft & Kerbal Safety Check
	PARAMETER
	{
		name = All
		type = All
		title = safely
		
		PARAMETER
		{
			name = VesselNotDestroyed
			type = VesselNotDestroyed
			title = without destroying your aircraft
			
			vessel = @/craft

		}
		
		PARAMETER
		{
			name = KerbalDeaths
			type = KerbalDeaths
			title = or killing anyone
			
			vessel = @/craft

		}

		completeInSequence = true
		disableOnStateChange = true

	}	
	
}