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 = nullptr
 
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:3366
s32 is_ability_active(s32 arg0)
Definition inventory.c:1735
@ GB_Tattles_00
#define EVT_INDEX_OF_GAME_BYTE(v)
Definition macros.h:144
BattleStatus gBattleStatus
Definition battle.cpp:14
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
524 return true;
525 }
526
528 flags |= battleStatus->tattleFlags[actorType / 8];
529
530 return (flags >> (actorType % 8)) & 1;
531}

◆ save_tattle_flags()

void save_tattle_flags ( s32 actorType)

Definition at line 533 of file 181810.c.

533 {
535 u8* types;
536 s32 gb;
537 s32 i = 0;
538 s32 j;
539 s32 k;
540
541 while (true) {
543 if (types == nullptr) {
544 break;
545 }
546
547 for (j = 0; types[j] != ACTOR_TYPE_LIST_END; j++) {
548 if (actorType == types[j]) {
549 for (k = 0; types[k] != ACTOR_TYPE_LIST_END; k++) {
550 actorType = types[k];
551
553 gb |= 1 << (actorType % 8);
555 battleStatus->tattleFlags[actorType / 8] |= gb;
556 }
557 return;
558 }
559 }
560 i++;
561 }
562
564 gb |= 1 << (actorType % 8);
566 battleStatus->tattleFlags[actorType / 8] |= gb;
567}
#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 569 of file 181810.c.

569 {
571 u8* types;
572 s32 gb;
573 s32 i = 0;
574 s32 j;
575 s32 k;
576
577 while (true) {
579 if (types == nullptr) {
580 break;
581 }
582
583 for (j = 0; types[j] != ACTOR_TYPE_LIST_END; j++) {
584 if (actorType == types[j]) {
585 for (k = 0; types[k] != ACTOR_TYPE_LIST_END; k++) {
586 actorType = types[k];
587
589 gb |= 1 << (actorType % 8);
590 battleStatus->tattleFlags[actorType / 8] |= gb;
591 }
592 return;
593 }
594 }
595 i++;
596 }
597
599 gb |= 1 << (actorType % 8);
600 battleStatus->tattleFlags[actorType / 8] |= gb;
601}

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 = nullptr

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:
= {
nullptr,
}
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().