comparison 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
comparison
equal deleted inserted replaced
242:2e751984b42d 243:5b59c6f17cd5
55 55
56 (def hxc-places 56 (def hxc-places
57 "The hardcoded place names in memory. List begins at 57 "The hardcoded place names in memory. List begins at
58 ROM@71500. Cinnabar Mansion is dynamically calculated." 58 ROM@71500. Cinnabar Mansion is dynamically calculated."
59 (map character-codes->str 59 (map character-codes->str
60 (take-nth 2 60 (take-nth 2
61 (partition-by #(= % 0x50) 61 (partition-by #(= % 0x50)
62 (take 560 62 (take 560
63 (drop 0x71500 63 (drop 0x71500
64 (rom (root)))))))) 64 (rom (root))))))))
65 65
66 66
67 (def hxc-dialog 67 (def hxc-dialog
68 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000." 68 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000."
69 (character-codes->str(take 0x0F728 69 (character-codes->str(take 0x0F728
70 (drop (+ 0x98000) 70 (drop (+ 0x98000)
71 (rom (root)))))) 71 (rom (root))))))
72
73
74
75
76 (def pkmn-types
77 {0 :normal
78 1 :fighting
79 2 :flying
80 3 :poison
81 4 :ground
82 5 :rock
83 7 :bug
84 8 :ghost
85
86 20 :fire
87 21 :water
88 22 :grass
89 23 :electric
90 24 :psychic
91 25 :ice
92 26 :dragon
93 })
94
95
96 (def hxc-advantage
97 (map
98 (fn [[atk def mult]] [(get pkmn-types atk (hex atk))
99 (get pkmn-types def (hex def))
100 (/ mult 10)])
101 (partition 3
102 (take-while (partial not= 0xFF)
103 (drop 0x3E62D (rom(root)))))))
104
105
106
107 ;; (def pkmn-types
108 ;; [:normal
109 ;; :fighting
110 ;; :flying
111 ;; :poison
112 ;; :ground
113 ;; :rock
114 ;; :bird ;;?
115 ;; :bug
116 ;; :ghost
117 ;; :A
118 ;; :B
119 ;; :C
120 ;; :D
121 ;; :E
122 ;; :fire
123 ;; :water
124 ;; :grass
125 ;; :electric
126 ;; :psychic
127 ;; :ice
128 ;; :poision?])
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
72 148
73 (def hxc-later 149 (def hxc-later
74 "Running this code produces, e.g. hardcoded names NPCs give 150 "Running this code produces, e.g. hardcoded names NPCs give
75 their pokemon. Will sort through it later." 151 their pokemon. Will sort through it later."
76 (print (character-codes->str(take 10000 152 (print (character-codes->str(take 10000