module Base
{

	model 49powerWagonWheelStock
	{
		mesh = vehicles/Vehicles_49powerWagon_Wheels|power_tire_stock,
		texture = vehicles/Vehicles_49powerWagon_Wheel_stock,
		shader = damn_wheel_shader,
		scale = 0.1,
	}

	model 49powerWagonWheelPA
	{
		mesh = vehicles/Vehicles_49powerWagon_Wheels|power_tire_pa,
		texture = vehicles/Vehicles_49powerWagon_Wheel_pa,
		shader = damn_wheel_shader,
		scale = 0.1,
	}

    model 49powerWagonWheel2L
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel2,
		shader = damn_wheel_shader,
		scale = 0.128,
	}
    model 49powerWagonWheel2R
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel2,
		shader = damn_wheel_shader,
		scale = 0.128,
        invertX = TRUE,
	}

	template vehicle PWRTiresStock
	{
            part TireFrontLeft
            {
                model PWRTire0
                {
                    file = 49powerWagonWheelStock,
                }

                model PWRTireUNIL
                {
                    file = 49powerWagonWheel2L,
                }

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

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

            }

            part TireFrontRight
            {
                model PWRTire0
                {
                    file = 49powerWagonWheelStock,
                }

                model PWRTireUNIR
                {
                    file = 49powerWagonWheel2R,
                }

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

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

            part TireRearLeft
            {
                model PWRTire0
                {
                    file = 49powerWagonWheelStock,
                }

                model PWRTireUNIL
                {
                    file = 49powerWagonWheel2L,
                }

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

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

            part TireRearRight
            {
                model PWRTire0
                {
                    file = 49powerWagonWheelStock,
                }

                model PWRTireUNIR
                {
                    file = 49powerWagonWheel2R,
                }

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

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

            part Tire*
            {
                category = tire,
                specificItem = false,
                itemType = Base.49powerWagonTire;damnCraft.SmallTire2,
                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 PWRTiresPA
	{
		part TireFrontLeft
		{
			area = TireFrontLeft,
			wheel = FrontLeft,
			table install
			{
				requireInstalled = BrakeFrontLeft;SuspensionFrontLeft,
			}

		}

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

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

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

		part Tire*
		{
			category = tire,
			specificItem = false,
			itemType = Base.49powerWagonApocalypseTire,
            durability = 3,
			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,
			}

			model PWRTirePA
			{
				file = 49powerWagonWheelPA,
			}

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