# HG changeset patch # User Robert McIntyre # Date 1332477542 18000 # Node ID 1844bdd5631498a229205c76b778ec711756bc23 # Parent da1a5ed61a8de1f96bbf4e108498b0c9d5da0cfe working on printing pokemon in a nicely formatted way. diff -r da1a5ed61a8d -r 1844bdd56314 clojure/com/aurellem/gb/pokemon.clj --- a/clojure/com/aurellem/gb/pokemon.clj Thu Mar 22 22:37:35 2012 -0500 +++ b/clojure/com/aurellem/gb/pokemon.clj Thu Mar 22 23:39:02 2012 -0500 @@ -237,7 +237,78 @@ })) ([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 "+------------------+----+--------+--------+") + + + + + )) + ([poke-num] + (print-pokemon @current-state poke-num))) (defn give-status-all ([^SaveState state status]