@pkmn/engine 0.1.0-dev.dd5b9081 → 0.1.0-dev.deda8593

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +1 -3
  2. package/README.md +44 -19
  3. package/build/pkg/addon.js +6 -7
  4. package/build/pkg/addon.js.map +1 -1
  5. package/build/pkg/data/ids.json +12 -12
  6. package/build/pkg/data/layout.json +2 -2
  7. package/build/pkg/data/protocol.json +69 -12
  8. package/build/pkg/data.d.ts +4 -4
  9. package/build/pkg/data.js.map +1 -1
  10. package/build/pkg/gen1.js +2 -2
  11. package/build/pkg/gen1.js.map +1 -1
  12. package/build/pkg/index.d.ts +2 -1
  13. package/build/pkg/index.js.map +1 -1
  14. package/build/pkg/protocol.js +61 -42
  15. package/build/pkg/protocol.js.map +1 -1
  16. package/build/test/display.js +2 -2
  17. package/build/test/display.js.map +1 -1
  18. package/build/tools/debug.js +5 -4
  19. package/build/tools/debug.js.map +1 -1
  20. package/build.zig +102 -104
  21. package/package.json +43 -23
  22. package/src/bin/install-pkmn-engine +26 -18
  23. package/src/lib/common/data.zig +9 -9
  24. package/src/lib/common/debug.zig +2 -2
  25. package/src/lib/common/optional.zig +9 -2
  26. package/src/lib/common/options.zig +2 -0
  27. package/src/lib/common/protocol.zig +739 -318
  28. package/src/lib/common/rational.zig +12 -9
  29. package/src/lib/common/rng.zig +25 -16
  30. package/src/lib/gen1/calc.zig +219 -49
  31. package/src/lib/gen1/chance.zig +138 -115
  32. package/src/lib/gen1/data/moves.zig +190 -176
  33. package/src/lib/gen1/data/species.zig +3 -3
  34. package/src/lib/gen1/data/types.zig +7 -7
  35. package/src/lib/gen1/data.zig +44 -44
  36. package/src/lib/gen1/helpers.zig +148 -82
  37. package/src/lib/gen1/mechanics.zig +392 -406
  38. package/src/lib/gen2/calc.zig +143 -0
  39. package/src/lib/gen2/chance.zig +1315 -0
  40. package/src/lib/gen2/data/items.zig +12 -18
  41. package/src/lib/gen2/data/moves.zig +377 -344
  42. package/src/lib/gen2/data/species.zig +1 -1
  43. package/src/lib/gen2/data/types.zig +134 -31
  44. package/src/lib/gen2/data.zig +52 -44
  45. package/src/lib/gen2/generated.zig +806 -0
  46. package/src/lib/gen2/helpers.zig +37 -7
  47. package/src/lib/gen2/mechanics.zig +3086 -211
  48. package/src/lib/{binding/node.zig → node.zig} +10 -13
  49. package/src/lib/pkmn.zig +27 -12
  50. package/src/lib/{binding/wasm.zig → wasm.zig} +2 -1
  51. package/src/test/display/pkmn.html.tmpl +5 -5
  52. package/src/lib/gen1/README.md +0 -894
  53. package/src/lib/gen2/README.md +0 -383
@@ -1,4 +1,4 @@
1
- //! Code generated by `tools/generate` - manual edits will be overwritten
1
+ //! Code generated by `tools/generate` - manual edits will be overwritten.
2
2
 
3
3
  const std = @import("std");
4
4
 
@@ -7,7 +7,7 @@ const gen1 = @import("../../gen1/data.zig");
7
7
 
8
8
  const assert = std.debug.assert;
9
9
 
10
- const Gen12 = rng.Gen12;
10
+ const percent = rng.Gen12.percent;
11
11
  const Type = gen1.Type;
12
12
 
13
13
  /// Representation of a Generation I Pokémon move.
@@ -201,7 +201,7 @@ pub const Move = enum(u8) {
201
201
  .effect = .None,
202
202
  .bp = 40,
203
203
  .type = .Normal,
204
- .accuracy = Gen12.percent(100),
204
+ .accuracy = percent(100),
205
205
  .target = .Other,
206
206
  },
207
207
  // KarateChop
@@ -209,7 +209,7 @@ pub const Move = enum(u8) {
209
209
  .effect = .HighCritical,
210
210
  .bp = 50,
211
211
  .type = .Normal,
212
- .accuracy = Gen12.percent(100),
212
+ .accuracy = percent(100),
213
213
  .target = .Other,
214
214
  },
215
215
  // DoubleSlap
@@ -217,7 +217,7 @@ pub const Move = enum(u8) {
217
217
  .effect = .MultiHit,
218
218
  .bp = 15,
219
219
  .type = .Normal,
220
- .accuracy = Gen12.percent(85),
220
+ .accuracy = percent(85),
221
221
  .target = .Other,
222
222
  },
223
223
  // CometPunch
@@ -225,7 +225,7 @@ pub const Move = enum(u8) {
225
225
  .effect = .MultiHit,
226
226
  .bp = 18,
227
227
  .type = .Normal,
228
- .accuracy = Gen12.percent(85),
228
+ .accuracy = percent(85),
229
229
  .target = .Other,
230
230
  },
231
231
  // MegaPunch
@@ -233,7 +233,7 @@ pub const Move = enum(u8) {
233
233
  .effect = .None,
234
234
  .bp = 80,
235
235
  .type = .Normal,
236
- .accuracy = Gen12.percent(85),
236
+ .accuracy = percent(85),
237
237
  .target = .Other,
238
238
  },
239
239
  // PayDay
@@ -241,7 +241,7 @@ pub const Move = enum(u8) {
241
241
  .effect = .PayDay,
242
242
  .bp = 40,
243
243
  .type = .Normal,
244
- .accuracy = Gen12.percent(100),
244
+ .accuracy = percent(100),
245
245
  .target = .Other,
246
246
  },
247
247
  // FirePunch
@@ -249,7 +249,7 @@ pub const Move = enum(u8) {
249
249
  .effect = .BurnChance1,
250
250
  .bp = 75,
251
251
  .type = .Fire,
252
- .accuracy = Gen12.percent(100),
252
+ .accuracy = percent(100),
253
253
  .target = .Other,
254
254
  },
255
255
  // IcePunch
@@ -257,7 +257,7 @@ pub const Move = enum(u8) {
257
257
  .effect = .FreezeChance,
258
258
  .bp = 75,
259
259
  .type = .Ice,
260
- .accuracy = Gen12.percent(100),
260
+ .accuracy = percent(100),
261
261
  .target = .Other,
262
262
  },
263
263
  // ThunderPunch
@@ -265,7 +265,7 @@ pub const Move = enum(u8) {
265
265
  .effect = .ParalyzeChance1,
266
266
  .bp = 75,
267
267
  .type = .Electric,
268
- .accuracy = Gen12.percent(100),
268
+ .accuracy = percent(100),
269
269
  .target = .Other,
270
270
  },
271
271
  // Scratch
@@ -273,7 +273,7 @@ pub const Move = enum(u8) {
273
273
  .effect = .None,
274
274
  .bp = 40,
275
275
  .type = .Normal,
276
- .accuracy = Gen12.percent(100),
276
+ .accuracy = percent(100),
277
277
  .target = .Other,
278
278
  },
279
279
  // ViseGrip
@@ -281,7 +281,7 @@ pub const Move = enum(u8) {
281
281
  .effect = .None,
282
282
  .bp = 55,
283
283
  .type = .Normal,
284
- .accuracy = Gen12.percent(100),
284
+ .accuracy = percent(100),
285
285
  .target = .Other,
286
286
  },
287
287
  // Guillotine
@@ -289,7 +289,7 @@ pub const Move = enum(u8) {
289
289
  .effect = .OHKO,
290
290
  .bp = 0,
291
291
  .type = .Normal,
292
- .accuracy = Gen12.percent(30),
292
+ .accuracy = percent(30),
293
293
  .target = .Other,
294
294
  },
295
295
  // RazorWind
@@ -297,7 +297,7 @@ pub const Move = enum(u8) {
297
297
  .effect = .Charge,
298
298
  .bp = 80,
299
299
  .type = .Normal,
300
- .accuracy = Gen12.percent(75),
300
+ .accuracy = percent(75),
301
301
  .target = .Other,
302
302
  },
303
303
  // SwordsDance
@@ -305,7 +305,7 @@ pub const Move = enum(u8) {
305
305
  .effect = .AttackUp2,
306
306
  .bp = 0,
307
307
  .type = .Normal,
308
- .accuracy = Gen12.percent(100),
308
+ .accuracy = percent(100),
309
309
  .target = .Self,
310
310
  },
311
311
  // Cut
@@ -313,7 +313,7 @@ pub const Move = enum(u8) {
313
313
  .effect = .None,
314
314
  .bp = 50,
315
315
  .type = .Normal,
316
- .accuracy = Gen12.percent(95),
316
+ .accuracy = percent(95),
317
317
  .target = .Other,
318
318
  },
319
319
  // Gust
@@ -321,7 +321,7 @@ pub const Move = enum(u8) {
321
321
  .effect = .None,
322
322
  .bp = 40,
323
323
  .type = .Normal,
324
- .accuracy = Gen12.percent(100),
324
+ .accuracy = percent(100),
325
325
  .target = .Any,
326
326
  },
327
327
  // WingAttack
@@ -329,7 +329,7 @@ pub const Move = enum(u8) {
329
329
  .effect = .None,
330
330
  .bp = 35,
331
331
  .type = .Flying,
332
- .accuracy = Gen12.percent(100),
332
+ .accuracy = percent(100),
333
333
  .target = .Any,
334
334
  },
335
335
  // Whirlwind
@@ -337,7 +337,7 @@ pub const Move = enum(u8) {
337
337
  .effect = .SwitchAndTeleport,
338
338
  .bp = 0,
339
339
  .type = .Normal,
340
- .accuracy = Gen12.percent(85),
340
+ .accuracy = percent(85),
341
341
  .target = .Other,
342
342
  },
343
343
  // Fly
@@ -345,7 +345,7 @@ pub const Move = enum(u8) {
345
345
  .effect = .Charge,
346
346
  .bp = 70,
347
347
  .type = .Flying,
348
- .accuracy = Gen12.percent(95),
348
+ .accuracy = percent(95),
349
349
  .target = .Any,
350
350
  },
351
351
  // Bind
@@ -353,7 +353,7 @@ pub const Move = enum(u8) {
353
353
  .effect = .Binding,
354
354
  .bp = 15,
355
355
  .type = .Normal,
356
- .accuracy = Gen12.percent(75),
356
+ .accuracy = percent(75),
357
357
  .target = .Other,
358
358
  },
359
359
  // Slam
@@ -361,7 +361,7 @@ pub const Move = enum(u8) {
361
361
  .effect = .None,
362
362
  .bp = 80,
363
363
  .type = .Normal,
364
- .accuracy = Gen12.percent(75),
364
+ .accuracy = percent(75),
365
365
  .target = .Other,
366
366
  },
367
367
  // VineWhip
@@ -369,7 +369,7 @@ pub const Move = enum(u8) {
369
369
  .effect = .None,
370
370
  .bp = 35,
371
371
  .type = .Grass,
372
- .accuracy = Gen12.percent(100),
372
+ .accuracy = percent(100),
373
373
  .target = .Other,
374
374
  },
375
375
  // Stomp
@@ -377,7 +377,7 @@ pub const Move = enum(u8) {
377
377
  .effect = .FlinchChance2,
378
378
  .bp = 65,
379
379
  .type = .Normal,
380
- .accuracy = Gen12.percent(100),
380
+ .accuracy = percent(100),
381
381
  .target = .Other,
382
382
  },
383
383
  // DoubleKick
@@ -385,7 +385,7 @@ pub const Move = enum(u8) {
385
385
  .effect = .DoubleHit,
386
386
  .bp = 30,
387
387
  .type = .Fighting,
388
- .accuracy = Gen12.percent(100),
388
+ .accuracy = percent(100),
389
389
  .target = .Other,
390
390
  },
391
391
  // MegaKick
@@ -393,7 +393,7 @@ pub const Move = enum(u8) {
393
393
  .effect = .None,
394
394
  .bp = 120,
395
395
  .type = .Normal,
396
- .accuracy = Gen12.percent(75),
396
+ .accuracy = percent(75),
397
397
  .target = .Other,
398
398
  },
399
399
  // JumpKick
@@ -401,7 +401,7 @@ pub const Move = enum(u8) {
401
401
  .effect = .JumpKick,
402
402
  .bp = 70,
403
403
  .type = .Fighting,
404
- .accuracy = Gen12.percent(95),
404
+ .accuracy = percent(95),
405
405
  .target = .Other,
406
406
  },
407
407
  // RollingKick
@@ -409,7 +409,7 @@ pub const Move = enum(u8) {
409
409
  .effect = .FlinchChance2,
410
410
  .bp = 60,
411
411
  .type = .Fighting,
412
- .accuracy = Gen12.percent(85),
412
+ .accuracy = percent(85),
413
413
  .target = .Other,
414
414
  },
415
415
  // SandAttack
@@ -417,7 +417,7 @@ pub const Move = enum(u8) {
417
417
  .effect = .AccuracyDown1,
418
418
  .bp = 0,
419
419
  .type = .Normal,
420
- .accuracy = Gen12.percent(100),
420
+ .accuracy = percent(100),
421
421
  .target = .Other,
422
422
  },
423
423
  // Headbutt
@@ -425,7 +425,7 @@ pub const Move = enum(u8) {
425
425
  .effect = .FlinchChance2,
426
426
  .bp = 70,
427
427
  .type = .Normal,
428
- .accuracy = Gen12.percent(100),
428
+ .accuracy = percent(100),
429
429
  .target = .Other,
430
430
  },
431
431
  // HornAttack
@@ -433,7 +433,7 @@ pub const Move = enum(u8) {
433
433
  .effect = .None,
434
434
  .bp = 65,
435
435
  .type = .Normal,
436
- .accuracy = Gen12.percent(100),
436
+ .accuracy = percent(100),
437
437
  .target = .Other,
438
438
  },
439
439
  // FuryAttack
@@ -441,7 +441,7 @@ pub const Move = enum(u8) {
441
441
  .effect = .MultiHit,
442
442
  .bp = 15,
443
443
  .type = .Normal,
444
- .accuracy = Gen12.percent(85),
444
+ .accuracy = percent(85),
445
445
  .target = .Other,
446
446
  },
447
447
  // HornDrill
@@ -449,7 +449,7 @@ pub const Move = enum(u8) {
449
449
  .effect = .OHKO,
450
450
  .bp = 0,
451
451
  .type = .Normal,
452
- .accuracy = Gen12.percent(30),
452
+ .accuracy = percent(30),
453
453
  .target = .Other,
454
454
  },
455
455
  // Tackle
@@ -457,7 +457,7 @@ pub const Move = enum(u8) {
457
457
  .effect = .None,
458
458
  .bp = 35,
459
459
  .type = .Normal,
460
- .accuracy = Gen12.percent(95),
460
+ .accuracy = percent(95),
461
461
  .target = .Other,
462
462
  },
463
463
  // BodySlam
@@ -465,7 +465,7 @@ pub const Move = enum(u8) {
465
465
  .effect = .ParalyzeChance2,
466
466
  .bp = 85,
467
467
  .type = .Normal,
468
- .accuracy = Gen12.percent(100),
468
+ .accuracy = percent(100),
469
469
  .target = .Other,
470
470
  },
471
471
  // Wrap
@@ -473,7 +473,7 @@ pub const Move = enum(u8) {
473
473
  .effect = .Binding,
474
474
  .bp = 15,
475
475
  .type = .Normal,
476
- .accuracy = Gen12.percent(85),
476
+ .accuracy = percent(85),
477
477
  .target = .Other,
478
478
  },
479
479
  // TakeDown
@@ -481,7 +481,7 @@ pub const Move = enum(u8) {
481
481
  .effect = .Recoil,
482
482
  .bp = 90,
483
483
  .type = .Normal,
484
- .accuracy = Gen12.percent(85),
484
+ .accuracy = percent(85),
485
485
  .target = .Other,
486
486
  },
487
487
  // Thrash
@@ -489,7 +489,7 @@ pub const Move = enum(u8) {
489
489
  .effect = .Thrashing,
490
490
  .bp = 90,
491
491
  .type = .Normal,
492
- .accuracy = Gen12.percent(100),
492
+ .accuracy = percent(100),
493
493
  .target = .RandomFoe,
494
494
  },
495
495
  // DoubleEdge
@@ -497,7 +497,7 @@ pub const Move = enum(u8) {
497
497
  .effect = .Recoil,
498
498
  .bp = 100,
499
499
  .type = .Normal,
500
- .accuracy = Gen12.percent(100),
500
+ .accuracy = percent(100),
501
501
  .target = .Other,
502
502
  },
503
503
  // TailWhip
@@ -505,7 +505,7 @@ pub const Move = enum(u8) {
505
505
  .effect = .DefenseDown1,
506
506
  .bp = 0,
507
507
  .type = .Normal,
508
- .accuracy = Gen12.percent(100),
508
+ .accuracy = percent(100),
509
509
  .target = .Foes,
510
510
  },
511
511
  // PoisonSting
@@ -513,7 +513,7 @@ pub const Move = enum(u8) {
513
513
  .effect = .PoisonChance1,
514
514
  .bp = 15,
515
515
  .type = .Poison,
516
- .accuracy = Gen12.percent(100),
516
+ .accuracy = percent(100),
517
517
  .target = .Other,
518
518
  },
519
519
  // Twineedle
@@ -521,7 +521,7 @@ pub const Move = enum(u8) {
521
521
  .effect = .Twineedle,
522
522
  .bp = 25,
523
523
  .type = .Bug,
524
- .accuracy = Gen12.percent(100),
524
+ .accuracy = percent(100),
525
525
  .target = .Other,
526
526
  },
527
527
  // PinMissile
@@ -529,7 +529,7 @@ pub const Move = enum(u8) {
529
529
  .effect = .MultiHit,
530
530
  .bp = 14,
531
531
  .type = .Bug,
532
- .accuracy = Gen12.percent(85),
532
+ .accuracy = percent(85),
533
533
  .target = .Other,
534
534
  },
535
535
  // Leer
@@ -537,7 +537,7 @@ pub const Move = enum(u8) {
537
537
  .effect = .DefenseDown1,
538
538
  .bp = 0,
539
539
  .type = .Normal,
540
- .accuracy = Gen12.percent(100),
540
+ .accuracy = percent(100),
541
541
  .target = .Foes,
542
542
  },
543
543
  // Bite
@@ -545,7 +545,7 @@ pub const Move = enum(u8) {
545
545
  .effect = .FlinchChance1,
546
546
  .bp = 60,
547
547
  .type = .Normal,
548
- .accuracy = Gen12.percent(100),
548
+ .accuracy = percent(100),
549
549
  .target = .Other,
550
550
  },
551
551
  // Growl
@@ -553,7 +553,7 @@ pub const Move = enum(u8) {
553
553
  .effect = .AttackDown1,
554
554
  .bp = 0,
555
555
  .type = .Normal,
556
- .accuracy = Gen12.percent(100),
556
+ .accuracy = percent(100),
557
557
  .target = .Foes,
558
558
  },
559
559
  // Roar
@@ -561,7 +561,7 @@ pub const Move = enum(u8) {
561
561
  .effect = .SwitchAndTeleport,
562
562
  .bp = 0,
563
563
  .type = .Normal,
564
- .accuracy = Gen12.percent(100),
564
+ .accuracy = percent(100),
565
565
  .target = .Other,
566
566
  },
567
567
  // Sing
@@ -569,7 +569,7 @@ pub const Move = enum(u8) {
569
569
  .effect = .Sleep,
570
570
  .bp = 0,
571
571
  .type = .Normal,
572
- .accuracy = Gen12.percent(55),
572
+ .accuracy = percent(55),
573
573
  .target = .Other,
574
574
  },
575
575
  // Supersonic
@@ -577,7 +577,7 @@ pub const Move = enum(u8) {
577
577
  .effect = .Confusion,
578
578
  .bp = 0,
579
579
  .type = .Normal,
580
- .accuracy = Gen12.percent(55),
580
+ .accuracy = percent(55),
581
581
  .target = .Other,
582
582
  },
583
583
  // SonicBoom
@@ -585,7 +585,7 @@ pub const Move = enum(u8) {
585
585
  .effect = .SpecialDamage,
586
586
  .bp = 1,
587
587
  .type = .Normal,
588
- .accuracy = Gen12.percent(90),
588
+ .accuracy = percent(90),
589
589
  .target = .Other,
590
590
  },
591
591
  // Disable
@@ -593,7 +593,7 @@ pub const Move = enum(u8) {
593
593
  .effect = .Disable,
594
594
  .bp = 0,
595
595
  .type = .Normal,
596
- .accuracy = Gen12.percent(55),
596
+ .accuracy = percent(55),
597
597
  .target = .Other,
598
598
  },
599
599
  // Acid
@@ -601,7 +601,7 @@ pub const Move = enum(u8) {
601
601
  .effect = .DefenseDownChance,
602
602
  .bp = 40,
603
603
  .type = .Poison,
604
- .accuracy = Gen12.percent(100),
604
+ .accuracy = percent(100),
605
605
  .target = .Other,
606
606
  },
607
607
  // Ember
@@ -609,7 +609,7 @@ pub const Move = enum(u8) {
609
609
  .effect = .BurnChance1,
610
610
  .bp = 40,
611
611
  .type = .Fire,
612
- .accuracy = Gen12.percent(100),
612
+ .accuracy = percent(100),
613
613
  .target = .Other,
614
614
  },
615
615
  // Flamethrower
@@ -617,7 +617,7 @@ pub const Move = enum(u8) {
617
617
  .effect = .BurnChance1,
618
618
  .bp = 95,
619
619
  .type = .Fire,
620
- .accuracy = Gen12.percent(100),
620
+ .accuracy = percent(100),
621
621
  .target = .Other,
622
622
  },
623
623
  // Mist
@@ -625,7 +625,7 @@ pub const Move = enum(u8) {
625
625
  .effect = .Mist,
626
626
  .bp = 0,
627
627
  .type = .Ice,
628
- .accuracy = Gen12.percent(100),
628
+ .accuracy = percent(100),
629
629
  .target = .Self,
630
630
  },
631
631
  // WaterGun
@@ -633,7 +633,7 @@ pub const Move = enum(u8) {
633
633
  .effect = .None,
634
634
  .bp = 40,
635
635
  .type = .Water,
636
- .accuracy = Gen12.percent(100),
636
+ .accuracy = percent(100),
637
637
  .target = .Other,
638
638
  },
639
639
  // HydroPump
@@ -641,7 +641,7 @@ pub const Move = enum(u8) {
641
641
  .effect = .None,
642
642
  .bp = 120,
643
643
  .type = .Water,
644
- .accuracy = Gen12.percent(80),
644
+ .accuracy = percent(80),
645
645
  .target = .Other,
646
646
  },
647
647
  // Surf
@@ -649,7 +649,7 @@ pub const Move = enum(u8) {
649
649
  .effect = .None,
650
650
  .bp = 95,
651
651
  .type = .Water,
652
- .accuracy = Gen12.percent(100),
652
+ .accuracy = percent(100),
653
653
  .target = .Foes,
654
654
  },
655
655
  // IceBeam
@@ -657,7 +657,7 @@ pub const Move = enum(u8) {
657
657
  .effect = .FreezeChance,
658
658
  .bp = 95,
659
659
  .type = .Ice,
660
- .accuracy = Gen12.percent(100),
660
+ .accuracy = percent(100),
661
661
  .target = .Other,
662
662
  },
663
663
  // Blizzard
@@ -665,7 +665,7 @@ pub const Move = enum(u8) {
665
665
  .effect = .FreezeChance,
666
666
  .bp = 120,
667
667
  .type = .Ice,
668
- .accuracy = Gen12.percent(90),
668
+ .accuracy = percent(90),
669
669
  .target = .Other,
670
670
  },
671
671
  // Psybeam
@@ -673,7 +673,7 @@ pub const Move = enum(u8) {
673
673
  .effect = .ConfusionChance,
674
674
  .bp = 65,
675
675
  .type = .Psychic,
676
- .accuracy = Gen12.percent(100),
676
+ .accuracy = percent(100),
677
677
  .target = .Other,
678
678
  },
679
679
  // BubbleBeam
@@ -681,7 +681,7 @@ pub const Move = enum(u8) {
681
681
  .effect = .SpeedDownChance,
682
682
  .bp = 65,
683
683
  .type = .Water,
684
- .accuracy = Gen12.percent(100),
684
+ .accuracy = percent(100),
685
685
  .target = .Other,
686
686
  },
687
687
  // AuroraBeam
@@ -689,7 +689,7 @@ pub const Move = enum(u8) {
689
689
  .effect = .AttackDownChance,
690
690
  .bp = 65,
691
691
  .type = .Ice,
692
- .accuracy = Gen12.percent(100),
692
+ .accuracy = percent(100),
693
693
  .target = .Other,
694
694
  },
695
695
  // HyperBeam
@@ -697,7 +697,7 @@ pub const Move = enum(u8) {
697
697
  .effect = .HyperBeam,
698
698
  .bp = 150,
699
699
  .type = .Normal,
700
- .accuracy = Gen12.percent(90),
700
+ .accuracy = percent(90),
701
701
  .target = .Other,
702
702
  },
703
703
  // Peck
@@ -705,7 +705,7 @@ pub const Move = enum(u8) {
705
705
  .effect = .None,
706
706
  .bp = 35,
707
707
  .type = .Flying,
708
- .accuracy = Gen12.percent(100),
708
+ .accuracy = percent(100),
709
709
  .target = .Any,
710
710
  },
711
711
  // DrillPeck
@@ -713,7 +713,7 @@ pub const Move = enum(u8) {
713
713
  .effect = .None,
714
714
  .bp = 80,
715
715
  .type = .Flying,
716
- .accuracy = Gen12.percent(100),
716
+ .accuracy = percent(100),
717
717
  .target = .Any,
718
718
  },
719
719
  // Submission
@@ -721,7 +721,7 @@ pub const Move = enum(u8) {
721
721
  .effect = .Recoil,
722
722
  .bp = 80,
723
723
  .type = .Fighting,
724
- .accuracy = Gen12.percent(80),
724
+ .accuracy = percent(80),
725
725
  .target = .Other,
726
726
  },
727
727
  // LowKick
@@ -729,7 +729,7 @@ pub const Move = enum(u8) {
729
729
  .effect = .FlinchChance2,
730
730
  .bp = 50,
731
731
  .type = .Fighting,
732
- .accuracy = Gen12.percent(90),
732
+ .accuracy = percent(90),
733
733
  .target = .Other,
734
734
  },
735
735
  // Counter
@@ -737,7 +737,7 @@ pub const Move = enum(u8) {
737
737
  .effect = .None,
738
738
  .bp = 1,
739
739
  .type = .Fighting,
740
- .accuracy = Gen12.percent(100),
740
+ .accuracy = percent(100),
741
741
  .target = .Depends,
742
742
  },
743
743
  // SeismicToss
@@ -745,7 +745,7 @@ pub const Move = enum(u8) {
745
745
  .effect = .SpecialDamage,
746
746
  .bp = 1,
747
747
  .type = .Fighting,
748
- .accuracy = Gen12.percent(100),
748
+ .accuracy = percent(100),
749
749
  .target = .Other,
750
750
  },
751
751
  // Strength
@@ -753,7 +753,7 @@ pub const Move = enum(u8) {
753
753
  .effect = .None,
754
754
  .bp = 80,
755
755
  .type = .Normal,
756
- .accuracy = Gen12.percent(100),
756
+ .accuracy = percent(100),
757
757
  .target = .Other,
758
758
  },
759
759
  // Absorb
@@ -761,7 +761,7 @@ pub const Move = enum(u8) {
761
761
  .effect = .DrainHP,
762
762
  .bp = 20,
763
763
  .type = .Grass,
764
- .accuracy = Gen12.percent(100),
764
+ .accuracy = percent(100),
765
765
  .target = .Other,
766
766
  },
767
767
  // MegaDrain
@@ -769,7 +769,7 @@ pub const Move = enum(u8) {
769
769
  .effect = .DrainHP,
770
770
  .bp = 40,
771
771
  .type = .Grass,
772
- .accuracy = Gen12.percent(100),
772
+ .accuracy = percent(100),
773
773
  .target = .Other,
774
774
  },
775
775
  // LeechSeed
@@ -777,7 +777,7 @@ pub const Move = enum(u8) {
777
777
  .effect = .LeechSeed,
778
778
  .bp = 0,
779
779
  .type = .Grass,
780
- .accuracy = Gen12.percent(90),
780
+ .accuracy = percent(90),
781
781
  .target = .Other,
782
782
  },
783
783
  // Growth
@@ -785,7 +785,7 @@ pub const Move = enum(u8) {
785
785
  .effect = .SpecialUp1,
786
786
  .bp = 0,
787
787
  .type = .Normal,
788
- .accuracy = Gen12.percent(100),
788
+ .accuracy = percent(100),
789
789
  .target = .Self,
790
790
  },
791
791
  // RazorLeaf
@@ -793,7 +793,7 @@ pub const Move = enum(u8) {
793
793
  .effect = .HighCritical,
794
794
  .bp = 55,
795
795
  .type = .Grass,
796
- .accuracy = Gen12.percent(95),
796
+ .accuracy = percent(95),
797
797
  .target = .Other,
798
798
  },
799
799
  // SolarBeam
@@ -801,7 +801,7 @@ pub const Move = enum(u8) {
801
801
  .effect = .Charge,
802
802
  .bp = 120,
803
803
  .type = .Grass,
804
- .accuracy = Gen12.percent(100),
804
+ .accuracy = percent(100),
805
805
  .target = .Other,
806
806
  },
807
807
  // PoisonPowder
@@ -809,7 +809,7 @@ pub const Move = enum(u8) {
809
809
  .effect = .Poison,
810
810
  .bp = 0,
811
811
  .type = .Poison,
812
- .accuracy = Gen12.percent(75),
812
+ .accuracy = percent(75),
813
813
  .target = .Other,
814
814
  },
815
815
  // StunSpore
@@ -817,7 +817,7 @@ pub const Move = enum(u8) {
817
817
  .effect = .Paralyze,
818
818
  .bp = 0,
819
819
  .type = .Grass,
820
- .accuracy = Gen12.percent(75),
820
+ .accuracy = percent(75),
821
821
  .target = .Other,
822
822
  },
823
823
  // SleepPowder
@@ -825,7 +825,7 @@ pub const Move = enum(u8) {
825
825
  .effect = .Sleep,
826
826
  .bp = 0,
827
827
  .type = .Grass,
828
- .accuracy = Gen12.percent(75),
828
+ .accuracy = percent(75),
829
829
  .target = .Other,
830
830
  },
831
831
  // PetalDance
@@ -833,7 +833,7 @@ pub const Move = enum(u8) {
833
833
  .effect = .Thrashing,
834
834
  .bp = 70,
835
835
  .type = .Grass,
836
- .accuracy = Gen12.percent(100),
836
+ .accuracy = percent(100),
837
837
  .target = .RandomFoe,
838
838
  },
839
839
  // StringShot
@@ -841,7 +841,7 @@ pub const Move = enum(u8) {
841
841
  .effect = .SpeedDown1,
842
842
  .bp = 0,
843
843
  .type = .Bug,
844
- .accuracy = Gen12.percent(95),
844
+ .accuracy = percent(95),
845
845
  .target = .Foes,
846
846
  },
847
847
  // DragonRage
@@ -849,7 +849,7 @@ pub const Move = enum(u8) {
849
849
  .effect = .SpecialDamage,
850
850
  .bp = 1,
851
851
  .type = .Dragon,
852
- .accuracy = Gen12.percent(100),
852
+ .accuracy = percent(100),
853
853
  .target = .Other,
854
854
  },
855
855
  // FireSpin
@@ -857,7 +857,7 @@ pub const Move = enum(u8) {
857
857
  .effect = .Binding,
858
858
  .bp = 15,
859
859
  .type = .Fire,
860
- .accuracy = Gen12.percent(70),
860
+ .accuracy = percent(70),
861
861
  .target = .Other,
862
862
  },
863
863
  // ThunderShock
@@ -865,7 +865,7 @@ pub const Move = enum(u8) {
865
865
  .effect = .ParalyzeChance1,
866
866
  .bp = 40,
867
867
  .type = .Electric,
868
- .accuracy = Gen12.percent(100),
868
+ .accuracy = percent(100),
869
869
  .target = .Other,
870
870
  },
871
871
  // Thunderbolt
@@ -873,7 +873,7 @@ pub const Move = enum(u8) {
873
873
  .effect = .ParalyzeChance1,
874
874
  .bp = 95,
875
875
  .type = .Electric,
876
- .accuracy = Gen12.percent(100),
876
+ .accuracy = percent(100),
877
877
  .target = .Other,
878
878
  },
879
879
  // ThunderWave
@@ -881,7 +881,7 @@ pub const Move = enum(u8) {
881
881
  .effect = .Paralyze,
882
882
  .bp = 0,
883
883
  .type = .Electric,
884
- .accuracy = Gen12.percent(100),
884
+ .accuracy = percent(100),
885
885
  .target = .Other,
886
886
  },
887
887
  // Thunder
@@ -889,7 +889,7 @@ pub const Move = enum(u8) {
889
889
  .effect = .ParalyzeChance1,
890
890
  .bp = 120,
891
891
  .type = .Electric,
892
- .accuracy = Gen12.percent(70),
892
+ .accuracy = percent(70),
893
893
  .target = .Other,
894
894
  },
895
895
  // RockThrow
@@ -897,7 +897,7 @@ pub const Move = enum(u8) {
897
897
  .effect = .None,
898
898
  .bp = 50,
899
899
  .type = .Rock,
900
- .accuracy = Gen12.percent(65),
900
+ .accuracy = percent(65),
901
901
  .target = .Other,
902
902
  },
903
903
  // Earthquake
@@ -905,7 +905,7 @@ pub const Move = enum(u8) {
905
905
  .effect = .None,
906
906
  .bp = 100,
907
907
  .type = .Ground,
908
- .accuracy = Gen12.percent(100),
908
+ .accuracy = percent(100),
909
909
  .target = .AllOthers,
910
910
  },
911
911
  // Fissure
@@ -913,7 +913,7 @@ pub const Move = enum(u8) {
913
913
  .effect = .OHKO,
914
914
  .bp = 0,
915
915
  .type = .Ground,
916
- .accuracy = Gen12.percent(30),
916
+ .accuracy = percent(30),
917
917
  .target = .Other,
918
918
  },
919
919
  // Dig
@@ -921,7 +921,7 @@ pub const Move = enum(u8) {
921
921
  .effect = .Charge,
922
922
  .bp = 100,
923
923
  .type = .Ground,
924
- .accuracy = Gen12.percent(100),
924
+ .accuracy = percent(100),
925
925
  .target = .Other,
926
926
  },
927
927
  // Toxic
@@ -929,7 +929,7 @@ pub const Move = enum(u8) {
929
929
  .effect = .Poison,
930
930
  .bp = 0,
931
931
  .type = .Poison,
932
- .accuracy = Gen12.percent(85),
932
+ .accuracy = percent(85),
933
933
  .target = .Other,
934
934
  },
935
935
  // Confusion
@@ -937,7 +937,7 @@ pub const Move = enum(u8) {
937
937
  .effect = .ConfusionChance,
938
938
  .bp = 50,
939
939
  .type = .Psychic,
940
- .accuracy = Gen12.percent(100),
940
+ .accuracy = percent(100),
941
941
  .target = .Other,
942
942
  },
943
943
  // Psychic
@@ -945,7 +945,7 @@ pub const Move = enum(u8) {
945
945
  .effect = .SpecialDownChance,
946
946
  .bp = 90,
947
947
  .type = .Psychic,
948
- .accuracy = Gen12.percent(100),
948
+ .accuracy = percent(100),
949
949
  .target = .Other,
950
950
  },
951
951
  // Hypnosis
@@ -953,7 +953,7 @@ pub const Move = enum(u8) {
953
953
  .effect = .Sleep,
954
954
  .bp = 0,
955
955
  .type = .Psychic,
956
- .accuracy = Gen12.percent(60),
956
+ .accuracy = percent(60),
957
957
  .target = .Other,
958
958
  },
959
959
  // Meditate
@@ -961,7 +961,7 @@ pub const Move = enum(u8) {
961
961
  .effect = .AttackUp1,
962
962
  .bp = 0,
963
963
  .type = .Psychic,
964
- .accuracy = Gen12.percent(100),
964
+ .accuracy = percent(100),
965
965
  .target = .Self,
966
966
  },
967
967
  // Agility
@@ -969,7 +969,7 @@ pub const Move = enum(u8) {
969
969
  .effect = .SpeedUp2,
970
970
  .bp = 0,
971
971
  .type = .Psychic,
972
- .accuracy = Gen12.percent(100),
972
+ .accuracy = percent(100),
973
973
  .target = .Self,
974
974
  },
975
975
  // QuickAttack
@@ -977,7 +977,7 @@ pub const Move = enum(u8) {
977
977
  .effect = .None,
978
978
  .bp = 40,
979
979
  .type = .Normal,
980
- .accuracy = Gen12.percent(100),
980
+ .accuracy = percent(100),
981
981
  .target = .Other,
982
982
  },
983
983
  // Rage
@@ -985,7 +985,7 @@ pub const Move = enum(u8) {
985
985
  .effect = .Rage,
986
986
  .bp = 20,
987
987
  .type = .Normal,
988
- .accuracy = Gen12.percent(100),
988
+ .accuracy = percent(100),
989
989
  .target = .Other,
990
990
  },
991
991
  // Teleport
@@ -993,7 +993,7 @@ pub const Move = enum(u8) {
993
993
  .effect = .SwitchAndTeleport,
994
994
  .bp = 0,
995
995
  .type = .Psychic,
996
- .accuracy = Gen12.percent(100),
996
+ .accuracy = percent(100),
997
997
  .target = .Self,
998
998
  },
999
999
  // NightShade
@@ -1001,7 +1001,7 @@ pub const Move = enum(u8) {
1001
1001
  .effect = .SpecialDamage,
1002
1002
  .bp = 1,
1003
1003
  .type = .Ghost,
1004
- .accuracy = Gen12.percent(100),
1004
+ .accuracy = percent(100),
1005
1005
  .target = .Other,
1006
1006
  },
1007
1007
  // Mimic
@@ -1009,7 +1009,7 @@ pub const Move = enum(u8) {
1009
1009
  .effect = .Mimic,
1010
1010
  .bp = 0,
1011
1011
  .type = .Normal,
1012
- .accuracy = Gen12.percent(100),
1012
+ .accuracy = percent(100),
1013
1013
  .target = .Other,
1014
1014
  },
1015
1015
  // Screech
@@ -1017,7 +1017,7 @@ pub const Move = enum(u8) {
1017
1017
  .effect = .DefenseDown2,
1018
1018
  .bp = 0,
1019
1019
  .type = .Normal,
1020
- .accuracy = Gen12.percent(85),
1020
+ .accuracy = percent(85),
1021
1021
  .target = .Other,
1022
1022
  },
1023
1023
  // DoubleTeam
@@ -1025,7 +1025,7 @@ pub const Move = enum(u8) {
1025
1025
  .effect = .EvasionUp1,
1026
1026
  .bp = 0,
1027
1027
  .type = .Normal,
1028
- .accuracy = Gen12.percent(100),
1028
+ .accuracy = percent(100),
1029
1029
  .target = .Self,
1030
1030
  },
1031
1031
  // Recover
@@ -1033,7 +1033,7 @@ pub const Move = enum(u8) {
1033
1033
  .effect = .Heal,
1034
1034
  .bp = 0,
1035
1035
  .type = .Normal,
1036
- .accuracy = Gen12.percent(100),
1036
+ .accuracy = percent(100),
1037
1037
  .target = .Self,
1038
1038
  },
1039
1039
  // Harden
@@ -1041,7 +1041,7 @@ pub const Move = enum(u8) {
1041
1041
  .effect = .DefenseUp1,
1042
1042
  .bp = 0,
1043
1043
  .type = .Normal,
1044
- .accuracy = Gen12.percent(100),
1044
+ .accuracy = percent(100),
1045
1045
  .target = .Self,
1046
1046
  },
1047
1047
  // Minimize
@@ -1049,7 +1049,7 @@ pub const Move = enum(u8) {
1049
1049
  .effect = .EvasionUp1,
1050
1050
  .bp = 0,
1051
1051
  .type = .Normal,
1052
- .accuracy = Gen12.percent(100),
1052
+ .accuracy = percent(100),
1053
1053
  .target = .Self,
1054
1054
  },
1055
1055
  // Smokescreen
@@ -1057,7 +1057,7 @@ pub const Move = enum(u8) {
1057
1057
  .effect = .AccuracyDown1,
1058
1058
  .bp = 0,
1059
1059
  .type = .Normal,
1060
- .accuracy = Gen12.percent(100),
1060
+ .accuracy = percent(100),
1061
1061
  .target = .Other,
1062
1062
  },
1063
1063
  // ConfuseRay
@@ -1065,7 +1065,7 @@ pub const Move = enum(u8) {
1065
1065
  .effect = .Confusion,
1066
1066
  .bp = 0,
1067
1067
  .type = .Ghost,
1068
- .accuracy = Gen12.percent(100),
1068
+ .accuracy = percent(100),
1069
1069
  .target = .Other,
1070
1070
  },
1071
1071
  // Withdraw
@@ -1073,7 +1073,7 @@ pub const Move = enum(u8) {
1073
1073
  .effect = .DefenseUp1,
1074
1074
  .bp = 0,
1075
1075
  .type = .Water,
1076
- .accuracy = Gen12.percent(100),
1076
+ .accuracy = percent(100),
1077
1077
  .target = .Self,
1078
1078
  },
1079
1079
  // DefenseCurl
@@ -1081,7 +1081,7 @@ pub const Move = enum(u8) {
1081
1081
  .effect = .DefenseUp1,
1082
1082
  .bp = 0,
1083
1083
  .type = .Normal,
1084
- .accuracy = Gen12.percent(100),
1084
+ .accuracy = percent(100),
1085
1085
  .target = .Self,
1086
1086
  },
1087
1087
  // Barrier
@@ -1089,7 +1089,7 @@ pub const Move = enum(u8) {
1089
1089
  .effect = .DefenseUp2,
1090
1090
  .bp = 0,
1091
1091
  .type = .Psychic,
1092
- .accuracy = Gen12.percent(100),
1092
+ .accuracy = percent(100),
1093
1093
  .target = .Self,
1094
1094
  },
1095
1095
  // LightScreen
@@ -1097,7 +1097,7 @@ pub const Move = enum(u8) {
1097
1097
  .effect = .LightScreen,
1098
1098
  .bp = 0,
1099
1099
  .type = .Psychic,
1100
- .accuracy = Gen12.percent(100),
1100
+ .accuracy = percent(100),
1101
1101
  .target = .Self,
1102
1102
  },
1103
1103
  // Haze
@@ -1105,7 +1105,7 @@ pub const Move = enum(u8) {
1105
1105
  .effect = .Haze,
1106
1106
  .bp = 0,
1107
1107
  .type = .Ice,
1108
- .accuracy = Gen12.percent(100),
1108
+ .accuracy = percent(100),
1109
1109
  .target = .Self,
1110
1110
  },
1111
1111
  // Reflect
@@ -1113,7 +1113,7 @@ pub const Move = enum(u8) {
1113
1113
  .effect = .Reflect,
1114
1114
  .bp = 0,
1115
1115
  .type = .Psychic,
1116
- .accuracy = Gen12.percent(100),
1116
+ .accuracy = percent(100),
1117
1117
  .target = .Self,
1118
1118
  },
1119
1119
  // FocusEnergy
@@ -1121,7 +1121,7 @@ pub const Move = enum(u8) {
1121
1121
  .effect = .FocusEnergy,
1122
1122
  .bp = 0,
1123
1123
  .type = .Normal,
1124
- .accuracy = Gen12.percent(100),
1124
+ .accuracy = percent(100),
1125
1125
  .target = .Self,
1126
1126
  },
1127
1127
  // Bide
@@ -1129,7 +1129,7 @@ pub const Move = enum(u8) {
1129
1129
  .effect = .Bide,
1130
1130
  .bp = 0,
1131
1131
  .type = .Normal,
1132
- .accuracy = Gen12.percent(100),
1132
+ .accuracy = percent(100),
1133
1133
  .target = .Self,
1134
1134
  },
1135
1135
  // Metronome
@@ -1137,7 +1137,7 @@ pub const Move = enum(u8) {
1137
1137
  .effect = .Metronome,
1138
1138
  .bp = 0,
1139
1139
  .type = .Normal,
1140
- .accuracy = Gen12.percent(100),
1140
+ .accuracy = percent(100),
1141
1141
  .target = .Self,
1142
1142
  },
1143
1143
  // MirrorMove
@@ -1145,7 +1145,7 @@ pub const Move = enum(u8) {
1145
1145
  .effect = .MirrorMove,
1146
1146
  .bp = 0,
1147
1147
  .type = .Flying,
1148
- .accuracy = Gen12.percent(100),
1148
+ .accuracy = percent(100),
1149
1149
  .target = .Self,
1150
1150
  },
1151
1151
  // SelfDestruct
@@ -1153,7 +1153,7 @@ pub const Move = enum(u8) {
1153
1153
  .effect = .Explode,
1154
1154
  .bp = 130,
1155
1155
  .type = .Normal,
1156
- .accuracy = Gen12.percent(100),
1156
+ .accuracy = percent(100),
1157
1157
  .target = .Other,
1158
1158
  },
1159
1159
  // EggBomb
@@ -1161,7 +1161,7 @@ pub const Move = enum(u8) {
1161
1161
  .effect = .None,
1162
1162
  .bp = 100,
1163
1163
  .type = .Normal,
1164
- .accuracy = Gen12.percent(75),
1164
+ .accuracy = percent(75),
1165
1165
  .target = .Other,
1166
1166
  },
1167
1167
  // Lick
@@ -1169,7 +1169,7 @@ pub const Move = enum(u8) {
1169
1169
  .effect = .ParalyzeChance2,
1170
1170
  .bp = 20,
1171
1171
  .type = .Ghost,
1172
- .accuracy = Gen12.percent(100),
1172
+ .accuracy = percent(100),
1173
1173
  .target = .Other,
1174
1174
  },
1175
1175
  // Smog
@@ -1177,7 +1177,7 @@ pub const Move = enum(u8) {
1177
1177
  .effect = .PoisonChance2,
1178
1178
  .bp = 20,
1179
1179
  .type = .Poison,
1180
- .accuracy = Gen12.percent(70),
1180
+ .accuracy = percent(70),
1181
1181
  .target = .Other,
1182
1182
  },
1183
1183
  // Sludge
@@ -1185,7 +1185,7 @@ pub const Move = enum(u8) {
1185
1185
  .effect = .PoisonChance2,
1186
1186
  .bp = 65,
1187
1187
  .type = .Poison,
1188
- .accuracy = Gen12.percent(100),
1188
+ .accuracy = percent(100),
1189
1189
  .target = .Other,
1190
1190
  },
1191
1191
  // BoneClub
@@ -1193,7 +1193,7 @@ pub const Move = enum(u8) {
1193
1193
  .effect = .FlinchChance1,
1194
1194
  .bp = 65,
1195
1195
  .type = .Ground,
1196
- .accuracy = Gen12.percent(85),
1196
+ .accuracy = percent(85),
1197
1197
  .target = .Other,
1198
1198
  },
1199
1199
  // FireBlast
@@ -1201,7 +1201,7 @@ pub const Move = enum(u8) {
1201
1201
  .effect = .BurnChance2,
1202
1202
  .bp = 120,
1203
1203
  .type = .Fire,
1204
- .accuracy = Gen12.percent(85),
1204
+ .accuracy = percent(85),
1205
1205
  .target = .Other,
1206
1206
  },
1207
1207
  // Waterfall
@@ -1209,7 +1209,7 @@ pub const Move = enum(u8) {
1209
1209
  .effect = .None,
1210
1210
  .bp = 80,
1211
1211
  .type = .Water,
1212
- .accuracy = Gen12.percent(100),
1212
+ .accuracy = percent(100),
1213
1213
  .target = .Other,
1214
1214
  },
1215
1215
  // Clamp
@@ -1217,7 +1217,7 @@ pub const Move = enum(u8) {
1217
1217
  .effect = .Binding,
1218
1218
  .bp = 35,
1219
1219
  .type = .Water,
1220
- .accuracy = Gen12.percent(75),
1220
+ .accuracy = percent(75),
1221
1221
  .target = .Other,
1222
1222
  },
1223
1223
  // Swift
@@ -1225,7 +1225,7 @@ pub const Move = enum(u8) {
1225
1225
  .effect = .Swift,
1226
1226
  .bp = 60,
1227
1227
  .type = .Normal,
1228
- .accuracy = Gen12.percent(100),
1228
+ .accuracy = percent(100),
1229
1229
  .target = .Foes,
1230
1230
  },
1231
1231
  // SkullBash
@@ -1233,7 +1233,7 @@ pub const Move = enum(u8) {
1233
1233
  .effect = .Charge,
1234
1234
  .bp = 100,
1235
1235
  .type = .Normal,
1236
- .accuracy = Gen12.percent(100),
1236
+ .accuracy = percent(100),
1237
1237
  .target = .Other,
1238
1238
  },
1239
1239
  // SpikeCannon
@@ -1241,7 +1241,7 @@ pub const Move = enum(u8) {
1241
1241
  .effect = .MultiHit,
1242
1242
  .bp = 20,
1243
1243
  .type = .Normal,
1244
- .accuracy = Gen12.percent(100),
1244
+ .accuracy = percent(100),
1245
1245
  .target = .Other,
1246
1246
  },
1247
1247
  // Constrict
@@ -1249,7 +1249,7 @@ pub const Move = enum(u8) {
1249
1249
  .effect = .SpeedDownChance,
1250
1250
  .bp = 10,
1251
1251
  .type = .Normal,
1252
- .accuracy = Gen12.percent(100),
1252
+ .accuracy = percent(100),
1253
1253
  .target = .Other,
1254
1254
  },
1255
1255
  // Amnesia
@@ -1257,7 +1257,7 @@ pub const Move = enum(u8) {
1257
1257
  .effect = .SpecialUp2,
1258
1258
  .bp = 0,
1259
1259
  .type = .Psychic,
1260
- .accuracy = Gen12.percent(100),
1260
+ .accuracy = percent(100),
1261
1261
  .target = .Self,
1262
1262
  },
1263
1263
  // Kinesis
@@ -1265,7 +1265,7 @@ pub const Move = enum(u8) {
1265
1265
  .effect = .AccuracyDown1,
1266
1266
  .bp = 0,
1267
1267
  .type = .Psychic,
1268
- .accuracy = Gen12.percent(80),
1268
+ .accuracy = percent(80),
1269
1269
  .target = .Other,
1270
1270
  },
1271
1271
  // SoftBoiled
@@ -1273,7 +1273,7 @@ pub const Move = enum(u8) {
1273
1273
  .effect = .Heal,
1274
1274
  .bp = 0,
1275
1275
  .type = .Normal,
1276
- .accuracy = Gen12.percent(100),
1276
+ .accuracy = percent(100),
1277
1277
  .target = .Self,
1278
1278
  },
1279
1279
  // HighJumpKick
@@ -1281,7 +1281,7 @@ pub const Move = enum(u8) {
1281
1281
  .effect = .JumpKick,
1282
1282
  .bp = 85,
1283
1283
  .type = .Fighting,
1284
- .accuracy = Gen12.percent(90),
1284
+ .accuracy = percent(90),
1285
1285
  .target = .Other,
1286
1286
  },
1287
1287
  // Glare
@@ -1289,7 +1289,7 @@ pub const Move = enum(u8) {
1289
1289
  .effect = .Paralyze,
1290
1290
  .bp = 0,
1291
1291
  .type = .Normal,
1292
- .accuracy = Gen12.percent(75),
1292
+ .accuracy = percent(75),
1293
1293
  .target = .Other,
1294
1294
  },
1295
1295
  // DreamEater
@@ -1297,7 +1297,7 @@ pub const Move = enum(u8) {
1297
1297
  .effect = .DreamEater,
1298
1298
  .bp = 100,
1299
1299
  .type = .Psychic,
1300
- .accuracy = Gen12.percent(100),
1300
+ .accuracy = percent(100),
1301
1301
  .target = .Other,
1302
1302
  },
1303
1303
  // PoisonGas
@@ -1305,7 +1305,7 @@ pub const Move = enum(u8) {
1305
1305
  .effect = .Poison,
1306
1306
  .bp = 0,
1307
1307
  .type = .Poison,
1308
- .accuracy = Gen12.percent(55),
1308
+ .accuracy = percent(55),
1309
1309
  .target = .Other,
1310
1310
  },
1311
1311
  // Barrage
@@ -1313,7 +1313,7 @@ pub const Move = enum(u8) {
1313
1313
  .effect = .MultiHit,
1314
1314
  .bp = 15,
1315
1315
  .type = .Normal,
1316
- .accuracy = Gen12.percent(85),
1316
+ .accuracy = percent(85),
1317
1317
  .target = .Other,
1318
1318
  },
1319
1319
  // LeechLife
@@ -1321,7 +1321,7 @@ pub const Move = enum(u8) {
1321
1321
  .effect = .DrainHP,
1322
1322
  .bp = 20,
1323
1323
  .type = .Bug,
1324
- .accuracy = Gen12.percent(100),
1324
+ .accuracy = percent(100),
1325
1325
  .target = .Other,
1326
1326
  },
1327
1327
  // LovelyKiss
@@ -1329,7 +1329,7 @@ pub const Move = enum(u8) {
1329
1329
  .effect = .Sleep,
1330
1330
  .bp = 0,
1331
1331
  .type = .Normal,
1332
- .accuracy = Gen12.percent(75),
1332
+ .accuracy = percent(75),
1333
1333
  .target = .Other,
1334
1334
  },
1335
1335
  // SkyAttack
@@ -1337,7 +1337,7 @@ pub const Move = enum(u8) {
1337
1337
  .effect = .Charge,
1338
1338
  .bp = 140,
1339
1339
  .type = .Flying,
1340
- .accuracy = Gen12.percent(90),
1340
+ .accuracy = percent(90),
1341
1341
  .target = .Any,
1342
1342
  },
1343
1343
  // Transform
@@ -1345,7 +1345,7 @@ pub const Move = enum(u8) {
1345
1345
  .effect = .Transform,
1346
1346
  .bp = 0,
1347
1347
  .type = .Normal,
1348
- .accuracy = Gen12.percent(100),
1348
+ .accuracy = percent(100),
1349
1349
  .target = .Other,
1350
1350
  },
1351
1351
  // Bubble
@@ -1353,7 +1353,7 @@ pub const Move = enum(u8) {
1353
1353
  .effect = .SpeedDownChance,
1354
1354
  .bp = 20,
1355
1355
  .type = .Water,
1356
- .accuracy = Gen12.percent(100),
1356
+ .accuracy = percent(100),
1357
1357
  .target = .Other,
1358
1358
  },
1359
1359
  // DizzyPunch
@@ -1361,7 +1361,7 @@ pub const Move = enum(u8) {
1361
1361
  .effect = .None,
1362
1362
  .bp = 70,
1363
1363
  .type = .Normal,
1364
- .accuracy = Gen12.percent(100),
1364
+ .accuracy = percent(100),
1365
1365
  .target = .Other,
1366
1366
  },
1367
1367
  // Spore
@@ -1369,7 +1369,7 @@ pub const Move = enum(u8) {
1369
1369
  .effect = .Sleep,
1370
1370
  .bp = 0,
1371
1371
  .type = .Grass,
1372
- .accuracy = Gen12.percent(100),
1372
+ .accuracy = percent(100),
1373
1373
  .target = .Other,
1374
1374
  },
1375
1375
  // Flash
@@ -1377,7 +1377,7 @@ pub const Move = enum(u8) {
1377
1377
  .effect = .AccuracyDown1,
1378
1378
  .bp = 0,
1379
1379
  .type = .Normal,
1380
- .accuracy = Gen12.percent(70),
1380
+ .accuracy = percent(70),
1381
1381
  .target = .Other,
1382
1382
  },
1383
1383
  // Psywave
@@ -1385,7 +1385,7 @@ pub const Move = enum(u8) {
1385
1385
  .effect = .SpecialDamage,
1386
1386
  .bp = 1,
1387
1387
  .type = .Psychic,
1388
- .accuracy = Gen12.percent(80),
1388
+ .accuracy = percent(80),
1389
1389
  .target = .Other,
1390
1390
  },
1391
1391
  // Splash
@@ -1393,7 +1393,7 @@ pub const Move = enum(u8) {
1393
1393
  .effect = .Splash,
1394
1394
  .bp = 0,
1395
1395
  .type = .Normal,
1396
- .accuracy = Gen12.percent(100),
1396
+ .accuracy = percent(100),
1397
1397
  .target = .Self,
1398
1398
  },
1399
1399
  // AcidArmor
@@ -1401,7 +1401,7 @@ pub const Move = enum(u8) {
1401
1401
  .effect = .DefenseUp2,
1402
1402
  .bp = 0,
1403
1403
  .type = .Poison,
1404
- .accuracy = Gen12.percent(100),
1404
+ .accuracy = percent(100),
1405
1405
  .target = .Self,
1406
1406
  },
1407
1407
  // Crabhammer
@@ -1409,7 +1409,7 @@ pub const Move = enum(u8) {
1409
1409
  .effect = .HighCritical,
1410
1410
  .bp = 90,
1411
1411
  .type = .Water,
1412
- .accuracy = Gen12.percent(85),
1412
+ .accuracy = percent(85),
1413
1413
  .target = .Other,
1414
1414
  },
1415
1415
  // Explosion
@@ -1417,7 +1417,7 @@ pub const Move = enum(u8) {
1417
1417
  .effect = .Explode,
1418
1418
  .bp = 170,
1419
1419
  .type = .Normal,
1420
- .accuracy = Gen12.percent(100),
1420
+ .accuracy = percent(100),
1421
1421
  .target = .Other,
1422
1422
  },
1423
1423
  // FurySwipes
@@ -1425,7 +1425,7 @@ pub const Move = enum(u8) {
1425
1425
  .effect = .MultiHit,
1426
1426
  .bp = 18,
1427
1427
  .type = .Normal,
1428
- .accuracy = Gen12.percent(80),
1428
+ .accuracy = percent(80),
1429
1429
  .target = .Other,
1430
1430
  },
1431
1431
  // Bonemerang
@@ -1433,7 +1433,7 @@ pub const Move = enum(u8) {
1433
1433
  .effect = .DoubleHit,
1434
1434
  .bp = 50,
1435
1435
  .type = .Ground,
1436
- .accuracy = Gen12.percent(90),
1436
+ .accuracy = percent(90),
1437
1437
  .target = .Other,
1438
1438
  },
1439
1439
  // Rest
@@ -1441,7 +1441,7 @@ pub const Move = enum(u8) {
1441
1441
  .effect = .Heal,
1442
1442
  .bp = 0,
1443
1443
  .type = .Psychic,
1444
- .accuracy = Gen12.percent(100),
1444
+ .accuracy = percent(100),
1445
1445
  .target = .Self,
1446
1446
  },
1447
1447
  // RockSlide
@@ -1449,7 +1449,7 @@ pub const Move = enum(u8) {
1449
1449
  .effect = .None,
1450
1450
  .bp = 75,
1451
1451
  .type = .Rock,
1452
- .accuracy = Gen12.percent(90),
1452
+ .accuracy = percent(90),
1453
1453
  .target = .Other,
1454
1454
  },
1455
1455
  // HyperFang
@@ -1457,7 +1457,7 @@ pub const Move = enum(u8) {
1457
1457
  .effect = .FlinchChance1,
1458
1458
  .bp = 80,
1459
1459
  .type = .Normal,
1460
- .accuracy = Gen12.percent(90),
1460
+ .accuracy = percent(90),
1461
1461
  .target = .Other,
1462
1462
  },
1463
1463
  // Sharpen
@@ -1465,7 +1465,7 @@ pub const Move = enum(u8) {
1465
1465
  .effect = .AttackUp1,
1466
1466
  .bp = 0,
1467
1467
  .type = .Normal,
1468
- .accuracy = Gen12.percent(100),
1468
+ .accuracy = percent(100),
1469
1469
  .target = .Self,
1470
1470
  },
1471
1471
  // Conversion
@@ -1473,7 +1473,7 @@ pub const Move = enum(u8) {
1473
1473
  .effect = .Conversion,
1474
1474
  .bp = 0,
1475
1475
  .type = .Normal,
1476
- .accuracy = Gen12.percent(100),
1476
+ .accuracy = percent(100),
1477
1477
  .target = .Other,
1478
1478
  },
1479
1479
  // TriAttack
@@ -1481,7 +1481,7 @@ pub const Move = enum(u8) {
1481
1481
  .effect = .None,
1482
1482
  .bp = 80,
1483
1483
  .type = .Normal,
1484
- .accuracy = Gen12.percent(100),
1484
+ .accuracy = percent(100),
1485
1485
  .target = .Other,
1486
1486
  },
1487
1487
  // SuperFang
@@ -1489,7 +1489,7 @@ pub const Move = enum(u8) {
1489
1489
  .effect = .SuperFang,
1490
1490
  .bp = 1,
1491
1491
  .type = .Normal,
1492
- .accuracy = Gen12.percent(90),
1492
+ .accuracy = percent(90),
1493
1493
  .target = .Other,
1494
1494
  },
1495
1495
  // Slash
@@ -1497,7 +1497,7 @@ pub const Move = enum(u8) {
1497
1497
  .effect = .HighCritical,
1498
1498
  .bp = 70,
1499
1499
  .type = .Normal,
1500
- .accuracy = Gen12.percent(100),
1500
+ .accuracy = percent(100),
1501
1501
  .target = .Other,
1502
1502
  },
1503
1503
  // Substitute
@@ -1505,7 +1505,7 @@ pub const Move = enum(u8) {
1505
1505
  .effect = .Substitute,
1506
1506
  .bp = 0,
1507
1507
  .type = .Normal,
1508
- .accuracy = Gen12.percent(100),
1508
+ .accuracy = percent(100),
1509
1509
  .target = .Self,
1510
1510
  },
1511
1511
  // Struggle
@@ -1513,7 +1513,7 @@ pub const Move = enum(u8) {
1513
1513
  .effect = .Recoil,
1514
1514
  .bp = 50,
1515
1515
  .type = .Normal,
1516
- .accuracy = Gen12.percent(100),
1516
+ .accuracy = percent(100),
1517
1517
  .target = .RandomFoe,
1518
1518
  },
1519
1519
  };
@@ -1599,43 +1599,43 @@ pub const Move = enum(u8) {
1599
1599
  }
1600
1600
 
1601
1601
  /// Whether this effect activates during the "begin" step of move execution.
1602
- pub inline fn onBegin(effect: Effect) bool {
1602
+ pub fn onBegin(effect: Effect) bool {
1603
1603
  return @intFromEnum(effect) > 0 and @intFromEnum(effect) <= 16;
1604
1604
  }
1605
1605
 
1606
1606
  /// Whether this effect lowers stats.
1607
- pub inline fn isStatDown(effect: Effect) bool {
1607
+ pub fn isStatDown(effect: Effect) bool {
1608
1608
  return @intFromEnum(effect) > 16 and @intFromEnum(effect) <= 21;
1609
1609
  }
1610
1610
 
1611
1611
  /// Whether this effect activates during the "end" step of move execution.
1612
- pub inline fn onEnd(effect: Effect) bool {
1612
+ pub fn onEnd(effect: Effect) bool {
1613
1613
  return @intFromEnum(effect) > 16 and @intFromEnum(effect) <= 31;
1614
1614
  }
1615
1615
 
1616
1616
  /// Whether this effect is considered to "always happen".
1617
- pub inline fn alwaysHappens(effect: Effect) bool {
1617
+ pub fn alwaysHappens(effect: Effect) bool {
1618
1618
  return @intFromEnum(effect) > 31 and @intFromEnum(effect) <= 38;
1619
1619
  }
1620
1620
 
1621
1621
  /// Whether this effect is handled specially by the engine.
1622
- pub inline fn isSpecial(effect: Effect) bool {
1622
+ pub fn isSpecial(effect: Effect) bool {
1623
1623
  // NB: isSpecial includes isMulti up to Twineedle
1624
1624
  return @intFromEnum(effect) > 31 and @intFromEnum(effect) <= 46;
1625
1625
  }
1626
1626
 
1627
1627
  /// Whether this effect is a multi-hit effect.
1628
- pub inline fn isMulti(effect: Effect) bool {
1628
+ pub fn isMulti(effect: Effect) bool {
1629
1629
  return @intFromEnum(effect) > 44 and @intFromEnum(effect) <= 47;
1630
1630
  }
1631
1631
 
1632
1632
  /// Whether this effect is has chance of lowering stats.
1633
- pub inline fn isStatDownChance(effect: Effect) bool {
1633
+ pub fn isStatDownChance(effect: Effect) bool {
1634
1634
  return @intFromEnum(effect) > 47 and @intFromEnum(effect) <= 51;
1635
1635
  }
1636
1636
 
1637
1637
  /// Whether this effect has a secondary chance.
1638
- pub inline fn isSecondaryChance(effect: Effect) bool {
1638
+ pub fn isSecondaryChance(effect: Effect) bool {
1639
1639
  // NB: isSecondaryChance includes isStatDownChance as well as Twineedle
1640
1640
  return (@intFromEnum(effect) > 46 and @intFromEnum(effect) <= 61);
1641
1641
  }
@@ -1838,8 +1838,22 @@ pub const Move = enum(u8) {
1838
1838
  /// The number of Pokémon moves in this generation.
1839
1839
  pub const size = 165;
1840
1840
 
1841
+ /// Pokémon moves that can be called by Metronome in this generation.
1842
+ pub const METRONOME = init: {
1843
+ var num = 0;
1844
+ var moves: [163]Move = undefined;
1845
+ for (1..Move.size) |i| {
1846
+ if (i != @intFromEnum(Move.Metronome)) {
1847
+ moves[num] = @enumFromInt(i);
1848
+ num += 1;
1849
+ }
1850
+ }
1851
+ assert(num == moves.len);
1852
+ break :init moves;
1853
+ };
1854
+
1841
1855
  /// Returns the `Data` corresponding to the move.
1842
- pub inline fn get(id: Move) Data {
1856
+ pub fn get(id: Move) Data {
1843
1857
  assert(id != .None and id != .SKIP_TURN);
1844
1858
  return DATA[@intFromEnum(id) - 1];
1845
1859
  }