module Base
{

	model 91rangeWheel1
	{
		mesh = vehicles/Vehicles_91range_Wheel_mk2,
		texture = vehicles/Vehicles_91range_Wheel,
		shader = damn_wheel_shader,
		scale = 0.1,
	}
    model 91rangeWheel2L
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel2,
		shader = damn_wheel_shader,
		scale = 0.115,
	}
    model 91rangeWheel2R
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel2,
		shader = damn_wheel_shader,
		scale = 0.115,
        invertX = TRUE,
	}

	template vehicle RR91Tires
	{
		part TireFrontLeft
		{
            model RR91Tire0
			{
				file = 91rangeWheel1,
			}

            model RR91Tire1
			{
				file = 91rangeWheel2L,
			}

			area = TireFrontLeft,
			wheel = FrontLeft,
            table install
			{
				complete = RR91.InstallComplete.TireFrontLeft,
				requireInstalled = BrakeFrontLeft;SuspensionFrontLeft,
			}
			table uninstall
			{
				complete = RR91.UninstallComplete.TireFrontLeft,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = RR91.Init.TireFrontLeft,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}

		}

		part TireFrontRight
		{
            model RR91Tire0
			{
				file = 91rangeWheel1,
			}

            model RR91Tire1
			{
				file = 91rangeWheel2R,
			}

			area = TireFrontRight,
			wheel = FrontRight,
            table install
			{
				complete = RR91.InstallComplete.TireFrontRight,
				requireInstalled = BrakeFrontRight;SuspensionFrontRight,
			}
			table uninstall
			{
				complete = RR91.UninstallComplete.TireFrontRight,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = RR91.Init.TireFrontRight,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearLeft
		{
            model RR91Tire0
			{
				file = 91rangeWheel1,
			}

            model RR91Tire1
			{
				file = 91rangeWheel2L,
			}

			area = TireRearLeft,
			wheel = RearLeft,
            table install
			{
				complete = RR91.InstallComplete.TireRearLeft,
				requireInstalled = BrakeRearLeft;SuspensionRearLeft,
			}
            table uninstall
			{
				complete = RR91.UninstallComplete.TireRearLeft,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = RR91.Init.TireRearLeft,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearRight
		{
            model RR91Tire0
			{
				file = 91rangeWheel1,
			}

            model RR91Tire1
			{
				file = 91rangeWheel2R,
			}

			area = TireRearRight,
			wheel = RearRight,
            table install
			{
				complete = RR91.InstallComplete.TireRearRight,
				requireInstalled = BrakeRearRight;SuspensionRearRight,
			}
			table uninstall
			{
				complete = RR91.UninstallComplete.TireRearRight,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = RR91.Init.TireRearRight,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part Tire*
		{
			category = tire,
			itemType = Base.91rangeTire;damnCraft.SmallTire,
            durability = 2,
			container
			{
				capacity = 35,
				test = Vehicles.ContainerAccess.Tire,
				contentType = Air,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						tags = LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.InstallTest.Default,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						tags = LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.UninstallTest.Default,
			}
		}
	}
}

