require "Insurgent/InsurgentTraitDefinitions"

CovertOperativeTrait = CreateInsurgentTrait()
CovertOperativeTrait.name = "CovertOperative"
CovertOperativeTrait.insurgentExclusive = true

function CovertOperativeTrait.Create()
    local covertoperative = TraitFactory.addTrait("CovertOperative", getText("UI_trait_CovertOperative"), 4, getText("UI_trait_CovertOperativeDesc"), false, false);
	covertoperative:addXPBoost(Perks.Sneak, 3);
	covertoperative:addXPBoost(Perks.Nimble, 3);
	covertoperative:addXPBoost(Perks.Lightfoot, 3);
    return covertoperative;
end

function CovertOperativeTrait.OnNewGame(player)
    if player:HasTrait("CovertOperative") then
        local inv = player:getInventory();
        inv:AddItems("ImprovisedSilencers.Silencer", 2);
    end	
end

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