changeset 331:6ec288064d49

improved do-save-corruption
author Robert McIntyre <rlm@mit.edu>
date Fri, 06 Apr 2012 12:18:58 -0500
parents ecff37d22293
children 5c2041d1cdda
files clojure/com/aurellem/run/bootstrap_0.clj
diffstat 1 files changed, 14 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/bootstrap_0.clj	Fri Apr 06 09:09:52 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/bootstrap_0.clj	Fri Apr 06 12:18:58 2012 -0500
     1.3 @@ -418,17 +418,18 @@
     1.4    ([desired-quantity [moves state :as script]]
     1.5       (set-quantity 99 desired-quantity script)))
     1.6  
     1.7 +(defn activate-start-menu [script]
     1.8 +  (first-difference [:b] [:b :start] AF script))
     1.9 +
    1.10  (defn-memo do-save-corruption
    1.11    ([] (do-save-corruption
    1.12         (walk-to-counter)))
    1.13    ([script]
    1.14       (->> script
    1.15 -          (first-difference [] [:start] AF)
    1.16 +          activate-start-menu
    1.17            (set-cursor 4)
    1.18 -          (do-nothing 5)
    1.19 -          (play-moves [[:a]])
    1.20 -          (play-moves (repeat 85 [:b]))
    1.21 -          (play-moves [[:a]])
    1.22 +          select-menu-entry
    1.23 +          select-menu-entry
    1.24            (play-moves
    1.25             ;; this section is copied from speedrun-2942 and corrupts
    1.26             ;; the save so that the total number of pokemon is set to
    1.27 @@ -485,14 +486,13 @@
    1.28         select-menu-entry
    1.29         scroll-text))
    1.30  
    1.31 -(defn activate-start-menu [script]
    1.32 -  (first-difference [:b] [:b :start] AF script))
    1.33 -
    1.34  (defn-memo corrupt-item-list
    1.35    "Corrupt the num-of-items variable by switching a corrupted pokemon
    1.36     into out-of-bounds memory."
    1.37    ([] (corrupt-item-list
    1.38 -       (corrupted-checkpoint)))
    1.39 +       ;;(corrupted-checkpoint)
    1.40 +       (do-save-corruption)
    1.41 +       ))
    1.42    ([script]
    1.43       (->> script
    1.44            activate-start-menu
    1.45 @@ -556,11 +556,10 @@
    1.46            (play-moves [[:b]])
    1.47            end-text)))
    1.48  
    1.49 -(defn corrupt-item-list-again
    1.50 +(defn-memo corrupt-item-list-again
    1.51    ([] (corrupt-item-list-again (buy-bootstrapping-items)))
    1.52    ([script]
    1.53       (->> script
    1.54 -
    1.55            activate-start-menu             
    1.56            (set-cursor-relative 0)                   
    1.57            select-menu-entry               
    1.58 @@ -568,7 +567,6 @@
    1.59            ;; repair list-offset for pokemon-list
    1.60            (set-cursor-relative -1)
    1.61  
    1.62 -          
    1.63            (set-cursor 4)                  ; switching it to    
    1.64            select-menu-entry               ; tenth place.       
    1.65            (set-cursor 1)
    1.66 @@ -578,44 +576,18 @@
    1.67            (set-cursor 9)                  ; goto 10th pokemon
    1.68            select-menu-entry               ; do switch
    1.69            close-menu
    1.70 -          close-menu                     
    1.71 -          
    1.72 -          (do-nothing 1)
    1.73 -          ;;select-menu-entry     
    1.74 -          ;;
    1.75 -          ;;(set-cursor 9)
    1.76 -          ;;select-menu-entry 
    1.77 -          ;;close-menu
    1.78 -         
    1.79 -          )))
    1.80 -          ;; (do-nothing 10)
    1.81 -          ;; (play-moves [[:b]])
    1.82 -          ;; (do-nothing 100)
    1.83 -          ;; (play-moves [[:b]])
    1.84 -          ;; (do-nothing 40)
    1.85 -          ;; (play-moves [[:b]])
    1.86 -          ;; (first-difference [:b] [:start :b] AF)
    1.87 -          ;; (menu [[:a] ↑ ↑ ↑ ↑ ↑         
    1.88 -          ;;        [:a] ↓ [:a]            
    1.89 -          ;;        ↓ ↓ ↓ ↓ ↓ [:a]])       
    1.90 -          ;;                               
    1.91 -          ;; )))                           
    1.92 +          close-menu)))
    1.93            
    1.94  (defn-memo viridian-store->viridian-poke-center
    1.95    ([] (viridian-store->viridian-poke-center
    1.96         (corrupt-item-list-again)))
    1.97    ([script]
    1.98       (->> script
    1.99 -          (do-nothing 100)
   1.100 -          (play-moves [[:b]])
   1.101 -          (do-nothing 100)
   1.102 -          (play-moves [[:b]])
   1.103 -          (do-nothing 40)
   1.104            ;; leave store
   1.105            (walk [↓ ↓ 
   1.106                   → ↓ ↓])
   1.107 -          (walk [← ← ← ←
   1.108 -                 ↓ ↓ ↓ ↓ ↓ ↓
   1.109 +          (walk [← ← ← 
   1.110 +                 ↓ ↓ ↓ ↓ ↓
   1.111                   ← ← ← ↑]))))
   1.112  
   1.113  (defn-memo to-poke-center-computer
   1.114 @@ -625,7 +597,7 @@
   1.115       (->> script
   1.116            (walk [→ →
   1.117                   ↑ ↑ ↑
   1.118 -                 → → → → → → → → → ↑])
   1.119 +                 → → → → → → → → →])
   1.120            (do-nothing 1))))
   1.121  
   1.122  (defn-memo begin-deposits