Mercurial > vba-clojure
comparison clojure/com/aurellem/gb/pokemon.clj @ 326:8484e6f6db2c
saving progress before trip to Liberal.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Wed, 04 Apr 2012 14:55:43 -0500 |
parents | ff37bc3004a7 |
children | fe6fd2323264 |
comparison
equal
deleted
inserted
replaced
325:a5cdb2f76307 | 326:8484e6f6db2c |
---|---|
1 (ns com.aurellem.gb.pokemon | 1 (ns com.aurellem.gb.pokemon |
2 (:use (com.aurellem.gb gb-driver util constants characters | 2 (:use (com.aurellem.gb gb-driver util constants characters |
3 moves types items status dv species | 3 moves types items status dv species |
4 experience stats | 4 experience stats pokemon-presets |
5 )) | 5 )) |
6 (:import [com.aurellem.gb.gb_driver SaveState])) | 6 (:import [com.aurellem.gb.gb_driver SaveState])) |
7 | 7 |
8 (def pokemon-names-start 0xD2B4) | 8 (def pokemon-names-start 0xD2B4) |
9 | 9 |
354 state | 354 state |
355 (range (party-number state)))) | 355 (range (party-number state)))) |
356 ([status] | 356 ([status] |
357 (give-status-all @current-state status))) | 357 (give-status-all @current-state status))) |
358 | 358 |
359 | |
360 (def pokemon-base | |
361 {:dv {:attack 15 :hp 15 :defense 15 | |
362 :special 15 :speed 15} | |
363 :species :ditto | |
364 :original-trainer "RLM" | |
365 :ID 5195 | |
366 :status :normal | |
367 :experience | |
368 {:main-exp 500 | |
369 :attack-exp 0xFFFF | |
370 :defense-exp 0xFFFF | |
371 :speed-exp 0xFFFF | |
372 :special-exp 0xFFFF | |
373 :hp-exp 0xFFFF} | |
374 | |
375 :stats | |
376 {:level 7 | |
377 :current-hp 30 | |
378 :hp 30 | |
379 :attack 18 | |
380 :defense 18 | |
381 :speed 18 | |
382 :special 18} | |
383 :moves [[:transform {:pp-ups 0 :current-pp 5}]]}) | |
384 | |
385 (defn expand-pokemon | 359 (defn expand-pokemon |
386 "Given a map describing a pokemon, fill in any missing | 360 "Given a map describing a pokemon, fill in any missing |
387 values based on the ones already present." | 361 values based on the ones already present." |
388 [pokemon] | 362 [pokemon] |
389 (-> (merge pokemon-base pokemon) | 363 (-> (merge pokemon-base pokemon) |
461 (give-pokemon state poke-num | 435 (give-pokemon state poke-num |
462 (merge (pokemon state poke-num) | 436 (merge (pokemon state poke-num) |
463 new-pokemon-data))) | 437 new-pokemon-data))) |
464 ([poke-num new-pokemon-data] | 438 ([poke-num new-pokemon-data] |
465 (edit-pokemon @current-state poke-num new-pokemon-data))) | 439 (edit-pokemon @current-state poke-num new-pokemon-data))) |
440 | |
441 (defn give-powerful-party | |
442 ([^SaveState state] | |
443 (-> state | |
444 (give-pokemon 0 tauros) | |
445 (give-pokemon 1 chansey) | |
446 (give-pokemon 2 alakazam) | |
447 (give-pokemon 3 golem) | |
448 (give-pokemon 4 exeggutor) | |
449 (give-pokemon 5 starmie) | |
450 | |
451 )) | |
452 ([] (give-powerful-party @current-state))) |