├── pork.p8 ├── pork_tilemask.p8 └── readme.md /pork.p8: -------------------------------------------------------------------------------- 1 | pico-8 cartridge // http://www.pico-8.com 2 | version 16 3 | __lua__ 4 | function _init() 5 | t=0 6 | shake=0 7 | 8 | dpal=explodeval("0,1,1,2,1,13,6,4,4,9,3,13,1,13,14") 9 | 10 | dirx=explodeval("-1,1,0,0,1,1,-1,-1") 11 | diry=explodeval("0,0,-1,1,-1,1,1,-1") 12 | 13 | itm_name=explode("butter knife,cheese knife,paring knife,utility knife,chef's knife,meat cleaver,paper apron,cotton apron,rubber apron,leather apron,chef's apron,butcher's apron,food 1,food 2,food 3,food 4,food 5,food 6,spork,salad fork,fish fork,dinner fork") 14 | itm_type=explode("wep,wep,wep,wep,wep,wep,arm,arm,arm,arm,arm,arm,fud,fud,fud,fud,fud,fud,thr,thr,thr,thr") 15 | itm_stat1=explodeval("1,2,3,4,5,6,0,0,0,0,1,2,1,2,3,4,5,6,1,2,3,4") 16 | itm_stat2=explodeval("0,0,0,0,0,0,1,2,3,4,3,3,0,0,0,0,0,0,0,0,0,0") 17 | itm_minf=explodeval("1,2,3,4,5,6,1,2,3,4,5,6,1,1,1,1,1,1,1,2,3,4") 18 | itm_maxf=explodeval("3,4,5,6,7,8,3,4,5,6,7,8,8,8,8,8,8,8,4,6,7,8") 19 | itm_desc=explode(",,,,,,,,,,,, heals, heals a lot, increases hp, stuns, is cursed, is blessed,,,,") 20 | 21 | mob_name=explode("player,slime,melt,shoggoth,mantis-man,giant scorpion,ghost,golem,drake") 22 | mob_ani=explodeval("240,192,196,200,204,208,212,216,220") 23 | mob_atk=explodeval("1,1,2,1,2,3,3,5,5") 24 | mob_hp=explodeval("5,1,2,3,3,4,5,14,8") 25 | mob_los=explodeval("4,4,4,4,4,4,4,4,4") 26 | mob_minf=explodeval("0,1,2,3,4,5,6,7,8") 27 | mob_maxf=explodeval("0,3,4,5,6,7,8,8,8") 28 | mob_spec=explode(",,,spawn?,fast?,stun,ghost,slow,") 29 | 30 | crv_sig=explodeval("255,214,124,179,233") 31 | crv_msk=explodeval("0,9,3,12,6") 32 | 33 | free_sig=explodeval("0,0,0,0,16,64,32,128,161,104,84,146") 34 | free_msk=explodeval("8,4,2,1,6,12,9,3,10,5,10,5") 35 | 36 | wall_sig=explodeval("251,233,253,84,146,80,16,144,112,208,241,248,210,177,225,120,179,0,124,104,161,64,240,128,224,176,242,244,116,232,178,212,247,214,254,192,48,96,32,160,245,250,243,249,246,252") 37 | wall_msk=explodeval("0,6,0,11,13,11,15,13,3,9,0,0,9,12,6,3,12,15,3,7,14,15,0,15,6,12,0,0,3,6,12,9,0,9,0,15,15,7,15,14,0,0,0,0,0,0") 38 | 39 | debug={} 40 | startgame() 41 | end 42 | 43 | function _update60() 44 | t+=1 45 | _upd() 46 | dofloats() 47 | dohpwind() 48 | end 49 | 50 | function _draw() 51 | doshake() 52 | _drw() 53 | drawind() 54 | drawlogo() 55 | --fadeperc=0 56 | checkfade() 57 | --★ 58 | cursor(4,4) 59 | color(8) 60 | for txt in all(debug) do 61 | print(txt) 62 | end 63 | end 64 | 65 | function startgame() 66 | poke(0x3101,194) 67 | music(0) 68 | tani=0 69 | fadeperc=1 70 | buttbuff=-1 71 | 72 | logo_t=240 73 | logo_y=35 74 | 75 | skipai=false 76 | win=false 77 | winfloor=9 78 | --★ 79 | mob={} 80 | dmob={} 81 | p_mob=addmob(1,1,1) 82 | 83 | p_t=0 84 | 85 | inv,eqp={},{} 86 | makeipool() 87 | foodnames() 88 | --takeitem(17) 89 | 90 | wind={} 91 | float={} 92 | 93 | talkwind=nil 94 | 95 | hpwind=addwind(5,5,28,13,{}) 96 | 97 | thrdx,thrdy=0,-1 98 | 99 | _upd=update_game 100 | _drw=draw_game 101 | 102 | st_steps,st_kills,st_meals,st_killer=0,0,0,"" 103 | 104 | genfloor(0) 105 | 106 | end 107 | -->8 108 | --updates 109 | function update_game() 110 | if talkwind then 111 | if getbutt()==5 then 112 | sfx(53) 113 | talkwind.dur=0 114 | talkwind=nil 115 | end 116 | else 117 | dobuttbuff() 118 | dobutt(buttbuff) 119 | buttbuff=-1 120 | end 121 | end 122 | 123 | function update_inv() 124 | --inventory 125 | if move_mnu(curwind) and curwind==invwind then 126 | showhint() 127 | end 128 | if btnp(4) then 129 | sfx(53) 130 | if curwind==invwind then 131 | _upd=update_game 132 | invwind.dur=0 133 | statwind.dur=0 134 | if hintwind then 135 | hintwind.dur=0 136 | end 137 | --★ 138 | elseif curwind==usewind then 139 | usewind.dur=0 140 | curwind=invwind 141 | end 142 | elseif btnp(5) then 143 | sfx(54) 144 | if curwind==invwind and invwind.cur!=3 then 145 | showuse() 146 | --★ 147 | elseif curwind==usewind then 148 | -- use window confirm 149 | triguse() 150 | end 151 | end 152 | end 153 | 154 | function update_throw() 155 | local b=getbutt() 156 | if b>=0 and b<=3 then 157 | thrdx=dirx[b+1] 158 | thrdy=diry[b+1] 159 | end 160 | if b==4 then 161 | _upd=update_game 162 | elseif b==5 then 163 | throw() 164 | end 165 | end 166 | 167 | function move_mnu(wnd) 168 | local moved=false 169 | if btnp(2) then 170 | sfx(56) 171 | wnd.cur-=1 172 | moved=true 173 | elseif btnp(3) then 174 | sfx(56) 175 | wnd.cur+=1 176 | moved=true 177 | end 178 | wnd.cur=(wnd.cur-1)%#wnd.txt+1 179 | return moved 180 | end 181 | 182 | 183 | function update_pturn() 184 | dobuttbuff() 185 | p_t=min(p_t+0.125,1) 186 | 187 | if p_mob.mov then 188 | p_mob:mov() 189 | end 190 | 191 | if p_t==1 then 192 | _upd=update_game 193 | if trig_step() then return end 194 | 195 | if checkend() and not skipai then 196 | doai() 197 | end 198 | skipai=false 199 | end 200 | end 201 | 202 | function update_aiturn() 203 | dobuttbuff() 204 | p_t=min(p_t+0.125,1) 205 | for m in all(mob) do 206 | if m!=p_mob and m.mov then 207 | m:mov() 208 | end 209 | end 210 | if p_t==1 then 211 | _upd=update_game 212 | if checkend() then 213 | if p_mob.stun then 214 | p_mob.stun=false 215 | doai() 216 | end 217 | end 218 | end 219 | end 220 | 221 | function update_gover() 222 | if btnp(❎) then 223 | sfx(54) 224 | fadeout() 225 | startgame() 226 | end 227 | end 228 | 229 | function dobuttbuff() 230 | if buttbuff==-1 then 231 | buttbuff=getbutt() 232 | end 233 | end 234 | 235 | function getbutt() 236 | for i=0,5 do 237 | if btnp(i) then 238 | return i 239 | end 240 | end 241 | return -1 242 | end 243 | 244 | function dobutt(butt) 245 | if butt<0 then return end 246 | if logo_t>0 then logo_t=0 end 247 | if butt<4 then 248 | moveplayer(dirx[butt+1],diry[butt+1]) 249 | elseif butt==5 then 250 | showinv() 251 | sfx(54) 252 | -- elseif butt==4 then 253 | --win=true 254 | --p_mob.hp=0 255 | --st_killer="slime" 256 | --genfloor(floor+1) 257 | --prettywalls() 258 | end 259 | end 260 | -->8 261 | --draws 262 | function draw_game() 263 | cls(0) 264 | if fadeperc==1 then return end 265 | animap() 266 | map() 267 | for m in all(dmob) do 268 | if sin(time()*8)>0 or m==p_mob then 269 | drawmob(m) 270 | end 271 | m.dur-=1 272 | if m.dur<=0 and m!=p_mob then 273 | del(dmob,m) 274 | end 275 | end 276 | 277 | for i=#mob,1,-1 do 278 | drawmob(mob[i]) 279 | end 280 | 281 | if _upd==update_throw then 282 | --★ 283 | local tx,ty=throwtile() 284 | local lx1,ly1=p_mob.x*8+3+thrdx*4,p_mob.y*8+3+thrdy*4 285 | local lx2,ly2=mid(0,tx*8+3,127),mid(0,ty*8+3,127) 286 | rectfill(lx1+thrdy,ly1+thrdx,lx2-thrdy,ly2-thrdx,0) 287 | 288 | local thrani,mb=flr(t/7)%2==0,getmob(tx,ty) 289 | if thrani then 290 | fillp(0b1010010110100101) 291 | else 292 | fillp(0b0101101001011010) 293 | end 294 | line(lx1,ly1,lx2,ly2,7) 295 | fillp() 296 | oprint8("+",lx2-1,ly2-2,7,0) 297 | 298 | if mb and thrani then 299 | mb.flash=1 300 | end 301 | end 302 | 303 | for x=0,15 do 304 | for y=0,15 do 305 | if fog[x][y]==1 then 306 | rectfill2(x*8,y*8,8,8,0) 307 | end 308 | end 309 | end 310 | 311 | for f in all(float) do 312 | oprint8(f.txt,f.x,f.y,f.c,0) 313 | end 314 | 315 | end 316 | 317 | function drawlogo() 318 | if logo_y>-24 then 319 | logo_t-=1 320 | if logo_t<=0 then 321 | logo_y+=logo_t/20 322 | end 323 | palt(12,true) 324 | palt(0,false) 325 | spr(144,7,logo_y,14,3) 326 | palt() 327 | oprint8("the quest for kielbasa",19,logo_y+20,7,0) 328 | end 329 | end 330 | 331 | function drawmob(m) 332 | local col=10 333 | if m.flash>0 then 334 | m.flash-=1 335 | col=7 336 | end 337 | drawspr(getframe(m.ani),m.x*8+m.ox,m.y*8+m.oy,col,m.flp) 338 | end 339 | 340 | --[[function draw_gover() 341 | cls(2) 342 | print("y ded",50,50,7) 343 | end 344 | 345 | function draw_win() 346 | cls(2) 347 | print("u win",50,50,7) 348 | end]]-- 349 | 350 | function draw_gover() 351 | cls() 352 | palt(12,true) 353 | spr(gover_spr,gover_x,30,gover_w,2) 354 | if not win then 355 | print("killed by a "..st_killer,28,43,6) 356 | end 357 | palt() 358 | color(5) 359 | cursor(40,56) 360 | if not win then 361 | print("floor: "..floor) 362 | end 363 | print("steps: "..st_steps) 364 | print("kills: "..st_kills) 365 | print("meals: "..st_meals) 366 | 367 | print("press ❎",46,90,5+abs(sin(time()/3)*2)) 368 | end 369 | 370 | function animap() 371 | tani+=1 372 | if (tani<15) return 373 | tani=0 374 | for x=0,15 do 375 | for y=0,15 do 376 | local tle=mget(x,y) 377 | if tle==64 or tle==66 then 378 | tle+=1 379 | elseif tle==65 or tle==67 then 380 | tle-=1 381 | end 382 | mset(x,y,tle) 383 | end 384 | end 385 | end 386 | 387 | -->8 388 | --tools 389 | 390 | function getframe(ani) 391 | return ani[flr(t/15)%#ani+1] 392 | end 393 | 394 | function drawspr(_spr,_x,_y,_c,_flip) 395 | palt(0,false) 396 | pal(6,_c) 397 | spr(_spr,_x,_y,1,1,_flip) 398 | pal() 399 | end 400 | 401 | function rectfill2(_x,_y,_w,_h,_c) 402 | --★ 403 | rectfill(_x,_y,_x+max(_w-1,0),_y+max(_h-1,0),_c) 404 | end 405 | 406 | function oprint8(_t,_x,_y,_c,_c2) 407 | for i=1,8 do 408 | print(_t,_x+dirx[i],_y+diry[i],_c2) 409 | end 410 | print(_t,_x,_y,_c) 411 | end 412 | 413 | function dist(fx,fy,tx,ty) 414 | local dx,dy=fx-tx,fy-ty 415 | return sqrt(dx*dx+dy*dy) 416 | end 417 | 418 | function dofade() 419 | local p,kmax,col,k=flr(mid(0,fadeperc,1)*100) 420 | for j=1,15 do 421 | col = j 422 | kmax=flr((p+j*1.46)/22) 423 | for k=1,kmax do 424 | col=dpal[col] 425 | end 426 | pal(j,col,1) 427 | end 428 | end 429 | 430 | function checkfade() 431 | if fadeperc>0 then 432 | fadeperc=max(fadeperc-0.04,0) 433 | dofade() 434 | end 435 | end 436 | 437 | function wait(_wait) 438 | repeat 439 | _wait-=1 440 | flip() 441 | until _wait<0 442 | end 443 | 444 | function fadeout(spd,_wait) 445 | if (spd==nil) spd=0.04 446 | if (_wait==nil) _wait=0 447 | repeat 448 | fadeperc=min(fadeperc+spd,1) 449 | dofade() 450 | flip() 451 | until fadeperc==1 452 | wait(_wait) 453 | end 454 | 455 | function blankmap(_dflt) 456 | local ret={} 457 | if (_dflt==nil) _dflt=0 458 | 459 | for x=0,15 do 460 | ret[x]={} 461 | for y=0,15 do 462 | ret[x][y]=_dflt 463 | end 464 | end 465 | return ret 466 | end 467 | 468 | function getrnd(arr) 469 | return arr[1+flr(rnd(#arr))] 470 | end 471 | 472 | function copymap(x,y) 473 | local tle 474 | for _x=0,15 do 475 | for _y=0,15 do 476 | tle=mget(_x+x,_y+y) 477 | mset(_x,_y,tle) 478 | if tle==15 then 479 | p_mob.x,p_mob.y=_x,_y 480 | end 481 | end 482 | end 483 | end 484 | 485 | function explode(s) 486 | local retval,lastpos={},1 487 | for i=1,#s do 488 | if sub(s,i,i)=="," then 489 | add(retval,sub(s, lastpos, i-1)) 490 | i+=1 491 | lastpos=i 492 | end 493 | end 494 | add(retval,sub(s,lastpos,#s)) 495 | return retval 496 | end 497 | 498 | function explodeval(_arr) 499 | return toval(explode(_arr)) 500 | end 501 | 502 | function toval(_arr) 503 | local _retarr={} 504 | for _i in all(_arr) do 505 | add(_retarr,flr(tonum(_i))) 506 | end 507 | return _retarr 508 | end 509 | 510 | function doshake() 511 | local shakex,shakey=16-rnd(32),16-rnd(32) 512 | camera(shakex*shake,shakey*shake) 513 | shake*=0.95 514 | if (shake<0.05) shake=0 515 | end 516 | -->8 517 | --gameplay 518 | 519 | function moveplayer(dx,dy) 520 | local destx,desty=p_mob.x+dx,p_mob.y+dy 521 | local tle=mget(destx,desty) 522 | 523 | if iswalkable(destx,desty,"checkmobs") then 524 | sfx(63) 525 | mobwalk(p_mob,dx,dy) 526 | st_steps+=1 527 | p_t=0 528 | _upd=update_pturn 529 | else 530 | --not walkable 531 | mobbump(p_mob,dx,dy) 532 | p_t=0 533 | _upd=update_pturn 534 | 535 | local mob=getmob(destx,desty) 536 | if mob then 537 | sfx(58) 538 | hitmob(p_mob,mob) 539 | else 540 | if fget(tle,1) then 541 | trig_bump(tle,destx,desty) 542 | else 543 | skipai=true 544 | --mset(destx,desty,1) 545 | end 546 | end 547 | end 548 | unfog() 549 | end 550 | 551 | function trig_bump(tle,destx,desty) 552 | if tle==7 or tle==8 then 553 | --vase 554 | sfx(59) 555 | mset(destx,desty,76) 556 | if rnd(3)<1 and floor>0 then 557 | if rnd(5)<1 then 558 | addmob(getrnd(mobpool),destx,desty) 559 | sfx(60) 560 | else 561 | if freeinvslot()==0 then 562 | showmsg("inventory full",120) 563 | sfx(60) 564 | else 565 | sfx(61) 566 | local itm=getrnd(fipool_com) 567 | takeitem(itm) 568 | showmsg(itm_name[itm].."!",60) 569 | end 570 | end 571 | end 572 | elseif tle==10 or tle==12 then 573 | --chest 574 | if freeinvslot()==0 then 575 | showmsg("inventory full",120) 576 | skipai=true 577 | sfx(60) 578 | else 579 | local itm=getrnd(fipool_com) 580 | if tle==12 then 581 | itm=getitm_rar() 582 | end 583 | sfx(61) 584 | mset(destx,desty,tle-1) 585 | takeitem(itm) 586 | showmsg(itm_name[itm].."!",60) 587 | end 588 | elseif tle==13 then 589 | --door 590 | sfx(62) 591 | mset(destx,desty,1) 592 | elseif tle==6 then 593 | --stone tablet 594 | if floor==0 then 595 | sfx(54) 596 | showtalk(explode(" welcome to porklike!,, climb this sausage, tower to obtain the, ultimate power of, the golden kielbasa, ")) 597 | end 598 | elseif tle==110 then 599 | --kielbasa 600 | win=true 601 | end 602 | end 603 | 604 | function trig_step() 605 | local tle=mget(p_mob.x,p_mob.y) 606 | 607 | if tle==14 then 608 | sfx(55) 609 | p_mob.bless=0 610 | fadeout() 611 | genfloor(floor+1) 612 | floormsg() 613 | return true 614 | end 615 | return false 616 | end 617 | 618 | function getmob(x,y) 619 | for m in all(mob) do 620 | if m.x==x and m.y==y then 621 | return m 622 | end 623 | end 624 | return false 625 | end 626 | 627 | function iswalkable(x,y,mode) 628 | local mode = mode or "test" 629 | 630 | --sight 631 | if inbounds(x,y) then 632 | local tle=mget(x,y) 633 | if mode=="sight" then 634 | return not fget(tle,2) 635 | else 636 | if not fget(tle,0) then 637 | if mode=="checkmobs" then 638 | return not getmob(x,y) 639 | end 640 | return true 641 | end 642 | end 643 | end 644 | return false 645 | end 646 | 647 | function inbounds(x,y) 648 | return not (x<0 or y<0 or x>15 or y>15) 649 | end 650 | 651 | function hitmob(atkm,defm,rawdmg) 652 | local dmg= atkm and atkm.atk or rawdmg 653 | 654 | --add curse/bless 655 | if defm.bless<0 then 656 | dmg*=2 657 | elseif defm.bless>0 then 658 | dmg=flr(dmg/2) 659 | end 660 | defm.bless=0 661 | 662 | local def=defm.defmin+flr(rnd(defm.defmax-defm.defmin+1)) 663 | dmg-=min(def,dmg) 664 | --dmg=max(0,dmg) 665 | 666 | defm.hp-=dmg 667 | defm.flash=10 668 | 669 | addfloat("-"..dmg,defm.x*8,defm.y*8,9) 670 | 671 | shake=defm==p_mob and 0.08 or 0.04 672 | 673 | if defm.hp<=0 then 674 | if defm!=p_mob then 675 | st_kills+=1 676 | else 677 | st_killer=atkm.name 678 | end 679 | 680 | add(dmob,defm) 681 | del(mob,defm) 682 | defm.dur=10 683 | end 684 | end 685 | 686 | function healmob(mb,hp) 687 | hp=min(mb.hpmax-mb.hp,hp) 688 | mb.hp+=hp 689 | mb.flash=10 690 | 691 | addfloat("+"..hp,mb.x*8,mb.y*8,7) 692 | sfx(51) 693 | end 694 | 695 | function stunmob(mb) 696 | mb.stun=true 697 | mb.flash=10 698 | addfloat("stun",mb.x*8-3,mb.y*8,7) 699 | sfx(51) 700 | end 701 | 702 | function blessmob(mb,val) 703 | mb.bless=mid(-1,1,mb.bless+val) 704 | mb.flash=10 705 | 706 | local txt="bless" 707 | if val<0 then txt="curse" end 708 | 709 | addfloat(txt,mb.x*8-6,mb.y*8,7) 710 | 711 | if mb.spec=="ghost" and val>0 then 712 | add(dmob,mb) 713 | del(mob,mb) 714 | mb.dur=10 715 | end 716 | sfx(51) 717 | end 718 | 719 | function checkend() 720 | if win then 721 | music(24) 722 | gover_spr,gover_x,gover_w=112,15,13 723 | showgover() 724 | return false 725 | elseif p_mob.hp<=0 then 726 | music(22) 727 | gover_spr,gover_x,gover_w=80,28,9 728 | showgover() 729 | return false 730 | end 731 | return true 732 | end 733 | 734 | function showgover() 735 | wind,_upd,_drw={},update_gover,draw_gover 736 | fadeout(0.02) 737 | end 738 | 739 | function los(x1,y1,x2,y2) 740 | local frst,sx,sy,dx,dy=true 741 | --★ 742 | if dist(x1,y1,x2,y2)==1 then return true end 743 | if y1>y2 then 744 | x1,x2,y1,y2=x2,x1,y2,y1 745 | end 746 | sy,dy=1,y2-y1 747 | 748 | if x1-dy then 760 | err-=dy 761 | x1+=sx 762 | end 763 | if e28 898 | --ui 899 | 900 | function addwind(_x,_y,_w,_h,_txt) 901 | local w={x=_x, 902 | y=_y, 903 | w=_w, 904 | h=_h, 905 | txt=_txt} 906 | add(wind,w) 907 | return w 908 | end 909 | 910 | function drawind() 911 | for w in all(wind) do 912 | local wx,wy,ww,wh=w.x,w.y,w.w,w.h 913 | rectfill2(wx,wy,ww,wh,0) 914 | rect(wx+1,wy+1,wx+ww-2,wy+wh-2,6) 915 | wx+=4 916 | wy+=4 917 | clip(wx,wy,ww-8,wh-8) 918 | if w.cur then 919 | wx+=6 920 | end 921 | for i=1,#w.txt do 922 | local txt,c=w.txt[i],6 923 | if w.col and w.col[i] then 924 | c=w.col[i] 925 | end 926 | print(txt,wx,wy,c) 927 | if i==w.cur then 928 | spr(255,wx-5+sin(time()),wy) 929 | end 930 | wy+=6 931 | end 932 | clip() 933 | 934 | if w.dur then 935 | w.dur-=1 936 | if w.dur<=0 then 937 | local dif=w.h/4 938 | w.y+=dif/2 939 | w.h-=dif 940 | if w.h<3 then 941 | del(wind,w) 942 | end 943 | end 944 | else 945 | if w.butt then 946 | oprint8("❎",wx+ww-15,wy-1+sin(time()),6,0) 947 | end 948 | end 949 | end 950 | end 951 | 952 | function showmsg(txt,dur) 953 | local wid=(#txt+2)*4+7 954 | local w=addwind(63-wid/2,50,wid,13,{" "..txt}) 955 | w.dur=dur 956 | end 957 | 958 | function showtalk(txt) 959 | talkwind=addwind(16,50,94,#txt*6+7,txt) 960 | talkwind.butt=true 961 | end 962 | 963 | function addfloat(_txt,_x,_y,_c) 964 | add(float,{txt=_txt,x=_x,y=_y,c=_c,ty=_y-10,t=0}) 965 | end 966 | 967 | function dofloats() 968 | for f in all(float) do 969 | f.y+=(f.ty-f.y)/10 970 | f.t+=1 971 | if f.t>70 then 972 | del(float,f) 973 | end 974 | end 975 | end 976 | 977 | function dohpwind() 978 | hpwind.txt[1]="♥"..p_mob.hp.."/"..p_mob.hpmax 979 | local hpy=5 980 | if p_mob.y<8 then 981 | hpy=110 982 | end 983 | hpwind.y+=(hpy-hpwind.y)/5 984 | end 985 | 986 | function showinv() 987 | local txt,col,itm,eqt={},{} 988 | _upd=update_inv 989 | for i=1,2 do 990 | itm=eqp[i] 991 | if itm then 992 | eqt=itm_name[itm] 993 | add(col,6) 994 | else 995 | eqt= i==1 and "[weapon]" or "[armor]" 996 | add(col,5) 997 | end 998 | add(txt,eqt) 999 | end 1000 | add(txt,"……………………") 1001 | add(col,6) 1002 | for i=1,6 do 1003 | itm=inv[i] 1004 | if itm then 1005 | add(txt,itm_name[itm]) 1006 | add(col,6) 1007 | else 1008 | add(txt,"...") 1009 | add(col,5) 1010 | end 1011 | end 1012 | 1013 | 1014 | invwind=addwind(5,17,84,62,txt) 1015 | invwind.cur=3 1016 | invwind.col=col 1017 | 1018 | txt="ok " 1019 | if p_mob.bless<0 then 1020 | txt="curse " 1021 | elseif p_mob.bless>0 then 1022 | txt="bless " 1023 | end 1024 | 1025 | statwind=addwind(5,5,84,13,{txt.."atk:"..p_mob.atk.." def:"..p_mob.defmin.."-"..p_mob.defmax}) 1026 | 1027 | curwind=invwind 1028 | end 1029 | 1030 | function showuse() 1031 | local itm=invwind.cur<3 and eqp[invwind.cur] or inv[invwind.cur-3] 1032 | if itm==nil then return end 1033 | local typ,txt=itm_type[itm],{} 1034 | 1035 | if (typ=="wep" or typ=="arm") and invwind.cur>3 then 1036 | add(txt,"equip") 1037 | end 1038 | if typ=="fud" then 1039 | add(txt,"eat") 1040 | end 1041 | if typ=="thr" or typ=="fud" then 1042 | add(txt,"throw") 1043 | end 1044 | add(txt,"trash") 1045 | 1046 | usewind=addwind(84,invwind.cur*6+11,36,7+#txt*6,txt) 1047 | usewind.cur=1 1048 | curwind=usewind 1049 | end 1050 | 1051 | function triguse() 1052 | local verb,i,back=usewind.txt[usewind.cur],invwind.cur,true 1053 | local itm=i<3 and eqp[i] or inv[i-3] 1054 | 1055 | if verb=="trash" then 1056 | if i<3 then 1057 | eqp[i]=nil 1058 | else 1059 | inv[i-3]=nil 1060 | end 1061 | elseif verb=="equip" then 1062 | local slot=2 1063 | if itm_type[itm]=="wep" then 1064 | slot=1 1065 | end 1066 | inv[i-3]=eqp[slot] 1067 | eqp[slot]=itm 1068 | elseif verb=="eat" then 1069 | eat(itm,p_mob) 1070 | _upd,inv[i-3],p_mob.mov,p_t,back=update_pturn,nil,nil,0,false 1071 | elseif verb=="throw" then 1072 | _upd,thrslt,back=update_throw,i-3,false 1073 | end 1074 | 1075 | updatestats() 1076 | usewind.dur=0 1077 | 1078 | if back then 1079 | del(wind,invwind) 1080 | del(wind,statwind) 1081 | showinv() 1082 | invwind.cur=i 1083 | showhint() 1084 | else 1085 | invwind.dur=0 1086 | statwind.dur=0 1087 | if hintwind then 1088 | hintwind.dur=0 1089 | end 1090 | end 1091 | end 1092 | 1093 | function floormsg() 1094 | showmsg("floor "..floor,120) 1095 | end 1096 | 1097 | function showhint() 1098 | if hintwind then 1099 | hintwind.dur=0 1100 | hintwind=nil 1101 | end 1102 | 1103 | if invwind.cur>3 then 1104 | local itm=inv[invwind.cur-3] 1105 | 1106 | if itm and itm_type[itm]=="fud" then 1107 | local txt=itm_known[itm] and itm_name[itm]..itm_desc[itm] or "???" 1108 | hintwind=addwind(5,78,#txt*4+7,13,{txt}) 1109 | end 1110 | 1111 | end 1112 | 1113 | end 1114 | -->8 1115 | --mobs and items 1116 | 1117 | function addmob(typ,mx,my) 1118 | local m={ 1119 | x=mx, 1120 | y=my, 1121 | ox=0, 1122 | oy=0, 1123 | flp=false, 1124 | ani={}, 1125 | flash=0, 1126 | stun=false, 1127 | bless=0, 1128 | charge=1, 1129 | lastmoved=false, 1130 | spec=mob_spec[typ], 1131 | hp=mob_hp[typ], 1132 | hpmax=mob_hp[typ], 1133 | atk=mob_atk[typ], 1134 | defmin=0, 1135 | defmax=0, 1136 | los=mob_los[typ], 1137 | task=ai_wait, 1138 | name=mob_name[typ] 1139 | } 1140 | for i=0,3 do 1141 | add(m.ani,mob_ani[typ]+i) 1142 | end 1143 | add(mob,m) 1144 | return m 1145 | end 1146 | 1147 | function mobwalk(mb,dx,dy) 1148 | mb.x+=dx --? 1149 | mb.y+=dy 1150 | 1151 | mobflip(mb,dx) 1152 | mb.sox,mb.soy=-dx*8,-dy*8 1153 | mb.ox,mb.oy=mb.sox,mb.soy 1154 | mb.mov=mov_walk 1155 | end 1156 | 1157 | function mobbump(mb,dx,dy) 1158 | mobflip(mb,dx) 1159 | mb.sox,mb.soy=dx*8,dy*8 1160 | mb.ox,mb.oy=0,0 1161 | mb.mov=mov_bump 1162 | end 1163 | 1164 | function mobflip(mb,dx) 1165 | mb.flp = dx==0 and mb.flp or dx<0 1166 | 1167 | end 1168 | 1169 | 1170 | function mov_walk(self) 1171 | local tme=1-p_t 1172 | self.ox=self.sox*tme 1173 | self.oy=self.soy*tme 1174 | end 1175 | 1176 | function mov_bump(self) 1177 | --★ 1178 | local tme= p_t>0.5 and 1-p_t or p_t 1179 | self.ox=self.sox*tme 1180 | self.oy=self.soy*tme 1181 | end 1182 | 1183 | function doai() 1184 | local moving=false 1185 | for m in all(mob) do 1186 | if m!=p_mob then 1187 | m.mov=nil 1188 | if m.stun then 1189 | m.stun=false 1190 | else 1191 | m.lastmoved=m.task(m) 1192 | moving=m.lastmoved or moving 1193 | end 1194 | end 1195 | end 1196 | if moving then 1197 | _upd=update_aiturn 1198 | p_t=0 1199 | else 1200 | p_mob.stun=false 1201 | end 1202 | end 1203 | 1204 | function ai_wait(m) 1205 | if cansee(m,p_mob) then 1206 | --aggro 1207 | m.task=ai_attac 1208 | m.tx,m.ty=p_mob.x,p_mob.y 1209 | addfloat("!",m.x*8+2,m.y*8,10) 1210 | end 1211 | return false 1212 | end 1213 | 1214 | function ai_attac(m) 1215 | if dist(m.x,m.y,p_mob.x,p_mob.y)==1 then 1216 | --attack player 1217 | local dx,dy=p_mob.x-m.x,p_mob.y-m.y 1218 | mobbump(m,dx,dy) 1219 | if m.spec=="stun" and m.charge>0 then 1220 | stunmob(p_mob) 1221 | m.charge-=1 1222 | elseif m.spec=="ghost" and m.charge>0 then 1223 | hitmob(m,p_mob) 1224 | blessmob(p_mob,-1) 1225 | m.charge-=1 1226 | else 1227 | hitmob(m,p_mob) 1228 | end 1229 | sfx(57) 1230 | return true 1231 | else 1232 | --move to player 1233 | if cansee(m,p_mob) then 1234 | m.tx,m.ty=p_mob.x,p_mob.y 1235 | end 1236 | 1237 | if m.x==m.tx and m.y==m.ty then 1238 | --de aggro 1239 | m.task=ai_wait 1240 | addfloat("?",m.x*8+2,m.y*8,10) 1241 | else 1242 | if m.spec=="slow" and m.lastmoved then 1243 | return false 1244 | end 1245 | local bdst,cand=999,{} 1246 | calcdist(m.tx,m.ty) 1247 | for i=1,4 do 1248 | local dx,dy=dirx[i],diry[i] 1249 | local tx,ty=m.x+dx,m.y+dy 1250 | if iswalkable(tx,ty,"checkmobs") then 1251 | local dst=distmap[tx][ty] 1252 | if dst0 then 1262 | local c=getrnd(cand) 1263 | mobwalk(m,dirx[c],diry[c]) 1264 | return true 1265 | end 1266 | --todo: re-aquire target? 1267 | end 1268 | end 1269 | return false 1270 | end 1271 | 1272 | function cansee(m1,m2) 1273 | return dist(m1.x,m1.y,m2.x,m2.y)<=m1.los and los(m1.x,m1.y,m2.x,m2.y) 1274 | end 1275 | 1276 | function spawnmobs() 1277 | 1278 | mobpool={} 1279 | for i=2,#mob_name do 1280 | if mob_minf[i]<=floor and mob_maxf[i]>=floor then 1281 | add(mobpool,i) 1282 | end 1283 | end 1284 | 1285 | if #mobpool==0 then return end 1286 | 1287 | local minmons=explodeval("3,5,7,9,10,11,12,13") 1288 | local maxmons=explodeval("6,10,14,18,20,22,24,26") 1289 | 1290 | local placed,rpot=0,{} 1291 | 1292 | for r in all(rooms) do 1293 | add(rpot,r) 1294 | end 1295 | 1296 | repeat 1297 | local r=getrnd(rpot) 1298 | placed+=infestroom(r) 1299 | del(rpot,r) 1300 | until #rpot==0 or placed>maxmons[floor] 1301 | 1302 | if placed=minmons[floor] 1311 | end 1312 | end 1313 | 1314 | function infestroom(r) 1315 | if r.nospawn then return 0 end 1316 | local target,x,y=2+flr(rnd((r.w*r.h)/6-1)) 1317 | target=min(5,target) 1318 | for i=1,target do 1319 | repeat 1320 | x=r.x+flr(rnd(r.w)) 1321 | y=r.y+flr(rnd(r.h)) 1322 | until iswalkable(x,y,"checkmobs") and (mget(x,y)==1 or mget(x,y)==4) 1323 | addmob(getrnd(mobpool),x,y) 1324 | end 1325 | return target 1326 | end 1327 | 1328 | ------------------------- 1329 | -- items 1330 | ------------------------- 1331 | 1332 | function takeitem(itm) 1333 | local i=freeinvslot() 1334 | if i==0 then return false end 1335 | inv[i]=itm 1336 | return true 1337 | end 1338 | 1339 | function freeinvslot() 1340 | for i=1,6 do 1341 | if not inv[i] then 1342 | return i 1343 | end 1344 | end 1345 | return 0 1346 | end 1347 | 1348 | function makeipool() 1349 | ipool_rar={} 1350 | ipool_com={} 1351 | 1352 | for i=1,#itm_name do 1353 | local t=itm_type[i] 1354 | if t=="wep" or t=="arm" then 1355 | add(ipool_rar,i) 1356 | else 1357 | add(ipool_com,i) 1358 | end 1359 | end 1360 | end 1361 | 1362 | function makefipool() 1363 | fipool_rar={} 1364 | fipool_com={} 1365 | 1366 | for i in all(ipool_rar) do 1367 | if itm_minf[i]<=floor 1368 | and itm_maxf[i]>=floor then 1369 | add(fipool_rar,i) 1370 | end 1371 | end 1372 | for i in all(ipool_com) do 1373 | if itm_minf[i]<=floor 1374 | and itm_maxf[i]>=floor then 1375 | add(fipool_com,i) 1376 | end 1377 | end 1378 | end 1379 | 1380 | function getitm_rar() 1381 | if #fipool_rar>0 then 1382 | local itm=getrnd(fipool_rar) 1383 | del(fipool_rar,itm) 1384 | del(ipool_rar,itm) 1385 | return itm 1386 | else 1387 | return getrnd(fipool_com) 1388 | end 1389 | end 1390 | 1391 | function foodnames() 1392 | local fud,fu=explode("jerky,schnitzel,steak,gyros,fricassee,haggis,mett,kebab,burger,meatball,pizza,calzone,pasticio,chops,hams,ribs,roast,meatloaf,chili,stew,pie,wrap,taco,burrito,rolls,filet,salami,sandwich,casserole,spam,souvlaki") 1393 | local adj,ad=explode("yellow,green,blue,purple,black,sweet,salty,spicy,strange,old,dry,wet,smooth,soft,crusty,pickled,sour,leftover,mom's,steamed,hairy,smoked,mini,stuffed,classic,marinated,bbq,savory,baked,juicy,sloppy,cheesy,hot,cold,zesty") 1394 | 1395 | itm_known={} 1396 | for i=1,#itm_name do 1397 | if itm_type[i]=="fud" then 1398 | fu,ad=getrnd(fud),getrnd(adj) 1399 | del(fud,fu) 1400 | del(adj,ad) 1401 | itm_name[i]=ad.." "..fu 1402 | itm_known[i]=false 1403 | end 1404 | end 1405 | end 1406 | -->8 1407 | --gen 1408 | 1409 | function genfloor(f) 1410 | floor=f 1411 | makefipool() 1412 | mob={} 1413 | add(mob,p_mob) 1414 | fog=blankmap(0) 1415 | if floor==1 then 1416 | st_steps=0 1417 | poke(0x3101,66) 1418 | end 1419 | if floor==0 then 1420 | copymap(16,0) 1421 | elseif floor==winfloor then 1422 | copymap(32,0) 1423 | else 1424 | fog=blankmap(1) 1425 | mapgen() 1426 | unfog() 1427 | end 1428 | end 1429 | 1430 | 1431 | function mapgen() 1432 | 1433 | --todo 1434 | --entry not in an alcove? 1435 | 1436 | repeat 1437 | copymap(48,0) 1438 | rooms={} 1439 | roomap=blankmap(0) 1440 | doors={} 1441 | genrooms() 1442 | mazeworm() 1443 | placeflags() 1444 | carvedoors() 1445 | until #flaglib==1 1446 | 1447 | carvescuts() 1448 | startend() 1449 | fillends() 1450 | prettywalls() 1451 | 1452 | installdoors() 1453 | 1454 | spawnchests() 1455 | spawnmobs() 1456 | decorooms() 1457 | end 1458 | 1459 | ---------------- 1460 | -- rooms 1461 | ---------------- 1462 | 1463 | function genrooms() 1464 | -- tweak dis 1465 | local fmax,rmax=5,4 --5,4? 1466 | local mw,mh=10,10 --5,5? 1467 | 1468 | repeat 1469 | local r=rndroom(mw,mh) 1470 | if placeroom(r) then 1471 | if #rooms==1 then 1472 | mw/=2 1473 | mh/=2 1474 | end 1475 | rmax-=1 1476 | else 1477 | fmax-=1 1478 | --★ 1479 | if r.w>r.h then 1480 | mw=max(mw-1,3) 1481 | else 1482 | mh=max(mh-1,3) 1483 | end 1484 | end 1485 | until fmax<=0 or rmax<=0 1486 | end 1487 | 1488 | function rndroom(mw,mh) 1489 | --clamp max area 1490 | local _w=3+flr(rnd(mw-2)) 1491 | mh=mid(35/_w,3,mh) 1492 | local _h=3+flr(rnd(mh-2)) 1493 | return { 1494 | x=0, 1495 | y=0, 1496 | w=_w, 1497 | h=_h 1498 | } 1499 | end 1500 | 1501 | function placeroom(r) 1502 | local cand,c={} 1503 | 1504 | for _x=0,16-r.w do 1505 | for _y=0,16-r.h do 1506 | if doesroomfit(r,_x,_y) then 1507 | add(cand,{x=_x,y=_y}) 1508 | end 1509 | end 1510 | end 1511 | 1512 | if #cand==0 then return false end 1513 | 1514 | c=getrnd(cand) 1515 | r.x=c.x 1516 | r.y=c.y 1517 | add(rooms,r) 1518 | for _x=0,r.w-1 do 1519 | for _y=0,r.h-1 do 1520 | mset(_x+r.x,_y+r.y,1) 1521 | roomap[_x+r.x][_y+r.y]=#rooms 1522 | end 1523 | end 1524 | return true 1525 | end 1526 | 1527 | function doesroomfit(r,x,y) 1528 | for _x=-1,r.w do 1529 | for _y=-1,r.h do 1530 | if iswalkable(_x+x,_y+y) then 1531 | return false 1532 | end 1533 | end 1534 | end 1535 | 1536 | return true 1537 | end 1538 | 1539 | ---------------- 1540 | -- maze 1541 | ---------------- 1542 | 1543 | function mazeworm() 1544 | repeat 1545 | local cand={} 1546 | for _x=0,15 do 1547 | for _y=0,15 do 1548 | if cancarve(_x,_y,false) and not nexttoroom(_x,_y) then 1549 | add(cand,{x=_x,y=_y}) 1550 | end 1551 | end 1552 | end 1553 | 1554 | if #cand>0 then 1555 | local c=getrnd(cand) 1556 | digworm(c.x,c.y) 1557 | end 1558 | until #cand<=1 1559 | end 1560 | 1561 | function digworm(x,y) 1562 | local dr,stp=1+flr(rnd(4)),0 1563 | 1564 | repeat 1565 | mset(x,y,1) 1566 | if not cancarve(x+dirx[dr],y+diry[dr],false) or (rnd()<0.5 and stp>2) then 1567 | stp=0 1568 | local cand={} 1569 | for i=1,4 do 1570 | if cancarve(x+dirx[i],y+diry[i],false) then 1571 | add(cand,i) 1572 | end 1573 | end 1574 | if #cand==0 then 1575 | dr=8 1576 | else 1577 | dr=getrnd(cand) 1578 | end 1579 | end 1580 | x+=dirx[dr] 1581 | y+=diry[dr] 1582 | stp+=1 1583 | until dr==8 1584 | end 1585 | 1586 | function cancarve(x,y,walk) 1587 | if not inbounds(x,y) then return false end 1588 | local walk= walk==nil and iswalkable(x,y) or walk 1589 | 1590 | if iswalkable(x,y)==walk then 1591 | return sigarray(getsig(x,y),crv_sig,crv_msk)!=0 1592 | end 1593 | return false 1594 | end 1595 | 1596 | function bcomp(sig,match,mask) 1597 | local mask=mask and mask or 0 1598 | return bor(sig,mask)==bor(match,mask) 1599 | end 1600 | 1601 | function getsig(x,y) 1602 | local sig,digit=0 1603 | for i=1,8 do 1604 | local dx,dy=x+dirx[i],y+diry[i] 1605 | --★ 1606 | if iswalkable(dx,dy) then 1607 | digit=0 1608 | else 1609 | digit=1 1610 | end 1611 | sig=bor(sig,shl(digit,8-i)) 1612 | end 1613 | return sig 1614 | end 1615 | 1616 | function sigarray(sig,arr,marr) 1617 | for i=1,#arr do 1618 | if bcomp(sig,arr[i],marr[i]) then 1619 | return i 1620 | end 1621 | end 1622 | return 0 1623 | end 1624 | 1625 | 1626 | ---------------- 1627 | -- doorways 1628 | ---------------- 1629 | 1630 | function placeflags() 1631 | local curf=1 1632 | flags,flaglib=blankmap(0),{} 1633 | for _x=0,15 do 1634 | for _y=0,15 do 1635 | if iswalkable(_x,_y) and flags[_x][_y]==0 then 1636 | growflag(_x,_y,curf) 1637 | add(flaglib,curf) 1638 | curf+=1 1639 | end 1640 | end 1641 | end 1642 | end 1643 | 1644 | function growflag(_x,_y,flg) 1645 | local cand,candnew={{x=_x,y=_y}} 1646 | flags[_x][_y]=flg 1647 | repeat 1648 | candnew={} 1649 | for c in all(cand) do 1650 | for d=1,4 do 1651 | local dx,dy=c.x+dirx[d],c.y+diry[d] 1652 | if iswalkable(dx,dy) and flags[dx][dy]!=flg then 1653 | flags[dx][dy]=flg 1654 | add(candnew,{x=dx,y=dy}) 1655 | end 1656 | end 1657 | end 1658 | cand=candnew 1659 | until #cand==0 1660 | end 1661 | 1662 | function carvedoors() 1663 | local x1,y1,x2,y2,found,_f1,_f2,drs=1,1,1,1 1664 | repeat 1665 | drs={} 1666 | for _x=0,15 do 1667 | for _y=0,15 do 1668 | if not iswalkable(_x,_y) then 1669 | local sig=getsig(_x,_y) 1670 | found=false 1671 | if bcomp(sig,0b11000000,0b00001111) then 1672 | x1,y1,x2,y2,found=_x,_y-1,_x,_y+1,true 1673 | elseif bcomp(sig,0b00110000,0b00001111) then 1674 | x1,y1,x2,y2,found=_x+1,_y,_x-1,_y,true 1675 | end 1676 | _f1=flags[x1][y1] 1677 | _f2=flags[x2][y2] 1678 | if found and _f1!=_f2 then 1679 | add(drs,{x=_x,y=_y,f1=_f1,f2=_f2}) 1680 | end 1681 | end 1682 | end 1683 | end 1684 | 1685 | if #drs>0 then 1686 | local d=getrnd(drs) 1687 | --★ 1688 | add(doors,d) 1689 | mset(d.x,d.y,1) 1690 | growflag(d.x,d.y,d.f1) 1691 | del(flaglib,d.f2) 1692 | end 1693 | until #drs==0 1694 | end 1695 | 1696 | function carvescuts() 1697 | local x1,y1,x2,y2,cut,found,drs=1,1,1,1,0 1698 | repeat 1699 | drs={} 1700 | for _x=0,15 do 1701 | for _y=0,15 do 1702 | if not iswalkable(_x,_y) then 1703 | local sig=getsig(_x,_y) 1704 | found=false 1705 | if bcomp(sig,0b11000000,0b00001111) then 1706 | x1,y1,x2,y2,found=_x,_y-1,_x,_y+1,true 1707 | elseif bcomp(sig,0b00110000,0b00001111) then 1708 | x1,y1,x2,y2,found=_x+1,_y,_x-1,_y,true 1709 | end 1710 | if found then 1711 | calcdist(x1,y1) 1712 | if distmap[x2][y2]>20 then 1713 | add(drs,{x=_x,y=_y}) 1714 | end 1715 | end 1716 | end 1717 | end 1718 | end 1719 | 1720 | if #drs>0 then 1721 | local d=getrnd(drs) 1722 | add(doors,d) 1723 | mset(d.x,d.y,1) 1724 | cut+=1 1725 | end 1726 | until #drs==0 or cut>=3 1727 | end 1728 | 1729 | function fillends() 1730 | local filled,tle 1731 | repeat 1732 | filled=false 1733 | for _x=0,15 do 1734 | for _y=0,15 do 1735 | tle=mget(_x,_y) 1736 | --★ 1737 | if cancarve(_x,_y,true) and tle!=14 and tle!=15 then 1738 | filled=true 1739 | mset(_x,_y,2) 1740 | end 1741 | end 1742 | end 1743 | until not filled 1744 | end 1745 | 1746 | function isdoor(x,y) 1747 | local sig=getsig(x,y) 1748 | if bcomp(sig,0b11000000,0b00001111) or bcomp(sig,0b00110000,0b00001111) then 1749 | return nexttoroom(x,y) 1750 | end 1751 | return false 1752 | end 1753 | 1754 | function nexttoroom(x,y,dirs) 1755 | local dirs = dirs or 4 1756 | for i=1,dirs do 1757 | if inbounds(x+dirx[i],y+diry[i]) and 1758 | roomap[x+dirx[i]][y+diry[i]]!=0 then 1759 | return true 1760 | end 1761 | end 1762 | return false 1763 | end 1764 | 1765 | function installdoors() 1766 | for d in all(doors) do 1767 | local dx,dy=d.x,d.y 1768 | if (mget(dx,dy)==1 1769 | or mget(dx,dy)==4) 1770 | and isdoor(dx,dy) 1771 | and not next2tile(dx,dy,13) then 1772 | 1773 | mset(dx,dy,13) 1774 | end 1775 | end 1776 | end 1777 | 1778 | ---------------- 1779 | -- decoration 1780 | ---------------- 1781 | 1782 | function startend() 1783 | local high,low,px,py,ex,ey=0,9999 1784 | repeat 1785 | px,py=flr(rnd(16)),flr(rnd(16)) 1786 | until iswalkable(px,py) 1787 | calcdist(px,py) 1788 | --★ 1789 | for x=0,15 do 1790 | for y=0,15 do 1791 | local tmp=distmap[x][y] 1792 | if iswalkable(x,y) and tmp>high then 1793 | px,py,high=x,y,tmp 1794 | end 1795 | end 1796 | end 1797 | calcdist(px,py) 1798 | high=0 1799 | for x=0,15 do 1800 | for y=0,15 do 1801 | local tmp=distmap[x][y] 1802 | if tmp>high and cancarve(x,y) then 1803 | ex,ey,high=x,y,tmp 1804 | end 1805 | end 1806 | end 1807 | mset(ex,ey,14) 1808 | 1809 | for x=0,15 do 1810 | for y=0,15 do 1811 | local tmp=distmap[x][y] 1812 | if tmp>=0 then 1813 | local score=starscore(x,y) 1814 | tmp=tmp-score 1815 | if tmp=0 then 1816 | px,py,low=x,y,tmp 1817 | end 1818 | end 1819 | end 1820 | end 1821 | 1822 | if roomap[px][py]>0 then 1823 | rooms[roomap[px][py]].nospawn=true 1824 | end 1825 | mset(px,py,15) 1826 | p_mob.x,p_mob.y=px,py 1827 | end 1828 | 1829 | function starscore(x,y) 1830 | if roomap[x][y]==0 then 1831 | if nexttoroom(x,y,8) then return -1 end 1832 | if freestanding(x,y)>0 then 1833 | return 5 1834 | else 1835 | if (cancarve(x,y)) return 0 1836 | end 1837 | else 1838 | local scr=freestanding(x,y) 1839 | if scr>0 then 1840 | return scr<=8 and 3 or 0 1841 | end 1842 | end 1843 | return -1 1844 | end 1845 | 1846 | function next2tile(_x,_y,tle) 1847 | for i=1,4 do 1848 | if inbounds(_x+dirx[i],_y+diry[i]) and mget(_x+dirx[i],_y+diry[i])==tle then 1849 | return true 1850 | end 1851 | end 1852 | return false 1853 | end 1854 | 1855 | function prettywalls() 1856 | for x=0,15 do 1857 | for y=0,15 do 1858 | local tle=mget(x,y) 1859 | if tle==2 then 1860 | local ntle=sigarray(getsig(x,y),wall_sig,wall_msk) 1861 | tle = ntle==0 and 3 or 15+ntle 1862 | mset(x,y,tle) 1863 | elseif tle==1 then 1864 | if not iswalkable(x,y-1) then 1865 | mset(x,y,4) 1866 | end 1867 | end 1868 | end 1869 | end 1870 | end 1871 | 1872 | function decorooms() 1873 | tarr_dirt=explodeval("1,74,75,76") 1874 | tarr_farn=explodeval("1,70,70,70,71,71,71,72,73,74") 1875 | tarr_vase=explodeval("1,1,7,8") 1876 | local funcs,func,rpot={ 1877 | deco_dirt, 1878 | deco_torch, 1879 | deco_carpet, 1880 | deco_farn, 1881 | deco_vase 1882 | },deco_vase,{} 1883 | 1884 | for r in all(rooms) do 1885 | add(rpot,r) 1886 | end 1887 | 1888 | repeat 1889 | local r=getrnd(rpot) 1890 | del(rpot,r) 1891 | for x=0,r.w-1 do 1892 | for y=r.h-1,1,-1 do 1893 | if mget(r.x+x,r.y+y)==1 then 1894 | func(r,r.x+x,r.y+y,x,y) 1895 | end 1896 | end 1897 | end 1898 | func=getrnd(funcs) 1899 | until #rpot==0 1900 | end 1901 | 1902 | function deco_torch(r,tx,ty,x,y) 1903 | if rnd(3)>1 and y%2==1 and not next2tile(tx,ty,13) then 1904 | if x==0 then 1905 | mset(tx,ty,64) 1906 | elseif x==r.w-1 then 1907 | mset(tx,ty,66) 1908 | end 1909 | end 1910 | end 1911 | 1912 | function deco_carpet(r,tx,ty,x,y) 1913 | deco_torch(r,tx,ty,x,y) 1914 | if x>0 and y>0 and x0 and #rpot>0 do 1945 | local r=getrnd(rpot) 1946 | placechest(r,rare) 1947 | rare=false 1948 | place-=1 1949 | del(rpot,r) 1950 | end 1951 | end 1952 | 1953 | function placechest(r,rare) 1954 | local x,y 1955 | repeat 1956 | x=r.x+flr(rnd(r.w-2))+1 1957 | y=r.y+flr(rnd(r.h-2))+1 1958 | until mget(x,y)==1 1959 | mset(x,y,rare and 12 or 10) 1960 | end 1961 | 1962 | function freestanding(x,y) 1963 | return sigarray(getsig(x,y),free_sig,free_msk) 1964 | end 1965 | __gfx__ 1966 | 000000000000000066606660000000006660666066606660aaaaaaaa00aaa00000aaa00000000000000000000000000000aaa000a0aaa0a0a000000055555550 1967 | 000000000000000000000000000000000000000000000000aaaaaaaa0a000a000a000a00066666600aaaaaa066666660a0aaa0a000000000a0aa000000000000 1968 | 007007000000000060666060000000006066606060000060a000000a0a000a000a000a00060000600a0000a060000060a00000a0a0aaa0a0a0aa0aa055000000 1969 | 00077000000000000000000000000000000000000000000000aa0a0000aaa000a0aaa0a0060000600a0aa0a060000060a00a00a000aaa00000aa0aa055055000 1970 | 000770000000000066606660000000000000000060000060a000000a0a00aa00aa00aaa0066666600aaaaaa066666660aaa0aaa0a0aaa0a0a0000aa055055050 1971 | 007007000005000000000000000000000005000000000000a0a0aa0a0aaaaa000aaaaa000000000000000000000000000000000000aaa000a0aa000055055050 1972 | 000000000000000060666060000000000000000060666060a000000a00aaa00000aaa000066666600aaaaaa066666660aaaaaaa0a0aaa0a0a0aa0aa055055050 1973 | 000000000000000000000000000000000000000000000000aaaaaaaa000000000000000000000000000000000000000000000000000000000000000000000000 1974 | 00000000000000000000000006666660666666000666666006666600666666006660666066666660000066606660000066666660000066600000666066600000 1975 | 00000000000000000000000066666660666666606666666066666660666666606660666066666660000066606660000066666660000066600000666066600000 1976 | 00000000000000000000000066666660666666606666666066666660666666606660066066666660000006606600000066666660000066600000066066600000 1977 | 00000000000000000000000066600000000066606660000066606660000066606660000000000000000000000000000000000000000066600000000066600000 1978 | 00000660666666606600000066600000000066606660666066606660666066606660066066000660660006606600066000000660660066606666666066600660 1979 | 00006660666666606660000066600000000066606660666066606660666066606660666066606660666066606660666000006660666066606666666066606660 1980 | 00006660666666606660000066600000000066606660666066606660666066606660666066606660666066606660666000006660666066606666666066606660 1981 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1982 | 00006660066666006660000066600000000066600666666066606660666666006660666066606660666066606660666066606660666000006660666066666660 1983 | 00006660666666606660000066600000000066606666666066606660666666606660666066606660666066606660666066606660666000006660666066666660 1984 | 00006660666666606660000066600000000066606666666066000660666666606600066066006660660006606600066066600660660000006600666066666660 1985 | 00006660666066606660000066600000000066606660000000000000000066600000000000006660000000000000000066600000000000000000666000000000 1986 | 00006660666666606660000066666660666666606666666066000660666666606666666066006660000006606600000066600000666666600000666066000000 1987 | 00006660666666606660000066666660666666606666666066606660666666606666666066606660000066606660000066600000666666600000666066600000 1988 | 00006660066666006660000006666660666666000666666066606660666666006666666066606660000066606660000066600000666666600000666066600000 1989 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1990 | 00006660666666606660000066666660666066606660666066606660666066600000666066600000000066600000000066606660666000005000000088000088 1991 | 00006660666666606660000066666660666066606660666066606660666066600000666066600000000066600000000066606660666000005055000080000008 1992 | 00000660666666606600000066666660666066606660666066606660666066600000066066000000000006600000000066000660660000005055055000000000 1993 | 00000000000000000000000000000000666066606660000066606660000066600000000000000000000000000000000000000000000000000055055000000000 1994 | 00000000000000000000000066666660666066606666666066666660666666606600000000000660000006606600066000000000660000005000055000000000 1995 | 00000000000000000000000066666660666066606666666066666660666666606660000000006660000066606660666000000000666000005055000000000000 1996 | 00000000000000000000000066666660666066600666666006666600666666006660000000006660000066606660666000000000666000005055055080000008 1997 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088000088 1998 | 06000000000000000000060000000000505050506660666000000000000550000000000000000000000000000000000000000000000000000000000000000000 1999 | 60000000060000000000006000000600000000000000000000500500000000500500005005050050005000000000005000500000000000000000000000000000 2000 | 66000000660000000000066000000660505050506066606000050000055005000500005005000000000005000050055000000500000000000000000000000000 2001 | 00000000000000000000000000000000000000000000000005050000555050000005000000005000000000000000000005000000000000000000000000000000 2002 | 66000000660000000000066000000660505050505050505000005050000050500005050000005050000000000000000000055000000000000000000000000000 2003 | 0005000000050000000500000005000000000000000000000050500000050000050505000500005000050000005500500050050000aaaaa00000000000000000 2004 | 600000006000000000000060000000605050505050505050000050000005000005000000050500500000000005555000005550000aaaaaaaa000000000aaaa00 2005 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aa0aaaaaaaa00000aaaaaaa0 2006 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc00000000000000000000000000000000a00aaaaaaaaaaaaaaaaaaaaa 2007 | cc7777cc7777ccccccccccccccccccccc77777777cccccccccccccccccccccc77ccccccc00000000000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaa 2008 | ccc77cccc77ccccccccccccccccccccccc77cccc77ccccccccccccccccccccc77ccccccc00000000000000000000000000000000aaaaaaaaaaaaaaaaaaaaaa0a 2009 | cccc77cc77cc77777cc7777cc7777ccccc77ccccc77cc777777c7777777cccc77ccccccc00000000000000000000000000000000aaaaaaaaaaaaaaaaaaaaa0aa 2010 | ccccc7777cc77ccc77cc77cccc77cccccc77cccccc77cc77cc7cc77ccc77ccc77ccccccc000000000000000000000000000000000aaaaaaaaaaaaaaaaaaa0aa0 2011 | ccccc7777c77ccccc77c77cccc77cccccc77cccccc77cc77ccccc77cccc77cc77ccccccc0000000000000000000000000000000000aaaaaaaaaaaaaaa0a0a0a0 2012 | cccccc77cc77ccccc77c77cccc77cccccc77cccccc77cc7777ccc77cccc77cc77ccccccc00000000000000000000000000000000a00aaa0a0a0a0a0a0a0a0a0a 2013 | cccccc77cc77ccccc77c77cccc77cccccc77cccccc77cc77ccccc77cccc77cc77ccccccc00000000000000000000000000000000a0000aaaa0a0a0a0a0aaa00a 2014 | cccccc77cc77ccccc77c77cccc77cccccc77ccccc77ccc77ccccc77cccc77cc77ccccccc00000000000000000000000000000000aa000000aaaaaaaaaaa000aa 2015 | cccccc77ccc77ccc77ccc77cc77ccccccc77cccc77cccc77cc7cc77ccc77cccccccccccc00000000000000000000000000000000aa000aa000000000000000aa 2016 | ccccc7777ccc77777ccccc7777ccccccc77777777cccc777777c7777777cccc77ccccccc000000000000000000000000000000000aa0000aaaaaaaaaa0000aa0 2017 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000000000000a0aa00000000000000aa0a0 2018 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0000000000000000000000000000000000a00aa0000000000aa00a00 2019 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc00000000000000000000000000000000000aa00aaaaaaaaaa00aa000 2020 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0000000000000000000000000000000000000aa0000000000aa00000 2021 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000000000000000000aaaaaaaaaa0000000 2022 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000 2023 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000 2024 | cc7777cc777cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc77777ccccccccccccccccccc77ccccccc000000000000000000000000 2025 | ccc77cc77cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc777ccc77cccccccccccccccccc77ccccccc000000000000000000000000 2026 | ccc77c77cccc7777c777777c7777ccc777777ccccc77cccccc7777cccc77ccccccccc77cccc77c777777c77777777cc77ccccccc000000000000000000000000 2027 | ccc7777cccccc77ccc77cc7cc77ccccc77cc77ccc7777cccc77c77ccc7777ccccccc77ccccccccc77cc7cccc77cc7cc77ccccccc000000000000000000000000 2028 | ccc777ccccccc77ccc77ccccc77ccccc77cc77ccc7cc7cccc77cccccc7cc7ccccccc77ccccccccc77ccccccc77ccccc77ccccccc000000000000000000000000 2029 | ccc7777cccccc77ccc7777ccc777cccc77777ccc77cc7ccccc77cccc77cc7ccccccc77cccc7777c7777ccccc77ccccc77ccccccc000000000000000000000000 2030 | ccc77777ccccc77ccc77cccc777ccccc77cc77cc777777ccccc77ccc777777cccccc77ccccc77cc77ccccccc77ccccc77ccccccc000000000000000000000000 2031 | ccc77c777cccc77ccc77ccccc77ccccc77cc77cc77cc77cccccc77cc77cc77ccccccc77cccc77cc77ccccccc77ccccc77ccccccc000000000000000000000000 2032 | ccc77cc777ccc77ccc77cc7cc77cc7cc77cc77c77ccc77cc77cc77c77ccc77cccccccc77ccc77cc77cc7cccc77cccccccccccccc000000000000000000000000 2033 | cc7777cc777c7777c777777c777777c777777c7777cc777cc7777c7777cc777cccccccc77777cc777777ccc7777cccc77ccccccc000000000000000000000000 2034 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000 2035 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000 2036 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000 2037 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000000000000000000000 2038 | c0000000000000ccccccc000000000cc00000000000ccc0000000000000000000000000000000000000000000000000000000000000000cc0000000000000000 2039 | 0000000000000000ccc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000 2040 | 00777777777770000c000077777770000777777777700007777777700777777077777777000077777707777777007777707777777777700c0000000000000000 2041 | 0007777777777770000077777777777000777777777770007777770007777700077777700c0007777707777770007777707777777777700c0000000000000000 2042 | c00000777000777000077770000077770000777000777000007770000777000000077700ccc000777000077700007770000077700007700c0000000000000000 2043 | cc0000777000077700777000000000777000777000077700007770007770000c00077700cccc00777000077700077700000077700000700c0000000000000000 2044 | cccc007770000777007770000000007770007770000777000077700777000cccc0077700cccc00777000077700777000cc0077700000000c0000000000000000 2045 | cccc00777000077700770000000000077700777000077700007770777000ccccc0077700cccc0077700007770777000ccc007770007000cc0000000000000000 2046 | cccc0077700007700777007700077007770077700007700c00777777000cccccc0077700cccc007770000777777000cccc00777777700ccc0000000000000000 2047 | cccc0077700777700777007700077007770077700077700c0077777000ccccccc0077700cccc00777000077777000ccccc00777777700ccc0000000000000000 2048 | cccc007777777700077700770007700777007777777700cc00777777000cccccc0077700cccc007770000777777000cccc00777000700ccc0000000000000000 2049 | cccc0077777770000777000700070007770077777777000c007777777000ccccc0077700cccc0077700007777777000ccc007770000000cc0000000000000000 2050 | cccc007770000000077700000000000770007770077770000077707777000cccc0077700ccc000777000077707777000cc0077700000000c0000000000000000 2051 | cccc0077700000c000777000000000777000777000777700007770077770000cc0077700cc00007770000777007777000c0077700000700c0000000000000000 2052 | ccc000777000cccc00777000000000777000777000077770007770007777000000077700000700777000077700077770000077700007700c0000000000000000 2053 | cc00007770000ccc00077770000077770000777000007777007770000777770000077700007700777000077700007777700077700007700c0000000000000000 2054 | c0007777777000ccc0007777777777700007777700000777777777700077777700777777777707777770777777000777777777777777700c0000000000000000 2055 | c0077777777700cccc000077777770000077777770000077777777770000777707777777777707777770777777700007777777777777700c0000000000000000 2056 | c0000000000000ccccc000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000c0000000000000000 2057 | cc00000000000cccccccc000000000ccc000000000ccc000000000000cc000000000000000000000000000000000cc0000000000000000cc0000000000000000 2058 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0000000000000000 2059 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0000000000000000 2060 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0000000000000000 2061 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0000000000000000 2062 | 00000000000000000000000000000000000006000000000006000000000000000000000000060006000000000066006600066600000666000006660000066600 2063 | 00000000006660000000000000000000006600600006600060066000006600000066006600060006006600660600060000660600006606000066060000660600 2064 | 00666000060666000066600000000000006660606066600060666000006660600600060000600060060006000600060006666000066660000666606606666066 2065 | 06066600060666000606660006666660066666006066006006666600600660600066606000666060006660600066606006666666066666660666660606666606 2066 | 60666660066666006066666060066666600666000666660006660060066666000606660606666606066606060606060606666606006606060660660000660600 2067 | 66666660066666006666666066666666606660000666600000666060006666000666060606060606060666060660660666066000066000006606600006600000 2068 | 06666600006660000666660006666660006666000066660006666000066660000606666006606660066606600666666006606600006600000060660000660000 2069 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2070 | 00000000000000000000000000666000000066000000000000000000000000000000000000000000000666000000000000666600006666000066666600666600 2071 | 00666600000000000066660006600600000666600000660000000000000066000000000000066600006666660006660000066666000660660006606600066066 2072 | 06600060006666660660006006000000000606000006666000006600000666600006660000666666006666060066666600666666006666660066660000666666 2073 | 06660000066600000666000006660000060666660006060000066660000606000066666600666606066666660066660600060000000600000006000000060000 2074 | 00666600006666000066660000666600066666060606666600060600060666660066660606666666066666000666666600006600060066000000660006006600 2075 | 06066066060660660606606606066066006660000666660606066666066666060666666606666600066666660666660000006660060066600000666006006660 2076 | 06060660060606600606066006060660000000000066600006666606006660000666660006666666066606060666666606666600006666000666660000666600 2077 | 00000000000000000000000000000000000000000000000000666000000000000666666606660606066660000666060600000000000000000000000000000000 2078 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2079 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2080 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2081 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2082 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2083 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2084 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2085 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2086 | 00000000000606000000000000060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000 2087 | 00060600006666000006060000666600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077000000 2088 | 00666600000606660066660000060666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077700000 2089 | 00060666000666660006066600066666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077000000 2090 | 06066666006000000006666606000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000 2091 | 66000000066066000660000066066600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2092 | 66066606066066000660660066066606000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2093 | 00600600000660000060060000066000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2094 | __gff__ 2095 | 0000050500050303030103010307020005050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505000000000000000004040000000000010101000000000000000000000000000101010000000000000000000000000001030100000000000000000000000000000000 2096 | 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2097 | __map__ 2098 | 0202020202020202020202020202020203030303030303030303030303030303030303030303030303030303030303030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2099 | 020f0101010d01010707020801c00e0203030303030303030303030303030303030000000000000000000000000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2100 | 02010101070201010707020101c0c00203030303030303030303030303030303030000001011111111111200000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2101 | 0201010108020801010102010101010203030303030310111203030303030303030000002002020202022200000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2102 | 02010101080208010108020707010102030303101111240e2311111203030303030000002002050205022200000003030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2103 | 020101010102020d0202020202020d0203030320040445444504042203030303030000002004040404042200000003030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2104 | 02080101080201010102010d01010102030303204a01444444014b22030303030303000020014d4e4f012200000003030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2105 | 0208010808020101010201020d020202030303204001440644014322030303030303000020015d5e5f012200000003030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2106 | 02020d02020201c001020102c0c00802030303204801444444010122030303030303000020016d6e6f012200000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2107 | 01010101010d0101010201020101010203030320070101010101072203030303030000002001010101012200000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2108 | 0d02020202020101010201020101010203030320080701010108082203030303030000003014010101133200000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2109 | 0101010102020d02020201020101010203030330313114011331313203030303030000000020010f01220000000003030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2110 | 01010101020101010102010d010a0102030303030303200f2203030303030303030000000030313131320000000003030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2111 | 0101010102010c01c0020102c001010203030303030330313203030303030303030000000000000000000000000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2112 | 010101010d01c001010d01020101070203030303030303030303030303030303030000000000000000000000000000030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2113 | 0202020202020202020202020202020203030303030303030303030303030303030303030303030303030303030303030202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2114 | __sfx__ 2115 | 011600000217502705021150200002135000000210402104021250000002105000000215500000000000211401175017050111500105011350010500105001050112500105001050010501135001000000000000 2116 | 01160000215101d510195251a535215351d520195151a5152151221515215252252521525215150e51511515205141c510195251c535205351c520195151c5152051220515205252152520525205150d51510515 2117 | 0116000000000215101d510195151a515215151d510195151a5152151221515215152251521515215150e51511515205141c510195151c515205151c510195151c5152051220515205152151520515205150d515 2118 | 01160000150051d00515015150151a0251a0151d0151d015220252201521025210151d0251d0151502515015140201402214025140151400514004140050d000100140c0100d0201003014030150201401210015 2119 | 011600000217502705021150200002135000000000000000021250000000000000000215500000000000211405175001050511500105051350010500105001050512500105001050010505135000000000000000 2120 | 01160000215141d510195251a525215251d520195151a5152151221515215202252021525215150e52511515205141d5101852519525205251d520185151951520512205151c5201d52020525205151052511515 2121 | 0116000000000215141d510195151a515215151d510195151a5152151221515215102251021515215150e51511515205141d5101851519515205151d510185151951520512205151c5101d510205152051510515 2122 | 01160000000002000015015150151a0251a0151d0251d015220252201521015210151d0251d01526015260152502025012250152501518000000000000000000100000d02011030140401505014040190301d010 2123 | 011600000717502005071150200007135000000000000000071250000000000000000715500000000000711403175001050311500105031350010500105001050312500105001050010503155000000000000000 2124 | 01160000091750200509115020000913500000000000000009125000000000000000091550000000000091140a175001050a115001050a1250010504105001050a125001050910500105041350c1000912500100 2125 | 01160000225121f5201a5251f515225251f5201a5151f515215122151222525215251f5251f5150e52513515225141f5101b5251f525225251f5201b5151f515215122151222525215251f5251f5150f52513515 2126 | 01160000215141c510195251d515215251c520195151d5152151222510215201f51021512215150d52510515205141d5101a52516515205151d5201a5151651520522205151d515205251f5251d5151c52519515 2127 | 0116000000000225121f5101a5151f515225151f5101a5151f515215122151222515215151f5151f5150e51513515225141f5101b5151f515225151f5101b5151f515215122151222515215151f5151f5150f515 2128 | 0116000000000215141c510195151d515215151c510195151d5152151222510215101f51021510215150d51510515205141d5101a51516515205151d5101a5152051520510205151d515205151f5151d5151c515 2129 | 01160000000000000022015220151f0251f0151a0151a01522025220151f0151f01519020190221a0251a0151f0201f0221f0151f01518000000000000000000000000f010130201603015030160321502013015 2130 | 011600001902519015220252201521015210151c0251c015220252201521025210151c0221c0151d0251d01520020200222001520015110051a0151d015220152601226012280102601625010250122501025015 2131 | 011600000217509035110150203502135090351101502104021250000002105000000212511035110150211401175080351001501035011350803510015001050112500105001050010501135100351001500000 2132 | 0116000002175090351101502035021350903511015021040212500000021050000002155110351101502114051750c0351401505035051350c03514015001050512500105001050010505135140351401500000 2133 | 01160000071750e0351601507035071350e0351601502104071250000002105000000715516035160150711403175160351301503035031351603513015001050312500105001050010503135160351601500000 2134 | 0116000009175100351101509035091351003511015021040912500000021050000009155100350d015091140a17510035110150a0350a1351003511015001050a12500105001050010509135150350d01509020 2135 | 0116000002215020451a7051a7050e70511705117050e7050e71511725117250e7250e53511535115450e12501215010451a6001a70001205012051a3001a2001071514725147251072510535155351554514515 2136 | 0116000002215020451a7051a7050e70511705117050e7050e71511725117250e7250e53511535115450e12505215050451a6001a70001205012051a3001a2001171514725147251172511535195351954518515 2137 | 0116000007215070451a7051a7050e70511705117050e705137151672516725137251353516535165451312503215030451a6001a70001205012051a3001a2001371516725167250d7250f535165351654513515 2138 | 0116000009215090451a7051a7050e70511705117050e7050d715157251572510725115351653516545157250a2150a0451a6001a70001205012051a3001a2000e71510725117250e7250d5350e5351154510515 2139 | 0116000021005210051d00515015150151a0151a0151d0151d015220152201521015210151d0151d01515015150151401014012140151401518000000000000000000100100c0100d01010010140101501014010 2140 | 0116000000000000002000015015150151a0151a0151d0151d015220152201521015210151d0151a01526015260152501019015190151900518000000000000000000000000d0101101014010150101401019010 2141 | 0116000000000000000000022015220151f0151f0151a0151a01522015220151f0151f01519010190121a0151a0151f0101f012130151300518000000000000000000000000f0101301016010150101601215010 2142 | 01160000190051901519015220152201521015210151c0151c015220152201521015210151c0121c0151d0151d015200102001220015200051d0051a015220152901029012260102801628010280122801528005 2143 | 01160000097140e720117300e730097250e7251173502735057240e725117350e735097450e7401174002740087400d740107200d720087350d7351072501725047240d725107250d725087350d7301074001740 2144 | 01160000097240e720117300e730097450e745117350e735117240e725117350e735097450e740117400e740087400d740117200d720087350d735117250d725117240d725117250d725087350d730117400d740 2145 | 011600000a7240e720137300e7300a7450e745137350e735137240e725137350e7350a7450e740137400e7400a7400f740137200f7200a7350f735137250f725137240f725137250f7250a7350f730137400f740 2146 | 0116000010724097201073009730107450974510735097351072409725107350973510745097401074009740117400e740117200e720117350e735117250e725117240e725117250e725097350d730107400d740 2147 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2148 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2149 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2150 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2151 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2152 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2153 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2154 | 0113000029700297002670026700257002570022700227000000026700217000e7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2155 | 011300000255011555165501555016555115550d5500a5500e5500e5520e5520e5521400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2156 | 011300001170015700197001a700117001670019700197001a7001a70025700257002570025700257002570025700197021970219702000000000000000000000000000000000000000000000000000000000000 2157 | 001300000d2200c2200b220154000000000000000000000029720287302672626745287402173029720217322673026732267350210526702267020e705021050000000000000000000000000000000000000000 2158 | 0113000000000000000000000000000000000000000000000e1100d1200a1300e1350d135091000a120091300e1220e1200e1200e1000e1020e10200000000000000000000000000000000000000000000000000 2159 | 0113000000000000000000000000000000000000000000000a14300000000000a060090600a000090000900002072020720207202005020020200500000000000000000000000000000000000000000000000000 2160 | 011200001b0001f0002200023000220001f0002000022000230002700023000200001f000200001f0001b0001f00022000200002200023000270001d000200001f0001f0001f0001f00000000000000000000000 2161 | 011200001f5001f5001b5001b50022500225002350023500225002250020500205001f5001f500205002050022500225002350023500255002550023500235002250022500225002250000000000000000000000 2162 | 01120000030000300003000130000700007000080000800008000170000b0000b0000a0000a0000a0000f00003000030000800008000080001100005000050000300003000030000300003000030000300000000 2163 | 011200001e0201e0201e032210401a0401e0401f0301f0321f0301f0301e0201e0201f0201f020210302103022030220322902029020290222902228020280202602026020260222602200000000000000000000 2164 | 011200001a7041a70415534155301a5321a5301c5401c5401c5451a540155401554516532165301a5301a5351f5401f54522544225402254222545215341f5301e5441e5401e5421e54500000000000000000000 2165 | 01120000110250e000120351500015045150000e0550e00512045150051503515005130251500516035260051a0452100513045210051604526005100251f0050e0500e0520e0520e0500c000000000000000000 2166 | 0002000031530315302d500315003b5303b5302e5000050031530315302e5002d50039530395302d5000050031530315303153031530315203152000500005000050000500005000050000500005000050000500 2167 | 000100003101031010300102f0102d0202c0202a02028030270302503023050210501e0501d0501b05018050160501405012050120301103011010110100e0100b01007010000000000000000000000000000000 2168 | 00010000240102e0202b0202602021010210101a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2169 | 0001000024010337203372033720277103a7103a71000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2170 | 00030000096201163005620056150160000600006001160011600116001160001620006200a6100a6050a6000a6000f6000f6000f6000f6000060000600026100261002615016000160005600056000160001600 2171 | 00010000145201a520015000150001500015000150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2172 | 00010000211102114015140271300f6300f6101c610196001761016600156100f6000c61009600076000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2173 | 010100001b61006540065401963018630116100e6100c610096100861000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2174 | 000100001f5302b5302e5302e5303250032500395002751027510285102a510005000050000500275102951029510005000050000500005002451024510245102751029510005000050000500005000050000500 2175 | 0001000024030240301c0301c0302a2302823025210212101e2101b2101b21016210112100d2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100020000200 2176 | 0001000024030240301c0301c03039010390103a0103001030010300102d010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2177 | 00010000210302703025040230301a030190100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2178 | 000100000d720137200d7100c40031200312000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2179 | __music__ 2180 | 03 00424344 2181 | 01 00031843 2182 | 00 04071947 2183 | 00 080e1a4e 2184 | 00 090f1b4f 2185 | 00 10010243 2186 | 00 11050647 2187 | 00 120a0c4e 2188 | 00 130b0d4f 2189 | 00 001c0344 2190 | 00 041d0744 2191 | 00 081e0e44 2192 | 00 091f0f44 2193 | 00 00145c44 2194 | 00 04155d44 2195 | 00 08165e44 2196 | 02 13175f44 2197 | 00 41424344 2198 | 00 41424344 2199 | 00 41424344 2200 | 00 41424344 2201 | 00 68696744 2202 | 04 2a2b2c44 2203 | 00 6d6e6f44 2204 | 04 30313244 2205 | 2206 | -------------------------------------------------------------------------------- /pork_tilemask.p8: -------------------------------------------------------------------------------- 1 | pico-8 cartridge // http://www.pico-8.com 2 | version 16 3 | __lua__ 4 | function _init() 5 | sig={} 6 | msk={} 7 | 8 | inputdata() 9 | 10 | local txt="wall_sig={" 11 | local txt2="wall_msk={" 12 | for i=0,45 do 13 | txt=txt..sig[i].."," 14 | txt2=txt2..msk[i].."," 15 | end 16 | printh(txt,"tilemask.txt",true) 17 | printh(txt2,"tilemask.txt") 18 | end 19 | 20 | function inputdata() 21 | --simple walls 22 | sig[16]=0b10110011 23 | msk[16]=0b00001100 24 | 25 | sig[1]=0b11101001 26 | msk[1]=0b00000110 27 | 28 | sig[18]=0b01111100 29 | msk[18]=0b00000011 30 | 31 | sig[33]=0b11010110 32 | msk[33]=0b00001001 33 | 34 | --inside corners 35 | sig[2]=0b11111101 36 | msk[2]=0 37 | 38 | sig[34]=0b11111110 39 | msk[34]=0 40 | 41 | sig[32]=0b11110111 42 | msk[32]=0 43 | 44 | sig[0]=0b11111011 45 | msk[0]=0 46 | 47 | --outside corners 48 | sig[3]=0b01010100 49 | msk[3]=0b00001011 50 | 51 | sig[4]=0b10010010 52 | msk[4]=0b00001101 53 | 54 | sig[20]=0b10100001 55 | msk[20]=0b00001110 56 | 57 | sig[19]=0b01101000 58 | msk[19]=0b00000111 59 | 60 | --singletons 61 | sig[17]=0 62 | msk[17]=0b00001111 63 | 64 | sig[22]=0b11110000 65 | msk[22]=0 66 | 67 | --thin straights 68 | sig[35]=0b11000000 69 | msk[35]=0b00001111 70 | 71 | sig[36]=0b00110000 72 | msk[36]=0b00001111 73 | 74 | --thin corners 75 | sig[5]=0b01010000 76 | msk[5]=0b00001011 77 | 78 | sig[7]=0b10010000 79 | msk[7]=0b00001101 80 | 81 | sig[39]=0b10100000 82 | msk[39]=0b00001110 83 | 84 | sig[37]=0b01100000 85 | msk[37]=0b00000111 86 | 87 | --thin ends 88 | sig[6]=0b00010000 89 | msk[6]=0b00001111 90 | 91 | sig[23]=0b10000000 92 | msk[23]=0b00001111 93 | 94 | sig[38]=0b00100000 95 | msk[38]=0b00001111 96 | 97 | sig[21]=0b01000000 98 | msk[21]=0b00001111 99 | 100 | --underpants 101 | sig[8]=0b01110000 102 | msk[8]=0b00000011 103 | 104 | sig[9]=0b11010000 105 | msk[9]=0b00001001 106 | 107 | sig[24]=0b11100000 108 | msk[24]=0b00000110 109 | 110 | sig[25]=0b10110000 111 | msk[25]=0b00001100 112 | 113 | --three corners 114 | sig[10]=0b11110001 115 | msk[10]=0 116 | 117 | sig[11]=0b11111000 118 | msk[11]=0 119 | 120 | sig[26]=0b11110010 121 | msk[26]=0 122 | 123 | sig[27]=0b11110100 124 | msk[27]=0 125 | 126 | --thin-into-wall 127 | sig[42]=0b11110011 128 | msk[42]=0 129 | 130 | sig[43]=0b11111001 131 | msk[43]=0 132 | 133 | sig[44]=0b11110110 134 | msk[44]=0 135 | 136 | sig[45]=0b11111100 137 | msk[45]=0 138 | 139 | --odd diagonals 140 | sig[40]=0b11110101 141 | msk[40]=0 142 | 143 | sig[41]=0b11111010 144 | msk[41]=0 145 | 146 | --unloved children 1 147 | sig[12]=0b11010010 148 | msk[12]=0b00001001 149 | 150 | sig[13]=0b10110001 151 | msk[13]=0b00001100 152 | 153 | sig[29]=0b11101000 154 | msk[29]=0b00000110 155 | 156 | sig[28]=0b01110100 157 | msk[28]=0b00000011 158 | 159 | --unloved children 2 160 | sig[14]=0b11100001 161 | msk[14]=0b00000110 162 | 163 | sig[15]=0b01111000 164 | msk[15]=0b00000011 165 | 166 | sig[30]=0b10110010 167 | msk[30]=0b00001100 168 | 169 | sig[31]=0b11010100 170 | msk[31]=0b00001001 171 | end 172 | __gfx__ 173 | 000000000000000022222220d0ddd0d0f0fff0f000000000aaaaaaaa00aaa00000aaa00000000000000000000000000000aaa000a0aaa0a0a000000055555550 174 | 000000000000000022222220000000000000000000000000aaaaaaaa0a000a000a000a00066666600aaaaaa066666660a0aaa0a000000000a0aa000000000000 175 | 007007000000000022222220ddd0ddd0fff0fff000000000a000000a0a000a000a000a00060000600a0000a060000060a00000a0a0aaa0a0a0aa0aa055000000 176 | 00077000000000002222222000000000000000000000000000aa0a0000aaa000a0aaa0a0060000600a0aa0a060000060a00a00a000aaa00000aa0aa055055000 177 | 000770000000000022222220d0ddd0d0f0fff0f000000000a000000a0a00aa00aa00aaa0066666600aaaaaa066666660aaa0aaa0a0aaa0a0a0000aa055055050 178 | 007007000005000022222220000000000000000000000000a0a0aa0a0aaaaa000aaaaa000000000000000000000000000000000000aaa000a0aa000055055050 179 | 000000000000000022222220ddd0ddd0fff0fff000000000a000000a00aaa00000aaa000066666600aaaaaa066666660aaaaaaa0a0aaa0a0a0aa0aa055055050 180 | 000000000000000000000000000000000000000000000000aaaaaaaa000000000000000000000000000000000000000000000000000000000000000000000000 181 | 22222220222222202222222006666660666666000666666006666600666666006662666066666660222266606662222066666660222266602222666066622220 182 | 22222220222222202222222066666660666666606666666066666660666666606662666066666660222266606662222066666660222266602222666066622220 183 | 22222220222222202222222066666660666666606666666066666660666666606662266066666660222226606622222066666660222266602222266066622220 184 | 22222220222222202222222066622220222266606662222066626660222266606662222022222220222222202222222022222220222266602222222066622220 185 | 22222660666666606622222066622220222266606662666066626660666266606662266066222660662226606622266022222660662266606666666066622660 186 | 22226660666666606662222066622220222266606662666066626660666266606662666066626660666266606662666022226660666266606666666066626660 187 | 22226660666666606662222066622220222266606662666066626660666266606662666066626660666266606662666022226660666266606666666066626660 188 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 189 | 22226660066666006662222066622220222266600666666066626660666666006662666066626660666266606662666066626660666222206662666066666660 190 | 22226660666666606662222066622220222266606666666066626660666666606662666066626660666266606662666066626660666222206662666066666660 191 | 22226660666666606662222066622220222266606666666066222660666666606622266066226660662226606622266066622660662222206622666066666660 192 | 22226660666266606662222066622220222266606662222022222220222266602222222022226660222222202222222066622220222222202222666022222220 193 | 22226660666666606662222066666660666666606666666066222660666666606666666066226660222226606622222066622220666666602222666066222220 194 | 22226660666666606662222066666660666666606666666066626660666666606666666066626660222266606662222066622220666666602222666066622220 195 | 22226660066666006662222006666660666666000666666066626660666666006666666066626660222266606662222066622220666666602222666066622220 196 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 197 | 22226660666666606662222066666660666266606662666066626660666266602222666066622220222266602222222066626660666222200000000000000000 198 | 22226660666666606662222066666660666266606662666066626660666266602222666066622220222266602222222066626660666222200000000000000000 199 | 22222660666666606622222066666660666266606662666066626660666266602222266066222220222226602222222066222660662222200000000000000000 200 | 22222220222222202222222022222220666266606662222066626660222266602222222022222220222222202222222022222220222222200000000000000000 201 | 22222220222222202222222066666660666266606666666066666660666666606622222022222660222226606622266022222220662222200000000000000000 202 | 22222220222222202222222066666660666266606666666066666660666666606662222022226660222266606662666022222220666222200000000000000000 203 | 22222220222222202222222066666660666266600666666006666600666666006662222022226660222266606662666022222220666222200000000000000000 204 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 205 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 206 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 207 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 208 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 209 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 210 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 211 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 212 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 213 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 214 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 215 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 216 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 217 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 218 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 219 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 220 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 221 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 222 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 223 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 224 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 225 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 226 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 227 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 228 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 229 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 230 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 231 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 232 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 233 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 234 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 235 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 236 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 237 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 238 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 239 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 240 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 241 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 242 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 243 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 244 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 245 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 246 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 247 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 248 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 249 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 250 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 251 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 252 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 253 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 254 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 255 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 256 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 257 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 258 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 259 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 260 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 261 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 262 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 263 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 264 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 265 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 266 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 267 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 268 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 269 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 270 | 00000000006660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 271 | 00666000060666000066600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 272 | 06066600060666000606660006666660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 273 | 60666660066666006066666060066666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 274 | 66666660066666006666666066666666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 275 | 06666600006660000666660006666660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 276 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 277 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 278 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 279 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 280 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 281 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 282 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 283 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 284 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 285 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 286 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 287 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 288 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 289 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 290 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 291 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 292 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 293 | 00000000000606000000000000060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000 294 | 00060600006666000006060000666600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077000000 295 | 00666600000606660066660000060666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077700000 296 | 00060666000666660006066600066666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077000000 297 | 06066666006000000006666606000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000 298 | 66000000066066000660000066066600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 299 | 66066606066066000660660066066606000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 300 | 00600600000660000060060000066000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 301 | __gff__ 302 | 0000050505000303030103010307020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 303 | 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 304 | __map__ 305 | 0202020202020202020202020202020202020202020202020202020202020202050505050505050505050505050505050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 306 | 020f0101010d01010707020801c00e0202020202020202020202020202020202050000000000000000000000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 307 | 02010101070201010707020101c0c00202020202020210111202020202020202050000000000000000000000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 308 | 02010101080208010101020101010102020202020202200e2202020202020202050000000000000000000000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 309 | 0201010108020801010802070701010202020210111124012311111202020202050000000000000000000000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 310 | 020101010102020d0202020202020d0202020220010101010101012202020202050000000002020202020200000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 311 | 02080101080201010102010d0101010202020220010101010101012202020202050000000002010101010200000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 312 | 0208010808020101010201020d02020202020220010101060101012202020202050000000002010601010200000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 313 | 02020d02020201c001020102c0c0080202020220010101010101012202020202050500000002010101010200000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 314 | 01010101010d0101010201020101010202020220070101010101072202020202050000000002010101010200000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 315 | 0d02020202020101010201020101010202020220080701010108082202020202050000000002020201020200000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 316 | 0101010102020d02020201020101010202020230313114011331313202020202050000000000020f01020000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 317 | 01010101020101010102010d010a0102020202020202200f2202020202020202050000000000020202020000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 318 | 0101010102010c01c0020102c001010202020202020230313202020202020202050000000000000000000000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 319 | 010101010d01c001010d01020101070202020202020202020202020202020202050000000000000000000000000000050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 320 | 0202020202020202020202020202020202020202020202020202020202020202050505050505050505050505050505050202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 321 | __sfx__ 322 | 000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 323 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 324 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 325 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 326 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 327 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 328 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 329 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 330 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 331 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 332 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 333 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 334 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 335 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 336 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 337 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 338 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 339 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 340 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 341 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 342 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 343 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 344 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 345 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 346 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 347 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 348 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 349 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 350 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 351 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 352 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 353 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 354 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 355 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 356 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 357 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 358 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 359 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 360 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 361 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 362 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 363 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 364 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 365 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 366 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 367 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 368 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 369 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 370 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 371 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 372 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 373 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 374 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 375 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 376 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 377 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 378 | 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 379 | 00010000211102114015140271300f6300f6101c610196001761016600156100f6000c61009600076000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 380 | 000100001b61006540065401963018630116100e6100c610096100861000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 381 | 000100001f5302b5302e5302e5303250032500395002751027510285102a510005000050000500275102951029510005000050000500005002451024510245102751029510005000050000500005000050000500 382 | 0001000024030240301c0301c0302a2302823025210212101e2101b2101b21016210112100d2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100a2100020000200 383 | 0001000024030240301c0301c03039010390103a0103001030010300102d010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 384 | 00010000210302703025040230301a030190100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 385 | 000100000d720137200d7100c40031200312000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 386 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Git version of the Lazy Devs Pico-8 Roguelike Tutorial 2 | 3 | Lazy Devs share their source code through pastebin/dropbox which offers no diffing or history of changes between episodes, so I've taken the code from the end ofeach episode and created a git history. 4 | 5 | This code was authored by Krystian Majewski 6 | 7 | You can check out the Lazy Devs Pico-8 Roguelike tutorial here: https://www.youtube.com/playlist?list=PLea8cjCua_P3LL7J1Q9b6PJua0A-96uUS 8 | 9 | Join the discussion on the Discord server: https://discordapp.com/invite/N9NBX8R --------------------------------------------------------------------------------