freeslot("SKINCOLOR_RINGI", "SKINCOLOR_AIRI", "SKINCOLOR_SPEEDI", "SKINCOLOR_SHIELDI", "SKINCOLOR_CUSTOMI") skincolors[SKINCOLOR_RINGI] = { name = "Interactive Ring", ramp = {79,79,79,79,79,78,78,78,78,78,78,191,191,191,191,191}, invcolor = SKINCOLOR_CORNFLOWER, invshade = 0, chatcolor = V_YELLOWMAP, accessible = true } skincolors[SKINCOLOR_AIRI] = { name = "Interactive Air", ramp = {139,139,139,139,139,138,138,138,138,138,138,137,137,137,137,137}, invcolor = SKINCOLOR_ORANGE, invshade = 0, chatcolor = V_AQUAMAP, accessible = true } skincolors[SKINCOLOR_SPEEDI] = { name = "Interactive Speed", ramp = {187,187,187,187,187,186,186,186,186,186,186,185,185,185,185,185}, invcolor = SKINCOLOR_LIME, invshade = 0, chatcolor = V_MAGENTAMAP, accessible = true } skincolors[SKINCOLOR_SHIELDI] = { name = "Interactive Shield", ramp = {15,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13}, invcolor = SKINCOLOR_BONE, invshade = 0, chatcolor = V_INVERTMAP, accessible = true } skincolors[SKINCOLOR_CUSTOMI] = { name = "Interactive Custom", ramp = {31,31,31,31,31,30,30,30,30,30,30,29,29,29,29,29}, invcolor = SKINCOLOR_WHITE, invshade = 0, chatcolor = V_INVERTMAP, accessible = true } local function checkTable(table1, table2) for i = 0,15 if table1[i] ~= table2[i+1] return false end end return true end local shieldColors = { [SH_NONE] = {15,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13}, [SH_PITY] = {96,97,98,99,100,101,102,103,103,102,101,100,99,98,97,96}, [SH_WHIRLWIND] = {1,2,3,5,6,6,8,10,10,10,12,12,13,14,15,15}, [SH_ARMAGEDDON] = {50,50,52,54,54,34,36,36,38,38,40,40,43,43,47,31}, [SH_PINK] = {207,206,205,204,203,202,201,200,200,201,202,203,204,205,206,207}, [SH_FORCE] = {160,160,161,161,162,162,163,163,164,164,165,165,166,166,167,168}, [257] = {176,176,177,178,179,180,192,193,162,163,164,165,166,167,168,169}, --Force shield with 2 hp [SH_ELEMENTAL] = {146,147,149,151,152,152,165,204,34,54,55,56,56,56,57,58}, [SH_FLAMEAURA] = {83,83,72,73,50,32,32,34,35,35,35,37,37,39,39,41}, [SH_BUBBLEWRAP] = {128,128,130,132,134,149,149,150,151,151,151,153,153,155,157,159}, [SH_ATTRACT] = {80,80,81,82,82,83,72,73,73,73,64,65,66,67,69,71}, [SH_THUNDERCOIN] = {0,0,0,0,1,1,1,1,2,2,3,3,4,4,5,5} } addHook("PlayerSpawn", function(player) player.arings = {} player.arings.counter = 0 player.arings.first = 0 player.arings.second = 0 player.arings.third = 0 player.awater = {} player.awater.counter = 0 player.awater.first = 0 player.awater.second = 0 player.awater.third = 0 player.aspeed = {} player.aspeed.counter = 0 player.aspeed.first = 0 player.aspeed.second = 0 player.aspeed.third = 0 player.ashield = 0 player.acustom = "A" player.customColors = { A = {31,31,31,31,31,30,30,30,30,30,30,29,29,29,29,29}, B = {15,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13} } local rfile = io.openlocal("client/InteractiveCustom.txt", "r") if rfile local color = rfile:read("*a") rfile:close() COM_BufInsertText(player, color) end end) local function shieldColorChanger(color, tocolor) if color > tocolor color = max($-1, tocolor) elseif color < tocolor color = min($+1, tocolor) end return color end addHook("PlayerThink", function(player) if player and server and #player == 0 if player.skincolor == SKINCOLOR_RINGI if player.arings.counter > player.rings player.arings.counter = max($-1, player.rings) elseif player.arings.counter < player.rings player.arings.counter = min($+1, player.rings) end if player.arings.counter < 40 player.arings.first = 79-player.arings.counter/5 else player.arings.first = max(91-player.arings.counter/5, 80) end if player.arings.counter < 35 player.arings.second = 78-player.arings.counter/5 else player.arings.second = max(90-player.arings.counter/5, 81) end if player.arings.counter < 20 player.arings.third = 191-player.arings.counter/5 else player.arings.third = max(87-player.arings.counter/5, 82) end local f = player.arings.first local s = player.arings.second local t = player.arings.third skincolors[SKINCOLOR_RINGI].ramp = {f,f,f,f,f,s,s,s,s,s,s,t,t,t,t,t} elseif player.skincolor == SKINCOLOR_AIRI if player.powers[pw_spacetime] if player.powers[pw_spacetime] == 402 player.awater.counter = 402 elseif player.awater.counter > player.powers[pw_spacetime] player.awater.counter = max($-1, player.powers[pw_spacetime]) elseif player.arings.counter < player.powers[pw_spacetime] player.awater.counter = min($+1, player.powers[pw_spacetime]) end player.awater.first = max(31-player.awater.counter/50, 18) player.awater.second = max(30-player.awater.counter/50, 17) player.awater.third = max(29-player.awater.counter/50, 16) local f = player.awater.first local s = player.awater.second local t = player.awater.third skincolors[SKINCOLOR_AIRI].ramp = {f,f,f,f,f,s,s,s,s,s,s,t,t,t,t,t} else if player.powers[pw_underwater] if player.powers[pw_underwater] == 1050 player.awater.counter = 1050 elseif player.awater.counter > player.powers[pw_underwater] player.awater.counter = max($-1, player.powers[pw_underwater]) elseif player.arings.counter < player.powers[pw_underwater] player.awater.counter = min($+1, player.powers[pw_underwater]) end else player.awater.counter = max($-50, 0) end player.awater.first = max(139-player.awater.counter/50, 130) player.awater.second = max(138-player.awater.counter/50, 129) player.awater.third = max(137-player.awater.counter/50, 128) local f = player.awater.first local s = player.awater.second local t = player.awater.third skincolors[SKINCOLOR_AIRI].ramp = {f,f,f,f,f,s,s,s,s,s,s,t,t,t,t,t} end elseif player.skincolor == SKINCOLOR_SPEEDI player.aspeed.counter = FixedInt(player.speed) player.aspeed.first = max(187-player.aspeed.counter/2, 178) player.aspeed.second = max(186-player.aspeed.counter/2, 177) player.aspeed.third = max(185-player.aspeed.counter/2, 176) local f = player.aspeed.first+player.powers[pw_sneakers] local s = player.aspeed.second+player.powers[pw_sneakers] local t = player.aspeed.third+player.powers[pw_sneakers] skincolors[SKINCOLOR_SPEEDI].ramp = {f,f,f,f,f,s,s,s,s,s,s,t,t,t,t,t} elseif player.skincolor == SKINCOLOR_SHIELDI player.ashield = player.powers[pw_shield] if player.ashield ~= nil for i = 0,15 skincolors[SKINCOLOR_SHIELDI].ramp[i] = shieldColorChanger($, shieldColors[player.ashield][i+1]) end end elseif player.skincolor == SKINCOLOR_CUSTOMI if checkTable(skincolors[SKINCOLOR_CUSTOMI].ramp, server.customColors["A"]) player.acustom = "B" elseif checkTable(skincolors[SKINCOLOR_CUSTOMI].ramp, server.customColors["B"]) player.acustom = "A" end for i = 0,15 skincolors[SKINCOLOR_CUSTOMI].ramp[i] = shieldColorChanger($, player.customColors[player.acustom][i+1]) end end end end) COM_AddCommand("setcustomcolor", function(player, key, pri, sec, ter, qua, qui, ses, set, ott, non, dec, und, dod, tre, quat, quind, sed) if not player.customColors player.customColors = { A = {31,31,31,31,31,30,30,30,30,30,30,29,29,29,29,29}, B = {15,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13} } end if not key then key = "nothing" end key = key:upper() if (key == "A" or key == "B") and pri and sec and ter and qua and qui and ses and set and ott and non and dec and und and dod and tre and quat and quind and sed pri = min($, 255) sec = min($, 255) ter = min($, 255) qua = min($, 255) qui = min($, 255) ses = min($, 255) set = min($, 255) ott = min($, 255) non = min($, 255) dec = min($, 255) und = min($, 255) dod = min($, 255) tre = min($, 255) quat = min($, 255) quind = min($, 255) sed = min($, 255) player.customColors[key] = {pri, sec, ter, qua, qui, ses, set, ott, non, dec, und, dod, tre, quat, quind, sed} local wfile = io.openlocal("client/InteractiveCustom.txt", "w+") if key == "A" local colorA = pri.." "..sec.." "..ter.." "..qua.." "..qui.." "..ses.." "..set.." "..ott.." "..non.." "..dec.." "..und.." "..dod.." "..tre.." "..quat.." "..quind.." "..sed local colorB = player.customColors["B"][1].." "..player.customColors["B"][2].." "..player.customColors["B"][3].." "..player.customColors["B"][4].." "..player.customColors["B"][5].." "..player.customColors["B"][6].." "..player.customColors["B"][7].." "..player.customColors["B"][8].." "..player.customColors["B"][9].." "..player.customColors["B"][10].." "..player.customColors["B"][11].." "..player.customColors["B"][12].." "..player.customColors["B"][13].." "..player.customColors["B"][14].." "..player.customColors["B"][15].." "..player.customColors["B"][16] wfile:write("setcustomcolor A "..colorA.."; setcustomcolor B "..colorB) else local colorA = player.customColors["A"][1].." "..player.customColors["A"][2].." "..player.customColors["A"][3].." "..player.customColors["A"][4].." "..player.customColors["A"][5].." "..player.customColors["A"][6].." "..player.customColors["A"][7].." "..player.customColors["A"][8].." "..player.customColors["A"][9].." "..player.customColors["A"][10].." "..player.customColors["A"][11].." "..player.customColors["A"][12].." "..player.customColors["A"][13].." "..player.customColors["A"][14].." "..player.customColors["A"][15].." "..player.customColors["A"][16] local colorB = pri.." "..sec.." "..ter.." "..qua.." "..qui.." "..ses.." "..set.." "..ott.." "..non.." "..dec.." "..und.." "..dod.." "..tre.." "..quat.." "..quind.." "..sed wfile:write("setcustomcolor A "..colorA.."; setcustomcolor B "..colorB) end wfile:close() else CONS_Printf(player, "setcustomcolor : sets Interactive Custom's colors, A is the starting color, B is the finishing color") end end, COM_LOCAL)