this.length = 2;
this.frontOffset = 3.5;
this.rearOffset = 3.5;
this.frontAnchor = 1.5;
this.rearAnchor = 2.5;

this.displayName = MAIN.$strings.$vehicle_bus02;
this.capacity = 24;

this.acceleration = 1.3;
this.braking = 0.25;
this.speed = 0.75;
this.turning = 0.8;
//this.tilting = 0.3;

$objectinfoPattern = MAIN.$strings.$objectinfo_timesLastMonth_pattern;
$objectinfoText = MAIN.$strings.$objectinfo_bus;
$objectinfoRange = [2, 13];

this.addPath("doorR0-enter", GRID_PATH_END, vector(2.0, 0.4, -0.83), QUAT_IDENT, vector(-0.5, 0.4, -0.83), QUAT_IDENT);
this.addPath("doorR1-exit", GRID_PATH_START, vector(-0.5, 0.4, -0.83), QUAT_IDENT, vector(2.0, 0.4, -0.83), QUAT_IDENT);

with (this.loadSkeleton("bus02_scene.skeleton")) {
  .loadAnimation("default", "bus02_anim.animation", 0);
}

this.doorOpenStart = 0.0;
this.doorOpenLen = 1.0;
this.doorCloseStart = 35.0 / 30.0;
this.doorCloseLen = 1.0;

$price = 60000;
$icon = MAIN.$window.video.new_texture("/metro/objects/vehicles/bus-02/bus02-icon.dds");
$rendering = "metro/objects/vehicles/bus-02/bus02-render.dds";
$reliability = 0.70;
$fuelConsumption = 18;
$electricityConsumption = 0;
$attractiveness = 0.55;
$speed = 40;
$type = 0;
$infoText = MAIN.$strings.$vehicle_bus02_info;

with (this.doorOpenSound = new_sound(this)) {
  .load("/metro/sounds/4. Bus door opening1 (hiss clank short).wav");
  .volume = 1.0;
  .minDistance = 50.0;
  .maxDistance = 300.0;
}

with (this.doorCloseSound = new_sound(this)) {
  .load("/metro/sounds/4. Bus door closing2 (short)  .wav");
  .volume = 1.0;
  .minDistance = 50.0;
  .maxDistance = 300.0;
}

with (this.engineSound = new_sound(this)) {
  .load("/metro/sounds/Bus engine run 01 (old2) (pitch).wav");
  .volume = 0.25;
  .minDistance = 50.0;
  .maxDistance = 300.0;
}

with (this.hornSound = new_sound(this)) {
  .load("/metro/sounds/Bus horn 01 (old2).wav");
  .volume = 1.0;
  .minDistance = 50.0;
  .maxDistance = 300.0;
}

with ($brokenEffect = new_particleEmitter(this)) {
  .direction = vector(0.0, 1.0, 0.0);
  .minParticleSpeed = 2.0;
  .maxParticleSpeed = 3.0;
  .minParticleAngle = 0.0;
  .maxParticleAngle = 1.0;
  .minParticleLife = 2.0;
  .maxParticleLife = 4.0;
  .maxDistance = 400.0;
  .particleSize = 0.5;
  .setParticleScale(1.0, 0.1, 6.0);
  .particleAirResist = 0.5;
  .gravitation = vector(0.0, 3.0, 0.0);
  .density = 40.0;
  .addColorRange(0x80333333, 0x00333333);
  .setTexture("effects/particles/lightsmoke.dds");
  .conditions = GRIDVEHICLE_BROKEN;
  .sortParticles = true;
  .autoemit = true;
  .visible = true;
}

event this.onLoaded::() {
  $brokenEffect.position = vector(0.0, 0.5, -3.0);
}

