-
Notifications
You must be signed in to change notification settings - Fork 811
/
stats_screen.asm
1195 lines (1077 loc) · 18.1 KB
/
stats_screen.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const_def 1
const PINK_PAGE ; 1
const GREEN_PAGE ; 2
const BLUE_PAGE ; 3
DEF NUM_STAT_PAGES EQU const_value - 1
DEF STAT_PAGE_MASK EQU %00000011
BattleStatsScreenInit:
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, StatsScreenInit
ld a, [wBattleMode]
and a
jr z, StatsScreenInit
jr _MobileStatsScreenInit
StatsScreenInit:
ld hl, StatsScreenMain
jr StatsScreenInit_gotaddress
_MobileStatsScreenInit:
ld hl, StatsScreenMobile
jr StatsScreenInit_gotaddress
StatsScreenInit_gotaddress:
ldh a, [hMapAnims]
push af
xor a
ldh [hMapAnims], a ; disable overworld tile animations
ld a, [wBoxAlignment] ; whether sprite is to be mirrorred
push af
ld a, [wJumptableIndex]
ld b, a
ld a, [wStatsScreenFlags]
ld c, a
push bc
push hl
call ClearBGPalettes
call ClearTilemap
call UpdateSprites
farcall StatsScreen_LoadFont
pop hl
call _hl_
call ClearBGPalettes
call ClearTilemap
pop bc
; restore old values
ld a, b
ld [wJumptableIndex], a
ld a, c
ld [wStatsScreenFlags], a
pop af
ld [wBoxAlignment], a
pop af
ldh [hMapAnims], a
ret
StatsScreenMain:
xor a
ld [wJumptableIndex], a
ld [wStatsScreenFlags], a
ld a, [wStatsScreenFlags]
and ~STAT_PAGE_MASK
or PINK_PAGE ; first_page
ld [wStatsScreenFlags], a
.loop
ld a, [wJumptableIndex]
and ~(1 << 7)
ld hl, StatsScreenPointerTable
rst JumpTable
call StatsScreen_WaitAnim
ld a, [wJumptableIndex]
bit 7, a
jr z, .loop
ret
StatsScreenMobile:
xor a
ld [wJumptableIndex], a
ld [wStatsScreenFlags], a
ld a, [wStatsScreenFlags]
and ~STAT_PAGE_MASK
or PINK_PAGE ; first_page
ld [wStatsScreenFlags], a
.loop
farcall Mobile_SetOverworldDelay
ld a, [wJumptableIndex]
and $7f
ld hl, StatsScreenPointerTable
rst JumpTable
call StatsScreen_WaitAnim
farcall MobileComms_CheckInactivityTimer
jr c, .exit
ld a, [wJumptableIndex]
bit 7, a
jr z, .loop
.exit
ret
StatsScreenPointerTable:
dw MonStatsInit ; regular pokémon
dw EggStatsInit ; egg
dw StatsScreenWaitCry
dw EggStatsJoypad
dw StatsScreen_LoadPage
dw StatsScreenWaitCry
dw MonStatsJoypad
dw StatsScreen_Exit
StatsScreen_WaitAnim:
ld hl, wStatsScreenFlags
bit 6, [hl]
jr nz, .try_anim
bit 5, [hl]
jr nz, .finish
call DelayFrame
ret
.try_anim
farcall SetUpPokeAnim
jr nc, .finish
ld hl, wStatsScreenFlags
res 6, [hl]
.finish
ld hl, wStatsScreenFlags
res 5, [hl]
farcall HDMATransferTilemapToWRAMBank3
ret
StatsScreen_SetJumptableIndex:
ld a, [wJumptableIndex]
and $80
or h
ld [wJumptableIndex], a
ret
StatsScreen_Exit:
ld hl, wJumptableIndex
set 7, [hl]
ret
MonStatsInit:
ld hl, wStatsScreenFlags
res 6, [hl]
call ClearBGPalettes
call ClearTilemap
farcall HDMATransferTilemapToWRAMBank3
call StatsScreen_CopyToTempMon
ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
call StatsScreen_InitUpperHalf
ld hl, wStatsScreenFlags
set 4, [hl]
ld h, 4
call StatsScreen_SetJumptableIndex
ret
.egg
ld h, 1
call StatsScreen_SetJumptableIndex
ret
EggStatsInit:
call EggStatsScreen
ld a, [wJumptableIndex]
inc a
ld [wJumptableIndex], a
ret
EggStatsJoypad:
call StatsScreen_GetJoypad
jr nc, .check
ld h, 0
call StatsScreen_SetJumptableIndex
ret
.check
bit A_BUTTON_F, a
jr nz, .quit
if DEF(_DEBUG)
cp START
jr z, .hatch
endc
and D_DOWN | D_UP | A_BUTTON | B_BUTTON
jp StatsScreen_JoypadAction
.quit
ld h, 7
call StatsScreen_SetJumptableIndex
ret
if DEF(_DEBUG)
.hatch
ld a, [wMonType]
or a
jr nz, .skip
push bc
push de
push hl
ld a, [wCurPartyMon]
ld bc, PARTYMON_STRUCT_LENGTH
ld hl, wPartyMon1Happiness
call AddNTimes
ld [hl], 1
ld a, 1
ld [wTempMonHappiness], a
ld a, 127
ld [wStepCount], a
ld de, .HatchSoonString
hlcoord 8, 17
call PlaceString
ld hl, wStatsScreenFlags
set 5, [hl]
pop hl
pop de
pop bc
.skip
xor a
jp StatsScreen_JoypadAction
.HatchSoonString:
db "▶HATCH SOON!@"
endc
StatsScreen_LoadPage:
call StatsScreen_LoadGFX
ld hl, wStatsScreenFlags
res 4, [hl]
ld a, [wJumptableIndex]
inc a
ld [wJumptableIndex], a
ret
MonStatsJoypad:
call StatsScreen_GetJoypad
jr nc, .next
ld h, 0
call StatsScreen_SetJumptableIndex
ret
.next
and D_DOWN | D_UP | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON
jp StatsScreen_JoypadAction
StatsScreenWaitCry:
call IsSFXPlaying
ret nc
ld a, [wJumptableIndex]
inc a
ld [wJumptableIndex], a
ret
StatsScreen_CopyToTempMon:
ld a, [wMonType]
cp TEMPMON
jr nz, .not_tempmon
ld a, [wBufferMonSpecies]
ld [wCurSpecies], a
call GetBaseData
ld hl, wBufferMon
ld de, wTempMon
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
jr .done
.not_tempmon
farcall CopyMonToTempMon
ld a, [wCurPartySpecies]
cp EGG
jr z, .done
ld a, [wMonType]
cp BOXMON
jr c, .done
farcall CalcTempmonStats
.done
and a
ret
StatsScreen_GetJoypad:
call GetJoypad
ld a, [wMonType]
cp TEMPMON
jr nz, .not_tempmon
push hl
push de
push bc
farcall StatsScreenDPad
pop bc
pop de
pop hl
ld a, [wMenuJoypad]
and D_DOWN | D_UP
jr nz, .set_carry
ld a, [wMenuJoypad]
jr .clear_carry
.not_tempmon
ldh a, [hJoyPressed]
.clear_carry
and a
ret
.set_carry
scf
ret
StatsScreen_JoypadAction:
push af
ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES
ld c, a
pop af
bit B_BUTTON_F, a
jp nz, .b_button
bit D_LEFT_F, a
jr nz, .d_left
bit D_RIGHT_F, a
jr nz, .d_right
bit A_BUTTON_F, a
jr nz, .a_button
bit D_UP_F, a
jr nz, .d_up
bit D_DOWN_F, a
jr nz, .d_down
jr .done
.d_down
ld a, [wMonType]
cp BOXMON
jr nc, .done
and a
ld a, [wPartyCount]
jr z, .next_mon
ld a, [wOTPartyCount]
.next_mon
ld b, a
ld a, [wCurPartyMon]
inc a
cp b
jr z, .done
ld [wCurPartyMon], a
ld b, a
ld a, [wMonType]
and a
jr nz, .load_mon
ld a, b
inc a
ld [wPartyMenuCursor], a
jr .load_mon
.d_up
ld a, [wCurPartyMon]
and a
jr z, .done
dec a
ld [wCurPartyMon], a
ld b, a
ld a, [wMonType]
and a
jr nz, .load_mon
ld a, b
inc a
ld [wPartyMenuCursor], a
jr .load_mon
.a_button
ld a, c
cp BLUE_PAGE ; last page
jr z, .b_button
.d_right
inc c
ld a, BLUE_PAGE ; last page
cp c
jr nc, .set_page
ld c, PINK_PAGE ; first page
jr .set_page
.d_left
dec c
jr nz, .set_page
ld c, BLUE_PAGE ; last page
jr .set_page
.done
ret
.set_page
ld a, [wStatsScreenFlags]
and ~STAT_PAGE_MASK
or c
ld [wStatsScreenFlags], a
ld h, 4
call StatsScreen_SetJumptableIndex
ret
.load_mon
ld h, 0
call StatsScreen_SetJumptableIndex
ret
.b_button
ld h, 7
call StatsScreen_SetJumptableIndex
ret
StatsScreen_InitUpperHalf:
call .PlaceHPBar
xor a
ldh [hBGMapMode], a
ld a, [wBaseDexNo]
ld [wTextDecimalByte], a
ld [wCurSpecies], a
hlcoord 8, 0
ld [hl], "№"
inc hl
ld [hl], "."
inc hl
hlcoord 10, 0
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
ld de, wTextDecimalByte
call PrintNum
hlcoord 14, 0
call PrintLevel
ld hl, .NicknamePointers
call GetNicknamePointer
call CopyNickname
hlcoord 8, 2
call PlaceString
hlcoord 18, 0
call .PlaceGenderChar
hlcoord 9, 4
ld a, "/"
ld [hli], a
ld a, [wBaseDexNo]
ld [wNamedObjectIndex], a
call GetPokemonName
call PlaceString
call StatsScreen_PlaceHorizontalDivider
call StatsScreen_PlacePageSwitchArrows
call StatsScreen_PlaceShinyIcon
ret
.PlaceHPBar:
ld hl, wTempMonHP
ld a, [hli]
ld b, a
ld c, [hl]
ld hl, wTempMonMaxHP
ld a, [hli]
ld d, a
ld e, [hl]
farcall ComputeHPBarPixels
ld hl, wCurHPPal
call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout
call DelayFrame
ret
.PlaceGenderChar:
push hl
farcall GetGender
pop hl
ret c
ld a, "♂"
jr nz, .got_gender
ld a, "♀"
.got_gender
ld [hl], a
ret
.NicknamePointers:
dw wPartyMonNicknames
dw wOTPartyMonNicknames
dw sBoxMonNicknames
dw wBufferMonNickname
StatsScreen_PlaceVerticalDivider: ; unreferenced
; The Japanese stats screen has a vertical divider.
hlcoord 7, 0
ld bc, SCREEN_WIDTH
ld d, SCREEN_HEIGHT
.loop
ld a, $31 ; vertical divider
ld [hl], a
add hl, bc
dec d
jr nz, .loop
ret
StatsScreen_PlaceHorizontalDivider:
hlcoord 0, 7
ld b, SCREEN_WIDTH
ld a, $62 ; horizontal divider (empty HP/exp bar)
.loop
ld [hli], a
dec b
jr nz, .loop
ret
StatsScreen_PlacePageSwitchArrows:
hlcoord 12, 6
ld [hl], "◀"
hlcoord 19, 6
ld [hl], "▶"
ret
StatsScreen_PlaceShinyIcon:
ld bc, wTempMonDVs
farcall CheckShininess
ret nc
hlcoord 19, 0
ld [hl], "⁂"
ret
StatsScreen_LoadGFX:
ld a, [wBaseDexNo]
ld [wTempSpecies], a
ld [wCurSpecies], a
xor a
ldh [hBGMapMode], a
call .ClearBox
call .PageTilemap
call .LoadPals
ld hl, wStatsScreenFlags
bit 4, [hl]
jr nz, .place_frontpic
call SetDefaultBGPAndOBP
ret
.place_frontpic
call StatsScreen_PlaceFrontpic
ret
.ClearBox:
ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES
ld c, a
call StatsScreen_LoadPageIndicators
hlcoord 0, 8
lb bc, 10, 20
call ClearBox
ret
.LoadPals:
ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES
ld c, a
farcall LoadStatsScreenPals
call DelayFrame
ld hl, wStatsScreenFlags
set 5, [hl]
ret
.PageTilemap:
ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES
dec a
ld hl, .Jumptable
rst JumpTable
ret
.Jumptable:
; entries correspond to *_PAGE constants
table_width 2, StatsScreen_LoadGFX.Jumptable
dw LoadPinkPage
dw LoadGreenPage
dw LoadBluePage
assert_table_length NUM_STAT_PAGES
LoadPinkPage:
hlcoord 0, 9
ld b, $0
predef DrawPlayerHP
hlcoord 8, 9
ld [hl], $41 ; right HP/exp bar end cap
ld de, .Status_Type
hlcoord 0, 12
call PlaceString
ld a, [wTempMonPokerusStatus]
ld b, a
and $f
jr nz, .HasPokerus
ld a, b
and $f0
jr z, .NotImmuneToPkrs
hlcoord 8, 8
ld [hl], "." ; Pokérus immunity dot
.NotImmuneToPkrs:
ld a, [wMonType]
cp BOXMON
jr z, .StatusOK
hlcoord 6, 13
push hl
ld de, wTempMonStatus
predef PlaceStatusString
pop hl
jr nz, .done_status
jr .StatusOK
.HasPokerus:
ld de, .PkrsStr
hlcoord 1, 13
call PlaceString
jr .done_status
.StatusOK:
ld de, .OK_str
call PlaceString
.done_status
hlcoord 1, 15
predef PrintMonTypes
hlcoord 9, 8
ld de, SCREEN_WIDTH
ld b, 10
ld a, $31 ; vertical divider
.vertical_divider
ld [hl], a
add hl, de
dec b
jr nz, .vertical_divider
ld de, .ExpPointStr
hlcoord 10, 9
call PlaceString
hlcoord 17, 14
call .PrintNextLevel
hlcoord 13, 10
lb bc, 3, 7
ld de, wTempMonExp
call PrintNum
call .CalcExpToNextLevel
hlcoord 13, 13
lb bc, 3, 7
ld de, wExpToNextLevel
call PrintNum
ld de, .LevelUpStr
hlcoord 10, 12
call PlaceString
ld de, .ToStr
hlcoord 14, 14
call PlaceString
hlcoord 11, 16
ld a, [wTempMonLevel]
ld b, a
ld de, wTempMonExp + 2
predef FillInExpBar
hlcoord 10, 16
ld [hl], $40 ; left exp bar end cap
hlcoord 19, 16
ld [hl], $41 ; right exp bar end cap
ret
.PrintNextLevel:
ld a, [wTempMonLevel]
push af
cp MAX_LEVEL
jr z, .AtMaxLevel
inc a
ld [wTempMonLevel], a
.AtMaxLevel:
call PrintLevel
pop af
ld [wTempMonLevel], a
ret
.CalcExpToNextLevel:
ld a, [wTempMonLevel]
cp MAX_LEVEL
jr z, .AlreadyAtMaxLevel
inc a
ld d, a
farcall CalcExpAtLevel
ld hl, wTempMonExp + 2
ld hl, wTempMonExp + 2
ldh a, [hQuotient + 3]
sub [hl]
dec hl
ld [wExpToNextLevel + 2], a
ldh a, [hQuotient + 2]
sbc [hl]
dec hl
ld [wExpToNextLevel + 1], a
ldh a, [hQuotient + 1]
sbc [hl]
ld [wExpToNextLevel], a
ret
.AlreadyAtMaxLevel:
ld hl, wExpToNextLevel
xor a
ld [hli], a
ld [hli], a
ld [hl], a
ret
.Status_Type:
db "STATUS/"
next "TYPE/@"
.OK_str:
db "OK @"
.ExpPointStr:
db "EXP POINTS@"
.LevelUpStr:
db "LEVEL UP@"
.ToStr:
db "TO@"
.PkrsStr:
db "#RUS@"
LoadGreenPage:
ld de, .Item
hlcoord 0, 8
call PlaceString
call .GetItemName
hlcoord 8, 8
call PlaceString
ld de, .Move
hlcoord 0, 10
call PlaceString
ld hl, wTempMonMoves
ld de, wListMoves_MoveIndicesBuffer
ld bc, NUM_MOVES
call CopyBytes
hlcoord 8, 10
ld a, SCREEN_WIDTH * 2
ld [wListMovesLineSpacing], a
predef ListMoves
hlcoord 12, 11
ld a, SCREEN_WIDTH * 2
ld [wListMovesLineSpacing], a
predef ListMovePP
ret
.GetItemName:
ld de, .ThreeDashes
ld a, [wTempMonItem]
and a
ret z
ld b, a
farcall TimeCapsule_ReplaceTeruSama
ld a, b
ld [wNamedObjectIndex], a
call GetItemName
ret
.Item:
db "ITEM@"
.ThreeDashes:
db "---@"
.Move:
db "MOVE@"
LoadBluePage:
call .PlaceOTInfo
hlcoord 10, 8
ld de, SCREEN_WIDTH
ld b, 10
ld a, $31 ; vertical divider
.vertical_divider
ld [hl], a
add hl, de
dec b
jr nz, .vertical_divider
hlcoord 11, 8
ld bc, 6
predef PrintTempMonStats
ret
.PlaceOTInfo:
ld de, IDNoString
hlcoord 0, 9
call PlaceString
ld de, OTString
hlcoord 0, 12
call PlaceString
hlcoord 2, 10
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
ld de, wTempMonID
call PrintNum
ld hl, .OTNamePointers
call GetNicknamePointer
call CopyNickname
farcall CorrectNickErrors
hlcoord 2, 13
call PlaceString
ld a, [wTempMonCaughtGender]
and a
jr z, .done
cp $7f
jr z, .done
and CAUGHT_GENDER_MASK
ld a, "♂"
jr z, .got_gender
ld a, "♀"
.got_gender
hlcoord 9, 13
ld [hl], a
.done
ret
.OTNamePointers:
dw wPartyMonOTs
dw wOTPartyMonOTs
dw sBoxMonOTs
dw wBufferMonOT
IDNoString:
db "<ID>№.@"
OTString:
db "OT/@"
StatsScreen_PlaceFrontpic:
ld hl, wTempMonDVs
predef GetUnownLetter
call StatsScreen_GetAnimationParam
jr c, .egg
and a
jr z, .no_cry
jr .cry
.egg
call .AnimateEgg
call SetDefaultBGPAndOBP
ret
.no_cry
call .AnimateMon
call SetDefaultBGPAndOBP
ret
.cry
call SetDefaultBGPAndOBP
call .AnimateMon
ld a, [wCurPartySpecies]
call PlayMonCry2
ret
.AnimateMon:
ld hl, wStatsScreenFlags
set 5, [hl]
ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unown
hlcoord 0, 0
call PrepMonFrontpic
ret
.unown
xor a
ld [wBoxAlignment], a
hlcoord 0, 0
call _PrepMonFrontpic
ret
.AnimateEgg:
ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unownegg
ld a, TRUE
ld [wBoxAlignment], a
call .get_animation
ret
.unownegg
xor a
ld [wBoxAlignment], a
call .get_animation
ret
.get_animation
ld a, [wCurPartySpecies]
call IsAPokemon
ret c
call StatsScreen_LoadTextboxSpaceGFX
ld de, vTiles2 tile $00
predef GetAnimatedFrontpic
hlcoord 0, 0
ld d, $0
ld e, ANIM_MON_MENU
predef LoadMonAnimation
ld hl, wStatsScreenFlags
set 6, [hl]
ret
StatsScreen_GetAnimationParam:
ld a, [wMonType]
ld hl, .Jumptable
rst JumpTable
ret
.Jumptable:
dw .PartyMon
dw .OTPartyMon
dw .BoxMon
dw .Tempmon
dw .Wildmon
.PartyMon:
ld a, [wCurPartyMon]
ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld b, h
ld c, l
jr .CheckEggFaintedFrzSlp
.OTPartyMon:
xor a
ret
.BoxMon:
ld hl, sBoxMons
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wCurPartyMon]
call AddNTimes
ld b, h
ld c, l
ld a, BANK(sBoxMons)
call OpenSRAM
call .CheckEggFaintedFrzSlp
push af
call CloseSRAM
pop af
ret
.Tempmon:
ld bc, wTempMonSpecies
jr .CheckEggFaintedFrzSlp ; utterly pointless
.CheckEggFaintedFrzSlp:
ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
call CheckFaintedFrzSlp
jr c, .FaintedFrzSlp
.egg
xor a
scf
ret
.Wildmon:
ld a, $1
and a
ret
.FaintedFrzSlp:
xor a
ret
StatsScreen_LoadTextboxSpaceGFX:
nop
push hl
push de
push bc
push af
call DelayFrame
ldh a, [rVBK]
push af
ld a, $1
ldh [rVBK], a
ld de, TextboxSpaceGFX
lb bc, BANK(TextboxSpaceGFX), 1
ld hl, vTiles2 tile " "
call Get2bpp
pop af
ldh [rVBK], a
pop af
pop bc
pop de
pop hl
ret
StatsScreenSpaceGFX: ; unreferenced
INCBIN "gfx/font/space.2bpp"
EggStatsScreen:
xor a
ldh [hBGMapMode], a
ld hl, wCurHPPal
call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout
call StatsScreen_PlaceHorizontalDivider
ld de, EggString