ocsenave@289
|
1 (ns com.aurellem.world.new-types
|
ocsenave@292
|
2 (:use (com.aurellem.gb gb-driver util hxc characters util assembly))
|
ocsenave@292
|
3 (:use (com.aurellem.world practice))
|
ocsenave@292
|
4 (:import [com.aurellem.gb.gb_driver SaveState]))
|
ocsenave@289
|
5
|
ocsenave@292
|
6
|
ocsenave@292
|
7 ;; GEN II type differences
|
ocsenave@292
|
8 ;; bug against poison: 2x -> 1/2
|
ocsenave@292
|
9 ;; poison against bug: 2x -> 1x
|
ocsenave@292
|
10 ;; !! our article is wrong. bug against ghost 1x -X-> 2x
|
ocsenave@292
|
11 ;; ghost against psychic: 0x -> 2x
|
ocsenave@292
|
12 ;; ice against fire: 1x -> 1/2
|
ocsenave@292
|
13
|
ocsenave@292
|
14 ;; steel against rock: 2x
|
ocsenave@292
|
15 ;; steel against steel: 1/2
|
ocsenave@292
|
16 ;; steel against fire : 1/2
|
ocsenave@292
|
17 ;; steel against water: 1/2
|
ocsenave@292
|
18 ;; steel against electric: 1/2
|
ocsenave@292
|
19 ;; steel against ice: 2x
|
ocsenave@292
|
20
|
ocsenave@292
|
21 ;; normal against steel: 1/2
|
ocsenave@292
|
22 ;; fighting against steel: 2x
|
ocsenave@292
|
23 ;; flying against steel: 1/2
|
ocsenave@292
|
24 ;; poison against steel: 0
|
ocsenave@292
|
25 ;; ground against steel: 2
|
ocsenave@292
|
26 ;; rock against steel: 1/2
|
ocsenave@292
|
27 ;; bug against steel: 1/2
|
ocsenave@292
|
28 ;; ghost against steel: 1/2
|
ocsenave@292
|
29 ;; fire against steel: 2
|
ocsenave@292
|
30 ;; grass against steel: 1/2
|
ocsenave@292
|
31 ;; psychic against steel: 1/2
|
ocsenave@292
|
32 ;; ice against steel: 1/2
|
ocsenave@292
|
33 ;; dragon against steel: 1/2
|
ocsenave@292
|
34 ;; dark against steel: 1/2
|
ocsenave@292
|
35
|
ocsenave@292
|
36 ;; dark against fighting 1/2
|
ocsenave@292
|
37 ;; dark against ghost 2x
|
ocsenave@292
|
38 ;; dark against steel 1/2
|
ocsenave@292
|
39 ;; dark against psychic 2x
|
ocsenave@292
|
40 ;; dark against dark 1/2
|
ocsenave@292
|
41
|
ocsenave@292
|
42 ;; fighting against dark 1/2
|
ocsenave@292
|
43 ;; bug against dark 2x
|
ocsenave@292
|
44 ;; ghost against dark 1/2
|
ocsenave@292
|
45 ;; psychic against dark 0
|
ocsenave@292
|
46
|
ocsenave@292
|
47
|
ocsenave@292
|
48 ;; #BIRD -> #DARK at 27DE8
|
ocsenave@292
|
49
|
ocsenave@292
|
50 (defn hack-encounter
|
ocsenave@292
|
51 "(BROKEN) Change the wild encounter pokemon of the given area in the current state. Volatile ---
|
ocsenave@292
|
52 only changes the current area, and then only as long as you remain in
|
ocsenave@292
|
53 the area."
|
ocsenave@292
|
54 ([pokemon]
|
ocsenave@292
|
55 (hack-encounter pokemon 11))
|
ocsenave@292
|
56 ([pokemon level]
|
ocsenave@292
|
57 (let [id ((zipmap (hxc-pokenames) (range)) pokemon)]
|
ocsenave@292
|
58 (rewrite-memory (vec(memory))
|
ocsenave@292
|
59 0xD888
|
ocsenave@292
|
60 (cons level
|
ocsenave@292
|
61 (interleave
|
ocsenave@292
|
62 (repeat 5 level)
|
ocsenave@292
|
63 (repeat (inc id)))
|
ocsenave@292
|
64 )))))
|
ocsenave@292
|
65
|
ocsenave@292
|
66
|
ocsenave@292
|
67 (defn hack-encounter*
|
ocsenave@292
|
68 "Certainly Encounter a certain pokemon in the grass outside celadon. You must
|
ocsenave@292
|
69 walk out of the wild and back to load the data into RAM."
|
ocsenave@292
|
70 ([mem pkmn] (encounter mem pkmn 11))
|
ocsenave@292
|
71 ([mem pkmn lvl]
|
ocsenave@292
|
72 (let [pkmn-id ((zipmap (hxc-pokenames) (range)) pkmn)
|
ocsenave@292
|
73 pkmn-id (if (nil? pkmn-id) 76 (inc pkmn-id))
|
ocsenave@292
|
74 ]
|
ocsenave@292
|
75 (rewrite-memory
|
ocsenave@292
|
76 mem
|
ocsenave@292
|
77 0xCF6C
|
ocsenave@292
|
78 (interleave (repeat lvl 10) (repeat pkmn-id))))))
|
ocsenave@292
|
79
|
ocsenave@292
|
80
|
ocsenave@292
|
81 (defn hack-gen-2-types
|
ocsenave@292
|
82 []
|
ocsenave@292
|
83 (->
|
ocsenave@292
|
84 (vec (rom))
|
ocsenave@292
|
85 (rewrite-memory 0x3E6DD [20]) ;; ghost is 2x effective against psychic
|
ocsenave@292
|
86 (rewrite-memory 0x3E6C5 [5]) ;; bug is half-effective against poison
|
ocsenave@292
|
87
|
ocsenave@292
|
88 ;; ice is half-effective against fire.
|
ocsenave@292
|
89 ;; since this overwrites "poison is 2x against bug",
|
ocsenave@292
|
90 ;; poison is now, by default, 1x effective against bug.
|
ocsenave@292
|
91 (rewrite-memory 0x3E681 [25 20 5])
|
ocsenave@292
|
92
|
ocsenave@292
|
93
|
ocsenave@292
|
94 (rewrite-memory 0x27DE9 ["DARK"]) ;; replace BIRD with DARK
|
ocsenave@292
|
95 (rewrite-memory 0x38105 [6]) ;; BITE is a dark-type attack
|
ocsenave@292
|
96
|
ocsenave@292
|
97 ;; the following commands write into risky unknown memory.
|
ocsenave@292
|
98
|
ocsenave@292
|
99 (rewrite-memory 0x27DFF
|
ocsenave@292
|
100 ["STEEL" 0x50])
|
ocsenave@292
|
101
|
ocsenave@292
|
102 (rewrite-memory 0x3E6f0
|
ocsenave@292
|
103 [6 1 5 ;; dark fighting 1/2
|
ocsenave@292
|
104 6 24 20 ;; dark psychic 2
|
ocsenave@292
|
105 6 8 20 ;; dark ghost 2
|
ocsenave@292
|
106 6 6 5 ;; dark dark 1/2
|
ocsenave@292
|
107
|
ocsenave@292
|
108 1 6 20 ;; fighting dark 2
|
ocsenave@292
|
109 24 6 0 ;; psychic dark 0
|
ocsenave@292
|
110 7 6 20 ;; bug dark 2
|
ocsenave@292
|
111 8 6 5 ;; ghost dark 1/2
|
ocsenave@292
|
112
|
ocsenave@292
|
113 0xff
|
ocsenave@292
|
114 ])
|
ocsenave@292
|
115 ;;(rewrite-rom _
|
ocsenave@292
|
116 ;;(write-rom!)
|
ocsenave@292
|
117
|
ocsenave@292
|
118 ))
|
ocsenave@292
|
119
|
ocsenave@292
|
120
|
ocsenave@292
|
121
|