class braf_m41_base : Tank_F {
    author = "BRAF Team";
    displayName = "Cadillac M41A";
    model = "\braf\braf_tracked\m41\braf_m41a.p3d";
    scope = 0;
    picture = "\braf\braf_tracked\m41\ui\picture_m41_ca.paa";
    Icon = "\braf\braf_tracked\m41\ui\icon_m41_ca.paa";
    mapSize = 9;
    accuracy = 0.19;
    precision = 5;
    cost = 1600000;
    threat[] = { 1, 1, 0.3 };
    extCameraPosition[] = { 0, 2.25, -11 };
    waterPPInVehicle = 0;
    driverOpticsModel = "a3\weapons_f\reticle\optics_driver_01_f";
    class Library {
        libTextDesc = "The M41 was an American light tank developed for armed reconnaissance purposes. It was produced by Cadillac between 1951 and 1954 and marketed successfully to the United States Army as a replacement for its aging fleet of World War II vintage M24 Chaffee tanks. Cadillac ceased production of the M41A1 in late 1954. It was replaced by the M551 Sheridan during the 1960s.";
    };
    driverForceOptics = 1;
    driverAction = "driver_apcwheeled2_out";
    driverInAction = "driver_apcwheeled2_in";
    hideWeaponsDriver = 1;
    weapons[] =	{"TruckHorn"};
    forceHideGunner = 0;
    transportSoldier = 0;
    class TransportMagazines {
    };
    transportAmmo = 0;
    supplyRadius = 1.7;
    enableGPS = 0;
    incomingMissileDetectionSystem = 0;
    armor = 300;
    armorLights = 0.1;
    armorStructural = 4;
    damageResistance = 0.00386;
    crewExplosionProtection = 0.9999;
    crewVulnerable = 0;
    epeImpulseDamageCoef = 18;
    destrType = "DestructDefault"; //this adds collisions to the wreck without requiring a dedicated wreck proxy
    //Physx
    #include "PhysX.hpp"
    //Sounds
    #include "Sounds.hpp"
    //Smoke Dispensers
    smokeLauncherGrenadeCount = 8;
    smokeLauncherVelocity = 14;
    smokeLauncherOnTurret = 1;
    smokeLauncherAngle = 120;
    //Turrets
    class CargoTurret;
    class Turrets : Turrets {
        class MainTurret : MainTurret {
            memoryPointGun[] = { "kulas" };
            gunBeg = "Usti hlavne";
            gunEnd = "Konec hlavne";
            body = "mainturret";
            gun = "maingun";
            gunnerAction = "Commander_MBT_02_cannon_F_out";
            gunnerInAction = "gunner_apctracked3_in";
            isPersonTurret = 1;
            personTurretAction = "vehicle_turnout_2";
            minOutElev = -20;
            maxOutElev = 40;
            initOutElev = 0;
            minOutTurn = -95;
            maxOutTurn = 95;
            initOutTurn = 0;
            gunnerGetInAction = "GetInLow";
            gunnerGetOutAction = "GetOutLow";
            stabilizedInAxes = 0;
            //Placeholder, trocar para as armas do M41A
            weapons[] = {
                "BRAF_76mm_M41A",
                "BRAF_M1919A4_M41A"
            };
            magazines[] = {
                "BRAF_11Rnd_76mm_HEAT",
                "BRAF_11Rnd_76mm_HEAT",
                "BRAF_11Rnd_76mm_HE",
                "BRAF_11Rnd_76mm_APFSDS",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red"
            };
            soundServo[] = { "A3\Sounds_F\vehicles\armor\noises\servo_armor_gunner", 0.56234133, 1, 50 };
            soundServoVertical[] = { "A3\Sounds_F\vehicles\armor\noises\servo_armor_gunner_vertical", 0.56234133, 1, 50 };
            forceHideGunner = 0;
            inGunnerMayFire = 1; // set to 0 to let gunner look around the internal compartment if modeled
            //viewGunnerInExternal = 1; // Needed to make gunner possible to be killed with penetrating rounds.
            memoryPointGunnerOptics = "gunnerview";
            minElev = -10;
            maxElev = 20;
            initElev = 10;
            maxHorizontalRotSpeed = 0.8;
            maxVerticalRotSpeed = 0.8;
            gunnerOutOpticsModel = "";
            gunnerOutOpticsEffect[] = {};
            gunnerOpticsModel = "\braf\braf_tracked\BRAF_Tracked_Optics\M41\braf_m41_gunner_optics_w.p3d";
            gunnerOpticsEffect[] = { "TankGunnerOptics1", "OpticsBlur2", "OpticsCHAbera2" };
            gunnerForceOptics = 1;
            /*class OpticsIn : braf_m41_gunner_optics {
            };*/
            class OpticsIn {
                class Wide //3x
                {
                    initAngleX = 0;
                    minAngleX = -30;
                    maxAngleX = +30;
                    initAngleY = 0;
                    minAngleY = -100;
                    maxAngleY = +100;
                    initFov = 0.155;
                    minFov = 0.155;
                    maxFov = 0.155;
                    visionMode[] = { "Normal" };
                    gunnerOpticsModel = "\braf\braf_tracked\BRAF_Tracked_Optics\M41\braf_m41_gunner_optics_w.p3d";
                    gunnerOpticsEffect[] = {};
                };
                class Narrow : Wide //10x
                {
                    gunnerOpticsModel = "\braf\braf_tracked\BRAF_Tracked_Optics\M41\braf_m41_gunner_optics_m.p3d";
                    initFov = 0.047;
                    minFov = 0.047;
                    maxFov = 0.047;
                };
            };
            //turretInfoType = "RscWeaponRangeZeroing";
            discreteDistance[] = { 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000 };
            discreteDistanceInitIndex = 5;
            showCrewAim = 2;
            class HitPoints {
                class HitTurret {
                    armor = 0.3;
                    material = -1;
                    armorComponent = "hit_main_turret";
                    name = "hit_main_turret_point";
                    visual = "main_turret";
                    passThrough = 0;
                    minimalHit = 0.1;
                    explosionShielding = 0.2;
                    radius = 0.25;
                    isTurret = 1;
                };
                class HitGun {
                    armor = 0.6;
                    material = -1;
                    armorComponent = "hit_main_gun";
                    name = "hit_main_gun_point";
                    visual = "main_gun";
                    passThrough = 0;
                    minimalHit = 0.1;
                    explosionShielding = 0.4;
                    radius = 0.2;
                    isGun = 1;
                };
            };
            class Turrets : Turrets {
                class CommanderOptics : CommanderOptics {
                    memoryPointGunnerOutOptics = "";
                    memoryPointGunnerOptics = "commander_view";
                    gunBeg = "";
                    gunEnd = "";
                    memoryPointGun = "commander_view";
                    body = "commander_turret";
                    gun = "commander_gun";
                    minElev = -15;
                    maxElev = 60;
                    initElev = 0;
                    minTurn = -45;
                    maxTurn = 45;
                    initTurn = 0;
                    weapons[] = { "SmokeLauncher" };
                    magazines[] = { "SmokeLauncherMag" };
                    soundServo[] = { "A3\Sounds_F\vehicles\armor\noises\servo_armor_comm", 1.0, 1, 30 };
                    soundServoVertical[] = { "A3\Sounds_F\vehicles\armor\noises\servo_armor_comm", 1.0, 1, 30 };
                    outGunnerMayFire = 0;
                    inGunnerMayFire = 1;
                    gunnerAction = "commander_apctracked3_out";
                    gunnerInAction = "commander_apctracked3_in";
                    gunnerGetInAction = "GetInLow";
                    gunnerGetOutAction = "GetOutLow";
                    gunnerOpticsModel = "a3\weapons_f\reticle\optics_driver_01_f";
                    gunnerOutOpticsModel = "";
                    gunnerOpticsEffect[] = {};
                    isPersonTurret = 1;
                    personTurretAction = "vehicle_turnout_1";
                    minOutElev = -20;
                    maxOutElev = 40;
                    initOutElev = 0;
                    minOutTurn = -95;
                    maxOutTurn = 95;
                    initOutTurn = 0;
                    class ViewGunner : ViewCargo {
                    };
                    class ViewOptics : ViewOptics {
                        initAngleX = 0;
                        minAngleX = -30;
                        maxAngleX = 30;
                        initAngleY = 0;
                        minAngleY = -100;
                        maxAngleY = 100;
                        initFov = 0.31;
                        minFov = 0.034;
                        maxFov = 0.31;
                        visionMode[] = { "Normal", "NVG" };
                    };
                    turretInfoType = "RscWeaponZeroing";
                    discreteDistance[] = { 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500 };
                    discreteDistanceInitIndex = 2;
                    showCrewAim = 1;
                    startEngine = 0;
                    gunnerHasFlares = 1;
                    stabilizedInAxes = 3;
                    maxHorizontalRotSpeed = 1;
                    maxVerticalRotSpeed = 1;
                    //viewGunnerInExternal = 1;
                    class HitPoints {
                        class HitComTurret {
                            armor = 0.1;
                            material = -1;
                            armorComponent = "hit_com_turret";
                            name = "hit_com_turret_point";
                            visual = "commander_turret";
                            passThrough = 0;
                            minimalHit = 0.1;
                            explosionShielding = 1;
                            radius = 0.15;
                            isTurret = 1;
                        };
                        class HitComGun {
                            armor = 0.1;
                            material = -1;
                            armorComponent = "hit_com_gun";
                            name = "hit_com_gun_point";
                            visual = "commander_gun";
                            passThrough = 0;
                            minimalHit = 0.1;
                            explosionShielding = 1;
                            radius = 0.15;
                            isGun = 1;
                        };
                    };
                };
            };
        };
    };
    hiddenSelections[] = {
        "camo1", "camo2", "camo3",

    };
    hiddenSelectionsTextures[] = {
        "\braf\braf_tracked\m41\data\main_CO.paa",
        "\braf\braf_tracked\m41\data\large_CO.paa",
        "\braf\braf_tracked\m41\data\small_CO.paa",
    };

    //Damage materials
    class Damage {
        tex[] = {};
        mat[] = {
            "\braf\braf_tracked\m41\data\main.rvmat",
            "\braf\braf_tracked\m41\data\main_damage.rvmat",
            "\braf\braf_tracked\m41\data\main_destruct.rvmat",

            "\braf\braf_tracked\m41\data\large.rvmat",
            "\braf\braf_tracked\m41\data\large_damage.rvmat",
            "\braf\braf_tracked\m41\data\large_destruct.rvmat",

            "\braf\braf_tracked\m41\data\small.rvmat",
            "\braf\braf_tracked\m41\data\small_damage.rvmat",
            "\braf\braf_tracked\m41\data\small_destruct.rvmat",

            "\braf\braf_tracked\m41\data\track.rvmat",
            "\braf\braf_tracked\m41\data\track_damage.rvmat",
            "\braf\braf_tracked\m41\data\track_destruct.rvmat",
        };
    };

    class textureSources {
        class ebmodern {
            displayName = "Brazilian Army (Modern)";
            textures[] = {
                "\braf\braf_tracked\m41\data\main_CO.paa",
                "\braf\braf_tracked\m41\data\large_CO.paa",
                "\braf\braf_tracked\m41\data\small_CO.paa",
            };
            factions[] = {};
        };
        class ebold {
            displayName = "Brazilian Army (Old)";
            textures[] = {
                "\braf\braf_tracked\m41\data\old\main_CO.paa",
                "\braf\braf_tracked\m41\data\old\large_CO.paa",
                "\braf\braf_tracked\m41\data\old\small_CO.paa",
            };
            factions[] = {};
        };
    };

    //Hitpoints
    class Hitpoints : Hitpoints {
        class HitHull : HitHull { // Handle internal damage
            armor = 1.6;
            material = -1;
            armorComponent = "hit_hull";
            name = "hit_hull_point";
            visual = "zbytek";
            passThrough = 1; // -Alw- was ?? 0;
            minimalHit = 0.3;
            explosionShielding = 0.009;
            radius = 0.25;
        };
        class HitLTrack : HitLTrack {
            armor = 0.3;
            material = -1;
            armorComponent = "hit_trackL";
            name = "hit_trackL_point";
            visual = "-";
            passThrough = 0;
            minimalHit = 0.15;
            explosionShielding = 0.4;
            radius = 0.2;
        };
        class HitRTrack : HitRTrack {
            armor = 0.3;
            material = -1;
            armorComponent = "hit_trackR";
            name = "hit_trackR_point";
            visual = "-";
            passThrough = 0;
            minimalHit = 0.15;
            explosionShielding = 0.4;
            radius = 0.2;
        };
        class HitFuel : HitFuel {
            armor = 0.5;
            material = -1;
            armorComponent = "hit_fuel";
            name = "hit_fuel_point";
            visual = "-";
            passThrough = 0.1;
            minimalHit = 0.1;
            explosionShielding = 0.6;
            radius = 0.3;
        };
        class HitEngine : HitEngine {
            armor = -15;
            material = -1;
            armorComponent = "hit_engine";
            name = "hit_engine_point";
            visual = "-";
            passThrough = 0.2;
            minimalHit = 0.1;
            explosionShielding = 0.2;
            radius = 0.3;
        };
    };

    //Fancy visual stuff
    class Exhausts {
        class Exhaust1 {
            position = "exhaust_1_pos";
            direction = "exhaust_1_dir";
            effect = "ExhaustEffectTankBack";
        };
        class Exhaust2 {
            position = "exhaust_2_pos";
            direction = "exhaust_2_dir";
            effect = "ExhaustEffectTankBack";
        };
    };

    class Reflectors {
        class Left {
            color[] = { 1900, 1300, 950 };
            ambient[] = { 5, 5, 5 };
            position = "L svetlo";
            direction = "Konec L svetla";
            hitpoint = "L svetlo";
            selection = "L svetlo";
            size = 1;
            innerAngle = 100;
            outerAngle = 179;
            coneFadeCoef = 10;
            intensity = 1; //17.5
            useFlare = 0;
            dayLight = 0;
            flareSize = 1.0;
            class Attenuation {
                start = 1.0;
                constant = 0;
                linear = 0;
                quadratic = 0.25;
                hardLimitStart = 30;
                hardLimitEnd = 60;
            };
        };
        class Right : Left {
            position = "P svetlo";
            direction = "konec P svetla";
            hitpoint = "P svetlo";
            selection = "P svetlo";
        };
    };
    aggregateReflectors[] = {};

    memoryPointTrack1L = "Stopa ll";
    memoryPointTrack1R = "Stopa lr";
    memoryPointTrack2L = "Stopa rl";
    memoryPointTrack2R = "Stopa rr";

    dustFrontLeftPos = "dustFrontLeft";
    dustFrontRightPos = "dustFrontRight";
    dustBackLeftPos = "dustBackLeft";
    dustBackRightPos = "dustBackRight";

    //AnimationSources
    animationSourceHatch = "hatchDriver";
    class AnimationSources : AnimationSources {
        class recoil_source {
            source = "reload";
            weapon = "BRAF_90MM_M41C";
        };
        class muzzle_rot_coax {
            source = "ammorandom";
            weapon = "BRAF_M1919A4_M41A";
        };
    };
    class VehicleTransport {
        class Cargo {
            parachuteClass = B_Parachute_02_F; // Type of parachute used when dropped in air. When empty then parachute is not used.
            parachuteHeightLimit = 40; // Minimal height above terrain when parachute is used.
            canBeTransported = 1; // 0 (false) / 1 (true)
            dimensions[] = { "BBox_1_1_pos", "BBox_1_2_pos" }; // Memory-point-based override of automatic bounding box
        };
    };
};

//Versões do EB, são puxadas pelo factions
class braf_army_m41a : braf_m41_base {
    editorPreview = "braf\braf_tracked\m41\preview\cwr3_i_m41a1.jpg";
    faction = "braf_army";
    scope = 2;
    scopeCurator = 2;
    side = 2;
    crew = "braf_army_crewman_regular_2000";
    typicalCargo[] = { "braf_army_crewman_regular_2000", "braf_army_crewman_regular_2000", "braf_army_crewman_regular_2000" };
    hiddenSelectionsTextures[] = {
        "\braf\braf_tracked\m41\data\old\main_CO.paa",
        "\braf\braf_tracked\m41\data\old\large_CO.paa",
        "\braf\braf_tracked\m41\data\old\small_CO.paa",
    };
    class TransportBackpacks {
    };
    class TransportItems {
        class _xx_FirstAidKit {
            count = 4;
            name = "FirstAidKit";
        };
        class _xx_Toolkit {
            count = 1;
            name = "Toolkit";
        };
    };
    class TransportWeapons {
    };
    class TransportMagazines {
    };
};

//class BRAF_Cascavel_Gunner_Optics;
class braf_army_m41c : braf_m41_base {
    editorPreview = "braf\braf_tracked\m41\preview\cwr3_i_m41a1.jpg";
    displayName = "Bernardini M41C";
    model = "\braf\braf_tracked\m41\braf_m41c.p3d";
    faction = "braf_army";
    scope = 2;
    scopeCurator = 2;
    side = 2;
    crew = "braf_army_crewman_regular_2000";
    typicalCargo[] = { "braf_army_crewman_regular_2000", "braf_army_crewman_regular_2000", "braf_army_crewman_regular_2000" };

    class Library {
        libTextDesc = "M41 modernized by Bernardini S/A Industria e Comercio for the Brazilian Army. Fitted with a new Saab-Scania DS-14A 04 eight-cylinder diesel engine.";
    };
    class Turrets : Turrets {
        class MainTurret : MainTurret {
            weapons[] = {
                "BRAF_90MM_M41C",
                "BRAF_MAG_VEH"
            };
            magazines[] = {
                "BRAF_11Rnd_90mm_HEAT_MP",
                "BRAF_11Rnd_90mm_HEAT_MP",
                "BRAF_11Rnd_90mm_HE_shells",
                "BRAF_11Rnd_90mm_HE_shells",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red",
                "BRAF_200Rnd_762x51_Mix_red"
            };
            turretInfoType = "RscWeaponRangeZeroing";
            gunnerOpticsModel = "\braf\braf_armored\BRAF_Optics_Armored\Cascavel\BRAF_optics_gunner_w.p3d";
            class OpticsIn {
                class Wide //3x
                {
                    initAngleX = 0;
                    minAngleX = -30;
                    maxAngleX = +30;
                    initAngleY = 0;
                    minAngleY = -100;
                    maxAngleY = +100;
                    initFov = 0.155;
                    minFov = 0.155;
                    maxFov = 0.155;
                    visionMode[] = { "Normal" };
                    gunnerOpticsModel = "\braf\braf_armored\BRAF_Optics_Armored\Cascavel\BRAF_optics_gunner_w.p3d";
                    gunnerOpticsEffect[] = { "TankGunnerOptics1", "OpticsBlur2", "OpticsCHAbera2" };
                };
                class Narrow : Wide //10x
                {
                    gunnerOpticsModel = "\braf\braf_armored\BRAF_Optics_Armored\Cascavel\BRAF_optics_gunner_w.p3d";
                    initFov = 0.047;
                    minFov = 0.047;
                    maxFov = 0.047;
                };
            };
        };
    };
    class TransportBackpacks {
    };
    class TransportItems {
        class _xx_FirstAidKit {
            count = 4;
            name = "FirstAidKit";
        };
        class _xx_Toolkit {
            count = 1;
            name = "Toolkit";
        };
    };
    class TransportWeapons {
    };
    class TransportMagazines {
    };
};