PWAD¼rawset(_G, "PTAIinit", function(p) p.ptaiinit = 1 p.ptaiframewait = 0 p.ptaicolor = 1 // p.ptaistyle = 1, // p.ptaispeed = 0, CONS_Printf(p, "Pizza Tower Variables set.") CONS_Printf(p, "\x82"+"Check out"+"\x86"+" ptafterimageshelp"+"\x82 "+"for options!") return true end) //pretty much just soap_cos_speedometer COM_AddCommand("ptafterimageshelp", function(p) if not p or not p.ptaiinit or not p.valid CONS_Printf(p, "\x85"+"You aren't valid or the Pizza Tower Variables aren't!") return end CONS_Printf(p, "PT Afterframes has 2 options you can choose, which are saved automatically.") CONS_Printf(p, "\x86ptafterimagesstyle -\x82 Sets the style of the afterimages.") CONS_Printf(p, "\x86ptafterimagesactive -\x82 Sets the activation method of the afterimages.") end) COM_AddCommand("ptafterimagesstyle", function(p, arg) if not p or not p.valid CONS_Printf(p, "\x85"+"You don't exist yet!") return end local prevstyle local argV if arg argV = tonumber(arg) prevstyle = p.ptaistyle p.ptaistyle = argV if not argV or argV > 2 or argV < 1 p.ptaistyle = prevstyle CONS_Printf(p, "\x85"+"Value is too low! Choose either 1 or 2.") return end if io and p == consoleplayer local file = io.openlocal("client/pizzatowerai/style.dat", "w+") file:write(argV) file:close() end CONS_Printf(p, "Style set to "+"\x82"+arg+"\x80"+".") else CONS_Printf(p, "Changes the colors of the Pizza Tower Afterimages.") CONS_Printf(p, "This has 2 styles available:") CONS_Printf(p, "1: Pizza Tower") CONS_Printf(p, "2: Sugary Spire") CONS_Printf(p, "Current style is \x82" + p.ptaistyle+"\x80"+".") end end) COM_AddCommand("ptafterimagesactive", function(p, arg) if not p or not p.valid CONS_Printf(p, "\x85"+"You don't exist yet!") return end local prevstyle local argV if arg argV = tonumber(arg) prevstyle = p.ptaispeed p.ptaispeed = argV if not argV or argV > 1 or argV < 0 p.ptaispeed = prevstyle CONS_Printf(p, "\x85"+"Value is too low! Choose either 0 or 1.") return end if io and p == consoleplayer local file = io.openlocal("client/pizzatowerai/activation.dat", "w+") file:write(argV) file:close() end CONS_Printf(p, "Style set to "+"\x82"+argV+"\x80"+".") else CONS_Printf(p, "Sets what makes afterimages.") CONS_Printf(p, "This has 2 styles available:") CONS_Printf(p, "0: Default (Shoes and Dashmode only)") CONS_Printf(p, "1: Speed (Shoes, Dashmode and speed)") CONS_Printf(p, "Current style is \x82" + p.ptaispeed+"\x80"+".") end end) freeslot("SKINCOLOR_AIREALLYRED") freeslot("SKINCOLOR_AIREALLYGREEN") freeslot("SKINCOLOR_AIREALLYBLUE") freeslot("SKINCOLOR_AIREALLYPINK") skincolors[SKINCOLOR_AIREALLYRED] = { name = "Really Red", ramp = {35,35,35,35,35,35,35,35,35,35,35,41,41,41,41,41}, invcolor = SKINCOLOR_AIREALLYGREEN, invshade = 0, chatcolor = V_REDMAP, accessible = true } //freeslot("SKINCOLOR_SOAPAIREALLYGREEN") skincolors[SKINCOLOR_AIREALLYGREEN] = { name = "Really Green", ramp = {100,100,100,100,100,100,100,100,100,100,100,191,191,191,191,191}, invcolor = SKINCOLOR_AIREALLYRED, invshade = 0, chatcolor = V_GREENMAP, accessible = true } skincolors[SKINCOLOR_AIREALLYBLUE] = { name = "Really Blue", ramp = {136,136,136,136,136,136,136,136,136,136,136,138,138,138,138,138}, invcolor = SKINCOLOR_AIREALLYPINK, invshade = 0, chatcolor = V_SKYMAP, accessible = true } skincolors[SKINCOLOR_AIREALLYPINK] = { name = "Really Pink", ramp = {204,204,204,204,204,204,204,204,204,204,204,71,71,71,71,71}, invcolor = SKINCOLOR_AIREALLYBLUE, invshade = 0, chatcolor = V_ROSYMAP, accessible = true }//heavily based off of alt sonic addHook("PlayerSpawn", function(p) if io and p == consoleplayer and p.ptaistyle == nil and p.ptaispeed == nil local file = io.openlocal("client/pizzatowerai/style.dat") if file // print("Opening style.dat...") local string = file:read("*a") if string == "2" COM_BufInsertText(p, "ptafterimagesstyle 2") elseif string == "1" or string == nil COM_BufInsertText(p, "ptafterimagesstyle 1") end file:close() // print("Closed style.dat.") end local file = io.openlocal("client/pizzatowerai/activation.dat") if file local string = file:read("*a") if string == "0" COM_BufInsertText(p, "ptafterimagesactive 0") elseif string == "1" or string == nil COM_BufInsertText(p, "ptafterimagesactive 1") end file:close() end end end) addHook("PlayerThink", function(p) if not p.valid return end if not p.ptaiinit PTAIinit(p) return end if p.mo.valid and p.mo local me = p.mo p.accSpeed = abs(FixedHypot(p.rmomx,p.rmomy)) //more accurate speed thing //make after images when we're going fast!!! if (p.dashmode >= (3*TICRATE)) or ((p.powers[pw_sneakers]) and (p.accSpeed > p.runspeed)) or ((p.accSpeed > p.normalspeed) and p.ptaispeed) and not (p.pflags & PF_STARTDASH) PizzaTowerAfterImages(p, me, p.ptaicolor) if not p.ptaiframewait p.ptaiframewait = 3 if p.ptaicolor == 1 p.ptaicolor = 2 else p.ptaicolor = 1 end else p.ptaiframewait = $ -1 end end end end) //taken from my other addon, Soap the Hedge //nothing fancy here, just regular ghosts //scrap that, lets add some pizza tower styled afterimages!! //lets make this follow the soap, so we can actually see the thing rawset(_G, "PizzaTowerAfterImages", function(p, me, color) // local ghost = P_SpawnGhostMobj(me) // ghost.frame = TR_TRANS80 // ghost.destscale = $*99 if p.ptaiframewait return end local chasecam = CV_FindVar("chasecam") local afteri = P_SpawnGhostMobj(me) if p.ptaistyle == 1 or p.ptaistyle == nil if color == 1 afteri.color = SKINCOLOR_AIREALLYRED elseif color == 2 afteri.color = SKINCOLOR_AIREALLYGREEN end else if color == 1 afteri.color = SKINCOLOR_AIREALLYBLUE elseif color == 2 afteri.color = SKINCOLOR_AIREALLYPINK end end afteri.colorized = true afteri.frame = FF_FULLBRIGHT|me.frame|TR_TRANS10 afteri.fuse = 14 //should you be out of my face? if chasecam.value afteri.flags2 = $ & ~MF2_DONTDRAW else afteri.flags2 = $ | MF2_DONTDRAW end end) VLUA_INITb<LUA_AFTIžLUA_FUNC