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

Go to the source code of this file.

Enumerations

enum  { BTL_SUBSTATE_FADE_OUT = 1 , BTL_SUBSTATE_EXEC_STAGE_SCRIPT = 2 , BTL_SUBSTATE_AWAIT_STAGE_SCRIPT = 3 , BTL_SUBSTATE_CLEANUP = 4 }
 

Functions

void btl_state_update_end_demo_battle (void)
 
void btl_state_draw_end_demo_battle (void)
 

Variables

s16 DemoBattleBeginDelay
 
StageListRowgCurrentStagePtr
 

Enumeration Type Documentation

◆ anonymous enum

Enumerator
BTL_SUBSTATE_FADE_OUT 
BTL_SUBSTATE_EXEC_STAGE_SCRIPT 
BTL_SUBSTATE_AWAIT_STAGE_SCRIPT 
BTL_SUBSTATE_CLEANUP 

Definition at line 8 of file end_demo.c.

8 {
9 // BTL_SUBSTATE_INIT = 0,
14};
@ BTL_SUBSTATE_FADE_OUT
Definition end_demo.c:10
@ BTL_SUBSTATE_EXEC_STAGE_SCRIPT
Definition end_demo.c:11
@ BTL_SUBSTATE_CLEANUP
Definition end_demo.c:13
@ BTL_SUBSTATE_AWAIT_STAGE_SCRIPT
Definition end_demo.c:12

Function Documentation

◆ btl_state_update_end_demo_battle()

void btl_state_update_end_demo_battle ( void )

Definition at line 16 of file end_demo.c.

16 {
19 Stage* stage;
20 s32 i;
21
22 switch (gBattleSubState) {
25 if (EndDemoWhiteOut == -1) {
26 if (DemoBattleBeginDelay != 0) {
28 break;
29 }
30 }
32 break;
34 switch (EndDemoWhiteOut) {
35 case 255:
37 return;
38 case -1:
39 if (BattleScreenFadeAmt == 255) {
41 return;
42 }
44 if (BattleScreenFadeAmt > 255) {
46 }
47 return;
48 }
49 break;
53 if (gCurrentStagePtr == NULL) {
54 stage = battle->stage;
55 } else {
56 stage = gCurrentStagePtr->stage;
57 }
58
59 if (stage->postBattle == NULL) {
61 } else {
62 battleStatus->controlScript = start_script(stage->postBattle, EVT_PRIORITY_A, 0);
63 battleStatus->controlScriptID = battleStatus->controlScript->id;
65 }
66 break;
68 if (does_script_exist(battleStatus->controlScriptID)) {
69 break;
70 }
72 //fallthrough
75
76 for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
77 Actor* enemy = battleStatus->enemyActors[i];
78
79 if (enemy != NULL) {
80 btl_delete_actor(enemy);
81 }
82 }
83
84 if (battleStatus->partnerActor != NULL) {
85 btl_delete_actor(battleStatus->partnerActor);
86 }
87
91
94 }
95
96 if (EndDemoWhiteOut != -1) {
98 }
99
103 break;
104 }
105}
s32 BattleScreenFadeAmt
Definition 16C8E0.c:50
s16 EndDemoWhiteOut
Definition 16C8E0.c:13
BSS s32 PopupMenu_SelectedIndex
BSS Battle * gCurrentBattlePtr
Definition battle.cpp:22
s16 DemoBattleBeginDelay
Definition 16C8E0.c:14
StageListRow * gCurrentStagePtr
Definition battle.cpp:12
@ BS_FLAGS2_PEACH_BATTLE
Definition enums.h:3643
@ BATTLE_STATE_NONE
Definition enums.h:3664
@ WINDOW_GROUP_ALL
Definition enums.h:4908
@ EVT_PRIORITY_A
Definition evt.h:154
void kill_all_scripts(void)
void decrement_status_bar_disabled(void)
Definition inventory.c:1656
void remove_all_effects(void)
Definition effects.c:278
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
void btl_delete_player_actor(Actor *player)
Definition 16C8E0.c:1107
void set_windows_visible(s32 groupIdx)
Definition windows.c:445
s32 does_script_exist(s32 id)
void btl_delete_actor(Actor *actor)
Definition 16C8E0.c:1041
void btl_set_state(s32 battleState)
void set_game_mode(s32 modeID)
Definition game_modes.c:127
@ GAME_MODE_END_BATTLE
Definition game_modes.h:16
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define LAST_DEMO_SCENE_IDX
Definition macros.h:120
Stage * stage
Definition battle.h:208
EvtScript * postBattle
Definition battle.h:186
Zero-terminated.
Definition battle.h:195
@ BTL_SUBSTATE_INIT
Definition states.h:8
s32 gBattleState
Definition battle.cpp:13
GameStatus * gGameStatusPtr
Definition main_loop.c:31
BattleStatus gBattleStatus
Definition battle.cpp:14
s32 gBattleSubState
Definition battle.cpp:17
s32 gLastDrawBattleState
Definition battle.cpp:15

Referenced by btl_update().

◆ btl_state_draw_end_demo_battle()

void btl_state_draw_end_demo_battle ( void )

Definition at line 107 of file end_demo.c.

107 {
108 if (EndDemoWhiteOut == -1) {
111 }
112}
@ OVERLAY_SCREEN_COLOR
Definition enums.h:2374
@ SCREEN_LAYER_FRONT
Definition enums.h:2368
void set_screen_overlay_params_front(u8, f32)
void set_screen_overlay_color(s32, u8, u8, u8)

Referenced by btl_draw_ui().

Variable Documentation

◆ DemoBattleBeginDelay

s16 DemoBattleBeginDelay
extern

Definition at line 14 of file 16C8E0.c.

Referenced by btl_state_update_end_demo_battle().

◆ gCurrentStagePtr

StageListRow* gCurrentStagePtr
extern

Definition at line 12 of file battle.cpp.

Referenced by btl_state_update_end_demo_battle().