comparison 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
comparison
equal deleted inserted replaced
208:45f1376b578c 209:912496041f98
262 current-pp)))) 262 current-pp))))
263 ([pokemon-num move-num pp-ups current-pp] 263 ([pokemon-num move-num pp-ups current-pp]
264 (give-pp @current-state 264 (give-pp @current-state
265 pokemon-num move-num pp-ups current-pp))) 265 pokemon-num move-num pp-ups current-pp)))
266 266
267 (defn give-moves-pps
268 ([^SaveState state poke-num moves-pps]
269 (let [new-moves
270 (-> state
271 (give-moves poke-num (map first moves-pps)))]
272 (reduce (fn [state move-num]
273 (let [pp (second (nth moves-pps move-num))]
274 (give-pp state poke-num move-num
275 (:pp-ups pp)
276 (:current-pp pp))))
277 new-moves (range (count moves-pps)))))
278 ([poke-num moves-pps]
279 (give-moves-pps @current-state poke-num moves-pps)))
280
267 281
268 (def move-name->move-pp 282 (def move-name->move-pp
269 { 283 {
270 :absorb 20 284 :absorb 20
271 :acid 30 285 :acid 30
376 :roar 20 390 :roar 20
377 :rock-slide 10 391 :rock-slide 10
378 :rock-throw 15 392 :rock-throw 15
379 :rolling-kick 15 393 :rolling-kick 15
380 :sand-attack 15 394 :sand-attack 15
381 :scratch 30 395 :scratch 35
382 :screech 40 396 :screech 40
383 :seismic-toss 20 397 :seismic-toss 20
384 :selfdestruct 5 398 :selfdestruct 5
385 :sharpen 30 399 :sharpen 30
386 :sing 15 400 :sing 15