#include "CfgMagazines.hpp"
#include "basicdefines_A3.hpp"

class CfgPatches
{
    class AMF_PERSEIS_II_POLY
    {
        units[] = {};
        weapons[] =
            {
                "AMF_Perseis_II_02_F"};
        requiredVersion = 0.1;
        requiredAddons[] =
            {
                "A3_Weapons_F",
                "cba_main",
                "A3_Anims_F"};
    };
};

class Extended_PreInit_EventHandlers
{
    bg_wepframework_init = "call ('\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\XEH_INIT.sqf' call SLX_XEH_COMPILE)";
};

class Extended_FiredBIS_Eventhandlers
{
    class CAManBase
    {
        bg_wepframe_fired = "_this call bg_wepframe_fired_eh";
    };
};

class CfgSounds
{
    class AMF_Perseis_II_BOLT_SOUND
    {
        name = "AMF_Perseis_II_BOLT_SOUND";
        Sound[] = {"\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\data\sounds\AMF_Perseis_II_Rechamber.wss", 1, 1, 15};
        titles[] = {};
    };
};

class Mode_SemiAuto;
class CowsSlot;

class CfgWeapons
{

    class Rifle_Base_F;
    class Rifle_Long_Base_F : Rifle_Base_F
    {
        class WeaponSlotsInfo;
    };

    class AMF_Perseis_II_02_F : Rifle_Long_Base_F
    {

        ACE_barrelTwist = 381;
        ACE_barrelLength = 700;
        author = "Armada, Krogar & AMF Team";
        scope = 2;
        _generalMacro = "AMF_Perseis_II_02_F";
        model = "\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\AMF_Perseis_II_02_F.p3d";
        displayName = "PGM Hecate II (Polymere)";
        picture = "\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\Data\UI\AMF_PERSEIS_II_ICO.paa";

        deployedPivot = "bipod";                                                                  /// what point should be used to be on surface while unfolded
        hasBipod = true;                                                                          /// bipod obviously has a bipod
        //soundBipodDown[] = {"A3\Sounds_F_Mark\arsenal\sfx\bipods\Bipod_BLU_down", db - 3, 1, 20}; /// what sound should be played during unfolding
        //soundBipodUp[] = {"A3\Sounds_F_Mark\arsenal\sfx\bipods\Bipod_BLU_up", db - 3, 1, 20};     /// what sound should be played during folding

        magazines[] =
            {
                "7Rnd_Perseis_II_mag",
                "7Rnd_Perseis_II_mag_Tracer_yellow",
                "7Rnd_Perseis_II_mag_Tracer_green",
                "7Rnd_Perseis_II_mag_Tracer_red"};
        cursor = "srifle";
        class Library
        {
            libTextDesc = "AMF PGM Hecate II Poly";
        };
        inertia = 1.2;
        dexterity = 1.0;
        reloadAction = "GestureReloadLRR";
        recoil = "recoil_m320";
        maxZeroing = 2400;
        initSpeed = 780;
        descriptionShort = "AMF PGM Hecate II Polymere";

        class WeaponSlotsInfo : WeaponSlotsInfo
        {
            mass = 320;
            class CowsSlot : CowsSlot
            {
            };
        };
        class ItemInfo
        {
            priority = 1;
        };
        class bg_weaponparameters
        {
            class onFired_Action
            {
                HandAction = "AMF_Perseis_II_Gesture_Rechamber";
                Actiondelay = 0.02;
                Sound = "AMF_Perseis_II_BOLT_SOUND";
                Sound_Location = "RightHandMiddle1";
                hasOptic = 0;
            };
        };

        handAnim[] = {"OFP2_ManSkeleton", "\braf\braf_weapons_anim\animations\50cal_PGM_HecateII\Hecate_II_Anim_static.rtm"};

        opticsPPEffects[] = {};
        opticsFlare = 1;
        opticsDisablePeripherialVision = 1;
        class GunParticles
        {
            class FirstEffect
            {
                effectName = "SniperCloud";
                positionName = "Usti hlavne";
                directionName = "Konec hlavne";
            };
        };
        distanceZoomMin = 500;
        distanceZoomMax = 500;
        bullet1[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_01", 0.891251, 1, 25};
        bullet2[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_02", 0.891251, 1, 25};
        bullet3[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_03", 0.891251, 1, 25};
        bullet4[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_04", 0.891251, 1, 25};
        bullet5[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_01", 0.794328, 1, 25};
        bullet6[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_02", 0.794328, 1, 25};
        bullet7[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_03", 0.794328, 1, 25};
        bullet8[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_04", 0.794328, 1, 25};
        bullet9[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_01", 0.707946, 1, 25};
        bullet10[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_02", 0.707946, 1, 25};
        bullet11[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_03", 0.707946, 1, 25};
        bullet12[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_04", 0.707946, 1, 25};
        soundBullet[] = {"bullet1", 0.083, "bullet2", 0.083, "bullet3", 0.083, "bullet4", 0.083, "bullet5", 0.083, "bullet6", 0.083, "bullet7", 0.083, "bullet8", 0.083, "bullet9", 0.083, "bullet10", 0.083, "bullet11", 0.083, "bullet12", 0.083};
        modes[] = {"Single", "single_close_optics1", "single_medium_optics1", "single_far_optics1"};
        drySound[] = {"A3\Sounds_F\arsenal\weapons\LongRangeRifles\M320\M320_dry", 0.501187, 1, 20};
        reloadMagazineSound[] = {"A3\Sounds_F\arsenal\weapons\LongRangeRifles\M320\M320_reload", 1.0, 1, 10};
        soundBipodDeploy[] = {"A3\Sounds_F_Mark\arsenal\sfx\bipods\Bipod_generic_deploy", 0.707946, 1, 20};
        soundBipodFold[] = {"A3\Sounds_F_Mark\arsenal\sfx\bipods\Bipod_generic_fold", 0.707946, 1, 20};

        class Single : Mode_SemiAuto
        {
            sounds[] = {"StandardSound"};
            class BaseSoundModeType
            {
                closure1[] = {"\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\Data\sounds\AMF_Perseis_II.wss", 1.0, 1, 30};
                closure2[] = {"\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\Data\sounds\AMF_Perseis_II.wss", 1.0, 1, 30};
                soundClosure[] = {"closure1", 0.5, "closure2", 0.5};
            };
            class StandardSound : BaseSoundModeType
            {
                begin1[] = {"\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\Data\sounds\AMF_Perseis_II.wss", 3.0118723, 1, 2200};
                begin2[] = {"\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\Data\sounds\AMF_Perseis_II.wss", 3.0118723, 1, 2200};
                begin3[] = {"\braf\braf_weapons_sniper_rifles\50cal_MSR_HecateII\Data\sounds\AMF_Perseis_II.wss", 3.0118723, 1, 2200};
                soundBegin[] = {"begin1", 0.33, "begin2", 0.33, "begin2", 0.34};
                class SoundTails
                {
                    class TailInterior
                    {
                        sound[] = {"A3\Sounds_F_Mark\arsenal\weapons\LongRangeRifles\DMR_02_MAR10\DMR_02_tail_interior", 2.2387211, 1, 2200};
                        frequency = 1;
                        volume = "interior";
                    };
                    class TailTrees
                    {
                        sound[] = {"A3\Sounds_F_Mark\arsenal\weapons\LongRangeRifles\DMR_02_MAR10\DMR_02_tail_trees", 2.2387211, 1, 2200};
                        frequency = 1;
                        volume = "(1-interior/1.4)*trees";
                    };
                    class TailForest
                    {
                        sound[] = {"A3\Sounds_F_Mark\arsenal\weapons\LongRangeRifles\DMR_02_MAR10\DMR_02_tail_forest", 2.2387211, 1, 2200};
                        frequency = 1;
                        volume = "(1-interior/1.4)*forest";
                    };
                    class TailMeadows
                    {
                        sound[] = {"A3\Sounds_F_Mark\arsenal\weapons\LongRangeRifles\DMR_02_MAR10\DMR_02_tail_meadows", 2.2387211, 1, 2200};
                        frequency = 1;
                        volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
                    };
                    class TailHouses
                    {
                        sound[] = {"A3\Sounds_F_Mark\arsenal\weapons\LongRangeRifles\DMR_02_MAR10\DMR_02_tail_houses", 2.2387211, 1, 2200};
                        frequency = 1;
                        volume = "(1-interior/1.4)*houses";
                    };
                };
            };

            reloadTime = 2;
            dispersion = 0.00011;
            recoil = "recoil_single_dmr";
            recoilProne = "recoil_single_prone_dmr";
            minRange = 2;
            minRangeProbab = 0.3;
            midRange = 350;
            midRangeProbab = 0.7;
            maxRange = 500;
            maxRangeProbab = 0.05;
        };
        class single_close_optics1 : Single
        {
            requiredOpticType = 1;
            showToPlayer = 0;
            minRange = 2;
            minRangeProbab = 0.05;
            midRange = 300;
            midRangeProbab = 0.8;
            maxRange = 500;
            maxRangeProbab = 0.01;
            aiRateOfFire = 2;
            aiRateOfFireDistance = 300;
        };
        class single_medium_optics1 : single_close_optics1
        {
            minRange = 300;
            minRangeProbab = 0.05;
            midRange = 500;
            midRangeProbab = 0.7;
            maxRange = 700;
            maxRangeProbab = 0.05;
            aiRateOfFire = 2;
            aiRateOfFireDistance = 500;
        };
        class single_far_optics1 : single_medium_optics1
        {
            requiredOpticType = 2;
            minRange = 300;
            minRangeProbab = 0.05;
            midRange = 700;
            midRangeProbab = 0.5;
            maxRange = 1000;
            maxRangeProbab = 0.05;
            aiRateOfFire = 4;
            aiRateOfFireDistance = 600;
        };
        aiDispersionCoefY = 3;
        aiDispersionCoefX = 2;
    };
};
