------------------------------------

-------------HatsChat 2-------------

------------------------------------

--Copyright (c) 2013 my_hat_stinks--

------------------------------------



HatsChat.ChatFilter = {}

local CF = HatsChat.ChatFilter



local function IgnoreFilter(ply)

	return (not IsValid(ply)) or ply:IsSuperAdmin()

end



CF.Enabled = false

CF.Filters = {

	["fuck"] = "fudge",

	["shit"] = "poop",

	["arse"] = "bottom",

	["bollocks"] = "********",

	["bollox"] = "******",

	["damn"] = "darn",

	["gay"] = "homosexual",

	["queer"] = "homosexual",

	

	["fag"] = "doo-doo head",

	["dyke"] = "puppet-ears",

	["nigger"] = "fecal-features",

	["nigga"] = "butthead",

	["niglet"] = "dummy",

	["bastard"] = "fart-face",

	["douche"] = "dumbhead",

	["skank"] = "*****",

	["slut"] = "****",

	["whore"] = "*****",

	

	["cunt"] = "girly parts",

	["clit"] = "girly parts",

	["dick"] = "weener",

	["cum"] = "***",

	["jizz"] = "****",

	["dildo"] = "toy",

	["tit"] = "***",

	["wank"] = "****",

	

	["ass"] = "donkey",

	["bitch"] = "puppy",

	["pussy"] = "kitty",

	["cock"] = "rooster",

}



function CF.RunFilter( ply, str )

	if not CF.Enabled then return str end

	if IgnoreFilter(ply) then return str end

	

	local pos

	for k,v in pairs( CF.Filters ) do

		pos = 0

		while pos do

			pos = string.find( str:lower(), k )

			if pos then

				str = str:sub(1,pos-1).. v ..str:sub(pos+#k, -1)

			end

		end

	end

	

	return str

end



local PirateDay = (os.date( "%m%d" )=="0919") --International Talk like a pirate day!

if PirateDay then

	if not CF.Enabled then table.Empty( CF.Filters ) end

	CF.Enabled = true

	IgnoreFilter = function() return false end

	

	table.Merge( CF.Filters, {

		["hello"] = "Ahoy",

		["yes"] = "yarr", ["yeah"] = "aye", ["of course"] = "aye aye",

		

		["fag"] = "bilge rat", ["dyke"] = "bilge rat", ["nigger"] = "bilge rat", ["nigga"] = "bilge rat", ["niglet"] = "bilge rat", ["bastard"] = "bilge rat", ["douche"] = "bilge rat", ["skank"] = "bilge rat", ["slut"] = "bilge rat", ["whore"] = "bilge rat",

		

		["wow"] = "shiver me timbers", ["wtf"] = "blimey",

		["treasure"] = "booty", ["money"] = "booty", ["friend"] = "matey", ["ally"] = "bucko",

		["lookout"] = "crow's nest", ["knife"] = "cutlass",

		

		["good luck"] = "fair winds", ["whip"] = "flog", ["beer"] = "grog", ["alcohol"] = "grog", ["food"] = "grub",

		["hideout"] = "haven", ["home"] = "haven",

		["cheat"] = "hornswaggle", ["hack"] = "hornswaggle",

		["girl"] = "lass", ["boy"] = "lad", ["abandon"] = "maroon",

		["rebel"] = "mutiny", ["steal"] = "plunder",

		["left"] = "port", ["right"] = "starboard", ["back"] = "aft", ["front"] = "prow",

		["song"] = "shanty", ["drunk"] = "three shets in the wind", ["clean"] = "titivate",

		["you"] = "ye"

	})

end