Mercurial > vba-clojure
view clojure/com/aurellem/world/new_types.clj @ 325:a5cdb2f76307
improved efficiency of set-cursor
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Wed, 04 Apr 2012 03:25:14 -0500 |
parents | c31cb3043087 |
children |
line wrap: on
line source
1 (ns com.aurellem.world.new-types2 (:use (com.aurellem.gb gb-driver util hxc characters util assembly))3 (:use (com.aurellem.world practice))4 (:import [com.aurellem.gb.gb_driver SaveState]))7 ;; GEN II type differences8 ;; bug against poison: 2x -> 1/29 ;; poison against bug: 2x -> 1x10 ;; !! our article is wrong. bug against ghost 1x -X-> 2x11 ;; ghost against psychic: 0x -> 2x12 ;; ice against fire: 1x -> 1/214 ;; steel against rock: 2x15 ;; steel against steel: 1/216 ;; steel against fire : 1/217 ;; steel against water: 1/218 ;; steel against electric: 1/219 ;; steel against ice: 2x21 ;; normal against steel: 1/222 ;; fighting against steel: 2x23 ;; flying against steel: 1/224 ;; poison against steel: 025 ;; ground against steel: 226 ;; rock against steel: 1/227 ;; bug against steel: 1/228 ;; ghost against steel: 1/229 ;; fire against steel: 230 ;; grass against steel: 1/231 ;; psychic against steel: 1/232 ;; ice against steel: 1/233 ;; dragon against steel: 1/234 ;; dark against steel: 1/236 ;; dark against fighting 1/237 ;; dark against ghost 2x38 ;; dark against steel 1/239 ;; dark against psychic 2x40 ;; dark against dark 1/242 ;; fighting against dark 1/243 ;; bug against dark 2x44 ;; ghost against dark 1/245 ;; psychic against dark 048 ;; #BIRD -> #DARK at 27DE850 (defn hack-encounter51 "(BROKEN) Change the wild encounter pokemon of the given area in the current state. Volatile ---52 only changes the current area, and then only as long as you remain in53 the area."54 ([pokemon]55 (hack-encounter pokemon 11))56 ([pokemon level]57 (let [id ((zipmap (hxc-pokenames) (range)) pokemon)]58 (rewrite-memory (vec(memory))59 0xD88860 (cons level61 (interleave62 (repeat 5 level)63 (repeat (inc id)))64 )))))67 (defn hack-encounter*68 "Certainly Encounter a certain pokemon in the grass outside celadon. You must69 walk out of the wild and back to load the data into RAM."70 ([mem pkmn] (encounter mem pkmn 11))71 ([mem pkmn lvl]72 (let [pkmn-id ((zipmap (hxc-pokenames) (range)) pkmn)73 pkmn-id (if (nil? pkmn-id) 76 (inc pkmn-id))74 ]75 (rewrite-memory76 mem77 0xCF6C78 (interleave (repeat lvl 10) (repeat pkmn-id))))))81 (defn hack-gen-2-types82 []83 (->84 (vec (rom))85 (rewrite-memory 0x3E6DD [20]) ;; ghost is 2x effective against psychic86 (rewrite-memory 0x3E6C5 [5]) ;; bug is half-effective against poison88 ;; ice is half-effective against fire.89 ;; since this overwrites "poison is 2x against bug",90 ;; poison is now, by default, 1x effective against bug.91 (rewrite-memory 0x3E681 [25 20 5])94 (rewrite-memory 0x27DE9 ["DARK"]) ;; replace BIRD with DARK95 (rewrite-memory 0x38105 [6]) ;; BITE is a dark-type attack97 ;; the following commands write into risky unknown memory.99 (rewrite-memory 0x27DFF100 ["STEEL" 0x50])102 (rewrite-memory 0x3E6f0103 [6 1 5 ;; dark fighting 1/2104 6 24 20 ;; dark psychic 2105 6 8 20 ;; dark ghost 2106 6 6 5 ;; dark dark 1/2108 1 6 20 ;; fighting dark 2109 24 6 0 ;; psychic dark 0110 7 6 20 ;; bug dark 2111 8 6 5 ;; ghost dark 1/2113 0xff114 ])115 ;;(rewrite-rom _116 ;;(write-rom!)118 ))