# HG changeset patch # User Robert McIntyre # Date 1332480764 18000 # Node ID d4e673d09181153949daa6fabf1546a867deb7f6 # Parent 5055ec9de2780e9ec0e06673d7eea3f61c6bad66# Parent 67c42608ef9db21d601a6e5dc54ac28b0d7fe3c4 merge diff -r 67c42608ef9d -r d4e673d09181 clojure/com/aurellem/gb/moves.clj --- a/clojure/com/aurellem/gb/moves.clj Fri Mar 23 00:24:54 2012 -0500 +++ b/clojure/com/aurellem/gb/moves.clj Fri Mar 23 00:32:44 2012 -0500 @@ -169,7 +169,7 @@ 0xA2 :super-fang 0xA3 :slash 0xA4 :substitute - 0xA5 :struggle}) + 0xA5 :struggle }) (def move-name->move-code (zipmap (vals move-code->move-name) @@ -264,3 +264,175 @@ (give-pp @current-state pokemon-num move-num pp-ups current-pp))) + +(def move-name->move-pp + { + :absorb 20 + :acid 30 + :acid-armor 40 ;; WTF happens with 3 PP-UPs??! + :agility 30 + :amnesia 20 + :aurora-beam 20 + :barrage 20 + :barrier 30 + :bide 10 + :bind 20 + :bite 25 + :blizzard 5 + :body-slam 15 + :bone-club 20 + :bonemerang 10 + :bubble 30 + :bubblebeam 20 + :clamp 10 + :comet-punch 15 + :confuse-ray 10 + :confusion 25 + :constrict 35 + :conversion 30 + :counter 20 + :crabhammer 10 + :cut 30 + :defense-curl 40 + :dig 10 + :disable 20 + :dizzy-punch 10 + :double-edge 15 + :double-kick 30 + :double-team 10 + :doubleslap 15 + :dragon-rage 10 + :dream-eater 15 + :drill-peck 20 + :earthquake 10 + :egg-bomb 10 + :ember 25 + :explosion 5 + :fire-blast 5 + :fire-punch 15 + :fire-spin 15 + :fissure 5 + :flamethrower 15 + :flash 20 + :fly 15 + :focus-energy 30 + :fury-attack 20 + :fury-swipes 15 + :glare 30 + :growl 40 + :growth 40 + :guillotine 5 + :gust 35 + :harden 30 + :haze 30 + :headbutt 15 + :hi-jump-kick 20 + :horn-attack 25 + :horn-drill 5 + :hydro-pump 5 + :hyper-beam 5 + :hyper-fang 15 + :hypnosis 20 + :ice-beam 10 + :ice-punch 15 + :jump-kick 25 + :karate-chop 25 + :kinesis 15 + :leech-life 15 + :leech-seed 10 + :leer 30 + :lick 30 + :light-screen 30 + :lovely-kiss 10 + :low-kick 20 + :meditate 40 + :mega-drain 10 + :mega-kick 5 + :mega-punch 20 + :metronome 10 + :mimic 10 + :minimize 20 + :mirror-move 20 + :mist 30 + :night-shade 15 + :pay-day 20 + :peck 35 + :petal-dance 20 + :pin-missle 20 + :poison-gas 40 + :poison-sting 35 + :poisonpowder 35 + :pound 35 + :psybeam 20 + :psychic 10 + :psywave 15 + :quick-attack 30 + :rage 20 + :razor-leaf 25 + :razor-wind 10 + :recover 20 + :reflect 20 + :rest 10 + :roar 20 + :rock-slide 10 + :rock-throw 15 + :rolling-kick 15 + :sand-attack 15 + :scratch 30 + :screech 40 + :seismic-toss 20 + :selfdestruct 5 + :sharpen 30 + :sing 15 + :skull-bash 15 + :sky-attack 5 + :slam 20 + :slash 20 + :sleep-powder 15 + :sludge 20 + :smog 20 + :smokescreen 20 + :softboiled 10 + :solarbeam 10 + :sonicboom 20 + :spike-cannon 15 + :splash 40 + :spore 15 + :stomp 20 + :strength 15 + :string-shot 40 + :struggle 1 + :stun-spore 30 + :submission 25 + :substitute 10 + :super-fang 10 + :supersonic 20 + :surf 15 + :swift 20 + :swords-dance 30 + :tackle 35 + :tail-whip 30 + :take-down 20 + :teleport 20 + :thrash 20 + :thunder 10 + :thunder-wave 20 + :thunderbolt 15 + :thunderpunch 15 + :thundershock 30 + :toxic 10 + :transform 10 + :tri-attack 10 + :twinneedle 20 + :vicegrip 30 + :vine-whip 10 + :water-gun 25 + :waterfall 15 + :whirlwind 20 + :wing-attack 35 + :withdraw 40 + :wrap 20}) + +(defn max-pp [name pp-ups] + (int (* (+ 1 (* (/ 1 5) pp-ups)) + (move-name->move-pp name)))) \ No newline at end of file diff -r 67c42608ef9d -r d4e673d09181 clojure/com/aurellem/gb/pokemon.clj --- a/clojure/com/aurellem/gb/pokemon.clj Fri Mar 23 00:24:54 2012 -0500 +++ b/clojure/com/aurellem/gb/pokemon.clj Fri Mar 23 00:32:44 2012 -0500 @@ -85,7 +85,7 @@ ([n new-name] (set-original-trainer @current-state n new-name))) -(def OT-ID-addresses [0xD176 0xD1A2 0xD1CE 0xD1FA 0xD228 0xD252]) +(def OT-ID-addresses [0xD176 0xD1A2 0xD1CE 0xD1FA 0xD226 0xD252]) (defn read-OT-id ([^SaveState state poke-num] @@ -228,7 +228,7 @@ :dv dv-values :original-trainer OT-name :ID ID - :moves (zipmap moves moves-pp) + :moves (mapv vector moves moves-pp) ;; ephemerial :satus status @@ -237,7 +237,85 @@ })) ([poke-num] (pokemon-info @current-state poke-num))) - + +(defn print-pokemon + ([^SaveState state poke-num] + (let [info (pokemon-info state poke-num)] + (printf + (str + "##################################" + "##################################\n" + "# " + " #\n" + "# %-44s" + "%-20s#\n" + "# " + " #\n" + "##################################" + "##################################\n\n") + + (str + (:name info) + (str + " (" (.substring (str (:species info)) 1) ")") + (str " Lvl." (format "%-3d" (:level (:stats info))))) + (str (:original-trainer info) " / " (:ID info))) + + (println + (str + (str "-----------------------------------" + "---------------------------------\n" ) + (str "| Stats | HP | Attack " + "| Defense | Speed | Special |\n") + (str "+-----------+----------+----------" + "+----------+----------+----------+"))) + + (printf + (str "|%-11s| %5d | %5d " + "| %5d | %5d | %5d |\n") + "DV Values" (:hp (:dv info)) (:attack (:dv info)) + (:defense (:dv info)) (:speed (:dv info)) + (:special (:dv info))) + + (let [c (:stats info)] + (printf + (str "|%-11s| %5d | %5d " + "| %5d | %5d | %5d |\n") + "Current" (:hp c) (:attack c) + (:defense c) (:speed c) + (:special c))) + + (let [e (:experience info)] + (printf + (str "|%-11s| %5d | %5d " + "| %5d | %5d | %5d |\n") + "Experience" (:hp-exp e) (:attack-exp e) + (:defense-exp e) (:speed-exp e) + (:special-exp e))) + (println + (str "+-----------+----------+----------" + "+----------+----------+----------+")) + + (print "\n") + (println "+------------------+----+--------+--------+") + (println "| Move | PP | Max PP | PP UPs |") + (println "+------------------+----+--------+--------+") + + (dorun + (for [[name {:keys [pp-ups current-pp]}] (:moves info)] + (printf + "| %-17s| %2d | %02d | %02d |\n" + (.substring (str name) 1) + current-pp (max-pp name pp-ups) pp-ups))) + + (println "+------------------+----+--------+--------+") + + + + + )) + ([poke-num] + (print-pokemon @current-state poke-num))) (defn give-status-all ([^SaveState state status] diff -r 67c42608ef9d -r d4e673d09181 save-states/before-erika.sav Binary file save-states/before-erika.sav has changed