module Base
{
	vehicle SemiTrailerCistern
    {
        mechanicType = 2,
        offRoadEfficiency = 2,
        engineRepairLevel = 4,
        playerDamageProtection = 1,

        model
        {
            file = Rotators.TrailerCisternBase,
            scale = 1.1500,
            offset = 0.0000 1.3913 0.2348,
        }

        skin
        {
            texture = Vehicles/Trailers_rCistern_White,
        }

        skin
        {
            texture = Vehicles/Trailers_rCistern_Black,
        }

        extents = 1.7565 1.2000 8.0348,
        physicsChassisShape = 1.7739 1.2000 8.0522,
        centerOfMassOffset = 0.0000 1.8000 2.6174,
        shadowExtents = 1.8266 8.2996,
        shadowOffset = 0.0000 2.5533,
        mass = 753,
        textureRust = Vehicles/Trailers_rCistern_Rust,
        textureMask = Vehicles/Trailers_rCistern_Mask,
        textureLights = Vehicles/Trailers_rCistern_Lights,
        textureDamage1Overlay = Vehicles/Trailers_rCistern_Overlay_Damaged01,
        textureDamage2Overlay = Vehicles/Trailers_rCistern_Overlay_Damaged02,
        textureDamage1Shell = Vehicles/Trailers_rCistern_Shell_Damaged01,
        textureDamage2Shell = Vehicles/Trailers_rCistern_Shell_Damaged02,
        brakingForce = 45,
        stoppingMovementForce = 3.0f,
        rollInfluence = 0.35f,
        steeringIncrement = 0.03,
        steeringClamp = 0.3,
        suspensionStiffness = 25,
        suspensionCompression = 2.83,
        suspensionDamping = 2.88,
        maxSuspensionTravelCm = 25,
        suspensionRestLength = 0.35f,
        wheelFriction = 0.65,
        frontEndHealth = 150,
        rearEndHealth = 150,
        seats = 2,
        isSmallVehicle = false,

        wheel FrontLeft
        {
            front = true,
            offset = 0.6000 -0.9826 0.2609,
            radius = 0.40f,
            width = 22.90f,
        }

        wheel FrontRight
        {
            front = true,
            offset = -0.6000 -0.9826 0.2609,
            radius = 0.40f,
            width = 22.90f,
        }

        wheel RearLeft
        {
            front = false,
            offset = 0.6000 -0.9826 -0.7217,
            radius = 0.40f,
            width = 22.90f,
        }

        wheel RearRight
        {
            front = false,
            offset = -0.6000 -0.9826 -0.7217,
            radius = 0.40f,
            width = 22.90f,
        }

        area TruckBed
        {
            xywh = -1.1565 1.3652 0.6087 1.1130,
        }

        area TireFrontLeft
        {
            xywh = 1.1391 0.0000 0.4522 0.4870,
        }

        area TireFrontRight
        {
            xywh = -1.1478 0.0087 0.4522 0.4870,
        }

        area TireRearLeft
        {
            xywh = 1.1478 -0.9913 0.4522 0.4870,
        }

        area TireRearRight
        {
            xywh = -1.1478 -0.9913 0.4522 0.4870,
        }

        template = Rotators.DoubleTires,

        part TireFrontLeft
        {
            table uninstall
            {
                requireUninstalled = WheelChainFrontLeft,
                recipes = Basic Mechanics,
            }

            model InflatedTirePlusWheel
            {
                file = Rotators.TrailerVanFrontWheelLeft,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 0.0000,
            }

            model ATAProtection
            {
                file = Rotators.SemiTruckArmorTireTrailer,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 180.0000,
            }
        }

        part WheelChainFrontLeft
        {
            parent = TireFrontLeft,
            area = TireFrontLeft,

            table install
            {
                requireInstalled = TireFrontLeft,
            }

            table uninstall
            {
                requireInstalled = TireFrontLeft,
            }
        }

        part TireFrontRight
        {
            table uninstall
            {
                requireUninstalled = WheelChainFrontRight,
                recipes = Basic Mechanics,
            }

            model InflatedTirePlusWheel
            {
                file = Rotators.TrailerVanFrontWheelRight,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 0.0000,
            }

            model ATAProtection
            {
                file = Rotators.SemiTruckArmorTireTrailer,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 0.0000,
            }
        }

        part WheelChainFrontRight
        {
            parent = TireFrontRight,
            area = TireFrontRight,

            table install
            {
                requireInstalled = TireFrontRight,
            }

            table uninstall
            {
                requireInstalled = TireFrontRight,
            }
        }

        part TireRearLeft
        {
            table uninstall
            {
                requireUninstalled = WheelChainRearLeft,
                recipes = Basic Mechanics,
            }

            model InflatedTirePlusWheel
            {
                file = Rotators.TrailerVanRearWheelLeft,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 0.0000,
            }

            model ATAProtection
            {
                file = Rotators.SemiTruckArmorTireTrailer,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 180.0000,
            }
        }

        part WheelChainRearLeft
        {
            parent = TireRearLeft,
            area = TireRearLeft,

            table install
            {
                requireInstalled = TireRearLeft,
            }

            table uninstall
            {
                requireInstalled = TireRearLeft,
            }
        }

        part TireRearRight
        {
            table uninstall
            {
                requireUninstalled = WheelChainRearRight,
                recipes = Basic Mechanics,
            }

            model InflatedTirePlusWheel
            {
                file = Rotators.TrailerVanRearWheelRight,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 0.0000,
            }

            model ATAProtection
            {
                file = Rotators.SemiTruckArmorTireTrailer,
                offset = 0.0000 0.0000 0.0000,
                rotate = 0.0000 0.0000 0.0000,
            }
        }

        part WheelChainRearRight
        {
            parent = TireRearRight,
            area = TireRearRight,

            table install
            {
                requireInstalled = TireRearRight,
            }

            table uninstall
            {
                requireInstalled = TireRearRight,
            }
        }

        part WheelChain*
        {
            mechanicRequireKey = false,
            repairMechanic = true,
            category = tire,
            itemType = Base.SemiTruckArmorTires_Item,

            table install
            {
                complete = rSemiTruck.ATATuning.InstallComplete.IndividualWheelProtection,

                items
                {
                    1
                    {
                        tags = base:wrench,
                        count = 1,
                        keep = true,
                        equip = primary,
                    }
                }

                time = 300,
                skills = Mechanics:1,
                recipes = Basic Mechanics,
                test = rSemiTruck.ATATuning.InstallTest.IndividualWheelProtection,
            }

            table uninstall
            {
                complete = rSemiTruck.ATATuning.UninstallComplete.IndividualWheelProtection,

                items
                {
                    1
                    {
                        tags = base:wrench,
                        count = 1,
                        keep = true,
                        equip = primary,
                    }
                }

                time = 300,
                skills = Mechanics:1,
                recipes = Basic Mechanics,
                test = rSemiTruck.ATATuning.UninstallTest.IndividualWheelProtection,
                requireEmpty = true,
            }

            lua
            {
                create = ATATuning.Create.Chance0,
                init = rSemiTruck.ATATuning.Init.IndividualWheelProtection,
                update = rSemiTruck.ATATuning.Update.IndividualWheelProtection,
            }
        }

        part Tire*
        {
            setAllModelsVisible = false,

            table install
            {
                complete = rSemiTruck.ATATuning.InstallComplete.SafeTireNotAllModelsVisible,
            }

            table uninstall
            {
                complete = rSemiTruck.ATATuning.UninstallComplete.SafeTireNotAllModelsVisible,
            }

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

        template = Battery,

        part Battery
        {
            category = nodisplay,

            lua
            {
                create = Vehicles.Create.Battery,
                update = Vehicles.Update.Battery,
            }
        }

        template = Headlight/part/HeadlightRearLeft,
        template = Headlight/part/HeadlightRearRight,
        template = Suspension/part/SuspensionFrontLeft,
        template = Suspension/part/SuspensionFrontRight,
        template = Suspension/part/SuspensionRearLeft,
        template = Suspension/part/SuspensionRearRight,
        template = Trunk/part/TruckBed,

        part TruckBed
        {
            itemType = Base.BigTrunk,
            durability = 10,

            container
            {
                conditionAffectsCapacity = false,
                capacity = 20,
            }
        }

        template = TrunkDoor,

        part TrunkDoor
        {
            durability = 10,

            model TrunkDoor
            {
                file = Rotators.TrailerCisternTrunk,
                rotate = 0.0000 0.0000 0.0000,
                scale = 1,
                offset = 0.0000 0.0000 0.0000,
            }

            anim Close
            {
                anim = Toolbox_closing,
                rate = 2.2,
            }

            anim Open
            {
                anim = Toolbox_closing,
                reverse = TRUE,
                rate = 2.0,
            }

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

            anim Opened
            {
                anim = Toolbox_closing,
                animate = FALSE,
            }

            mechanicRequireKey = false,

            anim ActorOpen
            {
                anim = WindowOpenSuccess,
                rate = 0.15,
                angle = 0.0 90.0 0.0,
            }

            anim ActorClose
            {
                anim = Attack_Shove,
                rate = 0.3,
                angle = 0.0 90.0 0.0,
            }
        }

        area GasTank
        {
            xywh = -1.2348 2.2957 1.0087 3.1478,
        }

        template = W900TruckTank,
        useChassisPhysicsCollision = false,

        physics box
        {
            offset = 0.0000 1.5073 2.1304,
            extents = 1.7826 0.7565 7.0783,
            rotate = 0.0000 0.0000 0.0000,
        }

        physics box
        {
            offset = 0.3478 0.5565 3.9187,
            extents = 0.1130 0.9304 0.1043,
            rotate = 0.0000 0.0000 0.0000,
        }

        physics box
        {
            offset = -0.3652 0.5565 3.9187,
            extents = 0.1130 0.9304 0.1043,
            rotate = 0.0000 0.0000 0.0000,
        }

        physics box
        {
            offset = 0.0000 0.7739 -0.2291,
            extents = 0.8696 0.5565 2.3130,
            rotate = 0.0000 0.0000 0.0000,
        }

        attachment trailerTruck
        {
            offset = 0.0000 -0.5574 5.6435,
            rotate = 0.0000 0.0000 0.0000,
            canAttach = trailerTruck,
            updateconstraint = false,
        }
    }
}
