module Base
{
	model Chevalier_Rhino_LeftDoor
	{
		mesh = vehicles/Vehicles_Chevalier_Rhino_F|LeftDoor,
		shader = vehicle_multiuv_noreflect,
		static = FALSE,
		scale = .4,
		boneWeight = LeftDoorBone 1.0,
	}
	
	model Chevalier_Rhino_RightDoor
	{
		mesh = vehicles/Vehicles_Chevalier_Rhino_F|RightDoor,
		shader = vehicle_multiuv_noreflect,
		static = FALSE,
		scale = .4,
		boneWeight = RightDoorBone 1.0,
	}
	
	template vehicle RhinoDoor
	{
		part DoorFrontLeft
		{
			model Default
			{
				file = Chevalier_Rhino_LeftDoor,
			}
			
			itemType = Base.RhinoFrontDoor,
			area = SeatFrontLeft,
			
			anim Close
			{
				anim = anim_leftdoor,
				reverse = TRUE,
				rate = 1.5,
			}

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

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

			anim Opened
			{
				anim = anim_leftdoor,
				reverse = TRUE,
				animate = FALSE,
			}				
			anim ActorOpen
			{
				angle = 0.0 270.0 0.0,
			}
			anim ActorClose
			{
				angle = 0.0 270.0 0.0,
			}
			
			table uninstall
			{
				requireUninstalled = WindowFrontLeft;ATA2ProtectionDoorFrontLeft,
			}				
		}

		part DoorFrontRight
		{
			model Default
			{
				file = Chevalier_Rhino_RightDoor,
			}
			
			itemType = Base.RhinoFrontDoor,
			area = SeatFrontRight,
			
			anim Close
			{
				anim = anim_rightdoor,
				reverse = TRUE,
				rate = 1.5,
			}

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

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

			anim Opened
			{
				anim = anim_rightdoor,
				reverse = TRUE,
				animate = FALSE,
			}				
			
			anim ActorOpen
			{
				angle = 0.0 90.0 0.0,
			}
			anim ActorClose
			{
				angle = 0.0 90.0 0.0,
			}
			
			table uninstall
			{
				requireUninstalled = WindowFrontRight;ATA2ProtectionDoorFrontRight,
			}			
		}
		
		part Door*
		{
			category = door,
			door
			{
				/* TODO: rear police-car doors won't open from inside */
			}
			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 = 300,
				skills = Mechanics:4,
				recipes = Basic Mechanics,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.Door,
			}
			table uninstall
			{
				items
				{
					item
					{
						type = Base.Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 300,
				skills = Mechanics:4,
				recipes = Basic Mechanics,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.Door,
			}
			lua
			{
				create = Vehicles.Create.Door,
				init = Vehicles.Init.Door,
				use = Vehicles.Use.Door,
			}
		}		
	}
}

