module Base
{
	model 84gageV300doorSide
	{
		mesh = vehicles/Vehicles_84gageV300_Body|v300_door_side,
		shader = damn_vehicle_noreflect_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 84gageV300door_r
	{
		mesh = vehicles/Vehicles_84gageV300_Body|v300_hatch_rear_door,
		shader = damn_vehicle_noreflect_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 84gageV300rearHatch
	{
		mesh = vehicles/Vehicles_84gageV300_Body|v300_hatch_rear,
		shader = damn_vehicle_noreflect_shader,
		static = FALSE,
		scale = 0.1,
	}

	template vehicle V300Doors
	{
		part DoorSide
		{
			model DoorSide
				{
				file = 84gageV300doorSide,
				}
				itemType = Base.V300DriverHatchDoor,
				area = DoorSide,
				category = door,
				anim ActorOpen
				{
					angle = 0.0 270.0 0.0,
				}
				anim ActorClose
				{
					angle = 0.0 270.0 0.0,
				}

				anim Close
				{
					anim = door_side_opening,
					reverse = TRUE,
					rate = 1.5,
				}

				anim Open
				{
					anim = door_side_opening,
					rate = 1.0,
				}

				anim Closed
				{
					anim = door_side_opening,
					animate = FALSE,
				}

				anim Opened
				{
					anim = door_side_opening,
					reverse = TRUE,
					animate = FALSE,
				}

				table uninstall
				{
					requireUninstalled = DoorSideViewport,
				}

				lua
				{
					create = Vehicles.Create.Door,
					init = Vehicles.Init.Door,
					use = Vehicles.Use.Door,
				}
		}


		part DoorFrontLeft
		{
				itemType = Base.V300TurretHatchLid,
				area = SeatFrontLeft,
				category = nodisplay,
				
				lua
				{
					create = Vehicles.Create.Door,
					init = Vehicles.Init.Door,
					use = Vehicles.Use.Door,
				}
		}

		part DoorRearLeft
		{
			model DoorRearLeft
	
				itemType = Base.V300TurretHatchLid,
				area = SeatRearLeft,
				category = nodisplay,
				
				lua
				{
					create = Vehicles.Create.Door,
					init = Vehicles.Init.Door,
					use = Vehicles.Use.Door,
				}
		}

		part DoorHatch
		{

			model V300DoorRear
			{
				file = 84gageV300door_r,
			}

			anim Close
			{
				anim = rear_hatch_door_opening,
				reverse = TRUE,
				rate = 0.70,
			}

			anim Open
			{
				anim = rear_hatch_door_opening,
				rate = 0.7,
			}

			anim Closed
			{
				anim = rear_hatch_door_opening,
				animate = FALSE,
			}

			anim Opened
			{
				anim = rear_hatch_door_opening,
				reverse = TRUE,
				animate = FALSE,
			}

			itemType = Base.V300RearDoor,
			category = door,
			parent = TrunkDoor,
			area = DoorRear,

			table uninstall
				{
					requireUninstalled = DoorRearViewport,
				}

			table install
				{
					requireInstalled = TrunkDoor,
				}

			lua
				{
					create = Vehicles.Create.Door,
					init = Vehicles.Init.Door,
					use = Vehicles.Use.Door,
				}
			}

		part Door*
		{
			
			door
			{
				}
				anim Open
				{
					sound = VehicleDoorOpenStandard,
				}
				anim Close
				{
					sound = VehicleDoorCloseStandard,
				}
				anim Lock
				{
					sound = LockVehicleDoorStandard,
				}
				anim Unlock
				{
					sound = UnlockVehicleDoorStandard,
				}
				anim IsLocked
				{
					sound = VehicleDoorIsLockedStandard,
				}
				anim ActorOpen
				{
					anim = Attack_Shove,
					rate = 0.3,
				}
				anim ActorClose
				{
					anim = Attack_Shove,
					rate = 0.3,
				}
				mechanicRequireKey = true,
				table install
				{
					items
					{
						item
						{
							type = Base.Wrench,
							count = 1,
							keep = true,
							equip = primary,
						}
					}
					time = 700,
					skills = Mechanics:4,
					recipes = Intermediate Mechanics,
					test = Vehicles.InstallTest.Default,
					complete = Vehicles.InstallComplete.Door,
				}
				table uninstall
				{
					items
					{
						item
						{
							type = Base.Wrench,
							count = 1,
							keep = true,
							equip = primary,
						}
					}
					time = 700,
					skills = Mechanics:4,
					recipes = Intermediate Mechanics,
					test = Vehicles.UninstallTest.Default,
					complete = Vehicles.UninstallComplete.Door,
				}
			}
		}

	template vehicle V300HatchRear
	{

		part TrunkDoor
		{

			model V300Tailgate2
			{
				file = 84gageV300rearHatch,
			}

			anim Close
			{
				anim = rear_hatch_opening,
				rate = 0.45,
			}

			anim Open
			{
				anim = rear_hatch_opening,
				reverse = TRUE,
				rate = 0.25,
			}

			anim Closed
			{
				anim = rear_hatch_opening,
				reverse = TRUE,
				animate = FALSE,
			}

			anim Opened
			{
				anim = rear_hatch_opening,
				animate = FALSE,
			}

			itemType = Base.V300RearHatchLid,
			category = bodywork,
			area = TruckBed,
			door
			{
			}
			anim Open
			{
				sound = VehicleTrunkOpenStandard,
			}
			anim Close
			{
				sound = VehicleTrunkCloseStandard,
			}
			anim Lock
			{
				sound = LockVehicleDoorStandard,
			}
			anim Unlock
			{
				sound = UnlockVehicleDoorStandard,
			}
			anim IsLocked
			{
				sound = VehicleDoorIsLockedStandard,
			}
			anim ActorOpen
			{
				anim = WindowOpenSuccess,
				rate = 0.15,
				angle = 0.0 0.0 0.0,
			}
			anim ActorClose
			{
				anim = Attack_Shove,
				rate = 0.3,
				angle = 0.0 0.0 0.0,
			}
			
			mechanicRequireKey = true,
			repairMechanic = true,
			table install
			{
				items
				{
					item
					{
						type = Base.Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 1000,
				skills = Mechanics:2,
				recipes = Intermediate Mechanics,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.Door,
			}
			table uninstall
			{
				items
				{
					item
					{
						type = Base.Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 1000,
				skills = Mechanics:2,
				recipes = Intermediate Mechanics,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.Door,
				requireUninstalled = DoorHatch;TrunkDoorViewport,

			}
			lua
			{
				create = Vehicles.Create.TrunkDoor,
				init = Vehicles.Init.Door,
				use = Vehicles.Use.TrunkDoor,
			}
		}
	}
}

