
// DO NOT EDIT THIS FILE!

local pairs = pairs
local unpack = unpack
local type = type
local Msg = Msg
local string = string
local table = table

/*---------------------------------------------------------
   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)
	 
	//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
	
	table.Merge( NewEffect, EffectList[ "base" ] )
	
	return NewEffect
	
end
