<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="pressureWasherTrailer">
    <storeData>
        <name>HDC 27/34 Trailer</name>
        <functions>
            <function>$l10n_function_highPressureWasher</function>
        </functions>
        <image>store_hdc2734Trailer.dds</image>
        <price>12400</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>KAERCHER</brand>
        <category>misc</category>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_highPressureWasher</typeDesc>
        <filename>hdc2734Trailer.i3d</filename>

        <size width="1.9" length="3.6" lengthOffset="0.5" />

        <components>
            <component centerOfMass="0 0.3 0" solverIterationCount="10" mass="686" />
        </components>

        <schemaOverlay attacherJointPosition="0 0">
            <default name="DEFAULT_IMPLEMENT"/>
            <selected name="DEFAULT_IMPLEMENT_SELECTED"/>
        </schemaOverlay>
    </base>

    <wheels>
        <wheelConfigurations>
            <wheelConfiguration name="$l10n_configuration_valueDefault" price="0">
                <wheels autoRotateBackSpeed="2.0">
                    <wheel filename="$data/shared/wheels/lizard/implement/280_55R16.xml" configId="trailer" isLeft="true" hasTireTracks="true" >
                        <physics restLoad="0.3" repr="wheelLeft"  radius="0.315"  width="0.195" forcePointRatio="0.5" initialCompression="15" suspTravel="0.10" spring="10" damper="50" frictionScale="2.5" />
                    </wheel>
                    <wheel filename="$data/shared/wheels/lizard/implement/280_55R16.xml" configId="trailer" isLeft="false" hasTireTracks="true" >
                        <physics restLoad="0.3" repr="wheelRight" radius="0.315"  width="0.195" forcePointRatio="0.5" initialCompression="15" suspTravel="0.10" spring="10" damper="50" frictionScale="2.5" />
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>
    </wheels>

    <rimColorConfigurations useDefaultColors="false" price="0">
        <rimColorConfiguration name="Kärcher Light Grey"  color="KAERCHER_GREY3"/>
        <rimColorConfiguration name="Kärcher Dark Grey"   color="KAERCHER_GREY4"/>
        <rimColorConfiguration name="Silver" material="8" color="0.98 0.98 0.98 1"/>
    </rimColorConfigurations>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="trailerLow" attacherHeight="0.47" />
        </inputAttacherJoints>

        <brakeForce>0.1</brakeForce>

        <support animationName="moveSupport" />
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="electric"  node="electricBack"  length="0.3" diameter="0.008" straighteningFactor="0.5">
            <objectChange node="electricBackAdapter" visibilityActive="false" visibilityInactive="true"/>
        </hose>
    </connectionHoses>

    <dynamicallyLoadedParts>
        <dynamicallyLoadedPart linkNode="electricBackAdapter" node="1|1" filename="$data/shared/connectionHoses/connectors.i3d" />

        <!-- Load dynamically so the shared I3D file is just being cloned when needed as hand tool. -->
        <dynamicallyLoadedPart linkNode="lanceNode" node="0|0|0" filename="hds9184MLance.i3d" />
    </dynamicallyLoadedParts>

    <lights>
        <sharedLight linkNode="rearLightLeft" filename="lights/rearMultipointLightLED_01_left.xml" />
        <sharedLight linkNode="rearLightRight" filename="lights/rearMultipointLightLED_01_right.xml" />

        <sharedLight linkNode="yellowRound01" filename="lights/yellowRound_01.xml" />
        <sharedLight linkNode="yellowRound02" filename="lights/yellowRound_01.xml" />
        <sharedLight linkNode="yellowRound03" filename="lights/yellowRound_01.xml" />
        <sharedLight linkNode="yellowRound04" filename="lights/yellowRound_01.xml" />

        <realLights>
            <high>
                <light node="backLightsHigh" lightTypes="0"/>
                <brakeLight node="backLightsHigh" />
                <turnLightLeft node="turnLightLeftBack" />
                <turnLightRight node="turnLightRightBack" />
                <reverseLight node="reverseLight" />
            </high>
        </realLights>
    </lights>

    <animations>
        <animation name="moveSupport">
            <part node="supportArm"     startTime="0" endTime="0.2" startTrans="0 0 0"     endTrans="0 -0.101 0" />
            <part node="supportArmPart" startTime="0" endTime="0.2" startRot="0 0 0"       endRot="-74 0 0" />
            <part node="supportCol"     startTime="0" endTime="0.2" startTrans="0 0.125 0" endTrans="0 -0.189 0" />
        </animation>
        <animation name="turnOnWasher">
            <part node="exhaustNode" startTime="0"   endTime="1.0"  visibility="false" />
            <part node="exhaustNode" startTime="1.0" endTime="1.1"  visibility="true" />
            <part node="modeSwitch" startTime="0"    endTime="0.1" startRot="0 0 0" endRot="0 0 0" />
            <part node="modeSwitch" startTime="0.1"  endTime="0.2" startRot="0 0 0" endRot="0 0 80" />
        </animation>
        <animation name="waterPressureNeedle">
            <part node="pressureNeedle" startTime="0" endTime="1" startRot="0 0 0" endRot="0 0 250" />
        </animation>
        <animation name="loadingBarFuel" >
            <part node="fillLevelBarFuel" startTime="0.0" endTime="1.0" shaderParameter="sliderPos" shaderStartValues="0 0 0 0" shaderEndValues="1.0 0 0 0" />
        </animation>
        <animation name="loadingBarWater" >
            <part node="fillLevelBarWater" startTime="0.0" endTime="1.0" shaderParameter="sliderPos" shaderStartValues="0 0 0 0" shaderEndValues="1.0 0 0 0" />
        </animation>
    </animations>

    <pressureWasher canAdjustPressure="true" maxPressure="3400" hoseConnectionNode="hoseConnectionPoint" drawFirstFillText="true">
        <interactionTrigger node="interactionTrigger" />

        <!-- Hiding the lance and the hoses when in use. -->
        <pressureWasherLanceConfigurations filename="hds9184MLance.xml" node="visibilityParts">
            <pressureWasherLanceConfiguration name="$l10n_configuration_pwHoseLenght15" price="0" hoseLength="15" washMultiplier="3">
                <objectChange node="extraHoseRight" visibilityActive="false"/>
                <objectChange node="extraHoseLeft"  visibilityActive="false"/>
                <objectChange node="extraHoseHooks" visibilityActive="false"/>
            </pressureWasherLanceConfiguration>

            <pressureWasherLanceConfiguration name="$l10n_configuration_pwHoseLenght30" price="390" hoseLength="30" washMultiplier="3">
                <objectChange node="extraHoseRight" visibilityActive="true"/>
                <objectChange node="extraHoseLeft"  visibilityActive="true"/>
                <objectChange node="extraHoseHooks" visibilityActive="true"/>
            </pressureWasherLanceConfiguration>
        </pressureWasherLanceConfigurations>

        <pressureWasherConsumerConfigurations>
            <!-- Basic consumers only, wash speed is the same as a placeable pressure washer. Additive option coming in future update.-->
            <pressureWasherConsumerConfiguration>
                <consumer fillUnitIndex="1" usagePerMin="0.83" fillType="diesel" />
                <consumer fillUnitIndex="2" usagePerMin="27.4" fillType="water" />
            </pressureWasherConsumerConfiguration>
        </pressureWasherConsumerConfigurations>

        <!-- Need a fast 'turnOffSpeedScale' so that the on / off switch is rotated instantly. -->
        <turnedAnimation name="turnOnWasher" turnOffSpeedScale="-100"/>

        <exhaustEffect node="exhaustNode" scale="0.1" color="0.0384 0.0359 0.0627 2.0"/>

        <dashboards>
            <dashboard displayType="ANIMATION" valueType="waterPressure" animName="waterPressureNeedle" />

            <dashboard displayType="NUMBER"    valueType="waterFlowRate" numbers="numbersWaterFlowRate" numberColor="KAERCHER_YELLOW2" precision="3" groups="PRESSURE_WASHER_RUNNING" />
            <dashboard displayType="NUMBER"    valueType="waterPressure" numbers="numbersWaterPressure" numberColor="KAERCHER_YELLOW2" precision="0" groups="PRESSURE_WASHER_RUNNING" />
            <dashboard displayType="NUMBER"    valueType="operatingTime" numbers="numbersWorkingHours"  numberColor="KAERCHER_YELLOW2" precision="1" groups="PRESSURE_WASHER_RUNNING" />
            <dashboard displayType="NUMBER"    valueType="time"          numbers="numbersTime"          numberColor="1 1 1 1"          precision="2" groups="PRESSURE_WASHER_RUNNING" />
        </dashboards>

        <sounds>
            <start linkNode="pressureWasher_main_component1" file="$data/sounds/vehicles/engine/kramer_kl35_8t/kramer_kl35_8t_start.wav" innerRadius="5.0" outerRadius="30.0" >
                <volume indoor="0.35" outdoor="0.85" />
                <pitch indoor="1.00" outdoor="1.00" />
                <lowpassGain indoor="0.2" outdoor="1.00" />
            </start>
            <stop linkNode="pressureWasher_main_component1" file="$data/sounds/vehicles/engine/kramer_kl35_8t/kramer_kl35_8t_stop.wav"  innerRadius="5.0" outerRadius="30.0" >
                <volume indoor="0.35" outdoor="0.85" />
                <pitch indoor="0.95" outdoor="0.95" />
                <lowpassGain indoor="0.2" outdoor="1.00" />
            </stop>
            <idle linkNode="pressureWasher_main_component1" file="$data/sounds/vehicles/engine/kramer_kl35_8t/kramer_kl35_8t_idle_loop.wav" innerRadius="5.0" outerRadius="30.0" fadeOut="0.1">
                <volume indoor="0.35" outdoor="0.85" />
                <pitch indoor="1.00" outdoor="1.00" />
                <lowpassGain indoor="0.2" outdoor="1.00" />
            </idle>
            <work linkNode="pressureWasher_main_component1" file="$data/sounds/tools/pressure_wash/pressure_washer_run_loop_01.wav" innerRadius="5.0" outerRadius="30.0" fadeOut="0.1">
                <volume indoor="0.1" outdoor="0.55" />
                <pitch indoor="1.00" outdoor="1.00" />
                <lowpassGain indoor="0.5" outdoor="1.00" />
            </work>
        </sounds>
    </pressureWasher>

    <fillUnit>
        <fillUnitConfigurations>
            <fillUnitConfiguration>
                <fillUnits>
                    <fillUnit unit="$l10n_unit_literShort" fillTypes="diesel" capacity="140" showInShop="true">
                        <dashboard displayType="ANIMATION" valueType="fillLevel" animName="loadingBarFuel" />
                        <dashboard displayType="EMITTER"   valueType="fillLevelWarning" node="iconFuel" baseColor="GREY" emitColor="RED" warningThresholdMax="21" />
                    </fillUnit>

                    <fillUnit unit="$l10n_unit_literShort" fillTypes="water" capacity="1000" showInShop="true">
                        <dashboard displayType="ANIMATION" valueType="fillLevel" animName="loadingBarWater" />
                        <dashboard displayType="EMITTER"   valueType="fillLevelWarning" node="iconWater" baseColor="GREY" emitColor="RED" warningThresholdMax="150"/>
                    </fillUnit>
                </fillUnits>
            </fillUnitConfiguration>
        </fillUnitConfigurations>
    </fillUnit>

    <waterTrailer fillUnitIndex="2" fillLitersPerSecond="50" fillNode="pressureWasher_main_component1">
        <sounds>
            <refill template="DEFAULT_REFUEL_SOUND" linkNode="pressureWasher_main_component1" />
        </sounds>
    </waterTrailer>

    <dashboard>
        <!-- Because of the start up screen, add extra start time time so warning light is shown 2 sec after actual start. -->
        <groups pressureWasherExtendedStartTime="2.0">
            <group name="PRESSURE_WASHER_STARTING"        isPressureWasherStarting="true" />
            <group name="PRESSURE_WASHER_RUNNING"         isPressureWasherRunning="true" />
            <group name="PRESSURE_WASHER_EXTENDED_START"  isPressureWasherExtendedStart="true" />
        </groups>

        <default>
            <dashboard displayType="VISIBILITY" node="screenStartUp" groups="PRESSURE_WASHER_STARTING" />
            <dashboard displayType="VISIBILITY" node="screenRunning" groups="PRESSURE_WASHER_RUNNING" />

            <dashboard displayType="EMITTER" node="iconWarning" baseColor="GREY" emitColor="RED"              groups="PRESSURE_WASHER_EXTENDED_START" />
            <dashboard displayType="EMITTER" node="iconHeater"  baseColor="GREY" emitColor="KAERCHER_YELLOW2" groups="PRESSURE_WASHER_RUNNING" />
        </default>
    </dashboard>

    <foliageBending>
        <bendingNode minX="-0.95" maxX="0.95" minZ="-1.2" maxZ="2.0" yOffset="0.4" />
    </foliageBending>

    <baseMaterial>
        <material name="trailer_mat" baseNode="pressureWasherTrailer_vis">
            <shaderParameter name="colorMat0" value="KAERCHER_GREY3"/>
            <shaderParameter name="colorMat1" value="KAERCHER_GREY4"/>
        </material>

        <material name="extras_mat" baseNode="extraParts">
            <shaderParameter name="colorMat0" value="KAERCHER_YELLOW2"/>
            <shaderParameter name="colorMat1" value="KAERCHER_RED"/>
            <shaderParameter name="colorMat2" value="KROEGER_YELLOW1" material="8"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90"  workMultiplier="2" fieldMultiplier="2" washDuration="1"/>

    <i3dMappings>
        <i3dMapping id="pressureWasher_main_component1" node="0>" />
        <i3dMapping id="pressureWasherTrailer_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="supportArm" node="0>0|0|1|0" />
        <i3dMapping id="supportArmPart" node="0>0|0|1|0|0" />
        <i3dMapping id="supportCol" node="0>0|0|1|1" />
        <i3dMapping id="electricBack" node="0>0|0|3" />
        <i3dMapping id="electricBackAdapter" node="0>0|0|4" />
        <i3dMapping id="wheelLeft" node="0>0|1|0" />
        <i3dMapping id="wheelRight" node="0>0|1|1" />
        <i3dMapping id="rearLightLeft" node="0>0|2|0|0" />
        <i3dMapping id="rearLightRight" node="0>0|2|0|1" />
        <i3dMapping id="yellowRound01" node="0>0|2|1|0" />
        <i3dMapping id="yellowRound02" node="0>0|2|1|1" />
        <i3dMapping id="yellowRound03" node="0>0|2|1|2" />
        <i3dMapping id="yellowRound04" node="0>0|2|1|3" />
        <i3dMapping id="backLightsHigh" node="0>0|2|2" />
        <i3dMapping id="turnLightLeftBack" node="0>0|2|3" />
        <i3dMapping id="turnLightRightBack" node="0>0|2|4" />
        <i3dMapping id="reverseLight" node="0>0|2|5" />
        <i3dMapping id="exhaustNode" node="0>0|3" />
        <i3dMapping id="screenStartUp" node="0>0|4|2|1" />
        <i3dMapping id="screenRunning" node="0>0|4|2|2" />
        <i3dMapping id="numbersTime" node="0>0|4|2|2|0|0" />
        <i3dMapping id="numbersWorkingHours" node="0>0|4|2|2|0|1" />
        <i3dMapping id="numbersWaterPressure" node="0>0|4|2|2|0|2" />
        <i3dMapping id="numbersWaterFlowRate" node="0>0|4|2|2|0|3" />
        <i3dMapping id="fillLevelBarWater" node="0>0|4|2|2|0|4" />
        <i3dMapping id="fillLevelBarFuel" node="0>0|4|2|2|0|5" />
        <i3dMapping id="iconFuel" node="0>0|4|2|2|0|6" />
        <i3dMapping id="iconHeater" node="0>0|4|2|2|0|7" />
        <i3dMapping id="iconWarning" node="0>0|4|2|2|0|8" />
        <i3dMapping id="iconWater" node="0>0|4|2|2|0|9" />
        <i3dMapping id="pressureNeedle" node="0>0|4|2|3" />
        <i3dMapping id="modeSwitch" node="0>0|4|2|4" />
        <i3dMapping id="extraParts" node="0>0|4|2" />
        <i3dMapping id="visibilityParts" node="0>0|4|3" />
        <i3dMapping id="lanceNode" node="0>0|4|3|0" />
        <i3dMapping id="extraHoseRight" node="0>0|4|3|2" />
        <i3dMapping id="extraHoseLeft" node="0>0|4|3|3" />
        <i3dMapping id="extraHoseHooks" node="0>0|4|4" />
        <i3dMapping id="interactionTrigger" node="0>0|5" />
        <i3dMapping id="hoseConnectionPoint" node="0>0|6" />
    </i3dMappings>
</vehicle>
