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
 
u8gBattleDmaDest = NULL
 
u8 ActorTypesGhost []
 
u8 ActorTypesLee []
 
u8 ActorTypesCrystalKing []
 
u8 ActorTypesShyGuyBoss []
 
u8 ActorTypesBowser []
 
u8 ActorTypesMagikoopa []
 
u8 ActorTypesRedMagikoopa []
 
u8 ActorTypesGreenMagikoopa []
 
u8 ActorTypesGrayMagikoopa []
 
u8 ActorTypesYellowMagikoopa []
 
u8 ActorTypesWhiteMagikoopa []
 
u8ActorTypesLists []
 

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 {
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}
BSS s32 PopupMenu_SelectedIndex
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:1736
@ 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 {
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 {
537 u8* types;
538 s32 gb;
539 s32 i = 0;
540 s32 j;
541 s32 k;
542
543 while (TRUE) {
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 {
573 u8* types;
574 s32 gb;
575 s32 i = 0;
576 s32 j;
577 s32 k;
578
579 while (TRUE) {
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

◆ ActorTypesLee

◆ ActorTypesCrystalKing

u8 ActorTypesCrystalKing[]
Initial value:

Definition at line 44 of file 181810.c.

◆ ActorTypesShyGuyBoss

u8 ActorTypesShyGuyBoss[]
Initial value:

Definition at line 50 of file 181810.c.

◆ ActorTypesBowser

u8 ActorTypesBowser[]

◆ ActorTypesMagikoopa

◆ ActorTypesRedMagikoopa

u8 ActorTypesRedMagikoopa[]

◆ ActorTypesGreenMagikoopa

u8 ActorTypesGreenMagikoopa[]

◆ ActorTypesGrayMagikoopa

u8 ActorTypesGrayMagikoopa[]

◆ ActorTypesYellowMagikoopa

u8 ActorTypesYellowMagikoopa[]

◆ ActorTypesWhiteMagikoopa

u8 ActorTypesWhiteMagikoopa[]

◆ ActorTypesLists

u8* ActorTypesLists[]
Initial value:
= {
}
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().