Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
181810.c File Reference

Go to the source code of this file.

Macros

#define ACTOR_TYPE_LIST_END   0xFF
 

Functions

s32 is_actor_health_bar_visible (Actor *actor)
 
s32 is_actortype_health_bar_visible (s32 actorType)
 
void save_tattle_flags (s32 actorType)
 
void load_tattle_flags (s32 actorType)
 

Variables

BSS char D_8029F660 [0x400]
 
BSS MessagePrintStategSpeakingActorPrintCtx
 
BSS MessagePrintStateD_8029FA64
 
BSS s32 gSpeakingActorPrintIsDone
 
BSS s32 gSpeakingActorTalkAnim
 
BSS s32 gSpeakingActorIdleAnim
 
BSS ActorgSpeakingActor
 
BSS ActorPartgSpeakingActorPart
 
u8 * gBattleDmaDest = NULL
 
u8 ActorTypesGhost []
 
u8 ActorTypesLee []
 
u8 ActorTypesCrystalKing []
 
u8 ActorTypesShyGuyBoss []
 
u8 ActorTypesBowser []
 
u8 ActorTypesMagikoopa []
 
u8 ActorTypesRedMagikoopa []
 
u8 ActorTypesGreenMagikoopa []
 
u8 ActorTypesGrayMagikoopa []
 
u8 ActorTypesYellowMagikoopa []
 
u8 ActorTypesWhiteMagikoopa []
 
u8 * ActorTypesLists []
 

Macro Definition Documentation

◆ ACTOR_TYPE_LIST_END

#define ACTOR_TYPE_LIST_END   0xFF

Definition at line 14 of file 181810.c.

Referenced by load_tattle_flags(), and save_tattle_flags().

Function Documentation

◆ is_actor_health_bar_visible()

s32 is_actor_health_bar_visible ( Actor * actor)

Definition at line 503 of file 181810.c.

503 {
504 BattleStatus* battleStatus = &gBattleStatus;
505 s32 flags;
506
508 return TRUE;
509 }
510
512 if (actor->flags & ACTOR_FLAG_TYPE_CHANGED) {
513 flags |= battleStatus->tattleFlags[actor->actorType / 8];
514 }
515
516 return (flags >> (actor->actorType % 8)) & 1;
517}
s8 flags
Definition demo_api.c:15
@ ABILITY_PEEKABOO
Definition enums.h:490
@ ACTOR_FLAG_TYPE_CHANGED
Indicates actors type has changed, triggers recheck for if HP bar should be shown based on tattle sta...
Definition enums.h:3332
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725
@ GB_Tattles_00
#define EVT_INDEX_OF_GAME_BYTE(v)
Definition macros.h:143
BattleStatus gBattleStatus
Definition battle.c:11
s32 get_global_byte(s32 index)
Get value of saved game byte.

Referenced by btl_draw_enemy_health_bars().

◆ is_actortype_health_bar_visible()

s32 is_actortype_health_bar_visible ( s32 actorType)

Definition at line 519 of file 181810.c.

519 {
520 BattleStatus* battleStatus = &gBattleStatus;
521 s32 flags;
522 s32 byteIdx;
523 s32 flagIdx;
524
526 return TRUE;
527 }
528
530 flags |= battleStatus->tattleFlags[actorType / 8];
531
532 return (flags >> (actorType % 8)) & 1;
533}

◆ save_tattle_flags()

void save_tattle_flags ( s32 actorType)

Definition at line 535 of file 181810.c.

535 {
536 BattleStatus* battleStatus = &gBattleStatus;
537 u8* types;
538 s32 gb;
539 s32 i = 0;
540 s32 j;
541 s32 k;
542
543 while (TRUE) {
544 types = ActorTypesLists[i];
545 if (types == NULL) {
546 break;
547 }
548
549 for (j = 0; types[j] != ACTOR_TYPE_LIST_END; j++) {
550 if (actorType == types[j]) {
551 for (k = 0; types[k] != ACTOR_TYPE_LIST_END; k++) {
552 actorType = types[k];
553
555 gb |= 1 << (actorType % 8);
557 battleStatus->tattleFlags[actorType / 8] |= gb;
558 }
559 return;
560 }
561 }
562 i++;
563 }
564
566 gb |= 1 << (actorType % 8);
568 battleStatus->tattleFlags[actorType / 8] |= gb;
569}
#define ACTOR_TYPE_LIST_END
Definition 181810.c:14
u8 * ActorTypesLists[]
Definition 181810.c:100
s8 set_global_byte(s32 index, s32 value)
Set value of saved game byte.

◆ load_tattle_flags()

void load_tattle_flags ( s32 actorType)

Definition at line 571 of file 181810.c.

571 {
572 BattleStatus* battleStatus = &gBattleStatus;
573 u8* types;
574 s32 gb;
575 s32 i = 0;
576 s32 j;
577 s32 k;
578
579 while (TRUE) {
580 types = ActorTypesLists[i];
581 if (types == NULL) {
582 break;
583 }
584
585 for (j = 0; types[j] != ACTOR_TYPE_LIST_END; j++) {
586 if (actorType == types[j]) {
587 for (k = 0; types[k] != ACTOR_TYPE_LIST_END; k++) {
588 actorType = types[k];
589
591 gb |= 1 << (actorType % 8);
592 battleStatus->tattleFlags[actorType / 8] |= gb;
593 }
594 return;
595 }
596 }
597 i++;
598 }
599
601 gb |= 1 << (actorType % 8);
602 battleStatus->tattleFlags[actorType / 8] |= gb;
603}

Variable Documentation

◆ D_8029F660

BSS char D_8029F660[0x400]

Definition at line 4 of file 181810.c.

◆ gSpeakingActorPrintCtx

BSS MessagePrintState* gSpeakingActorPrintCtx

Definition at line 6 of file 181810.c.

◆ D_8029FA64

BSS MessagePrintState* D_8029FA64

Definition at line 7 of file 181810.c.

◆ gSpeakingActorPrintIsDone

BSS s32 gSpeakingActorPrintIsDone

Definition at line 8 of file 181810.c.

◆ gSpeakingActorTalkAnim

BSS s32 gSpeakingActorTalkAnim

Definition at line 9 of file 181810.c.

◆ gSpeakingActorIdleAnim

BSS s32 gSpeakingActorIdleAnim

Definition at line 10 of file 181810.c.

◆ gSpeakingActor

BSS Actor* gSpeakingActor

Definition at line 11 of file 181810.c.

◆ gSpeakingActorPart

BSS ActorPart* gSpeakingActorPart

Definition at line 12 of file 181810.c.

◆ gBattleDmaDest

u8* gBattleDmaDest = NULL

Definition at line 16 of file 181810.c.

◆ ActorTypesGhost

u8 ActorTypesGhost[]
Initial value:
= {
ACTOR_TYPE_DUPLIGHOST,
ACTOR_TYPE_GHOST_GOOMBARIO,
ACTOR_TYPE_GHOST_KOOPER,
ACTOR_TYPE_GHOST_BOMBETTE,
ACTOR_TYPE_GHOST_PARAKARRY,
ACTOR_TYPE_GHOST_BOW,
ACTOR_TYPE_GHOST_WATT,
ACTOR_TYPE_GHOST_SUSHIE,
ACTOR_TYPE_GHOST_LAKILESTER,
0xFF
}

Definition at line 18 of file 181810.c.

18 {
19 ACTOR_TYPE_DUPLIGHOST,
20 ACTOR_TYPE_GHOST_GOOMBARIO,
21 ACTOR_TYPE_GHOST_KOOPER,
22 ACTOR_TYPE_GHOST_BOMBETTE,
23 ACTOR_TYPE_GHOST_PARAKARRY,
24 ACTOR_TYPE_GHOST_BOW,
25 ACTOR_TYPE_GHOST_WATT,
26 ACTOR_TYPE_GHOST_SUSHIE,
27 ACTOR_TYPE_GHOST_LAKILESTER,
29};

◆ ActorTypesLee

u8 ActorTypesLee[]
Initial value:
= {
ACTOR_TYPE_LEE,
ACTOR_TYPE_LEE_GOOMBARIO,
ACTOR_TYPE_LEE_KOOPER,
ACTOR_TYPE_LEE_BOMBETTE,
ACTOR_TYPE_LEE_PARAKARRY,
ACTOR_TYPE_LEE_BOW,
ACTOR_TYPE_LEE_WATT,
ACTOR_TYPE_LEE_SUSHIE,
ACTOR_TYPE_LEE_LAKILESTER,
0xFF
}

Definition at line 31 of file 181810.c.

31 {
32 ACTOR_TYPE_LEE,
33 ACTOR_TYPE_LEE_GOOMBARIO,
34 ACTOR_TYPE_LEE_KOOPER,
35 ACTOR_TYPE_LEE_BOMBETTE,
36 ACTOR_TYPE_LEE_PARAKARRY,
37 ACTOR_TYPE_LEE_BOW,
38 ACTOR_TYPE_LEE_WATT,
39 ACTOR_TYPE_LEE_SUSHIE,
40 ACTOR_TYPE_LEE_LAKILESTER,
42};

◆ ActorTypesCrystalKing

u8 ActorTypesCrystalKing[]
Initial value:
= {
ACTOR_TYPE_CRYSTAL_KING,
ACTOR_TYPE_CRYSTAL_CLONE,
0xFF
}

Definition at line 44 of file 181810.c.

44 {
45 ACTOR_TYPE_CRYSTAL_KING,
46 ACTOR_TYPE_CRYSTAL_CLONE,
48};

◆ ActorTypesShyGuyBoss

u8 ActorTypesShyGuyBoss[]
Initial value:
= {
ACTOR_TYPE_TOY_TANK,
ACTOR_TYPE_LIGHT_BULB,
0xFF
}

Definition at line 50 of file 181810.c.

50 {
51 ACTOR_TYPE_TOY_TANK,
52 ACTOR_TYPE_LIGHT_BULB,
54};

◆ ActorTypesBowser

u8 ActorTypesBowser[]
Initial value:
= {
ACTOR_TYPE_FINAL_BOWSER_1,
ACTOR_TYPE_FINAL_BOWSER_2,
0xFF
}

Definition at line 56 of file 181810.c.

56 {
57 ACTOR_TYPE_FINAL_BOWSER_1,
58 ACTOR_TYPE_FINAL_BOWSER_2,
60};

◆ ActorTypesMagikoopa

u8 ActorTypesMagikoopa[]
Initial value:
= {
ACTOR_TYPE_MAGIKOOPA,
ACTOR_TYPE_MAGICLONE,
ACTOR_TYPE_FLYING_MAGIKOOPA,
ACTOR_TYPE_FLYING_MAGICLONE,
0xFF
}

Definition at line 62 of file 181810.c.

62 {
63 ACTOR_TYPE_MAGIKOOPA,
64 ACTOR_TYPE_MAGICLONE,
65 ACTOR_TYPE_FLYING_MAGIKOOPA,
66 ACTOR_TYPE_FLYING_MAGICLONE,
68};

◆ ActorTypesRedMagikoopa

u8 ActorTypesRedMagikoopa[]
Initial value:
= {
ACTOR_TYPE_RED_MAGIKOOPA,
ACTOR_TYPE_FLYING_RED_MAGIKOOPA,
0xFF
}

Definition at line 70 of file 181810.c.

70 {
71 ACTOR_TYPE_RED_MAGIKOOPA,
72 ACTOR_TYPE_FLYING_RED_MAGIKOOPA,
74};

◆ ActorTypesGreenMagikoopa

u8 ActorTypesGreenMagikoopa[]
Initial value:
= {
ACTOR_TYPE_GREEN_MAGIKOOPA,
ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA,
0xFF
}

Definition at line 76 of file 181810.c.

76 {
77 ACTOR_TYPE_GREEN_MAGIKOOPA,
78 ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA,
80};

◆ ActorTypesGrayMagikoopa

u8 ActorTypesGrayMagikoopa[]
Initial value:
= {
ACTOR_TYPE_GRAY_MAGIKOOPA,
ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA,
0xFF
}

Definition at line 82 of file 181810.c.

82 {
83 ACTOR_TYPE_GRAY_MAGIKOOPA,
84 ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA,
86};

◆ ActorTypesYellowMagikoopa

u8 ActorTypesYellowMagikoopa[]
Initial value:
= {
ACTOR_TYPE_YELLOW_MAGIKOOPA,
ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA,
0xFF
}

Definition at line 88 of file 181810.c.

88 {
89 ACTOR_TYPE_YELLOW_MAGIKOOPA,
90 ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA,
92};

◆ ActorTypesWhiteMagikoopa

u8 ActorTypesWhiteMagikoopa[]
Initial value:
= {
ACTOR_TYPE_WHITE_MAGIKOOPA,
ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA,
0xFF
}

Definition at line 94 of file 181810.c.

94 {
95 ACTOR_TYPE_WHITE_MAGIKOOPA,
96 ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA,
98};

◆ ActorTypesLists

u8* ActorTypesLists[]
Initial value:
= {
NULL,
}
u8 ActorTypesBowser[]
Definition 181810.c:56
u8 ActorTypesGreenMagikoopa[]
Definition 181810.c:76
u8 ActorTypesLee[]
Definition 181810.c:31
u8 ActorTypesYellowMagikoopa[]
Definition 181810.c:88
u8 ActorTypesGrayMagikoopa[]
Definition 181810.c:82
u8 ActorTypesMagikoopa[]
Definition 181810.c:62
u8 ActorTypesCrystalKing[]
Definition 181810.c:44
u8 ActorTypesShyGuyBoss[]
Definition 181810.c:50
u8 ActorTypesWhiteMagikoopa[]
Definition 181810.c:94
u8 ActorTypesGhost[]
Definition 181810.c:18
u8 ActorTypesRedMagikoopa[]
Definition 181810.c:70

Definition at line 100 of file 181810.c.

Referenced by load_tattle_flags(), and save_tattle_flags().