require "Insurgent/Traits/LoadoutGunslingerTrait"

LoadoutGunslingerTrait = CreateInsurgentTrait()
LoadoutGunslingerTrait.name = "LoadoutGunslinger"
LoadoutGunslingerTrait.insurgentExclusive = true
LoadoutGunslingerTrait.mutualExclusions = {"LoadoutPistoleer"}
LoadoutGunslingerTrait.description  = getText("UI_trait_LoadoutGunslingerDesc")

function LoadoutGunslingerTrait.Create()
    local lGunslinger = TraitFactory.addTrait("LoadoutGunslinger", getText("UI_trait_LoadoutGunslinger"), 3, LoadoutGunslingerTrait.description, false, false);
    lGunslinger:addXPBoost(Perks.Aiming, 1);
    return lGunslinger;
end

function LoadoutGunslingerTrait.OnNewGame(player)
    if not player:HasTrait("LoadoutGunslinger") then
        return
    end

    local weapon = InsurgentWeaponUtil.addWeapon(player, "Base.Revolver_Long", {"Base.RedDot"})
    InsurgentWeaponUtil.addMags(player, "Base.Bullets44", 30)
end

function LoadoutGunslingerTrait.RegisterEvents()
    Events.OnNewGame.Add(LoadoutGunslingerTrait.OnNewGame)
end