Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
end_training.c
Go to the documentation of this file.
1#include "states.h"
2#include "script_api/battle.h"
3
4enum {
5 // BTL_SUBSTATE_INIT = 0,
11};
12
19 Evt* script;
20
21 switch (gBattleSubState) {
24 if (partner != NULL) {
26 }
32
33 if (player->koStatus == STATUS_KEY_KO) {
36 }
37 player->debuff = 0;
38 player->staticStatus = 0;
39 player->stoneStatus = 0;
40 player->transparentStatus = 0;
41 player->koStatus = 0;
42 player->koDuration = 0;
44 if (partner != NULL) {
45 if (partner->koStatus == STATUS_KEY_KO) {
48 }
49 partner->debuff = 0;
50 partner->staticStatus = 0;
51 partner->stoneStatus = 0;
52 partner->transparentStatus = 0;
53 partner->koStatus = 0;
54 partner->koDuration = 0;
55 partner->disableEffect->data.disableX->koDuration = 0;
56 }
57 break;
60 break;
61 }
62 player->handleEventScript = NULL;
63
64 if (partner != NULL) {
65 if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) {
66 break;
67 }
68 partner->handleEventScript = NULL;
69 }
70
72 break;
73 }
74
75 switch (gBattleSubState) {
77 battleStatus->stateFreezeCount = 0;
82
83 if (!battleStatus->outtaSightActive) {
85 } else {
86 battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
87 script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0);
88 partner->handlePhaseScript = script;
89 partner->handlePhaseScriptID = script->id;
90 script->owner1.actorID = ACTOR_PARTNER;
92 }
93 break;
95 if (!does_script_exist(partner->handlePhaseScriptID)) {
96 battleStatus->outtaSightActive = FALSE;
98 }
99 break;
100 }
101
102 switch (gBattleSubState) {
107 break;
109 if (BattleSubstateDelay != 0) {
111 return;
112 }
113 if (playerData->trainingsDone < 9999) {
114 playerData->trainingsDone++;
115 }
116 encounterStatus->battleOutcome = OUTCOME_ENEMY_FLED;
118 bgm_set_song(0, -1, 0, 1500, 8);
119 }
121 break;
122 }
123}
124
BSS s32 PopupMenu_SelectedIndex
s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume)
BSS s32 BattleSubstateDelay
struct EffectInstance * disableEffect
s8 transparentStatus
struct Evt * handleEventScript
s32 handleEventScriptID
struct DisableXFXData * disableX
Definition effects.h:2529
EffectInstanceDataPtr data
Definition effects.h:2605
@ BTL_SUBSTATE_AWAIT_OUTTA_SIGHT
Definition end_training.c:8
@ BTL_SUBSTATE_AWAIT_RECOVERING
Definition end_training.c:6
@ BTL_SUBSTATE_RESET_CAM
Definition end_training.c:9
@ BTL_SUBSTATE_CHECK_OUTTA_SIGHT
Definition end_training.c:7
@ BTL_SUBSTATE_DONE
void btl_state_update_end_training_battle(void)
void btl_state_draw_end_training_battle(void)
@ PHASE_ENEMY_BEGIN
Definition enums.h:2101
@ BS_FLAGS2_DONT_STOP_MUSIC
Definition enums.h:3652
@ STATUS_KEY_KO
Definition enums.h:2814
@ BTL_CAM_DEFAULT
Definition enums.h:4409
@ BATTLE_STATE_END_BATTLE
Definition enums.h:3694
@ ACTOR_PARTNER
Definition enums.h:2119
@ ACTOR_FLAG_SHOW_STATUS_ICONS
Definition enums.h:3377
@ ACTOR_FLAG_USING_IDLE_ANIM
Definition enums.h:3376
@ OUTCOME_ENEMY_FLED
Definition enums.h:1931
@ EVENT_RECOVER_FROM_KO
Definition enums.h:2203
@ EVT_PRIORITY_A
Definition evt.h:154
void dispatch_event_player(s32)
Definition dmg_player.c:131
void btl_cam_use_preset(s32)
Definition camera.c:1919
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
s32 does_script_exist(s32 id)
void btl_set_state(s32 battleState)
void dispatch_event_partner(s32)
Definition dmg_partner.c:7
EncounterStatus gCurrentEncounter
Definition encounter.c:175
@ BTL_SUBSTATE_INIT
Definition states.h:8
struct Actor * partnerActor
struct Actor * playerActor
PlayerData gPlayerData
Definition 77480.c:39
BattleStatus gBattleStatus
Definition battle.cpp:14
s32 gBattleSubState
Definition battle.cpp:17