Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
partner_turn_begin.c
Go to the documentation of this file.
1#include "states.h"
2#include "effects.h"
3
4enum {
5 // BTL_SUBSTATE_INIT = 0,
11};
12
15 Actor* partner = battleStatus->partnerActor;
16 Actor* enemy;
17 Evt* script;
18 s32 i;
19
21 if (partner == NULL) {
26 return;
27 } else if (partner->flags & ACTOR_FLAG_NO_ATTACK) {
29 return;
30 } else {
32 btl_cam_move(5);
34 }
35 }
36
41 partner = battleStatus->partnerActor;
42 battleStatus->actionResult = ACTION_RESULT_NONE;
43 battleStatus->blockResult = BLOCK_RESULT_NONE;
48
49 if (partner->koStatus != 0) {
50 partner->koDuration--;
53 if (partner->koDuration > 0) {
54 partner->disableEffect->data.disableX->koDuration = partner->koDuration;
55 } else {
56 partner->koStatus = 0;
58 partner->disableEffect->data.disableX->koDuration = 0;
60 }
61 }
62
63 for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
64 enemy = battleStatus->enemyActors[i];
65 if (enemy != NULL) {
67 }
68 }
70 }
71 }
72
73 switch (gBattleSubState) {
75 if (partner != NULL) {
76 if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) {
77 break;
78 }
79 partner->handleEventScript = NULL;
80 }
81
84 return;
85 }
87 break;
88 }
89
91 if (partner->handlePhaseSource != NULL) {
92 battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
93 script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0);
94 partner->handlePhaseScript = script;
95 partner->handlePhaseScriptID = script->id;
96 script->owner1.actorID = ACTOR_PARTNER;
97 }
99 }
100
102 if (partner->handlePhaseSource == NULL || !does_script_exist(partner->handlePhaseScriptID)) {
104 }
105 }
106
108 if (BattleStatusUpdateDelay != 0) {
110 return;
111 }
116 } else {
118 }
119 }
120}
121
BSS s32 PopupMenu_SelectedIndex
BSS s32 BattleStatusUpdateDelay
BSS b32 BattleSkipActorTurn
@ BS_FLAGS1_PLAYER_IN_BACK
Definition enums.h:3622
@ BS_FLAGS1_PARTNER_ACTING
Definition enums.h:3621
@ PHASE_ENEMY_BEGIN
Definition enums.h:2101
@ BS_FLAGS2_PLAYER_TURN_USED
Definition enums.h:3638
@ BS_FLAGS2_OVERRIDE_INACTIVE_PLAYER
Definition enums.h:3640
@ BS_FLAGS2_PARTNER_TURN_USED
Definition enums.h:3639
@ BTL_CAM_DEFAULT
Definition enums.h:4409
@ BATTLE_STATE_SWITCH_TO_PARTNER
Definition enums.h:3675
@ BATTLE_STATE_TRANSFER_TURN
Definition enums.h:3673
@ ACTOR_PARTNER
Definition enums.h:2119
@ ACTOR_FLAG_SHOW_STATUS_ICONS
Definition enums.h:3377
@ ACTOR_FLAG_NO_ATTACK
Skip attack turn.
Definition enums.h:3373
@ ACTOR_FLAG_USING_IDLE_ANIM
Definition enums.h:3376
@ BLOCK_RESULT_NONE
Definition enums.h:1998
@ ACTION_RESULT_NONE
Definition enums.h:1989
@ EVENT_RECOVER_FROM_KO
Definition enums.h:2203
@ EVT_PRIORITY_A
Definition evt.h:154
s32 btl_check_player_defeated(void)
Definition 190B20.c:661
void reset_actor_turn_info(void)
Definition 190B20.c:710
void btl_cam_use_preset(s32)
Definition camera.c:1919
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
void btl_cam_move(s16)
Definition camera.c:1953
s32 btl_cam_is_moving_done(void)
Definition camera.c:1980
s32 does_script_exist(s32 id)
void btl_set_state(s32 battleState)
s32 btl_check_enemies_defeated(void)
Definition 190B20.c:653
void dispatch_event_partner(s32)
Definition dmg_partner.c:7
void btl_state_update_begin_partner_turn(void)
void btl_state_draw_begin_partner_turn(void)
@ BTL_SUBSTATE_AWAIT_RECOVER_DONE
@ BTL_SUBSTATE_RESET_STATE
@ BTL_SUBSTATE_AWAIT_TURN_SCRIPT
@ BTL_SUBSTATE_EXEC_TURN_SCRIPT
@ BTL_SUBSTATE_END_DELAY
#define ARRAY_COUNT(arr)
Definition macros.h:40
@ BTL_SUBSTATE_INIT
Definition states.h:8
BattleStatus gBattleStatus
Definition battle.cpp:14
s32 gBattleSubState
Definition battle.cpp:17