module Base
{

	model W460Wheel1
	{
		mesh = vehicles/Vehicles_84mercW460_Wheels|w460_tire1,
		texture = vehicles/Vehicles_84merc_Wheels,
		shader = damn_wheel_shader,
		scale = 0.1,
	}
	model W460Wheel2
	{
		mesh = vehicles/Vehicles_84mercW460_Wheels|w460_tire2,
		texture = vehicles/Vehicles_84merc_Wheels,
		shader = damn_wheel_shader,
		scale = 0.1,
	}
	model W460Wheel3
	{
		mesh = vehicles/Vehicles_84mercW460_Wheels|w460_tire3,
		texture = vehicles/Vehicles_84merc_Wheels,
		shader = damn_wheel_shader,
		scale = 0.1,
	}

    model W460WheelML
	{
		mesh = vehicles/Vehicles_84mercW460_Wheels|w460_tireM,
		texture = vehicles/Vehicles_84merc_WheelM,
		shader = damn_wheel_shader,
		scale = 0.1,
	}

    model W460WheelMR
	{
		mesh = vehicles/Vehicles_84mercW460_Wheels|w460_tireM,
		texture = vehicles/Vehicles_84merc_WheelM,
		shader = damn_wheel_shader,
		scale = 0.1,
        invertX = TRUE,
	}

    model W460Wheel5L
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel1,
		shader = damn_wheel_shader,
		scale = 0.121,
	}
    model W460Wheel5R
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel1,
		shader = damn_wheel_shader,
		scale = 0.121,
        invertX = TRUE,
	}

	template vehicle W460CTires
	{
		part TireFrontLeft
		{
            model  W460Tire0
			{
				file = W460Wheel1,
			}

			model  W460Tire1
			{
				file = W460Wheel2,
			}

			model  W460Tire2
			{
				file = W460Wheel3,
			}

            model  W460Tire3
			{
				file = W460Wheel5L,
			}

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

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

		}

		part TireFrontRight
		{
            model  W460Tire0
			{
				file = W460Wheel1,
			}

			model  W460Tire1
			{
				file = W460Wheel2,
			}

			model  W460Tire2
			{
				file = W460Wheel3,
			}

            model  W460Tire3
			{
				file = W460Wheel5R,
			}

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

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

		part TireRearLeft
		{
            model  W460Tire0
			{
				file = W460Wheel1,
			}

			model  W460Tire1
			{
				file = W460Wheel2,
			}

			model  W460Tire2
			{
				file = W460Wheel3,
			}

            model  W460Tire3
			{
				file = W460Wheel5L,
			}

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

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

		part TireRearRight
		{
            model  W460Tire0
			{
				file = W460Wheel1,
			}

			model  W460Tire1
			{
				file = W460Wheel2,
			}

			model  W460Tire2
			{
				file = W460Wheel3,
			}

            model  W460Tire3
			{
				file = W460Wheel5R,
			}

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

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

		part Tire*
		{
			category = tire,
			specificItem = false,
			itemType = Base.W460NormalTire2;Base.W460WideTire2;Base.W460ModernTire2;damnCraft.SmallTire1,
			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,
			}

		}
	}

    template vehicle W460MTires
	{
		part TireFrontLeft
		{
			area = TireFrontLeft,
			wheel = FrontLeft,
			table install
			{
				requireInstalled = BrakeFrontLeft;SuspensionFrontLeft,
			}

            model W460MilitaryTiresFL
			{
				file = W460WheelML,
			}

		}

		part TireFrontRight
		{
			area = TireFrontRight,
			wheel = FrontRight,
			table install
			{
				requireInstalled = BrakeFrontRight;SuspensionFrontRight,
			}

            model W460MilitaryTiresRL
			{
				file = W460WheelMR,
			}
		}

		part TireRearLeft
		{
			area = TireRearLeft,
			wheel = RearLeft,
			table install
			{
				requireInstalled = BrakeRearLeft;SuspensionRearLeft,
			}

            model W460MilitaryTiresRL
			{
				file = W460WheelML,
			}
		}

		part TireRearRight
		{
			area = TireRearRight,
			wheel = RearRight,
			table install
			{
				requireInstalled = BrakeRearRight;SuspensionRearRight,
			}

            model W460MilitaryTiresRR
			{
				file = W460WheelMR,
			}
		}

		part Tire*
		{
			category = tire,
			itemType = Base.W460MilitaryTire,
			durability = 4,
			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,
				complete = Vehicles.InstallComplete.Tire,
			}
			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,
				complete = Vehicles.UninstallComplete.Tire,
			}

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

