module Base
{
	model m540_door_rr
	{
		mesh = vehicles/Vehicles_cobbM540_Body|m540_door_rr,
		shader = damn_vehicle_noreflect_shader,
		static = FALSE,
		scale = 0.1,
	}

	template vehicle M540Doors
	{
		part DoorRearRight
		{
			model door_rr
			{
				file = m540_door_rr,
			}

				anim Close
				{
					anim = door_rr_opening,
                    reverse = TRUE,
					rate = 1.0,
				}

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

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

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

			area = SeatRearRight,
			anim ActorOpen
			{
				angle = 0.0 90.0 0.0,
			}
			anim ActorClose
			{
				angle = 0.0 270.0 0.0,
			}
			itemType = Base.cobbM540Door,

			category = door,
            durability = 5,
			door
				{
				}
			anim Open
				{
					sound = VehicleDoorOpen,
				}
			anim Close
				{
					sound = VehicleDoorOpen,
				}
			anim Lock
				{
					sound = LockVehicleDoorStandard,
				}
				anim Unlock
				{
					sound = UnlockVehicleDoorStandard,
				}
				anim IsLocked
				{
					sound = VehicleDoorIsLockedStandard,
				}
			anim ActorOpen
			{
				anim = Attack_Shove,
				rate = 0.1,
			}
			anim ActorClose
			{
				anim = Attack_Shove,
				rate = 0.1,
			}
			table install
			{
				items
				{
					item
					{
						tags = Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 2000,
				skills = Mechanics:5,
				recipes = Intermediate Mechanics,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.Door,
			}
			table uninstall
			{
				items
				{
					item
					{
						tags = Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 2500,
				skills = Mechanics:5,
				recipes = Intermediate Mechanics,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.Door,
                requireUninstalled = WindowRearRight,
			}
			lua
			{
				create = Vehicles.Create.Door,
				init = Vehicles.Init.Door,
				use = Vehicles.Use.Door,
			}
		}
	}
}