comparison clojure/com/aurellem/gb/pokemon.clj @ 210:565f5d17f90a

fixed minor bug in give-pokemon
author Robert McIntyre <rlm@mit.edu>
date Fri, 23 Mar 2012 05:58:04 -0500
parents 912496041f98
children 8523faa122b0
comparison
equal deleted inserted replaced
209:912496041f98 210:565f5d17f90a
413 (let [moves (:moves pokemon)] 413 (let [moves (:moves pokemon)]
414 (assoc pokemon :moves 414 (assoc pokemon :moves
415 (for [move moves] 415 (for [move moves]
416 (cond 416 (cond
417 (keyword? move) 417 (keyword? move)
418 [move {:current-pp (max-pp move) :pp-ups 0}] 418 [move {:current-pp (max-pp move 0) :pp-ups 0}]
419 (vector? move) 419 (vector? move)
420 [(first move) 420 [(first move)
421 (merge {:current-pp (max-pp (first move) 0) 421 (merge {:current-pp (max-pp (first move) 0)
422 :pp-ups 0} (second move))])))))) 422 :pp-ups 0} (second move))]))))))
423 ;; The game stores the pokemon's type redundantly 423 ;; The game stores the pokemon's type redundantly