Mercurial > vba-clojure
diff clojure/com/aurellem/gb/moves.clj @ 209:912496041f98
give pokemon appears to work.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 23 Mar 2012 05:45:56 -0500 |
parents | 5055ec9de278 |
children | 62969eb07e04 |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/gb/moves.clj Fri Mar 23 04:39:24 2012 -0500 1.2 +++ b/clojure/com/aurellem/gb/moves.clj Fri Mar 23 05:45:56 2012 -0500 1.3 @@ -264,6 +264,20 @@ 1.4 (give-pp @current-state 1.5 pokemon-num move-num pp-ups current-pp))) 1.6 1.7 +(defn give-moves-pps 1.8 + ([^SaveState state poke-num moves-pps] 1.9 + (let [new-moves 1.10 + (-> state 1.11 + (give-moves poke-num (map first moves-pps)))] 1.12 + (reduce (fn [state move-num] 1.13 + (let [pp (second (nth moves-pps move-num))] 1.14 + (give-pp state poke-num move-num 1.15 + (:pp-ups pp) 1.16 + (:current-pp pp)))) 1.17 + new-moves (range (count moves-pps))))) 1.18 + ([poke-num moves-pps] 1.19 + (give-moves-pps @current-state poke-num moves-pps))) 1.20 + 1.21 1.22 (def move-name->move-pp 1.23 { 1.24 @@ -378,7 +392,7 @@ 1.25 :rock-throw 15 1.26 :rolling-kick 15 1.27 :sand-attack 15 1.28 - :scratch 30 1.29 + :scratch 35 1.30 :screech 40 1.31 :seismic-toss 20 1.32 :selfdestruct 5