Mercurial > vba-clojure
view clojure/com/aurellem/gb/hxc.clj @ 245:a50faba43967
forgot to include Bird type with the list of available type names for type advantage data. now hxc-advantage is correct.
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Sun, 25 Mar 2012 23:04:01 -0500 |
parents | 27ca947084cf |
children | 921d2277bb57 |
line wrap: on
line source
1 (ns com.aurellem.gb.hxc2 (:use (com.aurellem.gb assembly characters gb-driver util3 constants))4 (:use (com.aurellem.world practice))5 (:import [com.aurellem.gb.gb_driver SaveState]))8 (def hxc-pokenames9 "The hardcoded names of the 190 species in memory. List begins at ROM@E8000."10 (let [count-species 19011 name-length 10]12 (map character-codes->str13 (partition name-length14 (take (* count-species name-length)15 (drop 0xE800016 (rom(root))))))))18 (def hxc-items19 "The hardcoded names of the items in memory. List begins at ROM@45B7 "20 (map character-codes->str21 (take-nth 222 (partition-by #(= % 0x50)23 (take 120024 (drop 0x45B7 (rom (root))))))))26 (def hxc-types27 "The hardcoded type names in memory. List begins at ROM@27D99,28 shortly before hxc-titles."29 (map character-codes->str30 (take-nth 231 (partition-by #(= 0x50 %)32 (take 10233 (drop 0x27D9934 (rom (root))))))))36 (def hxc-titles37 "The hardcoded names of the trainer titles in memory. List begins at38 ROM@27E77"39 (map character-codes->str40 (take-nth 241 (partition-by #(= 0x50 %)42 (take 19643 (drop 0x27E7744 (rom (root))))))))47 (def hxc-pokedex48 "The hardcoded pokedex entries in memory. List begins at49 ROM@B8000, shortly before move names."50 (map character-codes->str51 (take-nth 252 (partition-by #(= % 0x50)53 (take 1475454 (drop 0xB800055 (rom (root))))))))56 (def hxc-moves57 "The hardcoded move names in memory. List begins at ROM@BC000"58 (map character-codes->str59 (take-nth 260 (partition-by #(= % 0x50)61 (take 155162 (drop 0xBC00063 (rom (root))))))))67 (def hxc-places68 "The hardcoded place names in memory. List begins at69 ROM@71500. Cinnabar Mansion is dynamically calculated."70 (map character-codes->str71 (take-nth 272 (partition-by #(= % 0x50)73 (take 56074 (drop 0x7150075 (rom (root))))))))78 (def hxc-dialog79 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000."80 (character-codes->str(take 0x0F72881 (drop (+ 0x98000)82 (rom (root))))))87 (def pkmn-types88 [:normal89 :fighting90 :flying91 :poison92 :ground93 :rock94 :bird95 :bug96 :ghost97 :A98 :B99 :C100 :D101 :E102 :F103 :G104 :H105 :I106 :J107 :K108 :fire109 :water110 :grass111 :electric112 :psychic113 :ice114 :dragon115 ])118 (def hxc-advantage119 "The hardcoded type advantages in memory, returned as tuples of [atk-type def-type multiplier]. By default (i.e. if not listed here), the multiplier is 1."120 (map121 (fn [[atk def mult]] [(get pkmn-types atk (hex atk))122 (get pkmn-types def (hex def))123 (/ mult 10)])124 (partition 3125 (take-while (partial not= 0xFF)126 (drop 0x3E62D (rom(root)))))))148 (def hxc-later149 "Running this code produces, e.g. hardcoded names NPCs give150 their pokemon. Will sort through it later."151 (print (character-codes->str(take 10000152 (drop 0x71597153 (rom (root)))))))155 (let [dex156 (partition-by #(= 0x50 %)157 (take 2540158 (drop 0x40687159 (rom (root)))))]160 (def dex dex)161 (def hxc-species162 (map character-codes->str163 (take-nth 4 dex))))