changeset 228:edce489c3c21

fixed badge order, added HM-mew, mapped out some more memory
author Robert McIntyre <rlm@mit.edu>
date Sat, 24 Mar 2012 13:15:15 -0500
parents d5dddf33543c
children 30f4fc9b1747
files clojure/com/aurellem/exp/cartography clojure/com/aurellem/exp/play.clj clojure/com/aurellem/gb/badges.clj clojure/com/aurellem/gb/pokemon_presets.clj
diffstat 4 files changed, 35 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/cartography	Sat Mar 24 05:45:06 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/cartography	Sat Mar 24 13:15:15 2012 -0500
     1.3 @@ -509,8 +509,8 @@
     1.4  D35E                   
     1.5  D35F                   
     1.6  D360                   
     1.7 -D361                   
     1.8 -D362                   
     1.9 +D361                   Player Offset X
    1.10 +D362                   Player Offset Y
    1.11  D363                   
    1.12  D364                   
    1.13  D365                   
     2.1 --- a/clojure/com/aurellem/exp/play.clj	Sat Mar 24 05:45:06 2012 -0500
     2.2 +++ b/clojure/com/aurellem/exp/play.clj	Sat Mar 24 13:15:15 2012 -0500
     2.3 @@ -5,7 +5,9 @@
     2.4                           items pokemon status types
     2.5                           characters species moves
     2.6                           pokedex money rival-name
     2.7 -                         text-speed))
     2.8 +                         text-speed badges
     2.9 +                         pokemon-presets
    2.10 +                         ))
    2.11    
    2.12    (:import java.io.File)
    2.13    (:import [com.aurellem.gb.gb_driver SaveState]))
     3.1 --- a/clojure/com/aurellem/gb/badges.clj	Sat Mar 24 05:45:06 2012 -0500
     3.2 +++ b/clojure/com/aurellem/gb/badges.clj	Sat Mar 24 13:15:15 2012 -0500
     3.3 @@ -1,10 +1,10 @@
     3.4  (ns com.aurellem.gb.badges
     3.5    (:use (com.aurellem.gb gb-driver util constants))
     3.6 -  (:use (com.aurellem.world practice))
     3.7    (:import [com.aurellem.gb.gb_driver SaveState]))
     3.8  
     3.9 -(def badges '(:boulder :cascade :thunder :marsh :rainbow :soul :volcano
    3.10 -     :earth))
    3.11 +(def badges
    3.12 +  '(:boulder :cascade :thunder :rainbow
    3.13 +             :soul :marsh :volcano :earth))
    3.14  
    3.15  (defn get-badges
    3.16    "Returns a list of the current badges held by the player."
    3.17 @@ -12,16 +12,16 @@
    3.18      ((fn this [coll n]
    3.19        (cond (zero? n) '()
    3.20              (zero? (rem n 2)) (recur (pop coll) (int (/ n 2)))
    3.21 -            :else (cons (peek coll) (this (pop coll) (int (/ n
    3.22 -                                                             2))))))
    3.23 +            :else (cons
    3.24 +                   (peek coll)
    3.25 +                   (this (pop coll) (int (/ n 2))))))
    3.26       badges
    3.27 -     (aget (memory state) 0xD355)
    3.28 -     ))
    3.29 +     (aget (memory state) 0xD355)))
    3.30    ([] (get-badges @current-state)))
    3.31  
    3.32  (defn set-badges
    3.33 -  "Sets the badges held by the player. badge-list may contain :boulder
    3.34 -:cascade :thunder :marsh :rainbow :soul :volcano."
    3.35 +  "Sets the badges held by the player. badge-list may contain
    3.36 +   :boulder :cascade :thunder :marsh :rainbow :soul :volcano."
    3.37    ([state badge-list]
    3.38       (let [has-badge (set badge-list)]
    3.39         (->>
    3.40 @@ -30,27 +30,13 @@
    3.41               (empty? coll) n
    3.42               (has-badge (peek coll)) (recur (inc(* 2 n)) (pop coll))
    3.43               :else (recur (* 2 n) (pop coll))))
    3.44 -      
    3.45           0
    3.46           (vec badges))
    3.47          (set-memory state 0xD355))))
    3.48 -     
    3.49 -    
    3.50    ([badge-list] (set-badges @current-state badge-list)))
    3.51  
    3.52 -
    3.53 -  
    3.54 -
    3.55 -    
    3.56 -
    3.57 -  
    3.58 -  ;; (let [mem (aget (memory state) 0xD354)]
    3.59 -  ;;   ((fn this [coll n]
    3.60 -  ;;     (cond (zero? n) '()
    3.61 -  ;;           (zero? (rem n 2)) (recur (pop coll) (int (/ n 2)))
    3.62 -  ;;           :else (cons (peek coll) (this (pop coll) (int (/ n
    3.63 -  ;;                                                            2))))))
    3.64 -  ;;    badges
    3.65 -  ;;    (aget (memory state) 0xD354)
    3.66 -  ;;    )))
    3.67 -  
    3.68 \ No newline at end of file
    3.69 +(defn give-all-badges
    3.70 +  ([^SaveState state]
    3.71 +     (set-badges state badges))
    3.72 +  ([] (give-all-badges @current-state)))
    3.73 +    
    3.74 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/clojure/com/aurellem/gb/pokemon_presets.clj	Sat Mar 24 13:15:15 2012 -0500
     4.3 @@ -0,0 +1,16 @@
     4.4 +(ns com.aurellem.gb.pokemon-presets)
     4.5 +
     4.6 +
     4.7 +(def HM-mew
     4.8 +  {:species :mew
     4.9 +   :ID 5195
    4.10 +   :original-trainer "RLM"
    4.11 +   :experience
    4.12 +   {:main-exp 200
    4.13 +    :hp-exp 0xFFFF
    4.14 +    :attack-exp 0xFFFF
    4.15 +    :defense-exp 0xFFFF
    4.16 +    :speed-exp 0xFFFF
    4.17 +    :special-exp 0xFFFF}
    4.18 +   :moves [:fly :surf :cut :strength]})
    4.19 +   
    4.20 \ No newline at end of file