Action segments (#259)

* rm debug.i

* match phys_update_action_state

* world/action/idle.c

* ~update_npcs

* document npc_iter_nop

* fix diff.py expected/ location

* struct/naming updates

* update Npc struct via clover

* coverage

* ~world_action_idle_update

* walk, run actions

* jump

* land

* name temp anim

* size for struct

* yucky

* talk

* stuff

* all the action segments

* ~func_802B61E4_E23444

* ~func_802B6000_E287F0

* cleanup

* remove step_entity_updatecmd comment

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
This commit is contained in:
alex 2021-04-17 12:16:13 +01:00 committed by GitHub
parent 8422d41f35
commit 8e47263c3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
266 changed files with 1315 additions and 1043 deletions

1
.gitignore vendored
View File

@ -36,7 +36,6 @@ build/
/include/message_ids.h
/include/sprite/
/include/map
/tools/permuter_settings.toml
# Star Rod
/sprite/SpriteTable.xml

View File

@ -21,8 +21,7 @@ If you use Visual Studio Code, you can use _Run Build Task_ (Ctrl+Shift+B) to ru
Once you've created a successful (`OK`) build, copy `ver/us/build/` to `ver/us/expected/build/`:
```sh
$ mkdir -p ver/us/expected
$ cp -r ver/us/build ver/us/expected
./make_expected.sh
```
(If you're working with other versions of the game, replace `us` in the file paths.)

View File

@ -541,7 +541,7 @@ def dump_objfile() -> Tuple[str, ObjdumpCommand, ObjdumpCommand]:
if not os.path.isfile(objfile):
fail(f"Not able to find .o file for function: {objfile} is not a file.")
refobjfile = "expected/" + objfile
refobjfile = "ver/us/expected/" + objfile
if not os.path.isfile(refobjfile):
fail(f'Please ensure an OK .o file exists at "{refobjfile}".')

View File

@ -100,34 +100,37 @@ typedef struct BlurBuffer {
/* 0xA4 */ f32 z[20];
} BlurBuffer; // size = 0xF4
typedef s32 Palette16[16]; // size = 0x40
typedef struct Npc {
/* 0x000 */ s32 flags;
/* 0x004 */ UNK_PTR onUpdate; /* run before anything else for this npc in the npc update step */
/* 0x008 */ UNK_PTR onRender; /* run after the display list for this npc is built */
/* 0x004 */ void (*onUpdate)(struct Npc*); ///< Run before anything else for this NPC in update_npcs()
/* 0x008 */ void (*onRender)(struct Npc*); ///< Run after the display list for this NPC is built
/* 0x00C */ f32 yaw;
/* 0x010 */ f32 planarFlyDist; /* also used for speech, temp0? */
/* 0x014 */ f32 jumpScale; /* also used for speech, temp1? */
/* 0x018 */ f32 moveSpeed;
/* 0x01C */ f32 jumpVelocity;
/* 0x020 */ struct BlurBuffer* blurBuf; ///< Null unless flag 0x100000 is set.
/* 0x024 */ s32 unk_24;
/* 0x024 */ s32 spriteInstanceID;
/* 0x028 */ u32 currentAnim;
/* 0x02C */ char unk_2C[4];
/* 0x030 */ f32 animationSpeed;
/* 0x034 */ f32 unk_34; // some angle?
/* 0x034 */ f32 renderYaw;
/* 0x038 */ Vec3f pos;
/* 0x044 */ Vec3f rotation;
/* 0x050 */ f32 unk_50;
/* 0x050 */ f32 rotationVerticalPivotOffset;
/* 0x054 */ Vec3f scale;
/* 0x060 */ Vec3f moveToPos;
/* 0x06C */ Vec3f colliderPos; /* used during collision with player */
/* 0x078 */ s32 shadowIndex;
/* 0x07C */ f32 shadowScale;
/* 0x080 */ s32 unk_80;
/* 0x084 */ char unk_84[4];
/* 0x084 */ u16 unk_84;
/* 0x086 */ u16 unk_86;
/* 0x088 */ s16 isFacingAway;
/* 0x08A */ s16 yawCamOffset;
/* 0x08C */ s16 unk_8C;
/* 0x08C */ s16 turnAroundYawAdjustment;
/* 0x08E */ s16 duration; // TODO: name less vaguely
/* 0x090 */ Vec3s homePos;
/* 0x096 */ char unk_96[12];
@ -138,12 +141,26 @@ typedef struct Npc {
/* 0x0A8 */ s16 collisionHeight;
/* 0x0AA */ u8 renderMode;
/* 0x0AB */ s8 unk_AB;
/* 0x0AC */ u8 unk_AC;
/* 0x0AD */ char unk_AD[3];
/* 0x0B0 */ s32 unk_B0;
/* 0x0B4 */ char unk_B4[72];
/* 0x0FC */ s32 unk_FC;
/* 0x100 */ char unk_100[576];
/* 0x0AC */ u8 alpha;
/* 0x0AD */ u8 alpha2; ///< Multiplied with Npc::alpha
/* 0x0AE */ char unk_AD[2];
/* 0x0B0 */ s32** extraAnimList;
/* 0x0B4 */ s8 unk_B4; // some kind of rendering type, 0..4 inclusive
/* 0x0B5 */ char unk_B5[13];
/* 0x0C1 */ s8 paletteCount;
/* 0x0C2 */ char unk_C2[2];
/* 0x0C4 */ UNK_PTR spritePaletteList;
/* 0x0C8 */ Palette16 localPaletteData[16];
/* 0x2C8 */ Palette16* localPalettes[16];
/* 0x308 */ char unk_308[0x50];
/* 0x318 */ f32 screenSpaceOffset2D[2];
/* 0x320 */ f32 verticalStretch;
/* 0x324 */ struct EffectInstance* decorations[2];
/* 0x32C */ s8 decorationType[2];
/* 0x32E */ s8 changedDecoration;
/* 0x32F */ char unk_32F;
/* 0x330 */ s8 decorationInitialised[2];
/* 0x332 */ char unk_332[14];
} Npc; // size = 0x340
typedef Npc* NpcList[MAX_NPCS];
@ -982,7 +999,7 @@ typedef struct GameStatus {
/* 0x07D */ s8 unk_7D;
/* 0x07E */ u8 peachFlags; /* (1 = isPeach, 2 = isTransformed, 4 = hasUmbrella) */
/* 0x07F */ s8 peachDisguise; /* (1 = koopatrol, 2 = hammer bros, 3 = clubba) */
/* 0x080 */ char unk_80;
/* 0x080 */ u8 peachAnimIdx; ///< @see world_action_idle_peachAnims
/* 0x081 */ s8 unk_81;
/* 0x082 */ s8 unk_82;
/* 0x083 */ s8 unk_83;
@ -1056,11 +1073,12 @@ typedef struct Shadow {
/* 0x04 */ char unk_04[2];
/* 0x06 */ u8 unk_06;
/* 0x07 */ char unk_07;
/* 0x08 */ s16 unk_08;
/* 0x08 */ s16 unk_08; // entity model index?
/* 0x0A */ char unk_0A[6];
/* 0x10 */ struct Vec3f position;
/* 0x1C */ struct Vec3f scale;
/* 0x28 */ char unk_28[80];
/* 0x28 */ struct Vec3f unk_28;
/* 0x34 */ char unk_34[68];
} Shadow; // size = 0x78
typedef Shadow* ShadowList[MAX_SHADOWS];
@ -1513,7 +1531,7 @@ typedef struct PlayerStatus {
/* 0x004 */ u32 animFlags;
/* 0x008 */ s16 framesOnGround; /* Number of frames since last jump landed */
/* 0x00A */ char unk_0A[2];
/* 0x00C */ u8 peachDisguise;
/* 0x00C */ s8 peachDisguise;
/* 0x00D */ char unk_0D[1];
/* 0x00E */ u8 unk_0E;
/* 0x00F */ u8 unk_0F;
@ -1539,7 +1557,7 @@ typedef struct PlayerStatus {
/* 0x080 */ f32 targetYaw;
/* 0x084 */ f32 currentYaw;
/* 0x088 */ f32 unk_88;
/* 0x08C */ char unk_8C[4];
/* 0x08C */ s32 unk_8C;
/* 0x090 */ f32 unk_90;
/* 0x094 */ char unk_94[12];
/* 0x0A0 */ f32 heading;
@ -1550,15 +1568,16 @@ typedef struct PlayerStatus {
/* 0x0B2 */ s16 colliderDiameter;
/* 0x0B4 */ s8 actionState;
/* 0x0B5 */ u8 prevActionState;
/* 0x0B6 */ u8 fallState;
/* 0x0B6 */ s8 fallState; ///< Also used as sleep state in Peach idle action
/* 0x0B7 */ char unk_B7;
/* 0x0B8 */ s32 anim;
/* 0x0BC */ s16 unk_BC;
/* 0x0BC */ u16 unk_BC;
/* 0x0BE */ u8 renderMode;
/* 0x0BF */ s8 unk_BF;
/* 0x0C0 */ s16 decorationList;
/* 0x0C2 */ s16 unk_C2;
/* 0x0C4 */ char unk_C4[2];
/* 0x0C4 */ char unk_C4;
/* 0x0C5 */ s8 unk_C5;
/* 0x0C6 */ s16 unk_C6;
/* 0x0C8 */ s32* unk_C8;
/* 0x0CC */ s32 shadowID;
@ -1799,7 +1818,9 @@ typedef struct Temp8010F250 {
/* 0x07 */ s8 unk_07;
/* 0x08 */ s32 unk_08;
/* 0x0C */ s32 unk_0C;
} Temp8010F250;
/* 0x10 */ char unk_10[0x20];
/* 0x30 */ SoundID unk_30;
} Temp8010F250; // size = 0x34
typedef struct Temp8010EBB0 {
/* 0x000 */ s8 unk_00;

View File

@ -1346,34 +1346,43 @@ enum ActionStates {
ACTION_STATE_WALK,
ACTION_STATE_RUN,
ACTION_STATE_JUMP,
ACTION_STATE_BOUNCE,
ACTION_STATE_ABORTED_JUMP,
ACTION_STATE_LAUNCH,
ACTION_STATE_7,
ACTION_STATE_BOUNCE, ///< Used with Kooper
ACTION_STATE_HOP, ///< Released A before apex of jump
ACTION_STATE_LAUNCH, ///< Shy Guy Toybox jack-in-the-boxes
ACTION_STATE_LAND_ON_SWITCH, ///< Small red/blue ! switches
ACTION_STATE_FALLING,
ACTION_STATE_STEP_DOWN,
ACTION_STATE_LAND,
ACTION_STATE_STEP_DOWN_LAND,
// Following action states prohibit movement:
ACTION_STATE_CONVERSATION,
// Following action states prohibit movement (see set_action_state())
ACTION_STATE_TALK, ///< Reading signs doesn't count
ACTION_STATE_SPIN_JUMP,
ACTION_STATE_GROUND_POUND,
ACTION_STATE_ULTRA_JUMP,
ACTION_STATE_ULTRA_POUND,
ACTION_STATE_SLIDING,
ACTION_STATE_SLIDE,
ACTION_STATE_HAMMER,
ACTION_STATE_HIT_HAZARD = 21,
ACTION_STATE_UNKNOWN_16,
ACTION_STATE_13,
ACTION_STATE_14,
ACTION_STATE_HIT_FIRE, ///< Causes Mario to fly up and take damage. Used for fire bars.
ACTION_STATE_UNKNOWN_16, // some kind of knockback, does no damage
ACTION_STATE_HIT_LAVA,
ACTION_STATE_18,
ACTION_STATE_SPIN = 26,
ACTION_STATE_SNEAKY_PARASOL,
ACTION_STATE_SPIN,
ACTION_STATE_ENEMY_FIRST_STRIKE,
ACTION_STATE_SPINNING_FLOWER = 29,
ACTION_STATE_USE_TWEESTER = 31,
ACTION_STATE_RIDE = 33,
ACTION_STATE_GET_STAR_SPIRIT,
ACTION_STATE_USE_SPINNING_FLOWER,
ACTION_STATE_USE_MUNCHLESIA, ///< Set by the jan_09 squishy flower entity; throws the player in the air.
ACTION_STATE_USE_TWEESTER,
ACTION_STATE_BOUNCE_OFF_SWITCH, ///< Small red/blue ! switches
ACTION_STATE_RIDE,
ACTION_STATE_STEP_UP,
ACTION_STATE_USE_SPRING = 38,
ACTION_STATE_23,
ACTION_STATE_24,
ACTION_STATE_25,
ACTION_STATE_USE_SPRING,
};
typedef s32 NpcID;
@ -1381,6 +1390,7 @@ enum NpcIDs {
NPC_SELF = -1,
NPC_PLAYER = -2,
NPC_PARTNER = -4,
NPC_BTL_MERLEE = -10,
};
typedef UNK_TYPE TriggerFlag;
@ -1525,25 +1535,51 @@ enum NpcFlags {
NPC_FLAG_PASSIVE = 0x00000001, ///< Collision does not trigger battle
NPC_FLAG_4 = 0x00000004,
NPC_FLAG_ENABLE_HIT_SCRIPT = 0x00000008,
NPC_FLAG_10 = 0x00000010, // TODO (shadow-related?)
NPC_FLAG_HAS_SHADOW = 0x00000010, ///< Set by default and by enable_npc_shadow
NPC_FLAG_NO_AI = 0x00000020, ///< Disable movement AI and collision (idle animation plays)
NPC_FLAG_80 = 0x00000080, // TODO
NPC_FLAG_100 = 0x00000100, // TODO
NPC_FLAG_200 = 0x00000200, // TODO (enable gravity?)
NPC_FLAG_GRAVITY = 0x00000200, ///< Enables gravity. Does nothing if NPC_FLAG_NO_Y_MOVEMENT is set.
NPC_FLAG_LOCK_ANIMS = 0x00000400, ///< Do not allow scripts to change animation
NPC_FLAG_IGNORE_HEIGHT = 0x00000800, ///< Causes NpcMoveTo() to ignore stairs
NPC_FLAG_NO_Y_MOVEMENT = 0x00000800, ///< Causes NpcMoveTo() to ignore stairs
NPC_FLAG_NO_PROJECT_SHADOW = 0x00002000, ///< Draw shadow at base of sprite instead of projecting to ground
NPC_FLAG_4000 = 0x00004000,
NPC_FLAG_8000 = 0x00008000,
NPC_FLAG_10000 = 0x00010000,
NPC_FLAG_DIRTY_SHADOW = 0x00010000, ///< Set if shadow model is dirty (needs to be repositioned etc.)
NPC_FLAG_INVISIBLE = 0x00020000, ///< Invisible sprite (shadow and particles still render) (TODO: possibly causes loading of player sprites instead?)
NPC_FLAG_40000 = 0x00040000,
NPC_FLAG_40000 = 0x00040000, ///< Related to NPC_FLAG_8000
NPC_FLAG_MOTION_BLUR = 0x00100000, ///< Gives motion blur effect as NPC moves. Set by enable_npc_blur
NPC_FLAG_200000 = 0x00200000,
NPC_FLAG_400000 = 0x00400000,
NPC_FLAG_NO_DROPS = 0x00800000, ///< Do not drop hearts, flowers, or coins on defeat
NPC_FLAG_SIMPLE_XZ_HITBOX = 0x04000000, ///< Perform only a single lateral collision test during motion.
NPC_FLAG_1000000 = 0x01000000, // TODO. fails assert in set_npc_sprite
/// Use simpler, faster physics calculations:
/// - Perform only one lateral collision test during motion
/// - Allow falling below Y=-2000 (by default, NPC_FLAG_NO_Y_MOVEMENT is set when an NPC falls out-of-bounds)
NPC_FLAG_PARTICLE = 0x04000000,
NPC_FLAG_40000000 = 0x40000000,
NPC_FLAG_80000000 = 0x80000000,
};
// XXX bad name
/// @see PlayerStatus::animFlags
enum PlayerAnimFlags {
PLAYER_ANIM_FLAG_HOLDING_ITEM = 0x00000001,
PLAYER_ANIM_FLAG_2 = 0x00000002,
PLAYER_ANIM_FLAG_4 = 0x00000004,
PLAYER_ANIM_FLAG_8 = 0x00000008,
PLAYER_ANIM_FLAG_INTERACT_PROMPT = 0x00000010, ///< ! prompt
PLAYER_ANIM_FLAG_SPEECH_PROMPT = 0x00000020, ///< (...) prompt
PLAYER_ANIM_FLAG_40 = 0x00000040,
PLAYER_ANIM_FLAG_PULSE_STONE = 0x00000080,
PLAYER_ANIM_FLAG_100 = 0x00000100,
PLAYER_ANIM_FLAG_GET_STAR_SPIRIT = 0x00000200, ///< Sets action state to ACTION_STATE_GET_STAR_SPIRIT on idle
PLAYER_ANIM_FLAG_SHIVER = 0x00000400,
PLAYER_ANIM_FLAG_PEACH_PHYSICS = 0x00001000,
PLAYER_ANIM_FLAG_IN_DISGUISE = 0x00002000,
PLAYER_ANIM_FLAG_8BIT_MARIO = 0x00004000,
};
#endif

View File

@ -187,7 +187,7 @@ void clear_partner_move_history(Npc* partner);
void set_background_color_blend(u8 r, u8 g, u8 b, u8 a);
void set_parter_tether_distance(f32);
void set_partner_tether_distance(f32);
s32 does_script_exist(s32 id);
s32 does_script_exist_by_ref(ScriptInstance* script);
ScriptInstance* start_script(Bytecode* initialLine, s32 priority, s32 initialState);

View File

@ -62,8 +62,8 @@ typedef struct Area {
typedef struct NpcBlueprint {
/* 0x00 */ s32 flags;
/* 0x04 */ NpcAnimID initialAnim;
/* 0x08 */ UNK_FUN_PTR(onUpdate);
/* 0x0C */ UNK_FUN_PTR(onRender);
/* 0x08 */ void (*onUpdate)(struct Npc*);
/* 0x0C */ void (*onRender)(struct Npc*);
} NpcBlueprint; // size = 0x10
typedef struct NpcAISettings {

View File

@ -1,2 +1,5 @@
mkdir -p expected/ver/us
cp -r ver/current/build expected/ver/us
mkdir -p ver/us/expected/ver/us
cp -r ver/us/build ver/us/expected/ver/us
mkdir -p ver/jp/expected/ver/jp
cp -r ver/jp/build ver/jp/expected/ver/jp

View File

@ -545,7 +545,7 @@ void func_802E2BA4(s32 entityIndex) {
x_inv = -entity->position.x;
y_inv = -entity->position.y;
z_inv = -entity->position.z;
phi_fp = temp_s4->unk_34;
phi_fp = temp_s4->renderYaw;
for (i = 0; i < 24; i++) {
if (temp_s4->unk_3C.s == 0xFF) {
gDPSetRenderMode(temp_s2++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);

View File

@ -7,7 +7,7 @@ void func_802E9050(Entity* entity) {
if (!(playerStatus->animFlags & 1) && !(entity->unk_06 & 1) && (val <= 40.0f || val >= 320.0f)) {
entity->flags |= 0x1000;
if ((playerStatus->animFlags & 0x10) && (entity->unk_06 & 8)) {
if ((playerStatus->animFlags & PLAYER_ANIM_FLAG_INTERACT_PROMPT) && (entity->unk_06 & 8)) {
func_80110678(entity);
}
} else {

View File

@ -73,28 +73,28 @@ ApiStatus UnfadeBackgroundFromBlack(ScriptInstance* script, s32 isInitialCall) {
}
ApiStatus FadeInMerlee(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(-0xA);
Npc* npc = get_npc_unsafe(NPC_BTL_MERLEE);
if (isInitialCall) {
sfx_play_sound(0x24B);
npc->unk_AC = 0;
npc->alpha = 0;
}
npc->unk_AC += 17;
npc->alpha += 17;
if ((u32)(npc->unk_AC & 0xFF) >= 0xFF) {
npc->unk_AC = 0xFF;
if ((u32)(npc->alpha & 0xFF) >= 0xFF) {
npc->alpha = 0xFF;
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
}
ApiStatus FadeOutMerlee(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(-0xA);
Npc* npc = get_npc_unsafe(NPC_BTL_MERLEE);
npc->unk_AC -= 17;
if (npc->unk_AC == 0) {
npc->unk_AC = 0;
npc->alpha -= 17;
if (npc->alpha == 0) {
npc->alpha = 0;
return ApiStatus_DONE1;
}
@ -277,7 +277,7 @@ void update_encounters_conversation(void) {
enable_player_input();
func_800EF600();
if (playerStatus->actionState == ACTION_STATE_CONVERSATION) {
if (playerStatus->actionState == ACTION_STATE_TALK) {
set_action_state(ACTION_STATE_IDLE);
}

View File

@ -125,7 +125,7 @@ s32 func_800493EC(Enemy* enemy, s32 arg1, f32 arg2, f32 arg3) {
f32 f1 = npc->pos.x;
f32 f2 = npc->pos.z;
add_vec2D_polar(&f1, &f2, arg3, 270.0f - npc->unk_34);
add_vec2D_polar(&f1, &f2, arg3, 270.0f - npc->renderYaw);
if (dist2D(f1, f2, playerStatus->position.x, playerStatus->position.z) <= arg2) {
return 1;

View File

@ -92,7 +92,7 @@ void update_player(void) {
}
}
if (!(playerStatus->animFlags & 0x1000)) {
if (!(playerStatus->animFlags & PLAYER_ANIM_FLAG_PEACH_PHYSICS)) {
func_800EFD08();
}
@ -105,7 +105,7 @@ void update_player(void) {
gameStatus->playerYaw = playerStatus->currentYaw;
check_input_open_menus();
if (!(playerStatus->animFlags & 0x1000)) {
if (!(playerStatus->animFlags & PLAYER_ANIM_FLAG_PEACH_PHYSICS)) {
check_input_status_menu();
}
@ -145,11 +145,15 @@ void func_800DFAAC(void) {
check_input_midair_jump();
if (playerStatus->actionState != ACTION_STATE_SLIDING) {
if (playerStatus->actionState != ACTION_STATE_SLIDE) {
collision_main_lateral();
func_800E4508();
if ((collision_main_above() < 0) && (playerStatus->decorationList == 0) && (playerStatus->animFlags & 0x1000)) {
if (
collision_main_above() < 0 &&
playerStatus->decorationList == 0 &&
playerStatus->animFlags & PLAYER_ANIM_FLAG_PEACH_PHYSICS
) {
func_800E4F10();
}
@ -215,9 +219,9 @@ s32 func_800DFCF4(void) {
INCLUDE_ASM(s32, "77480", func_800DFD48);
void func_800DFEFC(void) {
void func_800DFEFC(s32 arg0) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 temp_v0 = func_800DFD48();
s32 temp_v0 = func_800DFD48(arg0);
if (temp_v0 != -1) {
playerStatus->anim = temp_v0;
@ -234,9 +238,9 @@ void func_800DFF50(s32 arg0) {
playerStatus->flags &= ~0x10000000;
}
void func_800DFF78(void) {
void func_800DFF78(s32 arg0) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 temp_v0 = func_800DFD48();
s32 temp_v0 = func_800DFD48(arg0);
if (temp_v0 != -1) {
playerStatus->anim = temp_v0;
@ -301,7 +305,7 @@ s32 enable_player_input(void) {
void func_800E01DC(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->animFlags & 0x10) {
if (playerStatus->animFlags & PLAYER_ANIM_FLAG_INTERACT_PROMPT) {
playerStatus->flags |= 0x8000000;
}
}
@ -328,14 +332,14 @@ void func_800E0260(void) {
INCLUDE_ASM(s32, "77480", func_800E0294);
void func_800E0330(void) {
if ((gPlayerStatusPtr->animFlags & 0x100) && (D_8010C93C != 0)) {
if ((gPlayerStatusPtr->animFlags & PLAYER_ANIM_FLAG_100) && (D_8010C93C != 0)) {
func_802B7000_E225B0();
}
}
void func_800E0374(void) {
D_8010C93C = 0;
gPlayerStatusPtr->animFlags &= ~0x100;
gPlayerStatusPtr->animFlags &= ~PLAYER_ANIM_FLAG_100;
}
INCLUDE_ASM(s32, "77480", func_800E0398);

View File

@ -2,7 +2,7 @@
#include "world/partners.h"
f32 func_800E34D8(void);
f32 func_800E3514(f32, f32*);
f32 func_800E3514(f32, s32* colliderID);
extern s32 D_8010C96C; // npc list index
extern s16 D_8010C9B0;
@ -23,7 +23,8 @@ s32 func_800E26C4(void) {
actionState == ACTION_STATE_WALK ||
actionState == ACTION_STATE_RUN ||
actionState == ACTION_STATE_USE_TWEESTER ||
actionState == ACTION_STATE_SPIN) {
actionState == ACTION_STATE_SPIN
) {
return 1;
}
@ -97,11 +98,12 @@ void gravity_use_fall_params(void) {
void func_800E3100(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->actionState != ACTION_STATE_7 && playerStatus->actionState != ACTION_STATE_BOUNCE) {
f32* temp;
if (playerStatus->actionState != ACTION_STATE_LAND_ON_SWITCH && playerStatus->actionState != ACTION_STATE_BOUNCE) {
s32* colliderID;
playerStatus->position.y = func_800E3514(func_800E34D8(), &temp);
func_800E315C(temp);
playerStatus->position.y = func_800E3514(func_800E34D8(), &colliderID);
func_800E315C(colliderID);
}
}
@ -133,7 +135,7 @@ f32 func_800E34D8(void) {
return ret;
}
INCLUDE_ASM(f32, "7bb60_len_41b0", func_800E3514, f32 arg0, f32* arg1);
INCLUDE_ASM(f32, "7bb60_len_41b0", func_800E3514, f32 arg0, s32* colliderID);
INCLUDE_ASM(s32, "7bb60_len_41b0", collision_main_lateral);
@ -358,21 +360,35 @@ void set_action_state(s32 actionState) {
}
if (playerStatus->animFlags & 0x4000) {
if (actionState < ACTION_STATE_CONVERSATION) {
// TODO figure this out
#ifdef NON_MATCHING
if (
actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK ||
actionState == ACTION_STATE_RUN || actionState == ACTION_STATE_JUMP ||
actionState == ACTION_STATE_BOUNCE || actionState == ACTION_STATE_HOP ||
actionState == ACTION_STATE_LAUNCH || actionState == ACTION_STATE_LAND_ON_SWITCH ||
actionState == ACTION_STATE_FALLING || actionState == ACTION_STATE_STEP_DOWN ||
actionState == ACTION_STATE_LAND || actionState == ACTION_STATE_STEP_DOWN_LAND
) {
#else
if (actionState < ACTION_STATE_TALK)
if (actionState >= 0) {
#endif
playerStatus->prevActionState = playerStatus->actionState;
playerStatus->actionState = actionState;
playerStatus->flags |= 0x80000000;
#ifdef NON_MATCHING
}
#endif
}
return;
}
if (actionState == ACTION_STATE_HIT_HAZARD || actionState == ACTION_STATE_HIT_LAVA) {
if (actionState == ACTION_STATE_HIT_FIRE || actionState == ACTION_STATE_HIT_LAVA) {
PartnerID partner;
if (playerStatus->unk_BF == 3) {
actionState = ACTION_STATE_HIT_HAZARD;
actionState = ACTION_STATE_HIT_FIRE;
}
// Whilst Sushie, Lakilester, Parakarry's ability is active, hazards have no effect.
@ -387,7 +403,7 @@ void set_action_state(s32 actionState) {
}
}
if (actionState == ACTION_STATE_SLIDING) {
if (actionState == ACTION_STATE_SLIDE) {
playerStatus->flags |= 0x10;
playerStatus->moveFrames = 0;
playerStatus->flags &= ~0x4000;
@ -485,7 +501,7 @@ void check_input_spin(void) {
Temp8010F250* temp_8010F250 = &D_8010F250;
Temp8010F250* temp2 = temp_8010F250;
if (!(playerStatus->flags & 0x5000) &&
if (!(playerStatus->flags & (PLAYER_ANIM_FLAG_8BIT_MARIO | PLAYER_ANIM_FLAG_PEACH_PHYSICS)) &&
!(playerStatus->animFlags & 1) &&
!(playerStatus->currentButtons & D_CBUTTONS) &&
!is_ability_active(ABILITY_SLOW_GO)) {
@ -493,6 +509,7 @@ void check_input_spin(void) {
s32 actionState = playerStatus->actionState;
s32 btnPressed = playerStatus->pressedButtons & Z_TRIG;
// TODO
if (actionState != 0x21) {
if (actionState < 0x22) {
if (actionState < 3) {
@ -526,9 +543,9 @@ void func_800E63A4(s32 arg0) {
PlayerStatus* playerStatus = &gPlayerStatus;
if (arg0 != 0) {
set_action_state(0x19);
set_action_state(ACTION_STATE_SNEAKY_PARASOL);
} else {
playerStatus->animFlags &= ~0x2000;
playerStatus->animFlags &= ~PLAYER_ANIM_FLAG_IN_DISGUISE;
gGameStatusPtr->peachFlags &= ~0x2;
playerStatus->peachDisguise = 0;
npc_free_by_index(D_8010C96C);
@ -552,17 +569,17 @@ void func_800E6428(void) {
if (*temp_8010C92C == 0) {
GameStatus** gameStatus = &gGameStatusPtr;
if ((*gameStatus)->peachFlags & 2) {
playerStatus->animFlags |= 0x2000;
playerStatus->animFlags |= PLAYER_ANIM_FLAG_IN_DISGUISE;
(*gameStatus)->peachFlags |= 2;
disguiseNpc = make_disguise_npc((*gameStatus)->peachDisguise);
if (disguiseNpc != NULL) {
disguiseNpc->flags &= ~0x40000;
disguiseNpc->flags &= ~NPC_FLAG_40000;
}
}
}
} else if (gGameStatusPtr->peachFlags & 4 && playerStatus2->pressedButtons & B_BUTTON) {
set_action_state(0x19);
set_action_state(ACTION_STATE_SNEAKY_PARASOL);
}
}
}
@ -573,8 +590,8 @@ void func_800E6500(void) {
if (D_8010C96C >= 0) {
Npc* npc = get_npc_by_index(D_8010C96C);
if (npc->flags & 0x40000) {
npc->unk_34 = playerStatus->spriteFacingAngle;
if (npc->flags & NPC_FLAG_40000) {
npc->renderYaw = playerStatus->spriteFacingAngle;
} else {
npc->yaw = playerStatus->targetYaw;
}

View File

@ -23,5 +23,5 @@ void func_802B79C8_E20AD8(void) {
gPlayerStatusPtr->unk_C8 = NULL;
gPlayerStatusPtr->animFlags &= ~0x10;
func_800EF3D4(0);
reset_parter_tether_distance();
reset_partner_tether_distance();
}

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E23260", func_802B6000_E23260);
INCLUDE_ASM(s32, "E23260", func_802B61E4_E23444);

View File

@ -1,11 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E236E0", func_802B6000_E236E0);
INCLUDE_ASM(s32, "E236E0", func_802B6288_E23968);
INCLUDE_ASM(s32, "E236E0", func_802B6550_E23C30);
INCLUDE_ASM(s32, "E236E0", func_802B65E8_E23CC8);
INCLUDE_ASM(s32, "E236E0", func_802B6738_E23E18);

View File

@ -1,15 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E24040", func_802B6000_E24040);
INCLUDE_ASM(s32, "E24040", func_802B60B4_E240F4);
INCLUDE_ASM(s32, "E24040", func_802B6198_E241D8);
INCLUDE_ASM(s32, "E24040", func_802B6294_E242D4);
INCLUDE_ASM(s32, "E24040", func_802B6348_E24388);
INCLUDE_ASM(s32, "E24040", func_802B647C_E244BC);
INCLUDE_ASM(s32, "E24040", func_802B6508_E24548);

View File

@ -1,7 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E245D0", func_802B6000_E245D0);
INCLUDE_ASM(s32, "E245D0", func_802B6198_E24768);
INCLUDE_ASM(s32, "E245D0", func_802B6230_E24800);

View File

@ -1,9 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E24920", func_802B6000_E24920);
INCLUDE_ASM(s32, "E24920", func_802B61C0_E24AE0);
INCLUDE_ASM(s32, "E24920", func_802B62CC_E24BEC);
INCLUDE_ASM(s32, "E24920", func_802B644C_E24D6C);

View File

@ -1,11 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E24ED0", func_802B6000_E24ED0);
INCLUDE_ASM(s32, "E24ED0", func_802B6048_E24F18);
INCLUDE_ASM(s32, "E24ED0", func_802B62A4_E25174);
INCLUDE_ASM(s32, "E24ED0", func_802B66A8_E25578);
INCLUDE_ASM(s32, "E24ED0", func_802B6820_E256F0);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E25D60", func_802B6000_E25D60);

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E26710", func_802B6000_E26710);
INCLUDE_ASM(s32, "E26710", func_802B65F8_E26D08);

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E26DE0", func_802B6000_E26DE0);
INCLUDE_ASM(s32, "E26DE0", func_802B6648_E27428);

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E27510", func_802B6000_E27510);
INCLUDE_ASM(s32, "E27510", func_802B6060_E27570);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E27C90", func_802B6000_E27C90);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E27F40", func_802B6000_E27F40);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E287F0", func_802B6000_E287F0);

View File

@ -1,15 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E28A30", func_802B6000_E28A30);
INCLUDE_ASM(s32, "E28A30", func_802B609C_E28ACC);
INCLUDE_ASM(s32, "E28A30", func_802B6350_E28D80);
INCLUDE_ASM(s32, "E28A30", func_802B63D4_E28E04);
INCLUDE_ASM(s32, "E28A30", func_802B6478_E28EA8);
INCLUDE_ASM(s32, "E28A30", func_802B6508_E28F38);
INCLUDE_ASM(s32, "E28A30", func_802B6638_E29068);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E291A0", func_802B6000_E291A0);

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E29470", func_802B6000_E29470);
INCLUDE_ASM(s32, "E29470", func_802B60A4_E29514);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E2A340", func_802B6000_E2A340);

View File

@ -1,7 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "E2A6B0", func_802B6000_E2A6B0);
INCLUDE_ASM(s32, "E2A6B0", func_802B6120_E2A7D0);
INCLUDE_ASM(s32, "E2A6B0", func_802B6CF0_E2B3A0);

View File

@ -238,7 +238,7 @@ void func_80122D7C(s32 idx, u32* arg1) {
}
}
EntityModel* func_80122DDC(s32 listIndex) {
EntityModel* get_entity_model(s32 listIndex) {
return (*gCurrentEntityModelList)[listIndex & ~0x800];
}

View File

@ -99,7 +99,7 @@ ApiStatus func_802CDE68(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
npc->unk_50 = var1;
npc->rotationVerticalPivotOffset = var1;
return ApiStatus_DONE2;
}
@ -316,7 +316,7 @@ ApiStatus SetNpcSprite(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
set_npc_sprite(npc, arg1, 0);
set_npc_sprite(npc, arg1, NULL);
return ApiStatus_DONE2;
}

View File

@ -111,24 +111,24 @@ void disable_npc_shadow(Npc* npc) {
}
}
void set_npc_sprite(Npc* npc, s32 anim, s32 arg2) {
void set_npc_sprite(Npc* npc, s32 anim, s32** extraAnimList) {
s32 flagsTemp;
ASSERT((npc->flags & 0x1000000) || func_802DE5E8(npc->unk_24) == 0);
ASSERT((npc->flags & NPC_FLAG_1000000) || func_802DE5E8(npc->spriteInstanceID) == 0);
npc->unk_B0 = arg2;
npc->extraAnimList = extraAnimList;
if (!(npc->flags & 0x1000000)) {
npc->unk_24 = func_802DE0EC(anim, arg2);
ASSERT(npc->unk_24 >= 0);
if (!(npc->flags & NPC_FLAG_1000000)) {
npc->spriteInstanceID = func_802DE0EC(anim, extraAnimList);
ASSERT(npc->spriteInstanceID >= 0);
}
flagsTemp = npc->flags;
npc->currentAnim = anim;
if (!(flagsTemp & 0x40000000)) {
if (!(flagsTemp & 0x1000000)) {
func_802DE2AC(npc->unk_24, anim, npc->animationSpeed);
if (!(flagsTemp & NPC_FLAG_1000000)) {
func_802DE2AC(npc->spriteInstanceID, anim, npc->animationSpeed);
}
}
}
@ -277,7 +277,7 @@ Npc* npc_find_near(f32 x, f32 y, f32 z, f32 radius) {
for (i = 0; i < ARRAY_COUNT(*gCurrentNpcListPtr); i++) {
Npc* npc = (*gCurrentNpcListPtr)[i];
if (npc != NULL && npc->flags != 0 && !(npc->flags & NPC_FLAG_SIMPLE_XZ_HITBOX)) {
if (npc != NULL && npc->flags != 0 && !(npc->flags & NPC_FLAG_PARTICLE)) {
if (!(npc->flags & (NPC_FLAG_80000000 | NPC_FLAG_4))) {
f32 distance = fabsf(dist2D(npc->pos.x, npc->pos.z, x, z));
@ -303,7 +303,7 @@ Npc* npc_find_near_simple(f32 x, f32 y, f32 z, f32 radius) {
for (i = 0; i < ARRAY_COUNT(*gCurrentNpcListPtr); i++) {
Npc* npc = (*gCurrentNpcListPtr)[i];
if (npc != NULL && npc->flags != 0 && (npc->flags & NPC_FLAG_SIMPLE_XZ_HITBOX)) {
if (npc != NULL && npc->flags != 0 && (npc->flags & NPC_FLAG_PARTICLE)) {
if (!(npc->flags & (NPC_FLAG_80000000 | NPC_FLAG_4))) {
f32 distance = fabsf(dist2D(npc->pos.x, npc->pos.z, x, z));

View File

@ -144,8 +144,8 @@ s32 func_8003CFA8();
/// Finds the closest NPC to a given point within a radius. Ignores Y position.
///
/// NPCs with NPC_FLAG_SIMPLE_XZ_HITBOX set are ignored.
/// See also npc_find_near_simple(), which requires that NPC_FLAG_SIMPLE_XZ_HITBOX be set.
/// NPCs with NPC_FLAG_PARTICLE set are ignored.
/// See also npc_find_near_simple(), which requires that NPC_FLAG_PARTICLE be set.
///
/// @param x X position
/// @param y Y position (unused)
@ -157,8 +157,8 @@ Npc* npc_find_near(f32 x, f32 y, f32 z, f32 radius);
/// Finds the closest simple-hitbox NPC to a given point within a radius. Ignores Y position.
///
/// Only NPCs with NPC_FLAG_SIMPLE_XZ_HITBOX set are considered.
/// See also npc_find_near(), which requires that NPC_FLAG_SIMPLE_XZ_HITBOX be unset.
/// Only NPCs with NPC_FLAG_PARTICLE set are considered.
/// See also npc_find_near(), which requires that NPC_FLAG_PARTICLE be unset.
///
/// @param x X position
/// @param y Y position (unused)

72
src/world/action/16.c Normal file
View File

@ -0,0 +1,72 @@
#include "common.h"
void sin_cos_rad(f32, f32*, f32*);
f32 func_800E34D8(void);
f32 func_800E3514(f32 length, s32* hitColliderID); // player_check_collision_below
s32 get_collider_type_by_id(s32 colliderID);
extern f32 D_802B6240; // bss? angle to lastGoodPosition
// Float problems near func_800E0088; almost matching otherwise
#ifndef NON_MATCHING
INCLUDE_ASM(void, "world/action/16", func_802B6000_E287F0, void);
#else
void func_802B6000_E287F0(void) {
f32 dx;
f32 dy;
f32 speed;
f32 angleRad;
if (gPlayerStatus.flags & 0x80000000) {
Camera* cameras = gCameras;
gPlayerStatus.flags &= ~0x80000000;
func_800DFF78(0x10017);
cameras[0].moveFlags |= 1;
gPlayerStatus.fallState = 0;
gPlayerStatus.gravityIntegrator[0] = 18.3473f;
gPlayerStatus.gravityIntegrator[1] = -3.738f;
gPlayerStatus.gravityIntegrator[2] = 0.8059f;
gPlayerStatus.gravityIntegrator[3] = -0.0987f;
gPlayerStatus.flags |= 8;
D_802B6240 = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, gPlayerStatus.lastGoodPosition.x, gPlayerStatus.lastGoodPosition.z);
gPlayerStatus.currentSpeed = func_800E0088(gPlayerStatus.lastGoodPosition.x, gPlayerStatus.lastGoodPosition.z) / 18.0f;
}
angleRad = (D_802B6240 * TAU) / 360.0f;
sin_cos_rad(angleRad, &dx, &dy);
speed = gPlayerStatus.currentSpeed;
if (gPlayerStatus.flags & 0x40000) {
speed *= 0.5f;
}
gPlayerStatus.position.x += speed * dx;
gPlayerStatus.position.z -= speed * dy;
if (gPlayerStatus.fallState == 0) {
integrate_gravity();
gPlayerStatus.position.y += gPlayerStatus.gravityIntegrator[0];
if (gPlayerStatus.gravityIntegrator[0] < 0.0f) {
gPlayerStatus.fallState = 1; // Now start checking for floor
gPlayerStatus.flags |= 4;
}
} else {
s32 colliderID;
gPlayerStatus.position.y = func_800E3514(func_800E34D8(), &colliderID);
if (colliderID >= 0) {
colliderID = get_collider_type_by_id(colliderID); // what
set_action_state(ACTION_STATE_LAND);
}
}
}
#endif

7
src/world/action/18.c Normal file
View File

@ -0,0 +1,7 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/18", func_802B6000_E245D0);
INCLUDE_ASM(s32, "world/action/18", func_802B6198_E24768);
INCLUDE_ASM(s32, "world/action/18", func_802B6230_E24800);

View File

@ -0,0 +1,15 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/encounter", func_802B6000_E28A30);
INCLUDE_ASM(s32, "world/action/encounter", func_802B609C_E28ACC);
INCLUDE_ASM(s32, "world/action/encounter", func_802B6350_E28D80);
INCLUDE_ASM(s32, "world/action/encounter", func_802B63D4_E28E04);
INCLUDE_ASM(s32, "world/action/encounter", func_802B6478_E28EA8);
INCLUDE_ASM(s32, "world/action/encounter", func_802B6508_E28F38);
INCLUDE_ASM(void, "world/action/encounter", func_802B6638_E29068, void);

11
src/world/action/hammer.c Normal file
View File

@ -0,0 +1,11 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/hammer", func_802B6000_E24ED0);
INCLUDE_ASM(s32, "world/action/hammer", func_802B6048_E24F18);
INCLUDE_ASM(s32, "world/action/hammer", func_802B62A4_E25174);
INCLUDE_ASM(void, "world/action/hammer", func_802B66A8_E25578, void);
INCLUDE_ASM(s32, "world/action/hammer", func_802B6820_E256F0);

View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(void, "world/action/hit_fire", func_802B6000_E27C90, void);

View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/hit_lava", func_802B6000_E27F40);

160
src/world/action/idle.c Normal file
View File

@ -0,0 +1,160 @@
#include "common.h"
#include "../actions.h"
void input_to_move_vector(f32* angle, f32* magnitude);
s32 check_input_jump(void);
s32 check_input_hammer(void);
NpcAnimID world_action_idle_peachAnims[] = {
0x000A0001, // Idle
// Cooking:
0x000A0007, 0x000A0009, 0x000A000B, 0x000A000D, 0x000A000F, 0x000A0011, 0x000A0013,
0x000A0015, 0x000A0017, 0x000A0019, 0x000A001B, 0x000A001D, 0x000A001F, 0x000A0021, 0x000A0023,
0x000A0025, 0x000A0027, 0x000A0029, 0x00000000,
};
void world_action_idle_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
s32 wasMoving = FALSE;
if (playerStatus->animFlags & PLAYER_ANIM_FLAG_PEACH_PHYSICS) {
func_802B61E4_E23444();
return;
}
playerStatus->framesOnGround++;
if (playerStatus->flags & 0x80000000) {
NpcAnimID anim;
playerStatus->flags &= ~0x8008000E;
wasMoving = TRUE;
playerStatus->fallState = 0;
playerStatus->framesOnGround = 0;
playerStatus->decorationList = 0;
playerStatus->unk_C2 = 0;
playerStatus->currentSpeed = 0.0f;
playerStatus->unk_8C = 0;
if (playerStatus->animFlags & PLAYER_ANIM_FLAG_8BIT_MARIO) {
anim = 0x90002;
} else if (!(playerStatus->animFlags & PLAYER_ANIM_FLAG_HOLDING_ITEM)) {
anim = 0x10002;
} else if ((s8)playerStatus->prevActionState == ACTION_STATE_IDLE) {
anim = 0x60005;
} else {
anim = 0x60007;
}
func_800DFEFC(anim);
}
if (playerStatus->animFlags & PLAYER_ANIM_FLAG_GET_STAR_SPIRIT) {
set_action_state(ACTION_STATE_GET_STAR_SPIRIT);
} else {
f32 angle;
f32 magnitude;
input_to_move_vector(&angle, &magnitude);
func_800E5150();
if (check_input_jump()) {
if (magnitude != 0.0f || playerStatus->targetYaw != angle) {
playerStatus->targetYaw = angle;
}
} else if (wasMoving || !check_input_hammer()) {
if (magnitude == 0.0f) {
playerData->idleFrameCounter++;
} else {
playerStatus->framesOnGround = 0;
set_action_state(ACTION_STATE_WALK);
if (magnitude != 0.0f) {
playerStatus->targetYaw = angle;
playerStatus->animFlags &= ~0x80000000;
}
}
}
}
}
#ifndef NON_MATCHING
INCLUDE_ASM(void, "world/action/idle", func_802B61E4_E23444, void);
#else
void func_802B61E4_E23444(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
if (playerStatus->flags & 0x80000000) {
playerStatus->flags &= ~0x80000000;
playerStatus->fallState = 0;
playerStatus->framesOnGround = 0;
playerStatus->decorationList = 0;
playerStatus->unk_C2 = 0;
playerStatus->currentSpeed = 0.0f;
playerStatus->flags &= ~0xE;
if (!(playerStatus->animFlags & PLAYER_ANIM_FLAG_IN_DISGUISE)) {
if (!(gGameStatusPtr->peachFlags & 0x10)) {
func_800DFEFC(world_action_idle_peachAnims[gGameStatusPtr->peachAnimIdx]);
} else {
func_800DFEFC(world_actions_peachDisguises[playerStatus->peachDisguise].idle);
}
} else {
func_800DFEFC(0xC000E);
}
}
if (!(playerStatus->animFlags & 0x2000)) {
switch (playerStatus->fallState) {
case 0:
if (((playerStatus->flags & 0x3000) == 0) && (playerStatus->unk_C4 == 0)) {
if (playerStatus->framesOnGround > 1800) {
playerStatus->fallState++;
func_800DFEFC(0xC0003);
return;
}
playerStatus->framesOnGround++;
}
break;
case 1:
if (playerStatus->unk_BC != 0) {
playerStatus->fallState++;
playerStatus->framesOnGround = 0;
func_800DFEFC(0xA0001);
}
break;
case 2: {
playerStatus->framesOnGround++;
if (playerStatus->framesOnGround > 200) {
playerStatus->fallState++;
func_800DFEFC(0xC0003);
}
break;
}
case 3:
if ((playerStatus->flags & 0x3000) != 0) {
func_800DFEFC(0xA0001);
playerStatus->fallState = 0;
} else if (playerStatus->unk_BC != 0) {
func_800DFEFC(0xC0004);
}
break;
}
}
{
f32 angle;
f32 magnitude;
input_to_move_vector(&angle, &magnitude);
func_800E5150();
if (magnitude != 0.0f) {
playerStatus->framesOnGround = 0;
playerStatus->targetYaw = angle;
set_action_state(ACTION_STATE_WALK);
}
}
}
#endif

15
src/world/action/jump.c Normal file
View File

@ -0,0 +1,15 @@
#include "common.h"
INCLUDE_ASM(void, "world/action/jump", func_802B6000_E24040, void);
INCLUDE_ASM(void, "world/action/jump", func_802B60B4_E240F4, void);
INCLUDE_ASM(void, "world/action/jump", func_802B6198_E241D8, void);
INCLUDE_ASM(void, "world/action/jump", func_802B6294_E242D4, void);
INCLUDE_ASM(void, "world/action/jump", func_802B6348_E24388, void);
INCLUDE_ASM(void, "world/action/jump", func_802B647C_E244BC, void);
INCLUDE_ASM(void, "world/action/jump", func_802B6508_E24548, void);

9
src/world/action/land.c Normal file
View File

@ -0,0 +1,9 @@
#include "common.h"
INCLUDE_ASM(void, "world/action/land", func_802B6000_E24920, void);
INCLUDE_ASM(void, "world/action/land", func_802B61C0_E24AE0, void);
INCLUDE_ASM(void, "world/action/land", func_802B62CC_E24BEC, void);
INCLUDE_ASM(void, "world/action/land", func_802B644C_E24D6C, void);

5
src/world/action/slide.c Normal file
View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/slide", func_802B6000_E27510);
INCLUDE_ASM(void, "world/action/slide", func_802B6060_E27570, void);

View File

@ -0,0 +1,7 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/sneaky_parasol", func_802B6000_E2A6B0);
INCLUDE_ASM(s32, "world/action/sneaky_parasol", func_802B6120_E2A7D0);
INCLUDE_ASM(s32, "world/action/sneaky_parasol", func_802B6CF0_E2B3A0);

3
src/world/action/spin.c Normal file
View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/spin", func_802B6000_E25D60);

View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(void, "world/action/super_boots", func_802B6000_E26DE0, void);
INCLUDE_ASM(void, "world/action/super_boots", func_802B6648_E27428, void);

View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(void, "world/action/ultra_boots", func_802B6000_E26710, void);
INCLUDE_ASM(void, "world/action/ultra_boots", func_802B65F8_E26D08, void);

View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/use_munchlesia", func_802B6000_E291A0);

View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/use_spinning_flower", func_802B6000_E29470);
INCLUDE_ASM(s32, "world/action/use_spinning_flower", func_802B60A4_E29514);

View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "world/action/use_tweester", func_802B6000_E2A340);

13
src/world/action/walk.c Normal file
View File

@ -0,0 +1,13 @@
#include "common.h"
// walk
INCLUDE_ASM(void, "world/action/walk", func_802B6000_E236E0, void);
// run
INCLUDE_ASM(void, "world/action/walk", func_802B6288_E23968, void);
INCLUDE_ASM(void, "world/action/walk", func_802B6550_E23C30, void);
INCLUDE_ASM(void, "world/action/walk", func_802B65E8_E23CC8, void);
INCLUDE_ASM(void, "world/action/walk", func_802B6738_E23E18, void);

View File

@ -1,24 +1,26 @@
#include "common.h"
#include "ld_addrs.h"
#include "actions.h"
s32 func_802B6000_E24920();
s32 func_802B6288_E23968();
s32 func_802B60B4_E240F4();
s32 func_802B6198_E241D8();
s32 func_802B6294_E242D4();
s32 func_802B6060_E27570();
s32 func_802B6348_E24388();
s32 func_802B61C0_E24AE0();
s32 func_802B6638_E29068();
s32 func_802B66A8_E25578();
s32 func_802B6350_E28D80();
s32 func_802B6508_E28F38();
s32 func_802B6230_E24800();
s32 func_802B6120_E2A7D0();
s32 func_802B63D4_E28E04();
s32 func_802B6478_E28EA8();
s32 func_802B60A4_E29514();
s32 func_802B609C_E28ACC();
void world_action_idle_update(void);
void func_802B6000_E24920(void);
void func_802B6288_E23968(void);
void func_802B60B4_E240F4(void);
void func_802B6198_E241D8(void);
void func_802B6294_E242D4(void);
void func_802B6348_E24388(void);
void func_802B61C0_E24AE0(void);
void func_802B6638_E29068(void);
void func_802B6060_E27570(void);
void func_802B66A8_E25578(void);
void func_802B6350_E28D80(void);
void func_802B6508_E28F38(void);
void func_802B6230_E24800(void);
void func_802B6120_E2A7D0(void);
void func_802B63D4_E28E04(void);
void func_802B6478_E28EA8(void);
void func_802B60A4_E29514(void);
void func_802B609C_E28ACC(void);
f32 D_800F7B40 = 0.0f;
s32 D_800F7B44 = 0;
@ -30,51 +32,56 @@ f32 D_800F7B60[] = { 0.154342994094f, -0.350080013275f, -0.182262003422f, 0.0115
f32 D_800F7B70[] = { 2.0, 4.0, 32.0, -32.0 };
s16 D_800F7B80 = 0;
s32 D_800F7B84[] = { 0, 0, 0};
s32 D_800F7B90 = 0;
f32 D_800F7B90 = 0.0;
s32 D_800F7B94[] = { 0x00390000, 0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390008, 0x00390007, 0x00390013, 0x00390014, 0xFFFFFFFF, 0x005A0000, 0x005A0002, 0x005A0003, 0x005A0004, 0x005A0006, 0x005A0007, 0x005A0009, 0x005A000A, 0x005A000B, 0x005A001A, 0xFFFFFFFF, 0x00580000, 0x00580001, 0x00580002, 0x00580004, 0x00580005, 0x00580006, 0x00580007, 0x00580008, 0x00580009, 0x00580012, 0x00580014, 0x0058001B, 0xFFFFFFFF };
s32 D_800F7C1C[] = { 0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000 };
s32 D_800F7C30[] = { 0x0058001B, 0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000, 0x0058001B, 0x005A0003, 0x005A0006, 0x005A0009, 0x005A000B, 0x005A0000, 0x005A001A, 0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390000, 0x00390014 };
void* D_800F7C7C[] = { &D_800F7BE8, &D_800F7BE8, &D_800F7BBC, &D_800F7B94 };
s32 D_800F7C8C[] = {
// TODO: struct for dma table
// TODO: ld addrs
(s32) &func_802B6000_E24920, &E23260_ROM_START, &E23260_ROM_END, 0x01000000,
(s32) &func_802B6000_E24920, 0x00E236E0, 0x00E24040, 0x01000000,
(s32) &func_802B6288_E23968, 0x00E236E0, 0x00E24040, 0x01000000,
(s32) &func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x01000000,
(s32) &func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x01000000,
(s32) &func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x00000000,
(s32) &func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x00000000,
(s32) &func_802B6198_E241D8, 0x00E24040, 0x00E245D0, 0x00000000,
(s32) &func_802B6294_E242D4, 0x00E24040, 0x00E245D0, 0x01000000,
(s32) &func_802B6348_E24388, 0x00E24040, 0x00E245D0, 0x01000000,
(s32) &func_802B6000_E24920, 0x00E24920, 0x00E24ED0, 0x01000000,
(s32) &func_802B61C0_E24AE0, 0x00E24920, 0x00E24ED0, 0x01000000,
(s32) &func_802B6638_E29068, 0x00E28A30, 0x00E291A0, 0x01000000,
(s32) &func_802B6000_E24920, 0x00E26DE0, 0x00E27510, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E26DE0, 0x00E27510, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E26710, 0x00E26DE0, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E26710, 0x00E26DE0, 0x00000000,
(s32) &func_802B6060_E27570, 0x00E27510, 0x00E27C90, 0x00000000,
(s32) &func_802B66A8_E25578, 0x00E24ED0, 0x00E25D60, 0x00000000,
(s32) &func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000,
(s32) &func_802B6508_E28F38, 0x00E28A30, 0x00E291A0, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E27C90, 0x00E27F40, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E287F0, 0x00E28A30, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E27F40, 0x00E287F0, 0x00000000,
(s32) &func_802B6230_E24800, 0x00E245D0, 0x00E24920, 0x01000000,
(s32) &func_802B6120_E2A7D0, 0x00E2A6B0, 0x00E2B530, 0x01000000,
(s32) &func_802B6000_E24920, 0x00E25D60, 0x00E26710, 0x00000000,
(s32) &func_802B63D4_E28E04, 0x00E28A30, 0x00E291A0, 0x00000000,
(s32) &func_802B6478_E28EA8, 0x00E28A30, 0x00E291A0, 0x00000000,
(s32) &func_802B60A4_E29514, 0x00E29470, 0x00E2A340, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E291A0, 0x00E29470, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E2A340, 0x00E2A6B0, 0x00000000,
(s32) &func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000,
(s32) &func_802B6000_E24920, 0x00E28A30, 0x00E291A0, 0x00000000,
(s32) &func_802B6000_E24920, 0x00E245D0, 0x00E24920, 0x01000000,
(s32) &func_802B609C_E28ACC, 0x00E28A30, 0x00E291A0, 0x00000000,
(s32) &func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x00000000,
(s32) &func_802B6350_E28D80, 0x00E236E0, 0x00E24040, 0x00000000,
(s32) &func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000,
DisguiseAnims world_actions_peachDisguises[] = {
{0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000, 0x0058001B},
{0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000, 0x0058001B},
{0x005A0003, 0x005A0006, 0x005A0009, 0x005A000B, 0x005A0000, 0x005A001A},
{0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390000, 0x00390014},
};
void* D_800F7C7C[] = { &D_800F7BE8, &D_800F7BE8, &D_800F7BBC, &D_800F7B94 };
Action D_800F7C8C[39] = {
{ world_action_idle_update, world_action_idle_ROM_START, world_action_idle_ROM_END, TRUE },
{ func_802B6000_E24920, world_action_walk_ROM_START, world_action_walk_ROM_END, TRUE },
{ func_802B6288_E23968, world_action_walk_ROM_START, world_action_walk_ROM_END, TRUE },
{ func_802B60B4_E240F4, world_action_jump_ROM_START, world_action_jump_ROM_END, TRUE },
{ func_802B60B4_E240F4, world_action_jump_ROM_START, world_action_jump_ROM_END, TRUE },
{ func_802B60B4_E240F4, world_action_jump_ROM_START, world_action_jump_ROM_END, FALSE },
{ func_802B60B4_E240F4, world_action_jump_ROM_START, world_action_jump_ROM_END, FALSE },
{ func_802B6198_E241D8, world_action_jump_ROM_START, world_action_jump_ROM_END, FALSE },
{ func_802B6294_E242D4, world_action_jump_ROM_START, world_action_jump_ROM_END, TRUE },
{ func_802B6348_E24388, world_action_jump_ROM_START, world_action_jump_ROM_END, TRUE },
{ func_802B6000_E24920, world_action_land_ROM_START, world_action_land_ROM_END, TRUE },
{ func_802B61C0_E24AE0, world_action_land_ROM_START, world_action_land_ROM_END, TRUE },
{ func_802B6638_E29068, world_action_encounter_ROM_START, world_action_encounter_ROM_END, TRUE },
{ func_802B6000_E24920, world_action_super_boots_ROM_START, world_action_super_boots_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_super_boots_ROM_START, world_action_super_boots_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_ultra_boots_ROM_START, world_action_ultra_boots_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_ultra_boots_ROM_START, world_action_ultra_boots_ROM_END, FALSE },
{ func_802B6060_E27570, world_action_slide_ROM_START, world_action_slide_ROM_END, FALSE },
{ func_802B66A8_E25578, world_action_hammer_ROM_START, world_action_hammer_ROM_END, FALSE },
{ func_802B6350_E28D80, world_action_encounter_ROM_START, world_action_encounter_ROM_END, TRUE },
{ func_802B6508_E28F38, world_action_encounter_ROM_START, world_action_encounter_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_hit_fire_ROM_START, world_action_hit_fire_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_16_ROM_START, world_action_16_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_hit_lava_ROM_START, world_action_hit_lava_ROM_END, FALSE },
{ func_802B6230_E24800, world_action_18_ROM_START, world_action_18_ROM_END, TRUE },
{ func_802B6120_E2A7D0, world_action_sneaky_parasol_ROM_START, world_action_sneaky_parasol_ROM_END, TRUE },
{ func_802B6000_E24920, world_action_spin_ROM_START, world_action_spin_ROM_END, FALSE },
{ func_802B63D4_E28E04, world_action_encounter_ROM_START, world_action_encounter_ROM_END, FALSE },
{ func_802B6478_E28EA8, world_action_encounter_ROM_START, world_action_encounter_ROM_END, FALSE },
{ func_802B60A4_E29514, world_action_use_spinning_flower_ROM_START, world_action_use_spinning_flower_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_use_munchlesia_ROM_START, world_action_use_munchlesia_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_use_tweester_ROM_START, world_action_use_tweester_ROM_END, FALSE },
{ func_802B6350_E28D80, world_action_encounter_ROM_START, world_action_encounter_ROM_END, TRUE },
{ func_802B6000_E24920, world_action_encounter_ROM_START, world_action_encounter_ROM_END, FALSE },
{ func_802B6000_E24920, world_action_18_ROM_START, world_action_18_ROM_END, TRUE },
{ func_802B609C_E28ACC, world_action_encounter_ROM_START, world_action_encounter_ROM_END, FALSE },
{ func_802B6350_E28D80, world_action_encounter_ROM_START, world_action_encounter_ROM_END, FALSE },
{ func_802B6350_E28D80, world_action_walk_ROM_START, world_action_walk_ROM_END, FALSE },
{ func_802B6350_E28D80, world_action_encounter_ROM_START, world_action_encounter_ROM_END, TRUE },
};

27
src/world/actions.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef _WORLD_ACTIONS_H_
#define _WORLD_ACTIONS_H_
#include "common.h"
typedef struct Action {
/* 0x00 */ void (*update)(void);
/* 0x04 */ void* dmaStart;
/* 0x08 */ void* dmaEnd;
/* 0x0C */ s8 flag;
} Action; // size = 0x10
typedef struct DisguiseAnims {
/* 0x00 */ NpcAnimID idle;
/* 0x04 */ NpcAnimID unk4;
/* 0x08 */ NpcAnimID unk8;
/* 0x0C */ NpcAnimID unkC;
/* 0x10 */ NpcAnimID unk10;
/* 0x10 */ NpcAnimID unk14;
} DisguiseAnims; // size = 0x18
extern f32 D_800F7B90;
extern Action D_800F7C8C[39];
extern DisguiseAnims world_actions_peachDisguises[];
#endif

View File

@ -218,8 +218,8 @@ s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, E
}
playerStatus = &gPlayerStatusPtr;
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
ret = FALSE;
}
@ -324,9 +324,9 @@ void N(func_80240834_BDD9E4)(ScriptInstance* script, NpcAISettings* aiSettings,
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
phi_s1 = 0;
if (is_point_within_region(enemy->territory->wander.detectShape,
enemy->territory->wander.detect.x, enemy->territory->wander.detect.z,
npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX,
if (is_point_within_region(enemy->territory->wander.detectShape,
enemy->territory->wander.detect.x, enemy->territory->wander.detect.z,
npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX,
enemy->territory->wander.detectSizeZ)) {
phi_s1 = 1;
}
@ -335,7 +335,7 @@ void N(func_80240834_BDD9E4)(ScriptInstance* script, NpcAISettings* aiSettings,
posY = npc->pos.y;
posZ = npc->pos.z;
if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ,
if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ,
1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) {
phi_s1 = 1;
}
@ -377,7 +377,7 @@ void N(func_80240A30_BDDBE0)(ScriptInstance* script, NpcAISettings* aiSettings,
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->duration = 10;
script->functionTemp[0].s = 50;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
}
@ -419,7 +419,7 @@ s32 N(func_80240C90_BDDE40)(ScriptInstance *script, s32 isInitialCall) {
}
}
if (enemy->unk_B0 & 4) {
if (enemy->unk_B0 & 4) {
if (enemy->unk_B4 != 0) {
return ApiStatus_BLOCK;
}

View File

@ -684,22 +684,22 @@ Script N(idle_80243D28) = SCRIPT({
Script N(init_80243E90) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_80243D28));
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
SetNpcFlagBits(NPC_SELF, NPC_FLAG_HAS_SHADOW, FALSE);
});
Script N(init_80243ECC) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_80243D28));
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
SetNpcFlagBits(NPC_SELF, NPC_FLAG_HAS_SHADOW, FALSE);
});
Script N(init_80243F08) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_80243D28));
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
SetNpcFlagBits(NPC_SELF, NPC_FLAG_HAS_SHADOW, FALSE);
});
Script N(init_80243F44) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_80243D28));
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
SetNpcFlagBits(NPC_SELF, NPC_FLAG_HAS_SHADOW, FALSE);
});
StaticNpc N(npcGroup_80243F80)[] = {
@ -707,7 +707,7 @@ StaticNpc N(npcGroup_80243F80)[] = {
.id = 5,
.settings = &N(npcSettings_80241C3C),
.pos = { 36.0f, 277.0f, 140.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_80243E90),
.yaw = 90,
.dropFlags = 0x80,
@ -736,7 +736,7 @@ StaticNpc N(npcGroup_80243F80)[] = {
.id = 6,
.settings = &N(npcSettings_80241C3C),
.pos = { 180.0f, 285.0f, 182.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_80243ECC),
.yaw = 90,
.dropFlags = 0x80,
@ -765,7 +765,7 @@ StaticNpc N(npcGroup_80243F80)[] = {
.id = 7,
.settings = &N(npcSettings_80241C3C),
.pos = { 349.0f, 286.0f, 152.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_80243F08),
.yaw = 90,
.dropFlags = 0x80,
@ -794,7 +794,7 @@ StaticNpc N(npcGroup_80243F80)[] = {
.id = 8,
.settings = &N(npcSettings_80241C3C),
.pos = { 490.0f, 324.0f, 128.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_80243F44),
.yaw = 90,
.dropFlags = 0x80,
@ -907,13 +907,13 @@ void N(func_80240158_BDEEE8)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x;
z = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -921,7 +921,7 @@ void N(func_80240158_BDEEE8)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -948,7 +948,7 @@ void N(func_802404C0_BDF250)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;
@ -1258,7 +1258,7 @@ ApiStatus N(func_802415F4_BE0384)(ScriptInstance* script, s32 isInitialCall) {
ApiStatus N(func_80241648_BE03D8)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
N(D_80241CD0_BE0A60) = get_variable(script, *args);
N(D_80241CCC_BE0A5C) = 1;
return ApiStatus_DONE2;
@ -1289,4 +1289,4 @@ ApiStatus func_80241680_BE0410(ScriptInstance* script, s32 isInitialCall) {
#else
INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", arn_03_func_80241680_BE0410, ScriptInstance* script, s32 isInitialCall);
#endif

View File

@ -284,7 +284,7 @@ void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings,
f32 posZ;
s32 i;
s32 j;
script->functionTemp[1].s = 0;
max = 32767.0f;
posX = npc->pos.x;
@ -332,13 +332,13 @@ void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x;
z = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -346,7 +346,7 @@ void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -373,7 +373,7 @@ void N(func_802404C0_BE3C70)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;
@ -542,9 +542,9 @@ void N(func_80240E90_BE4640)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -671,9 +671,9 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
@ -683,7 +683,7 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) {
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
return;
@ -759,7 +759,7 @@ void N(func_80241728_BE4ED8)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if ((npc->unk_8C == 0) && (npc->duration <= 0)) {
if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) {
script->functionTemp[1].s--;
if (script->functionTemp[1].s > 0) {
if (!(enemy->npcSettings->unk_2A & 0x10)) {
@ -812,8 +812,8 @@ void N(func_80241CE8_BE5498)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_07 = 0;
if (!(npc->flags & 8)) {
posX = npc->pos.x;
posY = npc->pos.y;
posZ = npc->pos.z;
posY = npc->pos.y;
posZ = npc->pos.z;
posW = 1000.0f;
phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
} else {
@ -856,8 +856,8 @@ void N(func_80241CE8_BE5498)(ScriptInstance* script, NpcAISettings* aiSettings,
}
posX = npc->pos.x;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0;
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) {
@ -982,8 +982,8 @@ s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, E
}
playerStatus = &gPlayerStatusPtr;
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
ret = FALSE;
}
@ -1088,9 +1088,9 @@ void N(func_80242BBC_BE636C)(ScriptInstance* script, NpcAISettings* aiSettings,
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
phi_s1 = 0;
if (is_point_within_region(enemy->territory->wander.detectShape,
enemy->territory->wander.detect.x, enemy->territory->wander.detect.z,
npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX,
if (is_point_within_region(enemy->territory->wander.detectShape,
enemy->territory->wander.detect.x, enemy->territory->wander.detect.z,
npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX,
enemy->territory->wander.detectSizeZ)) {
phi_s1 = 1;
}
@ -1099,7 +1099,7 @@ void N(func_80242BBC_BE636C)(ScriptInstance* script, NpcAISettings* aiSettings,
posY = npc->pos.y;
posZ = npc->pos.z;
if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ,
if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ,
1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) {
phi_s1 = 1;
}
@ -1141,7 +1141,7 @@ void N(func_80242DB8_BE6568)(ScriptInstance* script, NpcAISettings* aiSettings,
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->duration = 10;
script->functionTemp[0].s = 50;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
}
@ -1180,14 +1180,14 @@ ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) {
if (!enemy->territory->wander.isFlying) {
npc->flags |= 0x200;
npc->flags &= ~0x8;
} else {
npc->flags &= ~0x200;
npc->flags |= 0x8;
}
}
if (enemy->unk_B0 & 4) {
if (enemy->unk_B0 & 4) {
if (enemy->unk_B4 != 0) {
return ApiStatus_BLOCK;
}

View File

@ -317,7 +317,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
.id = NPC_BOO0,
.settings = &N(npcSettings_8024172C),
.pos = { 55.0f, 195.0f, 160.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80241FB8),
.yaw = 270,
.dropFlags = 0x80,
@ -348,7 +348,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
.id = NPC_BOO1,
.settings = &N(npcSettings_80241758),
.pos = { 160.0f, 191.0f, 250.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80242008),
.yaw = 270,
.dropFlags = 0x80,
@ -378,7 +378,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
.id = NPC_BOO2,
.settings = &N(npcSettings_80241758),
.pos = { 390.0f, 190.0f, 255.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024202C),
.yaw = 270,
.dropFlags = 0x80,
@ -408,7 +408,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
.id = NPC_BOO3,
.settings = &N(npcSettings_80241758),
.pos = { 503.0f, 206.0f, 210.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024212C),
.yaw = 270,
.dropFlags = 0x80,
@ -438,7 +438,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
.id = NPC_BOO4,
.settings = &N(npcSettings_8024172C),
.pos = { 350.0f, 185.0f, 197.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_802421EC),
.yaw = 270,
.dropFlags = 0x80,
@ -580,7 +580,7 @@ Script N(80242C50) = SCRIPT({
SetPanTarget(0, 426, 190, 194);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
SetNpcFlagBits(NPC_WORLD_TUBBA, NPC_FLAG_200, TRUE);
SetNpcFlagBits(NPC_WORLD_TUBBA, NPC_FLAG_GRAVITY, TRUE);
SetNpcSpeed(NPC_WORLD_TUBBA, 2.5);
SetNpcPos(NPC_WORLD_TUBBA, 675, 200, 180);
NpcFaceNpc(NPC_BOO0, NPC_WORLD_TUBBA, 1);
@ -704,7 +704,7 @@ Script N(80242C50) = SCRIPT({
NpcMoveTo(NPC_WORLD_TUBBA, 550, 196, 0);
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
SetNpcPos(NPC_WORLD_TUBBA, 0, -1000, 0);
SetNpcFlagBits(NPC_WORLD_TUBBA, NPC_FLAG_200, FALSE);
SetNpcFlagBits(NPC_WORLD_TUBBA, NPC_FLAG_GRAVITY, FALSE);
NpcFacePlayer(NPC_BOO0, 3);
SetNpcPos(NPC_BOO0, 55, 195, 160);
SetNpcPos(NPC_BOO1, 160, 191, 250);
@ -783,7 +783,7 @@ StaticNpc N(npcGroup_802443AC) = {
.id = NPC_WORLD_TUBBA,
.settings = &N(npcSettings_802416B0),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80244358),
.yaw = 270,
.dropFlags = 0x80,
@ -857,7 +857,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
.id = NPC_BOO5,
.settings = &N(npcSettings_80241758),
.pos = { 36.0f, 277.0f, 140.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_80244704),
.yaw = 90,
.dropFlags = 0x80,
@ -886,7 +886,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
.id = NPC_BOO6,
.settings = &N(npcSettings_80241758),
.pos = { 200.0f, 275.0f, 182.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_8024473C),
.yaw = 90,
.dropFlags = 0x80,
@ -915,7 +915,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
.id = NPC_BOO7,
.settings = &N(npcSettings_80241758),
.pos = { 379.0f, 300.0f, 192.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_80244774),
.yaw = 90,
.dropFlags = 0x80,
@ -944,7 +944,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
.id = NPC_BOO8,
.settings = &N(npcSettings_80241758),
.pos = { 525.0f, 286.0f, 178.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(init_802447AC),
.yaw = 90,
.dropFlags = 0x80,
@ -1049,13 +1049,13 @@ void N(func_80240158_BE7D38)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = script->functionTemp[2].s[enemy->territory->patrol.points].x;
z = script->functionTemp[2].s[enemy->territory->patrol.points].z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -1063,7 +1063,7 @@ void N(func_80240158_BE7D38)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -1090,7 +1090,7 @@ void N(func_802404C0_BE80A0)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;

View File

@ -691,7 +691,7 @@ StaticNpc N(npcGroup_80245D0C)[] = {
.id = NPC_WORLD_TUBBA,
.settings = &N(npcSettings_80243CF0),
.pos = { 309.0f, 0.0f, 11.0f },
.flags = NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000,
.flags = NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_40000 | NPC_FLAG_200000,
.init = &N(init_80245090),
.yaw = 270,
.dropFlags = 0x80,
@ -721,7 +721,7 @@ StaticNpc N(npcGroup_80245D0C)[] = {
.id = NPC_TUBBAS_HEART,
.settings = &N(npcSettings_80243CC4),
.pos = { -10.0f, 50.0f, -170.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_40000 | NPC_FLAG_200000,
.init = &N(init_80245058),
.yaw = 90,
.dropFlags = 0x80,
@ -753,7 +753,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
.id = NPC_BOO0,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245104),
.yaw = 270,
.dropFlags = 0x80,
@ -783,7 +783,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
.id = NPC_BOO1,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245104),
.yaw = 270,
.dropFlags = 0x80,
@ -813,7 +813,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
.id = NPC_BOO2,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245104),
.yaw = 270,
.dropFlags = 0x80,
@ -843,7 +843,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
.id = NPC_BOO3,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245104),
.yaw = 270,
.dropFlags = 0x80,
@ -873,7 +873,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
.id = NPC_BOO4,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245104),
.yaw = 270,
.dropFlags = 0x80,
@ -903,7 +903,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
.id = NPC_BOO5,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245104),
.yaw = 270,
.dropFlags = 0x80,
@ -935,7 +935,7 @@ StaticNpc N(npcGroup_80246C8C) = {
.id = NPC_WORLD_BOW,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_80245164),
.yaw = 0,
.dropFlags = 0x80,
@ -965,7 +965,7 @@ StaticNpc N(npcGroup_80246E7C) = {
.id = NPC_BOOTLER,
.settings = &N(npcSettings_80243D1C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000,
.init = &N(init_8024519C),
.yaw = 0,
.dropFlags = 0x80,
@ -1004,7 +1004,7 @@ StaticNpc N(npcGroup_802470BC) = {
.id = NPC_PARAGOOMBA0,
.settings = &N(npcSettings_80243C78),
.pos = { -216.0f, 60.0f, -10.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024706C),
.yaw = 90,
.dropFlags = 0x80,
@ -1041,7 +1041,7 @@ StaticNpc N(npcGroup_802472AC) = {
.id = NPC_PARAGOOMBA1,
.settings = &N(npcSettings_80243C78),
.pos = { 0.0f, 60.0f, 150.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024706C),
.yaw = 270,
.dropFlags = 0x80,
@ -1078,7 +1078,7 @@ StaticNpc N(npcGroup_8024749C) = {
.id = NPC_PARAGOOMBA2,
.settings = &N(npcSettings_80243C78),
.pos = { 260.0f, 60.0f, 30.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024706C),
.yaw = 90,
.dropFlags = 0x80,
@ -1115,7 +1115,7 @@ StaticNpc N(npcGroup_8024768C) = {
.id = NPC_WORLD_SKOLAR,
.settings = &N(npcSettings_80243D48),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80245C9C),
.yaw = 0,
.dropFlags = 0x80,
@ -1166,9 +1166,9 @@ void N(func_80240950_BED740)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -1239,8 +1239,8 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
posZ = npc->pos.z;
posW = 1000.0f;
func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
phi_f4 = posY;
phi_f4 += temp_f26;
phi_f4 = posY;
phi_f4 += temp_f26;
d = temp_f20 + ((phi_f4 - temp_f20) * 0.09);
test = d;
npc->pos.y = test;
@ -1275,7 +1275,7 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
if (aiSettings->unk_14 >= 0) {
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
npc->moveToPos.y = npc->pos.y;
@ -1294,9 +1294,9 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
@ -1306,7 +1306,7 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) {
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
return;
@ -1382,7 +1382,7 @@ void N(func_802411E8_BEDFD8)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if ((npc->unk_8C == 0) && (npc->duration <= 0)) {
if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) {
script->functionTemp[1].s--;
if (script->functionTemp[1].s > 0) {
if (!(enemy->npcSettings->unk_2A & 0x10)) {
@ -1435,8 +1435,8 @@ void N(func_802417A8_BEE598)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_07 = 0;
if (!(npc->flags & 8)) {
posX = npc->pos.x;
posY = npc->pos.y;
posZ = npc->pos.z;
posY = npc->pos.y;
posZ = npc->pos.z;
posW = 1000.0f;
phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
} else {
@ -1479,8 +1479,8 @@ void N(func_802417A8_BEE598)(ScriptInstance* script, NpcAISettings* aiSettings,
}
posX = npc->pos.x;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0;
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) {

View File

@ -3,7 +3,7 @@
ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 temp_f20;
f32 var;
s32 colliderID;
if (isInitialCall) {
script->functionTemp[0].s = 0;
@ -11,7 +11,7 @@ ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) {
}
temp_f20 = func_800E34D8();
playerStatus->position.y = func_800E3514(temp_f20, &var);
playerStatus->position.y = func_800E3514(temp_f20, &colliderID);
script->functionTemp[0].s += fabsf(temp_f20);
do {} while(0);
return (script->functionTemp[0].s > 50) * ApiStatus_DONE2;

View File

@ -344,7 +344,7 @@ StaticNpc N(npcGroup_80241448) = {
.id = NPC_TUBBAS_HEART,
.settings = &N(npcSettings_80241220),
.pos = { -23.0f, 75.0f, 31.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80241288),
.yaw = 270,
.dropFlags = 0x80,
@ -374,7 +374,7 @@ StaticNpc N(npcGroup_80241638) = {
.id = NPC_YAKKEY,
.settings = &N(npcSettings_8024124C),
.pos = { 38.0f, 0.0f, 97.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_802413E8),
.yaw = 270,
.dropFlags = 0x80,
@ -436,9 +436,9 @@ ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall) {
if (!(playerStatus->position.y > -10.0f)) {
f32 temp_f20 = func_800E34D8();
s32 var;
s32 colliderID;
playerStatus->position.y = func_800E3514(temp_f20, &var);
playerStatus->position.y = func_800E3514(temp_f20, &colliderID);
script->functionTemp[0].s += fabsf(temp_f20);
return (script->functionTemp[0].s > 50) * ApiStatus_DONE2;

View File

@ -145,7 +145,7 @@ StaticNpc N(npcGroup_80240784) = {
.id = 0,
.settings = &N(npcSettings_802405D0),
.pos = { 0.0f, 25.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80240730),
.yaw = 270,
.dropFlags = 0x80,
@ -182,7 +182,7 @@ ApiStatus N(func_80240000_BF6060)(ScriptInstance *script, s32 isInitialCall) {
if (entity == NULL) {
return ApiStatus_BLOCK;
}
play_model_animation(entity->virtualModelIndex, &D_000001E4);
return ApiStatus_DONE2;
}

View File

@ -163,7 +163,7 @@ StaticNpc N(npcGroup_802407D8) = {
.id = 0,
.settings = &N(npcSettings_80240450),
.pos = { 80.0f, 50.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80240720),
.yaw = 270,
.dropFlags = 0x80,
@ -192,7 +192,7 @@ StaticNpc N(npcGroup_802407D8) = {
StaticNpc N(npcGroup_802409C8) = {
.id = 1,
.settings = &N(npcSettings_802404CC),
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024076C),
.yaw = 270,
.dropFlags = 0x80,

View File

@ -255,7 +255,7 @@ StaticNpc N(npcGroup_80240EEC) = {
.id = NPC_TUBBAS_HEART,
.settings = &N(npcSettings_802406A0),
.pos = { 119.0f, 60.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_40000,
.init = &N(init_80240E70),
.yaw = 270,
.dropFlags = 0x80,

View File

@ -163,7 +163,7 @@ StaticNpc N(npcGroup_802407DC) = {
.id = 0,
.settings = &N(npcSettings_80240440),
.pos = { 80.0f, 50.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80240710),
.yaw = 270,
.dropFlags = 0x80,
@ -192,7 +192,7 @@ StaticNpc N(npcGroup_802407DC) = {
StaticNpc N(npcGroup_802409CC) = {
.id = 1,
.settings = &N(npcSettings_802404BC),
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024075C),
.yaw = 270,
.dropFlags = 0x80,

View File

@ -164,7 +164,7 @@ StaticNpc N(npcGroup_802407EC) = {
.id = 0,
.settings = &N(npcSettings_80240450),
.pos = { 80.0f, 50.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80240720),
.yaw = 270,
.dropFlags = 0x80,
@ -193,7 +193,7 @@ StaticNpc N(npcGroup_802407EC) = {
StaticNpc N(npcGroup_802409DC) = {
.id = 1,
.settings = &N(npcSettings_802404CC),
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024076C),
.yaw = 270,
.dropFlags = 0x80,

View File

@ -415,7 +415,7 @@ StaticNpc N(npcGroup_80241FE4) = {
.id = NPC_BOO0,
.settings = &N(npcSettings_80240640),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_400000,
.init = &N(init_80241F70),
.yaw = 90,
.dropFlags = 0x80,
@ -446,7 +446,7 @@ StaticNpc N(npcGroup_802421D4) = {
.id = NPC_BOO1,
.settings = &N(npcSettings_80240640),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS,
.init = &N(init_80241F94),
.yaw = 90,
.dropFlags = 0x80,
@ -476,7 +476,7 @@ StaticNpc N(npcGroup_802423C4) = {
.id = NPC_BOO2,
.settings = &N(npcSettings_80240640),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS,
.init = &N(init_80241FA4),
.yaw = 90,
.dropFlags = 0x80,
@ -506,7 +506,7 @@ StaticNpc N(npcGroup_802425B4) = {
.id = NPC_BOO3,
.settings = &N(npcSettings_80240640),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS,
.init = &N(init_80241FB4),
.yaw = 90,
.dropFlags = 0x80,
@ -536,7 +536,7 @@ StaticNpc N(npcGroup_802427A4) = {
.id = NPC_BOO4,
.settings = &N(npcSettings_80240640),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS,
.init = &N(init_80241FC4),
.yaw = 90,
.dropFlags = 0x80,
@ -566,7 +566,7 @@ StaticNpc N(npcGroup_80242994) = {
.id = NPC_BOO5,
.settings = &N(npcSettings_80240640),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS,
.init = &N(init_80241FD4),
.yaw = 90,
.dropFlags = 0x80,
@ -674,13 +674,13 @@ Script N(80242B84) = SCRIPT({
GetCurrentPartnerID(SI_VAR(0));
match SI_VAR(0) {
== 1 {
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_GRAVITY, TRUE);
}
== 2 {
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_GRAVITY, TRUE);
}
== 3 {
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_GRAVITY, TRUE);
}
}
DisablePartnerAI(0);
@ -748,7 +748,7 @@ StaticNpc N(npcGroup_802434FC) = {
.id = NPC_SENTINEL,
.settings = &N(npcSettings_8024066C),
.pos = { 0.0f, 0.0f, -1000.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_400000,
.init = &N(init_802434EC),
.yaw = 90,
.dropFlags = 0x80,

View File

@ -471,7 +471,7 @@ f32 N(D_80244CD0_C02550)[] = {
Script N(80244CE8) = SCRIPT({
SetSelfEnemyFlagBits(((0x00100000 | 0x01000000 | 0x02000000 | 0x04000000 | 0x08000000 | 0x10000000 | 0x20000000)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT)), TRUE);
});
NpcAISettings N(npcAISettings_80244D24) = {
@ -492,9 +492,9 @@ void N(func_80240120_BFD9A0)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -602,7 +602,7 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings,
if (aiSettings->unk_14 >= 0) {
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
npc->moveToPos.y = npc->pos.y;
@ -621,9 +621,9 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
@ -633,7 +633,7 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) {
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
return;
@ -709,7 +709,7 @@ void N(func_802409B8_BFE238)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if ((npc->unk_8C == 0) && (npc->duration <= 0)) {
if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) {
script->functionTemp[1].s--;
if (script->functionTemp[1].s > 0) {
if (!(enemy->npcSettings->unk_2A & 0x10)) {
@ -762,8 +762,8 @@ void N(func_80240F78_BFE7F8)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_07 = 0;
if (!(npc->flags & 8)) {
posX = npc->pos.x;
posY = npc->pos.y;
posZ = npc->pos.z;
posY = npc->pos.y;
posZ = npc->pos.z;
posW = 1000.0f;
phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
} else {
@ -806,8 +806,8 @@ void N(func_80240F78_BFE7F8)(ScriptInstance* script, NpcAISettings* aiSettings,
}
posX = npc->pos.x;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0;
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) {
@ -1008,8 +1008,8 @@ void N(func_80241954_BFF1D4)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->rotation.y -= 360.0;
}
temp_f8_2 = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f);
func_802DE894(npc->unk_24, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
func_802DE894(npc->spriteInstanceID, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
posX = (*playerStatus)->position.x;
posY = (*playerStatus)->position.y;
posZ = (*playerStatus)->position.z;
@ -1037,7 +1037,7 @@ void N(func_80241BF0_BFF470)(ScriptInstance *script, NpcAISettings *aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
enemy->varTable[0] &= ~0x100;
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
if (enemy->varTable[0] & 0x1000) {
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
@ -1142,7 +1142,7 @@ void N(func_80241F98_BFF818)(ScriptInstance *script, NpcAISettings *aiSettings,
}
script->functionTemp[1].s--;
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1178,7 +1178,7 @@ ApiStatus N(func_802422B0_BFFB30)(ScriptInstance *script, s32 isInitialCall) {
switch (script->functionTemp[0].s) {
case 0:
N(func_80240120_BFD9A0)(script, aiSettings, territoryPtr);
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
case 1:
N(func_802402D0_BFDB50)(script, aiSettings, territoryPtr);
if (script->functionTemp[0].s == 12) {
@ -1488,13 +1488,13 @@ void N(func_80242684_BFFF04)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = script->functionTemp[2].s[enemy->territory->patrol.points].x;
z = script->functionTemp[2].s[enemy->territory->patrol.points].z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -1502,7 +1502,7 @@ void N(func_80242684_BFFF04)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -1529,7 +1529,7 @@ void N(func_802429EC_C0026C)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;
@ -1609,7 +1609,7 @@ void N(func_80243000_C00880)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s = 0;
script->functionTemp[0].s = 1;
}
ApiStatus N(func_802430C0_C00940)(ScriptInstance *script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1846,7 +1846,7 @@ StaticNpc N(npcGroup_80246090) = {
.id = NPC_SENTINEL0,
.settings = &N(npcSettings_8024526C),
.pos = { -180.0f, 100.0f, 230.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80245D80),
.yaw = 90,
.dropFlags = 0x80,
@ -1877,7 +1877,7 @@ StaticNpc N(npcGroup_80246280) = {
.id = NPC_SENTINEL1,
.settings = &N(npcSettings_8024526C),
.pos = { 180.0f, 100.0f, 230.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80245E44),
.yaw = 270,
.dropFlags = 0x80,
@ -1908,7 +1908,7 @@ StaticNpc N(npcGroup_80246470) = {
.id = NPC_SENTINEL2,
.settings = &N(npcSettings_8024526C),
.pos = { -180.0f, 100.0f, -230.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80245F08),
.yaw = 90,
.dropFlags = 0x80,
@ -1939,7 +1939,7 @@ StaticNpc N(npcGroup_80246660) = {
.id = NPC_SENTINEL3,
.settings = &N(npcSettings_8024526C),
.pos = { 180.0f, 100.0f, -230.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80245FCC),
.yaw = 270,
.dropFlags = 0x80,

View File

@ -275,7 +275,7 @@ StaticNpc N(npcGroup_80241E08)[] = {
.id = NPC_WORLD_CLUBBA0,
.settings = &N(npcSettings_80241C3C),
.pos = { -200.0f, 0.0f, 180.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -312,7 +312,7 @@ StaticNpc N(npcGroup_80241E08)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_80241DDC),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -344,7 +344,7 @@ StaticNpc N(npcGroup_802421E8)[] = {
.id = NPC_WORLD_CLUBBA2,
.settings = &N(npcSettings_80241D08),
.pos = { 375.0f, 0.0f, 100.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -380,7 +380,7 @@ StaticNpc N(npcGroup_802421E8)[] = {
.id = NPC_WORLD_CLUBBA3,
.settings = &N(npcSettings_80241DDC),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -492,17 +492,17 @@ ApiStatus N(update_starpoints_display_C2EF5C)(ScriptInstance *script, s32 isInit
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -525,7 +525,7 @@ ApiStatus N(update_starpoints_display_C2EF5C)(ScriptInstance *script, s32 isInit
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -642,10 +642,10 @@ void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings,
f32 posX, posZ;
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
phi_s2 = TRUE;
}
@ -657,7 +657,7 @@ void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
posX = npc->pos.x;
posZ = npc->pos.z;
@ -771,7 +771,7 @@ void N(func_80240F00_C2FAA0)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
var = npc->yaw;
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
npc->yaw = var;
@ -784,7 +784,7 @@ void N(func_80241078_C2FC18)(ScriptInstance *script, NpcAISettings *aiSettings,
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration <= 0) {
npc->duration = 0;

View File

@ -531,7 +531,7 @@ StaticNpc N(npcGroup_80243DE8)[] = {
.id = NPC_WORLD_CLUBBA0,
.settings = &N(npcSettings_80243AFC),
.pos = { 180.0f, 0.0f, -122.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -567,7 +567,7 @@ StaticNpc N(npcGroup_80243DE8)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_80243D68),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -599,7 +599,7 @@ StaticNpc N(npcGroup_802441C8)[] = {
.id = NPC_WORLD_CLUBBA2,
.settings = &N(npcSettings_80243BC8),
.pos = { -272.0f, 0.0f, -135.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -635,7 +635,7 @@ StaticNpc N(npcGroup_802441C8)[] = {
.id = NPC_WORLD_CLUBBA3,
.settings = &N(npcSettings_80243D68),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -667,7 +667,7 @@ StaticNpc N(npcGroup_802445A8)[] = {
.id = NPC_WORLD_CLUBBA4,
.settings = &N(npcSettings_80243C94),
.pos = { -326.0f, 210.0f, 80.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80243D94),
.yaw = 90,
.dropFlags = 0x80,
@ -704,7 +704,7 @@ StaticNpc N(npcGroup_802445A8)[] = {
.id = NPC_WORLD_CLUBBA5,
.settings = &N(npcSettings_80243D68),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -817,17 +817,17 @@ ApiStatus N(func_8024060C_C31AEC)(ScriptInstance *script, s32 isInitialCall) {
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -850,7 +850,7 @@ ApiStatus N(func_8024060C_C31AEC)(ScriptInstance *script, s32 isInitialCall) {
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -999,13 +999,13 @@ void N(func_80240C78_C32158)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = script->functionTemp[2].s[enemy->territory->patrol.points].x;
z = script->functionTemp[2].s[enemy->territory->patrol.points].z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -1013,7 +1013,7 @@ void N(func_80240C78_C32158)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -1040,7 +1040,7 @@ void N(func_80240FE0_C324C0)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;
@ -1320,10 +1320,10 @@ void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings,
f32 posX, posZ;
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
phi_s2 = TRUE;
}
@ -1335,7 +1335,7 @@ void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
posX = npc->pos.x;
posZ = npc->pos.z;
@ -1449,7 +1449,7 @@ void N(func_802422AC_C3378C)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
var = npc->yaw;
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
npc->yaw = var;
@ -1462,7 +1462,7 @@ void N(func_80242424_C33904)(ScriptInstance *script, NpcAISettings *aiSettings,
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration <= 0) {
npc->duration = 0;

View File

@ -114,7 +114,7 @@ f32 N(D_80243560_C39A90)[] = {
Script N(80243578) = SCRIPT({
SetSelfEnemyFlagBits(((0x00100000 | 0x01000000 | 0x02000000 | 0x04000000 | 0x08000000 | 0x10000000 | 0x20000000)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT)), TRUE);
});
NpcAISettings N(npcAISettings_802435B4) = {
@ -225,7 +225,7 @@ StaticNpc N(npcGroup_80243B28) = {
.id = NPC_SENTINEL,
.settings = &N(npcSettings_80243AFC),
.pos = { 70.0f, -220.0f, 186.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 90,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -262,14 +262,14 @@ s32 N(D_80243D30_C3A260)[] = {
};
s16 N(D_80243D38_C3A268)[] = {
0x0001, 0x0002, 0x0003, 0x0004,
0x0001, 0x0002, 0x0003, 0x0004,
0x0009, 0x0006, 0x0007, 0x0008
};
s32 N(D_80243D48_C3A278)[8][2] = {
{0x001D00E0, 0x001D00E1 }, {0x001D00E2, 0x001D00E3 },
{0x001D00E4, 0x001D00E5 }, {0x001D00E6, 0x001D00E7 },
{0x001D00E8, 0x001D00E9 }, {0x001D00EA, 0x001D00EB },
{0x001D00E0, 0x001D00E1 }, {0x001D00E2, 0x001D00E3 },
{0x001D00E4, 0x001D00E5 }, {0x001D00E6, 0x001D00E7 },
{0x001D00E8, 0x001D00E9 }, {0x001D00EA, 0x001D00EB },
{0x001D00EC, 0x001D00ED }, {0x001D00EE, 0x001D00EF }
};
@ -401,9 +401,9 @@ void N(func_80240000_C36530)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -511,7 +511,7 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings,
if (aiSettings->unk_14 >= 0) {
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
npc->moveToPos.y = npc->pos.y;
@ -530,9 +530,9 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
@ -542,7 +542,7 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) {
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
return;
@ -618,7 +618,7 @@ void N(func_80240898_C36DC8)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if ((npc->unk_8C == 0) && (npc->duration <= 0)) {
if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) {
script->functionTemp[1].s--;
if (script->functionTemp[1].s > 0) {
if (!(enemy->npcSettings->unk_2A & 0x10)) {
@ -671,8 +671,8 @@ void N(func_80240E58_C37388)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_07 = 0;
if (!(npc->flags & 8)) {
posX = npc->pos.x;
posY = npc->pos.y;
posZ = npc->pos.z;
posY = npc->pos.y;
posZ = npc->pos.z;
posW = 1000.0f;
phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
} else {
@ -715,8 +715,8 @@ void N(func_80240E58_C37388)(ScriptInstance* script, NpcAISettings* aiSettings,
}
posX = npc->pos.x;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0;
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) {
@ -907,8 +907,8 @@ void N(func_802417F8_C37D28)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->rotation.y -= 360.0;
}
temp_f8_2 = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f);
func_802DE894(npc->unk_24, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
func_802DE894(npc->spriteInstanceID, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
posX = (*playerStatus)->position.x;
posY = (*playerStatus)->position.y;
posZ = (*playerStatus)->position.z;
@ -936,7 +936,7 @@ void N(func_80241A94_C37FC4)(ScriptInstance *script, NpcAISettings *aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
enemy->varTable[0] &= ~0x100;
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
if (enemy->varTable[0] & 0x1000) {
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
@ -1041,7 +1041,7 @@ void N(func_80241E3C_C3836C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
script->functionTemp[1].s--;
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1077,7 +1077,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance *script, s32 isInitialCall) {
switch (script->functionTemp[0].s) {
case 0:
N(func_80240000_C36530)(script, aiSettings, territoryPtr);
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
case 1:
N(func_802401B0_C366E0)(script, aiSettings, territoryPtr);
if (script->functionTemp[0].s == 12) {
@ -1321,7 +1321,7 @@ ApiStatus N(func_80242914_C38E44)(ScriptInstance *script, s32 isInitialCall) {
Entity* entity = get_entity_by_index(get_variable(script, *script->ptrReadPos));
func_80070BB0(4, entity->position.x, entity->position.y + 12.5f, entity->position.z, 1.0f, 0x4B);
return ApiStatus_DONE2;
}

View File

@ -233,7 +233,7 @@ StaticNpc N(npcGroup_80241B4C)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_80241B20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -301,7 +301,7 @@ StaticNpc N(npcGroup_80241F2C)[] = {
.id = NPC_WORLD_CLUBBA3,
.settings = &N(npcSettings_80241B20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -427,17 +427,17 @@ ApiStatus N(func_8024041C_C3AE2C)(ScriptInstance *script, s32 isInitialCall) {
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -460,7 +460,7 @@ ApiStatus N(func_8024041C_C3AE2C)(ScriptInstance *script, s32 isInitialCall) {
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -492,10 +492,10 @@ void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings,
f32 posX, posZ;
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
phi_s2 = TRUE;
}
@ -507,7 +507,7 @@ void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
posX = npc->pos.x;
posZ = npc->pos.z;
@ -621,7 +621,7 @@ void N(func_80240CAC_C3B6BC)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
var = npc->yaw;
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
npc->yaw = var;
@ -634,7 +634,7 @@ void N(func_80240E24_C3B834)(ScriptInstance *script, NpcAISettings *aiSettings,
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration <= 0) {
npc->duration = 0;

View File

@ -184,7 +184,7 @@ StaticNpc N(npcGroup_80241A7C)[] = {
.id = NPC_WORLD_CLUBBA0,
.settings = &N(npcSettings_8024197C),
.pos = { -500.0f, 0.0f, -240.0f },
.flags = NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -221,7 +221,7 @@ StaticNpc N(npcGroup_80241A7C)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_80241A50),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -336,17 +336,17 @@ ApiStatus N(update_starpoints_display_C3DFAC)(ScriptInstance *script, s32 isInit
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -369,7 +369,7 @@ ApiStatus N(update_starpoints_display_C3DFAC)(ScriptInstance *script, s32 isInit
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -401,10 +401,10 @@ void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings,
f32 posX, posZ;
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
phi_s2 = TRUE;
}
@ -416,7 +416,7 @@ void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
posX = npc->pos.x;
posZ = npc->pos.z;
@ -530,7 +530,7 @@ void N(func_80240C4C_C3E83C)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
var = npc->yaw;
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
npc->yaw = var;
@ -543,7 +543,7 @@ void N(func_80240DC4_C3E9B4)(ScriptInstance *script, NpcAISettings *aiSettings,
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration <= 0) {
npc->duration = 0;

View File

@ -261,7 +261,7 @@ f32 N(D_80244460_C44210)[] = {
Script N(80244478) = SCRIPT({
SetSelfEnemyFlagBits(((0x00100000 | 0x01000000 | 0x02000000 | 0x04000000 | 0x08000000 | 0x10000000 | 0x20000000)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT)), TRUE);
});
NpcAISettings N(npcAISettings_802444B4) = {
@ -566,7 +566,7 @@ StaticNpc N(npcGroup_80245290)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_80244434),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -635,7 +635,7 @@ StaticNpc N(npcGroup_80245670)[] = {
.id = NPC_WORLD_CLUBBA3,
.settings = &N(npcSettings_80244434),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -704,7 +704,7 @@ StaticNpc N(npcGroup_80245A50)[] = {
.id = NPC_WORLD_CLUBBA5,
.settings = &N(npcSettings_80244434),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -849,7 +849,7 @@ StaticNpc N(npcGroup_80246528) = {
.id = NPC_WORLD_CLUBBA6,
.settings = &N(npcSettings_80244A28),
.pos = { 426.0f, 0.0f, 38.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000 | NPC_FLAG_400000,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_200000 | NPC_FLAG_400000,
.init = &N(init_802464C4),
.yaw = 270,
.dropFlags = 0x80,
@ -1012,13 +1012,13 @@ void N(func_80240158_C3FF08)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = script->functionTemp[2].s[enemy->territory->patrol.points].x;
z = script->functionTemp[2].s[enemy->territory->patrol.points].z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -1026,7 +1026,7 @@ void N(func_80240158_C3FF08)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -1053,7 +1053,7 @@ void N(func_802404C0_C40270)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;
@ -1298,17 +1298,17 @@ ApiStatus N(func_8024124C_C40FFC)(ScriptInstance *script, s32 isInitialCall) {
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -1331,7 +1331,7 @@ ApiStatus N(func_8024124C_C40FFC)(ScriptInstance *script, s32 isInitialCall) {
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -1427,9 +1427,9 @@ void N(func_80241760_C41510)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -1537,7 +1537,7 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings,
if (aiSettings->unk_14 >= 0) {
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
npc->moveToPos.y = npc->pos.y;
@ -1556,9 +1556,9 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
@ -1568,7 +1568,7 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) {
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
return;
@ -1644,7 +1644,7 @@ void N(func_80241FF8_C41DA8)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if ((npc->unk_8C == 0) && (npc->duration <= 0)) {
if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) {
script->functionTemp[1].s--;
if (script->functionTemp[1].s > 0) {
if (!(enemy->npcSettings->unk_2A & 0x10)) {
@ -1697,8 +1697,8 @@ void N(func_802425B8_C42368)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_07 = 0;
if (!(npc->flags & 8)) {
posX = npc->pos.x;
posY = npc->pos.y;
posZ = npc->pos.z;
posY = npc->pos.y;
posZ = npc->pos.z;
posW = 1000.0f;
phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
} else {
@ -1741,8 +1741,8 @@ void N(func_802425B8_C42368)(ScriptInstance* script, NpcAISettings* aiSettings,
}
posX = npc->pos.x;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0;
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) {
@ -1942,8 +1942,8 @@ void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->rotation.y -= 360.0;
}
temp_f8_2 = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f);
func_802DE894(npc->unk_24, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
func_802DE894(npc->spriteInstanceID, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
posX = (*playerStatus)->position.x;
posY = (*playerStatus)->position.y;
posZ = (*playerStatus)->position.z;
@ -1971,7 +1971,7 @@ void N(func_80243230_C42FE0)(ScriptInstance *script, NpcAISettings *aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
enemy->varTable[0] &= ~0x100;
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
if (enemy->varTable[0] & 0x1000) {
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
@ -2076,7 +2076,7 @@ void N(func_802435D8_C43388)(ScriptInstance *script, NpcAISettings *aiSettings,
}
script->functionTemp[1].s--;
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -2112,7 +2112,7 @@ ApiStatus N(func_802438F0_C436A0)(ScriptInstance *script, s32 isInitialCall) {
switch (script->functionTemp[0].s) {
case 0:
N(func_80241760_C41510)(script, npcAISettings, territoryPtr);
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
case 1:
N(func_80241910_C416C0)(script, npcAISettings, territoryPtr);
if (script->functionTemp[0].s == 12) {

View File

@ -307,7 +307,7 @@ f32 N(D_80244358_C4AF38)[] = {
Script N(80244370) = SCRIPT({
SetSelfEnemyFlagBits(((0x00100000 | 0x01000000 | 0x02000000 | 0x04000000 | 0x08000000 | 0x10000000 | 0x20000000)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT)), TRUE);
});
NpcAISettings N(npcAISettings_802443AC) = {
@ -419,7 +419,7 @@ StaticNpc N(npcGroup_80244920)[] = {
.id = NPC_WORLD_CLUBBA0,
.settings = &N(npcSettings_8024418C),
.pos = { -350.0f, 0.0f, 180.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -456,7 +456,7 @@ StaticNpc N(npcGroup_80244920)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_8024432C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -496,7 +496,7 @@ StaticNpc N(npcGroup_80244D6C)[] = {
.id = NPC_WORLD_CLUBBA2,
.settings = &N(npcSettings_80244258),
.pos = { 310.0f, 0.0f, 88.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_80244D00),
.yaw = 270,
.dropFlags = 0x80,
@ -534,7 +534,7 @@ StaticNpc N(npcGroup_80244D6C)[] = {
.id = NPC_WORLD_CLUBBA3,
.settings = &N(npcSettings_8024432C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -677,17 +677,17 @@ ApiStatus N(update_starpoints_display_C46F9C)(ScriptInstance *script, s32 isInit
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -710,7 +710,7 @@ ApiStatus N(update_starpoints_display_C46F9C)(ScriptInstance *script, s32 isInit
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -827,10 +827,10 @@ void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings,
f32 posX, posZ;
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
phi_s2 = TRUE;
}
@ -842,7 +842,7 @@ void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
posX = npc->pos.x;
posZ = npc->pos.z;
@ -956,7 +956,7 @@ void N(func_80240F00_C47AE0)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
var = npc->yaw;
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
npc->yaw = var;
@ -969,7 +969,7 @@ void N(func_80241078_C47C58)(ScriptInstance *script, NpcAISettings *aiSettings,
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration <= 0) {
npc->duration = 0;
@ -1087,9 +1087,9 @@ void N(func_80241424_C48004)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -1197,7 +1197,7 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings,
if (aiSettings->unk_14 >= 0) {
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
npc->moveToPos.y = npc->pos.y;
@ -1216,9 +1216,9 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
@ -1228,7 +1228,7 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) {
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
return;
@ -1304,7 +1304,7 @@ void N(func_80241CBC_C4889C)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->varTable[9]--;
}
if ((npc->unk_8C == 0) && (npc->duration <= 0)) {
if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) {
script->functionTemp[1].s--;
if (script->functionTemp[1].s > 0) {
if (!(enemy->npcSettings->unk_2A & 0x10)) {
@ -1357,8 +1357,8 @@ void N(func_8024227C_C48E5C)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_07 = 0;
if (!(npc->flags & 8)) {
posX = npc->pos.x;
posY = npc->pos.y;
posZ = npc->pos.z;
posY = npc->pos.y;
posZ = npc->pos.z;
posW = 1000.0f;
phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
} else {
@ -1401,8 +1401,8 @@ void N(func_8024227C_C48E5C)(ScriptInstance* script, NpcAISettings* aiSettings,
}
posX = npc->pos.x;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posY = npc->pos.y + npc->collisionHeight;
posZ = npc->pos.z;
posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0;
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) {
@ -1594,8 +1594,8 @@ void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->rotation.y -= 360.0;
}
temp_f8_2 = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f);
func_802DE894(npc->unk_24, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
func_802DE894(npc->spriteInstanceID, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
posX = (*playerStatus)->position.x;
posY = (*playerStatus)->position.y;
posZ = (*playerStatus)->position.z;
@ -1623,7 +1623,7 @@ void N(func_80242EB8_C49A98)(ScriptInstance *script, NpcAISettings *aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
enemy->varTable[0] &= ~0x100;
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
if (enemy->varTable[0] & 0x1000) {
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
@ -1728,7 +1728,7 @@ void N(func_80243260_C49E40)(ScriptInstance *script, NpcAISettings *aiSettings,
}
script->functionTemp[1].s--;
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1764,7 +1764,7 @@ ApiStatus N(func_80243578_C4A158)(ScriptInstance *script, s32 isInitialCall) {
switch (script->functionTemp[0].s) {
case 0:
N(func_80241424_C48004)(script, aiSettings, territoryPtr);
func_802DE894(npc->unk_24, 0, 0, 0, 0, 0, 0);
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
case 1:
N(func_802415D4_C481B4)(script, aiSettings, territoryPtr);
if (script->functionTemp[0].s == 12) {

View File

@ -329,7 +329,7 @@ NpcAISettings N(npcAISettings_8024271C) = {
Script N(npcAI_8024274C) = SCRIPT({
spawn N(80242184);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_200)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_GRAVITY)), TRUE);
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_C));
spawn N(802424E8);
N(func_80241464_C50974)(N(npcAISettings_8024271C));
@ -362,7 +362,7 @@ StaticNpc N(npcGroup_802428C0) = {
.id = NPC_WORLD_TUBBA,
.settings = &N(npcSettings_8024212C),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000 | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_40000 | NPC_FLAG_200000 | NPC_FLAG_NO_DROPS,
.init = &N(init_802427EC),
.yaw = 270,
.dropFlags = 0x80,
@ -523,17 +523,17 @@ ApiStatus N(update_starpoints_display_C4F8CC)(ScriptInstance *script, s32 isInit
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -556,7 +556,7 @@ ApiStatus N(update_starpoints_display_C4F8CC)(ScriptInstance *script, s32 isInit
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -705,13 +705,13 @@ void N(func_80240A28_C4FF38)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = script->functionTemp[2].s[enemy->territory->patrol.points].x;
z = script->functionTemp[2].s[enemy->territory->patrol.points].z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -719,7 +719,7 @@ void N(func_80240A28_C4FF38)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -746,7 +746,7 @@ void N(func_80240D90_C502A0)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;

View File

@ -200,7 +200,7 @@ StaticNpc N(npcGroup_80241A4C)[] = {
.id = NPC_WORLD_CLUBBA0,
.settings = &N(npcSettings_8024194C),
.pos = { -70.0f, 0.0f, -100.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -237,7 +237,7 @@ StaticNpc N(npcGroup_80241A4C)[] = {
.id = NPC_WORLD_CLUBBA1,
.settings = &N(npcSettings_80241A20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -269,7 +269,7 @@ StaticNpc N(npcGroup_80241E2C)[] = {
.id = NPC_WORLD_CLUBBA2,
.settings = &N(npcSettings_8024194C),
.pos = { 0.0f, 0.0f, -235.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 90,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -305,7 +305,7 @@ StaticNpc N(npcGroup_80241E2C)[] = {
.id = NPC_WORLD_CLUBBA3,
.settings = &N(npcSettings_80241A20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -337,7 +337,7 @@ StaticNpc N(npcGroup_8024220C)[] = {
.id = NPC_WORLD_CLUBBA4,
.settings = &N(npcSettings_8024194C),
.pos = { 70.0f, 0.0f, -100.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 90,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -373,7 +373,7 @@ StaticNpc N(npcGroup_8024220C)[] = {
.id = NPC_WORLD_CLUBBA5,
.settings = &N(npcSettings_80241A20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -405,7 +405,7 @@ StaticNpc N(npcGroup_802425EC)[] = {
.id = NPC_WORLD_CLUBBA6,
.settings = &N(npcSettings_8024194C),
.pos = { 140.0f, 0.0f, -235.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -441,7 +441,7 @@ StaticNpc N(npcGroup_802425EC)[] = {
.id = NPC_WORLD_CLUBBA7,
.settings = &N(npcSettings_80241A20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -473,7 +473,7 @@ StaticNpc N(npcGroup_802429CC)[] = {
.id = NPC_WORLD_CLUBBA8,
.settings = &N(npcSettings_8024194C),
.pos = { 210.0f, 0.0f, -100.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -509,7 +509,7 @@ StaticNpc N(npcGroup_802429CC)[] = {
.id = NPC_WORLD_CLUBBA9,
.settings = &N(npcSettings_80241A20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -541,7 +541,7 @@ StaticNpc N(npcGroup_80242DAC)[] = {
.id = NPC_WORLD_CLUBBA10,
.settings = &N(npcSettings_8024194C),
.pos = { 280.0f, 0.0f, -235.0f },
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT,
.yaw = 90,
.dropFlags = 0x80,
.itemDropChance = 5,
@ -577,7 +577,7 @@ StaticNpc N(npcGroup_80242DAC)[] = {
.id = NPC_WORLD_CLUBBA11,
.settings = &N(npcSettings_80241A20),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_NO_DROPS,
.yaw = 0,
.dropFlags = 0x80,
.heartDrops = NO_DROPS,
@ -693,17 +693,17 @@ ApiStatus N(update_starpoints_display_C528FC)(ScriptInstance *script, s32 isInit
}
posX = npc2->pos.x;
posZ = npc2->pos.z;
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->renderYaw);
npc->pos.x = posX;
enemy->unk_10.x = npc->pos.x;
npc->pos.y = npc2->pos.y + enemy->varTable[0];
enemy->unk_10.y = npc->pos.y;
npc->pos.z = posZ;
enemy->unk_10.z = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
enemy->flags &= 0xE0EFFFFF;
npc->duration = 0;
@ -726,7 +726,7 @@ ApiStatus N(update_starpoints_display_C528FC)(ScriptInstance *script, s32 isInit
enemy->unk_07 = func;
script->functionTemp[0].s = 0;
}
break;
break;
}
return ApiStatus_BLOCK;
@ -758,10 +758,10 @@ void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings,
f32 posX, posZ;
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
phi_s2 = TRUE;
}
@ -773,7 +773,7 @@ void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
posX = npc->pos.x;
posZ = npc->pos.z;
@ -887,7 +887,7 @@ void N(func_80240C4C_C5318C)(ScriptInstance *script, NpcAISettings *aiSettings,
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
var = npc->yaw;
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
npc->yaw = var;
@ -900,7 +900,7 @@ void N(func_80240DC4_C53304)(ScriptInstance *script, NpcAISettings *aiSettings,
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration <= 0) {
npc->duration = 0;

View File

@ -571,7 +571,7 @@ StaticNpc N(npcGroup_802432D4) = {
.id = NPC_WORLD_TUBBA,
.settings = &N(npcSettings_802415FC),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000 | NPC_FLAG_NO_DROPS,
.flags = NPC_FLAG_NO_Y_MOVEMENT | NPC_FLAG_40000 | NPC_FLAG_200000 | NPC_FLAG_NO_DROPS,
.init = &N(init_80242924),
.yaw = 270,
.dropFlags = 0x80,
@ -602,7 +602,7 @@ StaticNpc N(npcGroup_802434C4) = {
.id = NPC_YAKKEY,
.settings = &N(npcSettings_80241628),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_IGNORE_HEIGHT,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_NO_Y_MOVEMENT,
.init = &N(init_8024329C),
.yaw = 270,
.dropFlags = 0x80,
@ -742,13 +742,13 @@ void N(func_80240158_C56098)(ScriptInstance* script, NpcAISettings* aiSettings,
script->functionTemp[1].s--;
}
if (npc->unk_8C == 0) {
if (npc->turnAroundYawAdjustment == 0) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
func_8003D660(npc, 1);
}
x = script->functionTemp[2].s[enemy->territory->patrol.points].x;
z = script->functionTemp[2].s[enemy->territory->patrol.points].z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
@ -756,7 +756,7 @@ void N(func_80240158_C56098)(ScriptInstance* script, NpcAISettings* aiSettings,
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
script->functionTemp[0].s = 2;
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
script->functionTemp[0].s = 4;
}
@ -783,7 +783,7 @@ void N(func_802404C0_C56400)(ScriptInstance* script, NpcAISettings* aiSettings,
} else {
script->functionTemp[0].s = 10;
}
} else if (npc->unk_8C == 0) {
} else if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
if (npc->duration == 0) {
script->functionTemp[1].s--;

View File

@ -270,7 +270,7 @@ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80242784_95D984);
/*
ApiStatus N(func_80242784_95D984)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241CD0_BE0A60 = get_variable(script, *args);
D_80241CCC_BE0A5C = 1;
return ApiStatus_DONE2;

View File

@ -7,9 +7,9 @@ void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -9,9 +9,9 @@ void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240B10_CCBE20)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -150,7 +150,7 @@ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80242288_CCD598);
/*
ApiStatus N(func_80242288_CCD598)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241CD0_BE0A60 = get_variable(script, *args);
D_80241CCC_BE0A5C = 1;
return ApiStatus_DONE2;

View File

@ -7,9 +7,9 @@ void N(func_80240E50_CD2C80)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240070_CD7350)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240040_CF2C10)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -219,7 +219,7 @@ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80241DAC_CF497C);
/*
ApiStatus N(func_80241DAC_CF497C)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241CD0_BE0A60 = get_variable(script, *args);
D_80241CCC_BE0A5C = 1;
return ApiStatus_DONE2;

View File

@ -7,9 +7,9 @@ void N(func_80240FF0_A17210)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -9,9 +9,9 @@ void N(func_80240CB0_A1BDB0)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -197,7 +197,7 @@ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80241540_B2D9B0);
/*
ApiStatus N(func_80241540_B2D9B0)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241CD0_BE0A60 = get_variable(script, *args);
D_80241CCC_BE0A5C = 1;
return ApiStatus_DONE2;

View File

@ -235,7 +235,7 @@ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80241A2C_B365FC);
/*
ApiStatus N(func_80241A2C_B365FC)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241CD0_BE0A60 = get_variable(script, *args);
D_80241CCC_BE0A5C = 1;
return ApiStatus_DONE2;

View File

@ -175,7 +175,7 @@ Script N(hit_80240F64) = SCRIPT({
sleep 10;
GetNpcPos(NPC_GOOMPA, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetNpcPos(NPC_PARTNER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_GRAVITY, TRUE);
SetNpcPos(NPC_GOOMPA, 0, -1000, 0);
SetNpcFlagBits(NPC_GOOMPA, NPC_FLAG_100, FALSE);
EnablePartnerAI();
@ -190,7 +190,7 @@ Script N(init_802411A8) = SCRIPT({
BindNpcHit(-1, N(hit_80240F64));
match STORY_PROGRESS {
>= STORY_CH0_GOOMPA_JOINED_PARTY {
SetNpcFlagBits(NPC_SELF, NPC_FLAG_200, FALSE);
SetNpcFlagBits(NPC_SELF, NPC_FLAG_GRAVITY, FALSE);
SetNpcFlagBits(NPC_SELF, NPC_FLAG_ENABLE_HIT_SCRIPT, TRUE);
SetNpcPos(NPC_SELF, 0, -1000, 0);
}

View File

@ -7,9 +7,9 @@ void N(func_80240000_8CE070)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240000_8D1510)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240000_8D5E00)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_802404E0_C5AC20)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {
@ -246,7 +246,7 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80242364_C5CAA4);
/*
ApiStatus N(func_80242364_C5CAA4)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241CD0_BE0A60 = get_variable(script, *args);
D_80241CCC_BE0A5C = 1;
return ApiStatus_DONE2;

View File

@ -11,9 +11,9 @@ void N(func_80240820_C6EB50)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240A50_C71ED0)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

View File

@ -7,9 +7,9 @@ void N(func_80240460_C80600)(ScriptInstance* script, NpcAISettings* aiSettings,
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
} else {

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