module Base
{
	template vehicle VVA_TrunkDoor {
		part TrunkDoor
		{
			anim Close
			{
				anim = Trunk_closing,
			}

			anim Open
			{
				anim = Trunk_closing,
				reverse = TRUE,
			}

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

			anim Opened
			{
				anim = Trunk_closing,
				animate = FALSE,
			}
		}
	}	
	
	template vehicle VVA_TrunkDoor_Slow {
		part TrunkDoor
		{
			anim Close
			{
				rate = 0.625,
			}

			anim Open
			{
				rate = 0.5,
			}
		}
	}
	template vehicle VVA_TrunkDoor_Reg {
		part TrunkDoor
		{
			anim Close
			{
				rate = 1.25,
			}

			anim Open
			{
				rate = 1.0,
			}
		}
	}
	template vehicle VVA_TrunkDoor_Fast {
		part TrunkDoor
		{
			anim Close
			{
				rate = 2.5,
			}

			anim Open
			{
				rate = 2.0,
			}
		}
	}
	template vehicle PZKA_VariableTrunk {
		part TrunkDoor
        {
			lua
			{
				create = Vehicles.Create.TrunkDoor,
				init = Vehicles.Init.AdjustLightGeometryDoor,
				update = Vehicles.Update.TrunkDoor,
				use = Vehicles.Use.TrunkDoor,
			}
			table install {
				complete = Vehicles.Init.AdjustLightGeometry,
			}
        }
	}

		
	template vehicle VVA_TrunkDoor_Common {
		part VVAAnchor_Trunk1
		{}
		part VVAAnchor_Trunk2
		{}
		part VVAAnchor_Trunk3
		{}
		part VVAAnchor_Trunk*
		{
			parent = TrunkDoor,
			category = nodisplay,
           	itemType = Base.LightBulb,
            setAllModelsVisible = true,
			lua
	    	{
				create = Vehicles.Create.Default,
				update = Vehicles.Update.MirrorHoodCondition,
	    	}
			model Default {
				file = VVA_Dummy,
			}
		}
		template! = VVA_TrunkDoor,		
		template! = VVA_TrunkDoor_Slow,
	}
}