comparison clojure/com/aurellem/run/bootstrap_0.clj @ 284:57e0314e488d

script: bought 96 burn heals
author Robert McIntyre <rlm@mit.edu>
date Wed, 28 Mar 2012 05:08:24 -0500
parents d5e5c73af7e6
children dc9a0060e7cb
comparison
equal deleted inserted replaced
283:516acb83410f 284:57e0314e488d
1 (ns com.aurellem.run.bootstrap-0 1 (ns com.aurellem.run.bootstrap-0
2 (:use (com.aurellem.gb gb-driver vbm characters money)) 2 (:use (com.aurellem.gb gb-driver util items vbm characters money))
3 (:use (com.aurellem.run title save-corruption)) 3 (:use (com.aurellem.run title save-corruption))
4 (:use (com.aurellem.exp item-bridge)) 4 (:use (com.aurellem.exp item-bridge))
5 (:import [com.aurellem.gb.gb_driver SaveState])) 5 (:import [com.aurellem.gb.gb_driver SaveState]))
6 6
7 (defn-memo boot-root [] 7 (defn-memo boot-root []
441 (do-nothing 1))) 441 (do-nothing 1)))
442 select-item 442 select-item
443 (range (dec quantity))) 443 (range (dec quantity)))
444 buy-items 444 buy-items
445 (->> request-items 445 (->> request-items
446 (do-nothing 3) 446 (do-nothing 10)
447 (play-moves [[:a]]) 447 (play-moves [[:a]])
448 (scroll-text) 448 (scroll-text)
449 (scroll-text) 449 (scroll-text)
450 (do-nothing 10)
450 (play-moves [[:a]]) 451 (play-moves [[:a]])
451 (scroll-text))] 452 (scroll-text))]
452 buy-items))) 453 buy-items)))
453 454
454 455
505 (do-nothing 3) 506 (do-nothing 3)
506 (play-moves [[:d]]) 507 (play-moves [[:d]])
507 (do-nothing 3) 508 (do-nothing 3)
508 (play-moves [[:d]]) 509 (play-moves [[:d]])
509 (do-nothing 10) 510 (do-nothing 10)
510 (buy-item 0 (item-lookup 3)))))) 511 (buy-item 0 (item-lookup 3)))
512 (and (= 0 (item-lookup 3))
513 (= 0 (item-lookup 4)))
514 initial-purchase)))
511 515
512 516
513 (defn test-buy-items 517 (defn test-buy-items
514 ([] (test-buy-items 518 ([] (test-buy-items
515 (walk-to-counter))) 519 (walk-to-counter)))
550 (do-nothing 100) 554 (do-nothing 100)
551 (play-moves [[:b]]) 555 (play-moves [[:b]])
552 (do-nothing 100) 556 (do-nothing 100)
553 (play-moves [[:b]]) 557 (play-moves [[:b]])
554 (do-nothing 100) 558 (do-nothing 100)
555 (play-moves [[:b] []])))) 559 (play-moves [[:b] []])
560 (advance [:b] [:b :start]))))
556 561
557 562
558 (defn-memo do-save-corruption 563 (defn-memo do-save-corruption
559 ([] (do-save-corruption 564 ([] (do-save-corruption
560 (buy-initial-items))) 565 (buy-initial-items)))
561 ([script] 566 ([script]
562 (->> script 567 (->> script
563 (advance [:b] [:b :start])
564 (advance [] [:d]) 568 (advance [] [:d])
565 (play-moves [[] [] [] [:d] 569 (play-moves [[] [] [] [:d]
566 [] [] [] [:d] 570 [] [] [] [:d]
567 [] [] [] [:d] 571 [] [] [] [:d]
568 [] [] [:a]]) 572 [] [] [:a]])
576 (title) 580 (title)
577 (advance [] [:start]) 581 (advance [] [:start])
578 (advance [] [:a]) 582 (advance [] [:a])
579 (advance [:a] [:a :start])))) 583 (advance [:a] [:a :start]))))
580 584
585 (def menu walk)
586
587 (defn-memo corrupt-item-list
588 ([] (corrupt-item-list
589 (do-save-corruption)))
590 ([script]
591 (->> script
592 (do-nothing 200)
593 (menu [↓ [:a]]) ; select "POKEMON" from
594 ; from main menu
595 (menu [↓ ↓ ↓ ↓ ↓ ↓ ; go to 6th pokemon
596 [:a] ↓ [:a] ; select "switch"
597 ↓ ↓ ↓ [:a]]) ; switch with 9th "pokemon"
598
599 (do-nothing 1))))
600
601
602 (defn slowly
603 [delay moves script]
604 (reduce
605 (fn [script move]
606 (->> script
607 (do-nothing delay)
608 (play-moves (vector move))))
609 script moves))
610
611 (defn-memo get-burn-heals
612 ([] (get-burn-heals
613 (corrupt-item-list)))
614 ([script]
615 (->> script
616 (menu [[:b] [:b]])
617 (menu [[:a]])
618 (do-nothing 100)
619 (menu [↓ [:a]])
620 (do-nothing 100)
621 (menu [[:a] ↓ [:a]])
622 (scroll-text)
623 (menu [[:b][:b]])
624 (menu [[:a]])
625
626 (do-nothing 50)
627 (buy-items [[0 1]])
628 (do-nothing 60)
629 (menu [[:a]])
630 (scroll-text)
631
632 (do-nothing 50)
633 (buy-items [[0 1]])
634 (do-nothing 60)
635 ;;(menu [[:a]])
636 ;;(scroll-text)
637
638 ;;(do-nothing 300)
639 ;;(menu [[:b] [:b]])
640 ;;(do-nothing 300)
641
642 (buy-items [[0 1]
643 [1 1]
644 [1 1]
645 [2 1]
646 [3 1]
647 [4 97]])
648
649 (do-nothing 10))))
650
651 (defn save-game-properly
652 [number-down script]
653 (->>
654 (reduce (fn [script _]
655 (->> script
656 (advance [] [:d])))
657 script
658 (range number-down))
659 (play-moves [[] [] [:a]])
660 (scroll-text)
661 (do-nothing 300)))
662
663
664
665 (defn-memo corrupt-item-list-again
666 ([] (corrupt-item-list-again (get-burn-heals)))
667 ([script]
668 (->> script
669 (do-nothing 10)
670 (play-moves [[:b]])
671 (do-nothing 100)
672 (play-moves [[:b]])
673 (do-nothing 40)
674 (play-moves [[:b]])
675 (advance [:b] [:start :b])
676 (menu [[:a] ↑ ↑ ↑ ↑ ↑ ; get fifth pokemon
677 [:a] ↓ [:a] ; and corrupt the
678 ↓ ↓ ↓ ↓ ↓ [:a]]) ; item list again by
679 ; switching it to
680 ))) ; tenth place.
681
682
581 683
582 (defn viridian-store->viridian-poke-center 684 (defn viridian-store->viridian-poke-center
583 [] 685 []
584 ;; leave store 686 ;; leave store
585 ;;(walk [↓ ↓ 687 ;;(walk [↓ ↓