mirror of
https://github.com/pmret/papermario.git
synced 2024-10-18 10:42:43 +02:00
isBattle refactor (#1211)
This commit is contained in:
parent
ba4499e2a7
commit
5929e49b72
@ -1427,7 +1427,7 @@ typedef struct GameStatus {
|
|||||||
/* 0x06A */ s8 demoStickX;
|
/* 0x06A */ s8 demoStickX;
|
||||||
/* 0x06B */ s8 demoStickY;
|
/* 0x06B */ s8 demoStickY;
|
||||||
/* 0x06C */ s32 mainScriptID;
|
/* 0x06C */ s32 mainScriptID;
|
||||||
/* 0x070 */ s8 isBattle;
|
/* 0x070 */ s8 context;
|
||||||
/* 0x071 */ s8 demoState; // see DemoState enum
|
/* 0x071 */ s8 demoState; // see DemoState enum
|
||||||
/* 0x072 */ s8 nextDemoScene; /* which part of the demo to play next */
|
/* 0x072 */ s8 nextDemoScene; /* which part of the demo to play next */
|
||||||
/* 0x073 */ u8 contBitPattern;
|
/* 0x073 */ u8 contBitPattern;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#define cos_deg dead_cos_deg
|
#define cos_deg dead_cos_deg
|
||||||
#define sin_cos_deg dead_sin_cos_deg
|
#define sin_cos_deg dead_sin_cos_deg
|
||||||
#define gPlayerStatus dead_gPlayerStatus
|
#define gPlayerStatus dead_gPlayerStatus
|
||||||
#define is_point_within_region dead_is_point_within_region
|
#define is_point_outside_territory dead_is_point_outside_territory
|
||||||
#define npc_raycast_down_sides dead_npc_raycast_down_sides
|
#define npc_raycast_down_sides dead_npc_raycast_down_sides
|
||||||
#define basic_ai_check_player_dist dead_basic_ai_check_player_dist
|
#define basic_ai_check_player_dist dead_basic_ai_check_player_dist
|
||||||
#define fx_emote dead_fx_emote
|
#define fx_emote dead_fx_emote
|
||||||
|
@ -3526,6 +3526,12 @@ enum EffectGfxDataFlags {
|
|||||||
|
|
||||||
#include "move_enum.h"
|
#include "move_enum.h"
|
||||||
|
|
||||||
|
enum GameContext {
|
||||||
|
CONTEXT_WORLD = 0,
|
||||||
|
CONTEXT_BATTLE = 1,
|
||||||
|
CONTEXT_PAUSE = 2,
|
||||||
|
};
|
||||||
|
|
||||||
enum DemoState {
|
enum DemoState {
|
||||||
DEMO_STATE_NONE = 0,
|
DEMO_STATE_NONE = 0,
|
||||||
DEMO_STATE_ACTIVE = 1,
|
DEMO_STATE_ACTIVE = 1,
|
||||||
@ -4556,14 +4562,14 @@ enum EnemyFlags {
|
|||||||
|
|
||||||
// used with enemy->aiFlags
|
// used with enemy->aiFlags
|
||||||
enum EnemyAIFlags {
|
enum EnemyAIFlags {
|
||||||
ENEMY_AI_FLAG_1 = 0x00000001,
|
AI_FLAG_1 = 0x00000001,
|
||||||
ENEMY_AI_FLAG_2 = 0x00000002, // do not move; do not sense player
|
AI_FLAG_CANT_DETECT_PLAYER = 0x00000002,
|
||||||
ENEMY_AI_FLAG_SUSPEND = 0x00000004,
|
AI_FLAG_SUSPEND = 0x00000004,
|
||||||
ENEMY_AI_FLAG_8 = 0x00000008,
|
AI_FLAG_SKIP_EMOTE_AFTER_FLEE = 0x00000008,
|
||||||
ENEMY_AI_FLAG_10 = 0x00000010,
|
AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE = 0x00000010,
|
||||||
ENEMY_AI_FLAG_20 = 0x00000020,
|
AI_FLAG_OUTSIDE_TERRITORY = 0x00000020,
|
||||||
ENEMY_AI_FLAG_40 = 0x00000040,
|
AI_FLAG_NEEDS_HEADING = 0x00000040,
|
||||||
ENEMY_AI_FLAG_80 = 0x00000080,
|
AI_FLAG_80 = 0x00000080,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EnemyAIStates {
|
enum EnemyAIStates {
|
||||||
@ -4613,7 +4619,7 @@ enum EnemyDetectFlags {
|
|||||||
AI_DETECT_FLAG_8 = 0x08,
|
AI_DETECT_FLAG_8 = 0x08,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EnemyTerritoryFlags {
|
enum TerritoryFlags {
|
||||||
AI_TERRITORY_IGNORE_HIDING = 0x01, // bow and sushi dont prevent enemy detection
|
AI_TERRITORY_IGNORE_HIDING = 0x01, // bow and sushi dont prevent enemy detection
|
||||||
AI_TERRITORY_IGNORE_ELEVATION = 0x02, // vertical size of detection volume is ignored
|
AI_TERRITORY_IGNORE_ELEVATION = 0x02, // vertical size of detection volume is ignored
|
||||||
};
|
};
|
||||||
|
@ -414,7 +414,7 @@ s32 suspend_all_script(s32 id);
|
|||||||
s32 resume_all_script(s32 id);
|
s32 resume_all_script(s32 id);
|
||||||
|
|
||||||
s32 create_shadow_type(s32 type, f32 x, f32 y, f32 z);
|
s32 create_shadow_type(s32 type, f32 x, f32 y, f32 z);
|
||||||
s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ);
|
b32 is_point_outside_territory(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ);
|
||||||
PlayerData* get_player_data(void);
|
PlayerData* get_player_data(void);
|
||||||
|
|
||||||
b32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32);
|
b32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32);
|
||||||
|
@ -424,7 +424,7 @@ extern EncounterStatus gCurrentEncounter;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s32 basic_ai_check_player_dist(EnemyDetectVolume* arg0, Enemy* arg1, f32 arg2, f32 arg3, s8 arg4);
|
b32 basic_ai_check_player_dist(EnemyDetectVolume* arg0, Enemy* arg1, f32 arg2, f32 arg3, b8 arg4);
|
||||||
|
|
||||||
/// The default Npc::onUpdate and Npc::onRender callback.
|
/// The default Npc::onUpdate and Npc::onRender callback.
|
||||||
void STUB_npc_callback(Npc*);
|
void STUB_npc_callback(Npc*);
|
||||||
|
@ -51,7 +51,7 @@ void state_step_enter_world(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
||||||
|
|
||||||
if (!gLoadedFromFileSelect) {
|
if (!gLoadedFromFileSelect) {
|
||||||
@ -155,7 +155,7 @@ void state_step_change_map(void) {
|
|||||||
if (gMapTransitionStateTime != 0) {
|
if (gMapTransitionStateTime != 0) {
|
||||||
gMapTransitionStateTime--;
|
gMapTransitionStateTime--;
|
||||||
} else {
|
} else {
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
||||||
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP);
|
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP);
|
||||||
set_time_freeze_mode(TIME_FREEZE_NORMAL);
|
set_time_freeze_mode(TIME_FREEZE_NORMAL);
|
||||||
@ -230,7 +230,7 @@ void state_step_game_over(void) {
|
|||||||
if (gMapTransitionStateTime != 0) {
|
if (gMapTransitionStateTime != 0) {
|
||||||
gMapTransitionStateTime--;
|
gMapTransitionStateTime--;
|
||||||
} else {
|
} else {
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
||||||
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP);
|
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP);
|
||||||
nuContRmbForceStopEnd();
|
nuContRmbForceStopEnd();
|
||||||
|
65
src/23680.c
65
src/23680.c
@ -295,16 +295,16 @@ void spawn_drops(Enemy* enemy) {
|
|||||||
s32 get_coin_drop_amount(Enemy* enemy) {
|
s32 get_coin_drop_amount(Enemy* enemy) {
|
||||||
EncounterStatus* currentEncounter = &gCurrentEncounter;
|
EncounterStatus* currentEncounter = &gCurrentEncounter;
|
||||||
EnemyDrops* enemyDrops = enemy->drops;
|
EnemyDrops* enemyDrops = enemy->drops;
|
||||||
s32 maxCoinBonus = enemyDrops->maxCoinBonus;
|
s32 max = enemyDrops->maxCoinBonus;
|
||||||
s32 amt = enemyDrops->minCoinBonus;
|
s32 amt = enemyDrops->minCoinBonus;
|
||||||
s32 minTemp = enemyDrops->minCoinBonus;
|
s32 minTemp = enemyDrops->minCoinBonus;
|
||||||
|
|
||||||
if (maxCoinBonus < amt) {
|
if (max < amt) {
|
||||||
amt = enemyDrops->maxCoinBonus;
|
amt = enemyDrops->maxCoinBonus;
|
||||||
maxCoinBonus = enemyDrops->minCoinBonus;
|
max = enemyDrops->minCoinBonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
minTemp = maxCoinBonus - amt;
|
minTemp = max - amt;
|
||||||
if ((amt < 0) || (minTemp != 0)) {
|
if ((amt < 0) || (minTemp != 0)) {
|
||||||
amt = rand_int(minTemp) - -amt;
|
amt = rand_int(minTemp) - -amt;
|
||||||
}
|
}
|
||||||
@ -392,24 +392,24 @@ s32 func_80048F0C(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ) {
|
b32 is_point_outside_territory(s32 shape, f32 centerX, f32 centerZ, f32 pointX, f32 pointZ, f32 sizeX, f32 sizeZ) {
|
||||||
f32 dist1;
|
f32 dist1;
|
||||||
f32 dist2;
|
f32 dist2;
|
||||||
|
|
||||||
switch (shape) {
|
switch (shape) {
|
||||||
case 0:
|
case SHAPE_CYLINDER:
|
||||||
dist1 = dist2D(pointX, pointY, centerX, centerY);
|
dist1 = dist2D(centerX, centerZ, pointX, pointZ);
|
||||||
return (sizeX < dist1);
|
return (sizeX < dist1);
|
||||||
case 1:
|
case SHAPE_RECT:
|
||||||
dist1 = dist2D(pointX, 0, centerX, 0);
|
dist1 = dist2D(centerX, 0, pointX, 0);
|
||||||
dist2 = dist2D(0, pointY, 0, centerY);
|
dist2 = dist2D(0, centerZ, 0, pointZ);
|
||||||
return ((sizeX < dist1) || (sizeZ < dist2));
|
return ((sizeX < dist1) || (sizeZ < dist2));
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 radius, f32 fwdPosOffset, s8 useWorldYaw) {
|
b32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 radius, f32 fwdPosOffset, b8 useWorldYaw) {
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||||
PartnerStatus* partnerStatus;
|
PartnerStatus* partnerStatus;
|
||||||
@ -417,7 +417,7 @@ s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 r
|
|||||||
f32 dist;
|
f32 dist;
|
||||||
s32 skipCheckForPlayer;
|
s32 skipCheckForPlayer;
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_2) {
|
if (enemy->aiFlags & AI_FLAG_CANT_DETECT_PLAYER) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 r
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (territory->sizeX | territory->sizeZ && is_point_within_region(territory->shape,
|
if (territory->sizeX | territory->sizeZ && is_point_outside_territory(territory->shape,
|
||||||
territory->pointX, territory->pointZ,
|
territory->pointX, territory->pointZ,
|
||||||
playerStatus->pos.x, playerStatus->pos.z,
|
playerStatus->pos.x, playerStatus->pos.z,
|
||||||
territory->sizeX, territory->sizeZ)) {
|
territory->sizeX, territory->sizeZ)) {
|
||||||
@ -563,8 +563,8 @@ void basic_ai_wander_init(Evt* script, MobileAISettings* npcAISettings, EnemyDet
|
|||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_40;
|
enemy->aiFlags &= ~AI_FLAG_NEEDS_HEADING;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_20;
|
enemy->aiFlags &= ~AI_FLAG_OUTSIDE_TERRITORY;
|
||||||
script->AI_TEMP_STATE = AI_STATE_WANDER;
|
script->AI_TEMP_STATE = AI_STATE_WANDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,6 +576,7 @@ void basic_ai_wander(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
|
|||||||
EffectInstance* sp34;
|
EffectInstance* sp34;
|
||||||
f32 yaw;
|
f32 yaw;
|
||||||
|
|
||||||
|
// search for the player
|
||||||
if (aiSettings->playerSearchInterval >= 0) {
|
if (aiSettings->playerSearchInterval >= 0) {
|
||||||
if (script->functionTemp[1] <= 0) {
|
if (script->functionTemp[1] <= 0) {
|
||||||
script->functionTemp[1] = aiSettings->playerSearchInterval;
|
script->functionTemp[1] = aiSettings->playerSearchInterval;
|
||||||
@ -588,8 +589,8 @@ void basic_ai_wander(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
|
|||||||
npc->yaw = yaw;
|
npc->yaw = yaw;
|
||||||
ai_enemy_play_sound(npc, SOUND_AI_ALERT_A, SOUND_PARAM_MORE_QUIET);
|
ai_enemy_play_sound(npc, SOUND_AI_ALERT_A, SOUND_PARAM_MORE_QUIET);
|
||||||
fx_emote(EMOTE_EXCLAMATION, 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->aiFlags &= ~ENEMY_AI_FLAG_40;
|
enemy->aiFlags &= ~AI_FLAG_NEEDS_HEADING;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_20;
|
enemy->aiFlags &= ~AI_FLAG_OUTSIDE_TERRITORY;
|
||||||
|
|
||||||
if (enemy->npcSettings->actionFlags & AI_ACTION_JUMP_WHEN_SEE_PLAYER) {
|
if (enemy->npcSettings->actionFlags & AI_ACTION_JUMP_WHEN_SEE_PLAYER) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_ALERT_INIT;
|
script->AI_TEMP_STATE = AI_STATE_ALERT_INIT;
|
||||||
@ -603,37 +604,39 @@ void basic_ai_wander(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
|
|||||||
script->functionTemp[1]--;
|
script->functionTemp[1]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the wander we've reached the boundary of the territory
|
// check if we've wandered beyond the boundary of the territory
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape,
|
||||||
enemy->territory->wander.centerPos.x,
|
enemy->territory->wander.centerPos.x,
|
||||||
enemy->territory->wander.centerPos.z,
|
enemy->territory->wander.centerPos.z,
|
||||||
npc->pos.x,
|
npc->pos.x,
|
||||||
npc->pos.z,
|
npc->pos.z,
|
||||||
enemy->territory->wander.wanderSize.x,
|
enemy->territory->wander.wanderSize.x,
|
||||||
enemy->territory->wander.wanderSize.z)
|
enemy->territory->wander.wanderSize.z)
|
||||||
&& npc->moveSpeed < dist2D(enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z, npc->pos.x, npc->pos.z)) {
|
&& npc->moveSpeed < dist2D(enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z, npc->pos.x, npc->pos.z)
|
||||||
if (!(enemy->aiFlags & ENEMY_AI_FLAG_20)) {
|
) {
|
||||||
enemy->aiFlags |= (ENEMY_AI_FLAG_20 | ENEMY_AI_FLAG_40);
|
if (!(enemy->aiFlags & AI_FLAG_OUTSIDE_TERRITORY)) {
|
||||||
|
enemy->aiFlags |= (AI_FLAG_OUTSIDE_TERRITORY | AI_FLAG_NEEDS_HEADING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_40) {
|
if (enemy->aiFlags & AI_FLAG_NEEDS_HEADING) {
|
||||||
npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z));
|
npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z));
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_40;
|
enemy->aiFlags &= ~AI_FLAG_NEEDS_HEADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if current heading is deflected by a wall, recalculate yaw to continue pursuing centerPos
|
||||||
x = npc->pos.x;
|
x = npc->pos.x;
|
||||||
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, 2.0 * npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionDiameter)) {
|
if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, 2.0 * npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionDiameter)) {
|
||||||
yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z));
|
yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z));
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_40;
|
enemy->aiFlags &= ~AI_FLAG_NEEDS_HEADING;
|
||||||
ai_check_fwd_collisions(npc, 5.0f, &yaw, NULL, NULL, NULL);
|
ai_check_fwd_collisions(npc, 5.0f, &yaw, NULL, NULL, NULL);
|
||||||
npc->yaw = yaw;
|
npc->yaw = yaw;
|
||||||
}
|
}
|
||||||
stillWithinTerritory = TRUE;
|
stillWithinTerritory = TRUE;
|
||||||
} else if (enemy->aiFlags & ENEMY_AI_FLAG_20) {
|
} else if (enemy->aiFlags & AI_FLAG_OUTSIDE_TERRITORY) {
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_20;
|
enemy->aiFlags &= ~AI_FLAG_OUTSIDE_TERRITORY;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_40;
|
enemy->aiFlags &= ~AI_FLAG_NEEDS_HEADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
// perform the motion
|
// perform the motion
|
||||||
@ -853,7 +856,7 @@ API_CALLABLE(BasicAI_Main) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (isInitialCall || enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
|
|
||||||
@ -868,14 +871,14 @@ API_CALLABLE(BasicAI_Main) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = AI_STATE_WANDER_INIT;
|
script->functionTemp[1] = AI_STATE_WANDER_INIT;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ s32 ai_check_fwd_collisions(Npc* npc, f32 time, f32* outYaw, f32* outDistFwd, f3
|
|||||||
f32 cwHitDist = -1.0f;
|
f32 cwHitDist = -1.0f;
|
||||||
f32 ccwHitDist = -1.0f;
|
f32 ccwHitDist = -1.0f;
|
||||||
f32 yaw;
|
f32 yaw;
|
||||||
s32 fwdHit;
|
b32 fwdHit;
|
||||||
|
|
||||||
x1 = npc->pos.x;
|
x1 = npc->pos.x;
|
||||||
y1 = npc->pos.y;
|
y1 = npc->pos.y;
|
||||||
|
@ -1052,7 +1052,7 @@ void check_for_pulse_stone(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->areaID != AREA_SBK || gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->areaID != AREA_SBK || gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1318,7 +1318,7 @@ void clear_interact_prompt(void) {
|
|||||||
void update_partner_timers(void) {
|
void update_partner_timers(void) {
|
||||||
PlayerData* playerData = &gPlayerData;
|
PlayerData* playerData = &gPlayerData;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
for (i = 1; i < ARRAY_COUNT(playerData->partnerUnlockedTime); i++) {
|
for (i = 1; i < ARRAY_COUNT(playerData->partnerUnlockedTime); i++) {
|
||||||
|
@ -241,7 +241,7 @@ void destroy_popup_menu(void) {
|
|||||||
gPopupMenu->popupType == POPUP_TYPE_TRADE_FOR_BADGE ||
|
gPopupMenu->popupType == POPUP_TYPE_TRADE_FOR_BADGE ||
|
||||||
gPopupMenu->popupType == POPUP_TYPE_UPGRADE_PARTNER ||
|
gPopupMenu->popupType == POPUP_TYPE_UPGRADE_PARTNER ||
|
||||||
gPopupMenu->popupType == POPUP_TYPE_USE_KEY
|
gPopupMenu->popupType == POPUP_TYPE_USE_KEY
|
||||||
) && !gGameStatusPtr->isBattle) {
|
) && gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
if (!PopupMenu_WasStatusBarIgnoringChanges) {
|
if (!PopupMenu_WasStatusBarIgnoringChanges) {
|
||||||
status_bar_respond_to_changes();
|
status_bar_respond_to_changes();
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ void free_animator_nodes(AnimatorNode* root) {
|
|||||||
void clear_animator_list(void) {
|
void clear_animator_list(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentAnimMeshListPtr = &D_801539C0;
|
gCurrentAnimMeshListPtr = &D_801539C0;
|
||||||
for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) {
|
for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) {
|
||||||
D_801533C0[i].ttl = -1;
|
D_801533C0[i].ttl = -1;
|
||||||
@ -212,7 +212,7 @@ void clear_animator_list(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void reset_animator_list(void) {
|
void reset_animator_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentAnimMeshListPtr = &D_801539C0;
|
gCurrentAnimMeshListPtr = &D_801539C0;
|
||||||
} else {
|
} else {
|
||||||
gCurrentAnimMeshListPtr = &D_80153A00;
|
gCurrentAnimMeshListPtr = &D_80153A00;
|
||||||
@ -311,7 +311,7 @@ s32 create_model_animator(s16* animPos) {
|
|||||||
animator->staticNodeIDs[j] = j + 1;
|
animator->staticNodeIDs[j] = j + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ID_BIT;
|
i |= BATTLE_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -351,7 +351,7 @@ s32 create_mesh_animator(s16* animPos, s16* animBuffer) {
|
|||||||
animator->staticNodeIDs[j] = j + 1;
|
animator->staticNodeIDs[j] = j + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ID_BIT;
|
i |= BATTLE_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -434,7 +434,7 @@ void update_model_animator(s32 animatorID) {
|
|||||||
s32 temp;
|
s32 temp;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle && !(animatorID & BATTLE_ID_BIT)) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +448,7 @@ void update_model_animator(s32 animatorID) {
|
|||||||
if (animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION) {
|
if (animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING;
|
animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING;
|
||||||
animator->nextUpdateTime -= animator->timeScale;
|
animator->nextUpdateTime -= animator->timeScale;
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ void update_model_animator_with_transform(s32 animatorID, Mtx* mtx) {
|
|||||||
s32 temp;
|
s32 temp;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle && !(animatorID & BATTLE_ID_BIT)) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -717,10 +717,10 @@ void render_animated_model(s32 animatorID, Mtx* rootTransform) {
|
|||||||
RenderTask rt;
|
RenderTask rt;
|
||||||
RenderTask* rtPtr = &rt;
|
RenderTask* rtPtr = &rt;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle && !(animatorID & BATTLE_ID_BIT)) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
animatorID &= ~BATTLE_ID_BIT;
|
animatorID &= ~BATTLE_ID_BIT;
|
||||||
animator = (*gCurrentAnimMeshListPtr)[animatorID];
|
animator = (*gCurrentAnimMeshListPtr)[animatorID];
|
||||||
|
|
||||||
@ -747,7 +747,7 @@ void render_animated_model_with_vertices(s32 animatorID, Mtx* rootTransform, s32
|
|||||||
RenderTask rt;
|
RenderTask rt;
|
||||||
RenderTask* rtPtr = &rt;
|
RenderTask* rtPtr = &rt;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle && !(animatorID & BATTLE_ID_BIT)) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,7 +1125,7 @@ void load_model_animator_tree(s32 index, StaticAnimatorNode** tree) {
|
|||||||
if (animator == NULL || animator->flags == 0) {
|
if (animator == NULL || animator->flags == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gAnimTreeRoot = tree;
|
gAnimTreeRoot = tree;
|
||||||
load_model_animator_node(*tree, animator, 0, nodeIDs);
|
load_model_animator_node(*tree, animator, 0, nodeIDs);
|
||||||
set_animator_tree_to_node_map(animator, nodeIDs, ARRAY_COUNT(animator->staticNodeIDs));
|
set_animator_tree_to_node_map(animator, nodeIDs, ARRAY_COUNT(animator->staticNodeIDs));
|
||||||
|
@ -311,7 +311,7 @@ void sfx_clear_sounds(void) {
|
|||||||
|
|
||||||
// name might be incorrect?
|
// name might be incorrect?
|
||||||
void sfx_clear_env_sounds(s16 playSounds) {
|
void sfx_clear_env_sounds(s16 playSounds) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentEnvSounds = wEnvSounds;
|
gCurrentEnvSounds = wEnvSounds;
|
||||||
} else {
|
} else {
|
||||||
gCurrentEnvSounds = bEnvSounds;
|
gCurrentEnvSounds = bEnvSounds;
|
||||||
@ -362,7 +362,7 @@ void sfx_stop_env_sounds(void) {
|
|||||||
SoundInstance* sound;
|
SoundInstance* sound;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentEnvSounds = wEnvSounds;
|
gCurrentEnvSounds = wEnvSounds;
|
||||||
} else {
|
} else {
|
||||||
gCurrentEnvSounds = bEnvSounds;
|
gCurrentEnvSounds = bEnvSounds;
|
||||||
@ -619,7 +619,7 @@ void sfx_compute_spatialized_sound_params_ignore_depth(f32 x, f32 y, f32 z, s16*
|
|||||||
*volume = 1;
|
*volume = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
// 25/75 at screen edge
|
// 25/75 at screen edge
|
||||||
*pan = (screenX * 0.2f) + 32.0f;
|
*pan = (screenX * 0.2f) + 32.0f;
|
||||||
} else {
|
} else {
|
||||||
|
@ -220,7 +220,7 @@ void load_demo_battle(u32 index) {
|
|||||||
gGameStatusPtr->demoBattleFlags = 0;
|
gGameStatusPtr->demoBattleFlags = 0;
|
||||||
gGameStatusPtr->areaID = 0;
|
gGameStatusPtr->areaID = 0;
|
||||||
gGameStatusPtr->mapID = 0;
|
gGameStatusPtr->mapID = 0;
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
|
|
||||||
general_heap_create();
|
general_heap_create();
|
||||||
clear_worker_list();
|
clear_worker_list();
|
||||||
|
@ -75,7 +75,7 @@ void update_effects(void) {
|
|||||||
if (effectInstance != NULL && (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED)) {
|
if (effectInstance != NULL && (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED)) {
|
||||||
effectInstance->graphics->flags &= ~FX_GRAPHICS_CAN_FREE;
|
effectInstance->graphics->flags &= ~FX_GRAPHICS_CAN_FREE;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
if (effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
|
if (effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
|
||||||
effectInstance->graphics->update(effectInstance);
|
effectInstance->graphics->update(effectInstance);
|
||||||
effectInstance->flags |= FX_INSTANCE_FLAG_HAS_UPDATED;
|
effectInstance->flags |= FX_INSTANCE_FLAG_HAS_UPDATED;
|
||||||
@ -118,7 +118,7 @@ void render_effects_world(void) {
|
|||||||
if (effectInstance != NULL) {
|
if (effectInstance != NULL) {
|
||||||
if (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED) {
|
if (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED) {
|
||||||
if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) {
|
if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) {
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
if (effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
|
if (effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
|
||||||
effectInstance->graphics->renderWorld(effectInstance);
|
effectInstance->graphics->renderWorld(effectInstance);
|
||||||
}
|
}
|
||||||
@ -145,11 +145,11 @@ void render_effects_UI(void) {
|
|||||||
if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) {
|
if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) {
|
||||||
void (*renderUI)(EffectInstance* effect);
|
void (*renderUI)(EffectInstance* effect);
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle && !(effectInstance->flags & FX_INSTANCE_FLAG_BATTLE)) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD && !(effectInstance->flags & FX_INSTANCE_FLAG_BATTLE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle && effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD && effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ EffectInstance* create_effect_instance(EffectBlueprint* effectBp) {
|
|||||||
effectBp->init(newEffectInst);
|
effectBp->init(newEffectInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
newEffectInst->flags |= FX_INSTANCE_FLAG_BATTLE;
|
newEffectInst->flags |= FX_INSTANCE_FLAG_BATTLE;
|
||||||
}
|
}
|
||||||
return newEffectInst;
|
return newEffectInst;
|
||||||
|
@ -167,7 +167,7 @@ void fire_breath_render(EffectInstance* effect) {
|
|||||||
renderTask.appendGfx = fire_breath_appendGfx;
|
renderTask.appendGfx = fire_breath_appendGfx;
|
||||||
renderTask.appendGfxArg = effect;
|
renderTask.appendGfxArg = effect;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle == TRUE) {
|
if (gGameStatusPtr->context == CONTEXT_BATTLE) {
|
||||||
renderTask.dist = data->pos.z + 1000.0f;
|
renderTask.dist = data->pos.z + 1000.0f;
|
||||||
} else {
|
} else {
|
||||||
renderTask.dist = 0;
|
renderTask.dist = 0;
|
||||||
|
@ -101,7 +101,7 @@ EffectInstance* lightning_main(
|
|||||||
s32 effectArg0;
|
s32 effectArg0;
|
||||||
|
|
||||||
load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE);
|
load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE);
|
||||||
if (gGameStatusPtr->isBattle == TRUE) {
|
if (gGameStatusPtr->context == CONTEXT_BATTLE) {
|
||||||
effectArg0 = FX_SHOCK_OVERLAY_LIGHTNING_BATTLE;
|
effectArg0 = FX_SHOCK_OVERLAY_LIGHTNING_BATTLE;
|
||||||
} else {
|
} else {
|
||||||
effectArg0 = FX_SHOCK_OVERLAY_LIGHTNING_WORLD;
|
effectArg0 = FX_SHOCK_OVERLAY_LIGHTNING_WORLD;
|
||||||
|
@ -155,7 +155,7 @@ void lightning_bolt_render(EffectInstance *effect) {
|
|||||||
|
|
||||||
renderTask.appendGfx = lightning_bolt_appendGfx;
|
renderTask.appendGfx = lightning_bolt_appendGfx;
|
||||||
renderTask.appendGfxArg = effect;
|
renderTask.appendGfxArg = effect;
|
||||||
if (gGameStatusPtr->isBattle == TRUE) {
|
if (gGameStatusPtr->context == CONTEXT_BATTLE) {
|
||||||
renderTask.dist = data->tipPos.z + 1000.0f;
|
renderTask.dist = data->tipPos.z + 1000.0f;
|
||||||
} else {
|
} else {
|
||||||
renderTask.dist = 10;
|
renderTask.dist = 10;
|
||||||
|
@ -151,7 +151,7 @@ void star_update(EffectInstance* effect) {
|
|||||||
load_effect(EFFECT_LANDING_DUST);
|
load_effect(EFFECT_LANDING_DUST);
|
||||||
landing_dust_main(0, data->pos.x, data->pos.y - 5.0f, data->pos.z, 0.0f);
|
landing_dust_main(0, data->pos.x, data->pos.y - 5.0f, data->pos.z, 0.0f);
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
sfx_play_sound_at_position(SOUND_SEQ_SHOOTING_STAR_BOUNCE, SOUND_SPACE_DEFAULT, data->pos.x, data->pos.y, data->pos.z);
|
sfx_play_sound_at_position(SOUND_SEQ_SHOOTING_STAR_BOUNCE, SOUND_SPACE_DEFAULT, data->pos.x, data->pos.y, data->pos.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,16 +848,16 @@ API_CALLABLE(OnPlayerFled) {
|
|||||||
Bytecode* args = script->ptrReadPos;
|
Bytecode* args = script->ptrReadPos;
|
||||||
s32 skipReaction = evt_get_variable(script, *args++);
|
s32 skipReaction = evt_get_variable(script, *args++);
|
||||||
|
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags |= AI_FLAG_SUSPEND;
|
||||||
|
|
||||||
if (!skipReaction) {
|
if (!skipReaction) {
|
||||||
EffectInstance* emoteEffect;
|
EffectInstance* emoteEffect;
|
||||||
|
|
||||||
if (!(enemy->aiFlags & ENEMY_AI_FLAG_10)) {
|
if (!(enemy->aiFlags & AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE)) {
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(enemy->aiFlags & ENEMY_AI_FLAG_8)) {
|
if (!(enemy->aiFlags & AI_FLAG_SKIP_EMOTE_AFTER_FLEE)) {
|
||||||
fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 0.0f, -20.0f, 40, &emoteEffect);
|
fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 0.0f, -20.0f, 40, &emoteEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
30
src/entity.c
30
src/entity.c
@ -345,7 +345,7 @@ void render_entities(void) {
|
|||||||
Entity* entity = get_entity_by_index(i);
|
Entity* entity = get_entity_by_index(i);
|
||||||
|
|
||||||
if (entity != NULL) {
|
if (entity != NULL) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
if (gEntityHideMode != ENTITY_HIDE_MODE_0 &&
|
if (gEntityHideMode != ENTITY_HIDE_MODE_0 &&
|
||||||
!(entity->flags & ENTITY_FLAG_IGNORE_DISTANCE_CULLING) &&
|
!(entity->flags & ENTITY_FLAG_IGNORE_DISTANCE_CULLING) &&
|
||||||
dist2D(gPlayerStatusPtr->pos.x,
|
dist2D(gPlayerStatusPtr->pos.x,
|
||||||
@ -541,7 +541,7 @@ Shadow* get_shadow_by_index(s32 index) {
|
|||||||
EntityList* get_entity_list(void) {
|
EntityList* get_entity_list(void) {
|
||||||
EntityList* ret;
|
EntityList* ret;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
ret = &gWorldEntityList;
|
ret = &gWorldEntityList;
|
||||||
} else {
|
} else {
|
||||||
ret = &gBattleEntityList;
|
ret = &gBattleEntityList;
|
||||||
@ -552,7 +552,7 @@ EntityList* get_entity_list(void) {
|
|||||||
ShadowList* get_shadow_list(void) {
|
ShadowList* get_shadow_list(void) {
|
||||||
ShadowList* ret;
|
ShadowList* ret;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
ret = &gWorldShadowList;
|
ret = &gWorldShadowList;
|
||||||
} else {
|
} else {
|
||||||
ret = &gBattleShadowList;
|
ret = &gBattleShadowList;
|
||||||
@ -795,7 +795,7 @@ void clear_entity_data(b32 arg0) {
|
|||||||
entity_updateCounter = 0;
|
entity_updateCounter = 0;
|
||||||
D_80151304 = 0;
|
D_80151304 = 0;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gEntityHideMode = ENTITY_HIDE_MODE_0;
|
gEntityHideMode = ENTITY_HIDE_MODE_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -807,7 +807,7 @@ void clear_entity_data(b32 arg0) {
|
|||||||
}
|
}
|
||||||
D_8014AFB0 = 255;
|
D_8014AFB0 = 255;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
wEntityDataLoadedSize = 0;
|
wEntityDataLoadedSize = 0;
|
||||||
for (i = 0; i < MAX_ENTITIES; i++) {
|
for (i = 0; i < MAX_ENTITIES; i++) {
|
||||||
wEntityBlueprint[i] = NULL;
|
wEntityBlueprint[i] = NULL;
|
||||||
@ -819,7 +819,7 @@ void clear_entity_data(b32 arg0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM;
|
gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM;
|
||||||
gEntityHeapBase = WORLD_ENTITY_HEAP_BASE;
|
gEntityHeapBase = WORLD_ENTITY_HEAP_BASE;
|
||||||
} else {
|
} else {
|
||||||
@ -840,7 +840,7 @@ void clear_entity_data(b32 arg0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_entity_data(void) {
|
void init_entity_data(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM;
|
gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM;
|
||||||
gEntityHeapBase = WORLD_ENTITY_HEAP_BASE;
|
gEntityHeapBase = WORLD_ENTITY_HEAP_BASE;
|
||||||
reload_world_entity_data();
|
reload_world_entity_data();
|
||||||
@ -957,7 +957,7 @@ s32 is_entity_data_loaded(Entity* entity, EntityBlueprint* blueprint, s32* loade
|
|||||||
*loadedEnd = 0;
|
*loadedEnd = 0;
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
blueprints = wEntityBlueprint;
|
blueprints = wEntityBlueprint;
|
||||||
} else {
|
} else {
|
||||||
blueprints = bEntityBlueprint;
|
blueprints = bEntityBlueprint;
|
||||||
@ -1016,7 +1016,7 @@ void load_simple_entity_data(Entity* entity, EntityBlueprint* bp, s32 listIndex)
|
|||||||
s32 totalSize;
|
s32 totalSize;
|
||||||
|
|
||||||
entity->vertexSegment = 0xA;
|
entity->vertexSegment = 0xA;
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
totalSize = wEntityDataLoadedSize;
|
totalSize = wEntityDataLoadedSize;
|
||||||
} else {
|
} else {
|
||||||
totalSize = bEntityDataLoadedSize;
|
totalSize = bEntityDataLoadedSize;
|
||||||
@ -1038,7 +1038,7 @@ void load_simple_entity_data(Entity* entity, EntityBlueprint* bp, s32 listIndex)
|
|||||||
get_entity_type(entity->listIndex);
|
get_entity_type(entity->listIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
wEntityDataLoadedSize = totalSize;
|
wEntityDataLoadedSize = totalSize;
|
||||||
} else {
|
} else {
|
||||||
bEntityDataLoadedSize = totalSize;
|
bEntityDataLoadedSize = totalSize;
|
||||||
@ -1091,7 +1091,7 @@ void load_split_entity_data(Entity* entity, EntityBlueprint* entityData, s32 lis
|
|||||||
animBaseAddr = (void*)(gEntityHeapBottom + specialSize * 4 + dma1size * 4);
|
animBaseAddr = (void*)(gEntityHeapBottom + specialSize * 4 + dma1size * 4);
|
||||||
swizzlePointers = TRUE;
|
swizzlePointers = TRUE;
|
||||||
} else if (is_entity_data_loaded(entity, entityData, &loadedStart, &loadedEnd)) {
|
} else if (is_entity_data_loaded(entity, entityData, &loadedStart, &loadedEnd)) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
totalLoaded = wEntityDataLoadedSize;
|
totalLoaded = wEntityDataLoadedSize;
|
||||||
} else {
|
} else {
|
||||||
totalLoaded = bEntityDataLoadedSize;
|
totalLoaded = bEntityDataLoadedSize;
|
||||||
@ -1116,7 +1116,7 @@ void load_split_entity_data(Entity* entity, EntityBlueprint* entityData, s32 lis
|
|||||||
totalLoaded += dma2size_2;
|
totalLoaded += dma2size_2;
|
||||||
get_entity_type(entity->listIndex);
|
get_entity_type(entity->listIndex);
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
wEntityDataLoadedSize = totalLoaded;
|
wEntityDataLoadedSize = totalLoaded;
|
||||||
} else {
|
} else {
|
||||||
bEntityDataLoadedSize = totalLoaded;
|
bEntityDataLoadedSize = totalLoaded;
|
||||||
@ -1688,7 +1688,7 @@ s32 entity_raycast_down(f32* x, f32* y, f32* z, f32* hitYaw, f32* hitPitch, f32*
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set_standard_shadow_scale(Shadow* shadow, f32 height) {
|
void set_standard_shadow_scale(Shadow* shadow, f32 height) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
shadow->scale.x = 0.13 - (height / 2600.0f);
|
shadow->scale.x = 0.13 - (height / 2600.0f);
|
||||||
} else {
|
} else {
|
||||||
shadow->scale.x = 0.12 - (height / 3600.0f);
|
shadow->scale.x = 0.12 - (height / 3600.0f);
|
||||||
@ -1701,7 +1701,7 @@ void set_standard_shadow_scale(Shadow* shadow, f32 height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set_npc_shadow_scale(Shadow* shadow, f32 height, f32 npcRadius) {
|
void set_npc_shadow_scale(Shadow* shadow, f32 height, f32 npcRadius) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
shadow->scale.x = 0.13 - (height / 2600.0f);
|
shadow->scale.x = 0.13 - (height / 2600.0f);
|
||||||
} else {
|
} else {
|
||||||
shadow->scale.x = 0.12 - (height / 3600.0f);
|
shadow->scale.x = 0.12 - (height / 3600.0f);
|
||||||
@ -1722,7 +1722,7 @@ void set_peach_shadow_scale(Shadow* shadow, f32 scale) {
|
|||||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||||
f32 phi_f2 = 0.12f;
|
f32 phi_f2 = 0.12f;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
switch (playerStatus->anim) {
|
switch (playerStatus->anim) {
|
||||||
case ANIM_Peach2_Carried:
|
case ANIM_Peach2_Carried:
|
||||||
case ANIM_Peach2_Thrown:
|
case ANIM_Peach2_Thrown:
|
||||||
|
@ -51,7 +51,7 @@ void free_entity_model_by_ref(EntityModel* entityModel);
|
|||||||
void clear_entity_models(void) {
|
void clear_entity_models(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentEntityModelList = &gWorldEntityModelList;
|
gCurrentEntityModelList = &gWorldEntityModelList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentEntityModelList = &gBattleEntityModelList;
|
gCurrentEntityModelList = &gBattleEntityModelList;
|
||||||
@ -74,7 +74,7 @@ void clear_entity_models(void) {
|
|||||||
void init_entity_models(void) {
|
void init_entity_models(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentEntityModelList = &gWorldEntityModelList;
|
gCurrentEntityModelList = &gWorldEntityModelList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentEntityModelList = &gBattleEntityModelList;
|
gCurrentEntityModelList = &gBattleEntityModelList;
|
||||||
@ -121,7 +121,7 @@ s32 load_entity_model(EntityModelScript* cmdList) {
|
|||||||
newEntityModel->fpSetupGfxCallback = NULL;
|
newEntityModel->fpSetupGfxCallback = NULL;
|
||||||
newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos;
|
newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ENTITY_ID_BIT;
|
i |= BATTLE_ENTITY_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -163,7 +163,7 @@ s32 ALT_load_entity_model(EntityModelScript* cmdList) {
|
|||||||
newEntityModel->fpSetupGfxCallback = NULL;
|
newEntityModel->fpSetupGfxCallback = NULL;
|
||||||
newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos;
|
newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ENTITY_ID_BIT;
|
i |= BATTLE_ENTITY_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -172,7 +172,7 @@ s32 ALT_load_entity_model(EntityModelScript* cmdList) {
|
|||||||
void exec_entity_model_commandlist(s32 idx) {
|
void exec_entity_model_commandlist(s32 idx) {
|
||||||
EntityModel* entityModel;
|
EntityModel* entityModel;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle || (idx & BATTLE_ENTITY_ID_BIT)) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD || (idx & BATTLE_ENTITY_ID_BIT)) {
|
||||||
idx &= ~BATTLE_ENTITY_ID_BIT;
|
idx &= ~BATTLE_ENTITY_ID_BIT;
|
||||||
entityModel = (*gCurrentEntityModelList)[idx];
|
entityModel = (*gCurrentEntityModelList)[idx];
|
||||||
if (entityModel != NULL && (entityModel->flags)) {
|
if (entityModel != NULL && (entityModel->flags)) {
|
||||||
@ -412,7 +412,7 @@ void draw_entity_model_A(s32 modelIdx, Mtx* transformMtx) {
|
|||||||
f32 x, y, z, w;
|
f32 x, y, z, w;
|
||||||
f32 inX, inY, inZ;
|
f32 inX, inY, inZ;
|
||||||
|
|
||||||
if ((!gGameStatusPtr->isBattle) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
||||||
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
||||||
model = (*gCurrentEntityModelList)[modelIdx];
|
model = (*gCurrentEntityModelList)[modelIdx];
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ void draw_entity_model_B(s32 modelIdx, Mtx* transformMtx, s32 vertexSegment, Vec
|
|||||||
f32 x, y, z, w;
|
f32 x, y, z, w;
|
||||||
f32 inX, inY, inZ;
|
f32 inX, inY, inZ;
|
||||||
|
|
||||||
if ((!gGameStatusPtr->isBattle) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
||||||
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
||||||
model = (*gCurrentEntityModelList)[modelIdx];
|
model = (*gCurrentEntityModelList)[modelIdx];
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ void draw_entity_model_C(s32 modelIdx, Mtx* transformMtx) {
|
|||||||
RenderTask rt;
|
RenderTask rt;
|
||||||
RenderTask* rtPtr = &rt;
|
RenderTask* rtPtr = &rt;
|
||||||
|
|
||||||
if ((!gGameStatusPtr->isBattle) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
||||||
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
||||||
model = (*gCurrentEntityModelList)[modelIdx];
|
model = (*gCurrentEntityModelList)[modelIdx];
|
||||||
|
|
||||||
@ -515,7 +515,7 @@ void draw_entity_model_D(s32 modelIdx, Mtx* transformMtx, s32 arg2, Vec3s* verte
|
|||||||
RenderTask rt;
|
RenderTask rt;
|
||||||
RenderTask* rtPtr = &rt;
|
RenderTask* rtPtr = &rt;
|
||||||
|
|
||||||
if ((!gGameStatusPtr->isBattle) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
|
||||||
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
modelIdx &= ~BATTLE_ENTITY_ID_BIT;
|
||||||
model = (*gCurrentEntityModelList)[modelIdx];
|
model = (*gCurrentEntityModelList)[modelIdx];
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ API_CALLABLE(ShakeCam) {
|
|||||||
*(f32*)&script->functionTemp[3] = 1.0f; //TODO functionTempF ?
|
*(f32*)&script->functionTemp[3] = 1.0f; //TODO functionTempF ?
|
||||||
script->functionTemp[1] = duration;
|
script->functionTemp[1] = duration;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
if (magnitude > 10.0f) {
|
if (magnitude > 10.0f) {
|
||||||
magnitude = 10.0f;
|
magnitude = 10.0f;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ void render_animated_models(void) {
|
|||||||
// split here?
|
// split here?
|
||||||
|
|
||||||
API_CALLABLE(InitAnimatedModels) {
|
API_CALLABLE(InitAnimatedModels) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList;
|
gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList;
|
gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList;
|
||||||
@ -258,7 +258,7 @@ API_CALLABLE(SetAnimatorFlags) {
|
|||||||
void reset_model_animators(void) {
|
void reset_model_animators(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle ) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD ) {
|
||||||
gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList;
|
gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList;
|
gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList;
|
||||||
@ -276,7 +276,7 @@ void reset_model_animators(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_model_animators(void) {
|
void init_model_animators(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList;
|
gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList;
|
gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList;
|
||||||
|
@ -170,7 +170,7 @@ void find_script_labels(Evt* script) {
|
|||||||
void clear_script_list(void) {
|
void clear_script_list(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentScriptListPtr = &gWorldScriptList;
|
gCurrentScriptListPtr = &gWorldScriptList;
|
||||||
gMapVars = gWorldMapVars;
|
gMapVars = gWorldMapVars;
|
||||||
gMapFlags = gWorldMapFlags;
|
gMapFlags = gWorldMapFlags;
|
||||||
@ -201,7 +201,7 @@ void clear_script_list(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_script_list(void) {
|
void init_script_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentScriptListPtr = &gWorldScriptList;
|
gCurrentScriptListPtr = &gWorldScriptList;
|
||||||
gMapVars = gWorldMapVars;
|
gMapVars = gWorldMapVars;
|
||||||
gMapFlags = gWorldMapFlags;
|
gMapFlags = gWorldMapFlags;
|
||||||
|
@ -119,7 +119,7 @@ void virtual_entity_list_render_UI(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
API_CALLABLE(InitVirtualEntityList) {
|
API_CALLABLE(InitVirtualEntityList) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList;
|
gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList;
|
gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList;
|
||||||
@ -654,7 +654,7 @@ void virtual_entity_delete_by_ref(VirtualEntity* obj) {
|
|||||||
void clear_virtual_entity_list(void) {
|
void clear_virtual_entity_list(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList;
|
gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList;
|
gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList;
|
||||||
@ -671,7 +671,7 @@ void clear_virtual_entity_list(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_virtual_entity_list(void) {
|
void init_virtual_entity_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList;
|
gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList;
|
gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList;
|
||||||
|
@ -32,7 +32,7 @@ s32 func_8002ACDC(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void* heap_malloc(s32 size) {
|
void* heap_malloc(s32 size) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
return general_heap_malloc(size);
|
return general_heap_malloc(size);
|
||||||
} else {
|
} else {
|
||||||
return _heap_malloc(&heap_battleHead, size);
|
return _heap_malloc(&heap_battleHead, size);
|
||||||
@ -40,7 +40,7 @@ void* heap_malloc(s32 size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s32 heap_free(void* data) {
|
s32 heap_free(void* data) {
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
return _heap_free(&heap_battleHead, data);
|
return _heap_free(&heap_battleHead, data);
|
||||||
} else {
|
} else {
|
||||||
return general_heap_free(data);
|
return general_heap_free(data);
|
||||||
@ -55,7 +55,7 @@ s32 collision_heap_create(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void* collision_heap_malloc(s32 size) {
|
void* collision_heap_malloc(s32 size) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
return _heap_malloc(&heap_collisionHead, size);
|
return _heap_malloc(&heap_collisionHead, size);
|
||||||
} else {
|
} else {
|
||||||
return _heap_malloc(&heap_battleHead, size);
|
return _heap_malloc(&heap_battleHead, size);
|
||||||
@ -63,7 +63,7 @@ void* collision_heap_malloc(s32 size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s32 collision_heap_free(void* data) {
|
s32 collision_heap_free(void* data) {
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
return _heap_free(&heap_battleHead, data);
|
return _heap_free(&heap_battleHead, data);
|
||||||
} else {
|
} else {
|
||||||
return _heap_free(&heap_collisionHead, data);
|
return _heap_free(&heap_collisionHead, data);
|
||||||
|
@ -190,7 +190,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) {
|
|||||||
if (entry->id == -1) {
|
if (entry->id == -1) {
|
||||||
entry->id = raster;
|
entry->id = raster;
|
||||||
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
|
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
capacity = gHudElementCacheCapacity;
|
capacity = gHudElementCacheCapacity;
|
||||||
} else {
|
} else {
|
||||||
capacity = gHudElementCacheCapacity / 2;
|
capacity = gHudElementCacheCapacity / 2;
|
||||||
@ -198,7 +198,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) {
|
|||||||
ASSERT(capacity > *gHudElementCacheSize + gHudElementSizes[preset].size);
|
ASSERT(capacity > *gHudElementCacheSize + gHudElementSizes[preset].size);
|
||||||
nuPiReadRom((s32)icon_ROM_START + raster, entry->data, gHudElementSizes[preset].size);
|
nuPiReadRom((s32)icon_ROM_START + raster, entry->data, gHudElementSizes[preset].size);
|
||||||
*gHudElementCacheSize += gHudElementSizes[preset].size;
|
*gHudElementCacheSize += gHudElementSizes[preset].size;
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -206,7 +206,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) {
|
|||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
} else if (entry->id == raster) {
|
} else if (entry->id == raster) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -226,7 +226,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) {
|
|||||||
if (entry->id == -1) {
|
if (entry->id == -1) {
|
||||||
entry->id = palette;
|
entry->id = palette;
|
||||||
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
|
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
capacity = gHudElementCacheCapacity;
|
capacity = gHudElementCacheCapacity;
|
||||||
} else {
|
} else {
|
||||||
capacity = gHudElementCacheCapacity / 2;
|
capacity = gHudElementCacheCapacity / 2;
|
||||||
@ -234,7 +234,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) {
|
|||||||
ASSERT(capacity > *gHudElementCacheSize + 32);
|
ASSERT(capacity > *gHudElementCacheSize + 32);
|
||||||
nuPiReadRom((s32)icon_ROM_START + palette, entry->data, 32);
|
nuPiReadRom((s32)icon_ROM_START + palette, entry->data, 32);
|
||||||
*gHudElementCacheSize += 32;
|
*gHudElementCacheSize += 32;
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -242,7 +242,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) {
|
|||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
} else if (entry->id == palette) {
|
} else if (entry->id == palette) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -610,7 +610,7 @@ void hud_element_clear_cache(void) {
|
|||||||
HudCacheEntry* entryRaster;
|
HudCacheEntry* entryRaster;
|
||||||
HudCacheEntry* entryPalette;
|
HudCacheEntry* entryPalette;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gHudElements = &gHudElementsWorld;
|
gHudElements = &gHudElementsWorld;
|
||||||
gHudElementCacheSize = &gHudElementCacheSizeWorld;
|
gHudElementCacheSize = &gHudElementCacheSizeWorld;
|
||||||
gHudElementCacheTableRaster = gHudElementCacheTableRasterWorld;
|
gHudElementCacheTableRaster = gHudElementCacheTableRasterWorld;
|
||||||
@ -622,7 +622,7 @@ void hud_element_clear_cache(void) {
|
|||||||
gHudElementCacheTablePalette = gHudElementCacheTablePaletteBattle;
|
gHudElementCacheTablePalette = gHudElementCacheTablePaletteBattle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gHudElementCacheBuffer = general_heap_malloc(gHudElementCacheCapacity);
|
gHudElementCacheBuffer = general_heap_malloc(gHudElementCacheCapacity);
|
||||||
ASSERT(gHudElementCacheBuffer);
|
ASSERT(gHudElementCacheBuffer);
|
||||||
gHudElementCacheBufferWorld = gHudElementCacheBuffer;
|
gHudElementCacheBufferWorld = gHudElementCacheBuffer;
|
||||||
@ -664,7 +664,7 @@ extern Addr D_80200000;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void init_hud_element_list(void) {
|
void init_hud_element_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
if (gHudElementCacheBufferBattle != NULL) {
|
if (gHudElementCacheBufferBattle != NULL) {
|
||||||
#if VERSION_PAL
|
#if VERSION_PAL
|
||||||
if (gHudElementCacheBufferBattle != D_80200000) {
|
if (gHudElementCacheBufferBattle != D_80200000) {
|
||||||
@ -755,7 +755,7 @@ s32 hud_element_create(HudScript* anim) {
|
|||||||
hudElement->tint.g = 255;
|
hudElement->tint.g = 255;
|
||||||
hudElement->tint.b = 255;
|
hudElement->tint.b = 255;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
hudElement->flags |= HUD_ELEMENT_FLAG_BATTLE;
|
hudElement->flags |= HUD_ELEMENT_FLAG_BATTLE;
|
||||||
id |= HUD_ELEMENT_BATTLE_ID_MASK;
|
id |= HUD_ELEMENT_BATTLE_ID_MASK;
|
||||||
}
|
}
|
||||||
@ -2042,7 +2042,7 @@ void hud_element_clear_flags(s32 id, s32 flags) {
|
|||||||
void ALT_clear_hud_element_cache(void) {
|
void ALT_clear_hud_element_cache(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
heap_free(gHudElementCacheBuffer);
|
heap_free(gHudElementCacheBuffer);
|
||||||
gHudElementCacheBuffer = heap_malloc(gHudElementCacheCapacity);
|
gHudElementCacheBuffer = heap_malloc(gHudElementCacheCapacity);
|
||||||
ASSERT(gHudElementCacheBuffer);
|
ASSERT(gHudElementCacheBuffer);
|
||||||
|
@ -1526,7 +1526,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) {
|
|||||||
) {
|
) {
|
||||||
cam = &gCameras[gCurrentCamID];
|
cam = &gCameras[gCurrentCamID];
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle == 2) {
|
if (gGameStatusPtr->context == CONTEXT_PAUSE) {
|
||||||
gSPViewport(gMainGfxPos++, &D_8014EE50);
|
gSPViewport(gMainGfxPos++, &D_8014EE50);
|
||||||
} else {
|
} else {
|
||||||
gSPViewport(gMainGfxPos++, &cam->vpAlt);
|
gSPViewport(gMainGfxPos++, &cam->vpAlt);
|
||||||
@ -1565,7 +1565,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) {
|
|||||||
alpha2 = 255;
|
alpha2 = 255;
|
||||||
cam = &gCameras[gCurrentCamID];
|
cam = &gCameras[gCurrentCamID];
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle == 2) {
|
if (gGameStatusPtr->context == CONTEXT_PAUSE) {
|
||||||
gSPViewport(gMainGfxPos++, &D_8014EE50);
|
gSPViewport(gMainGfxPos++, &D_8014EE50);
|
||||||
} else {
|
} else {
|
||||||
gSPViewport(gMainGfxPos++, &cam->vpAlt);
|
gSPViewport(gMainGfxPos++, &cam->vpAlt);
|
||||||
@ -1620,7 +1620,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) {
|
|||||||
&& (state->flags & someFlags)
|
&& (state->flags & someFlags)
|
||||||
) {
|
) {
|
||||||
cam = &gCameras[gCurrentCamID];
|
cam = &gCameras[gCurrentCamID];
|
||||||
if (gGameStatusPtr->isBattle == 2) {
|
if (gGameStatusPtr->context == CONTEXT_PAUSE) {
|
||||||
gSPViewport(gMainGfxPos++, &D_8014EE40);
|
gSPViewport(gMainGfxPos++, &D_8014EE40);
|
||||||
D_8014EE50.vp.vtrans[0] = D_8014EE40.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x;
|
D_8014EE50.vp.vtrans[0] = D_8014EE40.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x;
|
||||||
D_8014EE50.vp.vtrans[1] = D_8014EE40.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y;
|
D_8014EE50.vp.vtrans[1] = D_8014EE40.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y;
|
||||||
|
@ -465,7 +465,7 @@ void status_bar_draw_number(s32 iconID, s32 startX, s32 startY, s32 value, s32 n
|
|||||||
b32 keepDrawing;
|
b32 keepDrawing;
|
||||||
s32 digit;
|
s32 digit;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
hud_element_set_script(iconID, TimesHudScript);
|
hud_element_set_script(iconID, TimesHudScript);
|
||||||
drawX = startX + 8;
|
drawX = startX + 8;
|
||||||
drawY = startY + 8;
|
drawY = startY + 8;
|
||||||
@ -578,7 +578,7 @@ void update_status_bar(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle && playerData->coins != statusBar->displayCoins) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->coins != statusBar->displayCoins) {
|
||||||
status_bar_start_blinking_coins();
|
status_bar_start_blinking_coins();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ void update_status_bar(void) {
|
|||||||
|
|
||||||
// sync displayed HP toward true HP
|
// sync displayed HP toward true HP
|
||||||
if (statusBar->displayHP != playerData->curHP) {
|
if (statusBar->displayHP != playerData->curHP) {
|
||||||
if (!gGameStatusPtr->isBattle && playerData->curHP < statusBar->displayHP) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->curHP < statusBar->displayHP) {
|
||||||
status_bar_start_blinking_hp();
|
status_bar_start_blinking_hp();
|
||||||
}
|
}
|
||||||
if (statusBar->displayHP < playerData->curHP) {
|
if (statusBar->displayHP < playerData->curHP) {
|
||||||
@ -645,7 +645,7 @@ void update_status_bar(void) {
|
|||||||
|
|
||||||
// sync displayed FP toward true FP
|
// sync displayed FP toward true FP
|
||||||
if (statusBar->displayFP != playerData->curFP) {
|
if (statusBar->displayFP != playerData->curFP) {
|
||||||
if (!gGameStatusPtr->isBattle && playerData->curFP < statusBar->displayFP) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->curFP < statusBar->displayFP) {
|
||||||
status_bar_start_blinking_fp();
|
status_bar_start_blinking_fp();
|
||||||
}
|
}
|
||||||
if (statusBar->displayFP < playerData->curFP) {
|
if (statusBar->displayFP < playerData->curFP) {
|
||||||
@ -700,7 +700,7 @@ void update_status_bar(void) {
|
|||||||
} else {
|
} else {
|
||||||
if (!statusBar->ignoreChanges) {
|
if (!statusBar->ignoreChanges) {
|
||||||
if (!statusBar->unk_3B || playerStatus->actionState != ACTION_STATE_IDLE) {
|
if (!statusBar->unk_3B || playerStatus->actionState != ACTION_STATE_IDLE) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
statusBar->hidden = TRUE;
|
statusBar->hidden = TRUE;
|
||||||
statusBar->showTimer = 0;
|
statusBar->showTimer = 0;
|
||||||
statusBar->unk_3C = FALSE;
|
statusBar->unk_3C = FALSE;
|
||||||
@ -723,7 +723,7 @@ void update_status_bar(void) {
|
|||||||
statusBar->showTimer++;
|
statusBar->showTimer++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statusBar->showTimer >= 240 && !gGameStatusPtr->isBattle) {
|
if (statusBar->showTimer >= 240 && gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
statusBar->showTimer = 210;
|
statusBar->showTimer = 210;
|
||||||
statusBar->hidden = FALSE;
|
statusBar->hidden = FALSE;
|
||||||
statusBar->unk_3B = TRUE;
|
statusBar->unk_3B = TRUE;
|
||||||
@ -1372,7 +1372,7 @@ s32 is_status_bar_visible(void) {
|
|||||||
void status_bar_start_blinking_hp(void) {
|
void status_bar_start_blinking_hp(void) {
|
||||||
StatusBar* statusBar = &gStatusBar;
|
StatusBar* statusBar = &gStatusBar;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
statusBar->hpBlinkTimer = 120;
|
statusBar->hpBlinkTimer = 120;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1395,7 +1395,7 @@ void status_bar_stop_blinking_hp(void) {
|
|||||||
void status_bar_start_blinking_fp(void) {
|
void status_bar_start_blinking_fp(void) {
|
||||||
StatusBar* statusBar = &gStatusBar;
|
StatusBar* statusBar = &gStatusBar;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
statusBar->fpBlinkTimer = 120;
|
statusBar->fpBlinkTimer = 120;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1417,7 +1417,7 @@ void status_bar_stop_blinking_fp(void) {
|
|||||||
void status_bar_start_blinking_coins(void) {
|
void status_bar_start_blinking_coins(void) {
|
||||||
StatusBar* statusBar = &gStatusBar;
|
StatusBar* statusBar = &gStatusBar;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
statusBar->coinsBlinkTimer = 120;
|
statusBar->coinsBlinkTimer = 120;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ void reveal_item_entity(ItemEntity* item) {
|
|||||||
void clear_item_entity_data(void) {
|
void clear_item_entity_data(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentItemEntities = WorldItemEntities;
|
gCurrentItemEntities = WorldItemEntities;
|
||||||
} else {
|
} else {
|
||||||
gCurrentItemEntities = BattleItemEntities;
|
gCurrentItemEntities = BattleItemEntities;
|
||||||
@ -258,7 +258,7 @@ void clear_item_entity_data(void) {
|
|||||||
CoinSparkleCenterZ = 0;
|
CoinSparkleCenterZ = 0;
|
||||||
ItemEntityAlternatingSpawn = 0;
|
ItemEntityAlternatingSpawn = 0;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
ItemEntityRenderGroup = 0;
|
ItemEntityRenderGroup = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ void clear_item_entity_data(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_item_entity_list(void) {
|
void init_item_entity_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentItemEntities = WorldItemEntities;
|
gCurrentItemEntities = WorldItemEntities;
|
||||||
} else {
|
} else {
|
||||||
gCurrentItemEntities = BattleItemEntities;
|
gCurrentItemEntities = BattleItemEntities;
|
||||||
@ -327,7 +327,7 @@ void item_entity_load(ItemEntity* item) {
|
|||||||
ASSERT(*gHudElementCacheSize + size < 0x11000);
|
ASSERT(*gHudElementCacheSize + size < 0x11000);
|
||||||
nuPiReadRom((s32)icon_ROM_START + raster, entry->data, size);
|
nuPiReadRom((s32)icon_ROM_START + raster, entry->data, size);
|
||||||
*gHudElementCacheSize += size;
|
*gHudElementCacheSize += size;
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -337,7 +337,7 @@ void item_entity_load(ItemEntity* item) {
|
|||||||
} else {
|
} else {
|
||||||
cond = entry->id == raster; // TODO required to match
|
cond = entry->id == raster; // TODO required to match
|
||||||
if (cond) {
|
if (cond) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -360,7 +360,7 @@ void item_entity_load(ItemEntity* item) {
|
|||||||
ASSERT(*gHudElementCacheSize + 0x20 < 0x11000);
|
ASSERT(*gHudElementCacheSize + 0x20 < 0x11000);
|
||||||
nuPiReadRom((s32)icon_ROM_START + palette, entry->data, 0x20);
|
nuPiReadRom((s32)icon_ROM_START + palette, entry->data, 0x20);
|
||||||
*gHudElementCacheSize += 0x20;
|
*gHudElementCacheSize += 0x20;
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -368,7 +368,7 @@ void item_entity_load(ItemEntity* item) {
|
|||||||
pos++;
|
pos++;
|
||||||
break;
|
break;
|
||||||
} else if (entry->id == palette) {
|
} else if (entry->id == palette) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
*pos = i;
|
*pos = i;
|
||||||
} else {
|
} else {
|
||||||
*pos = (u16)(*pos) | (i << 16);
|
*pos = (u16)(*pos) | (i << 16);
|
||||||
@ -791,7 +791,7 @@ void item_entity_update(ItemEntity* entity) {
|
|||||||
entity->nextUpdate = *args++;
|
entity->nextUpdate = *args++;
|
||||||
*args++;
|
*args++;
|
||||||
*args++;
|
*args++;
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
entity->lookupRasterIndex = *args++;
|
entity->lookupRasterIndex = *args++;
|
||||||
entity->lookupPaletteIndex = *args++;
|
entity->lookupPaletteIndex = *args++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2318,7 +2318,7 @@ void mdl_load_all_textures(ModelNode* rootModel, s32 romOffset, s32 size) {
|
|||||||
s32 baseOffset = 0;
|
s32 baseOffset = 0;
|
||||||
|
|
||||||
// textures are loaded to the upper half of the texture heap when not in the world
|
// textures are loaded to the upper half of the texture heap when not in the world
|
||||||
if (gGameStatusPtr->isBattle != 0) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
baseOffset = WORLD_TEXTURE_MEMORY_SIZE;
|
baseOffset = WORLD_TEXTURE_MEMORY_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2359,7 +2359,7 @@ s32 mdl_get_child_count(ModelNode* model) {
|
|||||||
void clear_model_data(void) {
|
void clear_model_data(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentModels = &wModelList;
|
gCurrentModels = &wModelList;
|
||||||
gCurrentTransformGroups = &wTransformGroups;
|
gCurrentTransformGroups = &wTransformGroups;
|
||||||
gCurrentCustomModelGfxPtr = &wCustomModelGfx;
|
gCurrentCustomModelGfxPtr = &wCustomModelGfx;
|
||||||
@ -2424,7 +2424,7 @@ void clear_model_data(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_model_data(void) {
|
void init_model_data(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentModels = &wModelList;
|
gCurrentModels = &wModelList;
|
||||||
gCurrentTransformGroups = &wTransformGroups;
|
gCurrentTransformGroups = &wTransformGroups;
|
||||||
gCurrentCustomModelGfxPtr = &wCustomModelGfx;
|
gCurrentCustomModelGfxPtr = &wCustomModelGfx;
|
||||||
|
@ -77,7 +77,7 @@ void mtx_ident_mirror_y(Matrix4f mtx) {
|
|||||||
void clear_npcs(void) {
|
void clear_npcs(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentNpcListPtr = &gWorldNpcList;
|
gCurrentNpcListPtr = &gWorldNpcList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentNpcListPtr = &gBattleNpcList;
|
gCurrentNpcListPtr = &gBattleNpcList;
|
||||||
@ -92,7 +92,7 @@ void clear_npcs(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_npc_list(void) {
|
void init_npc_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentNpcListPtr = &gWorldNpcList;
|
gCurrentNpcListPtr = &gWorldNpcList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentNpcListPtr = &gBattleNpcList;
|
gCurrentNpcListPtr = &gBattleNpcList;
|
||||||
@ -207,7 +207,7 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) {
|
|||||||
npc->shadowIndex = create_shadow_type(SHADOW_VARYING_CIRCLE, npc->pos.x, npc->pos.y, npc->pos.z);
|
npc->shadowIndex = create_shadow_type(SHADOW_VARYING_CIRCLE, npc->pos.x, npc->pos.y, npc->pos.z);
|
||||||
npc->shadowScale = 1.0f;
|
npc->shadowScale = 1.0f;
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_NPC_ID_BIT;
|
i |= BATTLE_NPC_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
@ -479,7 +479,7 @@ void func_80138198(void) {
|
|||||||
void render_screen_overlay_frontUI(void) {
|
void render_screen_overlay_frontUI(void) {
|
||||||
if (screen_overlay_frontType != OVERLAY_NONE
|
if (screen_overlay_frontType != OVERLAY_NONE
|
||||||
&& screen_overlay_frontZoom != -1.0f
|
&& screen_overlay_frontZoom != -1.0f
|
||||||
&& gGameStatusPtr->isBattle != 2
|
&& gGameStatusPtr->context != CONTEXT_PAUSE
|
||||||
) {
|
) {
|
||||||
_render_transition_stencil(screen_overlay_frontType, screen_overlay_frontZoom, &ScreenOverlays[0]);
|
_render_transition_stencil(screen_overlay_frontType, screen_overlay_frontZoom, &ScreenOverlays[0]);
|
||||||
}
|
}
|
||||||
@ -488,7 +488,7 @@ void render_screen_overlay_frontUI(void) {
|
|||||||
void render_screen_overlay_backUI(void) {
|
void render_screen_overlay_backUI(void) {
|
||||||
if (screen_overlay_backType != OVERLAY_NONE
|
if (screen_overlay_backType != OVERLAY_NONE
|
||||||
&& screen_overlay_backZoom != -1.0f
|
&& screen_overlay_backZoom != -1.0f
|
||||||
&& gGameStatusPtr->isBattle != 2
|
&& gGameStatusPtr->context != CONTEXT_PAUSE
|
||||||
) {
|
) {
|
||||||
_render_transition_stencil(screen_overlay_backType, screen_overlay_backZoom, &ScreenOverlays[1]);
|
_render_transition_stencil(screen_overlay_backType, screen_overlay_backZoom, &ScreenOverlays[1]);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ void spr_appendGfx_component_flat(
|
|||||||
gDPSetTileSize(gMainGfxPos++, 2, 0, 0, 63 << 2, 0);
|
gDPSetTileSize(gMainGfxPos++, 2, 0, 0, 63 << 2, 0);
|
||||||
if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) {
|
if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) {
|
||||||
Camera* camera = &gCameras[gCurrentCamID];
|
Camera* camera = &gCameras[gCurrentCamID];
|
||||||
if (gGameStatusPtr->isBattle == 2) {
|
if (gGameStatusPtr->context == CONTEXT_PAUSE) {
|
||||||
gSPViewport(gMainGfxPos++, &SprPauseVpAlt);
|
gSPViewport(gMainGfxPos++, &SprPauseVpAlt);
|
||||||
} else {
|
} else {
|
||||||
gSPViewport(gMainGfxPos++, &camera->vpAlt);
|
gSPViewport(gMainGfxPos++, &camera->vpAlt);
|
||||||
@ -268,7 +268,7 @@ void spr_appendGfx_component_flat(
|
|||||||
256, 256);
|
256, 256);
|
||||||
if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) {
|
if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) {
|
||||||
Camera* camera = &gCameras[gCurrentCamID];
|
Camera* camera = &gCameras[gCurrentCamID];
|
||||||
if (gGameStatusPtr->isBattle == 2) {
|
if (gGameStatusPtr->context == CONTEXT_PAUSE) {
|
||||||
gSPViewport(gMainGfxPos++, &SprPauseVpAlt);
|
gSPViewport(gMainGfxPos++, &SprPauseVpAlt);
|
||||||
} else {
|
} else {
|
||||||
gSPViewport(gMainGfxPos++, &camera->vpAlt);
|
gSPViewport(gMainGfxPos++, &camera->vpAlt);
|
||||||
@ -304,7 +304,7 @@ void spr_appendGfx_component_flat(
|
|||||||
if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) {
|
if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) {
|
||||||
Camera* camera = &gCameras[gCurrentCamID];
|
Camera* camera = &gCameras[gCurrentCamID];
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle == 2) {
|
if (gGameStatusPtr->context == CONTEXT_PAUSE) {
|
||||||
gSPViewport(gMainGfxPos++, &SprPauseVp);
|
gSPViewport(gMainGfxPos++, &SprPauseVp);
|
||||||
SprPauseVpAlt.vp.vtrans[0] = SprPauseVp.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x;
|
SprPauseVpAlt.vp.vtrans[0] = SprPauseVp.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x;
|
||||||
SprPauseVpAlt.vp.vtrans[1] = SprPauseVp.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y;
|
SprPauseVpAlt.vp.vtrans[1] = SprPauseVp.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y;
|
||||||
|
@ -37,7 +37,7 @@ void clear_sprite_shading_data(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_sprite_shading_data(void) {
|
void init_sprite_shading_data(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gSpriteShadingProfile = &wSpriteShadingProfile;
|
gSpriteShadingProfile = &wSpriteShadingProfile;
|
||||||
gAuxSpriteShadingProfile = &wSpriteShadingProfileAux;
|
gAuxSpriteShadingProfile = &wSpriteShadingProfileAux;
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,7 +57,7 @@ void state_step_battle(void) {
|
|||||||
nuContRmbForceStopEnd();
|
nuContRmbForceStopEnd();
|
||||||
sfx_stop_env_sounds();
|
sfx_stop_env_sounds();
|
||||||
func_8003B1A8();
|
func_8003B1A8();
|
||||||
gGameStatusPtr->isBattle = TRUE;
|
gGameStatusPtr->context = CONTEXT_BATTLE;
|
||||||
backup_map_collision_data();
|
backup_map_collision_data();
|
||||||
|
|
||||||
#if !VERSION_IQUE
|
#if !VERSION_IQUE
|
||||||
@ -146,7 +146,7 @@ void state_step_end_battle(void) {
|
|||||||
mapSettings = get_current_map_settings();
|
mapSettings = get_current_map_settings();
|
||||||
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
|
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
|
||||||
btl_restore_world_cameras();
|
btl_restore_world_cameras();
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
func_8005AF84();
|
func_8005AF84();
|
||||||
func_8002ACDC();
|
func_8002ACDC();
|
||||||
sfx_clear_env_sounds(1);
|
sfx_clear_env_sounds(1);
|
||||||
|
@ -191,7 +191,7 @@ void state_step_demo(void) {
|
|||||||
gGameStatusPtr->demoState = DEMO_STATE_NONE;
|
gGameStatusPtr->demoState = DEMO_STATE_NONE;
|
||||||
gGameStatusPtr->peachFlags = 0;
|
gGameStatusPtr->peachFlags = 0;
|
||||||
enable_sounds();
|
enable_sounds();
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->debugUnused1 = FALSE;
|
gGameStatusPtr->debugUnused1 = FALSE;
|
||||||
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
||||||
gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;
|
gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;
|
||||||
|
@ -139,7 +139,7 @@ void state_step_language_select(void) {
|
|||||||
D_800A0930 = -1;
|
D_800A0930 = -1;
|
||||||
sfx_stop_env_sounds();
|
sfx_stop_env_sounds();
|
||||||
func_8003B1A8();
|
func_8003B1A8();
|
||||||
gGameStatusPtr->isBattle = 2;
|
gGameStatusPtr->context = CONTEXT_PAUSE;
|
||||||
backup_map_collision_data();
|
backup_map_collision_data();
|
||||||
battle_heap_create();
|
battle_heap_create();
|
||||||
sfx_clear_env_sounds(0);
|
sfx_clear_env_sounds(0);
|
||||||
@ -292,7 +292,7 @@ void state_step_exit_language_select(void) {
|
|||||||
gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
|
gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
|
||||||
mapSettings = get_current_map_settings();
|
mapSettings = get_current_map_settings();
|
||||||
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
|
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
func_8005AF84();
|
func_8005AF84();
|
||||||
func_8002ACDC();
|
func_8002ACDC();
|
||||||
sfx_clear_env_sounds(1);
|
sfx_clear_env_sounds(1);
|
||||||
|
@ -156,7 +156,7 @@ void state_step_intro(void) {
|
|||||||
break;
|
break;
|
||||||
case INTRO_LOAD_MAP:
|
case INTRO_LOAD_MAP:
|
||||||
set_curtain_draw_callback(NULL);
|
set_curtain_draw_callback(NULL);
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->debugUnused1 = FALSE;
|
gGameStatusPtr->debugUnused1 = FALSE;
|
||||||
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
||||||
gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;
|
gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;
|
||||||
|
@ -82,7 +82,7 @@ void state_step_pause(void) {
|
|||||||
gGameStatusPtr->savedBackgroundDarkness = gGameStatusPtr->backgroundDarkness;
|
gGameStatusPtr->savedBackgroundDarkness = gGameStatusPtr->backgroundDarkness;
|
||||||
sfx_stop_env_sounds();
|
sfx_stop_env_sounds();
|
||||||
func_8003B1A8();
|
func_8003B1A8();
|
||||||
gGameStatusPtr->isBattle = 2;
|
gGameStatusPtr->context = CONTEXT_PAUSE;
|
||||||
backup_map_collision_data();
|
backup_map_collision_data();
|
||||||
battle_heap_create();
|
battle_heap_create();
|
||||||
nuContRmbForceStop();
|
nuContRmbForceStop();
|
||||||
@ -163,7 +163,7 @@ void state_step_unpause(void) {
|
|||||||
gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
|
gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
|
||||||
mapSettings = get_current_map_settings();
|
mapSettings = get_current_map_settings();
|
||||||
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
|
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->backgroundFlags &= ~BACKGROUND_RENDER_STATE_MASK;
|
gGameStatusPtr->backgroundFlags &= ~BACKGROUND_RENDER_STATE_MASK;
|
||||||
func_8005AF84();
|
func_8005AF84();
|
||||||
func_8002ACDC();
|
func_8002ACDC();
|
||||||
|
@ -20,7 +20,7 @@ void state_step_startup(void) {
|
|||||||
|
|
||||||
gOverrideFlags = 0;
|
gOverrideFlags = 0;
|
||||||
gGameStatusPtr->areaID = 0;
|
gGameStatusPtr->areaID = 0;
|
||||||
gGameStatusPtr->isBattle = 0;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gameStatus->prevArea = -1;
|
gameStatus->prevArea = -1;
|
||||||
gameStatus->mapID = 0;
|
gameStatus->mapID = 0;
|
||||||
gameStatus->entryID = 0;
|
gameStatus->entryID = 0;
|
||||||
|
@ -126,7 +126,7 @@ void state_init_title_screen(void) {
|
|||||||
sfx_set_reverb_mode(0);
|
sfx_set_reverb_mode(0);
|
||||||
gGameStatusPtr->startupState = TITLE_STATE_INIT;
|
gGameStatusPtr->startupState = TITLE_STATE_INIT;
|
||||||
gGameStatusPtr->logoTime = 0;
|
gGameStatusPtr->logoTime = 0;
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->introPart = INTRO_PART_NONE;
|
gGameStatusPtr->introPart = INTRO_PART_NONE;
|
||||||
startup_fade_screen_update();
|
startup_fade_screen_update();
|
||||||
titleData = load_asset_by_name("title_data", &titleDataSize);
|
titleData = load_asset_by_name("title_data", &titleDataSize);
|
||||||
|
@ -615,7 +615,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->status1.activeTask == STATUS_ICON_TASK_DRAW) {
|
if (icon->status1.activeTask == STATUS_ICON_TASK_DRAW) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_DEBUFF) {
|
if (icon->flags & STATUS_ICON_FLAG_DEBUFF) {
|
||||||
hud_element_set_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -632,7 +632,9 @@ void draw_all_status_icons(void* data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon->status1.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
if (icon->status1.removingTask == STATUS_ICON_TASK_DRAW
|
||||||
|
&& (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE)
|
||||||
|
) {
|
||||||
hud_element_clear_flags(icon->status1.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status1.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
if (isActiveDrawn == 0) {
|
if (isActiveDrawn == 0) {
|
||||||
@ -654,7 +656,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->status2.activeTask == STATUS_ICON_TASK_DRAW) {
|
if (icon->status2.activeTask == STATUS_ICON_TASK_DRAW) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_STATIC) {
|
if (icon->flags & STATUS_ICON_FLAG_STATIC) {
|
||||||
hud_element_set_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
@ -677,7 +679,9 @@ void draw_all_status_icons(void* data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon->status2.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
if (icon->status2.removingTask == STATUS_ICON_TASK_DRAW
|
||||||
|
&& (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE)
|
||||||
|
) {
|
||||||
hud_element_clear_flags(icon->status2.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status2.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
@ -703,7 +707,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->status3.activeTask == STATUS_ICON_TASK_DRAW) {
|
if (icon->status3.activeTask == STATUS_ICON_TASK_DRAW) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_TRANSPARENT) {
|
if (icon->flags & STATUS_ICON_FLAG_TRANSPARENT) {
|
||||||
hud_element_set_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
@ -727,7 +731,9 @@ void draw_all_status_icons(void* data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon->status3.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
if (icon->status3.removingTask == STATUS_ICON_TASK_DRAW
|
||||||
|
&& (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE)
|
||||||
|
) {
|
||||||
hud_element_clear_flags(icon->status3.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status3.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
@ -756,7 +762,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->status4.activeTask == STATUS_ICON_TASK_DRAW) {
|
if (icon->status4.activeTask == STATUS_ICON_TASK_DRAW) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_STATUS_CHILL_OUT) {
|
if (icon->flags & STATUS_ICON_FLAG_STATUS_CHILL_OUT) {
|
||||||
hud_element_set_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
@ -784,7 +790,9 @@ void draw_all_status_icons(void* data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon->status4.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
if (icon->status4.removingTask == STATUS_ICON_TASK_DRAW
|
||||||
|
&& (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE)
|
||||||
|
) {
|
||||||
hud_element_clear_flags(icon->status4.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->status4.removingElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
offsetY = 0;
|
offsetY = 0;
|
||||||
@ -816,7 +824,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->boostJump.active) {
|
if (icon->boostJump.active) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_BOOST_JUMP) {
|
if (icon->flags & STATUS_ICON_FLAG_BOOST_JUMP) {
|
||||||
hud_element_set_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -846,7 +854,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->boostHammer.active) {
|
if (icon->boostHammer.active) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_BOOST_HAMMER) {
|
if (icon->flags & STATUS_ICON_FLAG_BOOST_HAMMER) {
|
||||||
hud_element_set_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -876,7 +884,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->boostPartner.active) {
|
if (icon->boostPartner.active) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_BOOST_PARTNER) {
|
if (icon->flags & STATUS_ICON_FLAG_BOOST_PARTNER) {
|
||||||
hud_element_set_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -894,7 +902,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->surprise.active) {
|
if (icon->surprise.active) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_SURPRISE) {
|
if (icon->flags & STATUS_ICON_FLAG_SURPRISE) {
|
||||||
hud_element_set_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -912,7 +920,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->peril.active) {
|
if (icon->peril.active) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_PERIL) {
|
if (icon->flags & STATUS_ICON_FLAG_PERIL) {
|
||||||
hud_element_set_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -930,7 +938,7 @@ void draw_all_status_icons(void* data) {
|
|||||||
if (icon->danger.active) {
|
if (icon->danger.active) {
|
||||||
if (icon->flags & STATUS_ICON_FLAG_DANGER) {
|
if (icon->flags & STATUS_ICON_FLAG_DANGER) {
|
||||||
hud_element_set_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_set_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) {
|
||||||
hud_element_clear_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
hud_element_clear_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAG_DISABLED);
|
||||||
|
|
||||||
x = icon->worldPos.x;
|
x = icon->worldPos.x;
|
||||||
@ -959,8 +967,9 @@ s32 create_status_icon_set(void) {
|
|||||||
ASSERT(i < MAX_ICONS);
|
ASSERT(i < MAX_ICONS);
|
||||||
|
|
||||||
icon->flags = STATUS_ICON_FLAG_USED;
|
icon->flags = STATUS_ICON_FLAG_USED;
|
||||||
if (gGameStatusPtr->isBattle) {
|
|
||||||
icon->flags = STATUS_ICON_FLAG_BATTLE | STATUS_ICON_FLAG_USED;
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
|
icon->flags |= STATUS_ICON_FLAG_BATTLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
icon->worldPos.x = 0;
|
icon->worldPos.x = 0;
|
||||||
|
@ -13,7 +13,7 @@ void clear_trigger_data(void) {
|
|||||||
CollisionStatus* collisionStatus = &gCollisionStatus;
|
CollisionStatus* collisionStatus = &gCollisionStatus;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentTriggerListPtr = &wTriggerList;
|
gCurrentTriggerListPtr = &wTriggerList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentTriggerListPtr = &bTriggerList;
|
gCurrentTriggerListPtr = &bTriggerList;
|
||||||
@ -42,7 +42,7 @@ void clear_trigger_data(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_trigger_list(void) {
|
void init_trigger_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentTriggerListPtr = &wTriggerList;
|
gCurrentTriggerListPtr = &wTriggerList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentTriggerListPtr = &bTriggerList;
|
gCurrentTriggerListPtr = &bTriggerList;
|
||||||
|
12
src/worker.c
12
src/worker.c
@ -10,7 +10,7 @@ void worker_delegate_do_nothing(void) {
|
|||||||
void clear_worker_list(void) {
|
void clear_worker_list(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentWorkerListPtr = &gWorldWorkerList;
|
gCurrentWorkerListPtr = &gWorldWorkerList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentWorkerListPtr = &gBattleWorkerList;
|
gCurrentWorkerListPtr = &gBattleWorkerList;
|
||||||
@ -22,7 +22,7 @@ void clear_worker_list(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_worker_list(void) {
|
void init_worker_list(void) {
|
||||||
if (!gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
gCurrentWorkerListPtr = &gWorldWorkerList;
|
gCurrentWorkerListPtr = &gWorldWorkerList;
|
||||||
} else {
|
} else {
|
||||||
gCurrentWorkerListPtr = &gBattleWorkerList;
|
gCurrentWorkerListPtr = &gBattleWorkerList;
|
||||||
@ -54,7 +54,7 @@ s32 create_worker_world(void (*updateFunc)(void), void (*drawFunc)(void)) {
|
|||||||
worker->draw = worker_delegate_do_nothing;
|
worker->draw = worker_delegate_do_nothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ENTITY_ID_BIT;
|
i |= BATTLE_ENTITY_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -85,7 +85,7 @@ s32 create_worker_frontUI(void (*updateFunc)(void), void (*drawFunc)(void)) {
|
|||||||
worker->draw = worker_delegate_do_nothing;
|
worker->draw = worker_delegate_do_nothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ENTITY_ID_BIT;
|
i |= BATTLE_ENTITY_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -116,7 +116,7 @@ s32 create_worker_backUI(void (*updateFunc)(void), void (*drawFunc)(void)) {
|
|||||||
worker->draw = &worker_delegate_do_nothing;
|
worker->draw = &worker_delegate_do_nothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGameStatusPtr->isBattle) {
|
if (gGameStatusPtr->context != CONTEXT_WORLD) {
|
||||||
i |= BATTLE_ENTITY_ID_BIT;
|
i |= BATTLE_ENTITY_ID_BIT;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -174,7 +174,7 @@ void render_workers_backUI(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void free_worker(s32 idx) {
|
void free_worker(s32 idx) {
|
||||||
if (!gGameStatusPtr->isBattle || (idx & BATTLE_ENTITY_ID_BIT)) {
|
if (gGameStatusPtr->context == CONTEXT_WORLD || (idx & BATTLE_ENTITY_ID_BIT)) {
|
||||||
idx &= ~BATTLE_ENTITY_ID_BIT;
|
idx &= ~BATTLE_ENTITY_ID_BIT;
|
||||||
if ((*gCurrentWorkerListPtr)[idx] != NULL) {
|
if ((*gCurrentWorkerListPtr)[idx] != NULL) {
|
||||||
heap_free((*gCurrentWorkerListPtr)[idx]);
|
heap_free((*gCurrentWorkerListPtr)[idx]);
|
||||||
|
@ -155,7 +155,7 @@ void action_update_first_strike(void) {
|
|||||||
|
|
||||||
if (playerStatus->curStateTime != 0) {
|
if (playerStatus->curStateTime != 0) {
|
||||||
playerStatus->curStateTime--;
|
playerStatus->curStateTime--;
|
||||||
} else if (!gGameStatusPtr->isBattle) {
|
} else if (gGameStatusPtr->context == CONTEXT_WORLD) {
|
||||||
set_action_state(ACTION_STATE_IDLE);
|
set_action_state(ACTION_STATE_IDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ API_CALLABLE(N(SetTubbaPatrolTerritory)) {
|
|||||||
API_CALLABLE(N(SetTubbaPatrolMode)) {
|
API_CALLABLE(N(SetTubbaPatrolMode)) {
|
||||||
if (get_enemy_safe(NPC_Tubba)) {
|
if (get_enemy_safe(NPC_Tubba)) {
|
||||||
Enemy* enemy = get_enemy(NPC_Tubba);
|
Enemy* enemy = get_enemy(NPC_Tubba);
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_80;
|
enemy->aiFlags |= AI_FLAG_80;
|
||||||
return ApiStatus_DONE2;
|
return ApiStatus_DONE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ NpcSettings N(NpcSettings_Archeologist_Wander) = {
|
|||||||
.radius = 24,
|
.radius = 24,
|
||||||
.ai = &N(EVS_NpcAI_Archeologist),
|
.ai = &N(EVS_NpcAI_Archeologist),
|
||||||
.level = ACTOR_LEVEL_NONE,
|
.level = ACTOR_LEVEL_NONE,
|
||||||
.actionFlags = ENEMY_AI_FLAG_10,
|
.actionFlags = AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE,
|
||||||
};
|
};
|
||||||
|
|
||||||
NpcSettings N(NpcSettings_Archeologist) = {
|
NpcSettings N(NpcSettings_Archeologist) = {
|
||||||
|
@ -282,7 +282,7 @@ API_CALLABLE(N(FadeToTitleScreen)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
API_CALLABLE(N(ChangeStateToTitleScreen)) {
|
API_CALLABLE(N(ChangeStateToTitleScreen)) {
|
||||||
gGameStatusPtr->isBattle = FALSE;
|
gGameStatusPtr->context = CONTEXT_WORLD;
|
||||||
gGameStatusPtr->debugUnused1 = FALSE;
|
gGameStatusPtr->debugUnused1 = FALSE;
|
||||||
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE;
|
||||||
gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;
|
gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;
|
||||||
|
@ -406,7 +406,7 @@ NpcData N(NpcData_ShyGuy_Thief) = {
|
|||||||
.flags = ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING,
|
.flags = ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING,
|
||||||
.drops = SHY_GUY_DROPS,
|
.drops = SHY_GUY_DROPS,
|
||||||
.animations = YELLOW_SHY_GUY_ANIMS,
|
.animations = YELLOW_SHY_GUY_ANIMS,
|
||||||
.aiFlags = ENEMY_AI_FLAG_1,
|
.aiFlags = AI_FLAG_1,
|
||||||
.aiDetectFlags = AI_DETECT_SIGHT,
|
.aiDetectFlags = AI_DETECT_SIGHT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ API_CALLABLE(N(AvoidPlayerAI_Main)) {
|
|||||||
enemy->unk_118 = 0.01f;
|
enemy->unk_118 = 0.01f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->functionTemp[0] = AI_STATE_WANDER_INIT;
|
script->functionTemp[0] = AI_STATE_WANDER_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -193,10 +193,10 @@ API_CALLABLE(N(AvoidPlayerAI_Main)) {
|
|||||||
npc->flags &= ~NPC_FLAG_GRAVITY;
|
npc->flags &= ~NPC_FLAG_GRAVITY;
|
||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = AI_STATE_SUSPEND;
|
script->functionTemp[0] = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = AI_STATE_WANDER_INIT;
|
script->functionTemp[1] = AI_STATE_WANDER_INIT;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,18 +49,18 @@ API_CALLABLE(N(BulletBillAI_Main)) {
|
|||||||
if (isInitialCall || enemy->VAR_PROJECTILE_HITBOX_STATE == PROJECTILE_HITBOX_STATE_DONE) {
|
if (isInitialCall || enemy->VAR_PROJECTILE_HITBOX_STATE == PROJECTILE_HITBOX_STATE_DONE) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_BULLET_INIT;
|
script->AI_TEMP_STATE = AI_STATE_BULLET_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_8;
|
enemy->aiFlags |= AI_FLAG_SKIP_EMOTE_AFTER_FLEE;
|
||||||
enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN;
|
enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN;
|
||||||
npc->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW;
|
npc->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW;
|
||||||
enemy->VAR_PROJECTILE_HITBOX_STATE = PROJECTILE_HITBOX_STATE_NONE;
|
enemy->VAR_PROJECTILE_HITBOX_STATE = PROJECTILE_HITBOX_STATE_NONE;
|
||||||
enemy->AI_VAR_BULLET_BLASTER = -1;
|
enemy->AI_VAR_BULLET_BLASTER = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
@ -172,12 +172,12 @@ API_CALLABLE(N(BillBlasterAI_Main)) {
|
|||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
|
@ -188,7 +188,7 @@ void N(CleftAI_Tackle)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol
|
|||||||
spawn_surface_effects(npc, SURFACE_INTERACT_RUN);
|
spawn_surface_effects(npc, SURFACE_INTERACT_RUN);
|
||||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||||
|
|
||||||
if (is_point_within_region(enemy->territory->wander.detectShape,
|
if (is_point_outside_territory(enemy->territory->wander.detectShape,
|
||||||
enemy->territory->wander.detectPos.x, enemy->territory->wander.detectPos.z,
|
enemy->territory->wander.detectPos.x, enemy->territory->wander.detectPos.z,
|
||||||
npc->pos.x, npc->pos.z,
|
npc->pos.x, npc->pos.z,
|
||||||
enemy->territory->wander.detectSize.x, enemy->territory->wander.detectSize.z)) {
|
enemy->territory->wander.detectSize.x, enemy->territory->wander.detectSize.z)) {
|
||||||
@ -316,11 +316,11 @@ API_CALLABLE(N(CleftAI_Main)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime) {
|
if (enemy->aiSuspendTime) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((script->AI_TEMP_STATE == AI_STATE_CLEFT_CHASE_INIT)
|
if (((script->AI_TEMP_STATE == AI_STATE_CLEFT_CHASE_INIT)
|
||||||
|
@ -216,7 +216,7 @@ API_CALLABLE(N(ClubbaNappingAI_Main)) {
|
|||||||
territory.halfHeight = 40.0f;
|
territory.halfHeight = 40.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_NAPPING_CLUBBA_INIT;
|
script->AI_TEMP_STATE = AI_STATE_NAPPING_CLUBBA_INIT;
|
||||||
npc->duration = 30;
|
npc->duration = 30;
|
||||||
npc->curAnim = enemy->animList[10];
|
npc->curAnim = enemy->animList[10];
|
||||||
@ -227,12 +227,12 @@ API_CALLABLE(N(ClubbaNappingAI_Main)) {
|
|||||||
} else {
|
} else {
|
||||||
npc->flags = (npc->flags & ~NPC_FLAG_GRAVITY) | NPC_FLAG_FLYING;
|
npc->flags = (npc->flags & ~NPC_FLAG_GRAVITY) | NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->AI_TEMP_STATE_AFTER_SUSPEND = AI_RETURN_HOME_INIT;
|
script->AI_TEMP_STATE_AFTER_SUSPEND = AI_RETURN_HOME_INIT;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (script->AI_TEMP_STATE >= AI_STATE_ALERT_INIT
|
if (script->AI_TEMP_STATE >= AI_STATE_ALERT_INIT
|
||||||
|
@ -22,7 +22,7 @@ API_CALLABLE(N(ClubbaPatrolAI_Main)) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_PATROL_INIT;
|
script->AI_TEMP_STATE = AI_STATE_PATROL_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -34,10 +34,10 @@ API_CALLABLE(N(ClubbaPatrolAI_Main)) {
|
|||||||
npc->flags &= ~NPC_FLAG_GRAVITY;
|
npc->flags &= ~NPC_FLAG_GRAVITY;
|
||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = AI_STATE_PATROL_INIT;
|
script->functionTemp[1] = AI_STATE_PATROL_INIT;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
enemy->varTable[0] = 0;
|
enemy->varTable[0] = 0;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ void N(FlyingAI_WanderInit)(Evt* script, MobileAISettings* aiSettings, EnemyDete
|
|||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape,
|
||||||
enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z,
|
enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z,
|
||||||
npc->pos.x, npc->pos.z,
|
npc->pos.x, npc->pos.z,
|
||||||
enemy->territory->wander.wanderSize.x, enemy->territory->wander.wanderSize.z)) {
|
enemy->territory->wander.wanderSize.x, enemy->territory->wander.wanderSize.z)) {
|
||||||
@ -151,7 +151,7 @@ void N(FlyingAI_Wander)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo
|
|||||||
enemy->varTable[9]--;
|
enemy->varTable[9]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape,
|
||||||
enemy->territory->wander.centerPos.x,
|
enemy->territory->wander.centerPos.x,
|
||||||
enemy->territory->wander.centerPos.z,
|
enemy->territory->wander.centerPos.z,
|
||||||
npc->pos.x, npc->pos.z,
|
npc->pos.x, npc->pos.z,
|
||||||
@ -428,7 +428,7 @@ void N(FlyingAI_Init)(Npc* npc, Enemy* enemy, Evt* script, MobileAISettings* aiS
|
|||||||
enemy->varTable[3] = (depth * 100.0) + 0.5;
|
enemy->varTable[3] = (depth * 100.0) + 0.5;
|
||||||
enemy->varTable[7] = (posY * 100.0) + 0.5;
|
enemy->varTable[7] = (posY * 100.0) + 0.5;
|
||||||
script->functionTemp[1] = aiSettings->playerSearchInterval;
|
script->functionTemp[1] = aiSettings->playerSearchInterval;
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_10;
|
enemy->aiFlags |= AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
API_CALLABLE(N(FlyingAI_Main)) {
|
API_CALLABLE(N(FlyingAI_Main)) {
|
||||||
@ -466,11 +466,11 @@ API_CALLABLE(N(FlyingAI_Main)) {
|
|||||||
|
|
||||||
npc->verticalRenderOffset = -2;
|
npc->verticalRenderOffset = -2;
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
|
@ -60,7 +60,7 @@ void N(FlyingMagikoopaAI_15)(Evt* arg0, MobileAISettings* arg1, EnemyDetectVolum
|
|||||||
if (npc->duration <= 0) {
|
if (npc->duration <= 0) {
|
||||||
randomDist = rand_int(30) + 180.0;
|
randomDist = rand_int(30) + 180.0;
|
||||||
isCCW = FALSE;
|
isCCW = FALSE;
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSize.x, enemy->territory->wander.wanderSize.z)) {
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSize.x, enemy->territory->wander.wanderSize.z)) {
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z) - iterations;
|
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z) - iterations;
|
||||||
moveDist = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z);
|
moveDist = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z);
|
||||||
if (randomDist > moveDist) {
|
if (randomDist > moveDist) {
|
||||||
@ -307,11 +307,11 @@ API_CALLABLE(N(FlyingMagikoopaAI_Main)) {
|
|||||||
|
|
||||||
npc->verticalRenderOffset = -5;
|
npc->verticalRenderOffset = -5;
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
|
@ -127,11 +127,11 @@ API_CALLABLE(N(FlyingNoAttackAI_Main)) {
|
|||||||
}
|
}
|
||||||
npc->verticalRenderOffset = -2;
|
npc->verticalRenderOffset = -2;
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime) {
|
if (enemy->aiSuspendTime) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->functionTemp[0]) {
|
switch (script->functionTemp[0]) {
|
||||||
|
@ -86,7 +86,7 @@ API_CALLABLE(N(GrooveGuyAI_Main)) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (isInitialCall || enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -100,13 +100,13 @@ API_CALLABLE(N(GrooveGuyAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = 99;
|
script->functionTemp[0] = 99;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->functionTemp[0] = 12;
|
script->functionTemp[0] = 12;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
|
||||||
hitDepth = 100.0f;
|
hitDepth = 100.0f;
|
||||||
|
@ -205,7 +205,7 @@ API_CALLABLE(N(GuardAI_Main)) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_GUARD_IDLE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_GUARD_IDLE_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
enemy->varTable[0] = npc->yaw;
|
enemy->varTable[0] = npc->yaw;
|
||||||
@ -220,10 +220,10 @@ API_CALLABLE(N(GuardAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = 15;
|
script->functionTemp[1] = 15;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
@ -14,7 +14,7 @@ void N(HoppingAI_HopInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect
|
|||||||
npc->jumpScale = 1.5f;
|
npc->jumpScale = 1.5f;
|
||||||
ai_enemy_play_sound(npc, SOUND_SEQ_FUZZY_HOP, 0);
|
ai_enemy_play_sound(npc, SOUND_SEQ_FUZZY_HOP, 0);
|
||||||
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape,
|
||||||
enemy->territory->wander.centerPos.x,
|
enemy->territory->wander.centerPos.x,
|
||||||
enemy->territory->wander.centerPos.z,
|
enemy->territory->wander.centerPos.z,
|
||||||
npc->pos.x, npc->pos.z,
|
npc->pos.x, npc->pos.z,
|
||||||
@ -245,18 +245,18 @@ API_CALLABLE(N(HoppingAI_Main)) {
|
|||||||
npc->flags &= ~NPC_FLAG_GRAVITY;
|
npc->flags &= ~NPC_FLAG_GRAVITY;
|
||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
|
|
||||||
enemy->aiFlags |= (ENEMY_AI_FLAG_8 | ENEMY_AI_FLAG_10);
|
enemy->aiFlags |= (AI_FLAG_SKIP_EMOTE_AFTER_FLEE | AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE);
|
||||||
if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
|
@ -25,10 +25,10 @@ API_CALLABLE(N(KoopaPatrolAI_Main)) {
|
|||||||
|
|
||||||
if (isInitialCall) {
|
if (isInitialCall) {
|
||||||
enemy->varTable[6] = npc->collisionHeight;
|
enemy->varTable[6] = npc->collisionHeight;
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_8;
|
enemy->aiFlags |= AI_FLAG_SKIP_EMOTE_AFTER_FLEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
enemy->hitboxIsActive = FALSE;
|
enemy->hitboxIsActive = FALSE;
|
||||||
@ -46,13 +46,13 @@ API_CALLABLE(N(KoopaPatrolAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
EffectInstance* emoteTemp;
|
EffectInstance* emoteTemp;
|
||||||
|
|
||||||
script->functionTemp[0] = 99;
|
script->functionTemp[0] = 99;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 40, &emoteTemp);
|
fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 40, &emoteTemp);
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->functionTemp[0] = AI_STATE_CHASE_INIT;
|
script->functionTemp[0] = AI_STATE_CHASE_INIT;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
@ -75,7 +75,7 @@ void N(LakituAI_Wander)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo
|
|||||||
script->functionTemp[1]--;
|
script->functionTemp[1]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.centerPos.x,
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape, enemy->territory->wander.centerPos.x,
|
||||||
enemy->territory->wander.centerPos.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSize.x,
|
enemy->territory->wander.centerPos.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSize.x,
|
||||||
enemy->territory->wander.wanderSize.z) != 0) {
|
enemy->territory->wander.wanderSize.z) != 0) {
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z);
|
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z);
|
||||||
@ -192,11 +192,11 @@ API_CALLABLE(N(LakituAI_Main)) {
|
|||||||
}
|
}
|
||||||
npc->verticalRenderOffset = -3;
|
npc->verticalRenderOffset = -3;
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
@ -283,7 +283,7 @@ API_CALLABLE(N(LakituAI_Main)) {
|
|||||||
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z);
|
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z);
|
||||||
playerDist = dist2D(gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z, npc->pos.x, npc->pos.z);
|
playerDist = dist2D(gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z, npc->pos.x, npc->pos.z);
|
||||||
if (!is_point_within_region(territoryPtr->shape,
|
if (!is_point_outside_territory(territoryPtr->shape,
|
||||||
territoryPtr->pointX, territoryPtr->pointZ,
|
territoryPtr->pointX, territoryPtr->pointZ,
|
||||||
npc->pos.x, npc->pos.z,
|
npc->pos.x, npc->pos.z,
|
||||||
territoryPtr->sizeX, territoryPtr->sizeZ)) {
|
territoryPtr->sizeX, territoryPtr->sizeZ)) {
|
||||||
|
@ -248,14 +248,14 @@ API_CALLABLE(N(MagikoopaAI_Main)) {
|
|||||||
territory.halfHeight = 100.0f;
|
territory.halfHeight = 100.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
npc->curAnim = enemy->animList[0];
|
npc->curAnim = enemy->animList[0];
|
||||||
npc->flags &= ~NPC_FLAG_JUMPING;
|
npc->flags &= ~NPC_FLAG_JUMPING;
|
||||||
npc->flags |= NPC_FLAG_200000;
|
npc->flags |= NPC_FLAG_200000;
|
||||||
enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN;
|
enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
npc->alpha = 0xFF;
|
npc->alpha = 0xFF;
|
||||||
npc->duration = 20;
|
npc->duration = 20;
|
||||||
npc->scale.x = 1.0f;
|
npc->scale.x = 1.0f;
|
||||||
|
@ -48,7 +48,7 @@ API_CALLABLE(N(MagikoopaAI_SpellMain)) {
|
|||||||
f32 t1;
|
f32 t1;
|
||||||
f32 t2;
|
f32 t2;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
npc1->duration = 0;
|
npc1->duration = 0;
|
||||||
npc1->flags |= NPC_FLAG_200000 | NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_INVISIBLE;
|
npc1->flags |= NPC_FLAG_200000 | NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_INVISIBLE;
|
||||||
@ -56,8 +56,8 @@ API_CALLABLE(N(MagikoopaAI_SpellMain)) {
|
|||||||
ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN | ENEMY_FLAG_PROJECTILE;
|
ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN | ENEMY_FLAG_PROJECTILE;
|
||||||
npc1->scale.x = 0.4f;
|
npc1->scale.x = 0.4f;
|
||||||
npc1->scale.y = 0.4f;
|
npc1->scale.y = 0.4f;
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ API_CALLABLE(N(MeleeHitbox_Main)) {
|
|||||||
hitboxEnemy->unk_118 = 0.0001f;
|
hitboxEnemy->unk_118 = 0.0001f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isInitialCall || (hitboxEnemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (hitboxEnemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
hitboxNpc->duration = 0;
|
hitboxNpc->duration = 0;
|
||||||
hitboxNpc->flags |= (NPC_FLAG_INVISIBLE | NPC_FLAG_IGNORE_PLAYER_COLLISION);
|
hitboxNpc->flags |= (NPC_FLAG_INVISIBLE | NPC_FLAG_IGNORE_PLAYER_COLLISION);
|
||||||
@ -120,8 +120,8 @@ API_CALLABLE(N(MeleeHitbox_Main)) {
|
|||||||
hitboxNpc->pos.x = NPC_DISPOSE_POS_X;
|
hitboxNpc->pos.x = NPC_DISPOSE_POS_X;
|
||||||
hitboxNpc->pos.y = NPC_DISPOSE_POS_Y;
|
hitboxNpc->pos.y = NPC_DISPOSE_POS_Y;
|
||||||
hitboxNpc->pos.z = NPC_DISPOSE_POS_Z;
|
hitboxNpc->pos.z = NPC_DISPOSE_POS_Z;
|
||||||
if (hitboxEnemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (hitboxEnemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
hitboxEnemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
hitboxEnemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,13 @@ enum AiStateMontyMole {
|
|||||||
AI_STATE_MOLE_BURROW = 21, // burrow underground
|
AI_STATE_MOLE_BURROW = 21, // burrow underground
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MONTY_MOLE_UNK_NPC_FLAGS 0x1F100000
|
#define INTANGIBLE_MONTY_MOLE_NPC_FLAGS \
|
||||||
|
ENEMY_FLAG_100000 \
|
||||||
|
| ENEMY_FLAG_IGNORE_TOUCH \
|
||||||
|
| ENEMY_FLAG_IGNORE_JUMP \
|
||||||
|
| ENEMY_FLAG_IGNORE_HAMMER \
|
||||||
|
| ENEMY_FLAG_IGNORE_PARTNER \
|
||||||
|
| ENEMY_FLAG_CANT_INTERACT
|
||||||
|
|
||||||
static s32 N(MontyMoleAI_CanAttack)(Evt* script, EnemyDetectVolume* territory, f32 radius, f32 arg3) {
|
static s32 N(MontyMoleAI_CanAttack)(Evt* script, EnemyDetectVolume* territory, f32 radius, f32 arg3) {
|
||||||
Camera* cam;
|
Camera* cam;
|
||||||
@ -74,7 +80,7 @@ static void N(MontyMoleAI_Init)(Evt* script, MobileAISettings* aiSettings, Enemy
|
|||||||
} else {
|
} else {
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
||||||
}
|
}
|
||||||
enemy->flags |= MONTY_MOLE_UNK_NPC_FLAGS;
|
enemy->flags |= INTANGIBLE_MONTY_MOLE_NPC_FLAGS;
|
||||||
npc->flags |= NPC_FLAG_INVISIBLE;
|
npc->flags |= NPC_FLAG_INVISIBLE;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
script->AI_TEMP_STATE = AI_STATE_MOLE_WANDER;
|
script->AI_TEMP_STATE = AI_STATE_MOLE_WANDER;
|
||||||
@ -86,7 +92,7 @@ static void N(MontyMoleAI_Wander)(Evt* script, MobileAISettings* aiSettings, Ene
|
|||||||
Npc dummyNpc;
|
Npc dummyNpc;
|
||||||
f32 hitDepth;
|
f32 hitDepth;
|
||||||
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
if (is_point_outside_territory(enemy->territory->wander.wanderShape,
|
||||||
enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z,
|
enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z,
|
||||||
npc->pos.x, npc->pos.z,
|
npc->pos.x, npc->pos.z,
|
||||||
enemy->territory->wander.wanderSize.x, enemy->territory->wander.wanderSize.z)) {
|
enemy->territory->wander.wanderSize.x, enemy->territory->wander.wanderSize.z)) {
|
||||||
@ -142,7 +148,7 @@ static void N(MontyMoleAI_Surface)(Evt* script, MobileAISettings* aiSettings, En
|
|||||||
|
|
||||||
npc->duration--;
|
npc->duration--;
|
||||||
if (npc->duration == 2) {
|
if (npc->duration == 2) {
|
||||||
enemy->flags &= ~MONTY_MOLE_UNK_NPC_FLAGS;
|
enemy->flags &= ~(INTANGIBLE_MONTY_MOLE_NPC_FLAGS);
|
||||||
}
|
}
|
||||||
if (npc->duration <= 0) {
|
if (npc->duration <= 0) {
|
||||||
npc->curAnim = ANIM_MontyMole_Anim18; // get and throw rock
|
npc->curAnim = ANIM_MontyMole_Anim18; // get and throw rock
|
||||||
@ -217,7 +223,7 @@ static void N(MontyMoleAI_Burrow)(Evt* script, MobileAISettings* aiSettings, Ene
|
|||||||
|
|
||||||
npc->duration--;
|
npc->duration--;
|
||||||
if (npc->duration == 3) {
|
if (npc->duration == 3) {
|
||||||
enemy->flags |= MONTY_MOLE_UNK_NPC_FLAGS;
|
enemy->flags |= INTANGIBLE_MONTY_MOLE_NPC_FLAGS;
|
||||||
}
|
}
|
||||||
if (npc->duration <= 0) {
|
if (npc->duration <= 0) {
|
||||||
npc->flags |= NPC_FLAG_INVISIBLE;
|
npc->flags |= NPC_FLAG_INVISIBLE;
|
||||||
@ -246,12 +252,12 @@ API_CALLABLE(N(MontyMoleAI_Main)) {
|
|||||||
script->AI_TEMP_STATE = AI_STATE_MOLE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_MOLE_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->flags &= ~NPC_FLAG_JUMPING;
|
npc->flags &= ~NPC_FLAG_JUMPING;
|
||||||
enemy->aiFlags |= (ENEMY_AI_FLAG_8 | ENEMY_AI_FLAG_10);
|
enemy->aiFlags |= (AI_FLAG_SKIP_EMOTE_AFTER_FLEE | AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime == 0) {
|
if (enemy->aiSuspendTime == 0) {
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else {
|
} else {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
@ -121,11 +121,11 @@ API_CALLABLE(N(ParatroopaAI_Main)) {
|
|||||||
|
|
||||||
npc->verticalRenderOffset = -3;
|
npc->verticalRenderOffset = -3;
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime != 0) {
|
if (enemy->aiSuspendTime != 0) {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (script->AI_TEMP_STATE) {
|
switch (script->AI_TEMP_STATE) {
|
||||||
|
@ -33,7 +33,7 @@ API_CALLABLE(N(PatrolNoAttackAI_Main)) {
|
|||||||
enemy->unk_118 = 0.0001f;
|
enemy->unk_118 = 0.0001f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (isInitialCall || enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_PATROL_INIT;
|
script->AI_TEMP_STATE = AI_STATE_PATROL_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -47,10 +47,10 @@ API_CALLABLE(N(PatrolNoAttackAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
@ -164,7 +164,7 @@ void N(PiranhaPlantAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_point_within_region(territory->shape, territory->pointX, territory->pointZ, npc->pos.x, npc->pos.z, territory->sizeX, territory->sizeZ)) {
|
if (is_point_outside_territory(territory->shape, territory->pointX, territory->pointZ, npc->pos.x, npc->pos.z, territory->sizeX, territory->sizeZ)) {
|
||||||
switch (territory->shape) {
|
switch (territory->shape) {
|
||||||
case SHAPE_CYLINDER:
|
case SHAPE_CYLINDER:
|
||||||
sp38 = dist2D(npc->pos.x, npc->pos.z, territory->pointX, territory->pointZ);
|
sp38 = dist2D(npc->pos.x, npc->pos.z, territory->pointX, territory->pointZ);
|
||||||
@ -319,16 +319,16 @@ API_CALLABLE(N(PiranhaPlantAI_Main)) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_PIRANHA_PLANT_00;
|
script->AI_TEMP_STATE = AI_STATE_PIRANHA_PLANT_00;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
|
|
||||||
enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_NONE;
|
enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_NONE;
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = AI_STATE_PIRANHA_PLANT_00;
|
script->functionTemp[1] = AI_STATE_PIRANHA_PLANT_00;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ API_CALLABLE(N(ProjectileAI_Main)) {
|
|||||||
npc->verticalRenderOffset = npc->collisionHeight / 2;
|
npc->verticalRenderOffset = npc->collisionHeight / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_INVISIBLE;
|
npc->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_INVISIBLE;
|
||||||
@ -159,8 +159,8 @@ API_CALLABLE(N(ProjectileAI_Main)) {
|
|||||||
enemy->flags |= ENEMY_FLAG_IGNORE_PARTNER | ENEMY_FLAG_CANT_INTERACT | ENEMY_FLAG_IGNORE_HAMMER |
|
enemy->flags |= ENEMY_FLAG_IGNORE_PARTNER | ENEMY_FLAG_CANT_INTERACT | ENEMY_FLAG_IGNORE_HAMMER |
|
||||||
ENEMY_FLAG_IGNORE_JUMP | ENEMY_FLAG_IGNORE_TOUCH | ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN |
|
ENEMY_FLAG_IGNORE_JUMP | ENEMY_FLAG_IGNORE_TOUCH | ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN |
|
||||||
ENEMY_FLAG_100000 | ENEMY_FLAG_PROJECTILE;
|
ENEMY_FLAG_100000 | ENEMY_FLAG_PROJECTILE;
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ API_CALLABLE(N(RangedAttackAI_Main)) {
|
|||||||
territory.halfHeight = 40.0f;
|
territory.halfHeight = 40.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = 0;
|
script->AI_TEMP_STATE = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -43,14 +43,14 @@ API_CALLABLE(N(RangedAttackAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ API_CALLABLE(N(ShyGuyPatrolAI_Main)) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (isInitialCall || enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -94,10 +94,10 @@ API_CALLABLE(N(ShyGuyPatrolAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = 99;
|
script->functionTemp[0] = 99;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->functionTemp[0] = 12;
|
script->functionTemp[0] = 12;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
@ -78,7 +78,7 @@ API_CALLABLE(N(ShyGuyWanderAI_Main)) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (isInitialCall || enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -92,13 +92,13 @@ API_CALLABLE(N(ShyGuyWanderAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->functionTemp[0] = 99;
|
script->functionTemp[0] = 99;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->functionTemp[0] = 12;
|
script->functionTemp[0] = 12;
|
||||||
}
|
}
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
|
||||||
hitDepth = 100.0f;
|
hitDepth = 100.0f;
|
||||||
|
@ -97,7 +97,7 @@ API_CALLABLE(N(SpearGuyAI_Main)) {
|
|||||||
territory.halfHeight = 65.0f;
|
territory.halfHeight = 65.0f;
|
||||||
territory.detectFlags = 0;
|
territory.detectFlags = 0;
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -111,10 +111,10 @@ API_CALLABLE(N(SpearGuyAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->AI_TEMP_STATE_AFTER_SUSPEND = AI_STATE_WANDER_INIT;
|
script->AI_TEMP_STATE_AFTER_SUSPEND = AI_STATE_WANDER_INIT;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
enemy->varTable[0] = 0;
|
enemy->varTable[0] = 0;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ API_CALLABLE(N(SpinyAI_Main)) {
|
|||||||
|
|
||||||
if (isInitialCall) {
|
if (isInitialCall) {
|
||||||
enemy->varTable[6] = npc->collisionHeight;
|
enemy->varTable[6] = npc->collisionHeight;
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_8;
|
enemy->aiFlags |= AI_FLAG_SKIP_EMOTE_AFTER_FLEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInitialCall || (enemy->varTable[10] == 100)) {
|
if (isInitialCall || (enemy->varTable[10] == 100)) {
|
||||||
@ -56,10 +56,10 @@ API_CALLABLE(N(SpinyAI_Main)) {
|
|||||||
npc->pos.z = NPC_DISPOSE_POS_Z;
|
npc->pos.z = NPC_DISPOSE_POS_Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->collisionHeight = enemy->varTable[6];
|
npc->collisionHeight = enemy->varTable[6];
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
if (npc->flags & NPC_FLAG_JUMPING) {
|
if (npc->flags & NPC_FLAG_JUMPING) {
|
||||||
npc->curAnim = ANIM_Spiny_Anim18;
|
npc->curAnim = ANIM_Spiny_Anim18;
|
||||||
npc->moveSpeed = 0.0f;
|
npc->moveSpeed = 0.0f;
|
||||||
|
@ -235,7 +235,7 @@ void N(PatrolAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDete
|
|||||||
|
|
||||||
npc->duration--;
|
npc->duration--;
|
||||||
if (npc->duration == 0) {
|
if (npc->duration == 0) {
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_80) {
|
if (enemy->aiFlags & AI_FLAG_80) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_PATROL_15;
|
script->AI_TEMP_STATE = AI_STATE_PATROL_15;
|
||||||
} else {
|
} else {
|
||||||
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
||||||
|
@ -24,7 +24,7 @@ API_CALLABLE(N(SwooperAI_Main)) {
|
|||||||
if (isInitialCall) {
|
if (isInitialCall) {
|
||||||
script->functionTemp[0] = 0;
|
script->functionTemp[0] = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_10;
|
enemy->aiFlags |= AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE;
|
||||||
hitDepth = 1000.0f;
|
hitDepth = 1000.0f;
|
||||||
x = npc->pos.x;
|
x = npc->pos.x;
|
||||||
y = npc->pos.y;
|
y = npc->pos.y;
|
||||||
@ -33,9 +33,9 @@ API_CALLABLE(N(SwooperAI_Main)) {
|
|||||||
enemy->varTable[1] = y;
|
enemy->varTable[1] = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
if (enemy->aiSuspendTime == 0) {
|
if (enemy->aiSuspendTime == 0) {
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else {
|
} else {
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,10 @@ API_CALLABLE(N(TackleAI_Main)) {
|
|||||||
enemy->varTable[6] = npc->collisionHeight;
|
enemy->varTable[6] = npc->collisionHeight;
|
||||||
enemy->varTable[8] = 0;
|
enemy->varTable[8] = 0;
|
||||||
enemy->instigatorValue = 0;
|
enemy->instigatorValue = 0;
|
||||||
enemy->aiFlags |= ENEMY_AI_FLAG_8;
|
enemy->aiFlags |= AI_FLAG_SKIP_EMOTE_AFTER_FLEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = 0;
|
script->AI_TEMP_STATE = 0;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
enemy->hitboxIsActive = FALSE;
|
enemy->hitboxIsActive = FALSE;
|
||||||
@ -60,13 +60,13 @@ API_CALLABLE(N(TackleAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
EffectInstance* emoteTemp;
|
EffectInstance* emoteTemp;
|
||||||
|
|
||||||
script->AI_TEMP_STATE = 99;
|
script->AI_TEMP_STATE = 99;
|
||||||
script->functionTemp[1] = 0;
|
script->functionTemp[1] = 0;
|
||||||
fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 40, &emoteTemp);
|
fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 40, &emoteTemp);
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
} else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
|
||||||
script->AI_TEMP_STATE = 12;
|
script->AI_TEMP_STATE = 12;
|
||||||
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
|
||||||
|
@ -38,7 +38,7 @@ API_CALLABLE(N(WanderMeleeAI_Main)) {
|
|||||||
enemy->unk_118 = 0.0001f;
|
enemy->unk_118 = 0.0001f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) {
|
if (isInitialCall || (enemy->aiFlags & AI_FLAG_SUSPEND)) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
|
||||||
npc->duration = 0;
|
npc->duration = 0;
|
||||||
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
|
||||||
@ -52,10 +52,10 @@ API_CALLABLE(N(WanderMeleeAI_Main)) {
|
|||||||
npc->flags |= NPC_FLAG_FLYING;
|
npc->flags |= NPC_FLAG_FLYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
|
if (enemy->aiFlags & AI_FLAG_SUSPEND) {
|
||||||
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
script->AI_TEMP_STATE = AI_STATE_SUSPEND;
|
||||||
script->functionTemp[1] = AI_STATE_WANDER_INIT;
|
script->functionTemp[1] = AI_STATE_WANDER_INIT;
|
||||||
enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
|
enemy->aiFlags &= ~AI_FLAG_SUSPEND;
|
||||||
}
|
}
|
||||||
enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_NONE;
|
enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_NONE;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ dead_npc_move_heading = 0x8003E424;
|
|||||||
dead_sqrtf = 0x80067040;
|
dead_sqrtf = 0x80067040;
|
||||||
dead_npc_test_move_simple_with_slipping = 0x800E5304;
|
dead_npc_test_move_simple_with_slipping = 0x800E5304;
|
||||||
dead_npc_raycast_down_sides = 0x800E423C;
|
dead_npc_raycast_down_sides = 0x800E423C;
|
||||||
dead_is_point_within_region = 0x8004D0C4;
|
dead_is_point_outside_territory = 0x8004D0C4;
|
||||||
dead_rand_int = 0x8002ACEC;
|
dead_rand_int = 0x8002ACEC;
|
||||||
dead_get_npc_safe = 0x8003E534; // get_npc_safe
|
dead_get_npc_safe = 0x8003E534; // get_npc_safe
|
||||||
dead_heap_malloc = 0x8002BFD4;
|
dead_heap_malloc = 0x8002BFD4;
|
||||||
|
@ -140,7 +140,7 @@ remove_status_debuff = 0x80047D88;
|
|||||||
remove_status_static = 0x80047E90;
|
remove_status_static = 0x80047E90;
|
||||||
remove_status_chill_out = 0x80048074;
|
remove_status_chill_out = 0x80048074;
|
||||||
spawn_drops = 0x80048860;
|
spawn_drops = 0x80048860;
|
||||||
is_point_within_region = 0x800495B4;
|
is_point_outside_territory = 0x800495B4;
|
||||||
basic_ai_check_player_dist = 0x80049694;
|
basic_ai_check_player_dist = 0x80049694;
|
||||||
ai_check_player_dist = 0x800499CC;
|
ai_check_player_dist = 0x800499CC;
|
||||||
ai_enemy_play_sound = 0x80049AA0;
|
ai_enemy_play_sound = 0x80049AA0;
|
||||||
|
@ -470,7 +470,7 @@ spawn_drops = 0x80048280; // type:func rom:0x23680
|
|||||||
get_coin_drop_amount = 0x80048D50; // type:func rom:0x24150
|
get_coin_drop_amount = 0x80048D50; // type:func rom:0x24150
|
||||||
func_80048E34 = 0x80048E34; // type:func rom:0x24234
|
func_80048E34 = 0x80048E34; // type:func rom:0x24234
|
||||||
func_80048F0C = 0x80048F0C; // type:func rom:0x2430C
|
func_80048F0C = 0x80048F0C; // type:func rom:0x2430C
|
||||||
is_point_within_region = 0x80048FD4; // type:func rom:0x243D4
|
is_point_outside_territory = 0x80048FD4; // type:func rom:0x243D4
|
||||||
basic_ai_check_player_dist = 0x800490B4; // type:func rom:0x244B4
|
basic_ai_check_player_dist = 0x800490B4; // type:func rom:0x244B4
|
||||||
ai_check_player_dist = 0x800493EC; // type:func rom:0x247EC
|
ai_check_player_dist = 0x800493EC; // type:func rom:0x247EC
|
||||||
ai_enemy_play_sound = 0x800494C0; // type:func rom:0x248C0
|
ai_enemy_play_sound = 0x800494C0; // type:func rom:0x248C0
|
||||||
|
@ -96,7 +96,7 @@ dead_GetSelfNpcID = GetSelfNpcID + 0x40B0;
|
|||||||
dead_SetEnemyFlagBits = SetEnemyFlagBits + 0x40B0;
|
dead_SetEnemyFlagBits = SetEnemyFlagBits + 0x40B0;
|
||||||
dead_GetSelfAnimationFromTable = GetSelfAnimationFromTable + 0x40B0;
|
dead_GetSelfAnimationFromTable = GetSelfAnimationFromTable + 0x40B0;
|
||||||
dead_OnPlayerFled = OnPlayerFled + 0x40B0;
|
dead_OnPlayerFled = OnPlayerFled + 0x40B0;
|
||||||
dead_is_point_within_region = is_point_within_region + 0x40F0;
|
dead_is_point_outside_territory = is_point_outside_territory + 0x40F0;
|
||||||
dead_basic_ai_check_player_dist = basic_ai_check_player_dist + 0x40F0;
|
dead_basic_ai_check_player_dist = basic_ai_check_player_dist + 0x40F0;
|
||||||
dead_ai_enemy_play_sound = ai_enemy_play_sound + 0x4340;
|
dead_ai_enemy_play_sound = ai_enemy_play_sound + 0x4340;
|
||||||
dead_basic_ai_wander_init = basic_ai_wander_init + 0x4420;
|
dead_basic_ai_wander_init = basic_ai_wander_init + 0x4420;
|
||||||
|
Loading…
Reference in New Issue
Block a user