require "Insurgent/InsurgentTraitDefinitions"

LoadoutExplosivesTrait = CreateInsurgentTrait()
LoadoutExplosivesTrait.name = "LoadoutExplosives"
LoadoutExplosivesTrait.insurgentExclusive = true

function LoadoutExplosivesTrait.Create()
    return TraitFactory.addTrait("LoadoutExplosives", getText("UI_trait_LoadoutExplosives"), 2, getText("UI_trait_LoadoutExplosivesDesc"), false, false);
end

function LoadoutExplosivesTrait.OnNewGame(player)
    if player:HasTrait("LoadoutExplosives") then
        local inv = player:getInventory();
        inv:AddItems("Base.PipeBomb", 3);	
        inv:AddItems("Base.FlameTrap", 3);
        inv:AddItems("Base.Base.SmokeBomb", 3);
    end	
end

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