monty mole AI + various enums (#694)

* monty mole AI pt 1

* monty mole AI #2

* enum values for evt priority and flags

* enemy ai flags

* done monty mole + partner enums

* removed union for partner action state

* missed parter action states + cam move flags + entity collision bit

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2022-04-17 11:36:37 -04:00 committed by GitHub
parent 0ef8c71bdb
commit cfe089af10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
181 changed files with 1309 additions and 2469 deletions

View File

@ -1703,7 +1703,7 @@ typedef struct CollisionStatus {
/* 0x04 */ s16 lastTouchedFloor; /* valid after jump */ /* 0x04 */ s16 lastTouchedFloor; /* valid after jump */
/* 0x06 */ s16 floorBelow; /* 0x06 */ s16 floorBelow;
/* 0x08 */ s16 currentCeiling; /* valid on touching with head */ /* 0x08 */ s16 currentCeiling; /* valid on touching with head */
/* 0x0A */ s16 unk_0A; /* associated with TRIGGER_WALL_PRESS_A */ /* 0x0A */ s16 currentInspect; /* associated with TRIGGER_WALL_PRESS_A */
/* 0x0C */ s16 unk_0C; /* associated with TRIGGER_FLAGS_2000 */ /* 0x0C */ s16 unk_0C; /* associated with TRIGGER_FLAGS_2000 */
/* 0x0E */ s16 unk_0E; /* associated with TRIGGER_FLAGS_4000 */ /* 0x0E */ s16 unk_0E; /* associated with TRIGGER_FLAGS_4000 */
/* 0x10 */ s16 unk_10; /* associated with TRIGGER_FLAGS_8000 */ /* 0x10 */ s16 unk_10; /* associated with TRIGGER_FLAGS_8000 */
@ -2315,10 +2315,10 @@ typedef struct TweesterPhysics {
} TweesterPhysics; // size = 0x1C } TweesterPhysics; // size = 0x1C
typedef struct PartnerActionStatus { typedef struct PartnerActionStatus {
/* 0x000 */ union { /* 0x000 */ s8 partnerActionState;
/* */ s32 i; /* 0x001 */ s8 partnerAction_unk_1;
/* */ s8 b[4]; /* 0x002 */ s8 partnerAction_unk_2;
} actionState; /* 0x003 */ s8 actingPartner;
/* 0x004 */ s16 stickX; /* 0x004 */ s16 stickX;
/* 0x006 */ s16 stickY; /* 0x006 */ s16 stickY;
/* 0x008 */ s32 currentButtons; /* 0x008 */ s32 currentButtons;

View File

@ -586,6 +586,7 @@ enum SoundIDs {
SOUND_DAYZEE_SONG = 0x000002D7, SOUND_DAYZEE_SONG = 0x000002D7,
SOUND_POWER_UP = 0x000002D8, SOUND_POWER_UP = 0x000002D8,
SOUND_2F1 = 0x000002F1, SOUND_2F1 = 0x000002F1,
SOUND_2F4 = 0x000002F4,
SOUND_2F6 = 0x000002F6, SOUND_2F6 = 0x000002F6,
SOUND_2F7 = 0x000002F7, SOUND_2F7 = 0x000002F7,
SOUND_CLOSE_SHELL = 0x000002FF, SOUND_CLOSE_SHELL = 0x000002FF,
@ -1868,6 +1869,18 @@ enum PartnerIDs {
PARTNER_TWINK = 0x0000000B, PARTNER_TWINK = 0x0000000B,
}; };
enum PartnerActions {
PARTNER_ACTION_NONE = 0, // genetic state
PARTNER_ACTION_USE = 1, // generic state
PARTNER_ACTION_KOOPER_1 = 1,
PARTNER_ACTION_KOOPER_2 = 2,
PARTNER_ACTION_BOMBETTE_1 = 1,
PARTNER_ACTION_BOMBETTE_2 = 2,
PARTNER_ACTION_PARAKARRY_HOVER = 1,
PARTNER_ACTION_WATT_SHINE = 1,
PARTNER_ACTION_LAKILESTER_1 = 1,
};
/// @see gAreas /// @see gAreas
enum Areas { enum Areas {
AREA_KMR, AREA_KMR,
@ -1908,7 +1921,6 @@ enum NpcPalSwapState {
}; };
enum NpcFlags { enum NpcFlags {
NPC_FLAG_0 = 0x00000000,
NPC_FLAG_PASSIVE = 0x00000001, ///< Collision does not trigger battle NPC_FLAG_PASSIVE = 0x00000001, ///< Collision does not trigger battle
NPC_FLAG_2 = 0x00000002, NPC_FLAG_2 = 0x00000002,
NPC_FLAG_4 = 0x00000004, NPC_FLAG_4 = 0x00000004,
@ -2729,6 +2741,18 @@ enum EnemyFlags {
ENEMY_FLAGS_80000000 = 0x80000000, ENEMY_FLAGS_80000000 = 0x80000000,
}; };
// used with enemy->unk_B0
enum EnemyAIFlags {
ENEMY_AI_FLAGS_1 = 0x00000001,
ENEMY_AI_FLAGS_2 = 0x00000002,
ENEMY_AI_FLAGS_4 = 0x00000004,
ENEMY_AI_FLAGS_8 = 0x00000008,
ENEMY_AI_FLAGS_10 = 0x00000010,
ENEMY_AI_FLAGS_20 = 0x00000020,
ENEMY_AI_FLAGS_40 = 0x00000040,
ENEMY_AI_FLAGS_80 = 0x00000080,
};
enum MusicSettingsFlags { enum MusicSettingsFlags {
MUSIC_SETTINGS_FLAGS_1 = 0x00000001, MUSIC_SETTINGS_FLAGS_1 = 0x00000001,
MUSIC_SETTINGS_FLAGS_2 = 0x00000002, MUSIC_SETTINGS_FLAGS_2 = 0x00000002,
@ -2869,6 +2893,12 @@ enum CameraFlags {
CAMERA_FLAGS_80000000 = 0x80000000, CAMERA_FLAGS_80000000 = 0x80000000,
}; };
enum CameraMoveFlags {
CAMERA_MOVE_FLAGS_1 = 0x00000001,
CAMERA_MOVE_FLAGS_2 = 0x00000002,
CAMERA_MOVE_FLAGS_4 = 0x00000004
};
enum CameraSettingsType { enum CameraSettingsType {
CAMERA_SETTINGS_TYPE_0 = 0, CAMERA_SETTINGS_TYPE_0 = 0,
CAMERA_SETTINGS_TYPE_1 = 1, CAMERA_SETTINGS_TYPE_1 = 1,

View File

@ -139,11 +139,30 @@ typedef s32 ApiStatus;
#define ApiStatus_REPEAT 3 /* Call again immediately */ #define ApiStatus_REPEAT 3 /* Call again immediately */
#define ApiStatus_FINISH 255 /* Corresponds to EVT_FINISH */ #define ApiStatus_FINISH 255 /* Corresponds to EVT_FINISH */
typedef enum EventGroup { enum EventGroupFlags {
EVT_GROUP_0 = 0x00, EVT_GROUP_00 = 0x00,
EVT_GROUP_B = 0x0B, EVT_GROUP_0B = 0x0B, // 8 | 4 | 1
EVT_GROUP_1B = 0x1B, EVT_GROUP_1B = 0x1B, // 10 | 8 | 4 | 1
EVT_GROUP_EF = 0xEF EVT_GROUP_EF = 0xEF, // ~10
} EventGroup; EVT_GROUP_01 = 0x01,
EVT_GROUP_02 = 0x02,
EVT_GROUP_04 = 0x04,
EVT_GROUP_08 = 0x08,
EVT_GROUP_10 = 0x10,
};
enum EventPriority {
EVT_PRIORITY_0 = 0x00, // map main script
EVT_PRIORITY_1 = 0x01,
EVT_PRIORITY_A = 0x0A,
EVT_PRIORITY_14 = 0x14,
};
enum EventStateFlags {
EVT_FLAG_01 = 0x01,
EVT_FLAG_10 = 0x10, // has child?
EVT_FLAG_20 = 0x20, // add to global script list
EVT_FLAG_40 = 0x40, // thread?
};
#endif #endif

View File

@ -230,6 +230,9 @@ typedef union {
char PADDING[0xC0]; char PADDING[0xC0];
} EnemyTerritory; // size = 0xC0 } EnemyTerritory; // size = 0xC0
// function signature used for state handlers in AI main functions
typedef void AIStateHandler(Evt* script, NpcAISettings* settings, EnemyTerritoryThing* territory);
typedef struct Enemy { typedef struct Enemy {
/* 0x00 */ s32 flags; /* 0x00 */ s32 flags;
/* 0x04 */ s8 encounterIndex; /* 0x04 */ s8 encounterIndex;
@ -268,7 +271,7 @@ typedef struct Enemy {
/* */ }; /* */ };
/* 0xAC */ u8 unk_AC; /* 0xAC */ u8 unk_AC;
/* 0xAD */ char unk_AD[3]; /* 0xAD */ char unk_AD[3];
/* 0xB0 */ s32 unk_B0; /* 0xB0 */ u32 unk_B0;
/* 0xB4 */ s8 unk_B4; /* 0xB4 */ s8 unk_B4;
/* 0xB5 */ s8 unk_B5; /* 0xB5 */ s8 unk_B5;
/* 0xB6 */ char unk_B6[2]; /* 0xB6 */ char unk_B6[2];

View File

@ -734,7 +734,7 @@ void filemenu_main_handle_input(MenuPanel* menu) {
} }
} }
if (filemenu_pressedButtons & 0x4000) { if (filemenu_pressedButtons & BUTTON_B) {
switch (menu->page) { switch (menu->page) {
case 0: case 0:
filemenu_set_selected(menu, 2, 2); filemenu_set_selected(menu, 2, 2);

View File

@ -252,7 +252,7 @@ void btl_state_update_victory(void) {
D_8029F254 = 1; D_8029F254 = 1;
} }
battleStatus->battlePhase = PHASE_ENEMY_BEGIN; battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
script = start_script(partner->onTurnChanceScriptSource, 0xA, 0); script = start_script(partner->onTurnChanceScriptSource, EVT_PRIORITY_A, 0);
partner->onTurnChangeScript = script; partner->onTurnChangeScript = script;
partner->onTurnChangeID = script->id; partner->onTurnChangeID = script->id;
script->owner1.enemyID = 0x100; script->owner1.enemyID = 0x100;
@ -378,7 +378,7 @@ void btl_state_update_victory(void) {
playerData->merleeCastsLeft++; playerData->merleeCastsLeft++;
} else { } else {
battleStatus->battlePhase = PHASE_MERLEE_EXP_BONUS; battleStatus->battlePhase = PHASE_MERLEE_EXP_BONUS;
script = start_script(PlayerScriptDispatcher, 0xA, 0); script = start_script(PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnScript = script; player->takeTurnScript = script;
player->takeTurnID = script->id; player->takeTurnID = script->id;
script->owner1.enemyID = 0; script->owner1.enemyID = 0;
@ -449,7 +449,7 @@ void btl_state_update_defend(void) {
case BATTLE_STATE2_UNK_0: case BATTLE_STATE2_UNK_0:
gBattleStatus.unk_8C = 0; gBattleStatus.unk_8C = 0;
gBattleStatus.battlePhase = PHASE_USE_DEFEND; gBattleStatus.battlePhase = PHASE_USE_DEFEND;
player->takeTurnScript = script = start_script(PlayerScriptDispatcher, 10, 0); player->takeTurnScript = script = start_script(PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnID = script->id; player->takeTurnID = script->id;
gBattleState2 = BATTLE_STATE2_UNK_1; gBattleState2 = BATTLE_STATE2_UNK_1;
script->owner1.enemyID = 0; script->owner1.enemyID = 0;
@ -503,13 +503,13 @@ void btl_state_update_defeat(void) {
func_8024E40C(0x19); func_8024E40C(0x19);
btl_cam_target_actor(0); btl_cam_target_actor(0);
battleStatus->battlePhase = PHASE_RUN_AWAY_RESET; battleStatus->battlePhase = PHASE_RUN_AWAY_RESET;
script = start_script(PlayerScriptDispatcher, 0xA, 0); script = start_script(PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnScript = script; player->takeTurnScript = script;
player->takeTurnID = script->id; player->takeTurnID = script->id;
script->owner1.enemyID = 0; script->owner1.enemyID = 0;
if (partner != NULL) { if (partner != NULL) {
script = start_script(partner->takeTurnScriptSource, 0xA, 0); script = start_script(partner->takeTurnScriptSource, EVT_PRIORITY_A, 0);
partner->takeTurnScript = script; partner->takeTurnScript = script;
partner->takeTurnID = script->id; partner->takeTurnID = script->id;
script->owner1.enemyID = 0x100; script->owner1.enemyID = 0x100;
@ -520,7 +520,7 @@ void btl_state_update_defeat(void) {
if (!does_script_exist(player->takeTurnID) && battleStatus->unk_8C == 0) { if (!does_script_exist(player->takeTurnID) && battleStatus->unk_8C == 0) {
if (find_item(ITEM_LIFE_SHROOM) >= 0) { if (find_item(ITEM_LIFE_SHROOM) >= 0) {
battleStatus->battlePhase = PHASE_USE_LIFE_SHROOM; battleStatus->battlePhase = PHASE_USE_LIFE_SHROOM;
script = start_script(PlayerScriptDispatcher, 0xA, 0); script = start_script(PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnScript = script; player->takeTurnScript = script;
player->takeTurnID = script->id; player->takeTurnID = script->id;
script->owner1.enemyID = 0; script->owner1.enemyID = 0;
@ -599,7 +599,7 @@ void btl_state_update_change_partner(void) {
break; break;
} }
deduct_current_move_fp(); deduct_current_move_fp();
script = start_script(BtlPutPartnerAway, 0xA, 0); script = start_script(BtlPutPartnerAway, EVT_PRIORITY_A, 0);
battleStatus->controlScript = script; battleStatus->controlScript = script;
battleStatus->controlScriptID = script->id; battleStatus->controlScriptID = script->id;
script->owner1.enemyID = 0x100; script->owner1.enemyID = 0x100;
@ -636,7 +636,7 @@ void btl_state_update_change_partner(void) {
} }
} }
script = start_script(BtlBringPartnerOut, 0xA, 0); script = start_script(BtlBringPartnerOut, EVT_PRIORITY_A, 0);
battleStatus->controlScript = script; battleStatus->controlScript = script;
battleStatus->controlScriptID = script->id; battleStatus->controlScriptID = script->id;
script->owner1.enemyID = 0x100; script->owner1.enemyID = 0x100;
@ -648,7 +648,7 @@ void btl_state_update_change_partner(void) {
if (partner != NULL) { if (partner != NULL) {
if (partner->onTurnChanceScriptSource != NULL) { if (partner->onTurnChanceScriptSource != NULL) {
battleStatus->battlePhase = PHASE_PLAYER_BEGIN; battleStatus->battlePhase = PHASE_PLAYER_BEGIN;
script = start_script(partner->onTurnChanceScriptSource, 0xA, 0); script = start_script(partner->onTurnChanceScriptSource, EVT_PRIORITY_A, 0);
partner->onTurnChangeScript = script; partner->onTurnChangeScript = script;
partner->onTurnChangeID = script->id; partner->onTurnChangeID = script->id;
script->owner1.enemyID = 0x100; script->owner1.enemyID = 0x100;
@ -756,7 +756,7 @@ void btl_state_update_partner_move(void) {
reset_actor_turn_info(); reset_actor_turn_info();
reset_all_actor_sounds(partner); reset_all_actor_sounds(partner);
battleStatus->battlePhase = PHASE_EXECUTE_ACTION; battleStatus->battlePhase = PHASE_EXECUTE_ACTION;
script = start_script(partner->takeTurnScriptSource, 0xA, 0); script = start_script(partner->takeTurnScriptSource, EVT_PRIORITY_A, 0);
partner->takeTurnScript = script; partner->takeTurnScript = script;
partner->takeTurnID = script->id; partner->takeTurnID = script->id;
script->owner1.enemyID = 0x100; script->owner1.enemyID = 0x100;
@ -813,7 +813,7 @@ void btl_state_update_partner_move(void) {
break; break;
} }
decrement_status_menu_disabled(); decrement_status_menu_disabled();
if (playerData->currentPartner == 1 && battleStatus->moveCategory == 5 if (playerData->currentPartner == PARTNER_GOOMBARIO && battleStatus->moveCategory == 5
&& battleStatus->selectedMoveID != MOVE_CHARGE) { && battleStatus->selectedMoveID != MOVE_CHARGE) {
partner->isGlowing = 0; partner->isGlowing = 0;
gBattleStatus.flags1 &= ~BS_FLAGS1_40000000; gBattleStatus.flags1 &= ~BS_FLAGS1_40000000;

View File

@ -419,7 +419,7 @@ void btl_update(void) {
set_screen_overlay_color(1, 0, 0, 0); set_screen_overlay_color(1, 0, 0, 0);
if (partner == NULL) { if (partner == NULL) {
set_screen_overlay_params_back(0, 215.0f); set_screen_overlay_params_back(0, 215.0f);
} else if (playerData->currentPartner == 6) { } else if (playerData->currentPartner == PARTNER_WATT) {
paramAmount -= 10.0f; paramAmount -= 10.0f;
if (paramAmount < 0.0f) { if (paramAmount < 0.0f) {
paramAmount = 0.0f; paramAmount = 0.0f;

View File

@ -1324,7 +1324,7 @@ void btl_cam_use_preset(s32 id) {
} }
BattleCam_ControlScript = preset; BattleCam_ControlScript = preset;
newScript = start_script(preset, 0xA, 0x20); newScript = start_script(preset, EVT_PRIORITY_A, EVT_FLAG_20);
BattleCam_DoneMoving = FALSE; BattleCam_DoneMoving = FALSE;
battleStatus->camMovementScript = newScript; battleStatus->camMovementScript = newScript;
battleStatus->camMovementScriptID = newScript->id; battleStatus->camMovementScriptID = newScript->id;

View File

@ -456,42 +456,42 @@ s32 calc_item_damage_enemy(void) {
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && wasStatusInflicted) {
script = start_script(DoSleepHit, 0xA, 0); script = start_script(DoSleepHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && wasStatusInflicted) {
script = start_script(DoDizzyHit, 0xA, 0); script = start_script(DoDizzyHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && wasStatusInflicted) {
script = start_script(DoParalyzeHit, 0xA, 0); script = start_script(DoParalyzeHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && wasStatusInflicted) {
script = start_script(DoPoisonHit, 0xA, 0); script = start_script(DoPoisonHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && wasStatusInflicted) {
script = start_script(DoStopHit, 0xA, 0); script = start_script(DoStopHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && wasStatusInflicted) {
script = start_script(DoFreezeHit, 0xA, 0); script = start_script(DoFreezeHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
@ -499,7 +499,7 @@ s32 calc_item_damage_enemy(void) {
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && wasStatusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && wasStatusInflicted) {
script = start_script(DoShrinkHit, 0xA, 0); script = start_script(DoShrinkHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;

View File

@ -184,7 +184,7 @@ void btl_state_update_celebration(void) {
D_8029FB4C--; D_8029FB4C--;
} else if (func_8024E584() != 0) { } else if (func_8024E584() != 0) {
dma_copy(_7A89A0_ROM_START, _7A89A0_ROM_END, _7A89A0_VRAM); dma_copy(_7A89A0_ROM_START, _7A89A0_ROM_END, _7A89A0_VRAM);
script = start_script(&D_802842B0, 0xA, 0); script = start_script(&D_802842B0, EVT_PRIORITY_A, 0);
D_8029FB78 = 0; D_8029FB78 = 0;
D_8029FB54 = 20; D_8029FB54 = 20;
D_8029FB70 = D_8029FB6C / D_8029FB54; D_8029FB70 = D_8029FB6C / D_8029FB54;
@ -230,12 +230,12 @@ void btl_state_update_celebration(void) {
partner->flags &= ~(ACTOR_FLAG_4000000 | ACTOR_FLAG_8000000); partner->flags &= ~(ACTOR_FLAG_4000000 | ACTOR_FLAG_8000000);
} }
battleStatus->battlePhase = 5; battleStatus->battlePhase = 5;
script = start_script(&PlayerScriptDispatcher, 0xA, 0); script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnScript = script; player->takeTurnScript = script;
player->takeTurnID = script->id; player->takeTurnID = script->id;
script->owner1.actorID = ACTOR_PLAYER; script->owner1.actorID = ACTOR_PLAYER;
if (partner != NULL) { if (partner != NULL) {
script = start_script(partner->takeTurnScriptSource, 0xA, 0); script = start_script(partner->takeTurnScriptSource, EVT_PRIORITY_A, 0);
partner->takeTurnScript = script; partner->takeTurnScript = script;
partner->takeTurnID = script->id; partner->takeTurnID = script->id;
script->owner1.actorID = ACTOR_PARTNER; script->owner1.actorID = ACTOR_PARTNER;
@ -273,7 +273,7 @@ void btl_state_update_celebration(void) {
} }
break; break;
case BATTLE_STATE2_UNK_5: case BATTLE_STATE2_UNK_5:
D_8029FB7C = start_script(&D_80284880, 0xA, 0); D_8029FB7C = start_script(&D_80284880, EVT_PRIORITY_A, 0);
D_8029FB4C = 25; D_8029FB4C = 25;
gBattleState2 = BATTLE_STATE2_UNK_6; gBattleState2 = BATTLE_STATE2_UNK_6;
D_8029FB80 = D_8029FB7C->id; D_8029FB80 = D_8029FB7C->id;
@ -700,7 +700,7 @@ void btl_state_update_celebration(void) {
set_animation(0, 0, 0x30009); set_animation(0, 0, 0x30009);
if (partner != NULL) { if (partner != NULL) {
script = start_script(partner->takeTurnScriptSource, 0xA, 0); script = start_script(partner->takeTurnScriptSource, EVT_PRIORITY_A, 0);
partner->takeTurnScript = script; partner->takeTurnScript = script;
partner->takeTurnID = script->id; partner->takeTurnID = script->id;
script->owner1.actorID = ACTOR_PARTNER; script->owner1.actorID = ACTOR_PARTNER;

View File

@ -2321,7 +2321,7 @@ void load_partner_actor(void) {
partnerActor->debuffIcon = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0); partnerActor->debuffIcon = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
partnerActor->unk_228 = NULL; partnerActor->unk_228 = NULL;
takeTurnScript = start_script(partnerActor->takeTurnScriptSource, 10, 0); takeTurnScript = start_script(partnerActor->takeTurnScriptSource, EVT_PRIORITY_A, 0);
partnerActor->takeTurnID = takeTurnScript->id; partnerActor->takeTurnID = takeTurnScript->id;
takeTurnScript->owner1.actorID = ACTOR_PARTNER; takeTurnScript->owner1.actorID = ACTOR_PARTNER;
} }
@ -2584,7 +2584,7 @@ Actor* create_actor(Formation formation) {
actor->hpFraction = 25; actor->hpFraction = 25;
actor->actorID = actor->enemyIndex | 0x200; actor->actorID = actor->enemyIndex | 0x200;
takeTurnScript = start_script(actor->takeTurnScriptSource, 0xA, 0); takeTurnScript = start_script(actor->takeTurnScriptSource, EVT_PRIORITY_A, 0);
actor->takeTurnID = takeTurnScript->id; actor->takeTurnID = takeTurnScript->id;
takeTurnScript->owner1.enemyID = actor->enemyIndex | 0x200; takeTurnScript->owner1.enemyID = actor->enemyIndex | 0x200;
actor->shadow.id = create_shadow_type(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); actor->shadow.id = create_shadow_type(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
@ -3663,29 +3663,29 @@ void start_rumble_type(u32 arg0) {
case 0: case 0:
break; break;
case 1: case 1:
D_802939C0 = start_script(&D_802939C4, 0xA, 0x20)->id; D_802939C0 = start_script(&D_802939C4, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
case 2: case 2:
D_802939C0 = start_script(&D_80293A10, 0xA, 0x20)->id; D_802939C0 = start_script(&D_80293A10, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
case 3: case 3:
D_802939C0 = start_script(&D_80293A34, 0xA, 0x20)->id; D_802939C0 = start_script(&D_80293A34, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
case 4: case 4:
D_802939C0 = start_script(&D_80293A58, 0xA, 0x20)->id; D_802939C0 = start_script(&D_80293A58, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
case 5: case 5:
D_802939C0 = start_script(&D_80293A7C, 0xA, 0x20)->id; D_802939C0 = start_script(&D_80293A7C, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
case 6: case 6:
D_802939C0 = start_script(&D_80293AA0, 0xA, 0x20)->id; D_802939C0 = start_script(&D_80293AA0, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
case 7: case 7:
case 8: case 8:
case 9: case 9:
case 10: case 10:
case 11: case 11:
D_802939C0 = start_script(&D_80293AC4, 0xA, 0x20)->id; D_802939C0 = start_script(&D_80293AC4, EVT_PRIORITY_A, EVT_FLAG_20)->id;
break; break;
} }
} }

View File

@ -137,7 +137,7 @@ void dispatch_event_player(s32 eventType) {
oldOnHitScript = player->onHitScript; oldOnHitScript = player->onHitScript;
oldOnHitID = player->onHitID; oldOnHitID = player->onHitID;
eventScript = start_script(&HandleEvent_Player, 10, 0x20); eventScript = start_script(&HandleEvent_Player, EVT_PRIORITY_A, EVT_FLAG_20);
player->onHitScript = eventScript; player->onHitScript = eventScript;
player->onHitID = eventScript->id; player->onHitID = eventScript->id;
eventScript->owner1.actor = NULL; eventScript->owner1.actor = NULL;
@ -163,7 +163,7 @@ void dispatch_event_player_continue_turn(s32 eventType) {
oldOnHitScript = player->onHitScript; oldOnHitScript = player->onHitScript;
oldOnHitID = player->onHitID; oldOnHitID = player->onHitID;
eventScript = start_script(&HandleEvent_Player, 10, 0x20); eventScript = start_script(&HandleEvent_Player, EVT_PRIORITY_A, EVT_FLAG_20);
player->onHitScript = eventScript; player->onHitScript = eventScript;
player->onHitID = eventScript->id; player->onHitID = eventScript->id;
eventScript->owner1.actor = NULL; eventScript->owner1.actor = NULL;

View File

@ -110,7 +110,7 @@ void dispatch_event_actor(Actor* actor, s32 event) {
Evt* newScript; Evt* newScript;
actor->lastEventType = event; actor->lastEventType = event;
newScript = start_script(actor->onHitScriptSource, 0xA, 0x20); newScript = start_script(actor->onHitScriptSource, EVT_PRIORITY_A, EVT_FLAG_20);
actor->onHitScript = newScript; actor->onHitScript = newScript;
actor->onHitID = newScript->id; actor->onHitID = newScript->id;
newScript->owner1.actorID = actor->actorID; newScript->owner1.actorID = actor->actorID;
@ -719,42 +719,42 @@ s32 calc_enemy_damage_target(Actor* attacker) {
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && statusInflicted) {
script = start_script(&DoSleepHit, 10, 0); script = start_script(&DoSleepHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && statusInflicted) {
script = start_script(&DoDizzyHit, 10, 0); script = start_script(&DoDizzyHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && statusInflicted) {
script = start_script(&DoParalyzeHit, 10, 0); script = start_script(&DoParalyzeHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && statusInflicted) {
script = start_script(&DoPoisonHit, 10, 0); script = start_script(&DoPoisonHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && statusInflicted) {
script = start_script(&DoStopHit, 10, 0); script = start_script(&DoStopHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && statusInflicted) {
script = start_script(&DoFreezeHit, 10, 0); script = start_script(&DoFreezeHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
@ -762,7 +762,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z); sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} }
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && statusInflicted) { if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && statusInflicted) {
script = start_script(&DoShrinkHit, 10, 0); script = start_script(&DoShrinkHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x; script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y; script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z; script->varTable[2] = state->goalPos.z;
@ -939,7 +939,7 @@ ApiStatus BindIdle(Evt* script, s32 isInitialCall) {
} }
actor->idleScriptSource = idleCode; actor->idleScriptSource = idleCode;
newScriptContext = start_script(idleCode, 10, 0); newScriptContext = start_script(idleCode, EVT_PRIORITY_A, 0);
actor->idleScript = newScriptContext; actor->idleScript = newScriptContext;
actor->idleScriptID = newScriptContext->id; actor->idleScriptID = newScriptContext->id;
newScriptContext->owner1.actorID = actorID; newScriptContext->owner1.actorID = actorID;

View File

@ -10,7 +10,7 @@ void dispatch_event_partner(s32 lastEventType) {
Evt* script; Evt* script;
partnerActor->lastEventType = lastEventType; partnerActor->lastEventType = lastEventType;
script = start_script(partnerActor->onHitScriptSource, 10, 0x20); script = start_script(partnerActor->onHitScriptSource, EVT_PRIORITY_A, EVT_FLAG_20);
partnerActor->onHitScript = script; partnerActor->onHitScript = script;
partnerActor->onHitID = script->id; partnerActor->onHitID = script->id;
script->owner1.actorID = ACTOR_PARTNER; script->owner1.actorID = ACTOR_PARTNER;
@ -33,7 +33,7 @@ void dispatch_event_partner_continue_turn(s8 lastEventType) {
Evt* script; Evt* script;
partnerActor->lastEventType = lastEventType; partnerActor->lastEventType = lastEventType;
script = start_script(partnerActor->onHitScriptSource, 10, 0x20); script = start_script(partnerActor->onHitScriptSource, EVT_PRIORITY_A, EVT_FLAG_20);
partnerActor->onHitScript = script; partnerActor->onHitScript = script;
partnerActor->onHitID = script->id; partnerActor->onHitID = script->id;
script->owner1.actorID = ACTOR_PARTNER; script->owner1.actorID = ACTOR_PARTNER;

View File

@ -705,7 +705,7 @@ s32 check_conversation_trigger(void) {
playerY = playerStatus->position.y; playerY = playerStatus->position.y;
playerZ = playerStatus->position.z; playerZ = playerStatus->position.z;
if (gPartnerActionStatus.actionState.b[0] != 0) { if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) {
return FALSE; return FALSE;
} }

View File

@ -65,7 +65,7 @@ void func_80048E34(Enemy* enemy, s32 arg1, s32 arg2) {
if (enemy->aiBytecode != NULL) { if (enemy->aiBytecode != NULL) {
enemy->unk_C8 = arg2; enemy->unk_C8 = arg2;
newScript = start_script(enemy->aiBytecode, 10, 0x20); newScript = start_script(enemy->aiBytecode, EVT_PRIORITY_A, EVT_FLAG_20);
enemy->aiScript = newScript; enemy->aiScript = newScript;
enemy->aiScriptID = newScript->id; enemy->aiScriptID = newScript->id;
newScript->owner2.npcID = enemy->npcID; newScript->owner2.npcID = enemy->npcID;
@ -74,7 +74,7 @@ void func_80048E34(Enemy* enemy, s32 arg1, s32 arg2) {
if (enemy->unk_B8 != NULL) { if (enemy->unk_B8 != NULL) {
enemy->unk_C4 = arg1; enemy->unk_C4 = arg1;
newScript = start_script(enemy->unk_B8, 10, 0x20); newScript = start_script(enemy->unk_B8, EVT_PRIORITY_A, EVT_FLAG_20);
enemy->unk_BC = newScript; enemy->unk_BC = newScript;
enemy->unk_C0 = newScript->id; enemy->unk_C0 = newScript->id;
newScript->owner2.npcID = enemy->npcID; newScript->owner2.npcID = enemy->npcID;
@ -121,25 +121,24 @@ s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 c
} }
} }
s32 func_800490B4(EnemyTerritoryThing* territory, Enemy* enemy, f32 chaseSpeed, f32 arg3, s8 arg4) { s32 func_800490B4(EnemyTerritoryThing* territory, Enemy* enemy, f32 radius, f32 moveSpeed, s8 arg4) {
Npc* npc = get_npc_unsafe(enemy->npcID); Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* partnerActionStatus; PartnerActionStatus* partnerActionStatus;
f32 x, y, z; f32 x, y, z;
f32 dist; f32 dist;
s32 phi_v0; s32 phi_v0;
f32 phi_a3;
if (enemy->unk_B0 & 2) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_2) {
return FALSE; return FALSE;
} }
partnerActionStatus = &gPartnerActionStatus; partnerActionStatus = &gPartnerActionStatus;
if (partnerActionStatus->actionState.b[3] == 9 && partnerActionStatus->actionState.b[0] && !(territory->unk_1C & 1)) { if (partnerActionStatus->actingPartner == PARTNER_BOW && partnerActionStatus->partnerActionState && !(territory->unk_1C & 1)) {
return FALSE; return FALSE;
} }
if (partnerActionStatus->actionState.b[3] == 7 && partnerActionStatus->actionState.b[0] && !(territory->unk_1C & 1)) { if (partnerActionStatus->actingPartner == PARTNER_SUSHIE && partnerActionStatus->partnerActionState && !(territory->unk_1C & 1)) {
return FALSE; return FALSE;
} }
@ -155,7 +154,7 @@ s32 func_800490B4(EnemyTerritoryThing* territory, Enemy* enemy, f32 chaseSpeed,
return FALSE; return FALSE;
} }
if ((playerStatus->actionState == 0x1D)) { if ((playerStatus->actionState == ACTION_STATE_USE_SPINNING_FLOWER)) {
return FALSE; return FALSE;
} }
@ -177,22 +176,20 @@ s32 func_800490B4(EnemyTerritoryThing* territory, Enemy* enemy, f32 chaseSpeed,
if (phi_v0 == 0) { if (phi_v0 == 0) {
if (enemy->unk_AC & 2) { if (enemy->unk_AC & 2) {
if (playerStatus->actionState == 1) { if (playerStatus->actionState == ACTION_STATE_WALK) {
chaseSpeed = chaseSpeed * 1.15; radius *= 1.15;
} else if (playerStatus->actionState == 2) { } else if (playerStatus->actionState == ACTION_STATE_RUN) {
chaseSpeed = chaseSpeed * 1.3; radius *= 1.3;
} }
} }
x = npc->pos.x; x = npc->pos.x;
z = npc->pos.z; z = npc->pos.z;
if (arg4 & 0xFF) { if (arg4 & 0xFF) {
phi_a3 = npc->yaw; add_vec2D_polar(&x, &z, moveSpeed, npc->yaw);
add_vec2D_polar(&x, &z, arg3, phi_a3);
} else { } else {
phi_a3 = 270.0f - npc->renderYaw; add_vec2D_polar(&x, &z, moveSpeed, 270.0f - npc->renderYaw);
add_vec2D_polar(&x, &z, arg3, phi_a3);
} }
if (dist2D(x, z, playerStatus->position.x, playerStatus->position.z) <= chaseSpeed) { if (dist2D(x, z, playerStatus->position.x, playerStatus->position.z) <= radius) {
return TRUE; return TRUE;
} }
} }
@ -267,8 +264,8 @@ void func_800495A0(Evt* script, NpcAISettings* npcAISettings, EnemyTerritoryThin
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
} }
enemy->unk_B0 &= ~0x40; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_40;
enemy->unk_B0 &= ~0x20; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_20;
script->functionTemp[0] = 1; script->functionTemp[0] = 1;
} }
@ -290,10 +287,10 @@ void func_800496B8(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing*
yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionRadius)) { if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionRadius)) {
npc->yaw = yaw; npc->yaw = yaw;
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, SOUND_2F4, 0x200000);
fx_emote(0, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp34); fx_emote(EMOTE_EXCLAMATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp34);
enemy->unk_B0 &= ~0x40; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_40;
enemy->unk_B0 &= ~0x20; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_20;
if (enemy->npcSettings->unk_2A & 1) { if (enemy->npcSettings->unk_2A & 1) {
script->functionTemp[0] = 10; script->functionTemp[0] = 10;
@ -315,13 +312,13 @@ void func_800496B8(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing*
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeX,
enemy->territory->wander.wanderSizeZ) enemy->territory->wander.wanderSizeZ)
&& npc->moveSpeed < dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z)) { && npc->moveSpeed < dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z)) {
if (!(enemy->unk_B0 & 0x20)) { if (!(enemy->unk_B0 & ENEMY_AI_FLAGS_20)) {
enemy->unk_B0 |= 0x60; enemy->unk_B0 |= (ENEMY_AI_FLAGS_20 | ENEMY_AI_FLAGS_40);
} }
if (enemy->unk_B0 & 0x40) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_40) {
npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z)); npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z));
enemy->unk_B0 &= ~0x40; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_40;
} }
x = npc->pos.x; x = npc->pos.x;
@ -329,14 +326,14 @@ void func_800496B8(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing*
z = npc->pos.z; z = npc->pos.z;
if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, 2.0 * npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, 2.0 * npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionRadius)) {
yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z)); yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z));
enemy->unk_B0 &= ~0x40; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_40;
func_8004A784(npc, 5.0f, &yaw, NULL, NULL, NULL); func_8004A784(npc, 5.0f, &yaw, NULL, NULL, NULL);
npc->yaw = yaw; npc->yaw = yaw;
} }
phi_s5 = 1; phi_s5 = 1;
} else if (enemy->unk_B0 & 0x20) { } else if (enemy->unk_B0 & ENEMY_AI_FLAGS_20) {
enemy->unk_B0 &= ~0x20; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_20;
enemy->unk_B0 &= ~0x40; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_40;
} }
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s5) { if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s5) {
@ -377,7 +374,7 @@ void func_80049C04(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing*
if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionRadius)) { if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionRadius)) {
npc->yaw = yaw; npc->yaw = yaw;
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
fx_emote(0, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &sp34); fx_emote(EMOTE_EXCLAMATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &sp34);
if (enemy->npcSettings->unk_2A & 1) { if (enemy->npcSettings->unk_2A & 1) {
script->functionTemp[0] = 10; script->functionTemp[0] = 10;
} else { } else {
@ -479,7 +476,7 @@ void func_8004A124(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing*
f32 x, y, z; f32 x, y, z;
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
fx_emote(2, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp28); fx_emote(EMOTE_QUESTION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp28);
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
npc->duration = 20; npc->duration = 20;
script->functionTemp[0] = 14; script->functionTemp[0] = 14;
@ -492,7 +489,7 @@ void func_8004A124(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing*
y = npc->pos.y; y = npc->pos.y;
z = npc->pos.z; z = npc->pos.z;
if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) {
fx_emote(2, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &sp28); fx_emote(EMOTE_QUESTION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &sp28);
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
npc->duration = 15; npc->duration = 15;
script->functionTemp[0] = 14; script->functionTemp[0] = 14;
@ -545,7 +542,7 @@ ApiStatus DoBasicAI(Evt* script, s32 isInitialCall) {
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || enemy->unk_B0 & 4) { if (isInitialCall || enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
@ -560,14 +557,14 @@ ApiStatus DoBasicAI(Evt* script, s32 isInitialCall) {
npc->flags |= NPC_FLAG_ENABLE_HIT_SCRIPT; npc->flags |= NPC_FLAG_ENABLE_HIT_SCRIPT;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
} else if (enemy->flags & ENEMY_FLAGS_40000000) { } else if (enemy->flags & ENEMY_FLAGS_40000000) {
script->functionTemp[0] = 12; script->functionTemp[0] = 12;
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
enemy->flags &= ~ENEMY_FLAGS_40000000; enemy->flags &= ~ENEMY_FLAGS_40000000;
} }

View File

@ -107,7 +107,7 @@ ApiStatus func_802C03E8(Evt* script, s32 isInitialCall) {
} }
EvtScript D_802C0410 = { EvtScript D_802C0410 = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetPlayerAnimation, ANIM_GOT_ITEM) EVT_CALL(SetPlayerAnimation, ANIM_GOT_ITEM)
EVT_CALL(GetPlayerPos, LW(0), LW(1), LW(2)) EVT_CALL(GetPlayerPos, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 45) EVT_ADD(LW(1), 45)
@ -149,7 +149,7 @@ EvtScript D_802C0560 = {
}; };
EvtScript D_802C05CC_32579C = { EvtScript D_802C05CC_32579C = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(GetCurrentPartner, LW(0)) EVT_CALL(GetCurrentPartner, LW(0))
EVT_IF_NE(LW(0), 0) EVT_IF_NE(LW(0), 0)

View File

@ -615,7 +615,7 @@ void update_player(void) {
collisionStatus->currentWall = -1; collisionStatus->currentWall = -1;
collisionStatus->lastWallHammered = -1; collisionStatus->lastWallHammered = -1;
collisionStatus->unk_0A = -1; collisionStatus->currentInspect = -1;
collisionStatus->floorBelow = 1; collisionStatus->floorBelow = 1;
update_player_input(); update_player_input();
@ -776,38 +776,38 @@ void player_reset_data(void) {
} }
s32 func_800DFCF4(void) { s32 func_800DFCF4(void) {
if (gPartnerActionStatus.actionState.b[0] == 1 && if (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_USE &&
(gPartnerActionStatus.actionState.b[3] == 6 || gPartnerActionStatus.actionState.b[3] == 9 || (gPartnerActionStatus.actingPartner == PARTNER_WATT
gPartnerActionStatus.actionState.b[3] == 7 || gPartnerActionStatus.actionState.b[3] == 4 || || gPartnerActionStatus.actingPartner == PARTNER_BOW
gPartnerActionStatus.actionState.b[3] == 8)) { || gPartnerActionStatus.actingPartner == PARTNER_SUSHIE
return 0; || gPartnerActionStatus.actingPartner == PARTNER_PARAKARRY
|| gPartnerActionStatus.actingPartner == PARTNER_LAKILESTER)) {
return FALSE;
} }
return 1; return TRUE;
} }
s32 get_overriding_player_anim(s32 anim) { s32 get_overriding_player_anim(s32 anim) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* actionStatus = &gPartnerActionStatus; PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
if (playerStatus->actionState == ACTION_STATE_USE_SPINNING_FLOWER && anim != ANIM_1002B && anim != ANIM_MIDAIR_STILL) { if (playerStatus->actionState == ACTION_STATE_USE_SPINNING_FLOWER && anim != ANIM_1002B && anim != ANIM_MIDAIR_STILL) {
return -1; return -1;
} }
if (actionStatus->actionState.b[0] != 0) { if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE) {
if (actionStatus->actionState.b[3] == 8 && anim == ANIM_10002) { if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER && anim == ANIM_10002) {
anim = ANIM_8000E; anim = ANIM_8000E;
} }
if (actionStatus->actionState.b[0] != 0) { if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE && partnerActionStatus->actingPartner == PARTNER_BOW) {
if (actionStatus->actionState.b[3] == 9) {
if (anim != ANIM_CROUCH && anim != ANIM_10002) { if (anim != ANIM_CROUCH && anim != ANIM_10002) {
return -1; return -1;
} }
} }
} }
}
if (anim == ANIM_THUMBS_UP && actionStatus->actionState.b[0] == 1) { if (anim == ANIM_THUMBS_UP && partnerActionStatus->partnerActionState == PARTNER_ACTION_USE) {
return -1; return -1;
} }
@ -871,8 +871,8 @@ void update_player_blink(void) {
u8 phi_v1; u8 phi_v1;
u8* alpha; u8* alpha;
if (gPartnerActionStatus.actionState.b[3] == 9) { if (gPartnerActionStatus.actingPartner == PARTNER_BOW) {
phi_a2 = gPartnerActionStatus.actionState.b[0] != 0; phi_a2 = gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE;
} }
if (playerStatus->blinkTimer > 0) { if (playerStatus->blinkTimer > 0) {
@ -968,7 +968,7 @@ s32 func_800E0208(void) {
if (gGameStatusPtr->disableScripts && if (gGameStatusPtr->disableScripts &&
(gGameStatusPtr->currentButtons & PLAYER_STATUS_FLAGS_10)) (gGameStatusPtr->currentButtons & PLAYER_STATUS_FLAGS_10))
{ {
if (gPartnerActionStatus.actionState.b[0] == 0) { if (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE) {
set_action_state(ACTION_STATE_IDLE); set_action_state(ACTION_STATE_IDLE);
} }
ret = TRUE; ret = TRUE;

View File

@ -146,14 +146,14 @@ s32 phys_adjust_cam_on_landing(void) {
if (ret == 1) { if (ret == 1) {
if ((get_collider_type_by_id(gCollisionStatus.currentFloor) & 0xFF) == 3) { if ((get_collider_type_by_id(gCollisionStatus.currentFloor) & 0xFF) == 3) {
ret = 0; ret = 0;
gCameras[0].moveFlags |= 0x1; gCameras[0].moveFlags |= CAMERA_MOVE_FLAGS_1;
} else { } else {
gCameras[0].moveFlags &= ~0x1; gCameras[0].moveFlags &= ~CAMERA_MOVE_FLAGS_1;
} }
} else if (partnerActionStatus->actionState.b[0] != 0 && partnerActionStatus->actionState.b[3] == 4) { } else if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE && partnerActionStatus->actingPartner == PARTNER_PARAKARRY) {
gCameras[0].moveFlags |= 0x2; gCameras[0].moveFlags |= CAMERA_MOVE_FLAGS_2;
} else { } else {
gCameras[0].moveFlags &= ~0x2; gCameras[0].moveFlags &= ~CAMERA_MOVE_FLAGS_2;
} }
return ret; return ret;
@ -255,8 +255,8 @@ void phys_update_action_state(void) {
cond = FALSE; cond = FALSE;
} }
if ((partnerActionStatus->actionState.b[0] == 0) && !(playerStatus->flags & 0x20) && cond) { if ((partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) && !(playerStatus->flags & PLAYER_STATUS_FLAGS_20) && cond) {
set_action_state(0xC); set_action_state(ACTION_STATE_TALK);
} }
check_input_spin(); check_input_spin();
} }
@ -354,8 +354,8 @@ void set_action_state(s32 actionState) {
partner = playerData->currentPartner; partner = playerData->currentPartner;
if (partner == PARTNER_SUSHIE || partner == PARTNER_LAKILESTER || partner == PARTNER_PARAKARRY) { if (partner == PARTNER_SUSHIE || partner == PARTNER_LAKILESTER || partner == PARTNER_PARAKARRY) {
if (gPartnerActionStatus.actionState.b[0] != 0) { if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) {
playerStatus->animFlags |= 0x4; playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4;
playerStatus->flags |= PLAYER_STATUS_FLAGS_800; playerStatus->flags |= PLAYER_STATUS_FLAGS_800;
return; return;
} }
@ -374,7 +374,7 @@ void set_action_state(s32 actionState) {
} }
if (actionState == ACTION_STATE_ENEMY_FIRST_STRIKE) { if (actionState == ACTION_STATE_ENEMY_FIRST_STRIKE) {
playerStatus->animFlags |= 4; playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4;
} }
playerStatus->actionState = actionState; playerStatus->actionState = actionState;
playerStatus->flags |= PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; playerStatus->flags |= PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
@ -448,7 +448,7 @@ s32 check_input_hammer(void) {
return FALSE; return FALSE;
} }
if (gPartnerActionStatus.actionState.b[0] == 1 && playerData->currentPartner == PARTNER_WATT) { if (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_USE && playerData->currentPartner == PARTNER_WATT) {
return FALSE; return FALSE;
} }
@ -481,8 +481,8 @@ s32 check_input_jump(void) {
return FALSE; return FALSE;
} }
if ((collisionStatus->unk_0A != -1) && (collisionStatus->unk_0A & 0x4000)) { if ((collisionStatus->currentInspect != -1) && (collisionStatus->currentInspect & COLLISION_WITH_ENTITY_BIT)) {
Entity* entity = get_entity_by_index(collisionStatus->unk_0A); Entity* entity = get_entity_by_index(collisionStatus->currentInspect);
if (entity->flags & ENTITY_FLAGS_SHOWS_INSPECT_PROMPT) { if (entity->flags & ENTITY_FLAGS_SHOWS_INSPECT_PROMPT) {
if ((entity->boundScriptBytecode == 0) || (entity->flags & ENTITY_FLAGS_4000)) { if ((entity->boundScriptBytecode == 0) || (entity->flags & ENTITY_FLAGS_4000)) {

View File

@ -33,17 +33,17 @@ s32 can_trigger_loading_zone(void) {
if (actionState == ACTION_STATE_RIDE) { if (actionState == ACTION_STATE_RIDE) {
if (playerData->currentPartner == PARTNER_LAKILESTER || playerData->currentPartner == PARTNER_BOW) { if (playerData->currentPartner == PARTNER_LAKILESTER || playerData->currentPartner == PARTNER_BOW) {
if (partnerActionStatus->actionState.b[0] != 0) { if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE) {
return TRUE; return TRUE;
} else { } else {
gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4;
return FALSE; return FALSE;
} }
} else { } else {
if (partnerActionStatus->actionState.b[3] == 6 || partnerActionStatus->actionState.b[3] == 7) { if (partnerActionStatus->actingPartner == PARTNER_WATT || partnerActionStatus->actingPartner == PARTNER_SUSHIE) {
return partnerActionStatus->actionState.b[0] != 0; return partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE;
} }
if (partnerActionStatus->actionState.b[3] == 4) { if (partnerActionStatus->actingPartner == PARTNER_PARAKARRY) {
gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4;
return FALSE; return FALSE;
} }
@ -98,7 +98,7 @@ s32 collision_main_above(void) {
{ {
if (sp2C <= fabsf(new_var + playerStatus->gravityIntegrator[0])) { if (sp2C <= fabsf(new_var + playerStatus->gravityIntegrator[0])) {
do { do {
if ((hitResult & 0x4000) && get_entity_type(hitResult) == ENTITY_TYPE_BRICK_BLOCK) { if ((hitResult & COLLISION_WITH_ENTITY_BIT) && get_entity_type(hitResult) == ENTITY_TYPE_BRICK_BLOCK) {
return hitResult; return hitResult;
} }
} while (0); } while (0);
@ -353,7 +353,7 @@ void func_800E315C(s32 colliderID) {
set_action_state(ACTION_STATE_LAND); set_action_state(ACTION_STATE_LAND);
break; break;
case 3: case 3:
if ((partnerActionStatus->actionState.i & 0xFF0000FF) != 0x01000009) { if ((*(s32*)(&partnerActionStatus->partnerActionState) & 0xFF0000FF) != 0x01000009) {
if (playerStatus->blinkTimer == 0) { if (playerStatus->blinkTimer == 0) {
if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) { if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
playerStatus->unk_BF = 1; playerStatus->unk_BF = 1;
@ -365,7 +365,7 @@ void func_800E315C(s32 colliderID) {
} }
break; break;
case 2: case 2:
if ((partnerActionStatus->actionState.i & 0xFF0000FF) != 0x01000009) { if ((*(s32*)(&partnerActionStatus->partnerActionState) & 0xFF0000FF) != 0x01000009) {
if (playerStatus->blinkTimer == 0) { if (playerStatus->blinkTimer == 0) {
if (playerStatus->actionState != ACTION_STATE_HIT_FIRE) { if (playerStatus->actionState != ACTION_STATE_HIT_FIRE) {
playerStatus->unk_BF = 2; playerStatus->unk_BF = 2;
@ -396,12 +396,12 @@ void phys_player_land(void) {
playerStatus->landPos.z = playerStatus->position.z; playerStatus->landPos.z = playerStatus->position.z;
playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_FLYING | PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING); playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_FLYING | PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING);
sfx_play_sound_at_player(SOUND_SOFT_LAND, 0); sfx_play_sound_at_player(SOUND_SOFT_LAND, 0);
if (!(collisionStatus->currentFloor & 0x4000)) { if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
} }
collisionStatus->lastTouchedFloor = -1; collisionStatus->lastTouchedFloor = -1;
if (collisionStatus->currentFloor & 0x4000) { if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) {
s32 entityType = get_entity_type(collisionStatus->currentFloor); s32 entityType = get_entity_type(collisionStatus->currentFloor);
if (entityType <= ACTION_STATE_FALLING) { if (entityType <= ACTION_STATE_FALLING) {
@ -901,7 +901,7 @@ void phys_main_collision_below(void) {
if (result >= 0) { if (result >= 0) {
switch (get_collider_type_by_id(result) & 0xFF) { switch (get_collider_type_by_id(result) & 0xFF) {
case 2: case 2:
if (partnerActionStatus->actionState.b[0] == 0 || partnerActionStatus->actionState.b[3] != 9) { if (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE || partnerActionStatus->actingPartner != PARTNER_BOW) {
if (playerStatus->blinkTimer == 0) { if (playerStatus->blinkTimer == 0) {
if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) { if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
playerStatus->unk_BF = 2; playerStatus->unk_BF = 2;
@ -913,7 +913,7 @@ void phys_main_collision_below(void) {
} }
break; break;
case 3: case 3:
if (partnerActionStatus->actionState.b[0] == 0 || partnerActionStatus->actionState.b[3] != 9) { if (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE || partnerActionStatus->actingPartner != PARTNER_BOW) {
if (playerStatus->blinkTimer == 0) { if (playerStatus->blinkTimer == 0) {
if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) { if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
playerStatus->unk_BF = 1; playerStatus->unk_BF = 1;
@ -926,7 +926,7 @@ void phys_main_collision_below(void) {
break; break;
default: default:
cond = FALSE; cond = FALSE;
if (collisionStatus->currentFloor & 0x4000) { if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) {
cond = get_entity_type(collisionStatus->currentFloor) == ENTITY_TYPE_HIDDEN_PANEL; cond = get_entity_type(collisionStatus->currentFloor) == ENTITY_TYPE_HIDDEN_PANEL;
} }
@ -1109,7 +1109,7 @@ void try_player_footstep_sounds(s32 arg0) {
} }
void phys_update_interact_collider(void) { void phys_update_interact_collider(void) {
gCollisionStatus.unk_0A = phys_check_interactable_collision(); gCollisionStatus.currentInspect = phys_check_interactable_collision();
} }
s32 phys_check_interactable_collision(void) { s32 phys_check_interactable_collision(void) {
@ -1145,9 +1145,9 @@ s32 phys_can_player_interact(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 ret = TRUE; s32 ret = TRUE;
if (gPartnerActionStatus.actionState.b[0] != 0) { if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) {
if (gPartnerActionStatus.actionState.b[3] == 3) { if (gPartnerActionStatus.actingPartner == PARTNER_BOMBETTE) {
if (gPartnerActionStatus.actionState.b[0] < 3) { if (gPartnerActionStatus.partnerActionState <= PARTNER_ACTION_BOMBETTE_2) {
ret = FALSE; ret = FALSE;
} }
} else { } else {

View File

@ -15,7 +15,7 @@ extern s16 D_8010CCFE;
void func_800E6860(void) { void func_800E6860(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (gPartnerActionStatus.actionState.b[0] != 0 && gPartnerActionStatus.actionState.b[3] == 9) { if (gPartnerActionStatus.partnerActionState != 0 && gPartnerActionStatus.actingPartner == PARTNER_BOW) {
Npc* partner = get_npc_unsafe(NPC_PARTNER); Npc* partner = get_npc_unsafe(NPC_PARTNER);
func_802DDEE4(0, -1, 7, 0, 0, 0, playerStatus->alpha1, 0); func_802DDEE4(0, -1, 7, 0, 0, 0, playerStatus->alpha1, 0);
@ -33,20 +33,20 @@ s32 func_800E6904(void) {
return FALSE; return FALSE;
} }
if (partnerActionStatus->actionState.b[0] == 0) { if (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) {
if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_1000) && if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_1000) &&
(actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN)) (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN))
{ {
return TRUE; return TRUE;
} }
} else if (partner_player_can_pause()) { } else if (partner_player_can_pause()) {
if (partnerActionStatus->actionState.b[3] == 6) { if (partnerActionStatus->actingPartner == PARTNER_WATT) {
return TRUE; return TRUE;
} else if (partnerActionStatus->actionState.b[3] == 9) { } else if (partnerActionStatus->actingPartner == PARTNER_BOW) {
if (actionState == ACTION_STATE_RIDE) { if (actionState == ACTION_STATE_RIDE) {
return TRUE; return TRUE;
} }
} else if (partnerActionStatus->actionState.b[3] == 8) { } else if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) {
if (actionState == ACTION_STATE_RIDE) { if (actionState == ACTION_STATE_RIDE) {
return TRUE; return TRUE;
} }
@ -69,7 +69,7 @@ s32 can_pause(s32 currentButtons, s32 pressedButtons) {
!is_picking_up_item()) !is_picking_up_item())
{ {
if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) {
if (partnerActionStatus->actionState.b[0] == 0) { if (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) {
if (!(gPlayerStatus.flags & PLAYER_STATUS_FLAGS_1000)) { if (!(gPlayerStatus.flags & PLAYER_STATUS_FLAGS_1000)) {
if (actionState == ACTION_STATE_IDLE || if (actionState == ACTION_STATE_IDLE ||
actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_WALK ||
@ -79,23 +79,23 @@ s32 can_pause(s32 currentButtons, s32 pressedButtons) {
} }
} }
} else if (partner_player_can_pause()) { } else if (partner_player_can_pause()) {
if (partnerActionStatus->actionState.b[3] == 6) { if (partnerActionStatus->actingPartner == PARTNER_WATT) {
return actionState == ACTION_STATE_IDLE || return actionState == ACTION_STATE_IDLE ||
actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_WALK ||
actionState == ACTION_STATE_RUN; actionState == ACTION_STATE_RUN;
} else if (partnerActionStatus->actionState.b[3] == 9) { } else if (partnerActionStatus->actingPartner == PARTNER_BOW) {
if (actionState == ACTION_STATE_RIDE) { if (actionState == ACTION_STATE_RIDE) {
gPlayerStatus.alpha2 = 0; gPlayerStatus.alpha2 = 0;
return TRUE; return TRUE;
} }
} else if (partnerActionStatus->actionState.b[3] == 8) { } else if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) {
if (actionState == ACTION_STATE_RIDE) { if (actionState == ACTION_STATE_RIDE) {
if (func_802BD7DC()) { if (func_802BD7DC()) {
return TRUE; return TRUE;
} }
sfx_play_sound(SOUND_MENU_ERROR); sfx_play_sound(SOUND_MENU_ERROR);
} }
} else if (partnerActionStatus->actionState.b[3] == 7) { } else if (partnerActionStatus->actingPartner == PARTNER_SUSHIE) {
sfx_play_sound(SOUND_MENU_ERROR); sfx_play_sound(SOUND_MENU_ERROR);
} }
} }

View File

@ -35,7 +35,7 @@ void func_800EFD08(void) {
colliderType = D_80109480; colliderType = D_80109480;
} }
if (playerStatus->actionState == ACTION_STATE_LAND && playerStatus->flags < 0) { if (playerStatus->actionState == ACTION_STATE_LAND && playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
D_8010CFF4 = D_8010CFF0; D_8010CFF4 = D_8010CFF0;
} }

View File

@ -109,7 +109,7 @@ void update_camera_mode_5(Camera* camera) {
camera->auxPos.y = camera->targetPos.y + camera->currentYOffset; camera->auxPos.y = camera->targetPos.y + camera->currentYOffset;
camera->auxPos.z = camera->targetPos.z; camera->auxPos.z = camera->targetPos.z;
func_8003034C(camera); func_8003034C(camera);
if (!(camera->moveFlags & 1)) { if (!(camera->moveFlags & CAMERA_MOVE_FLAGS_1)) {
func_80030210(camera, temp_f20, temp_f22, 0); func_80030210(camera, temp_f20, temp_f22, 0);
} else { } else {
lookXDelta = temp_f22; // needed to match lookXDelta = temp_f22; // needed to match
@ -264,7 +264,7 @@ void update_camera_zone_interp(Camera* camera) {
camera->linearInterpScale = 1.0f; camera->linearInterpScale = 1.0f;
} }
temp = targetX; temp = targetX;
if (camera->moveFlags & 1) { if (camera->moveFlags & CAMERA_MOVE_FLAGS_1) {
camera->unk_498 = 0.0f; camera->unk_498 = 0.0f;
} else if (camera->unk_494 != targetY) { } else if (camera->unk_494 != targetY) {
camera->unk_494 = targetY; camera->unk_494 = targetY;
@ -282,14 +282,14 @@ void update_camera_zone_interp(Camera* camera) {
camera->unk_498 = 1.0f; camera->unk_498 = 1.0f;
} }
if (camera->moveFlags & 4) { if (camera->moveFlags & CAMERA_MOVE_FLAGS_4) {
camera->unk_498 += 0.3; camera->unk_498 += 0.3;
if (camera->unk_498 >= 1.0) { if (camera->unk_498 >= 1.0) {
camera->unk_498 = 1.0f; camera->unk_498 = 1.0f;
} }
} }
if (!(camera->moveFlags & 2)) { if (!(camera->moveFlags & CAMERA_MOVE_FLAGS_2)) {
camera->savedTargetY += (camera->unk_494 - camera->savedTargetY) * camera->unk_498; camera->savedTargetY += (camera->unk_494 - camera->savedTargetY) * camera->unk_498;
} }
@ -522,7 +522,7 @@ void update_camera_zone_interp(Camera* camera) {
cosViewPitch = cos_deg(blendedCamSettings.boomPitch + D_800A08DC); cosViewPitch = cos_deg(blendedCamSettings.boomPitch + D_800A08DC);
sinViewPitch = sin_deg(blendedCamSettings.boomPitch + D_800A08DC); sinViewPitch = sin_deg(blendedCamSettings.boomPitch + D_800A08DC);
if (!(camera->moveFlags & 2)) { if (!(camera->moveFlags & CAMERA_MOVE_FLAGS_2)) {
camera->lookAt_eye.y = blendedCamSettings.position.y + (blendedCamSettings.boomLength * sinViewPitch); camera->lookAt_eye.y = blendedCamSettings.position.y + (blendedCamSettings.boomLength * sinViewPitch);
} }
@ -538,7 +538,7 @@ void update_camera_zone_interp(Camera* camera) {
} }
temp_f8_2 = blendedCamSettings.position.y - camera->lookAt_eye.y; temp_f8_2 = blendedCamSettings.position.y - camera->lookAt_eye.y;
if (!(camera->moveFlags & 2)) { if (!(camera->moveFlags & CAMERA_MOVE_FLAGS_2)) {
camera->lookAt_obj.y = camera->lookAt_eye.y + ((dist * sinViewPitch) + (temp_f8_2 * cosViewPitch)); camera->lookAt_obj.y = camera->lookAt_eye.y + ((dist * sinViewPitch) + (temp_f8_2 * cosViewPitch));
} }
temp_f4_4 = (dist * cosViewPitch) - (temp_f8_2 * sinViewPitch); temp_f4_4 = (dist * cosViewPitch) - (temp_f8_2 * sinViewPitch);

View File

@ -5,7 +5,9 @@ s32 func_802B7000_2(void) {
s8 actionState = gPlayerActionState; s8 actionState = gPlayerActionState;
if (actionState != ACTION_STATE_USE_TWEESTER) { if (actionState != ACTION_STATE_USE_TWEESTER) {
if (partnerActionStatus->actionState.b[0] != 1 || (partnerActionStatus->actionState.b[3] != 9 && partnerActionStatus->actionState.b[3] != 4)) { if (partnerActionStatus->partnerActionState != PARTNER_ACTION_USE ||
(partnerActionStatus->actingPartner != PARTNER_BOW
&& partnerActionStatus->actingPartner != PARTNER_PARAKARRY)) {
return 0; return 0;
} }
} }

View File

@ -134,7 +134,7 @@ void func_802B735C_E2290C(void) {
switch (temp_v1) { switch (temp_v1) {
case 0: case 0:
if (partnerActionStatus->actionState.b[0] && partnerActionStatus->actionState.b[3] == 8) { if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE && partnerActionStatus->actingPartner == PARTNER_LAKILESTER) {
phi_v0 = gGameStatusPtr->keepUsingPartnerOnMapChange; phi_v0 = gGameStatusPtr->keepUsingPartnerOnMapChange;
} else { } else {
phi_v0 = playerStatus->flags & 0x3000; phi_v0 = playerStatus->flags & 0x3000;

View File

@ -21,7 +21,7 @@ void func_80240DC4_EA16C4(Evt* script, NpcAISettings* aiSettings, EnemyTerritory
#include "world/common/UnkNpcAIFunc5.inc.c" #include "world/common/UnkNpcAIFunc5.inc.c"
//Basically UnkNpcAIFunc26.inc.c, but gPartnerActionStatus.actionState.b[0] access 0, instead of 3 //Basically UnkNpcAIFunc26.inc.c, but gPartnerActionStatus.partnerActionState access 0, instead of 3
s32 N(UnkNpcAIFunc26)(Evt* script) { s32 N(UnkNpcAIFunc26)(Evt* script) {
Enemy* enemy = script->owner1.enemy; Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID); Npc* npc = get_npc_unsafe(enemy->npcID);
@ -49,11 +49,11 @@ s32 N(UnkNpcAIFunc26)(Evt* script) {
ret = FALSE; ret = FALSE;
} }
if (gPartnerActionStatus.actionState.b[0] == 9) { if (gPartnerActionStatus.partnerActionState == PARTNER_BOW) {
ret = FALSE; ret = FALSE;
} }
if (gPartnerActionStatus.actionState.b[0] == 7) { if (gPartnerActionStatus.partnerActionState == PARTNER_SUSHIE) {
ret = FALSE; ret = FALSE;
} }
@ -74,7 +74,7 @@ ApiStatus func_802406CC_EA0FCC(Evt* script, s32 isInitialCall) {
enemy->unk_114 = 0.0001f; enemy->unk_114 = 0.0001f;
enemy->unk_118 = 0.0001f; enemy->unk_118 = 0.0001f;
if (isInitialCall || enemy->unk_B0 & 4) { if (isInitialCall || enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->flags |= NPC_FLAG_2 | NPC_FLAG_100; npc->flags |= NPC_FLAG_2 | NPC_FLAG_100;
@ -82,8 +82,8 @@ ApiStatus func_802406CC_EA0FCC(Evt* script, s32 isInitialCall) {
npc->pos.x = 0.0f; npc->pos.x = 0.0f;
npc->pos.y = -1000.0f; npc->pos.y = -1000.0f;
npc->pos.z = 0.0f; npc->pos.z = 0.0f;
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
} }
@ -165,7 +165,7 @@ ApiStatus func_8024097C_EA127C(Evt* script, s32 isInitialCall) {
enemy->unk_114 = 0.0001f; enemy->unk_114 = 0.0001f;
enemy->unk_118 = 0.0001f; enemy->unk_118 = 0.0001f;
if (isInitialCall || enemy->unk_B0 & 4) { if (isInitialCall || enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -175,10 +175,10 @@ ApiStatus func_8024097C_EA127C(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~NPC_FLAG_GRAVITY) | NPC_FLAG_ENABLE_HIT_SCRIPT; npc->flags = (npc->flags & ~NPC_FLAG_GRAVITY) | NPC_FLAG_ENABLE_HIT_SCRIPT;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }
@ -278,16 +278,16 @@ ApiStatus func_80241AE0_EA23E0(Evt* script, s32 isInitialCall) {
enemy->unk_118 = 0.7f; enemy->unk_118 = 0.7f;
} }
if (isInitialCall || enemy->unk_B0 & 4) { if (isInitialCall || enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
} }

View File

@ -159,7 +159,7 @@ ApiStatus func_8024150C_ECB20C(Evt* script, s32 isInitialCall) {
enemy->unk_114 = 0.01f; enemy->unk_114 = 0.01f;
enemy->unk_118 = 0.01f; enemy->unk_118 = 0.01f;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -169,10 +169,10 @@ ApiStatus func_8024150C_ECB20C(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~NPC_FLAG_GRAVITY) | NPC_FLAG_ENABLE_HIT_SCRIPT; npc->flags = (npc->flags & ~NPC_FLAG_GRAVITY) | NPC_FLAG_ENABLE_HIT_SCRIPT;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
} }

View File

@ -56,7 +56,7 @@ void func_80241730_EE00F0(Evt* script, NpcAISettings* aiSettings, EnemyTerritory
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) { if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
x = npc->pos.x; x = npc->pos.x;
y = npc->pos.y; y = npc->pos.y;
@ -135,7 +135,7 @@ void func_80241B94_EE0554(Evt* script, NpcAISettings* aiSettings, EnemyTerritory
npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20); npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20);
enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC); enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) { if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 12; script->functionTemp[0] = 12;
return; return;

View File

@ -52,7 +52,7 @@ void func_802415DC_EF3BEC(Evt* script, NpcAISettings* aiSettings, EnemyTerritory
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) { if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
x = npc->pos.x; x = npc->pos.x;
y = npc->pos.y; y = npc->pos.y;
@ -131,7 +131,7 @@ void func_80241A40_EF4050(Evt* script, NpcAISettings* aiSettings, EnemyTerritory
npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20); npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20);
enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC); enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) { if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 12; script->functionTemp[0] = 12;
return; return;
@ -154,236 +154,4 @@ INCLUDE_ASM(s32, "EF2680", func_80241C90_EF42A0);
#include "world/common/DeadUnkNpcAIMainFunc5.inc.c" #include "world/common/DeadUnkNpcAIMainFunc5.inc.c"
// This should be roughly like this and is a copy from CD7350 (UnkNpcAIMainFunc6), but with the little extra block #include "world/common/DeadUnkNpcAIMainFunc6.inc.c"
// at the beginning. I have to assume that is has to roughly look like below, but I can't get it to match.
#ifdef NON_EQUIVALENT
ApiStatus func_8024299C_EF4FAC(Evt* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
NpcAISettings* aiSettings = (NpcAISettings*) evt_get_variable(script, *args);
s32 var;
u32 x, y, z;
f32 x2, y2, z2, w2;
Npc* npc2;
territory.unk_00 = 0;
territory.shape = enemy->territory->wander.detectShape;
territory.pointX = enemy->territory->wander.detect.x;
territory.pointZ = enemy->territory->wander.detect.z;
territory.sizeX = enemy->territory->wander.detectSizeX;
territory.sizeZ = enemy->territory->wander.detectSizeZ;
territory.unk_18 = 65.0f;
territory.unk_1C = 0;
// God knows what happens here ----------------
enemy->territory->patrol.points[4].x = npc->pos.x;
enemy->territory->patrol.points[4].y = npc->pos.y;
enemy->territory->patrol.points[5].x = 0.0001f;
enemy->territory->patrol.points[5].y = 0.0001f;
enemy->territory->patrol.points[4].z = npc->pos.z;
// --------------------------------------------
if (isInitialCall) {
enemy->varTable[6] = npc->collisionHeight;
enemy->unk_B0 |= 8;
}
if (isInitialCall || (enemy->varTable[10] == 100)) {
script->functionTemp[0] = 100;
npc->duration = 0;
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
enemy->flags |= ENEMY_FLAGS_200000;
npc->flags = (npc->flags & ~0x200) | 8;
enemy->varTable[10] = 0;
enemy->varTable[11] = -1;
npc->pos.x = 0.0f;
npc->pos.y = -1000.0f;
npc->pos.z = 0.0f;
}
if (enemy->unk_B0 & 4) {
npc->duration = 0;
npc->collisionHeight = enemy->varTable[6];
enemy->unk_B0 &= ~4;
if (npc->flags & 0x800) {
npc->currentAnim.w = 0x4A0018;
npc->moveSpeed = 0.0f;
npc->jumpVelocity = 0.0f;
npc->jumpScale = 1.0f;
script->functionTemp[0] = 102;
} else {
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var);
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1] = 0;
script->functionTemp[0] = 200;
}
}
get_screen_coords(0, npc->pos.x, npc->pos.y, npc->pos.z, &x, &y, &z);
if ((script->functionTemp[0] < 100) && ((x + 50) >= 421)) {
script->functionTemp[0] = 110;
}
switch (script->functionTemp[0]) {
case 0:
func_800495A0(script, aiSettings, territoryPtr);
npc->collisionHeight = enemy->varTable[6];
if (enemy->varTable[13] != 0) {
if (npc->pos.y <= 0.0) {
npc->flags = (npc->flags & ~0x200) | 8;
} else {
npc->flags = (npc->flags | 0x200) & ~8;
}
}
func_800496B8(script, aiSettings, territoryPtr);
break;
case 1:
func_800496B8(script, aiSettings, territoryPtr);
break;
case 2:
base_UnkNpcAIFunc1(script, aiSettings, territoryPtr);
case 3:
func_80049C04(script, aiSettings, territoryPtr);
break;
case 12:
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
case 13:
N(UnkDistFunc)(script, aiSettings, territoryPtr);
npc->collisionHeight = enemy->varTable[6];
break;
case 14:
N(UnkNpcAIFunc12)(script, aiSettings, territoryPtr);
break;
case 15:
N(set_script_owner_npc_col_height)(script, aiSettings, territoryPtr);
break;
case 100:
if (enemy->varTable[10] != 2) {
break;
}
npc2 = get_npc_unsafe(get_enemy(enemy->varTable[11])->npcID);
if (npc2->yaw < 180.0) {
npc->pos.x = npc2->pos.x + 12.0;
} else {
npc->pos.x = npc2->pos.x - 12.0;
}
npc->pos.y = npc2->pos.y + 25.0;
npc->pos.z = npc2->pos.z + 1.0;
npc->rotation.y = 0.0f;
npc->flags |= 8;
npc->flags &= ~2;
npc->flags &= ~0x200;
npc->renderYaw = 0.0f;
npc->currentAnim.w = 0x4A0018;
script->functionTemp[0] = 101;
case 101:
if (enemy->varTable[10] != 3) {
break;
}
enemy->varTable[10] = 4;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
npc->moveSpeed = 2.5f;
npc->jumpVelocity = 8.0f;
npc->jumpScale = 0.8f;
npc->flags |= 0x800;
script->functionTemp[0] = 102;
case 102:
if (npc->moveSpeed > 0.0) {
x2 = npc->pos.x;
y2 = npc->pos.y;
z2 = npc->pos.z;
if (npc_test_move_simple_with_slipping(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight,
npc->collisionRadius) == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
npc->moveSpeed = 0.0f;
}
}
if (npc->jumpVelocity < 0.0) {
x2 = npc->pos.x;
y2 = npc->pos.y + 13.0;
z2 = npc->pos.z;
w2 = fabsf(npc->jumpVelocity) + 16.0;
if ((npc_raycast_down_sides(npc->unk_80, &x2, &y2, &z2, &w2) != 0) && (w2 <= (fabsf(npc->jumpVelocity) + 13.0))) {
npc->pos.y = y2;
enemy->territory->wander.point.x = npc->pos.x;
enemy->territory->wander.point.y = npc->pos.y;
enemy->territory->wander.point.z = npc->pos.z;
enemy->territory->wander.detect.x = npc->pos.x;
enemy->territory->wander.detect.y = npc->pos.y;
enemy->territory->wander.detect.z = npc->pos.z;
enemy->varTable[10] = 5;
if (enemy->varTable[13] != 0) {
if (npc->pos.y <= 0.0) {
npc->flags = (npc->flags & ~0x200) | 8;
} else {
npc->flags = (npc->flags | 0x200) & ~8;
}
} else if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
} else {
npc->flags = (npc->flags & ~0x200) | 8;
}
npc->flags = (npc->flags | 0x40000) & ~0x800;
npc->jumpVelocity = 0.0f;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
npc->currentAnim.w = 0x4A001A;
npc->duration = 3;
script->functionTemp[0] = 103;
break;
}
}
npc->pos.y += npc->jumpVelocity;
npc->jumpVelocity -= npc->jumpScale;
break;
case 103:
npc->duration--;
if (npc->duration <= 0) {
npc->flags &= 0xFFFBFFFF;
npc->currentAnim.w = 0x4A0001;
script->functionTemp[0] = 0;
}
break;
case 110:
npc->duration = 30;
npc->pos.x = 0.0f;
npc->pos.z = 0.0f;
npc->pos.y = -1000.0f;
npc->flags = (npc->flags | 0xA) & ~0x200;
script->functionTemp[0] = 111;
case 111:
npc->duration--;
if (npc->duration <= 0) {
enemy->varTable[10] = 0;
script->functionTemp[0] = 100;
}
break;
case 200:
func_8004A73C(script);
break;
}
return ApiStatus_BLOCK;
}
#else
INCLUDE_ASM(s32, "EF2680", func_8024299C_EF4FAC);
#endif

View File

@ -1059,7 +1059,7 @@ void update_entities(void) {
if (!(entity->flags & ENTITY_FLAGS_8000)) { if (!(entity->flags & ENTITY_FLAGS_8000)) {
entity->flags |= ENTITY_FLAGS_2000000; entity->flags |= ENTITY_FLAGS_2000000;
} }
entity->boundScript = start_script(entity->boundScriptBytecode, 0xA, 0x20); entity->boundScript = start_script(entity->boundScriptBytecode, EVT_PRIORITY_A, EVT_FLAG_20);
} }
if (entity->flags & ENTITY_FLAGS_2000000) { if (entity->flags & ENTITY_FLAGS_2000000) {

View File

@ -403,7 +403,7 @@ EvtScript N(8021B0E4) = {
EVT_USE_ARRAY(D_80235FC0) EVT_USE_ARRAY(D_80235FC0)
EVT_CALL(N(StartRumbleWithParams), 256, 30) EVT_CALL(N(StartRumbleWithParams), 256, 30)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 20, EVT_FLOAT(3.0)) EVT_CALL(ShakeCam, 1, 0, 20, EVT_FLOAT(3.0))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(SetPartFlagBits, ACTOR_SELF, 5, ACTOR_PART_FLAG_100000, 1) EVT_CALL(SetPartFlagBits, ACTOR_SELF, 5, ACTOR_PART_FLAG_100000, 1)
@ -429,35 +429,35 @@ EvtScript N(8021B0E4) = {
EVT_WAIT_FRAMES(30) EVT_WAIT_FRAMES(30)
EVT_CALL(PlaySoundAtModel, 15, 482, 0) EVT_CALL(PlaySoundAtModel, 15, 482, 0)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(1.0)) EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(1.0))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 100, 20) EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_WAIT_FRAMES(20) EVT_WAIT_FRAMES(20)
EVT_CALL(PlaySoundAtModel, 11, 482, 0) EVT_CALL(PlaySoundAtModel, 11, 482, 0)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.5)) EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.5))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 150, 20) EVT_CALL(N(StartRumbleWithParams), 150, 20)
EVT_WAIT_FRAMES(30) EVT_WAIT_FRAMES(30)
EVT_CALL(PlaySoundAtModel, 9, 482, 0) EVT_CALL(PlaySoundAtModel, 9, 482, 0)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.0)) EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.0))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 100, 20) EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_WAIT_FRAMES(30) EVT_WAIT_FRAMES(30)
EVT_CALL(PlaySoundAtModel, 31, 482, 0) EVT_CALL(PlaySoundAtModel, 31, 482, 0)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.7)) EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.7))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 70, 20) EVT_CALL(N(StartRumbleWithParams), 70, 20)
EVT_WAIT_FRAMES(20) EVT_WAIT_FRAMES(20)
EVT_CALL(PlaySoundAtModel, 25, 482, 0) EVT_CALL(PlaySoundAtModel, 25, 482, 0)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.0)) EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.0))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 100, 20) EVT_CALL(N(StartRumbleWithParams), 100, 20)
@ -465,12 +465,12 @@ EvtScript N(8021B0E4) = {
EVT_CALL(PlaySoundAtModel, 43, 482, 0) EVT_CALL(PlaySoundAtModel, 43, 482, 0)
EVT_CALL(N(StartRumbleWithParams), 60, 20) EVT_CALL(N(StartRumbleWithParams), 60, 20)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.6)) EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.6))
EVT_END_THREAD EVT_END_THREAD
EVT_WAIT_FRAMES(20) EVT_WAIT_FRAMES(20)
EVT_THREAD EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.3)) EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.3))
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 30, 20) EVT_CALL(N(StartRumbleWithParams), 30, 20)

View File

@ -461,7 +461,7 @@ void update_collider_transform(s16 colliderID) {
} }
s32 get_collider_type_by_id(s32 colliderID) { s32 get_collider_type_by_id(s32 colliderID) {
if (colliderID & 0x4000) { if (colliderID & COLLISION_WITH_ENTITY_BIT) {
return 0; return 0;
} else { } else {
return gCollisionData.colliderList[colliderID].flags; return gCollisionData.colliderList[colliderID].flags;
@ -1026,7 +1026,7 @@ ApiStatus func_8005DB00(Evt* script, s32 isInitialCall) {
script->functionTemp[0] = 1; script->functionTemp[0] = 1;
break; break;
case 1: case 1:
if (partnerStatus->actionState.b[3] != 9) { if (partnerStatus->actingPartner != PARTNER_BOW) {
if (npc->duration != 0 && npc->duration != script->functionTemp[0]) if (npc->duration != 0 && npc->duration != script->functionTemp[0])
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -170,7 +170,7 @@ ApiStatus DoNpcDefeat(Evt* script, s32 isInitialCall) {
kill_script(script); kill_script(script);
npc->currentAnim.w = owner->animList[6]; npc->currentAnim.w = owner->animList[6];
newScript = start_script(&SCRIPT_NpcDefeat, 10, 0); newScript = start_script(&SCRIPT_NpcDefeat, EVT_PRIORITY_A, 0);
owner->defeatScript = newScript; owner->defeatScript = newScript;
owner->defeatScriptID = newScript->id; owner->defeatScriptID = newScript->id;
newScript->owner1.enemy = owner; newScript->owner1.enemy = owner;
@ -217,7 +217,7 @@ void start_battle(Evt* script, s32 songID) {
Evt* hitEvtInstance; Evt* hitEvtInstance;
enemy->encountered = TRUE; enemy->encountered = TRUE;
hitEvtInstance = start_script(enemy->hitBytecode, 10, 0); hitEvtInstance = start_script(enemy->hitBytecode, EVT_PRIORITY_A, 0);
enemy->hitScript = hitEvtInstance; enemy->hitScript = hitEvtInstance;
enemy->hitScriptID = hitEvtInstance->id; enemy->hitScriptID = hitEvtInstance->id;
@ -284,7 +284,7 @@ ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) {
) && enemy->hitBytecode != NULL) { ) && enemy->hitBytecode != NULL) {
enemy->encountered = TRUE; enemy->encountered = TRUE;
script = start_script(enemy->hitBytecode, 10, 0); script = start_script(enemy->hitBytecode, EVT_PRIORITY_A, 0);
enemy->hitScript = script; enemy->hitScript = script;
enemy->hitScriptID = script->id; enemy->hitScriptID = script->id;
@ -356,10 +356,10 @@ ApiStatus BindNpcAI(Evt* script, s32 isInitialCall) {
enemy->unk_C8 = 100; enemy->unk_C8 = 100;
enemy->aiBytecode = newScriptSource; enemy->aiBytecode = newScriptSource;
scriptTemp = start_script(newScriptSource, 10, 0); scriptTemp = start_script(newScriptSource, EVT_PRIORITY_A, 0);
enemy->aiScript = scriptTemp; enemy->aiScript = scriptTemp;
enemy->aiScriptID = scriptTemp->id; enemy->aiScriptID = scriptTemp->id;
scriptTemp->owner1.enemyID = (s32)enemy; scriptTemp->owner1.enemy = enemy;
scriptTemp->owner2.npcID = id; scriptTemp->owner2.npcID = id;
scriptTemp->groupFlags = phi_s1; scriptTemp->groupFlags = phi_s1;
return ret; return ret;
@ -405,7 +405,7 @@ ApiStatus RestartNpcAI(Evt* script, s32 isInitialCall) {
} }
npc->unk_C8 = 100; npc->unk_C8 = 100;
newScript = start_script(npc->aiBytecode, 10, 0); newScript = start_script(npc->aiBytecode, EVT_PRIORITY_A, 0);
npc->aiScript = newScript; npc->aiScript = newScript;
npc->aiScriptID = newScript->id; npc->aiScriptID = newScript->id;
newScript->owner1.enemy = npc; newScript->owner1.enemy = npc;
@ -473,10 +473,10 @@ ApiStatus SetNpcAux(Evt* script, s32 isInitialCall) {
if (newScriptSource != NULL) { if (newScriptSource != NULL) {
enemy->auxBytecode = newScriptSource; enemy->auxBytecode = newScriptSource;
scriptTemp = start_script(newScriptSource, 10, 0); scriptTemp = start_script(newScriptSource, EVT_PRIORITY_A, 0);
enemy->auxScript = scriptTemp; enemy->auxScript = scriptTemp;
enemy->auxScriptID = scriptTemp->id; enemy->auxScriptID = scriptTemp->id;
scriptTemp->owner1.enemyID = (s32)enemy; scriptTemp->owner1.enemy = enemy;
scriptTemp->owner2.npcID = id; scriptTemp->owner2.npcID = id;
scriptTemp->groupFlags = script->groupFlags; scriptTemp->groupFlags = script->groupFlags;
} }
@ -501,31 +501,31 @@ ApiStatus BindNpcAux(Evt* script, s32 isInitialCall) {
ApiStatus RestartNpcAux(Evt* script, s32 isInitialCall) { ApiStatus RestartNpcAux(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos; Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy; Enemy* enemy = script->owner1.enemy;
s32 npcID = evt_get_variable(script, *args++); s32 npcID = evt_get_variable(script, *args++);
Evt* newScript; Evt* newScript;
s32 groupFlags; s32 groupFlags;
if (npcID == NPC_SELF) { if (npcID == NPC_SELF) {
npcID = npc->npcID; npcID = enemy->npcID;
} }
npc = get_enemy(npcID); enemy = get_enemy(npcID);
if (npc->flags & 1) { if (enemy->flags & 1) {
groupFlags = 10; groupFlags = 10;
} else { } else {
groupFlags = 11; groupFlags = 11;
} }
if (npc->auxScript != NULL) { if (enemy->auxScript != NULL) {
kill_script_by_ID(npc->auxScriptID); kill_script_by_ID(enemy->auxScriptID);
} }
newScript = start_script(npc->auxBytecode, 10, 0); newScript = start_script(enemy->auxBytecode, EVT_PRIORITY_A, 0);
npc->auxScript = newScript; enemy->auxScript = newScript;
npc->auxScriptID = newScript->id; enemy->auxScriptID = newScript->id;
newScript->owner1.enemy = npc; newScript->owner1.enemy = enemy;
newScript->owner2.npcID = npcID; newScript->owner2.npcID = npcID;
newScript->groupFlags = groupFlags; newScript->groupFlags = groupFlags;
@ -806,17 +806,17 @@ ApiStatus func_80045900(Evt* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(enemy->npcID); Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var0 = evt_get_variable(script, *script->ptrReadPos); s32 var0 = evt_get_variable(script, *script->ptrReadPos);
enemy->unk_B0 |= 4; enemy->unk_B0 |= ENEMY_AI_FLAGS_4;
if (var0 == 0) { if (var0 == 0) {
s32 unk; s32 unk;
if (!(enemy->unk_B0 & 0x10)) { if (!(enemy->unk_B0 & ENEMY_AI_FLAGS_10)) {
npc->currentAnim.w = *enemy->animList; npc->currentAnim.w = *enemy->animList;
} }
if (!(enemy->unk_B0 & 0x8)) { if (!(enemy->unk_B0 & ENEMY_AI_FLAGS_8)) {
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 0.0f, -20.0f, 40, &unk); fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 0.0f, -20.0f, 40, &unk);
} }
if ((npc->flags & 0xA08) == 0x808) { if ((npc->flags & 0xA08) == 0x808) {

View File

@ -105,7 +105,7 @@ void entity_small_switch_idle(Entity* entity) {
return; return;
} }
if (partnerActionStatus->actionState.b[3] == 4 && partnerActionStatus->actionState.b[0] != 0) { if (partnerActionStatus->actingPartner == PARTNER_PARAKARRY && partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE) {
return; return;
} }

View File

@ -162,7 +162,7 @@ void func_802BB9E0_E2E310(Entity* entity) {
case 0: case 0:
if (entity->collisionFlags & 1) { if (entity->collisionFlags & 1) {
data->unk_01 = 0; data->unk_01 = 0;
if (partnerActionStatus->actionState.b[3] != 0) { if (partnerActionStatus->actingPartner != 0) {
playerStatus->animFlags |= 4; playerStatus->animFlags |= 4;
} }
func_800EF300(partnerActionStatus); func_800EF300(partnerActionStatus);
@ -222,7 +222,7 @@ void func_802BB9E0_E2E310(Entity* entity) {
} }
break; break;
case 6: case 6:
if (!(entity->collisionFlags & 1) && (partnerActionStatus->actionState.b[0] == 0)) { if (!(entity->collisionFlags & 1) && (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE)) {
data->unk_00 = 0; data->unk_00 = 0;
enable_partner_ai(); enable_partner_ai();
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();

View File

@ -25,7 +25,7 @@ void func_802BC2BC_E30C0C(Entity* entity) {
f32 x,y,z,sp2C; f32 x,y,z,sp2C;
s32 result = 0; s32 result = 0;
if ((currentFloor & 0x4000) && ((currentFloor & 0xFF) == entity->listIndex) && (actionState == ACTION_STATE_HAMMER)) { if ((currentFloor & COLLISION_WITH_ENTITY_BIT) && ((currentFloor & 0xFF) == entity->listIndex) && (actionState == ACTION_STATE_HAMMER)) {
x = playerStatus->position.x; x = playerStatus->position.x;
y = playerStatus->position.y + 5.0f; y = playerStatus->position.y + 5.0f;
z = playerStatus->position.z; z = playerStatus->position.z;
@ -33,8 +33,8 @@ void func_802BC2BC_E30C0C(Entity* entity) {
add_vec2D_polar(&x, &z, 10.0f, func_800E5348()); add_vec2D_polar(&x, &z, 10.0f, func_800E5348());
if (npc_raycast_down_sides(0x10000, &x, &y, &z, &sp2C) != 0) { if (npc_raycast_down_sides(0x10000, &x, &y, &z, &sp2C) != 0) {
if (D_8010C978 & 0x4000) { if (D_8010C978 & COLLISION_WITH_ENTITY_BIT) {
result = get_entity_type(D_8010C978) == 0x31; result = get_entity_type(D_8010C978) == ENTITY_TYPE_STAR_BOX_LAUCHER;
} }
} }
} else if ((entity->collisionFlags & 1) && ((actionState == ACTION_STATE_GROUND_POUND) || (actionState == ACTION_STATE_ULTRA_POUND))) { } else if ((entity->collisionFlags & 1) && ((actionState == ACTION_STATE_GROUND_POUND) || (actionState == ACTION_STATE_ULTRA_POUND))) {

View File

@ -2,14 +2,14 @@
#include "camera.h" #include "camera.h"
EvtScript ShakeCam1 = { EvtScript ShakeCam1 = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), EVT_FIXED(1.0)) EVT_CALL(ShakeCam, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), EVT_FIXED(1.0))
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript ShakeCamX = { EvtScript ShakeCamX = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), EVT_VAR(3)) EVT_CALL(ShakeCam, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), EVT_VAR(3))
EVT_RETURN EVT_RETURN
EVT_END EVT_END
@ -265,7 +265,7 @@ ApiStatus ShakeCam(Evt* script, s32 isInitialCall) {
void exec_ShakeCam1(s32 camID, s32 mode, s32 duration) { void exec_ShakeCam1(s32 camID, s32 mode, s32 duration) {
Evt* script; Evt* script;
script = start_script_in_group(&ShakeCam1, 1, 0, 4); script = start_script_in_group(&ShakeCam1, EVT_PRIORITY_1, 0, EVT_GROUP_04);
script->varTable[0] = camID; script->varTable[0] = camID;
script->varTable[1] = mode; script->varTable[1] = mode;
script->varTable[2] = duration; script->varTable[2] = duration;
@ -274,7 +274,7 @@ void exec_ShakeCam1(s32 camID, s32 mode, s32 duration) {
void exec_ShakeCamX(s32 camID, s32 mode, s32 duration, f32 magnitude) { void exec_ShakeCamX(s32 camID, s32 mode, s32 duration, f32 magnitude) {
Evt* script; Evt* script;
script = start_script_in_group(&ShakeCamX, 1, 0, 4); script = start_script_in_group(&ShakeCamX, EVT_PRIORITY_1, 0, EVT_GROUP_04);
evt_set_variable(script, EVT_VAR(0), camID); evt_set_variable(script, EVT_VAR(0), camID);
evt_set_variable(script, EVT_VAR(1), mode); evt_set_variable(script, EVT_VAR(1), mode);
evt_set_variable(script, EVT_VAR(2), duration); evt_set_variable(script, EVT_VAR(2), duration);

View File

@ -974,7 +974,7 @@ s32 evt_trigger_on_activate_exec_script(Trigger* trigger) {
return 0; return 0;
} }
script = start_script((EvtScript*)scriptStart, trigger->priority, 0x20); script = start_script(scriptStart, trigger->priority, EVT_FLAG_20);
trigger->runningScript = script; trigger->runningScript = script;
trigger->runningScriptID = script->id; trigger->runningScriptID = script->id;
script->varTable[0] = trigger->varTable[0]; script->varTable[0] = trigger->varTable[0];
@ -1094,7 +1094,7 @@ ApiStatus evt_handle_does_script_exist(Evt* script) {
s32 evt_trigger_on_activate_lock(Trigger* trigger) { s32 evt_trigger_on_activate_lock(Trigger* trigger) {
if (trigger->runningScript == NULL) { if (trigger->runningScript == NULL) {
Evt* newScript = start_script(trigger->onTriggerEvt, trigger->priority, 0x20); Evt* newScript = start_script(trigger->onTriggerEvt, trigger->priority, EVT_FLAG_20);
trigger->runningScript = newScript; trigger->runningScript = newScript;
trigger->runningScriptID = newScript->id; trigger->runningScriptID = newScript->id;
newScript->varTable[0] = trigger->varTable[0]; newScript->varTable[0] = trigger->varTable[0];
@ -1155,7 +1155,7 @@ ApiStatus evt_handle_thread(Evt* script) {
} while (opcode != EVT_OP_END_THREAD); } while (opcode != EVT_OP_END_THREAD);
script->ptrNextLine = endLine; script->ptrNextLine = endLine;
newScript = start_script_in_group((EvtScript*)startLine, script->priority, 0x60, script->groupFlags); newScript = start_script_in_group((EvtScript*)startLine, script->priority, (EVT_FLAG_20 | EVT_FLAG_40), script->groupFlags);
newScript->owner1.enemyID = script->owner1.enemyID; newScript->owner1.enemyID = script->owner1.enemyID;
newScript->owner2.npcID = script->owner2.npcID; newScript->owner2.npcID = script->owner2.npcID;
newScript->array = script->array; newScript->array = script->array;
@ -1192,7 +1192,7 @@ ApiStatus evt_handle_child_thread(Evt* script) {
} while (opcode != EVT_OP_END_CHILD_THREAD); } while (opcode != EVT_OP_END_CHILD_THREAD);
script->ptrNextLine = endLine; script->ptrNextLine = endLine;
newScript = func_802C39F8(script, startLine, 0x60); newScript = func_802C39F8(script, startLine, (EVT_FLAG_20 | EVT_FLAG_40));
newScript->owner1.enemyID = script->owner1.enemyID; newScript->owner1.enemyID = script->owner1.enemyID;
newScript->owner2.npcID = script->owner2.npcID; newScript->owner2.npcID = script->owner2.npcID;
newScript->groupFlags = script->groupFlags; newScript->groupFlags = script->groupFlags;

View File

@ -26,7 +26,7 @@ ApiStatus func_802D5C70(Evt* script) {
D_802DB800[i] = 0; D_802DB800[i] = 0;
} }
start_script(&D_802D9D34, 1, 0); start_script(&D_802D9D34, EVT_PRIORITY_1, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -111,7 +111,7 @@ ApiStatus Spawn802D9D50(Evt* script, s32 isInitialCall) {
s32 var5 = evt_get_variable(script, *args++); s32 var5 = evt_get_variable(script, *args++);
s32 var6 = evt_get_variable(script, *args++); s32 var6 = evt_get_variable(script, *args++);
Evt* newScript = start_script(&D_802D9D50, 1, 0); Evt* newScript = start_script(&D_802D9D50, EVT_PRIORITY_1, 0);
newScript->varTable[0] = var0; newScript->varTable[0] = var0;
newScript->varTable[1] = var1; newScript->varTable[1] = var1;
newScript->varTable[2] = var2; newScript->varTable[2] = var2;

View File

@ -529,7 +529,7 @@ ApiStatus ResetFromLava(Evt* script, s32 isInitialCall) {
D_802DADA4 = -1; D_802DADA4 = -1;
} }
if (!(collisionStatus->currentFloor & 0x4000)) { if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
collider = &gCollisionData.colliderList[collisionStatus->currentFloor]; collider = &gCollisionData.colliderList[collisionStatus->currentFloor];
if (collider->flags & 0x100) { if (collider->flags & 0x100) {
D_802DADA4 = collisionStatus->currentFloor; D_802DADA4 = collisionStatus->currentFloor;

View File

@ -33,7 +33,7 @@ ApiStatus CreateNpc(Evt* script, s32 isInitialCall) {
NpcBlueprint blueprint; NpcBlueprint blueprint;
Npc *npc; Npc *npc;
blueprint.flags = NPC_FLAG_0; blueprint.flags = 0;
blueprint.initialAnim = initialAnim; blueprint.initialAnim = initialAnim;
blueprint.onUpdate = NULL; blueprint.onUpdate = NULL;
blueprint.onRender = NULL; blueprint.onRender = NULL;

View File

@ -757,7 +757,7 @@ ApiStatus GetCurrentPartner(Evt* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData; PlayerData* playerData = &gPlayerData;
s32 currentPartner = 0; s32 currentPartner = 0;
if (gPartnerActionStatus.actionState.b[0] != 0) { if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) {
currentPartner = playerData->currentPartner; currentPartner = playerData->currentPartner;
} }

View File

@ -171,7 +171,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 initialState) {
gNumScripts++; gNumScripts++;
ASSERT(newScript != NULL); ASSERT(newScript != NULL);
newScript->state = initialState | 1; newScript->state = initialState | EVT_FLAG_01;
newScript->currentOpcode = 0; newScript->currentOpcode = 0;
newScript->priority = priority; newScript->priority = priority;
newScript->ptrNextLine = (Bytecode*)source; newScript->ptrNextLine = (Bytecode*)source;
@ -186,7 +186,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 initialState) {
newScript->owner2.npcID = -1; newScript->owner2.npcID = -1;
newScript->loopDepth = -1; newScript->loopDepth = -1;
newScript->switchDepth = -1; newScript->switchDepth = -1;
newScript->groupFlags = ~0x10; newScript->groupFlags = ~EVT_GROUP_10;
newScript->ptrSavedPosition = NULL; newScript->ptrSavedPosition = NULL;
newScript->frameCounter = 0.0f; newScript->frameCounter = 0.0f;
newScript->unk_158 = 0; newScript->unk_158 = 0;
@ -204,7 +204,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 initialState) {
find_script_labels(newScript); find_script_labels(newScript);
if (gIsUpdatingScripts && (newScript->state & 0x20)) { if (gIsUpdatingScripts && (newScript->state & EVT_FLAG_20)) {
scriptListCount = gScriptListCount++; scriptListCount = gScriptListCount++;
gScriptIndexList[scriptListCount] = curScriptIndex; gScriptIndexList[scriptListCount] = curScriptIndex;
gScriptIdList[scriptListCount] = newScript->id; gScriptIdList[scriptListCount] = newScript->id;
@ -243,7 +243,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 initialState, u8 g
// Some of this function is surely macros. I think we'll learn more as we do others in this file. -Ethan // Some of this function is surely macros. I think we'll learn more as we do others in this file. -Ethan
do { do {
newScript->state = initialState | 1; newScript->state = initialState | EVT_FLAG_01;
newScript->currentOpcode = 0; newScript->currentOpcode = 0;
newScript->priority = priority; newScript->priority = priority;
newScript->id = gStaticScriptCounter++; newScript->id = gStaticScriptCounter++;
@ -274,7 +274,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 initialState, u8 g
find_script_labels(newScript); find_script_labels(newScript);
if (gIsUpdatingScripts && (newScript->state & 0x20)) { if (gIsUpdatingScripts && (newScript->state & EVT_FLAG_20)) {
scriptListCount = gScriptListCount++; scriptListCount = gScriptListCount++;
gScriptIndexList[scriptListCount] = curScriptIndex; gScriptIndexList[scriptListCount] = curScriptIndex;
gScriptIdList[scriptListCount] = newScript->id; gScriptIdList[scriptListCount] = newScript->id;
@ -311,8 +311,8 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 initialState)
ASSERT(child != NULL); ASSERT(child != NULL);
parentScript->childScript = child; parentScript->childScript = child;
parentScript->state |= 0x10; parentScript->state |= EVT_FLAG_10;
child->state = initialState | 1; child->state = initialState | EVT_FLAG_01;
child->ptrCurrentLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source; child->ptrCurrentLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source;
@ -380,7 +380,7 @@ Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) {
gNumScripts++; gNumScripts++;
ASSERT(child != NULL); ASSERT(child != NULL);
child->state = newState | 1; child->state = newState | EVT_FLAG_01;
child->ptrNextLine = nextLine; child->ptrNextLine = nextLine;
child->ptrFirstLine = nextLine; child->ptrFirstLine = nextLine;
child->ptrCurrentLine = nextLine; child->ptrCurrentLine = nextLine;

View File

@ -394,8 +394,8 @@ void npc_do_other_npc_collision(Npc* npc) {
if (!(thisBuf + otherBuf <= dist)) { if (!(thisBuf + otherBuf <= dist)) {
collision = FALSE; collision = FALSE;
if (npc->flags & NPC_FLAG_PARTICLE) { if (npc->flags & NPC_FLAG_PARTICLE) {
collision = gPartnerActionStatus.actionState.b[0] == 0; collision = gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE;
} else if (!(otherNpc->flags & NPC_FLAG_PARTICLE) || gPartnerActionStatus.actionState.b[0] == 0) { } else if (!(otherNpc->flags & NPC_FLAG_PARTICLE) || gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE) {
collision = TRUE; collision = TRUE;
} }
@ -1480,7 +1480,7 @@ s32 npc_find_standing_on_entity(s32 arg0) {
} else { } else {
floorID = npc->currentFloor; floorID = npc->currentFloor;
if (!(floorID & 0x4000)) { if (!(floorID & COLLISION_WITH_ENTITY_BIT)) {
continue; continue;
} }
} }
@ -1616,7 +1616,7 @@ void func_8003D660(Npc* npc, s32 arg1) {
func_8003DC38(npc, arg1); func_8003DC38(npc, arg1);
return; return;
case 8: case 8:
if ((temp->actionState.b[0] == 0) || (temp->actionState.b[3] != 8)) { if ((temp->partnerActionState == PARTNER_ACTION_NONE) || (temp->actingPartner != PARTNER_LAKILESTER)) {
func_8003DFA0(npc, arg1); func_8003DFA0(npc, arg1);
return; return;
} }
@ -2038,7 +2038,7 @@ s32 bind_enemy_ai(Enemy* enemy, EvtScript* aiScriptBytecode) {
kill_script_by_ID(enemy->aiScript->id); kill_script_by_ID(enemy->aiScript->id);
} }
enemy->aiBytecode = aiScriptBytecode; enemy->aiBytecode = aiScriptBytecode;
aiScript = enemy->aiScript = start_script(aiScriptBytecode, 0xA, 0); aiScript = enemy->aiScript = start_script(aiScriptBytecode, EVT_PRIORITY_A, 0);
id = enemy->aiScriptID = aiScript->id; id = enemy->aiScriptID = aiScript->id;
aiScript->owner1.enemy = enemy; aiScript->owner1.enemy = enemy;
return id; return id;
@ -2052,7 +2052,7 @@ s32 bind_enemy_aux(Enemy* enemy, EvtScript* auxScriptBytecode) {
kill_script_by_ID(enemy->auxScript->id); kill_script_by_ID(enemy->auxScript->id);
} }
enemy->auxBytecode = auxScriptBytecode; enemy->auxBytecode = auxScriptBytecode;
auxScript = enemy->auxScript = start_script(auxScriptBytecode, 0xA, 0); auxScript = enemy->auxScript = start_script(auxScriptBytecode, EVT_PRIORITY_A, 0);
id = enemy->auxScriptID = auxScript->id; id = enemy->auxScriptID = auxScript->id;
auxScript->owner1.enemy = enemy; auxScript->owner1.enemy = enemy;
return id; return id;
@ -2066,7 +2066,7 @@ s32 bind_enemy_interact(Enemy* enemy, EvtScript* interactScriptBytecode) {
kill_script_by_ID(enemy->interactScript->id); kill_script_by_ID(enemy->interactScript->id);
} }
enemy->interactBytecode = interactScriptBytecode; enemy->interactBytecode = interactScriptBytecode;
interactScript = enemy->interactScript = start_script(interactScriptBytecode, 0xA, 0); interactScript = enemy->interactScript = start_script(interactScriptBytecode, EVT_PRIORITY_A, 0);
id = enemy->interactScriptID = interactScript->id; id = enemy->interactScriptID = interactScript->id;
interactScript->owner1.enemy = enemy; interactScript->owner1.enemy = enemy;
return id; return id;

View File

@ -23,7 +23,7 @@ void clear_trigger_data(void) {
collisionStatus->currentFloor = -1; collisionStatus->currentFloor = -1;
collisionStatus->lastTouchedFloor = -1; collisionStatus->lastTouchedFloor = -1;
collisionStatus->currentCeiling = -1; collisionStatus->currentCeiling = -1;
collisionStatus->unk_0A = -1; collisionStatus->currentInspect = -1;
collisionStatus->unk_0C = -1; collisionStatus->unk_0C = -1;
collisionStatus->unk_0E = -1; collisionStatus->unk_0E = -1;
collisionStatus->unk_10 = -1; collisionStatus->unk_10 = -1;
@ -130,7 +130,7 @@ void update_triggers(void) {
if (listTrigger->location.colliderID == collisionStatus->currentWall) { if (listTrigger->location.colliderID == collisionStatus->currentWall) {
collisionStatus->touchingWallTrigger = 1; collisionStatus->touchingWallTrigger = 1;
} }
if ((listTrigger->location.colliderID != collisionStatus->unk_0A) || !phys_can_player_interact()) { if ((listTrigger->location.colliderID != collisionStatus->currentInspect) || !phys_can_player_interact()) {
continue; continue;
} }
} }

View File

@ -20,7 +20,7 @@ void func_802B6000_E287F0(void) {
playerStatus->gravityIntegrator[2] = 0.8059f; playerStatus->gravityIntegrator[2] = 0.8059f;
playerStatus->gravityIntegrator[3] = -0.0987f; playerStatus->gravityIntegrator[3] = -0.0987f;
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
D_802B6240 = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, D_802B6240 = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x,
playerStatus->lastGoodPosition.z); playerStatus->lastGoodPosition.z);

View File

@ -30,8 +30,8 @@ void func_802B6000_E245D0(void) {
f32 sinTheta; f32 sinTheta;
s32 colliderID; s32 colliderID;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
if (!(playerStatus->animFlags & 0x1000)) { if (!(playerStatus->animFlags & 0x1000)) {
s32 temp; s32 temp;
@ -90,8 +90,8 @@ void func_802B6198_E24768(void) {
void func_802B6230_E24800(void) { void func_802B6230_E24800(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
suggest_player_anim_clearUnkFlag(0xA0005); suggest_player_anim_clearUnkFlag(0xA0005);
playerStatus->currentStateTime = 8; playerStatus->currentStateTime = 8;
} }

View File

@ -9,7 +9,7 @@ void func_802B6000_E28A30(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 oldFlags = playerStatus->flags; s32 oldFlags = playerStatus->flags;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~( playerStatus->flags &= ~(
PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_8 | PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_8 |
PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING
@ -23,7 +23,7 @@ void func_802B6000_E28A30(void) {
} }
if (playerStatus->animFlags & 0x400000) { if (playerStatus->animFlags & 0x400000) {
switch (gPartnerActionStatus.actionState.b[3]) { switch (gPartnerActionStatus.actingPartner) {
case 8: case 8:
func_802BD100_317020(oldFlags); func_802BD100_317020(oldFlags);
break; break;
@ -63,7 +63,7 @@ void func_802B609C_E28ACC(void) {
f32 zDelta; f32 zDelta;
f32 phi_f20; f32 phi_f20;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(0x80080000 | 0x80000 | 0x8 | 0x4 | 0x2); playerStatus->flags &= ~(0x80080000 | 0x80000 | 0x8 | 0x4 | 0x2);
playerStatus->fallState = 0; playerStatus->fallState = 0;
playerStatus->framesOnGround = 0; playerStatus->framesOnGround = 0;
@ -138,7 +138,7 @@ INCLUDE_ASM(s32, "world/action/encounter", func_802B609C_E28ACC);
void func_802B6350_E28D80(void) { void func_802B6350_E28D80(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(0x80000000 | 0x80000 | 0x8 | 0x4 | 0x2); playerStatus->flags &= ~(0x80000000 | 0x80000 | 0x8 | 0x4 | 0x2);
playerStatus->fallState = 0; playerStatus->fallState = 0;
playerStatus->currentStateTime = 0; playerStatus->currentStateTime = 0;
@ -162,7 +162,7 @@ void func_802B6350_E28D80(void) {
void func_802B63D4_E28E04(void) { void func_802B63D4_E28E04(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(0x80000000 | 0x8 | 0x4 | 0x2); playerStatus->flags &= ~(0x80000000 | 0x8 | 0x4 | 0x2);
playerStatus->fallState = 0; playerStatus->fallState = 0;
playerStatus->decorationList = 0; playerStatus->decorationList = 0;
@ -183,7 +183,7 @@ void func_802B63D4_E28E04(void) {
void func_802B6478_E28EA8(void) { void func_802B6478_E28EA8(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~0x80000000;
playerStatus->flags |= 0x80000; playerStatus->flags |= 0x80000;
playerStatus->currentStateTime = 0; playerStatus->currentStateTime = 0;
@ -202,7 +202,7 @@ void func_802B6478_E28EA8(void) {
void func_802B6508_E28F38(void) { void func_802B6508_E28F38(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
f32 angle; f32 angle;
f32 magnitude; f32 magnitude;
@ -234,8 +234,8 @@ void func_802B6508_E28F38(void) {
void func_802B6638_E29068(void) { void func_802B6638_E29068(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
playerStatus->currentSpeed = 0.0f; playerStatus->currentSpeed = 0.0f;
playerStatus->unk_60 = 0; playerStatus->unk_60 = 0;

View File

@ -170,7 +170,7 @@ s32 func_802B62A4_E25174(void) {
} }
} }
if (ret >= 0 && (ret & 0x4000)) { if (ret >= 0 && (ret & COLLISION_WITH_ENTITY_BIT)) {
s32 hammerLevel = gPlayerData.hammerLevel; s32 hammerLevel = gPlayerData.hammerLevel;
switch (get_entity_type(ret)) { switch (get_entity_type(ret)) {
@ -313,7 +313,7 @@ void func_802B6820_E256F0(void) {
if (HammerHit->unk_14 == 0) { if (HammerHit->unk_14 == 0) {
collisionStatus->lastWallHammered = result; collisionStatus->lastWallHammered = result;
if (result >= 0) { if (result >= 0) {
if (result & 0x4000) { if (result & COLLISION_WITH_ENTITY_BIT) {
get_entity_by_index(result)->unk_07 = 0; get_entity_by_index(result)->unk_07 = 0;
} }
} }
@ -344,7 +344,7 @@ void func_802B6820_E256F0(void) {
if (HammerHit->unk_14 == 0) { if (HammerHit->unk_14 == 0) {
collisionStatus->lastWallHammered = result; collisionStatus->lastWallHammered = result;
if (result >= 0) { if (result >= 0) {
if (result & 0x4000) { if (result & COLLISION_WITH_ENTITY_BIT) {
get_entity_by_index(result)->unk_07 = 0; get_entity_by_index(result)->unk_07 = 0;
} }
} }
@ -369,7 +369,7 @@ void func_802B6820_E256F0(void) {
action_hammer_play_hit_fx(HammerHit->hitID); action_hammer_play_hit_fx(HammerHit->hitID);
if (collisionStatus->lastWallHammered >= 0 && (collisionStatus->lastWallHammered & 0x4000)) { if (collisionStatus->lastWallHammered >= 0 && (collisionStatus->lastWallHammered & COLLISION_WITH_ENTITY_BIT)) {
get_entity_by_index(collisionStatus->lastWallHammered)->unk_07 = 0; get_entity_by_index(collisionStatus->lastWallHammered)->unk_07 = 0;
playerStatus->flags |= PLAYER_STATUS_FLAGS_1000000; playerStatus->flags |= PLAYER_STATUS_FLAGS_1000000;
} else if (HammerHit->hitID < 0) { } else if (HammerHit->hitID < 0) {

View File

@ -18,7 +18,7 @@ void func_802B6000_E27C90(void) {
playerStatus->gravityIntegrator[1] = -3.738f; playerStatus->gravityIntegrator[1] = -3.738f;
playerStatus->gravityIntegrator[2] = 0.8059f; playerStatus->gravityIntegrator[2] = 0.8059f;
playerStatus->gravityIntegrator[3] = -0.0987f; playerStatus->gravityIntegrator[3] = -0.0987f;
gCameras->moveFlags |= 1; gCameras->moveFlags |= CAMERA_MOVE_FLAGS_1;
D_802B62B0 = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z); D_802B62B0 = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z);
playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f; playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f;
subtract_hp(1); subtract_hp(1);

View File

@ -33,7 +33,7 @@ void func_802B6000_E27F40(void) {
playerStatus->currentSpeed = 0.0f; playerStatus->currentSpeed = 0.0f;
D_802B68B0 = 0.0f; D_802B68B0 = 0.0f;
gCameras[CAM_DEFAULT].moveFlags |= 3; gCameras[CAM_DEFAULT].moveFlags |= (CAMERA_MOVE_FLAGS_1 | CAMERA_MOVE_FLAGS_2);
D_802B68B4 = 90.0f; D_802B68B4 = 90.0f;
subtract_hp(1); subtract_hp(1);
open_status_menu_long(); open_status_menu_long();
@ -164,7 +164,7 @@ void func_802B6000_E27F40(void) {
exec_ShakeCamX(0, 2, 1, 0.8f); exec_ShakeCamX(0, 2, 1, 0.8f);
start_rumble(0x100, 0x32); start_rumble(0x100, 0x32);
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
gCameras[CAM_DEFAULT].moveFlags &= ~2; gCameras[CAM_DEFAULT].moveFlags &= ~CAMERA_MOVE_FLAGS_2;
sfx_play_sound_at_player(0x3FB, 0); sfx_play_sound_at_player(0x3FB, 0);
suggest_player_anim_setUnkFlag(0x8001A); suggest_player_anim_setUnkFlag(0x8001A);
playerStatus->flags &= ~0x800; playerStatus->flags &= ~0x800;

View File

@ -37,7 +37,7 @@ void func_802B6000_E24040(void) {
void func_802B60B4_E240F4(void) { void func_802B60B4_E240F4(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 phi_a0; s32 anim;
if (playerStatus->flags < 0) { if (playerStatus->flags < 0) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~0x80000000;
@ -46,7 +46,7 @@ void func_802B60B4_E240F4(void) {
if (playerStatus->actionState == ACTION_STATE_LAUNCH) { if (playerStatus->actionState == ACTION_STATE_LAUNCH) {
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
} else { } else {
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
} }
if (playerStatus->actionState == ACTION_STATE_JUMP) { if (playerStatus->actionState == ACTION_STATE_JUMP) {
@ -60,13 +60,13 @@ void func_802B60B4_E240F4(void) {
} }
if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) {
phi_a0 = 0x90005; anim = 0x90005;
} else if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { } else if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) {
phi_a0 = 0x10007; anim = 0x10007;
} else { } else {
phi_a0 = 0x60009; anim = 0x60009;
} }
suggest_player_anim_clearUnkFlag(phi_a0); suggest_player_anim_clearUnkFlag(anim);
playerStatus->decorationList++; playerStatus->decorationList++;
} }
@ -74,12 +74,9 @@ void func_802B60B4_E240F4(void) {
void func_802B6198_E241D8(void) { void func_802B6198_E241D8(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
CollisionStatus* collisionStatus = &gCollisionStatus; CollisionStatus* collisionStatus = &gCollisionStatus;
s32 temp_s1; s32 anim;
s32 phi_a0;
temp_s1 = 0x80000000; // weirdness with this - fake match if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
if (playerStatus->flags < 0) {
Entity* entity = get_entity_by_index(collisionStatus->currentFloor); Entity* entity = get_entity_by_index(collisionStatus->currentFloor);
D_8010C960 = entity->position.x; D_8010C960 = entity->position.x;
@ -95,20 +92,19 @@ void func_802B6198_E241D8(void) {
return; return;
} }
if (playerStatus->flags & 0x80000000) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x8000000A; playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING);
playerStatus->flags |= 4; playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING;
if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) {
phi_a0 = 0x10008; anim = 0x10008;
} else { } else {
phi_a0 = 0x6000A; anim = 0x6000A;
} }
temp_s1 = phi_a0; suggest_player_anim_clearUnkFlag(anim);
suggest_player_anim_clearUnkFlag(temp_s1); gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
gCameras[CAM_DEFAULT].moveFlags |= 1;
} }
playerStatus->fallState++; playerStatus->fallState++;
@ -122,11 +118,11 @@ void func_802B6294_E242D4(void) {
return; return;
} }
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
s32 phi_a0; s32 phi_a0;
playerStatus->flags &= ~0x8000000A; playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING);
playerStatus->flags |= 4; playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING;
if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) {
phi_a0 = 0x90005; phi_a0 = 0x90005;
@ -136,7 +132,7 @@ void func_802B6294_E242D4(void) {
phi_a0 = 0x6000A; phi_a0 = 0x6000A;
} }
suggest_player_anim_clearUnkFlag(phi_a0); suggest_player_anim_clearUnkFlag(phi_a0);
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
} }
playerStatus->decorationList++; playerStatus->decorationList++;
} }
@ -157,10 +153,10 @@ void func_802B6348_E24388(void) {
return; return;
} }
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= 0x7FFFFFF5; playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING);
playerStatus->flags |= 4; playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING;
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
} }
playerStatus->decorationList++; playerStatus->decorationList++;
@ -183,10 +179,10 @@ void func_802B647C_E244BC(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 temp_v1; s32 temp_v1;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
playerStatus->flags &= ~0xA; playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING);
playerStatus->flags |= 4; playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING;
if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) {
temp_v1 = 0x10008; temp_v1 = 0x10008;
@ -195,7 +191,7 @@ void func_802B647C_E244BC(void) {
} }
suggest_player_anim_clearUnkFlag(temp_v1); suggest_player_anim_clearUnkFlag(temp_v1);
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
} }
playerStatus->decorationList++; playerStatus->decorationList++;
} }
@ -203,11 +199,11 @@ void func_802B647C_E244BC(void) {
void func_802B6508_E24548(void) { void func_802B6508_E24548(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
playerStatus->flags &= ~0xA; playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING);
playerStatus->flags |= 4; playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING;
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) {
suggest_player_anim_clearUnkFlag(0xA0006); suggest_player_anim_clearUnkFlag(0xA0006);

View File

@ -44,13 +44,13 @@ void func_802B6000_E24920(void) {
sfx_play_sound_at_player(0x8161, 0); sfx_play_sound_at_player(0x8161, 0);
sfx_play_sound_at_player(0x148, 0); sfx_play_sound_at_player(0x148, 0);
if (!(collisionStatus->currentFloor & 0x4000)) { if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
} }
collisionStatus->lastTouchedFloor = -1; collisionStatus->lastTouchedFloor = -1;
playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40000; playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40000;
camera->moveFlags &= ~0x4; camera->moveFlags &= ~CAMERA_MOVE_FLAGS_4;
} }
playerStatus->fallState++; playerStatus->fallState++;
playerStatus->currentSpeed *= 0.6f; playerStatus->currentSpeed *= 0.6f;
@ -96,7 +96,7 @@ void func_802B61C0_E24AE0(void) {
playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.x = playerStatus->position.x;
playerStatus->landPos.z = playerStatus->position.z; playerStatus->landPos.z = playerStatus->position.z;
if (!(collisionStatus->currentFloor & 0x4000)) { if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
} }
@ -133,7 +133,7 @@ void func_802B62CC_E24BEC(void) {
sfx_play_sound_at_player(SOUND_SOFT_LAND, 0); sfx_play_sound_at_player(SOUND_SOFT_LAND, 0);
if (!(collisionStatus->currentFloor & 0x4000)) { if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
} }
@ -175,7 +175,7 @@ void func_802B644C_E24D6C(void) {
playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.x = playerStatus->position.x;
playerStatus->landPos.z = playerStatus->position.z; playerStatus->landPos.z = playerStatus->position.z;
if (!(collisionStatus->currentFloor & 0x4000)) { if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing(); phys_adjust_cam_on_landing();
} }
collisionStatus->lastTouchedFloor = -1; collisionStatus->lastTouchedFloor = -1;

View File

@ -53,7 +53,7 @@ void func_802B6060_E27570(void) {
D_802B679C = 0; D_802B679C = 0;
suggest_player_anim_clearUnkFlag(0x1000A); suggest_player_anim_clearUnkFlag(0x1000A);
sfx_play_sound_at_player(SOUND_167, 0); sfx_play_sound_at_player(SOUND_167, 0);
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
} }
tempCurrentSpeed = playerStatus->currentSpeed; tempCurrentSpeed = playerStatus->currentSpeed;
sp28 = playerStatus->position.x; sp28 = playerStatus->position.x;

View File

@ -63,8 +63,8 @@ void func_802B6120_E2A7D0(void) {
f32 phi_f20; f32 phi_f20;
f32 phi_f22; f32 phi_f22;
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
mem_clear(&D_802B6E80, sizeof(D_802B6E80)); mem_clear(&D_802B6E80, sizeof(D_802B6E80));
disable_player_static_collisions(); disable_player_static_collisions();
tempUnk_1C = &parasolStruct->unk_1C; tempUnk_1C = &parasolStruct->unk_1C;

View File

@ -15,17 +15,18 @@ void func_802B6000_E26DE0(void) {
u32 entityType; u32 entityType;
u8 colliderType; u8 colliderType;
if (playerStatus->flags & (1 << 31)) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000006; playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FALLING);
playerStatus->flags |= 0xA; playerStatus->flags |= (PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING);
playerStatus->fallState = 0; playerStatus->fallState = 0;
playerStatus->currentSpeed = 0.0f; playerStatus->currentSpeed = 0.0f;
D_802B6730 = 0.0f; D_802B6730 = 0.0f;
playerStatus->gravityIntegrator[0] = 5.2f; playerStatus->gravityIntegrator[0] = 5.2f;
suggest_player_anim_clearUnkFlag(0x1000A); suggest_player_anim_clearUnkFlag(0x1000A);
disable_player_input(); disable_player_input();
playerStatus->flags |= 0x200; playerStatus->flags |= PLAYER_STATUS_FLAGS_200;
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
sfx_play_sound_at_player(0x146, 0); sfx_play_sound_at_player(0x146, 0);
} }
@ -41,7 +42,7 @@ void func_802B6000_E26DE0(void) {
playerStatus->gravityIntegrator[0] -= 0.54; playerStatus->gravityIntegrator[0] -= 0.54;
if (collisionStatus->currentCeiling < 0) { if (collisionStatus->currentCeiling < 0) {
playerStatus->position.y += playerStatus->gravityIntegrator[0]; playerStatus->position.y += playerStatus->gravityIntegrator[0];
} else if (collisionStatus->currentCeiling & 0x4000) { } else if (collisionStatus->currentCeiling & COLLISION_WITH_ENTITY_BIT) {
entity = get_entity_by_index(collisionStatus->currentCeiling); entity = get_entity_by_index(collisionStatus->currentCeiling);
if (entity != NULL) { if (entity != NULL) {
playerStatus->position.y = entity->position.y - (playerStatus->colliderHeight * 0.5); playerStatus->position.y = entity->position.y - (playerStatus->colliderHeight * 0.5);
@ -92,8 +93,8 @@ void func_802B6000_E26DE0(void) {
playerStatus->gravityIntegrator[0] = -100.0f; playerStatus->gravityIntegrator[0] = -100.0f;
} }
if (sp10 >= 0) { if (sp10 >= 0) {
if (collisionStatus->currentFloor & 0x4000 && (entityType = get_entity_type(collisionStatus->currentFloor), if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT && (entityType = get_entity_type(collisionStatus->currentFloor),
entityType == 8 || entityType == 7)) { entityType == ENTITY_TYPE_RED_SWITCH || entityType == ENTITY_TYPE_BLUE_SWITCH)) {
get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= 1; get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= 1;
playerStatus->fallState = 0xB; playerStatus->fallState = 0xB;
playerStatus->flags &= ~0x8; playerStatus->flags &= ~0x8;

View File

@ -16,8 +16,8 @@ void func_802B6000_E26710(void) {
s32 sp10; s32 sp10;
u32 entityType; u32 entityType;
if (playerStatus->flags & (1 << 31)) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80000000; playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED;
playerStatus->flags |= 0x2000A; playerStatus->flags |= 0x2000A;
phys_clear_spin_history(); phys_clear_spin_history();
playerStatus->fallState = 0; playerStatus->fallState = 0;
@ -29,7 +29,7 @@ void func_802B6000_E26710(void) {
suggest_player_anim_setUnkFlag(0x80000); suggest_player_anim_setUnkFlag(0x80000);
disable_player_input(); disable_player_input();
playerStatus->flags |= 0x200; playerStatus->flags |= 0x200;
gCameras[CAM_DEFAULT].moveFlags |= 1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
temp_f0 = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw); temp_f0 = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw);
phi_f4 = -60.0f; phi_f4 = -60.0f;
if (temp_f0 <= 180.0f) { if (temp_f0 <= 180.0f) {
@ -64,7 +64,7 @@ void func_802B6000_E26710(void) {
case 0: case 0:
temp_f20 = integrate_gravity(); temp_f20 = integrate_gravity();
playerStatus->position.y = player_check_collision_below(temp_f20, &sp10); playerStatus->position.y = player_check_collision_below(temp_f20, &sp10);
if (sp10 >= 0 && collisionStatus->currentFloor & 0x4000 ) { if (sp10 >= 0 && collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT ) {
entityType = get_entity_type(collisionStatus->currentFloor); entityType = get_entity_type(collisionStatus->currentFloor);
if(entityType == 7 || entityType == 8) { if(entityType == 7 || entityType == 8) {
get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= 1; get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= 1;
@ -100,13 +100,13 @@ void func_802B6000_E26710(void) {
playerStatus->gravityIntegrator[0] = -100.0f; playerStatus->gravityIntegrator[0] = -100.0f;
} }
if (sp10 >= 0) { if (sp10 >= 0) {
if (collisionStatus->currentFloor & 0x4000) { if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) {
entityType = get_entity_type(collisionStatus->currentFloor); entityType = get_entity_type(collisionStatus->currentFloor);
if (entityType == 0x2E || entityType == 0x2F) { if (entityType == ENTITY_TYPE_SIMPLE_SPRING || entityType == ENTITY_TYPE_SCRIPT_SPRING) {
playerStatus->flags &= ~0x00020008; playerStatus->flags &= ~0x00020008;
set_action_state(ACTION_STATE_LAND); set_action_state(ACTION_STATE_LAND);
return; return;
} else if (entityType == 7 || entityType == 8) { } else if (entityType == ENTITY_TYPE_BLUE_SWITCH || entityType == ENTITY_TYPE_RED_SWITCH) {
playerStatus->flags &= ~0x00020008; playerStatus->flags &= ~0x00020008;
phys_player_land(); phys_player_land();
exec_ShakeCam1(0, 0, 4); exec_ShakeCam1(0, 0, 4);

View File

@ -61,7 +61,7 @@ void func_802B60A4_E29514(void) {
TempPointer = &D_802B6ED0; TempPointer = &D_802B6ED0;
if (sp20 >= 0){ if (sp20 >= 0){
if(!(sp20 & 0x4000)) { if(!(sp20 & COLLISION_WITH_ENTITY_BIT)) {
D_802B6ED0 = -1; D_802B6ED0 = -1;
} else { } else {
D_802B6ED0 = sp20 & 0x3FF; D_802B6ED0 = sp20 & 0x3FF;
@ -114,7 +114,7 @@ void func_802B60A4_E29514(void) {
gCameras->targetPos.y = playerStatus->position.y; gCameras->targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras->targetPos.z = playerStatus->position.z;
sp20 = func_802B6000_E29470(); sp20 = func_802B6000_E29470();
if (sp20 < 0 || !(sp20 & 0x4000)) { if (sp20 < 0 || !(sp20 & COLLISION_WITH_ENTITY_BIT)) {
playerStatus->currentStateTime = 20; playerStatus->currentStateTime = 20;
D_802B6EE8 = 0.0f; D_802B6EE8 = 0.0f;
D_802B6EF4 = playerStatus->position.y; D_802B6EF4 = playerStatus->position.y;

View File

@ -46,7 +46,7 @@ void action_run_update(void) {
return; return;
} }
if (playerStatus->flags < 0) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~0x80880000; playerStatus->flags &= ~0x80880000;
D_8010C980 = 0; D_8010C980 = 0;
playerStatus->unk_60 = 0; playerStatus->unk_60 = 0;

View File

@ -235,7 +235,7 @@ s32 N(func_80240000_BDD1B0)(Evt* script, NpcAISettings* aiSettings, EnemyTerrito
if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) { if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) {
ret = FALSE; ret = FALSE;
} }
if (gPartnerActionStatus.actionState.b[3] == 9) { if (gPartnerActionStatus.actingPartner == PARTNER_BOW) {
ret = FALSE; ret = FALSE;
} }
return ret; return ret;
@ -252,7 +252,7 @@ void N(func_802401D4_BDD384)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) {
npc->currentAnim.w = enemy->animList[9]; npc->currentAnim.w = enemy->animList[9];
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
npc->duration = 12; npc->duration = 12;
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
@ -353,11 +353,11 @@ s32 N(func_80240C90_BDDE40)(Evt* script, s32 isInitialCall) {
} }
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
if (enemy->unk_B4 != 0) { if (enemy->unk_B4 != 0) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if ((u32)script->functionTemp[0] - 12 < 3 && N(func_80240000_BDD1B0)(script, npcAISettings, territoryPtr)) { if ((u32)script->functionTemp[0] - 12 < 3 && N(func_80240000_BDD1B0)(script, npcAISettings, territoryPtr)) {

View File

@ -316,7 +316,7 @@ s32 N(func_80242388_BE5B38)(Evt* script, NpcAISettings* aiSettings, EnemyTerrito
if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) { if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) {
ret = FALSE; ret = FALSE;
} }
if (gPartnerActionStatus.actionState.b[3] == 9) { if (gPartnerActionStatus.actingPartner == PARTNER_BOW) {
ret = FALSE; ret = FALSE;
} }
return ret; return ret;
@ -333,7 +333,7 @@ void N(func_8024255C_BE5D0C)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) {
npc->currentAnim.w = enemy->animList[9]; npc->currentAnim.w = enemy->animList[9];
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
npc->duration = 12; npc->duration = 12;
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
@ -438,11 +438,11 @@ ApiStatus N(func_80243018_BE67C8)(Evt* script, s32 isInitialCall) {
} }
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
if (enemy->unk_B4 != 0) { if (enemy->unk_B4 != 0) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if ((u32)script->functionTemp[0] - 12 < 3 && N(func_80242388_BE5B38)(script, aiSettings, territoryPtr)) { if ((u32)script->functionTemp[0] - 12 < 3 && N(func_80242388_BE5B38)(script, aiSettings, territoryPtr)) {

View File

@ -51,7 +51,7 @@ EvtScript N(802437AC) = {
}; };
EvtScript N(802439B0) = { EvtScript N(802439B0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 1) EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(ShowKeyChoicePopup) EVT_CALL(ShowKeyChoicePopup)
EVT_IF_EQ(EVT_VAR(0), 0) EVT_IF_EQ(EVT_VAR(0), 0)

View File

@ -434,7 +434,7 @@ EvtScript N(802449C4) = {
}; };
EvtScript N(80244AD0) = { EvtScript N(80244AD0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_SUSPEND_GROUP(1) EVT_SUSPEND_GROUP(1)
EVT_CALL(ShowKeyChoicePopup) EVT_CALL(ShowKeyChoicePopup)
EVT_IF_EQ(EVT_VAR(0), 0) EVT_IF_EQ(EVT_VAR(0), 0)
@ -610,7 +610,7 @@ void N(func_80241954_BFF1D4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
} else { } else {
npc->rotation.y = 0.0f; npc->rotation.y = 0.0f;
npc->flags &= ~0x00200000; npc->flags &= ~0x00200000;
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
disable_player_input(); disable_player_input();
partner_disable_input(); partner_disable_input();
npc->duration = 0; npc->duration = 0;
@ -654,7 +654,7 @@ void N(func_80241CA8_BFF528)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (!(npc->pos.y < (posY + temp_f20))) { if (!(npc->pos.y < (posY + temp_f20))) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc->pos.y = posY + temp_f20; npc->pos.y = posY + temp_f20;
fx_emote(2, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); fx_emote(EMOTE_QUESTION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var);
npc->duration = 10; npc->duration = 10;
script->functionTemp[0] = 18; script->functionTemp[0] = 18;
} }
@ -676,7 +676,7 @@ void N(func_80241E70_BFF6F0)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
npc->duration++; npc->duration++;
if (npc->duration >= 3) { if (npc->duration >= 3) {
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
npc->duration = 0; npc->duration = 0;
script->functionTemp[0] = 100; script->functionTemp[0] = 100;
} else { } else {
@ -723,7 +723,7 @@ void N(func_80241F98_BFF818)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) {
fx_emote(0, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
npc->moveToPos.y = npc->pos.y; npc->moveToPos.y = npc->pos.y;
script->functionTemp[0] = 12; script->functionTemp[0] = 12;
@ -841,7 +841,7 @@ EvtScript N(npcAI_80244D54) = {
EVT_CALL(DisablePlayerPhysics, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(func_802D2B6C) EVT_CALL(func_802D2B6C)
EVT_CALL(DisablePartnerAI, 0) EVT_CALL(DisablePartnerAI, 0)
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 1) EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2)) EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 20) EVT_ADD(EVT_VAR(1), 20)

View File

@ -453,7 +453,7 @@ ApiStatus N(func_8024061C_C2F1BC)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -463,10 +463,10 @@ ApiStatus N(func_8024061C_C2F1BC)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }
@ -555,15 +555,15 @@ void N(func_80240958_C2F4F8)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
phi_s2 = TRUE; phi_s2 = TRUE;
} }
if (playerData->currentPartner == 2) { if (playerData->currentPartner == PARTNER_KOOPER) {
if (gPartnerActionStatus.actionState.b[0] == playerData->currentPartner) { if (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_KOOPER_2) {
phi_s2 = TRUE; phi_s2 = TRUE;
} }
} }
} }
if (((playerData->currentPartner == 1) && (gPartnerActionStatus.actionState.b[0] != 0)) || if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE)) ||
((playerData->currentPartner == 3) && (gPartnerActionStatus.actionState.b[0] == 2))) { ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) {
posX = npc->pos.x; posX = npc->pos.x;
posZ = npc->pos.z; posZ = npc->pos.z;
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
@ -576,7 +576,7 @@ void N(func_80240958_C2F4F8)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
ai_enemy_play_sound(npc, 0xB000000E, 0); ai_enemy_play_sound(npc, 0xB000000E, 0);
npc->currentAnim.w = enemy->animList[11]; npc->currentAnim.w = enemy->animList[11];
npc->duration = 10; npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
} }
@ -716,7 +716,7 @@ ApiStatus N(func_802410D4_C2FC74)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 40.0f; territory.unk_18 = 40.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 30; npc->duration = 30;
npc->currentAnim.w = enemy->animList[10]; npc->currentAnim.w = enemy->animList[10];
@ -727,12 +727,12 @@ ApiStatus N(func_802410D4_C2FC74)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 40; script->functionTemp[1] = 40;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) {

View File

@ -212,7 +212,7 @@ static s32 N(pad_30D8)[] = {
}; };
EvtScript N(802430E0) = { EvtScript N(802430E0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_LOOP(20) EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, EVT_VAR(10)) EVT_CALL(GetCurrentPartner, EVT_VAR(10))
EVT_IF_NE(EVT_VAR(10), 0) EVT_IF_NE(EVT_VAR(10), 0)
@ -345,7 +345,7 @@ static s32 N(pad_3738)[] = {
}; };
EvtScript N(80243740) = { EvtScript N(80243740) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_SUSPEND_GROUP(1) EVT_SUSPEND_GROUP(1)
EVT_CALL(ShowKeyChoicePopup) EVT_CALL(ShowKeyChoicePopup)
EVT_IF_EQ(EVT_VAR(0), 0) EVT_IF_EQ(EVT_VAR(0), 0)
@ -794,7 +794,7 @@ ApiStatus N(func_8024086C_C31D4C)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -804,10 +804,10 @@ ApiStatus N(func_8024086C_C31D4C)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }
@ -881,7 +881,7 @@ ApiStatus N(func_802419B0_C32E90)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -891,10 +891,10 @@ ApiStatus N(func_802419B0_C32E90)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }
@ -986,15 +986,15 @@ void N(func_80241D04_C331E4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
phi_s2 = TRUE; phi_s2 = TRUE;
} }
if (playerData->currentPartner == 2) { if (playerData->currentPartner == PARTNER_KOOPER) {
if (gPartnerActionStatus.actionState.b[0] == playerData->currentPartner) { if (gPartnerActionStatus.partnerActionState == playerData->currentPartner) {
phi_s2 = TRUE; phi_s2 = TRUE;
} }
} }
} }
if (((playerData->currentPartner == 1) && (gPartnerActionStatus.actionState.b[0] != 0)) || if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE)) ||
((playerData->currentPartner == 3) && (gPartnerActionStatus.actionState.b[0] == 2))) { ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) {
posX = npc->pos.x; posX = npc->pos.x;
posZ = npc->pos.z; posZ = npc->pos.z;
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
@ -1007,7 +1007,7 @@ void N(func_80241D04_C331E4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
ai_enemy_play_sound(npc, 0xB000000E, 0); ai_enemy_play_sound(npc, 0xB000000E, 0);
npc->currentAnim.w = enemy->animList[11]; npc->currentAnim.w = enemy->animList[11];
npc->duration = 10; npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
} }
@ -1147,7 +1147,7 @@ ApiStatus N(func_80242480_C33960)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 40.0f; territory.unk_18 = 40.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 30; npc->duration = 30;
npc->currentAnim.w = enemy->animList[10]; npc->currentAnim.w = enemy->animList[10];
@ -1158,12 +1158,12 @@ ApiStatus N(func_80242480_C33960)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 40; script->functionTemp[1] = 40;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) {

View File

@ -157,7 +157,7 @@ EvtScript N(npcAI_802435E4) = {
EVT_CALL(DisablePlayerPhysics, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(func_802D2B6C) EVT_CALL(func_802D2B6C)
EVT_CALL(DisablePartnerAI, 0) EVT_CALL(DisablePartnerAI, 0)
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 1) EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2)) EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 20) EVT_ADD(EVT_VAR(1), 20)
@ -378,7 +378,7 @@ void N(func_802417F8_C37D28)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
} else { } else {
npc->rotation.y = 0.0f; npc->rotation.y = 0.0f;
npc->flags &= ~0x00200000; npc->flags &= ~0x00200000;
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
disable_player_input(); disable_player_input();
partner_disable_input(); partner_disable_input();
npc->duration = 0; npc->duration = 0;
@ -422,7 +422,7 @@ void N(func_80241B4C_C3807C)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (!(npc->pos.y < (posY + temp_f20))) { if (!(npc->pos.y < (posY + temp_f20))) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc->pos.y = posY + temp_f20; npc->pos.y = posY + temp_f20;
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var);
npc->duration = 10; npc->duration = 10;
script->functionTemp[0] = 18; script->functionTemp[0] = 18;
} }
@ -444,7 +444,7 @@ void N(func_80241D14_C38244)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
npc->duration++; npc->duration++;
if (npc->duration >= 3) { if (npc->duration >= 3) {
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
npc->duration = 0; npc->duration = 0;
script->functionTemp[0] = 100; script->functionTemp[0] = 100;
} else { } else {
@ -491,7 +491,7 @@ void N(func_80241E3C_C3836C)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
npc->moveToPos.y = npc->pos.y; npc->moveToPos.y = npc->pos.y;
script->functionTemp[0] = 12; script->functionTemp[0] = 12;

View File

@ -404,15 +404,15 @@ void N(func_80240704_C3B114)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
phi_s2 = TRUE; phi_s2 = TRUE;
} }
if (playerData->currentPartner == 2) { if (playerData->currentPartner == PARTNER_KOOPER) {
if (gPartnerActionStatus.actionState.b[0] == playerData->currentPartner) { if (gPartnerActionStatus.partnerActionState == playerData->currentPartner) {
phi_s2 = TRUE; phi_s2 = TRUE;
} }
} }
} }
if (((playerData->currentPartner == 1) && (gPartnerActionStatus.actionState.b[0] != 0)) || if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE)) ||
((playerData->currentPartner == 3) && (gPartnerActionStatus.actionState.b[0] == 2))) { ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) {
posX = npc->pos.x; posX = npc->pos.x;
posZ = npc->pos.z; posZ = npc->pos.z;
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
@ -425,7 +425,7 @@ void N(func_80240704_C3B114)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
ai_enemy_play_sound(npc, 0xB000000E, 0); ai_enemy_play_sound(npc, 0xB000000E, 0);
npc->currentAnim.w = enemy->animList[11]; npc->currentAnim.w = enemy->animList[11];
npc->duration = 10; npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
} }
@ -565,7 +565,7 @@ ApiStatus N(func_80240E80_C3B890)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 40.0f; territory.unk_18 = 40.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 30; npc->duration = 30;
npc->currentAnim.w = enemy->animList[10]; npc->currentAnim.w = enemy->animList[10];
@ -576,12 +576,12 @@ ApiStatus N(func_80240E80_C3B890)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 40; script->functionTemp[1] = 40;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) {
@ -669,7 +669,7 @@ ApiStatus N(func_802411D0_C3BBE0)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -679,10 +679,10 @@ ApiStatus N(func_802411D0_C3BBE0)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }

View File

@ -89,7 +89,7 @@ static s32** N(varStash) = NULL;
#include "world/common/StashVars.inc.c" #include "world/common/StashVars.inc.c"
EvtScript N(80240624) = { EvtScript N(80240624) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 2) EVT_CALL(SetTimeFreezeMode, 2)
EVT_WAIT_FRAMES(40) EVT_WAIT_FRAMES(40)
EVT_CALL(ShowGotItem, EVT_VAR(0), 0, 0) EVT_CALL(ShowGotItem, EVT_VAR(0), 0, 0)

View File

@ -311,15 +311,15 @@ void N(func_802406A4_C3E294)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
phi_s2 = TRUE; phi_s2 = TRUE;
} }
if (playerData->currentPartner == 2) { if (playerData->currentPartner == PARTNER_KOOPER) {
if (gPartnerActionStatus.actionState.b[0] == playerData->currentPartner) { if (gPartnerActionStatus.partnerActionState == playerData->currentPartner) {
phi_s2 = TRUE; phi_s2 = TRUE;
} }
} }
} }
if (((playerData->currentPartner == 1) && (gPartnerActionStatus.actionState.b[0] != 0)) || if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE)) ||
((playerData->currentPartner == 3) && (gPartnerActionStatus.actionState.b[0] == 2))) { ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) {
posX = npc->pos.x; posX = npc->pos.x;
posZ = npc->pos.z; posZ = npc->pos.z;
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
@ -332,7 +332,7 @@ void N(func_802406A4_C3E294)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
ai_enemy_play_sound(npc, 0xB000000E, 0); ai_enemy_play_sound(npc, 0xB000000E, 0);
npc->currentAnim.w = enemy->animList[11]; npc->currentAnim.w = enemy->animList[11];
npc->duration = 10; npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
} }
@ -472,7 +472,7 @@ ApiStatus N(func_80240E20_C3EA10)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 40.0f; territory.unk_18 = 40.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 30; npc->duration = 30;
npc->currentAnim.w = enemy->animList[10]; npc->currentAnim.w = enemy->animList[10];
@ -483,12 +483,12 @@ ApiStatus N(func_80240E20_C3EA10)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 40; script->functionTemp[1] = 40;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) {
@ -576,7 +576,7 @@ ApiStatus N(func_80241170_C3ED60)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -586,10 +586,10 @@ ApiStatus N(func_80241170_C3ED60)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }

View File

@ -308,7 +308,7 @@ EvtScript N(npcAI_802444E4) = {
EVT_CALL(DisablePlayerPhysics, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(func_802D2B6C) EVT_CALL(func_802D2B6C)
EVT_CALL(DisablePartnerAI, 0) EVT_CALL(DisablePartnerAI, 0)
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 1) EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2)) EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 20) EVT_ADD(EVT_VAR(1), 20)
@ -1019,7 +1019,7 @@ ApiStatus N(func_802414AC_C4125C)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -1029,10 +1029,10 @@ ApiStatus N(func_802414AC_C4125C)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }
@ -1195,7 +1195,7 @@ void N(func_80242F94_C42D44)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
} else { } else {
npc->rotation.y = 0.0f; npc->rotation.y = 0.0f;
npc->flags &= ~0x00200000; npc->flags &= ~0x00200000;
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
disable_player_input(); disable_player_input();
partner_disable_input(); partner_disable_input();
npc->duration = 0; npc->duration = 0;
@ -1239,7 +1239,7 @@ void N(func_802432E8_C43098)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (!(npc->pos.y < (posY + temp_f20))) { if (!(npc->pos.y < (posY + temp_f20))) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc->pos.y = posY + temp_f20; npc->pos.y = posY + temp_f20;
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var);
npc->duration = 10; npc->duration = 10;
script->functionTemp[0] = 18; script->functionTemp[0] = 18;
} }
@ -1261,7 +1261,7 @@ void N(func_802434B0_C43260)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
npc->duration++; npc->duration++;
if (npc->duration >= 3) { if (npc->duration >= 3) {
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
npc->duration = 0; npc->duration = 0;
script->functionTemp[0] = 100; script->functionTemp[0] = 100;
} else { } else {
@ -1308,7 +1308,7 @@ void N(func_802435D8_C43388)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
npc->moveToPos.y = npc->pos.y; npc->moveToPos.y = npc->pos.y;
script->functionTemp[0] = 12; script->functionTemp[0] = 12;

View File

@ -360,7 +360,7 @@ EvtScript N(npcAI_802443DC) = {
EVT_CALL(DisablePlayerPhysics, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(func_802D2B6C) EVT_CALL(func_802D2B6C)
EVT_CALL(DisablePartnerAI, 0) EVT_CALL(DisablePartnerAI, 0)
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 1) EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2)) EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 20) EVT_ADD(EVT_VAR(1), 20)
@ -651,7 +651,7 @@ ApiStatus N(func_8024061C_C471FC)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -661,10 +661,10 @@ ApiStatus N(func_8024061C_C471FC)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }
@ -753,15 +753,15 @@ void N(func_80240958_C47538)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
phi_s2 = TRUE; phi_s2 = TRUE;
} }
if (playerData->currentPartner == 2) { if (playerData->currentPartner == PARTNER_KOOPER) {
if (gPartnerActionStatus.actionState.b[0] == playerData->currentPartner) { if (gPartnerActionStatus.partnerActionState == playerData->currentPartner) {
phi_s2 = TRUE; phi_s2 = TRUE;
} }
} }
} }
if (((playerData->currentPartner == 1) && (gPartnerActionStatus.actionState.b[0] != 0)) || if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE)) ||
((playerData->currentPartner == 3) && (gPartnerActionStatus.actionState.b[0] == 2))) { ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) {
posX = npc->pos.x; posX = npc->pos.x;
posZ = npc->pos.z; posZ = npc->pos.z;
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
@ -774,7 +774,7 @@ void N(func_80240958_C47538)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
ai_enemy_play_sound(npc, 0xB000000E, 0); ai_enemy_play_sound(npc, 0xB000000E, 0);
npc->currentAnim.w = enemy->animList[11]; npc->currentAnim.w = enemy->animList[11];
npc->duration = 10; npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
} }
@ -914,7 +914,7 @@ ApiStatus N(func_802410D4_C47CB4)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 40.0f; territory.unk_18 = 40.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 30; npc->duration = 30;
npc->currentAnim.w = enemy->animList[10]; npc->currentAnim.w = enemy->animList[10];
@ -925,12 +925,12 @@ ApiStatus N(func_802410D4_C47CB4)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 40; script->functionTemp[1] = 40;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) {
@ -1101,7 +1101,7 @@ void N(func_80242C1C_C497FC)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
} else { } else {
npc->rotation.y = 0.0f; npc->rotation.y = 0.0f;
npc->flags &= ~0x00200000; npc->flags &= ~0x00200000;
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
disable_player_input(); disable_player_input();
partner_disable_input(); partner_disable_input();
npc->duration = 0; npc->duration = 0;
@ -1145,7 +1145,7 @@ void N(func_80242F70_C49B50)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (!(npc->pos.y < (posY + temp_f20))) { if (!(npc->pos.y < (posY + temp_f20))) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc->pos.y = posY + temp_f20; npc->pos.y = posY + temp_f20;
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var);
npc->duration = 10; npc->duration = 10;
script->functionTemp[0] = 18; script->functionTemp[0] = 18;
} }
@ -1167,7 +1167,7 @@ void N(func_80243138_C49D18)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
npc->duration++; npc->duration++;
if (npc->duration >= 3) { if (npc->duration >= 3) {
if (gPartnerActionStatus.actionState.b[3] != 9) { if (gPartnerActionStatus.actingPartner != 9) {
npc->duration = 0; npc->duration = 0;
script->functionTemp[0] = 100; script->functionTemp[0] = 100;
} else { } else {
@ -1214,7 +1214,7 @@ void N(func_80243260_C49E40)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
npc->moveToPos.y = npc->pos.y; npc->moveToPos.y = npc->pos.y;
script->functionTemp[0] = 12; script->functionTemp[0] = 12;

View File

@ -134,7 +134,7 @@ static s32** N(varStash) = NULL;
#include "world/common/StashVars.inc.c" #include "world/common/StashVars.inc.c"
EvtScript N(80240874) = { EvtScript N(80240874) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 2) EVT_CALL(SetTimeFreezeMode, 2)
EVT_WAIT_FRAMES(40) EVT_WAIT_FRAMES(40)
EVT_CALL(ShowGotItem, EVT_VAR(0), 0, 0) EVT_CALL(ShowGotItem, EVT_VAR(0), 0, 0)

View File

@ -420,7 +420,7 @@ static s32 N(pad_2AC8)[] = {
}; };
EvtScript N(80242AD0) = { EvtScript N(80242AD0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_SUSPEND_GROUP(1) EVT_SUSPEND_GROUP(1)
EVT_CALL(ShowKeyChoicePopup) EVT_CALL(ShowKeyChoicePopup)
EVT_IF_EQ(EVT_VAR(0), 0) EVT_IF_EQ(EVT_VAR(0), 0)
@ -493,7 +493,7 @@ ApiStatus N(func_8024061C_C4FB2C)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -503,10 +503,10 @@ ApiStatus N(func_8024061C_C4FB2C)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }

View File

@ -668,15 +668,15 @@ void N(func_802406A4_C52BE4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
phi_s2 = TRUE; phi_s2 = TRUE;
} }
if (playerData->currentPartner == 2) { if (playerData->currentPartner == PARTNER_KOOPER) {
if (gPartnerActionStatus.actionState.b[0] == playerData->currentPartner) { if (gPartnerActionStatus.partnerActionState == playerData->currentPartner) {
phi_s2 = TRUE; phi_s2 = TRUE;
} }
} }
} }
if (((playerData->currentPartner == 1) && (gPartnerActionStatus.actionState.b[0] != 0)) || if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE)) ||
((playerData->currentPartner == 3) && (gPartnerActionStatus.actionState.b[0] == 2))) { ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) {
posX = npc->pos.x; posX = npc->pos.x;
posZ = npc->pos.z; posZ = npc->pos.z;
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
@ -689,7 +689,7 @@ void N(func_802406A4_C52BE4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
ai_enemy_play_sound(npc, 0xB000000E, 0); ai_enemy_play_sound(npc, 0xB000000E, 0);
npc->currentAnim.w = enemy->animList[11]; npc->currentAnim.w = enemy->animList[11];
npc->duration = 10; npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
} }
@ -829,7 +829,7 @@ ApiStatus N(func_80240E20_C53360)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 40.0f; territory.unk_18 = 40.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 30; npc->duration = 30;
npc->currentAnim.w = enemy->animList[10]; npc->currentAnim.w = enemy->animList[10];
@ -840,12 +840,12 @@ ApiStatus N(func_80240E20_C53360)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 40; script->functionTemp[1] = 40;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) {
@ -933,7 +933,7 @@ ApiStatus N(func_80241170_C536B0)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 65.0f; territory.unk_18 = 65.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -943,10 +943,10 @@ ApiStatus N(func_80241170_C536B0)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
} }

View File

@ -386,7 +386,7 @@ EvtScript N(idle_80242494) = {
}; };
EvtScript N(npcAI_802426B0) = { EvtScript N(npcAI_802426B0) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2039, 0) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2039, 0)
EVT_CALL(ShowSleepBubble, 0, 0, 50, 2, 552, 111, 128, 30, EVT_VAR(0)) EVT_CALL(ShowSleepBubble, 0, 0, 50, 2, 552, 111, 128, 30, EVT_VAR(0))
EVT_WAIT_FRAMES(360) EVT_WAIT_FRAMES(360)
@ -411,7 +411,7 @@ EvtScript N(npcAI_802426B0) = {
}; };
EvtScript N(npcAI_80242834) = { EvtScript N(npcAI_80242834) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_world_tubba_Palette_00_Anim_D) EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_world_tubba_Palette_00_Anim_D)
EVT_THREAD EVT_THREAD
EVT_LOOP(0) EVT_LOOP(0)
@ -654,7 +654,7 @@ static s32 N(pad_36D8)[] = {
s32** N(varStash) = NULL; // StashVars.inc.c data s32** N(varStash) = NULL; // StashVars.inc.c data
EvtScript N(802436E4) = { EvtScript N(802436E4) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 2) EVT_CALL(SetTimeFreezeMode, 2)
EVT_WAIT_FRAMES(40) EVT_WAIT_FRAMES(40)
EVT_CALL(ShowGotItem, EVT_VAR(0), 0, 0) EVT_CALL(ShowGotItem, EVT_VAR(0), 0, 0)

View File

@ -2190,7 +2190,7 @@ void N(func_802430C8_95E2C8)(Unk_Struct_1* ptr, s32 arg1) {
if (ptr->unk_1C >= 6) { if (ptr->unk_1C >= 6) {
if (fabsf(get_clamped_angle_diff(atan2(125.0f, -42.0f, 152.0f, -61.0f), atan2(125.0f, -42.0f, playerStatus->position.x, if (fabsf(get_clamped_angle_diff(atan2(125.0f, -42.0f, 152.0f, -61.0f), atan2(125.0f, -42.0f, playerStatus->position.x,
playerStatus->position.z))) < 30.0f) { playerStatus->position.z))) < 30.0f) {
start_script(&N(80248504), 1, 0); start_script(&N(80248504), EVT_PRIORITY_1, 0);
ptr->unk_20 = 4; ptr->unk_20 = 4;
} }
} }

View File

@ -364,7 +364,7 @@ EvtScript N(toggleVis_8024468C) = {
}; };
EvtScript N(8024486C) = { EvtScript N(8024486C) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(func_802D2C14, 1) EVT_CALL(func_802D2C14, 1)
EVT_CALL(PlayerMoveTo, 230, 10, 20) EVT_CALL(PlayerMoveTo, 230, 10, 20)
@ -398,7 +398,7 @@ EvtScript N(8024486C) = {
}; };
EvtScript N(80244A68) = { EvtScript N(80244A68) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(func_802D2C14, 1) EVT_CALL(func_802D2C14, 1)
EVT_CALL(PlayerMoveTo, 230, -70, 20) EVT_CALL(PlayerMoveTo, 230, -70, 20)

View File

@ -72,7 +72,7 @@ EvtScript N(80240814) = {
}; };
EvtScript N(80240880) = { EvtScript N(80240880) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -55,7 +55,7 @@ static s32 N(pad_8CC) = {
}; };
EvtScript N(updateTexturePan_802408D0) = { EvtScript N(updateTexturePan_802408D0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(EVT_VAR(5), 1) EVT_IF_EQ(EVT_VAR(5), 1)
EVT_IF_EQ(EVT_VAR(6), 1) EVT_IF_EQ(EVT_VAR(6), 1)
EVT_IF_EQ(EVT_VAR(7), 1) EVT_IF_EQ(EVT_VAR(7), 1)
@ -72,7 +72,7 @@ EvtScript N(updateTexturePan_802408D0) = {
}; };
EvtScript N(8024096C) = { EvtScript N(8024096C) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -58,7 +58,7 @@ EvtScript N(makeEntities) = {
}; };
EvtScript N(80242680) = { EvtScript N(80242680) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))
@ -942,7 +942,7 @@ void N(func_80241364_CB00A4)(Evt* script, NpcAISettings* npcAISettings, EnemyTer
s32 var; s32 var;
if (func_800490B4(territory, enemy, npcAISettings->chaseRadius, npcAISettings->unk_28.f, 1) == 0) { if (func_800490B4(territory, enemy, npcAISettings->chaseRadius, npcAISettings->unk_28.f, 1) == 0) {
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
npc->duration = 25; npc->duration = 25;
script->functionTemp[0] = 14; script->functionTemp[0] = 14;
@ -991,7 +991,7 @@ ApiStatus N(func_8024150C_CB024C)(Evt* script, s32 isInitialCall) {
territory.unk_18 = 100.0f; territory.unk_18 = 100.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || (enemy->unk_B0 & 4)) { if (isInitialCall || (enemy->unk_B0 & ENEMY_AI_FLAGS_4)) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
@ -1001,10 +1001,10 @@ ApiStatus N(func_8024150C_CB024C)(Evt* script, s32 isInitialCall) {
} else { } else {
npc->flags = (npc->flags & ~0x200) | 0x8; npc->flags = (npc->flags & ~0x200) | 0x8;
} }
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
} }
@ -1098,7 +1098,7 @@ static s32 N(pad_598C) = {
}; };
EvtScript N(80245990) = { EvtScript N(80245990) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -35,7 +35,7 @@ EvtScript N(80241880) = {
}; };
EvtScript N(802418F0) = { EvtScript N(802418F0) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))
@ -149,7 +149,7 @@ static s32 N(pad_2004)[] = {
}; };
EvtScript N(80242010) = { EvtScript N(80242010) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -38,7 +38,7 @@ EvtScript N(802403E0) = {
}; };
EvtScript N(80240450) = { EvtScript N(80240450) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -57,7 +57,7 @@ static s32 N(pad_86C) = {
}; };
EvtScript N(80240870) = { EvtScript N(80240870) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -118,7 +118,7 @@ static s32 N(pad_3A3C) = {
}; };
EvtScript N(80243A40) = { EvtScript N(80243A40) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))
@ -1268,7 +1268,7 @@ void N(func_80241704_CC4F14)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) { if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
x = npc->pos.x; x = npc->pos.x;
y = npc->pos.y; y = npc->pos.y;
@ -1347,7 +1347,7 @@ void N(func_80241B68_CC5378)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20); npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20);
enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC); enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) { if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 12; script->functionTemp[0] = 12;
return; return;
@ -1391,11 +1391,11 @@ ApiStatus N(func_80241DB8_CC55C8)(Evt* script, s32 isInitialCall) {
} }
npc->unk_AB = -3; npc->unk_AB = -3;
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
if (enemy->unk_B4 != 0) { if (enemy->unk_B4 != 0) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }

View File

@ -26,7 +26,7 @@ EvtScript N(802423F0) = {
}; };
EvtScript N(updateTexturePan_80242460) = { EvtScript N(updateTexturePan_80242460) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(EVT_VAR(5), 1) EVT_IF_EQ(EVT_VAR(5), 1)
EVT_IF_EQ(EVT_VAR(6), 1) EVT_IF_EQ(EVT_VAR(6), 1)
EVT_IF_EQ(EVT_VAR(7), 1) EVT_IF_EQ(EVT_VAR(7), 1)
@ -150,7 +150,7 @@ static s32 N(pad_2BF4)[] = {
}; };
EvtScript N(80242C00) = { EvtScript N(80242C00) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))
@ -417,7 +417,7 @@ s32 N(D_80243B18_CCEE28) = {
}; };
EvtScript N(80243B1C) = { EvtScript N(80243B1C) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_SET(EVT_VAR(15), EVT_VAR(0)) EVT_SET(EVT_VAR(15), EVT_VAR(0))
EVT_LABEL(0) EVT_LABEL(0)
EVT_IF_EQ(EVT_AREA_FLAG(35), 1) EVT_IF_EQ(EVT_AREA_FLAG(35), 1)

View File

@ -95,7 +95,7 @@ EvtScript N(main) = {
}; };
EvtScript N(80242EA0) = { EvtScript N(80242EA0) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -37,7 +37,7 @@ EvtScript N(80243280) = {
}; };
EvtScript N(802432F0) = { EvtScript N(802432F0) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))
@ -672,7 +672,7 @@ void N(func_802415B0_CD8890)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
if (script->functionTemp[1] <= 0) { if (script->functionTemp[1] <= 0) {
script->functionTemp[1] = aiSettings->unk_14; script->functionTemp[1] = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) { if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
x = npc->pos.x; x = npc->pos.x;
y = npc->pos.y; y = npc->pos.y;
@ -751,7 +751,7 @@ void N(func_80241A14_CD8CF4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit
npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20); npc->pos.y = y + temp_f22 + (sin_deg(enemy->varTable[2]) * temp_f20);
enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC); enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) { if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
ai_enemy_play_sound(npc, 0x2F4, 0x200000); ai_enemy_play_sound(npc, 0x2F4, 0x200000);
script->functionTemp[0] = 12; script->functionTemp[0] = 12;
return; return;
@ -795,11 +795,11 @@ ApiStatus N(func_80241C64_CD8F44)(Evt* script, s32 isInitialCall) {
} }
npc->unk_AB = -3; npc->unk_AB = -3;
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
if (enemy->unk_B4 != 0) { if (enemy->unk_B4 != 0) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }

View File

@ -43,7 +43,7 @@ static s32 N(pad_8B8)[] = {
}; };
EvtScript N(updateTexturePan_802408C0) = { EvtScript N(updateTexturePan_802408C0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(EVT_VAR(5), 1) EVT_IF_EQ(EVT_VAR(5), 1)
EVT_IF_EQ(EVT_VAR(6), 1) EVT_IF_EQ(EVT_VAR(6), 1)
EVT_IF_EQ(EVT_VAR(7), 1) EVT_IF_EQ(EVT_VAR(7), 1)
@ -152,7 +152,7 @@ static s32 N(pad_E88)[] = {
}; };
EvtScript N(80240E90) = { EvtScript N(80240E90) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_LOOP(0) EVT_LOOP(0)
EVT_CALL(PlayEffect, 0x5E, 0, EVT_FIXED(-16.0), EVT_FIXED(102.0), EVT_FIXED(-4.1), EVT_FIXED(80.9), EVT_FIXED(102.0), EVT_FIXED(-4.1), EVT_FIXED(0.5), 6, 0, 0, 0, 0) EVT_CALL(PlayEffect, 0x5E, 0, EVT_FIXED(-16.0), EVT_FIXED(102.0), EVT_FIXED(-4.1), EVT_FIXED(80.9), EVT_FIXED(102.0), EVT_FIXED(-4.1), EVT_FIXED(0.5), 6, 0, 0, 0, 0)
EVT_CALL(N(func_80240340_CDC9E0)) EVT_CALL(N(func_80240340_CDC9E0))

View File

@ -78,7 +78,7 @@ static s32 N(pad_AF4)[] = {
}; };
EvtScript N(updateTexturePan_80240B00) = { EvtScript N(updateTexturePan_80240B00) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(EVT_VAR(5), 1) EVT_IF_EQ(EVT_VAR(5), 1)
EVT_IF_EQ(EVT_VAR(6), 1) EVT_IF_EQ(EVT_VAR(6), 1)
EVT_IF_EQ(EVT_VAR(7), 1) EVT_IF_EQ(EVT_VAR(7), 1)

View File

@ -49,7 +49,7 @@ EvtScript N(80240D40) = {
#include "world/common/StarSpiritEffectFunc.inc.c" #include "world/common/StarSpiritEffectFunc.inc.c"
EvtScript N(80240DA0) = { EvtScript N(80240DA0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(EVT_VAR(5), 1) EVT_IF_EQ(EVT_VAR(5), 1)
EVT_IF_EQ(EVT_VAR(6), 1) EVT_IF_EQ(EVT_VAR(6), 1)
EVT_IF_EQ(EVT_VAR(7), 1) EVT_IF_EQ(EVT_VAR(7), 1)

View File

@ -39,7 +39,7 @@ EvtScript N(80240D30) = {
}; };
EvtScript N(80240DA0) = { EvtScript N(80240DA0) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -29,7 +29,7 @@ EvtScript N(80240600) = {
}; };
EvtScript N(80240690) = { EvtScript N(80240690) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))
@ -182,7 +182,7 @@ EvtScript N(80241728) = {
}; };
EvtScript N(updateTexturePan_802417A0) = { EvtScript N(updateTexturePan_802417A0) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(EVT_VAR(5), 1) EVT_IF_EQ(EVT_VAR(5), 1)
EVT_IF_EQ(EVT_VAR(6), 1) EVT_IF_EQ(EVT_VAR(6), 1)
EVT_IF_EQ(EVT_VAR(7), 1) EVT_IF_EQ(EVT_VAR(7), 1)

View File

@ -39,7 +39,7 @@ EvtScript N(80242330) = {
}; };
EvtScript N(802423A0) = { EvtScript N(802423A0) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -53,7 +53,7 @@ static s32 N(pad_4734)[] = {
}; };
EvtScript N(80244740) = { EvtScript N(80244740) = {
EVT_SET_GROUP(EVT_GROUP_B) EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(EVT_VAR(10), EVT_VAR(0)) EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1)) EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_SET(EVT_VAR(12), EVT_VAR(2)) EVT_SET(EVT_VAR(12), EVT_VAR(2))

View File

@ -14,27 +14,9 @@
#include "world/common/UnkFunc54.inc.c" #include "world/common/UnkFunc54.inc.c"
#include "world/common/UnkFunc55.inc.c" #include "world/common/UnkFunc55.inc.c" // AI for projectile
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80241414_910AC4); #include "world/common/atomic/enemy/MontyMoleAI.inc.c"
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_802415E0_910C90);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_802416F0_910DA0);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_8024192C_910FDC);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_802419C0_911070);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80241A4C_9110FC);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80241B74_911224);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80241C78_911328);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80241CF0_9113A0);
INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80241D70_911420);
#include "world/common/UnkNpcAIMainFunc7.inc.c" #include "world/common/UnkNpcAIMainFunc7.inc.c"

View File

@ -1,7 +1,7 @@
#include "kgr_02.h" #include "kgr_02.h"
ApiStatus func_80240730_8AAB80(Evt* script, s32 isInitialCall) { ApiStatus func_80240730_8AAB80(Evt* script, s32 isInitialCall) {
if (gPartnerActionStatus.actionState.b[3] == 6) { if (gPartnerActionStatus.actingPartner == PARTNER_WATT) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} else { } else {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
@ -9,7 +9,7 @@ ApiStatus func_80240730_8AAB80(Evt* script, s32 isInitialCall) {
} }
ApiStatus func_80240748_8AAB98(Evt* script, s32 isInitialCall) { ApiStatus func_80240748_8AAB98(Evt* script, s32 isInitialCall) {
if (gPartnerActionStatus.actionState.b[3] != 6) { if (gPartnerActionStatus.actingPartner != PARTNER_WATT) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} else { } else {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -61,7 +61,7 @@ NpcSettings N(goombaNpcSettings) = {
/// @bug Never returns /// @bug Never returns
EvtScript N(ReadWestSign) = { EvtScript N(ReadWestSign) = {
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
// "Eat a Mushroom to regain your energy!" // "Eat a Mushroom to regain your energy!"
EVT_SUSPEND_GROUP(1) EVT_SUSPEND_GROUP(1)
@ -208,7 +208,7 @@ EvtScript N(ReadEastSign) = {
EVT_IF_EQ(LW(0), 1) EVT_IF_EQ(LW(0), 1)
EVT_RETURN EVT_RETURN
EVT_END_IF EVT_END_IF
EVT_SET_GROUP(EVT_GROUP_0) EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, 1) EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ShowMessageAtScreenPos, MSG_kmr_12_sign_to_fortress, 160, 40) EVT_CALL(ShowMessageAtScreenPos, MSG_kmr_12_sign_to_fortress, 160, 40)

View File

@ -44,16 +44,16 @@ ApiStatus func_80241C54_B95094(Evt* script, s32 isInitialCall) {
territory.unk_18 = 200.0f; territory.unk_18 = 200.0f;
territory.unk_1C = 0; territory.unk_1C = 0;
if (isInitialCall || enemy->unk_B0 & 4) { if (isInitialCall || enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
npc->duration = 0; npc->duration = 0;
npc->currentAnim.w = enemy->animList[0]; npc->currentAnim.w = enemy->animList[0];
enemy->varTable[0] = 0; enemy->varTable[0] = 0;
if (enemy->unk_B0 & 4) { if (enemy->unk_B0 & ENEMY_AI_FLAGS_4) {
script->functionTemp[0] = 99; script->functionTemp[0] = 99;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
enemy->unk_B0 &= ~4; enemy->unk_B0 &= ~ENEMY_AI_FLAGS_4;
} }
} }

View File

@ -203,7 +203,7 @@ ApiStatus func_802406C4_9EE2B4(Evt* script, s32 isInitialCall) {
break; break;
} }
script2 = start_script(phi_a0, 1, 0); script2 = start_script(phi_a0, EVT_PRIORITY_1, 0);
script->varTable[temp_s1_2 + 6] = script2->id; script->varTable[temp_s1_2 + 6] = script2->id;
switch(temp_s1_2) { switch(temp_s1_2) {

Some files were not shown because too many files have changed in this diff Show More