|
@@ -8,112 +8,112 @@
|
8
|
8
|
#define TEST_AMOUNT 10000
|
9
|
9
|
|
10
|
10
|
void test_speed() {
|
11
|
|
- print("Initiating Initiative Unit\nTest...\n");
|
|
11
|
+ debug_print("Initiating Initiative Unit\nTest...\n");
|
12
|
12
|
u8 pass = true;
|
13
|
13
|
battle_participants[0].spd = 10;
|
14
|
14
|
battle_participants[1].spd = 11;
|
15
|
|
- printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
16
|
|
- printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
17
|
|
- print("testing (await TWO):");
|
|
15
|
+ debug_printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
|
16
|
+ debug_printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
|
17
|
+ debug_print("testing (await TWO):");
|
18
|
18
|
enum init_enum result = get_first_to_strike(0, 1, 0);
|
19
|
19
|
if (result == TWO)
|
20
|
|
- print("\xFE\x1 pass\n\xFE\x0");
|
|
20
|
+ debug_print("\xFE\x1 pass\n\xFE\x0");
|
21
|
21
|
else {
|
22
|
22
|
pass = false;
|
23
|
|
- print("\xFE\x2 fail\n\xFE\x0");
|
|
23
|
+ debug_print("\xFE\x2 fail\n\xFE\x0");
|
24
|
24
|
}
|
25
|
25
|
battle_participants[0].spd = 12;
|
26
|
|
- printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
27
|
|
- printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
28
|
|
- print("testing (await ONE):");
|
|
26
|
+ debug_printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
|
27
|
+ debug_printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
|
28
|
+ debug_print("testing (await ONE):");
|
29
|
29
|
result = get_first_to_strike(0, 1, 0);
|
30
|
30
|
if (result == ONE)
|
31
|
|
- print("\xFE\x1 pass\n\xFE\x0");
|
|
31
|
+ debug_print("\xFE\x1 pass\n\xFE\x0");
|
32
|
32
|
else {
|
33
|
33
|
pass = false;
|
34
|
|
- print("\xFE\x2 fail\n\xFE\x0");
|
|
34
|
+ debug_print("\xFE\x2 fail\n\xFE\x0");
|
35
|
35
|
}
|
36
|
36
|
battle_participants[0].spd = 10;
|
37
|
37
|
battle_participants[1].spd = 11;
|
38
|
|
- printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
39
|
|
- printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
|
38
|
+ debug_printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
|
39
|
+ debug_printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
40
|
40
|
|
41
|
41
|
//trick room
|
42
|
42
|
custom_battle_elements.ptr->field_affecting.trick_room = 1;
|
43
|
|
- print("activating trick room...\n");
|
44
|
|
- print("testing (await ONE):");
|
|
43
|
+ debug_print("activating trick room...\n");
|
|
44
|
+ debug_print("testing (await ONE):");
|
45
|
45
|
result = get_first_to_strike(0, 1, 0);
|
46
|
46
|
if (result == ONE)
|
47
|
|
- print("\xFE\x1 pass\n\xFE\x0");
|
|
47
|
+ debug_print("\xFE\x1 pass\n\xFE\x0");
|
48
|
48
|
else {
|
49
|
49
|
pass = false;
|
50
|
|
- print("\xFE\x2 fail\n\xFE\x0");
|
|
50
|
+ debug_print("\xFE\x2 fail\n\xFE\x0");
|
51
|
51
|
}
|
52
|
52
|
|
53
|
53
|
battle_participants[0].spd = 12;
|
54
|
|
- printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
55
|
|
- printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
56
|
|
- print("testing (await TWO):");
|
|
54
|
+ debug_printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
|
55
|
+ debug_printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
|
56
|
+ debug_print("testing (await TWO):");
|
57
|
57
|
result = get_first_to_strike(0, 1, 0);
|
58
|
58
|
if (result == TWO)
|
59
|
|
- print("\xFE\x1 pass\n\xFE\x0");
|
|
59
|
+ debug_print("\xFE\x1 pass\n\xFE\x0");
|
60
|
60
|
else {
|
61
|
61
|
pass = false;
|
62
|
|
- print("\xFE\x2 fail\n\xFE\x0");
|
|
62
|
+ debug_print("\xFE\x2 fail\n\xFE\x0");
|
63
|
63
|
}
|
64
|
64
|
|
65
|
65
|
battle_participants[1].ability_id = ABILITY_STALL;
|
66
|
|
- print("stall test (+tr): ");
|
|
66
|
+ debug_print("stall test (+tr): ");
|
67
|
67
|
result = get_first_to_strike(0, 1, 0);
|
68
|
68
|
if (result == ONE)
|
69
|
|
- print("\xFE\x1 pass\n\xFE\x0");
|
|
69
|
+ debug_print("\xFE\x1 pass\n\xFE\x0");
|
70
|
70
|
else {
|
71
|
71
|
pass = false;
|
72
|
|
- print("\xFE\x2 fail\n\xFE\x0");
|
|
72
|
+ debug_print("\xFE\x2 fail\n\xFE\x0");
|
73
|
73
|
}
|
74
|
74
|
custom_battle_elements.ptr->field_affecting.trick_room = 0;
|
75
|
|
- print("stall test (-tr): ");
|
|
75
|
+ debug_print("stall test (-tr): ");
|
76
|
76
|
|
77
|
77
|
result = get_first_to_strike(0, 1, 0);
|
78
|
78
|
if (result == ONE)
|
79
|
|
- print("\xFE\x1 pass\n\xFE\x0");
|
|
79
|
+ debug_print("\xFE\x1 pass\n\xFE\x0");
|
80
|
80
|
else {
|
81
|
81
|
pass = false;
|
82
|
|
- print("\xFE\x2 fail\n\xFE\x0");
|
|
82
|
+ debug_print("\xFE\x2 fail\n\xFE\x0");
|
83
|
83
|
}
|
84
|
84
|
|
85
|
85
|
battle_participants[1].ability_id = 0;
|
86
|
86
|
|
87
|
|
- print("\nPRESS A TO CONTINUE...");
|
88
|
|
- wait_for_btn(1);
|
|
87
|
+ debug_print("\nPRESS A TO CONTINUE...");
|
|
88
|
+ debug_wait_for_btn(1);
|
89
|
89
|
debug_clean();
|
90
|
90
|
|
91
|
|
- print("speed value tests...\n");
|
|
91
|
+ debug_print("speed value tests...\n");
|
92
|
92
|
battle_participants[0].spd = 75;
|
93
|
93
|
battle_participants[1].spd = 60;
|
94
|
|
- printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
95
|
|
- printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
|
94
|
+ debug_printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
|
95
|
+ debug_printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
96
|
96
|
u16 speed_one = get_speed(0);
|
97
|
97
|
u16 speed_two = get_speed(1);
|
98
|
|
- printf("unaffected speed: %d", speed_one);
|
99
|
|
- printf(": %d", speed_two);
|
|
98
|
+ debug_printf("unaffected speed: %d", speed_one);
|
|
99
|
+ debug_printf(": %d", speed_two);
|
100
|
100
|
if (speed_one == 75 && speed_two == 60) {
|
101
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
101
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
102
|
102
|
} else {
|
103
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
103
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
104
|
104
|
pass = false;
|
105
|
105
|
}
|
106
|
106
|
battle_participants[0].status.flags.paralysis = 1;
|
107
|
107
|
battle_participants[1].status.flags.paralysis = 1;
|
108
|
108
|
speed_one = get_speed(0);
|
109
|
109
|
speed_two = get_speed(1);
|
110
|
|
- printf("para speed: %d", speed_one);
|
111
|
|
- printf(": %d", speed_two);
|
|
110
|
+ debug_printf("para speed: %d", speed_one);
|
|
111
|
+ debug_printf(": %d", speed_two);
|
112
|
112
|
|
113
|
113
|
if (speed_one == 18 && speed_two == 15) {
|
114
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
114
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
115
|
115
|
} else {
|
116
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
116
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
117
|
117
|
pass = false;
|
118
|
118
|
}
|
119
|
119
|
battle_participants[0].spd_buff = 12;
|
|
@@ -121,13 +121,13 @@ void test_speed() {
|
121
|
121
|
speed_one = get_speed(0);
|
122
|
122
|
speed_two = get_speed(1);
|
123
|
123
|
|
124
|
|
- printf("para/speed+6: %d", speed_one);
|
125
|
|
- printf(": %d", speed_two);
|
|
124
|
+ debug_printf("para/speed+6: %d", speed_one);
|
|
125
|
+ debug_printf(": %d", speed_two);
|
126
|
126
|
|
127
|
127
|
if (speed_one == 75 && speed_two == 60) {
|
128
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
128
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
129
|
129
|
} else {
|
130
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
130
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
131
|
131
|
pass = false;
|
132
|
132
|
}
|
133
|
133
|
battle_participants[0].status.flags.paralysis = 0;
|
|
@@ -135,13 +135,13 @@ void test_speed() {
|
135
|
135
|
speed_one = get_speed(0);
|
136
|
136
|
speed_two = get_speed(1);
|
137
|
137
|
|
138
|
|
- printf("speed+6: %d", speed_one);
|
139
|
|
- printf(": %d", speed_two);
|
|
138
|
+ debug_printf("speed+6: %d", speed_one);
|
|
139
|
+ debug_printf(": %d", speed_two);
|
140
|
140
|
|
141
|
141
|
if (speed_one == 300 && speed_two == 240) {
|
142
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
142
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
143
|
143
|
} else {
|
144
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
144
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
145
|
145
|
pass = false;
|
146
|
146
|
}
|
147
|
147
|
|
|
@@ -150,19 +150,19 @@ void test_speed() {
|
150
|
150
|
speed_one = get_speed(0);
|
151
|
151
|
speed_two = get_speed(1);
|
152
|
152
|
|
153
|
|
- printf("speed-3: %d", speed_one);
|
154
|
|
- printf(": %d", speed_two);
|
|
153
|
+ debug_printf("speed-3: %d", speed_one);
|
|
154
|
+ debug_printf(": %d", speed_two);
|
155
|
155
|
|
156
|
156
|
if (speed_one == 30 && speed_two == 24) {
|
157
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
157
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
158
|
158
|
} else {
|
159
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
159
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
160
|
160
|
pass = false;
|
161
|
161
|
}
|
162
|
162
|
|
163
|
163
|
battle_participants[0].spd_buff = 6;
|
164
|
164
|
battle_participants[1].spd_buff = 6;
|
165
|
|
- print("activating chemtrails...\n");
|
|
165
|
+ debug_print("activating chemtrails...\n");
|
166
|
166
|
battle_weather.flags.rain = 1;
|
167
|
167
|
battle_weather.flags.sun = 1;
|
168
|
168
|
battle_weather.flags.sandstorm = 1;
|
|
@@ -180,12 +180,12 @@ void test_speed() {
|
180
|
180
|
speed_one = get_speed(0);
|
181
|
181
|
if (speed_one != 150)
|
182
|
182
|
weather_pass = false;
|
183
|
|
- print("weather test:");
|
184
|
|
- print(weather_pass ? "\xFE\x1 pass\xFE\x0\n" : "\xFE\x2 fail\xFE\x0\n");
|
|
183
|
+ debug_print("weather test:");
|
|
184
|
+ debug_print(weather_pass ? "\xFE\x1 pass\xFE\x0\n" : "\xFE\x2 fail\xFE\x0\n");
|
185
|
185
|
if (!weather_pass)
|
186
|
186
|
pass = false;
|
187
|
187
|
|
188
|
|
- print("tailwind + weather: ");
|
|
188
|
+ debug_print("tailwind + weather: ");
|
189
|
189
|
custom_battle_elements.ptr->side_affecting[0].tailwind = 1;
|
190
|
190
|
custom_battle_elements.ptr->side_affecting[0].tailwind_bank = 0;
|
191
|
191
|
custom_battle_elements.ptr->side_affecting[1].tailwind = 1;
|
|
@@ -194,9 +194,9 @@ void test_speed() {
|
194
|
194
|
speed_two = get_speed(1);
|
195
|
195
|
|
196
|
196
|
if (speed_one == 300 && speed_two == 240) {
|
197
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
197
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
198
|
198
|
} else {
|
199
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
199
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
200
|
200
|
pass = false;
|
201
|
201
|
}
|
202
|
202
|
custom_battle_elements.ptr->side_affecting[0].tailwind = 0;
|
|
@@ -208,7 +208,7 @@ void test_speed() {
|
208
|
208
|
battle_weather.flags.sandstorm = 0;
|
209
|
209
|
|
210
|
210
|
|
211
|
|
- print("quick feet: ");
|
|
211
|
+ debug_print("quick feet: ");
|
212
|
212
|
battle_participants[0].ability_id = ABILITY_QUICK_FEET;
|
213
|
213
|
battle_participants[1].ability_id = ABILITY_QUICK_FEET;
|
214
|
214
|
battle_participants[0].status.flags.paralysis = 1;
|
|
@@ -230,21 +230,21 @@ void test_speed() {
|
230
|
230
|
quick_feet_pass = false;
|
231
|
231
|
|
232
|
232
|
if (quick_feet_pass) {
|
233
|
|
- print(" \xFE\x1pass\xFE\x0\n");
|
|
233
|
+ debug_print(" \xFE\x1pass\xFE\x0\n");
|
234
|
234
|
} else {
|
235
|
|
- print("\xFE\x02 fail\xFE\x0\n");
|
|
235
|
+ debug_print("\xFE\x02 fail\xFE\x0\n");
|
236
|
236
|
pass = false;
|
237
|
237
|
}
|
238
|
238
|
battle_participants[0].status.flags.sleep = 0;
|
239
|
239
|
battle_participants[0].ability_id = 0;
|
240
|
240
|
battle_participants[1].ability_id = 0;
|
241
|
|
- wait_for_btn(8);
|
|
241
|
+ debug_wait_for_btn(8);
|
242
|
242
|
debug_clean();
|
243
|
243
|
//stress
|
244
|
244
|
battle_participants[0].spd = 20;
|
245
|
245
|
battle_participants[1].spd = 20;
|
246
|
|
- printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
247
|
|
- printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
|
246
|
+ debug_printf("bank_one.spd: %d\n", battle_participants[0].spd);
|
|
247
|
+ debug_printf("bank_two.spd: %d\n", battle_participants[1].spd);
|
248
|
248
|
int count_one = 0;
|
249
|
249
|
int count_two = 0;
|
250
|
250
|
for (int i = 0; i < TEST_AMOUNT; ++i) {
|
|
@@ -255,23 +255,23 @@ void test_speed() {
|
255
|
255
|
count_two++;
|
256
|
256
|
}
|
257
|
257
|
|
258
|
|
- printf("tie stress test...\ncount \xFE\x1%d\xFE\x0 / ", count_one);
|
259
|
|
- printf(" \xFE\x2%d\xFE\x0\n", count_two);
|
|
258
|
+ debug_printf("tie stress test...\ncount \xFE\x1%d\xFE\x0 / ", count_one);
|
|
259
|
+ debug_printf(" \xFE\x2%d\xFE\x0\n", count_two);
|
260
|
260
|
int ratio_one = (count_one * 100) / TEST_AMOUNT;
|
261
|
261
|
int ratio_two = (count_two * 100) / TEST_AMOUNT;
|
262
|
|
- printf("%d%% / ", ratio_one);
|
263
|
|
- printf("%d%%\n", ratio_two);
|
264
|
|
- print("\nPRESS A TO CONTINUE...");
|
|
262
|
+ debug_printf("%d%% / ", ratio_one);
|
|
263
|
+ debug_printf("%d%%\n", ratio_two);
|
|
264
|
+ debug_print("\nPRESS A TO CONTINUE...");
|
265
|
265
|
|
266
|
|
- wait_for_btn(1);
|
|
266
|
+ debug_wait_for_btn(1);
|
267
|
267
|
debug_clean();
|
268
|
268
|
|
269
|
269
|
|
270
|
270
|
if (pass)
|
271
|
|
- set_debug_background(0x3E0);
|
|
271
|
+ debug_set_bg(0x3E0);
|
272
|
272
|
else
|
273
|
|
- set_debug_background(0x1F);
|
274
|
|
- print("test complete\n(entering deadlock)");
|
|
273
|
+ debug_set_bg(0x1F);
|
|
274
|
+ debug_print("test complete\n(entering deadlock)");
|
275
|
275
|
while (true) {
|
276
|
276
|
}
|
277
|
277
|
return;
|