diff clojure/com/aurellem/gb/hxc.clj @ 243:5b59c6f17cd5

Added the list of types and advantages to the hardcoded collection.
author Dylan Holmes <ocsenave@gmail.com>
date Sun, 25 Mar 2012 22:29:12 -0500
parents ca9d2897435b
children 27ca947084cf
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/hxc.clj	Sun Mar 25 02:53:29 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/hxc.clj	Sun Mar 25 22:29:12 2012 -0500
     1.3 @@ -57,8 +57,8 @@
     1.4    "The hardcoded place names in memory. List begins at
     1.5  ROM@71500. Cinnabar Mansion is dynamically calculated."
     1.6    (map character-codes->str
     1.7 -       (take-nth 2
     1.8 -                 (partition-by #(= % 0x50)
     1.9 +       (take-nth 2 
    1.10 +                (partition-by #(= % 0x50)
    1.11                                 (take 560
    1.12                                       (drop 0x71500
    1.13                                             (rom (root))))))))
    1.14 @@ -70,6 +70,82 @@
    1.15                            (drop (+ 0x98000)
    1.16                                  (rom (root))))))
    1.17  
    1.18 +
    1.19 +
    1.20 +
    1.21 +(def pkmn-types
    1.22 +  {0 :normal
    1.23 +   1 :fighting
    1.24 +   2 :flying
    1.25 +   3 :poison
    1.26 +   4 :ground
    1.27 +   5 :rock
    1.28 +   7 :bug
    1.29 +   8 :ghost
    1.30 +
    1.31 +   20 :fire
    1.32 +   21 :water
    1.33 +   22 :grass
    1.34 +   23 :electric
    1.35 +   24 :psychic
    1.36 +   25 :ice
    1.37 +   26 :dragon
    1.38 +   })
    1.39 +
    1.40 +
    1.41 +(def hxc-advantage
    1.42 +  (map
    1.43 +   (fn [[atk def mult]] [(get pkmn-types atk (hex atk))
    1.44 +                         (get pkmn-types def (hex def))
    1.45 +                         (/ mult 10)])
    1.46 +   (partition 3
    1.47 +              (take-while (partial not= 0xFF)
    1.48 +                          (drop 0x3E62D (rom(root)))))))
    1.49 +  
    1.50 +
    1.51 +
    1.52 +;; (def pkmn-types
    1.53 +;;   [:normal
    1.54 +;;    :fighting
    1.55 +;;    :flying
    1.56 +;;    :poison
    1.57 +;;    :ground
    1.58 +;;    :rock
    1.59 +;;    :bird ;;?
    1.60 +;;    :bug
    1.61 +;;    :ghost
    1.62 +;;    :A
    1.63 +;;    :B
    1.64 +;;    :C
    1.65 +;;    :D
    1.66 +;;    :E
    1.67 +;;    :fire
    1.68 +;;    :water
    1.69 +;;    :grass
    1.70 +;;    :electric
    1.71 +;;    :psychic
    1.72 +;;    :ice
    1.73 +;;    :poision?])
    1.74 +
    1.75 +
    1.76 +
    1.77 +
    1.78 +
    1.79 +
    1.80 +
    1.81 +
    1.82 +
    1.83 +
    1.84 +
    1.85 +
    1.86 +
    1.87 +
    1.88 +
    1.89 +
    1.90 +
    1.91 +
    1.92 +
    1.93 +
    1.94  (def hxc-later
    1.95    "Running this code produces, e.g. hardcoded names NPCs give
    1.96  their pokemon. Will sort through it later."