-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpicohaven2_minified.lua
173 lines (173 loc) · 36.7 KB
/
picohaven2_minified.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
function _init()dlvl=2ex()eO()eg()e9()palt(2)music(16)n"splash"end function _draw()local n=128-2*d clip(d,d,n,n)o()clip()end function _update60()if D<1then eA()else n7=0for n in all(actor)do if(n.hp<=0and n~=p)n.x=-99
end f()end ey()end function ey()n0+=1np=flr(n0/eT)%4d=max(0,d-5)if(n0%eR==0and#msgq>3and msg_yd<(#msgq-3)*6and not nH)msg_yd+=1
end function eA()D=min(D+eN,1)for n in all(actor)do n.ox,n.oy=n.sox*(1-D),n.soy*(1-D)if D==1then n.sox,n.soy=0,0if(n.ephem)del(actor,n)
end end end function n(n,t)n8=state state=n C,H=false,false a,e,ne=1,1,1c()d=t or 63E,K=0,eI if(nG[n])nG[state]()
end function nt()if(btnp(🅾️))n(g)
end function eb()eD()music(0)mapmsg=ew[dlvl]c"ᶜc🅾️ᶜ6:bEGIN"g,f,o="newturn",nt,nF end function nF()Y(0)nM()nW()nE(mapmsg,21,4,10,6)nP()ni()end function eS()while(#msgq>30)deli(msgq,1)msg_yd=max(0,msg_yd-6)
i"ᶜ7----- nEW rOUND ------"c"ᶜcさしᶜ6:iNSPECT mAP ³f🅾️ᶜ6:cARDS"a,e,H=p.x,p.y,true f,o=eU,A end function eU()h(10,10,0,0)if(btnp(🅾️))n"choosecards"
end function h(f,i,n,t)n,t=n or 1,t or 1for n=1,4do if(btnp(n-1))a+=nx[n]e+=nO[n]break
end a,e=mid(n,a,f),mid(t,e,i)ne=(a-1)*i+e end function ek()tpdeck={}for n in all(pdeck)do add(tpdeck,n)end j(ng)add(tpdeck,ng)add(tpdeck,m("act;confirm;status;1;name;\nconfirm\n\nᶜ6confirm\nthe two\nselected\ncards",false,true))c"ᶜc🅾️ᶜ6:sELECT 2 cARDS ᶜc❎ᶜ6:mAP"p.crds={}f,o=ev,eL end function ev()h(2,(#tpdeck+1)\2)if(ne>#tpdeck)e-=1
if(n1)local n=m"ᶜcさし🅾️ᶜ6:sELECT 1ST CARD;ᶜcさし🅾️ᶜ6:sELECT 2ND CARD;ᶜcさし🅾️ᶜ6:ᶜ7confirmᶜ6 IF DONE"c(n[#p.crds+1])
if btnp(🅾️)then local e=tpdeck[ne]if e.status==0then if l(p.crds,e)then del(p.crds,e)else if(e.act=="rest")p.crds={}
if ne==#tpdeck then for n in all(p.crds)do n.status=1end eC(p.crds)n"precombat"elseif#p.crds<2then add(p.crds,e)end end tpdeck[#tpdeck].status=#p.crds==2and 0or 1end elseif btnp(❎)then n"newturn"end end function eL()Y(5)print("ᶜ6yOUR dECK:\n\n\n\n\n\n\n\n\n\n\n\n\n¹f ¹7 ⁵celEGEND:",8,24)y("discard",92,108,1)y("burned",92,118,2)local n,e=eH(tpdeck)na({n,e},0,27,p.crds,9)if(#p.crds<1)r("ᶜ61ST cARD CHOSEN\nSETS ᶜ7iNITIATIVE,ᶜ6\nlOW:aCT fIRSTす",61,3)
nV()end function eC(n)if n[1].act=="rest"then eG="ᶜ8burnedᶜ6 ["..n[2].act.."]"n[2].status=2deli(n,2)else local e=T"swift"and"😐3"or"😐2"if(T"belt")e..="웃"
add(n,{act=e})add(n,{act=T"quivr"and"█2➡️3"or"█2"})end end function eF()eM()R,n9=eW(),1local n="🅾️:bEGIN tURNS"if(n1)n="🅾️:bEGIN ("..R[1].name.." FIRST @iNIT ᶜ7"..R[1].init.."ᶜ6)"
c(n)g,f,o="actloop",nt,A end function eM()local n=eP()for n in all(n)do n.crds=rnd(edecks[n.id])n.init=n.crds[1].init end for n in all(actor)do if(n.type)n.crds=n.type.crds
n.init=n.crds[1].init n.crdi=1end end function eP()local n={}for e in all(actor)do if(e~=p and not(l(n,e.type)))add(n,e.type)
end return n end function eV()f=eK o=A end function eK()if(p.hp<=0)nK()return
if(n9>#R)n("cleanup",0)return
w=R[n9].id local e=actor[w]n9+=1if(e.hp<1)return
if e==p and p.crds[1]==ng then eY()p.stun=nil elseif e.stun then i(e.name.." ▥, TURN SKIPPED")e.stun=nil else if(e==p)n("actplayerpre",0)else n("actenemy",0)
end end function ej()f=eB o=A end function eB()local e=actor[w]if(e.crdi>#e.crds)n("actloop",0)return
e.crd=nf(e.crds[e.crdi].act)e.crdi+=1if e.crd.act=="😐"then if e.crdi<=#e.crds then local n=nf(e.crds[e.crdi].act)if(n.act=="█")e.crd.rng=n.rng
end end nY(e)end function ez(n)local e,t=n.type.summon,no(n,true)if(#t>0)local t=rnd(t)nj(e,t.x,t.y)i(n.name.." ᶜ7SUMMONSᶜ6 "..S[e].name..",ᶜ8-2♥ᶜ6")U(n,2)
end function eq(e)mvq=nB(nz(e,p),e.crd.val,e.crd.rng)if(not mvq or#mvq<=1)mvq=nB(nz(e,p,false,true),e.crd.val,e.crd.rng)
n("animmovestep",0)end function nB(n,i,a)if(not n)return n
local t for e,n in ipairs(n)do local f=B(n.x,n.y,true)if e==1or f and e<=i+1then t=e if(z(n,p)<=a and nc(n,p))break
end end return{unpack(n,1,t)}end function B(n,e,t,i,a,f)if(fget(mget(n,e),1)or q(n,e))return false
if(fget(mget(n,e),2)and(t or not i))return false
local n=nd(n,e)if(t and n>0and a~=n)return false
if((f or a==1)and n>1and not i)return false
return true end function no(n,i,a,f)local e={}for t=1,4do local n,t=n.x+nx[t],n.y+nO[t]if(B(n,t,i,a,nil,f))add(e,k(n,t))
end return e end function nq(a,e)local o=a.crd local c,t,f=o.wound,o.val,""if a==p then local n=e_()if(n1)i("yOU DRAW RANDOM ATTACK\n mODIFIER CARD ᶜ7"..n)
f="ᶜ7["..n.."ᶜ7]ᶜ6 ³f"if n=="*2"then t*=2nl()n7=3elseif n=="/2"then t\=2nl()else if(n[-1]=="∧")o.wound=true n=sub(n,1,#n-1)
t=max(0,t+tonum(n))end end sfx(1)f..=a.name.."█"..e.name if(e==p and T("shld",true))p.shld+=2i"ᶜ7gREAT sHIELD USEDᶜ6:+★2"
if(e.shld>0)f..="("..e.shld.."★)"t=t-e.shld
t=max(0,t)f..=":ᶜ8-"..t.."♥ᶜ6"if(a.crd.stun)f..="▥"e.stun=true
if(a.crd.wound)f..="∧"e.wound=true
if a.crd.push and e.hp>t then mvq={k(e.x,e.y)}for t=1,a.crd.push do local n,e=e.x+t*(e.x-a.x),e.y+t*(e.y-a.y)if(B(n,e,true))add(mvq,k(n,e))else G=t n_=actor[nd(n,e)]eX,eZ=n,e break
end end o.wound=c i(f)local i=144+t if(t>9)i=154
nr(nil,e.x,e.y,a.x,a.y,i)U(e,t)if(#mvq>=1)N=e n("animmovestep",0)
end function e_()if(#I==0)nl()
local n=rnd(I)add(nA,n)del(I,n)return n end function eJ(n)if(z(n,p)<=n.crd.rng and nc(n,p))nq(n,p)
end function nX(n,e)local e=min(e,n.maxhp-n.hp)n.hp+=e if(e>0or n.wound)i(n.name.." hEALED ᶜ8+"..e.."♥")
n.wound=nil end function U(n,t)n.hp-=t if n.hp<=0then if n==p then if T("life",true)then n.hp,n.wound=1,false i"ᶜ7yOUR lIFE cHARM GLOWS\n AND YOU SURVIVE @ 1hp"else local e=rnd(F())if(e)e.status=2n.hp+=t i("yOU ᶜ8bURNᶜ6 A RANDOM CARD\nᶜ8[ᶜ6"..e.act.."ᶜ8]ᶜ6 ³fTO AVOID DEATH")
end sfx(3)else i(""..n.name.." IS dEFEATED!")if n.name=="orb"then local n=actor[l(actor,"noah","name")]if(n)n.pshld\=2n.shld\=2i"ᶜcnOAH HOWLS AS THE AURA\nᶜc AROUND HIM WEAKENS.."
end mvq={}if(not n.obj)local e,t=mget(n.x,n.y),13if e>=13and e<=15then t=min(15,e+1)elseif e~=33then t=e end mset(n.x,n.y,t)
p_xp+=1X+=1end end end function eQ()p.actionsleft=2n("actplayer",0)end function tn()ny(p)if(p.actionsleft==0)p.crds,p.init=nil n("actloop",0)return
c(n1 and"ᶜcし🅾️ᶜ6:card (OR dFLT █2😐2)"or"ᶜcし🅾️ᶜ6:cHOOSE cARD "..3-p.actionsleft)f=t0 o=A end function t0()h(1,#p.crds)if btnp(🅾️)then local n=p.crds[e]nZ,te=n,l(p.crds,n)p.crd=nf(n.act)if p.crd.rng and p.crd.rng>1then if(T"goggl")p.crd.rng+=3
if(T"razor")p.crd.val+=1
end p.actionsleft-=1nY(p)if(p.crd.burn)n.status=2
del(p.crds,n)end end function nY(t)local e=t.crd if e.act=="😐"then if(t==p)n("actplayermove",0)else eq(t)
elseif e.aoe==8and e.rng==1then local e=u("x;-1;y;-1|x;0;y;-1|x;1;y;-1|x;-1;y;0|x;1;y;0|x;-1;y;1|x;0;y;1|x;1;y;1",true)nT=p foreach(e,nJ)foreach(e,nR)n("actplayer",0)elseif e.act=="█"then if(t==p)n("actplayerattack",0)else eJ(t)
else if(e.act=="♥")nX(t,e.val)
if e.act=="★"then t.shld+=e.val i(t.name.." ★+"..e.val)elseif e.act=="⬅️"and t==p then i("lOOTING tREASURE @➡️"..e.val)tt(e.val)elseif e.act=="smite"then foreach(nQ(p,e.rng),nR)elseif e.act=="howl"then i(t.name.." hOWLS.. ᶜ8-1♥,▥")U(p,1)p.stun=true elseif e.act=="call"then ez(t)end if(t==p)n("actplayer",0)
end if(e.burn)p_xp+=2
end function nJ(n)n.x+=nT.x n.y+=nT.y end function nR(n)local e=nd(n.x,n.y)if(e>1)nq(p,actor[e])else nr(nil,n.x,n.y,p.x,p.y,6)
end function nQ(e,n)local i={}for t=-n,n do for a=-n,n do local a,f=e.x+t,e.y+a local t=k(a,f)if(not q(a,f)and z(e,t)<=n and nc(e,t))add(i,t)
end end return i end function eY()p.actionsleft=0i"yOU TAKE A ᶜ7lONG rESTᶜ6:"foreach(pdeck,j)foreach(pitems,j)nX(p,3)i(eG)end function en(e,t)local n=mget(e,t)if(fget(n,5))mset(e,t,33)if n>=13and n<=15then nN(ti*(n-12))elseif n==12then nI+=1i"ᶜ7yOU COLLECT SOME HERBS"elseif n==37then local n=5+rnd(5*s)\1i"yOU OPEN A CHEST..."nN(n)end
end function nN(n)p_gp+=n Z+=n i("yOU GET "..n.."●")end function tt(n)for n in all(nQ(p,n))do en(n.x,n.y)end end function t1()H=true a,e=p.x,p.y mvq={k(a,e)}c("ᶜcさし🅾️ᶜ6:mOVE "..p.crd.val.." (ᶜc❎ᶜ6:uNDO)")f=ta o=A end function ta()local t,f=a,e h(10,10,0,0)if(a~=t or e~=f)if#mvq>=2and mvq[#mvq-1].x==a and mvq[#mvq-1].y==e then deli(mvq,#mvq)elseif#mvq>p.crd.val or not B(a,e,false,p.crd.jmp,1)then a,e=t,f else add(mvq,k(a,e))end
C=#mvq-1<=p.crd.val and B(a,e,true,false,1)if btnp(🅾️)then if C then if(#mvq>1)sfx(0)
n("animmovestep",0)else i"iNVALID mOVE"end elseif btnp(❎)then e0()end end function e0()p.actionsleft+=1mvq={}nZ.status=1add(p.crds,nZ,te)n"actplayer"end function tf()local e=N or actor[w]if not mvq or#mvq<=1then mvq={}if N and G then if N.hp>0then i(" cOLLISION dAMAGE:ᶜ8-"..G.."♥")U(N,G)if(n_)U(n_,G)
nr(nil,eX,eZ,N.x,N.y,144+G)end G=false end N=nil if(w==1)n("actplayer",0)else n("actenemy",0)
else local n,t,i,a=mvq[1].x,mvq[1].y,mvq[2].x,mvq[2].y nr(e,i,a,n,t)f=to ny(e,e.crd and e.crd.jmp)end end function ny(n,f)local e,t=n.x,n.y local a=mget(e,t)if(fget(a,4))if a==43and not f then i(n.name.." @ tRAP! ᶜ8-"..ee.."♥")mset(e,t,33)U(n,ee)elseif fget(a,7)then for n=1,4do et(e+nx[n],t+nO[n])end ei()nb-=1mset(e,t,33)elseif a==24and n==p then nI+=1mset(e,t,28)i"ᶜ7yOU LIGHT A BUNDLE OF\nᶜ7 HERBS, SMOKE RISES.."end
end function to()deli(mvq,1)n("animmovestep",0)end function tc()H=true a,e=p.x,p.y c"ᶜcさし🅾️ᶜ6:aTK tARGET (ᶜc❎ᶜ6uNDO)"f=td o=A end function td()h(10,10,0,0)local t=k(a,e)local f,o=z(p,t),p.crd C=f<=o.rng and f>0and not q(a,e)and nc(p,t)if btnp(🅾️)then if C then local e={{x=0,y=0}}if(o.aoe)e=u("x;-1;y;-1|x;0;y;-1|x;1;y;-1|x;-1;y;0|x;0;y;0|x;1;y;0|x;-1;y;1|x;0;y;1|x;1;y;1",true)
nT=t foreach(e,nJ)foreach(e,nR)if(not N)n("actplayer",0)
else i" iNVALID tARGET"end elseif btnp(❎)then e0()end end function tl()for n in all(actor)do nD(n)if(n.type)nD(n.type)
if(n.wound and n.hp>0)i(n.name.." wOUNDED ∧:ᶜ8-1♥")U(n,1)
n.shld=n.pshld ny(n)if(n.hp<=0and n~=p)del(actor,n)
end en(p.x,p.y)if#actor==1and nb==0or(dlvl==14or dlvl==16)and nI==4or dlvl==22and not l(actor,"noah","name")then tr()elseif t2()then nK()else if(#F()<2)local n=tu()i("ᶜchAND EMPTYᶜ6: yOU sHORT\nrEST, REDRAW, AND ᶜ8bURN\nRANDOM CARD: ᶜ8[ᶜ6"..n.."ᶜ8]")
c"ᶜcしᶜ6:rEVIEW ᶜc🅾️ᶜ6:nEXT rOUND"n2,g,f=true,"newturn",e1 o=A end end function tu()foreach(pdeck,j)local n=rnd(F())n.status=2return n.act end function F(t)local e={}for n in all(pdeck)do if(n.status==0or t and n.status==1)add(e,n)
end return e end function e1()if btnp(🅾️)then n2,nH=false,false n(g)elseif btn(⬆️)then nH=true msg_yd=max(msg_yd-1,0)elseif btn(⬇️)and#msgq>3then msg_yd=min(msg_yd+1,(#msgq-3)*6)end end function ts()ea()c"ᶜcしᶜ6:rEVIEW 🅾️:eND sCENARIO"n2=true M+=abs(time()-th)\6g,f="pretown",e1 end function t5()c"ᶜc🅾️ᶜ6:rETURN TO tOWN"g,o="town",nF if(n8=="endlevel")music(16)
f=nt end function tr()local e=lvls[dlvl]p_xp+=e.xp i("ᶜ7victory! ᶜ6(+"..e.xp.."xp)")if(e.gp>0)nN(e.gp)
mapmsg=nu[dlvl]J=dlvl e.unlocked=0for n in all(split(e.unlocks))do if(n~="")lvls[tonum(n)].unlocked=1
end if(dlvl==22)wongame=1nw+=1
n("endlevel",0)end function t2()if(p.hp<=0)return true
if(#F(true)<2)return true
if(#F(true)==2and#F()<2)return true
end function nK()i"ᶜ8yOU ARE eXHAUSTED"mapmsg="dEFEATED, YOU HOBBLE BACK TO TOWN TO NURSE YOUR WOUNDS AND PLAN A RETURN."n("endlevel",0)end function Y(n)rectfill(0,0,127,127,n)end function A()Y(0)nM()nW()t3()nP()ni()end function nM()print(sub(lvls[dlvl].name,1,15),0,0,7)r("♥"..p.hp.."/"..p.maxhp,66,0,8)end function ni()local n=n2 and 12or 13ns(E,99,E+K-1,120,5,n)clip(max(E,d)+1,max(101,d),min(E+K,127-2*d)-max(E,d)-2,120-2*d-max(101,d))nh(msgq,E,98-msg_yd,K,23,2,5)clip()if(n2)r("ᶜc⬆️\n\n\n⁴f⬇️",89,99)
nV()end function nV()if(ef)r(ef,1,122)
end function c(n)ef=n end function nW()ns(0,6,91,97,0,5)end function t3()camera(rnd(n7),rnd(n7))for n=0,10do for e=0,10do local t=mget(n,e)if(fget(mget(n,e),3))t+=np
if(q(n,e))t=39
spr(t,2+8*n,8+8*e)end end camera(0,0)foreach(actor,eo)if(#mvq>1)local e,t=mvq[1].x,mvq[1].y for n in all(mvq)do line(6+8*e,12+8*t,6+8*n.x,12+8*n.y,12)e,t=n.x,n.y end circfill(6+8*e,12+8*t,1,12)
if(H)t6()
end function eo(n)local e=n.noanim and 0or np if(n.stun)e=0pal(m("1;12;3;12;4;12;5;12;6;12;7;12;13;12",false,true))
spr(n.spr+e,2+8*n.x+n.ox,8+8*n.y+n.oy)pal()palt(2)local e=actor[w]if(e and n~=e and not n.ephem)eo(e)
end function t6()local n,e=1+a*8,7+e*8if(not C)fillp(23130)
rect(n,e,n+9,e+9,12)fillp()end function ec(n,e,i,t)local i=actor[i]if(not t)nS(n,e,i,t)
local a=i.type.crds if(a and#a>=1)local t={}for n in all(a)do add(t,n.act)end nh(t,n+10,e+10,25,15,nil,nil,1)r(i.type.init.."³f:",n+2,e+15,7)
if(t)nS(n,e,i,t)
end function nS(i,a,n,f)local e,o,c,d,t={" "..n.name},13,22,"?/"..n.maxhp,"\n⁴b ³e"if(n.wound)t..="∧ ³f"
if(n.stun)t..="▥ ³f"
if(n.shld>0)t..="★"..n.shld
if n==p then c=37if(p.init)add(e,"\n⁴d ³eᶜ7"..p.init..":")
add(e,"\n"..t)else if(f)d=n.hp o=12
add(e," ♥"..d)if(f)add(e,t)
end nh(e,i,a,33,c,nil,o)spr(n.spr,i+2,a+2)end function t4()local n,t=n5+2,ed+7nS(n5,ed,p)if state=="precombat"or state=="actenemy"or state=="actloop"or state=="animmovestep"and w~=1then if(p.crds)for e=1,min(#p.crds,2)do y(p.crds[e],n,t+10*e)end
elseif sub(state,1,9)=="actplayer"or state=="animmovestep"and w==1then for i,a in ipairs(p.crds)do local f=0if(not a.init)f=5
local e=i==e and state=="actplayer"y(a,n,t-10+10*i,f,e)fillp()end end end function y(t,i,a,n,p,d,u)local l=t if not u then if d then l=tm(t)else if(type(t)=="table")l=t.act
end end local e,o,c,f,h,m,r,s=13,1,6,32,9,1if(n==9)n=t.status
if d then f,h,m=39,67,3else if(n==1)e,c,r=0,5,true
if(n==2)e,o,c,r=0,130,0,true
if(n==3)e=5
if(n==4)e=12
if(n==5)o=0
if(p)s=12
end nh(l,i,a,f,h,m,e,o,c,r,s)if(d and not u)line(i,a+18,i+f-1,a+18,e)circfill(i+f-2,a-1,7,o)circ(i+f-2,a-1,7,e)print(t.init,i+f-5,a-3,c)
end function tm(e)local n,e=nf(e.act),{"ᶜ7"..e.name,"",""}if not n.special then nU(e,t7[n.act]..n.val)if(n.jmp)add(e," jump")
if(n.rng>1)add(e," @ rng "..n.rng)
if(n.wound)add(e," ᶜ8wound")
if(n.stun)add(e," ᶜcstun")
if(n.push)add(e," ᶜcpushᶜ6 "..n.push.."\n\n+1█ per\nそ pushed\nif into\nobstacle")
if(n.aoe)nU(e,"multiple\n targets")
if(n.burn)add(e,"\nᶜ8burnᶜ6 crd\n on use")
end return e end function nP()local n={}for t,e in ipairs(actor)do if e~=p and not e.ephem then local e=e.name if(not l(n,e))add(n,e)ec(n5,n3*l(n,e)-n3,t)
end end local e=nd(a,e)if(e>1and H)ec(n5,n3*l(n,actor[e].name)-n3,e,true)
t4()end function ex()poke(22016,unpack(split"4,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,0,0,0,0,7,7,7,0,0,0,0,0,7,5,7,0,0,0,0,0,5,2,5,0,0,0,0,0,5,0,5,0,0,0,0,0,5,5,5,0,0,0,0,4,6,7,6,4,0,0,0,1,3,7,3,1,0,0,0,7,1,1,1,0,0,0,0,0,4,4,4,7,0,0,0,5,7,2,7,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0,0,3,3,0,0,0,5,5,0,0,0,0,0,0,2,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,2,0,0,0,5,5,0,0,0,0,0,0,5,7,5,7,5,0,0,0,7,3,6,7,2,0,0,0,5,4,2,1,5,0,0,0,3,3,6,5,7,0,0,0,4,2,0,0,0,0,0,0,2,1,1,1,2,0,0,0,2,4,4,4,2,0,0,0,5,2,7,2,5,0,0,0,0,2,7,2,0,0,0,0,0,0,0,2,1,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,2,0,0,0,4,2,2,2,1,0,0,0,7,5,5,5,7,0,0,0,3,2,2,2,7,0,0,0,7,4,7,1,7,0,0,0,7,4,6,4,7,0,0,0,5,5,7,4,4,0,0,0,7,1,7,4,7,0,0,0,1,1,7,5,7,0,0,0,7,4,4,4,4,0,0,0,7,5,7,5,7,0,0,0,7,5,7,4,4,0,0,0,0,2,0,2,0,0,0,0,0,2,0,2,1,0,0,0,4,2,1,2,4,0,0,0,0,7,0,7,0,0,0,0,1,2,4,2,1,0,0,0,7,4,6,0,2,0,0,0,2,5,5,1,6,0,0,0,0,6,5,5,6,0,0,0,1,1,3,5,3,0,0,0,0,6,1,1,6,0,0,0,4,4,6,5,6,0,0,0,0,6,3,1,6,0,0,0,4,2,7,2,2,0,0,0,0,6,5,7,4,3,0,0,1,1,3,5,5,0,0,0,2,0,2,2,2,0,0,0,2,0,2,2,3,0,0,0,1,1,5,3,5,0,0,0,2,2,2,2,4,0,0,0,0,7,7,5,5,0,0,0,0,3,5,5,5,0,0,0,0,2,5,5,2,0,0,0,0,3,5,3,1,1,0,0,0,6,5,6,4,4,0,0,0,6,1,1,1,0,0,0,0,6,3,4,3,0,0,0,0,2,7,2,4,0,0,0,0,5,5,5,6,0,0,0,0,5,5,7,2,0,0,0,0,5,5,7,7,0,0,0,0,5,2,2,5,0,0,0,0,5,5,7,4,3,0,0,0,7,2,1,7,0,0,0,3,1,1,1,3,0,0,0,1,2,2,2,4,0,0,0,6,4,4,4,6,0,0,0,2,5,0,0,0,0,0,0,0,0,0,0,7,0,0,0,2,4,0,0,0,0,0,0,6,5,7,5,5,0,0,0,7,5,3,5,7,0,0,0,6,1,1,1,6,0,0,0,3,5,5,5,3,0,0,0,7,1,3,1,7,0,0,0,7,1,3,1,1,0,0,0,6,1,1,5,7,0,0,0,5,5,7,5,5,0,0,0,7,2,2,2,7,0,0,0,7,2,2,2,3,0,0,0,5,5,3,5,5,0,0,0,1,1,1,1,7,0,0,0,7,7,5,5,5,0,0,0,3,5,5,5,5,0,0,0,6,5,5,5,3,0,0,0,7,5,7,1,1,0,0,0,2,5,5,3,6,0,0,0,3,5,3,5,5,0,0,0,6,1,7,4,3,0,0,0,7,2,2,2,2,0,0,0,5,5,5,5,6,0,0,0,5,5,5,7,2,0,0,0,5,5,5,7,7,0,0,0,5,5,2,5,5,0,0,0,5,5,7,4,7,0,0,0,7,4,2,1,7,0,0,0,6,2,3,2,6,0,0,0,2,2,2,2,2,0,0,0,3,2,6,2,3,0,0,0,0,4,7,1,0,0,0,0,0,2,5,2,0,0,0,0,16,8,5,2,5,0,0,0,17,10,4,10,17,0,0,0,0,0,4,0,0,0,0,0,0,31,14,4,0,0,0,0,21,0,21,0,21,0,0,0,14,23,31,31,14,0,0,0,14,31,31,31,14,0,0,0,10,31,31,14,4,0,0,0,21,0,0,0,0,0,0,0,6,9,9,29,9,0,0,0,0,0,0,0,31,0,0,0,4,14,21,4,31,0,0,0,3,3,15,31,31,0,0,0,3,3,15,31,0,0,0,0,14,17,21,17,14,0,0,0,4,12,31,12,4,0,0,0,0,0,4,2,1,0,0,0,23,12,28,18,17,0,0,0,31,31,31,14,4,0,0,0,4,0,17,0,4,0,0,0,0,4,14,31,0,0,0,0,0,0,0,0,0,0,0,0,4,14,23,31,14,0,0,0,14,21,27,21,14,0,0,0,0,0,31,0,0,0,0,0,21,4,31,4,21,0,0,0,18,9,5,18,13,0,0,0,4,17,4,17,4,0,0,0,0,10,31,10,0,0,0,0,14,31,31,14,14,0,0,0,28,24,20,2,1,0,0,0,14,27,19,31,14,0,0,0,14,21,27,21,14,0,0,0,14,31,31,31,14,0,0,0,10,17,31,17,10,0,0,0,14,21,4,21,14,0,0,0,0,10,27,10,0,0,0,0,4,14,0,14,4,0,0,0,4,12,31,12,4,0,0,0,10,31,10,31,10,0,0,0,31,17,17,17,31,0,0,0,0,0,0,0,0,0,0,0,2,1,0,16,8,0,0,0,0,0,4,0,0,0,0,0,0,0,10,0,0,0,0,0,0,14,21,14,4,0,0,0,0,8,4,2,1,0,0,0"))poke(24408,129)el=m(" ; ³f;[;[³f;];³f];(;(³f;);³f);:;³f:;█;ᶜ6█;▒;ᶜ8▒;🐱;_;⬇️;ᶜc⬇️;░;ᶜ8░³aᶜ6🐱;✽;_;●;ᶜa●³aᶜ9✽;♥;ᶜ8♥;☉;ᶜ8☉³aᶜ6🐱;웃;ᶜ6웃;⌂;_;⬅️;ᶜ6⬅️³aᶜ9⌂;😐;ᶜ6😐³aᶜ4♪;♪;_;🅾️;ᶜc🅾️;◆;ᶜc◆ᶜ6;…;_;➡️;ᶜ6➡️³aᶜ4…;★;ᶜ6★;⧗;ᶜ8⧗³aᶜ6🐱;⬆️;ᶜc⬆️;∧;ᶜ8∧;❎;ᶜc❎;▤;ᶜ8▤;▥;ᶜc▥;あ;あ³aᶜ8ち;い;い³aᶜ8つ;う;う³aᶜ1て;え;え³aᶜdと;お;ᶜ8お³aᶜ6な;く;ᶜ8く³aᶜ6き;け;ᶜcけᶜ6;こ;ᶜcこᶜ6;さ;ᶜcさᶜ6;し;ᶜcしᶜ6",false,true)end function r(n,i,a,e)e=e or 6local t="ᵉ"for i=1,#n do local n=n[i]if n==" "then n=" ³f"elseif el[n]and e==6then n=el[n].."ᶜ6"end t..=n end print(t,i,a,e)end function nE(n,t,i,e,a)local n=split(n,"\n")for n in all(n)do while#n>t do local t=t+1while(n[t]~=" ")t-=1
print(sub(n,1,t),i,e,a)n=sub(n,t+1)e+=6end print(sub(n,1,t),i,e,a)e+=9end end function nh(n,e,t,d,i,a,f,o,c,u,l)a=a or 1f=f or 13o=o or 5c=c or 6if(type(n)~="table")n={n}
i=i or#n*6+3if(u)fillp(23130)
ns(e,t,e+d-1,t+i-1,o,f)fillp()for n,i in ipairs(n)do r(i,e+a+1,t+a-5+6*n,c)end if(l)rect(e-1,t-1,e+d,t+i,l)
end function na(n,t,r,i,c,f,o)i=i or{}f=f or 36t=t or 0local u=c==3and 8or 10for o=1,#n do for n,d in ipairs(n[o])do local f,r,t=t+8+(o-1)*f,r+5+(n-1)*u,c if(l(i,d))t=4
local n=o==a and n==e y(d,f,r,t,n)end end if a>0and e>0then local n=n[a][e]if(o)n=er(n)
y(n,85,24,0,true,true,o)end end function e2(i,n,o,t)t=t or 6for a,f in ipairs(i)do local i=o+(a-1)*8r(f,n,i,t)if(e==a)rect(n-2,i-2,n+#f*4,i+6,12)
end end function i(n)nU(msgq,n)end function eu()msgq={}msg_yd=0end function ns(n,e,t,i,a,f)rectfill(n,e,t,i,a)rect(n,e,t,i,f)end function nc(n,e)for t=0,1,.11do if(fget(mget(flr(n.x+t*(e.x-n.x)+.5),flr(n.y+t*(e.y-n.y)+.5)),1))return false
end return true end function nf(e)local n={}if(e[-1]=="▒")n.burn=true e=sub(e,1,-2)
if tonum(e[2])==nil then n.special=true n.act=e if(e=="smite")n.val,n.rng=20,10
else n.act=e[1]n.val=tonum(e[2])if#e>=3then n.mod=e[3]if#e>=4then if tonum(e[4])==nil then n.mod2=e[4]else n.modval=tonum(e[4])if(#e>=5)n.mod2=e[5]
end end end if(n.mod=="웃")n.jmp=true
n.rng=1if(n.mod=="➡️")n.rng=n.modval
if(e[-1]=="░")n.aoe=8
if(n.mod=="◆")n.push=n.modval
if(n.mod=="▥"or n.mod2=="▥")n.stun=true
if(n.mod=="∧"or n.mod2=="∧")n.wound=true
end return n end function nl()while(#nA>0)add(I,deli(nA))
end function ea()for n in all(pdeck)do n.status=0end nl()end function j(n)if(n.status==1)n.status=0
end function nD(n)n.crds,n.init,n.crd=nil end function eH(n)local e,n={unpack(n,1,ceil(#n/2))},{unpack(n,ceil(#n/2)+1)}return e,n end function l(t,n,e)for t,i in ipairs(t)do if not e then if(i==n)return t
else if(i[e]==n)return t
end end end function nk(e)for n=1,#e do local n=n while(n>1and tonum(e[n-1].init)>tonum(e[n].init))e[n],e[n-1]=e[n-1],e[n]n-=1
end end function k(n,e)return{x=n,y=e}end function tp(e)local n={}for e in all(e)do n[e]=(n[e]or 0)+1end return n end function nU(e,n)if(type(n)~="table")n=split(n,"\n")
for n in all(n)do add(e,n)end end function nd(e,t)for i,n in ipairs(actor)do if(n.x==e and n.y==t)return i
end return 0end function eW()R={}for e,n in ipairs(actor)do add(R,{init=n.init,id=e,name=n.name})end nk(R)return R end function T(n,e)local n=l(pitems,n,"shortname")if(not n or pitems[n].status~=0)return false
if(e)pitems[n].status=1
return true end function nr(n,e,t,i,a,f)n=n or add(actor,{spr=f,noanim=true,ephem=true})n.x,n.y=e,t n.sox,n.soy=8*(i-e),8*(a-t)n.ox,n.oy=n.sox,n.soy D=0end function z(n,e)return abs(n.x-e.x)+abs(n.y-e.y)end function t8()es=u"1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1|1;1;1;1;1;1;1;1;1;1;1"end function q(n,e)return n<0or n>10or e<0or e>10or es[n+1][e+1]end function tE(n,e)es[n+1][e+1]=false end function et(e,t)if(fget(mget(e,t),6))return
local i,a,f,o=10,10,0,0for n=0,10do if fget(mget(n,t),6)then if(n<e)f=n else i=min(n,i)
end if fget(mget(e,n),6)then if(n<t)o=n else a=min(n,a)
end end for n=f,i do for e=o,a do tE(n,e)end end end function m(n,t,i)local e,n={},split(n,";",not t)if(i)for t=1,#n,2do e[n[t]]=n[t+1]end return e
return n end function u(n,e)local t,n=split(n,"/"),{}for t,i in ipairs(t)do add(n,{})local i=split(i,"|")for i in all(i)do add(n[t],m(i,nil,e))end end while(#n==1)n=n[1]
return n end function eh(n)local e={}n-=1for t=1,%n do add(e,@(n-t))end return tx(e)end function tx(i)local t,n,e="",0,0for i in all(i)do n=256*n+i e+=8while(e>=6)e-=6t..=tO[(n>>e&63)+1]n=n&2^e-1
end return t end function eO()eI,E,msg_yd,n5,n3,ed=92,0,0,93,27,81eT,np,n0,D,d=15,0,0,1,0eR,eN=3,.05s=2Q=4W=u("txt;●easier●;hpscale;0.3;gp;2;trapdmg;6|txt;★normal★;hpscale;1;gp;1;trapdmg;6|txt;▥harder▥;hpscale;1.2;gp;2;trapdmg;8|txt;▒brutal▒;hpscale;1.5;gp;2;trapdmg;10",true)nx,nO=split"-1,1,0,0",split"0,0,-1,1"msgq={}Z,X,M,nw=0,0,0,0state,n8,g="","",""nG={newlevel=eb,splash=tg,town=t9,endlevel=ts,newturn=eS,choosecards=ek,precombat=eF,actloop=eV,actenemy=ej,actplayerpre=eQ,actplayer=tn,actplayermove=t1,animmovestep=tf,actplayerattack=tc,cleanup=tl,profile=tA,upgradedeck=ty,upgrademod=tT,store=tR,pretown=t5}t7=u("█;atk ;😐;move ;♥;heal ;●;gold ;웃;jump;➡️;@ rng ;⬅️;get all\ntreasure\nwithin\nrange ➡️;★;shld ;∧;wound;▥;stun;▒;burn;░;adjacent",true)end function eD()ti,ee=W[s].gp,W[s].trapdmg nI=0eu()tN(dlvl)t8()actor={p}if(T"mail")p.pshld=1
p.shld,p.stun,p.wound,p.hp=p.pshld,false,false,p.maxhp tI()et(p.x,p.y)ei()mvq={}ea()foreach(pitems,j)a,e,H,C=p.x,p.y,true,false S[#S].id=#S foreach(S,nD)n1=dlvl<=2th=time()end function tN(n)for e=0,10do for t=0,10do mset(e,t,mget(e+lvls[n].x0,t+lvls[n].y0))end end end function tI()nb=0for n=0,10do for e=0,10do if(mget(n,e)==1)mset(n,e,33)p.x,p.y=n,e
if(fget(mget(n,e),7))nb+=1
end end end function ei()for n=0,10do for e=0,10do for t,i in ipairs(S)do if(i.spr==mget(n,e)and not q(n,e))mset(n,e,33)nj(t,n,e)
end end end end function nj(n,e,t)local n=S[n]local n={type=n,x=e,y=t,ox=0,oy=0,sox=0,soy=0,maxhp=ceil(n.maxhp*W[s].hpscale),spr=n.spr,name=n.name,obj=n.obj,pshld=n.pshld}n.shld,n.hp=n.pshld,n.maxhp add(actor,n)end function eg()lvls=u("name;test level;x0;0;y0;0;unlocks;1;xp;10;gp;0|name;forest;x0;11;y0;0;unlocks;3;xp;10;gp;0|name;funeral;x0;22;y0;0;unlocks;4;xp;60;gp;20|name;ruined chapel;x0;33;y0;0;unlocks;5,6;xp;10;gp;5|name;forest hovel;x0;44;y0;0;unlocks;7;xp;10;gp;0|name;investigate inn;x0;55;y0;0;unlocks;;xp;10;gp;0|name;town cemetery;x0;66;y0;0;unlocks;8;xp;10;gp;0|name;hero mausoleum;x0;77;y0;0;unlocks;9,10,12;xp;50;gp;0|name;vicious wolves (side job);x0;88;y0;0;unlocks;10;xp;5;gp;25|name;rampaging bear (side job);x0;99;y0;0;unlocks;11;xp;20;gp;0|name;strange noises (side job);x0;88;y0;11;unlocks;9;xp;20;gp;5|name;council meeting;x0;110;y0;0;unlocks;13;xp;10;gp;20|name;mossy cottage;x0;11;y0;11;unlocks;14;xp;10;gp;0|name;fetid swamp;x0;22;y0;11;unlocks;15;xp;10;gp;0|name;outer cemetery;x0;33;y0;11;unlocks;16;xp;10;gp;0|name;inner cemetery;x0;44;y0;11;unlocks;17;xp;50;gp;30|name;* victory *;x0;55;y0;11;unlocks;18;xp;20;gp;0|name;twisted grove;x0;66;y0;11;unlocks;19;xp;10;gp;0|name;roadside shrine;x0;77;y0;11;unlocks;20,21;xp;10;gp;10|name;mountain vault (side quest);x0;0;y0;11;unlocks;;xp;10;gp;0|name;mountain maze;x0;99;y0;11;unlocks;22;xp;10;gp;0|name;ritual chamber;x0;110;y0;11;unlocks;;xp;50;gp;0",true)lvls[dlvl].unlocked=1tO=split("\n| |!|'|(|)|,|-|.|/|2|:|;|?|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|m|n|o|p|q|r|s|t|v|w|y|THE |OU|S |D ","|",false)ew=m(eh(17151))nu=m(eh(8191))S=u("id;1;name;skel;spr;64;maxhp;4;pshld;0|id;2;name;zomb;spr;68;maxhp;8;pshld;0|id;3;name;skel+;spr;72;maxhp;6;pshld;1|id;4;name;zomb+;spr;76;maxhp;12;pshld;0|id;5;name;sklar;spr;80;maxhp;3;pshld;0|id;6;name;cult;spr;84;maxhp;6;summon;1;pshld;0|id;7;name;bndt;spr;130;maxhp;8;pshld;0|id;8;name;wolf;spr;88;maxhp;5;pshld;0|id;9;name;warg;spr;92;maxhp;9;pshld;1|id;10;name;tree;spr;96;maxhp;8;pshld;0|id;11;name;spdr;spr;100;maxhp;1;pshld;0|id;12;name;orb;spr;104;maxhp;6;pshld;0;obj;1|id;13;name;grav;spr;108;maxhp;1;summon;4;pshld;2;obj;1|id;14;name;grav ;spr;112;maxhp;1;summon;4;pshld;2;obj;1|id;15;name;rat;spr;116;maxhp;2;pshld;0|id;16;name;bear;spr;134;maxhp;70;pshld;0|id;17;name;golem;spr;120;maxhp;8;pshld;5|id;18;name;shdw;spr;52;maxhp;5;summon;18;pshld;0|id;19;name;shdw+;spr;56;maxhp;8;summon;18;pshld;0|id;20;name;noah;spr;60;maxhp;24;summon;19;pshld;8|id;21;name;hero;spr;124;maxhp;20;pshld;0|id;22;name;hero+;spr;125;maxhp;24;pshld;1|id;23;name;hero*;spr;126;maxhp;99;pshld;9",true)tb="init;57;act;😐3|act;█3/init;60;act;😐1|act;█4/init;30;act;😐2|act;♥2/init;21;act;😐3|act;█2/init;19;act;😐2|act;█2,init;78;act;█7/init;72;act;😐1|act;█4/init;56;act;😐1|act;█2∧/init;67;act;😐1|act;█5,init;57;act;😐4|act;█4/init;60;act;😐2|act;█5/init;30;act;😐3|act;♥3/init;21;act;😐4|act;█3/init;19;act;😐3|act;█3,init;78;act;█8/init;72;act;😐1|act;█7/init;56;act;😐2|act;█4∧/init;67;act;😐1|act;█6∧,init;21;act;😐1|act;█2➡️3/init;40;act;█3➡️3/init;50;act;😐1|act;█1➡️4∧/init;70;act;😐1|act;█3➡️3/init;37;act;😐2|act;█1➡️3,init;40;act;😐1|act;█1/init;30;act;😐1|act;█2/init;90;act;call,init;54;act;😐1|act;█4/init;44;act;😐2|act;█3/init;34;act;😐3|act;█2/init;51;act;😐3|act;█2➡️2/init;22;act;★2|act;█3/init;36;act;★2|act;♥2,init;65;act;howl/init;11;act;😐4|act;█3/init;22;act;😐5|act;█2/init;35;act;😐4|act;█2∧,init;60;act;howl/init;8;act;😐4|act;█4∧/init;17;act;😐5|act;█2∧/init;20;act;😐4|act;█3∧,init;60;act;█4/init;72;act;█3/init;80;act;█5/init;64;act;█2➡️3,init;10;act;😐1|act;█1▥/init;24;act;😐2|act;█1▥/init;14;act;😐2|act;█1/init;26;act;😐1|act;█2,init;99;act;♥1/init;99;act;♥1,init;99;act;♥1/init;99;act;♥1/init;50;act;call,init;99;act;♥1/init;99;act;♥1/init;99;act;♥1/init;99;act;♥1/init;50;act;call,init;22;act;😐3|act;█1/init;38;act;😐3|act;█1/init;32;act;😐2|act;█2/init;35;act;😐1|act;█2,init;18;act;😐2|act;█3∧/init;52;act;😐3|act;█5∧/init;57;act;😐3|act;█5∧/init;68;act;😐2|act;█8∧,init;50;act;😐2|act;█4/init;50;act;😐2|act;█4/init;50;act;😐2|act;█4/init;50;act;😐2|act;█4/init;50;act;😐2|act;█4➡️2,init;40;act;😐2|act;█3/init;53;act;😐3|act;█2/init;70;act;♥2|act;█2➡️2/init;90;act;call,init;53;act;😐1|act;█2➡️3/init;70;act;♥1|act;█2➡️4/init;90;act;call,init;39;act;😐2|act;█3➡️4/init;52;act;😐1|act;█2➡️4/init;69;act;♥1|act;█1➡️6/init;60;act;😐2|act;█2➡️5/init;43;act;😐1|act;█1➡️5▥/init;80;act;😐2|act;call/init;80;act;😐3|act;call,init;15;act;😐2|act;█4/init;15;act;😐2|act;█2➡️3/init;35;act;😐3|act;█3/init;23;act;★2|act;█2➡️3/init;65;act;♥4|act;█2/init;70;act;😐3|act;█5➡️2,init;15;act;😐2|act;█4/init;15;act;😐2|act;█3➡️3/init;17;act;😐2|act;█2▥/init;11;act;★4|act;█3➡️3/init;73;act;😐6|act;█3∧/init;31;act;😐5|act;█6/init;65;act;♥4|act;█2/init;48;act;★4|act;█7▥,init;15;act;😐2|act;█4/init;15;act;😐2|act;█3➡️3/init;17;act;😐2|act;█2▥/init;11;act;😐4|act;█3➡️3/init;73;act;😐6|act;█3∧/init;31;act;😐5|act;█6/init;65;act;😐3|act;♥4/init;48;act;😐4|act;█7▥"edecks={}for n in all(split(tb))do add(edecks,u(n,true))end p=u("name;you;spr;2;maxhp;10;hp;10;pshld;0;shld;0;ox;0;oy;0;sox;0;soy;0",true)p_xp,p_gp,x=0,10,1v=u("init;13;act;😐3;status;0;name;\n dash|init;22;act;█2;status;0;name;\n slice|init;42;act;█3;status;0;name;\n chop|init;31;act;😐4웃▒;status;0;name;\n leap|init;32;act;█3➡️3;status;0;name;\n dart|init;28;act;█2◆2;status;0;name;\n thrust|init;55;act;█2➡️5;status;0;name;\n volley|init;54;act;█5➡️4▒;status;0;name;\n missile|init;36;act;♥4▒;status;0;name; first\n aid|init;74;act;😐3;status;0;name;\nshuffle|init;85;act;⬅️2;status;0;name; loot\nlocally|init;45;act;█3∧;status;0;name;\n slash|init;25;act;😐5;status;0;name;\nsidestep|init;20;act;█2◆4;status;0;name;\n bash|init;33;act;█1➡️4░;status;0;name; arrow\n spray|init;10;act;★5;status;0;name; shield\n self|init;30;act;█2∧░;status;0;name;spinning\n blades|init;25;act;█2➡️6▥;status;0;name;numbing\n venom|init;13;act;😐9웃▒;status;0;name; artful\nparkour|init;46;act;█3➡️5∧;status;0;name;piercing\n missile|init;75;act;⬅️5▒;status;0;name; gather\ngreedily|init;36;act;♥5;status;0;name; herbal\n remedy|init;21;act;█3◆6;status;0;name; judo\n throw|init;26;act;█8∧▒;status;0;name; razor\n trap|init;58;act;█3➡️4░;status;0;name;blot out\n the sun|init;62;act;█3▥░;status;0;name;stinging\n shivs|init;34;act;█6➡️5;status;0;name; doomed\n quarrel|init;10;act;smite;status;0;name;\n smite\n\nᶜ6divine\n torrent\n of hail\n\nᶜ8(debug\n assist)|init;99;act;rest;status;0;name; long\n rest\n\nᶜ6heal 3\n\n⁴drefresh\n items\n\n⁴dᶜ8burnᶜ6 the\n2nd card\n chosen",true)ng=v[#v]pdeck={}nv=11for n=1,nv do add(pdeck,v[n])end nk(pdeck)I=m("/2;-2;-1;-1;-1;-1;+0;+0;+0;+0;+0;+0;+1;+1;+1;+1;+2;*2",true)nA={}n6=m("-2;-1;-1>+0;+0;+0>+1;>+1;+0>+2;+1>+2;+0>+1∧;+0>+2;+0;+1>+3;>+2;>+1∧;-1",true)P={}e5=7for n=1,e5 do add(P,n6[n])end e3={}nL=u("init;60;act;😐 swift ³f●60;status;0;name; swift\n boots\n\nᶜ6default\n 😐2 is\n now 😐3;icon;😐;shortname;swift|init;60;act;い life ●60;status;0;name; life\n charm\n\nᶜ6negate a\n killing\n blow\n\n(refresh\n on long\n rest);icon;い;shortname;life|init;50;act;웃 belt ●50;status;0;name; winged\n belt\n\nᶜ6default\n 😐 move\n also\n 웃 jumps;icon;웃;shortname;belt|init;70;act;➡️ quivr ³f●70;status;0;name;endless\n quiver\n\nᶜ6default\n █2 atk\n is now\n █2➡️3;icon;➡️;shortname;quivr|init;60;act;う goggl ³f●60;status;0;name; keen\ngoggles\n\nᶜ6+3➡️ rng\n for all\n ranged\n attacks;icon;う;shortname;goggl|init;40;act;★ shld ●40;status;0;name; great\n shield\n\nᶜ6★2 first\n round\n attackd\n\n(refresh\n on long\n rest);icon;★;shortname;shld|init;90;act;お razor ³f●90;status;0;name; razor\n tips\n\nᶜ6+1█ dmg\n to all\n ranged\n attacks;icon;お;shortname;razor|init;150;act;え mail ●150;status;0;name; great\n mail\n\nᶜ6permnent\n +★1;icon;え;shortname;mail|init;;act;done;status;0;name;\n done\n\nᶜ6return\nto town;icon;;shortname;done",true)V={}for n in all(nL)do add(V,n)end pitems={}end function tA()a=0f,o=tD,tw end function tw()ns(0,0,127,127,5,13)r("ᶜ7hunterᶜ6¹3 ♥ ᶜ6"..p.maxhp.." ᶜ7lVL ᶜ6"..x.."/9\n¹9 ● ᶜ6"..p_gp.." ᶜ7xp ³eᶜ6"..p_xp.."/"..tostr(min(x*80,640)).."\n\n\n⁴eᶜ6aCTIONS: ³fmODS: ³fiTEMS:\n\n\n\n\n\n\n\n\n\n\n\n\n\n¹b ⁴ecAMPAIGN tOTALS:\n\n⁴b¹b █"..X.." ●"..Z.." か"..tostr(M\10).."MIN",7,6)line(1,24,126,24,13)na({pdeck,e6(I),pitems},-2,31,nil,3,42)end function e6(n)local e,n=tp(n),{}for e,t in pairs(e)do add(n,"ᶜ5"..t.."x ᶜ6"..e)end return n end function tD()if(btnp(🅾️))n(n8)
end function tg()f,o=tS,tU n4={"sTART nEW gAME"}if(dget2(0)>0)add(n4,"cONTINUE gAME",1)
end function tS()h(1,#n4)if btnp(🅾️)then if(n4[e]=="cONTINUE gAME")tk()n"town"else dset2(0,0)n"newlevel"
end end function tU()if(n0%10==0)cls(1)print("¹f ¹c ᶜ0V1.0cᶜ6\n\n¹5 ⁴d⁶i⁶t⁶w⁶bᶜcpicohaven 2⁶-w⁶-t⁶-i\n¹b ᶜd⁶iᶠBY ICEGOATᵉ⁶-i\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n⁴bᶜd¹2 ᶠCONTROLS:ᵉ\n⁴b\n¹6 ³eᶜcさしᶜd,ᶜc🅾️ᶜd:³fsELECTᶜd ᶜc❎ᶜd:³fcANCEL\n¹9 ³f(ᶜcZᶜd)¹8 ³d(ᶜcXᶜd)",0,1)e2(n4,38,84,7)map(121,0,36,36,7,5)y("█2➡️5",8,45)y("😐3웃",8,56)
end function ty()p.maxhp+=1x+=1i"uPGRADE aCTION dECK::\n cHOOSE UPGRADE AND\n A CARD TO REPLACE"c"¹c ³fᶜcさし🅾️ᶜ6:cONFIRM"a,L=2,{{},{}}E,K=44,84nm={pdeck,tv(x)}f,o=tL,e4 end function tv(n)return{v[nv+2*n-3],v[nv+2*n-2]}end function tL()h(2,#pdeck)e=min(e,#nm[a])if btnp(🅾️)then local e=nm[a][e]if(L[a]==e)L[a]={}else L[a]=e
local e,t=L[1],L[2]if(e.init and t.init)i(e.act.." -> "..t.act)add(pdeck,t)del(pdeck,e)nk(pdeck)n"upgrademod"
end end function tT()em(x)i"uPGRADE YOUR DECK\n OF mODIFIER cARDS:"c"¹c ³fᶜcし🅾️ᶜ6:cONFIRM"a,L=2,{}E,K=44,84nm={e6(I),P}f,o=tC,e4 end function em(n)add(P,n6[e5+n-1])end function tC()h(2,#P,2)if(btnp(🅾️))local e=P[e]e7(e)n"town"
end function e4()Y(5)r("ᶜ6deck: ³eupgrades:",15,5)na(nm,0,10,L,0,nil,state=="upgrademod")ni()end function e7(n)local i,e,t=er(n)if(e)del(I,e)
if(t)add(I,t)
del(P,n)add(e3,n)end function er(n)local e,t,i="summary:\n"if(n[1]~=">")t=sub(n,1,2)e..="\nremove\n mod "..t n=sub(n,3)
if(#n>0and n[1]==">")i=sub(n,2)e..="\n\nadd\n mod "..i
return e,t,i end function t9()ep()e8="yOU RETURN TO THE TOWN OF pICOHAVEN. "O=m"vIEW pROFILE;rEVIEW sTORY;sHOP FOR gEAR"if(p_xp>=x*80and x<9)e8..="yOU HAVE GAINED ENOUGH xp TO lEVEL uP! "add(O,"* lEVEL uP *",1)
if wongame==1then add(O,"* retire *",1)else for n in all(lvls)do if(n.unlocked==1)add(O,"->"..n.name)
end end add(O,"cHANGE dIFFICULTY: "..W[s].txt)f,o=tH,tG end function tG()cls(5)print("ᶜ7 wHAT nEXT?ᶠ⁴9ᶜ0⁶w⁶t¹4 ⌂ ⌂\n\n¹a ³c⌂ ⌂\n¹c ⌂\n\n\n\nᵉ",0,36)nE(e8,29,8,8,6)line(8,43,68,43,7)e2(O,8,48)end function tH()h(1,#O)if btnp(🅾️)then local e=O[e]if e=="vIEW pROFILE"then n"profile"elseif e=="rEVIEW sTORY"then if(J)mapmsg=nu[J]
dlvl=J eu()n"pretown"elseif e=="* lEVEL uP *"then n"upgradedeck"elseif e=="* retire *"then o=tF g="town"f=nt elseif e=="sHOP FOR gEAR"then n"store"elseif sub(e,1,2)=="->"then dlvl=l(lvls,sub(e,3),"name")Q=min(Q,s)n"newlevel"elseif sub(e,1,10)=="cHANGE dIF"then s=s%4+1O[#O]="cHANGE dIFFICULTY: "..W[s].txt ep()end end end function tR()i"yOU BROWSE THE STORE.."c"ᶜcし🅾️ᶜ6:sELECT"f,o=tM,tW end function tM()h(1,#V)if(btnp(🅾️))local e=V[e]if e.act=="done"then n"town"elseif p_gp<e.init then i"nOT ENOUGH gOLD."else i("yOU BOUGHT "..e.shortname)add(pitems,e)del(V,e)p_gp-=e.init end
end function tW()Y(5)na({V},0,0)r("ᶜ7you have:\n ●"..p_gp,86,6)ni()end function tF()fillp(-0x4ee0.a)rectfill(0,0,127,127,6)fillp()rectfill(8,8,119,119,5)nE(nu[#nu],26,12,12,6)r("ᶜ7cAMPAIGN sTATS ("..W[Q].txt..")\n █kILLS: ᶜc"..X.."\n ●gOLD: ³eᶜc"..Z.."ᶜ6\n かtIME: ³eᶜc"..tostr(M\600).."ᶜ6Hᶜc"..tostr(M\10%60).."ᶜ6MIN",12,70)end function nz(e,t,i,a)local n=no if(i)n=function(n)return no(n,false,true)end
if(a)n=function(n)return no(n,false,false,true)end
return tP(e,t,z,n)end function tP(t,f,d,r,e)local n,o={last=t,cost_from_start=0,cost_to_goal=d(t,f,e)},{}o[nn(t,e)]=n local t,i,u,l={n},1,nn(f,e),32767.99while i>0do local c,a=l for n=1,i do local e=t[n].cost_from_start+t[n].cost_to_goal if(e<=c)a,c=n,e
end n=t[a]t[a],n.dead=t[i],true i-=1local a=n.last if nn(a,e)==u then a={f}while(n.prev)n=o[nn(n.prev,e)]add(a,n.last,1)
return a end for c in all(r(a,e))do local r=nn(c,e)local n,u=o[r],n.cost_from_start+1if(not n)n={last=c,cost_from_start=l,cost_to_goal=d(c,f,e)}i+=1t[i],o[r]=n,n
if(not n.dead and n.cost_from_start>u)n.cost_from_start,n.prev=u,a
end end end function nn(n)return n.y*128+n.x end function e9()cartdata"icegoat_picohaven2_08"eE=1b=0end function dset2(n,e)b=e or b poke2(24064+2*b,n)b+=1end function dget2(n)b=n or b b+=1return peek2(24062+2*b)end function tk()eE,nw,Z,X,M,J,x,p.maxhp,p_xp,p_gp,wongame,s,Q=peek2(24064,13)pdeck={}for n=1,dget2(20)do add(pdeck,v[dget2()])end for n=1,dget2(32)do em(n+1)e7(n6[dget2()])end pitems={}for n=1,dget2(41)do local n=nL[dget2()]add(pitems,n)del(V,n)end for n=1,dget2(50)do lvls[n].unlocked=dget2()end end function ep()poke2(24064,eE,nw,Z,X,M,J,x,p.maxhp,p_xp,p_gp,wongame,s,Q)nC(20,pdeck,v)nC(32,e3,n6)nC(41,pitems,nL)dset2(#lvls,50)for n in all(lvls)do dset2(n.unlocked)end end function nC(e,n,t)dset2(#n,e)for n in all(n)do dset2(l(t,n))end end