changeset 214:62969eb07e04

fixed give-pokemon to give a properly formatted pokemon for pokemon with less than 4 moves.
author Robert McIntyre <rlm@mit.edu>
date Fri, 23 Mar 2012 19:25:21 -0500
parents 8523faa122b0
children aba78e52faba
files clojure/com/aurellem/exp/struggle.txt clojure/com/aurellem/gb/constants.clj clojure/com/aurellem/gb/moves.clj clojure/com/aurellem/gb/species.clj save-states/bad-jiggly.sav save-states/good-jiggly.sav
diffstat 6 files changed, 40 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/clojure/com/aurellem/exp/struggle.txt	Fri Mar 23 19:25:21 2012 -0500
     1.3 @@ -0,0 +1,31 @@
     1.4 +;; struggle works
     1.5 +
     1.6 + [ccd5 (4 5 6 7 8)]
     1.7 + [cfe8 (5 4 3 2 1)]
     1.8 + [d02c (4 3 2 1 0)]
     1.9 + [d187 (4 3 2 1 0)]
    1.10 +
    1.11 +;; struggle doesn't work
    1.12 +
    1.13 + [ccd5 (0 1 2 3 4)]
    1.14 + [cfe8 (0 4 3 2 1)]
    1.15 + [d02c (32 3 2 1 0)]
    1.16 + [d187 (4 3 2 1 0)]
    1.17 +
    1.18 +
    1.19 +
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +ran:
    1.25 +
    1.26 +(clojure.pprint/pprint (temporal-compare jiggly-4-pp jiggly-3-pp
    1.27 +jiggly-2-pp jiggly-1-pp jiggly-0-pp))
    1.28 +
    1.29 +and:
    1.30 +
    1.31 +(clojure.pprint/pprint (temporal-compare syn-jiggly-4-pp
    1.32 +syn-jiggly-3-pp syn-jiggly-2-pp syn-jiggly-1-pp syn-jiggly-0-pp))
    1.33 +
    1.34 +to generate the above, then filtered manually
     2.1 --- a/clojure/com/aurellem/gb/constants.clj	Fri Mar 23 18:06:37 2012 -0500
     2.2 +++ b/clojure/com/aurellem/gb/constants.clj	Fri Mar 23 19:25:21 2012 -0500
     2.3 @@ -5,3 +5,6 @@
     2.4  (def end-of-name-marker 0x50)
     2.5  (def max-name-length 10)
     2.6  (def name-width 11)
     2.7 +
     2.8 +(def pokemon-record-begin 0xD162)
     2.9 +(def pokemon-record-end 0xD2F5)
    2.10 \ No newline at end of file
     3.1 --- a/clojure/com/aurellem/gb/moves.clj	Fri Mar 23 18:06:37 2012 -0500
     3.2 +++ b/clojure/com/aurellem/gb/moves.clj	Fri Mar 23 19:25:21 2012 -0500
     3.3 @@ -268,6 +268,11 @@
     3.4    ([^SaveState state poke-num moves-pps]
     3.5       (let [new-moves
     3.6             (-> state
     3.7 +               ;; zero out the pp of the pokemon's moves
     3.8 +               (give-pp poke-num 0 0 0)
     3.9 +               (give-pp poke-num 1 0 0)
    3.10 +               (give-pp poke-num 2 0 0)
    3.11 +               (give-pp poke-num 3 0 0)
    3.12                 (give-moves poke-num (map first moves-pps)))]
    3.13         (reduce (fn [state move-num]
    3.14                   (let [pp (second (nth moves-pps move-num))]
     4.1 --- a/clojure/com/aurellem/gb/species.clj	Fri Mar 23 18:06:37 2012 -0500
     4.2 +++ b/clojure/com/aurellem/gb/species.clj	Fri Mar 23 19:25:21 2012 -0500
     4.3 @@ -139,7 +139,7 @@
     4.4     0x3A  :seel
     4.5     0x3B  :diglett
     4.6     0x3C  :tauros
     4.7 -   0x40  :farfetch'd
     4.8 +   0x40  :farfetch
     4.9     0x41  :venonat
    4.10     0x42  :dragonite
    4.11     0x46  :doduo
     5.1 Binary file save-states/bad-jiggly.sav has changed
     6.1 Binary file save-states/good-jiggly.sav has changed