freeslot("SKINCOLOR_RINGI", "SKINCOLOR_AIRI", "SKINCOLOR_SPEEDI", "SKINCOLOR_SHIELDI", "SKINCOLOR_CUSTOMI", "SKINCOLOR_EMERALDI", "SKINCOLOR_FIGHTI") 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 } skincolors[SKINCOLOR_EMERALDI] = { name = "Interactive Emerald", ramp = {119,119,119,119,119,118,118,118,118,118,118,117,117,117,117,117}, invcolor = SKINCOLOR_RUBY, invshade = 0, chatcolor = V_GREENMAP, accessible = true } skincolors[SKINCOLOR_FIGHTI] = { name = "Interactive Fight", ramp = {47,47,47,47,47,46,46,46,46,46,46,45,45,45,45,45}, invcolor = SKINCOLOR_GREEN, invshade = 0, chatcolor = V_REDMAP, accessible = true } local function checkTable(table1, table2) if not table1 or not table2 then return false end 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} } local function emeraldsCheck(player) if not player.aemerald then return end player.aemerald.list = {} if emeralds & EMERALD1 table.insert(player.aemerald.list, {0,88,96,96,97,112,112,113,114,115,125,125,142,143,127,127}) end if emeralds & EMERALD2 table.insert(player.aemerald.list, {0,176,178,178,179,179,180,181,181,163,164,164,165,166,167,156}) end if emeralds & EMERALD3 table.insert(player.aemerald.list, {0,129,131,132,134,149,149,151,151,151,153,155,155,157,159,253}) end if emeralds & EMERALD4 table.insert(player.aemerald.list, {0,129,130,130,131,133,133,134,134,134,135,137,137,138,138,139}) end if emeralds & EMERALD5 table.insert(player.aemerald.list, {0,80,81,82,72,51,52,53,55,55,57,59,70,70,71,71}) end if emeralds & EMERALD6 table.insert(player.aemerald.list, {0,48,50,52,33,34,34,35,36,39,39,41,41,43,45,47}) end if emeralds & EMERALD7 table.insert(player.aemerald.list, {0,3,6,6,9,12,12,13,14,171,171,172,172,173,174,175}) end if emeralds == 0 player.aemerald.list[1] = {119,119,119,119,119,118,118,118,118,118,118,117,117,117,117,117} end end 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 player.aemerald = {} player.aemerald.counter = 1 player.aemerald.timer = 0 emeraldsCheck(player) player.afight = {} player.afight.counter = 0 player.afight.first = 0 player.afight.second = 0 player.afight.third = 0 end) addHook("MobjDamage", function(target, inflictor, source, damagetype) if source and source.player if target.flags & MF_ENEMY source.player.afight.counter = $+1 elseif target.flags & MF_BOSS source.player.afight.counter = $+2 end elseif target.player target.player.afight.counter = 0 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) emeraldsCheck(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 elseif player.skincolor == SKINCOLOR_EMERALDI player.aemerald.timer = max($-1, 0) if checkTable(skincolors[SKINCOLOR_EMERALDI].ramp, player.aemerald.list[player.aemerald.counter]) player.aemerald.counter = $+1 if player.aemerald.counter > #player.aemerald.list then player.aemerald.counter = 1 end player.aemerald.timer = 10 end if player.aemerald.timer then return end for i = 0,15 if not pcall(do skincolors[SKINCOLOR_EMERALDI].ramp[i] = shieldColorChanger($, player.aemerald.list[player.aemerald.counter][i+1]) end) then emeraldsCheck(player) end end elseif player.skincolor == SKINCOLOR_FIGHTI player.afight.first = max(47-player.afight.counter, 34) player.afight.second = max(46-player.afight.counter, 33) player.afight.third = max(45-player.afight.counter, 32) local f = player.afight.first local s = player.afight.second local t = player.afight.third skincolors[SKINCOLOR_FIGHTI].ramp = {f,f,f,f,f,s,s,s,s,s,s,t,t,t,t,t} end end end) COM_AddCommand("setcustomcolor", function(player, key, ...) local 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(tonumber($), 255) sec = min(tonumber($), 255) ter = min(tonumber($), 255) qua = min(tonumber($), 255) qui = min(tonumber($), 255) ses = min(tonumber($), 255) set = min(tonumber($), 255) ott = min(tonumber($), 255) non = min(tonumber($), 255) dec = min(tonumber($), 255) und = min(tonumber($), 255) dod = min(tonumber($), 255) tre = min(tonumber($), 255) quat = min(tonumber($), 255) quind = min(tonumber($), 255) sed = min(tonumber($), 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)