Mercurial > vba-clojure
comparison clojure/com/aurellem/gb/hxc.clj @ 244:27ca947084cf
minor fixes
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Sun, 25 Mar 2012 22:33:17 -0500 |
parents | 5b59c6f17cd5 |
children | a50faba43967 |
comparison
equal
deleted
inserted
replaced
243:5b59c6f17cd5 | 244:27ca947084cf |
---|---|
20 (map character-codes->str | 20 (map character-codes->str |
21 (take-nth 2 | 21 (take-nth 2 |
22 (partition-by #(= % 0x50) | 22 (partition-by #(= % 0x50) |
23 (take 1200 | 23 (take 1200 |
24 (drop 0x45B7 (rom (root)))))))) | 24 (drop 0x45B7 (rom (root)))))))) |
25 | |
26 (def hxc-types | |
27 "The hardcoded type names in memory. List begins at ROM@27D99, | |
28 shortly before hxc-titles." | |
29 (map character-codes->str | |
30 (take-nth 2 | |
31 (partition-by #(= 0x50 %) | |
32 (take 102 | |
33 (drop 0x27D99 | |
34 (rom (root)))))))) | |
35 | |
25 (def hxc-titles | 36 (def hxc-titles |
26 "The hardcoded names of the trainer titles in memory. List begins at | 37 "The hardcoded names of the trainer titles in memory. List begins at |
27 ROM@27E77" | 38 ROM@27E77" |
28 (map character-codes->str | 39 (map character-codes->str |
29 (take-nth 2 | 40 (take-nth 2 |
72 | 83 |
73 | 84 |
74 | 85 |
75 | 86 |
76 (def pkmn-types | 87 (def pkmn-types |
77 {0 :normal | 88 [:normal |
78 1 :fighting | 89 :fighting |
79 2 :flying | 90 :flying |
80 3 :poison | 91 :poison |
81 4 :ground | 92 :ground |
82 5 :rock | 93 :rock |
83 7 :bug | 94 :bug |
84 8 :ghost | 95 :ghost |
85 | 96 :A |
86 20 :fire | 97 :B |
87 21 :water | 98 :C |
88 22 :grass | 99 :D |
89 23 :electric | 100 :E |
90 24 :psychic | 101 :F |
91 25 :ice | 102 :G |
92 26 :dragon | 103 :H |
93 }) | 104 :I |
105 :J | |
106 :K | |
107 :fire | |
108 :water | |
109 :grass | |
110 :electric | |
111 :psychic | |
112 :ice | |
113 :dragon | |
114 ]) | |
94 | 115 |
95 | 116 |
96 (def hxc-advantage | 117 (def hxc-advantage |
97 (map | 118 (map |
98 (fn [[atk def mult]] [(get pkmn-types atk (hex atk)) | 119 (fn [[atk def mult]] [(get pkmn-types atk (hex atk)) |
100 (/ mult 10)]) | 121 (/ mult 10)]) |
101 (partition 3 | 122 (partition 3 |
102 (take-while (partial not= 0xFF) | 123 (take-while (partial not= 0xFF) |
103 (drop 0x3E62D (rom(root))))))) | 124 (drop 0x3E62D (rom(root))))))) |
104 | 125 |
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 | 126 |
130 | 127 |
131 | 128 |
132 | 129 |
133 | 130 |