comparison clojure/com/aurellem/exp/pokemon.clj @ 168:04dfda91db9c

discovered locations of Stat experience and lost location of DV values
author Robert McIntyre <rlm@mit.edu>
date Tue, 20 Mar 2012 20:26:00 -0500
parents bfd06de5a934
children 4857f59f63a6
comparison
equal deleted inserted replaced
167:bfd06de5a934 168:04dfda91db9c
552 552
553 553
554 (defn crazy-pid [] 554 (defn crazy-pid []
555 (read-state "crazy-pidgeot")) 555 (read-state "crazy-pidgeot"))
556 556
557 (def unknown "[[[UNKNOWN]]]")
558
557 (def unknown "") 559 (def unknown "")
558 560
559 (def pokemon-1-info 561 (def pokemon-1-info
560 {0xD16A "Color Map" ;; 0 562 {0xD16A "Color Map" ;; 0
561 0xD16B "Current-HP (h)" ;; 1 563 0xD16B "Current-HP (h)" ;; 1
572 0xD176 "OT-ID (h)" ;; 12 574 0xD176 "OT-ID (h)" ;; 12
573 0xD177 "OT-ID (l)" ;; 13 575 0xD177 "OT-ID (l)" ;; 13
574 0xD178 "Exp. Points (h)" ;; 14 576 0xD178 "Exp. Points (h)" ;; 14
575 0xD179 "Exp. Points (m)" ;; 15 577 0xD179 "Exp. Points (m)" ;; 15
576 0xD17A "Exp. Points (l)" ;; 16 578 0xD17A "Exp. Points (l)" ;; 16
577 0xD17B "HP DV" ;; 17 579 0xD17B "HP Exp. (h)" ;; 17
578 0xD17C unknown ;; 18 580 0xD17C "HP Exp. (l)" ;; 18
579 0xD17D "Attack DV" ;; 19 581 0xD17D "Attack Exp. (h)" ;; 19
580 0xD17E unknown ;; 20 582 0xD17E "Attack Exp. (l)" ;; 20
581 0xD17F "Defense DV" ;; 21 583 0xD17F "Defense Exp. (h)" ;; 21
582 0xD180 unknown ;; 22 584 0xD180 "Defense Exp. (l)" ;; 22
583 0xD181 "Speed DV" ;; 23 585 0xD181 "Speed Exp. (h)" ;; 23
584 0xD182 unknown ;; 24 586 0xD182 "Speed Exp. (l)" ;; 24
585 0xD183 "Special DV" ;; 25 587 0xD183 "Special Exp. (h)" ;; 25
586 0xD184 unknown ;; 26 588 0xD184 "Special Exp. (l)" ;; 26
587 0xD185 unknown ;; 27 589 0xD185 unknown ;; 27
588 0xD186 unknown ;; 28 590 0xD186 unknown ;; 28
589 0xD187 "PP Move 1" ;; 29 591 0xD187 "PP Move 1" ;; 29
590 0xD188 "PP Move 2" ;; 30 592 0xD188 "PP Move 2" ;; 30
591 0xD189 "PP Move 3" ;; 31 593 0xD189 "PP Move 3" ;; 31
598 0xD190 "Defense (h)" ;; 38 600 0xD190 "Defense (h)" ;; 38
599 0xD191 "Defense (l)" ;; 39 601 0xD191 "Defense (l)" ;; 39
600 0xD192 "Speed (h)" ;; 40 602 0xD192 "Speed (h)" ;; 40
601 0xD193 "Speed (l)" ;; 41 603 0xD193 "Speed (l)" ;; 41
602 0xD194 "Special (h)" ;; 42 604 0xD194 "Special (h)" ;; 42
603 0xD195 "Special (h)" ;; 43 605 0xD195 "Special (l)" ;; 43
604 }) 606 })
605 607
606 (defn pokemon-data 608 (defn pokemon-data
607 ([^SaveState state pokemon-num] 609 ([^SaveState state pokemon-num]
608 (assert (<= 0 pokemon-num 5)) 610 (assert (<= 0 pokemon-num 5))
622 (defn print-pokemon-data 624 (defn print-pokemon-data
623 ([^SaveState state pokemon-num] 625 ([^SaveState state pokemon-num]
624 (assert (<= 0 pokemon-num 5)) 626 (assert (<= 0 pokemon-num 5))
625 (let [poke-data (pokemon-data state pokemon-num) 627 (let [poke-data (pokemon-data state pokemon-num)
626 backbone (sort (keys pokemon-1-info))] 628 backbone (sort (keys pokemon-1-info))]
627 (println "Pokemon " pokemon-num 629 (println "Pokemon " pokemon-num " -- "
628 "------------------------") 630 (nth (party-names state)
631 pokemon-num) \newline)
632
633 (println " Desc. | Hex | Dec | Binary |")
634 (println "-------------------+------+-----+----------+")
629 (dorun 635 (dorun
630 (map 636 (map
631 (comp println 637 (comp println
632 (fn [desc data] 638 (fn [desc data]
633 (format "%-16s : 0x%02X" desc data))) 639 (format "%-16s | 0x%02X | %3d | %s |"
640 desc data data
641 (let [s (Integer/toBinaryString data)]
642 (apply
643 str
644 (concat (repeat (- 8 (count s)) "0" )
645 s)))
646
647
648 )))
634 649
635 (map pokemon-1-info backbone) 650 (map pokemon-1-info backbone)
636 poke-data)))) 651 poke-data))))
637 ([pokemon-num] 652 ([pokemon-num]
638 (print-pokemon-data @current-state pokemon-num))) 653 (print-pokemon-data @current-state pokemon-num)))
639 654
640 655
641 656
642 (defn pre-battle [] (read-state "prepare-for-battle")) 657 (defn pre-battle [] (read-state "prepare-for-battle"))
643 658
659
660
661
662