papermario
Decompilation of Paper Mario
 
Loading...
Searching...
No Matches
encounter.c File Reference

Enumerations

enum  { MERLEE_EFFECTS_HOLD = 0 , MERLEE_EFFECTS_RELEASE = 1 , MERLEE_EFFECTS_DISMISS = 2 }
 

Functions

void set_battle_formation (Battle *)
 
void setup_status_bar_for_world (void)
 
void partner_handle_after_battle (void)
 
s32 get_coin_drop_amount (Enemy *enemy)
 
s32 get_defeated (s32 mapID, s32 encounterID)
 
void set_defeated (s32 mapID, s32 encounterID)
 
void update_encounters_neutral (void)
 
void draw_encounters_neutral (void)
 
void update_encounters_pre_battle (void)
 
void draw_encounters_pre_battle (void)
 
void show_first_strike_message (void)
 
void update_encounters_post_battle (void)
 
void draw_encounters_post_battle (void)
 
void update_encounters_conversation (void)
 
void draw_encounters_conversation (void)
 
bool check_conversation_trigger (void)
 
void create_encounters (void)
 
void init_encounters_ui (void)
 
s32 is_starting_conversation (void)
 

Variables

bool D_80077C40 = false
 
bool EncounterStateChanged
 
EvtScript EVS_MerleeDropCoins
 
EvtScript EVS_NpcDefeat
 
EvtScript EVS_FleeBattleDrops
 
EnemyDrops DefaultEnemyDrops
 
EvtScript EnemyNpcHit
 
EvtScript EnemyNpcDefeat
 
s32 gEncounterState
 
s32 gEncounterSubState
 
EncounterStatus gCurrentEncounter
 
s8 HasPreBattleSongPushed
 
s8 PendingPartnerAbilityResume
 
s8 LastBattleStartedBySpin
 
s16 gFirstStrikeMessagePos
 
BSS s32 WorldMerleeEffectsTime
 
BSS f32 WorldMerleeBasePosY
 
BSS EffectInstance * WorldMerleeOrbEffect
 
BSS EffectInstance * WorldMerleeWaveEffect
 
BSS Evt * MerleeDropCoinsEvt
 
BSS s32 MerleeDropCoinsEvtID
 
BSS s16 WorldMerleeEffectsState
 

Enumeration Type Documentation

◆ anonymous enum

Enumerator
MERLEE_EFFECTS_HOLD 
MERLEE_EFFECTS_RELEASE 
MERLEE_EFFECTS_DISMISS 

Function Documentation

◆ check_conversation_trigger()

bool check_conversation_trigger ( void )

◆ create_encounters()

void create_encounters ( void )

Referenced by update_encounters().

◆ draw_encounters_conversation()

void draw_encounters_conversation ( void )

Referenced by draw_encounter_ui().

◆ draw_encounters_neutral()

void draw_encounters_neutral ( void )

Referenced by draw_encounter_ui().

◆ draw_encounters_post_battle()

void draw_encounters_post_battle ( void )

Referenced by draw_encounter_ui().

◆ draw_encounters_pre_battle()

void draw_encounters_pre_battle ( void )

Referenced by draw_encounter_ui().

◆ get_coin_drop_amount()

s32 get_coin_drop_amount ( Enemy * enemy)

◆ get_defeated()

s32 get_defeated ( s32 mapID,
s32 encounterID )

Referenced by create_encounters().

◆ init_encounters_ui()

void init_encounters_ui ( void )

Referenced by draw_encounter_ui().

◆ is_starting_conversation()

◆ partner_handle_after_battle()

void partner_handle_after_battle ( void )

◆ set_battle_formation()

void set_battle_formation ( Battle * battle)

◆ set_defeated()

void set_defeated ( s32 mapID,
s32 encounterID )

◆ setup_status_bar_for_world()

void setup_status_bar_for_world ( void )

◆ show_first_strike_message()

void show_first_strike_message ( void )

Referenced by draw_first_strike_ui().

◆ update_encounters_conversation()

void update_encounters_conversation ( void )

Referenced by update_encounters().

◆ update_encounters_neutral()

void update_encounters_neutral ( void )

Referenced by update_encounters().

◆ update_encounters_post_battle()

void update_encounters_post_battle ( void )

Referenced by update_encounters().

◆ update_encounters_pre_battle()

void update_encounters_pre_battle ( void )

Referenced by update_encounters().

Variable Documentation

◆ D_80077C40

◆ DefaultEnemyDrops

EnemyDrops DefaultEnemyDrops

Referenced by create_encounters().

◆ EncounterStateChanged

◆ EnemyNpcDefeat

EvtScript EnemyNpcDefeat
Initial value:
= {
}
@ ENEMY_FLAG_FLED
Definition enums.h:4549
@ NPC_SELF
Definition enums.h:2515
@ OUTCOME_ENEMY_FLED
Definition enums.h:1934
@ OUTCOME_PLAYER_WON
Definition enums.h:1931
@ OUTCOME_PLAYER_FLED
Definition enums.h:1933
@ true
Definition macros.h:552
ApiStatus OnPlayerFled(Evt *script, bool isInitialCall)
ApiStatus SetEnemyFlagBits(Evt *script, bool isInitialCall)
ApiStatus DoNpcDefeat(Evt *script, bool isInitialCall)
ApiStatus GetBattleOutcome(Evt *script, bool isInitialCall)
ApiStatus SetNpcRotation(Evt *script, bool isInitialCall)
ApiStatus RemoveNpc(Evt *script, bool isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:355
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:363
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:257
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:406
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:620
#define LVar0
Definition macros.h:176
#define Return
Kills the current EVT thread.
Definition macros.h:261

◆ EnemyNpcHit

EvtScript EnemyNpcHit
Initial value:
= {
IfEq(LVar0, 0)
Set(LVarA, 0)
Loop(30)
Add(LVarA, 40)
Wait(1)
}
@ ENEMY_ANIM_INDEX_HIT
Definition enums.h:3470
@ ENCOUNTER_TRIGGER_JUMP
Definition enums.h:269
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ ENCOUNTER_TRIGGER_NONE
Definition enums.h:268
@ ENCOUNTER_TRIGGER_PARTNER
Definition enums.h:273
@ ENCOUNTER_TRIGGER_SPIN
Definition enums.h:270
EvtScript EVS_NpcHitRecoil
Definition 38F00.c:13
ApiStatus func_800458CC(Evt *script, bool isInitialCall)
ApiStatus GetSelfAnimationFromTable(Evt *script, bool isInitialCall)
ApiStatus GetOwnerEncounterTrigger(Evt *script, bool isInitialCall)
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:409
#define Add(VAR, INT_VALUE)
Definition macros.h:420
#define EndLoop
Marks the end of a loop.
Definition macros.h:292
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:396
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:385
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:342
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:519
#define Thread
Marks the start of a thread block.
Definition macros.h:588
#define EndThread
Marks the end of a thread block.
Definition macros.h:591
#define LVarA
Definition macros.h:186
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:298
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:313
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:289

◆ EVS_FleeBattleDrops

EvtScript EVS_FleeBattleDrops
Initial value:
= {
}
ApiStatus OnFleeBattleDrops(Evt *script, bool isInitialCall)

Referenced by update_encounters_post_battle().

◆ EVS_MerleeDropCoins

EvtScript EVS_MerleeDropCoins

◆ EVS_NpcDefeat

EvtScript EVS_NpcDefeat
Initial value:
= {
}
@ OUTCOME_PLAYER_LOST
Definition enums.h:1932
ApiStatus OnDefeatEnemy(Evt *script, bool isInitialCall)

Referenced by update_encounters_post_battle().

◆ gCurrentEncounter

◆ gEncounterState

◆ gEncounterSubState

◆ gFirstStrikeMessagePos

s16 gFirstStrikeMessagePos

◆ HasPreBattleSongPushed

s8 HasPreBattleSongPushed

◆ LastBattleStartedBySpin

s8 LastBattleStartedBySpin

◆ MerleeDropCoinsEvt

BSS Evt* MerleeDropCoinsEvt

◆ MerleeDropCoinsEvtID

BSS s32 MerleeDropCoinsEvtID

◆ PendingPartnerAbilityResume

s8 PendingPartnerAbilityResume

◆ WorldMerleeBasePosY

BSS f32 WorldMerleeBasePosY

◆ WorldMerleeEffectsState

BSS s16 WorldMerleeEffectsState

◆ WorldMerleeEffectsTime

BSS s32 WorldMerleeEffectsTime

◆ WorldMerleeOrbEffect

BSS EffectInstance* WorldMerleeOrbEffect

◆ WorldMerleeWaveEffect

BSS EffectInstance* WorldMerleeWaveEffect