
// DO NOT EDIT THIS FILE!

// Globals that we need 
//local gmod = gmod
local pairs = pairs
local unpack = unpack
local type = type
local Msg = Msg
local string = string
local tablex = tablex

/*---------------------------------------------------------
   Name: effects
   Desc: Engine effects hooking
---------------------------------------------------------*/
module("effects")

local EffectList = {}


/*---------------------------------------------------------
   Name: Register( table, string )
---------------------------------------------------------*/
function Register( t, name )

	name = string.lower(name)
	EffectList[ name ] = t
	
end


/*---------------------------------------------------------
   Name: Create( string )
---------------------------------------------------------*/
function Create( name )

	name = string.lower(name)
	
	// Uncomment to see effect names called out 
	//Msg( "Create.. ".. name .. "\n" )

	if (EffectList[ name ] == nil) then return nil end

	local NewEffect = {}
	
	for k, v in pairs( EffectList[ name ] ) do 
	
		NewEffect[k] = v
		
	end
	
	tablex.Merge( NewEffect, EffectList[ "base" ] )
	
	return NewEffect
	
end
