;SDL
actor

(include "vehicle.ext")
(include "car_crew.ext")

("brain_vehicle")

(define "accuracy_by_motion" ;  spreading depending on the speed of "body", "gun" volumes
    {AccuracyByMotion
        {MaxLinearSpeed %max_linear}               ;km/h
        {ByLinearSpeed %accuracy_by_linear}
        {MaxAngularSpeed %max_angular}             ;deg/s
        {ByAngularSpeed %accuracy_by_angular}
        {DisorderTime %disorder_time}              ;s
        {OrderTime %order_time}                    ;s
    }
)
(define "abm_18"
    ("accuracy_by_motion"
        max_linear(18) accuracy_by_linear(0.2)
        max_angular(4) accuracy_by_angular(0.6)
        disorder_time(1.6) order_time(1.5)
    )
)
(define "abm_zenite"
    ("accuracy_by_motion"
        max_linear(10) accuracy_by_linear(0.2)
        max_angular(4) accuracy_by_angular(0.8)
        disorder_time(1.2) order_time(1.4)
    )
)

(define "abm_mgun"
	("accuracy_by_motion"
		max_linear(18) accuracy_by_linear(0.3)
		max_angular(4) accuracy_by_angular(0.8)
		disorder_time(1.2) order_time(2)
	)
)

(define "abm_mgun_heavy"
	("accuracy_by_motion"
		max_linear(18) accuracy_by_linear(0.5)
		max_angular(4) accuracy_by_angular(0.9)
		disorder_time(1.2) order_time(2)
	)
)


{hearingBias 4.5} ; in meters
{sensor
    {visor "main"
        {bone "visor1"}
    }
    {Visor "driver"
        {vision "tank_driver"}
        {bone "visor2"}
    }
        (mod "mp"
            {visor "view-around"
                {vision "tank_around-l"}
                {bone "visor2"}
            }
        )
}

{PatherID  "armored"}
{collider "armored"}
{props "emit_on_sink" "armored_car" "tractor"}
{targetClass "armoredcar" "bullet"}
{targetSelector "tank_bullet"}

{extender "inventory"
    {box
        {Size 6 10}
        {weight 10000}
        (mod "mp"
                {item "repair_kit"}
                {item "can"}
        )
    }
}

{extender "talk"
    {talker "tank"}
}
{able "talk"}

{volume "body"
    {thickness 4}
}
{volume "engine"
    {thickness 15}
}
{volume "inventory"
    {tags "explosive"}
    {thickness 2}
}
{volume "crew"
    {thickness 1}
}
{volume "turret"
    {component "turret"}
    {tags "turret"}
}



{component "body"
    {RepairTime 120}
    {tags "mover" "noDestroyedView"}
}
{component "engine"
    {RepairTime 15}
}

{Chassis "wheel"
    ("chassis_defaults")
    {speed
        {Slow   15 }    ; km/h
        {Normal 25}
        {Fast   25  }
    }
}

(define "locomotion"
    {MaxSpeed   25  }       ; максимальная скорость, kmph
    {StartTime  15  }       ; время разгона до макс. скорости с 0, seconds
    {maxSpeedAtMaxTurn 15}
    {BrakeTime  2   }       ; время торможения с макс. скорости до 0, seconds
    {StopTime   4   }       ; время остановки после отключения двигателя с макс. скорости до 0, seconds
    {TurnRadius 8   }       ; мин. радиус разворота, meter
    {Gears      0.1 0.5 0.8 1.0} ; передаточные коэф-ты коробки передач
    {RearGears  0.35}       ; передаточные коэф-ты коробки передач
    {SteerOn    20}         ; скорость поворота колес, градусов в секунду
    {SteerOff   40}         ; скорость возврата колес в исх. состояние, градусов в секунду
    {SplineRadius 3}        ; ограничение радиуса поворота на сплайнах, метров
)

(define "armor_btr"
    {armor
        {setting "track"
;           {max (* %t %k)}
;           {max_absorb %ta}
            {volumes "track*"}
        }
        {setting "wheel"
;           {max (* %w %k)}
            {thickness 5}
            {threshold
                {blast
                    {value 10}
                }
                {pierce
                    {value 1}
                }
            }
            {durability
                {blast
                    {value 10}
                }
                {pierce
                    {value 12}
                }
            }
            {whole_wound}
            {volumes "wheel*"}
        }
        {setting "gun"
            {durability
                            {blast  {koef 2}}
                {pierce {koef 10}}
                        }
                        {threshold
                            {blast {value 15}}
                            {pierce {value 16}}
                        }
            {volumes "gun*"}
        }
        {setting "body"
            {threshold
                {blast
                    {value 6}
                }
                {pierce
                    {value 8}
                }
            }
            {durability
                (mod "mp" {pierce  {koef 200}})
                {blast
                    {value 20}
                }
            }
            {volumes "body*"}
        }
                {setting "turret"
            {threshold
                {blast
                    {value 6}
                }
                {pierce
                    {value 6}
                }
            }
            {durability
                (mod "mp" {pierce  {koef 200}})
                {blast
                    {value 20}
                }
            }
            {volumes "turret"}
        }
        {setting "engine"
            {threshold
                {blast
                    {value 6}
                }
                {pierce
                    {koef 20}
                }
                        }
            {durability
                {blast
                    {value 20}
                }
            }
            {volumes "engine*"}
        }
        {setting "other"
            {thickness 0.1}
            {durability
                {pierce
                    {koef 999}
                }
            }
        }
    }
)

(define "armor_light"
    ("armor_btr" t(14) ta(8) b(30) w(30) k(%0))
)

(define "armor_medium"
    ("armor_btr" t(22) ta(10) b(60) w(60) k(%0))
)

(define "restore_ik_time"
    {RestoreIKTime 10}
)
