comparison clojure/com/aurellem/gb/pokemon.clj @ 327:fe6fd2323264

corrected compilation bugs
author Robert McIntyre <rlm@mit.edu>
date Thu, 05 Apr 2012 12:59:30 -0500
parents 8484e6f6db2c
children
comparison
equal deleted inserted replaced
326:8484e6f6db2c 327:fe6fd2323264
387 (let [moves (:moves pokemon)] 387 (let [moves (:moves pokemon)]
388 (assoc pokemon :moves 388 (assoc pokemon :moves
389 (for [move moves] 389 (for [move moves]
390 (cond 390 (cond
391 (keyword? move) 391 (keyword? move)
392 [move {:current-pp (max-pp move 0) :pp-ups 0}] 392 [move {:current-pp (max-pp move 3) :pp-ups 3}]
393 (vector? move) 393 (vector? move)
394 [(first move) 394 [(first move)
395 (merge {:current-pp (max-pp (first move) 0) 395 (merge {:current-pp (max-pp (first move) 3)
396 :pp-ups 0} (second move))])))))) 396 :pp-ups 3} (second move))]))))))
397 ;; The game stores the pokemon's type redundantly 397 ;; The game stores the pokemon's type redundantly
398 ;; along with the species. If it's not specified 398 ;; along with the species. If it's not specified
399 ;; then it should default to that species default type. 399 ;; then it should default to that species default type.
400 ((fn [pokemon] 400 ((fn [pokemon]
401 (if (nil? (:type pokemon)) 401 (if (nil? (:type pokemon))