diff --git a/.vscode/settings.json b/.vscode/settings.json index 4fbfb91d..cca7d0b8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -137,7 +137,11 @@ "sf64mesg.h": "c", "sf64audio_external.h": "c", "audioseq_cmd.h": "c", - "ultralog.h": "c" + "ultralog.h": "c", + "charconv": "c", + "compare": "c", + "os_motor.h": "c", + "os_pfs.h": "c" }, "C_Cpp_Runner.msvcBatchPath": "" } \ No newline at end of file diff --git a/include/context.h b/include/context.h index 690df8cd..0027aac4 100644 --- a/include/context.h +++ b/include/context.h @@ -76,10 +76,10 @@ extern UNK_TYPE F_80177DE8; extern s32 gGameFrameCount; extern s32 gObjectLoadIndex; extern s32 gPrevEventActorIndex; -extern s32 D_ctx_80177E78; +extern s32 gFormationLeaderIndex; extern s32 gRingPassCount; -extern Vec3f D_ctx_80177E88; -extern Vec3f D_ctx_80177F10; +extern Vec3f gFormationInitRot; +extern Vec3f gFormationInitPos; extern UNK_TYPE F_80178020; extern s32 D_ctx_8017812C; extern LevelId gCurrentLevel; diff --git a/include/functions.h b/include/functions.h index e9ae1323..223e8abf 100644 --- a/include/functions.h +++ b/include/functions.h @@ -24,8 +24,8 @@ void AllRange_ClearRadio(void); void func_360_8002EE64(Actor* this); void ActorAllRange_SpawnTeam(void); void ActorAllRange_PlayMessage(u16* msg, RadioCharacterId character); -void func_360_8002F69C(Actor*); -void func_360_8002FC00(Actor*); +void ActorAllRange_UpdateStarWolfEvents(Actor*); +void ActorAllRange_UpdateEvemyEvents(Actor*); void ActorAllRange_ApplyDamage(Actor*); bool func_360_80031900(Actor*); void ActorAllRange_Update(Actor* this); @@ -223,9 +223,9 @@ void Scenery42_Update(Scenery*); void Actor196_Update(Actor*); void Actor189_Update(Actor*); void MeteoTunnel_Update(Scenery*); -void func_enmy2_8006ECBC(PlayerShotId, PlayerShot*, s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); -void func_enmy2_8006EEFC(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); -void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, +void Actor_SetupPlayerShot(PlayerShotId, PlayerShot*, s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); +void Actor_SpawnPlayerLaser(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); +void Actor_SpawnGreatFoxLaser(s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, f32 zRot); void ActorEvent_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 scale1); void ActorEvent_8006F254(Actor*); diff --git a/include/sf64event.h b/include/sf64event.h index 0b292dd1..c382d054 100644 --- a/include/sf64event.h +++ b/include/sf64event.h @@ -10,11 +10,11 @@ #define evaRotateFlag(actor) (actor)->iwork[6] #define evaTexLineFlag(actor) (actor)->iwork[7] #define evaTexLineIndex(actor) (actor)->iwork[8] -#define EvaIwork9(actor) (actor)->iwork[9] +#define evaLeaderActorIndex(actor) (actor)->iwork[9] #define EvaIwork10(actor) (actor)->iwork[10] #define EvaIwork11(actor) (actor)->iwork[11] #define EvaIwork12(actor) (actor)->iwork[12] -#define EvaIwork13(actor) (actor)->iwork[13] +#define evaFormationFly(actor) (actor)->iwork[13] #define EvaIwork14(actor) (actor)->iwork[14] #define EvaIwork15(actor) (actor)->iwork[15] #define EvaIwork16(actor) (actor)->iwork[16] @@ -67,47 +67,70 @@ #define EV_CHANGE_AI 200 -#define EVENT_PLAY_MSG(rcid, msg) EVENT_CMD(EVOP_PLAY_MSG, rcid, msg) -#define EVENT_STOP_SCRIPT() EVENT_CMD(EVOP_STOP_SCRIPT, 0, 0) -#define EVENT_MAKE_TEXLINE(color) EVENT_CMD(EVOP_MAKE_TEXLINE, 0, color) -#define EVENT_STOP_TEXLINE() EVENT_CMD(EVOP_STOP_TEXLINE, 0, 0) -#define EVENT_INIT_ACTOR(info, health) EVENT_CMD(EVOP_INIT_ACTOR, health, info) #define EVENT_SET_SPEED(speed, zmode, time) EVENT_CMD(EVOP_SET_SPEED, EV_ZMODE(zmode) | ((speed) & 0x7F), time) #define EVENT_SET_ACCEL(speedTarget, zmode, time) EVENT_CMD(EVOP_SET_ACCEL, EV_ZMODE(zmode) | ((speedTarget) & 0x7F), time) -#define EVENT_SET_ROTATE() EVENT_CMD(EVOP_SET_ROTATE, 0, 0) -#define EVENT_STOP_ROTATE() EVENT_CMD(EVOP_STOP_ROTATE, 0, 0) -#define EVENT_SET_TRIGGER(cond, cmd) EVENT_CMD(EVOP_SET_TRIGGER, cmd, cond) -#define EVENT_SET_Z_TRIGGER(z, cmd) EVENT_SET_TRIGGER(EVC_CLOSE_Z + (s32)((z) / 10), cmd) -#define EVENT_CLEAR_TRIGGER(cmd) EVENT_SET_TRIGGER(EVC_NONE, cmd) -#define EVENT_LOOP(count, cmd) EVENT_CMD(EVOP_LOOP, cmd, count) -#define EVENT_GOTO(cmd) EVENT_LOOP(0, cmd) -#define EVENT_SET_SURFACE(type) EVENT_CMD(EVOP_SET_SURFACE, 0, type) -#define EVENT_DROP_ITEM(item) EVENT_CMD(EVOP_DROP_ITEM, 0, item) -#define EVENT_ADD_TO_GROUP(num, flags) EVENT_CMD(EVOP_ADD_TO_GROUP, flags, num) -#define EVENT_SET_REVERB(reverb) EVENT_CMD(EVOP_SET_REVERB, 0, reverb) -#define EVENT_STOP_BGM() EVENT_CMD(EVOP_STOP_BGM, 0, 0) -#define EVENT_SET_ACTION(action) EVENT_CMD(EVOP_SET_ACTION, 0, action) -#define EVENT_RESTORE_TEAM(teammate) EVENT_CMD(EVOP_RESTORE_TEAM, 0, teammate) -#define EVENT_PLAY_SFX(sfx) EVENT_CMD(EVOP_PLAY_SFX, 0, sfx) -#define EVENT_STOP_SFX(sfx) EVENT_CMD(EVOP_STOP_SFX, 0, sfx) -#define EVENT_SET_CALL(duration, voiceParam) EVENT_CMD(EVOP_SET_CALL, voiceParam, duration) +#define EVENT_SET_BASE_ZVEL(zvel) EVENT_CMD(EVOP_SET_BASE_ZVEL, 0, zvel) +#define EVENT_SET_AS_LEADER() EVENT_CMD(EVOP_SET_AS_LEADER, 0 ,0 ) +#define EVENT_START_FORMATION(duration) EVENT_CMD(EVOP_START_FORMATION, 0, duration) +#define EVENT_STOP_FORMATION() EVENT_CMD(EVOP_STOP_FORMATION, 0, 0) + +#define EVENT_F4_PLUS_X(rot, rotVel) EVENT_CMD(EVOP_F4_PLUS_X, (rotVel) * 10, rot) +#define EVENT_F4_MINUS_X(rot, rotVel) EVENT_CMD(EVOP_F4_MINUS_X, (rotVel) * 10, rot) +#define EVENT_F4_PLUS_Y(rot, rotVel) EVENT_CMD(EVOP_F4_PLUS_Y, (rotVel) * 10, rot) +#define EVENT_F4_MINUS_Y(rot, rotVel) EVENT_CMD(EVOP_F4_MINUS_Y, (rotVel) * 10, rot) + #define EVENT_ROT_PLUS_X(rot, rotVel) EVENT_CMD(EVOP_ROT_PLUS_X, (rotVel) * 10, rot) #define EVENT_ROT_MINUS_X(rot, rotVel) EVENT_CMD(EVOP_ROT_MINUS_X, (rotVel) * 10, rot) #define EVENT_ROT_PLUS_Y(rot, rotVel) EVENT_CMD(EVOP_ROT_PLUS_Y, (rotVel) * 10, rot) #define EVENT_ROT_MINUS_Y(rot, rotVel) EVENT_CMD(EVOP_ROT_MINUS_Y, (rotVel) * 10, rot) #define EVENT_ROT_PLUS_Z(rot, rotVel) EVENT_CMD(EVOP_ROT_PLUS_Z, (rotVel) * 10, rot) #define EVENT_ROT_MINUS_Z(rot, rotVel) EVENT_CMD(EVOP_ROT_MINUS_Z, (rotVel) * 10, rot) -#define EVENT_F4_PLUS_X(rot, rotVel) EVENT_CMD(EVOP_F4_PLUS_X, (rotVel) * 10, rot) -#define EVENT_F4_MINUS_X(rot, rotVel) EVENT_CMD(EVOP_F4_MINUS_X, (rotVel) * 10, rot) -#define EVENT_F4_PLUS_Y(rot, rotVel) EVENT_CMD(EVOP_F4_PLUS_Y, (rotVel) * 10, rot) -#define EVENT_F4_MINUS_Y(rot, rotVel) EVENT_CMD(EVOP_F4_MINUS_Y, (rotVel) * 10, rot) -#define EVENT_SET_BASE_ZVEL(zvel) EVENT_CMD(EVOP_SET_BASE_ZVEL, 0, zvel) -#define EVENT_SET_TEAM_ID(teamId) EVENT_CMD(EVOP_SET_TEAM_ID, 0, teamId) -#define EVENT_DAMAGE_TEAM(teamId, damage) EVENT_CMD(EVOP_DAMAGE_TEAM, damage, teamId) + +#define EVENT_SET_ROTATE() EVENT_CMD(EVOP_SET_ROTATE, 0, 0) +#define EVENT_STOP_ROTATE() EVENT_CMD(EVOP_STOP_ROTATE, 0, 0) + +#define EVENT_PURSUE_PLAYER(duration, turnRate) EVENT_CMD(EVOP_PURSUE_PLAYER, turnRate, duration) +#define EVENT_FLEE_PLAYER(duration, turnRate) EVENT_CMD(EVOP_FLEE_PLAYER, turnRate, duration) +#define EVENT_PURSUE_TARGET(duration, turnRate) EVENT_CMD(EVOP_PURSUE_TARGET, turnRate, duration) +#define EVENT_FLEE_TARGET(duration, turnRate) EVENT_CMD(EVOP_FLEE_TARGET, turnRate, duration) +#define EVENT_CHASE_TARGET(duration, turnRate) EVENT_CMD(EVOP_CHASE_TARGET, turnRate, duration) #define EVENT_SET_TARGET(teamId, spread) EVENT_CMD(EVOP_SET_TARGET, teamId, spread) -#define EVENT_CHASE_TARGET(duration, turnRate) EVENT_CMD(EVOP_CHASE_TARGET, duration, turnRate) +#define EVENT_PURSUE_CAMERA(duration, turnRate) EVENT_CMD(EVOP_PURSUE_CAMERA, turnRate, duration) +#define EVENT_FLEE_CAMERA(duration, turnRate) EVENT_CMD(EVOP_FLEE_CAMERA, turnRate, duration) #define EVENT_SET_WAIT(duration) EVENT_CMD(EVOP_SET_WAIT, 0, duration) +#define EVENT_SET_CALL(duration, voiceParam) EVENT_CMD(EVOP_SET_CALL, voiceParam, duration) +#define EVENT_RESTORE_TEAM(teammate) EVENT_CMD(EVOP_RESTORE_TEAM, 0, teammate) +#define EVENT_PLAY_SFX(sfx) EVENT_CMD(EVOP_PLAY_SFX, 0, sfx) +#define EVENT_STOP_SFX(sfx) EVENT_CMD(EVOP_STOP_SFX, 0, sfx) + +#define EVENT_SET_TRIGGER(cond, cmd) EVENT_CMD(EVOP_SET_TRIGGER, cmd, cond) +#define EVENT_SET_Z_TRIGGER(z, cmd) EVENT_SET_TRIGGER(EVC_CLOSE_Z + (s32)((z) / 100), cmd) +#define EVENT_CLEAR_TRIGGER(cmd) EVENT_SET_TRIGGER(EVC_NONE, cmd) + +#define EVENT_INIT_ACTOR(info, health) EVENT_CMD(EVOP_INIT_ACTOR, health, info) +#define EVENT_SET_TEAM_ID(teamId) EVENT_CMD(EVOP_SET_TEAM_ID, 0, teamId) + +#define EVENT_SET_ACTION(action) EVENT_CMD(EVOP_SET_ACTION, 0, action) +#define EVENT_ADD_TO_GROUP(num, flags) EVENT_CMD(EVOP_ADD_TO_GROUP, flags, num) + +#define EVENT_DROP_ITEM(item) EVENT_CMD(EVOP_DROP_ITEM, 0, item) + +#define EVENT_SET_REVERB(reverb) EVENT_CMD(EVOP_SET_REVERB, 0, reverb) +#define EVENT_SET_SURFACE(type) EVENT_CMD(EVOP_SET_SURFACE, 0, type) +#define EVENT_PLAY_MSG(rcid, msg) EVENT_CMD(EVOP_PLAY_MSG, rcid, msg) +#define EVENT_DAMAGE_TEAM(teamId, damage) EVENT_CMD(EVOP_DAMAGE_TEAM, damage, teamId) +#define EVENT_STOP_BGM() EVENT_CMD(EVOP_STOP_BGM, 0, 0) + +#define EVENT_MAKE_TEXLINE(color) EVENT_CMD(EVOP_MAKE_TEXLINE, 0, color) +#define EVENT_STOP_TEXLINE() EVENT_CMD(EVOP_STOP_TEXLINE, 0, 0) + +#define EVENT_LOOP(count, cmd) EVENT_CMD(EVOP_LOOP, cmd, count) +#define EVENT_GOTO(cmd) EVENT_LOOP(0, cmd) + +#define EVENT_STOP_SCRIPT() EVENT_CMD(EVOP_STOP_SCRIPT, 0, 0) + + typedef enum EventModeZ { EMZ_REST, EMZ_RELATIVE, @@ -119,9 +142,9 @@ typedef enum EventOpcode { /* 0 */ EVOP_SET_SPEED, /* 1 */ EVOP_SET_ACCEL, /* 2 */ EVOP_SET_BASE_ZVEL, - /* 3 */ EVOP_SET_TO_IWORK_9, - /* 4 */ EVOP_SET_IWORK_13, - /* 8 */ EVOP_CLEAR_IWORK_13 = 8, + /* 3 */ EVOP_SET_AS_LEADER, + /* 4 */ EVOP_START_FORMATION, + /* 8 */ EVOP_STOP_FORMATION = 8, /* 9 */ EVOP_F4_PLUS_X, /* 10 */ EVOP_F4_MINUS_X, /* 11 */ EVOP_F4_PLUS_Y, @@ -134,14 +157,14 @@ typedef enum EventOpcode { /* 21 */ EVOP_ROT_MINUS_Z, /* 24 */ EVOP_SET_ROTATE = 24, /* 25 */ EVOP_STOP_ROTATE, - /* 40 */ EVOP_SET_STATE_6 = 40, - /* 41 */ EVOP_SET_STATE_7, - /* 42 */ EVOP_SET_STATE_8, - /* 43 */ EVOP_SET_STATE_9, + /* 40 */ EVOP_PURSUE_PLAYER = 40, + /* 41 */ EVOP_FLEE_PLAYER, + /* 42 */ EVOP_PURSUE_TARGET, + /* 43 */ EVOP_FLEE_TARGET, /* 44 */ EVOP_CHASE_TARGET, /* 45 */ EVOP_SET_TARGET, - /* 46 */ EVOP_SET_STATE_14, - /* 47 */ EVOP_SET_STATE_15, + /* 46 */ EVOP_PURSUE_CAMERA, + /* 47 */ EVOP_FLEE_CAMERA, /* 48 */ EVOP_SET_WAIT, /* 56 */ EVOP_SET_CALL = 56, /* 57 */ EVOP_RESTORE_TEAM, @@ -166,7 +189,7 @@ typedef enum EventOpcode { typedef enum EventCondition { /* 0 */ EVC_NONE, - /* 1 */ EVC_1, + /* 1 */ EVC_NO_TARGET, /* 2 */ EVC_TEAM_COUNT_3, /* 3 */ EVC_TEAM_COUNT_2, /* 4 */ EVC_TEAM_COUNT_1, @@ -206,12 +229,12 @@ typedef enum EventCondition { /* 38 */ EVC_UNK3_LASER, /* 39 */ EVC_SHOT_CLOSE_150, /* 40 */ EVC_SHOT_CLOSE_300, - /* 41 */ EVC_41, - /* 42 */ EVC_42, - /* 43 */ EVC_43, + /* 41 */ EVC_NO_LEADER, + /* 42 */ EVC_NO_FOLLOWER, + /* 43 */ EVC_HAS_FOLLOWER, /* 44 */ EVC_TOOK_DAMAGE, /* 45 */ EVC_PASSED_ALL_RINGS, - /* 46 */ EVC_46, + /* 46 */ EVC_ATTACK_GROUP_CLEARED, /* 47 */ EVC_PRESS_CRIGHT, /* 48 */ EVC_WING_BROKEN, /* 49 */ EVC_ME_CLEAR, @@ -227,14 +250,12 @@ typedef enum EventCondition { /* 59 */ EVC_ZO_CLEAR, /* 60 */ EVC_SZ_CLEAR, /* 61 */ EVC_A6_CLEAR, - /* 62 */ EVC_62, - /* 63 */ EVC_63, + /* 62 */ EVC_NOT_CHASED, + /* 63 */ EVC_CHASED, /* 64 */ EVC_MISSED_SEARCHLIGHT, /* 65 */ EVC_30_HITS, /* 66 */ EVC_80_HITS, /* 67 */ EVC_EXPERT_MODE, - /* 68 */ EVC_68, - /* 69 */ EVC_69, /* 100 */ EVC_CLOSE_Z=100, } EventCondition; @@ -245,16 +266,16 @@ typedef enum EventState { /* 3 */ EVSTATE_F4_MINUS_X, /* 4 */ EVSTATE_F4_PLUS_Y, /* 5 */ EVSTATE_F4_MINUS_Y, - /* 6 */ EVSTATE_6, - /* 7 */ EVSTATE_7, - /* 8 */ EVSTATE_8, - /* 9 */ EVSTATE_9, + /* 6 */ EVSTATE_PURSUE_PLAYER, + /* 7 */ EVSTATE_FLEE_PLAYER, + /* 8 */ EVSTATE_PURSUE_TARGET, + /* 9 */ EVSTATE_FLEE_TARGET, /* 10 */ EVSTATE_ME_AS_OPEN, /* 11 */ EVSTATE_ME_AS_CLOSE, /* 12 */ EVSTATE_TEAM_RETREAT, /* 13 */ EVSTATE_CHASE_TARGET, - /* 14 */ EVSTATE_14, - /* 15 */ EVSTATE_15, + /* 14 */ EVSTATE_PURSUE_CAMERA, + /* 15 */ EVSTATE_FLEE_CAMERA, /* 200 */ EVSTATE_SCRIPT_END = 200, /* 1000 */ EVSTATE_1000 = 1000, } EventState; @@ -273,7 +294,7 @@ typedef enum EventAction { /* 10 */ EVACT_10, /* 11 */ EVACT_11, /* 12 */ EVACT_DESPAWN, - /* 13 */ EVACT_13, + /* 13 */ EVACT_TI_DROP_MINE, /* 14 */ EVACT_ME_AS_OPEN, /* 15 */ EVACT_ME_AS_CLOSE, /* 16 */ EVACT_16, @@ -282,119 +303,119 @@ typedef enum EventAction { /* 19 */ EVACT_19, } EventAction; -typedef enum EventActorInfo { - /* 0 */ EINFO_0, - /* 1 */ EINFO_1, - /* 2 */ EINFO_2, - /* 3 */ EINFO_3, - /* 4 */ EINFO_4, - /* 5 */ EINFO_5, - /* 6 */ EINFO_6, - /* 7 */ EINFO_7, - /* 8 */ EINFO_8, - /* 9 */ EINFO_9, - /* 10 */ EINFO_10, - /* 11 */ EINFO_11, - /* 12 */ EINFO_12, - /* 13 */ EINFO_13, - /* 14 */ EINFO_14, - /* 15 */ EINFO_15, - /* 16 */ EINFO_16, - /* 17 */ EINFO_17, - /* 18 */ EINFO_18, - /* 19 */ EINFO_19, - /* 20 */ EINFO_20, - /* 21 */ EINFO_21, - /* 22 */ EINFO_22, - /* 23 */ EINFO_23, - /* 24 */ EINFO_24, - /* 25 */ EINFO_25, - /* 26 */ EINFO_26, - /* 27 */ EINFO_27, - /* 28 */ EINFO_28, - /* 29 */ EINFO_29, - /* 30 */ EINFO_30, - /* 31 */ EINFO_31, - /* 32 */ EINFO_32, - /* 33 */ EINFO_33, - /* 34 */ EINFO_34, - /* 35 */ EINFO_35, - /* 36 */ EINFO_36, - /* 37 */ EINFO_37, - /* 38 */ EINFO_38, - /* 39 */ EINFO_39, - /* 40 */ EINFO_40, - /* 41 */ EINFO_41, - /* 42 */ EINFO_42, - /* 43 */ EINFO_43, - /* 44 */ EINFO_44, - /* 45 */ EINFO_45, - /* 46 */ EINFO_46, - /* 47 */ EINFO_47, - /* 48 */ EINFO_48, - /* 49 */ EINFO_49, - /* 50 */ EINFO_50, - /* 51 */ EINFO_51, - /* 52 */ EINFO_52, - /* 53 */ EINFO_53, - /* 54 */ EINFO_54, - /* 55 */ EINFO_55, - /* 56 */ EINFO_56, - /* 57 */ EINFO_57, - /* 58 */ EINFO_58, - /* 59 */ EINFO_59, - /* 60 */ EINFO_60, - /* 61 */ EINFO_61, - /* 62 */ EINFO_62, - /* 63 */ EINFO_63, - /* 64 */ EINFO_64, - /* 65 */ EINFO_65, - /* 66 */ EINFO_66, - /* 67 */ EINFO_67, - /* 68 */ EINFO_68, - /* 69 */ EINFO_69, - /* 70 */ EINFO_70, - /* 71 */ EINFO_71, - /* 72 */ EINFO_72, - /* 73 */ EINFO_73, - /* 74 */ EINFO_74, - /* 75 */ EINFO_75, - /* 76 */ EINFO_76, - /* 77 */ EINFO_77, - /* 78 */ EINFO_78, - /* 79 */ EINFO_79, - /* 80 */ EINFO_80, - /* 81 */ EINFO_81, - /* 82 */ EINFO_82, - /* 83 */ EINFO_83, - /* 84 */ EINFO_84, - /* 85 */ EINFO_85, - /* 86 */ EINFO_86, - /* 87 */ EINFO_87, - /* 88 */ EINFO_88, - /* 89 */ EINFO_89, - /* 90 */ EINFO_90, - /* 91 */ EINFO_91, - /* 92 */ EINFO_92, - /* 93 */ EINFO_93, - /* 94 */ EINFO_94, - /* 95 */ EINFO_95, - /* 96 */ EINFO_96, - /* 97 */ EINFO_97, - /* 98 */ EINFO_98, - /* 99 */ EINFO_99, - /* 100 */ EINFO_100, - /* 101 */ EINFO_101, - /* 102 */ EINFO_102, - /* 103 */ EINFO_103, - /* 104 */ EINFO_104, - /* 105 */ EINFO_105, - /* 106 */ EINFO_106, - /* 107 */ EINFO_107, - /* 200 */ EINFO_200 = 200, - /* 300 */ EINFO_300 = 300, - /* 4095*/ EINFO_FFF = 4095, -} EventActorInfo; +typedef enum EventActorId { + /* 0 */ EVID_0, + /* 1 */ EVID_1, + /* 2 */ EVID_2, + /* 3 */ EVID_3, + /* 4 */ EVID_4, + /* 5 */ EVID_5, + /* 6 */ EVID_6, + /* 7 */ EVID_7, + /* 8 */ EVID_8, + /* 9 */ EVID_9, + /* 10 */ EVID_10, + /* 11 */ EVID_11, + /* 12 */ EVID_12, + /* 13 */ EVID_13, + /* 14 */ EVID_14, + /* 15 */ EVID_15, + /* 16 */ EVID_16, + /* 17 */ EVID_17, + /* 18 */ EVID_18, + /* 19 */ EVID_19, + /* 20 */ EVID_20, + /* 21 */ EVID_21, + /* 22 */ EVID_22, + /* 23 */ EVID_23, + /* 24 */ EVID_24, + /* 25 */ EVID_25, + /* 26 */ EVID_26, + /* 27 */ EVID_27, + /* 28 */ EVID_28, + /* 29 */ EVID_29, + /* 30 */ EVID_30, + /* 31 */ EVID_31, + /* 32 */ EVID_32, + /* 33 */ EVID_33, + /* 34 */ EVID_34, + /* 35 */ EVID_35, + /* 36 */ EVID_36, + /* 37 */ EVID_37, + /* 38 */ EVID_38, + /* 39 */ EVID_39, + /* 40 */ EVID_40, + /* 41 */ EVID_41, + /* 42 */ EVID_42, + /* 43 */ EVID_43, + /* 44 */ EVID_44, + /* 45 */ EVID_45, + /* 46 */ EVID_46, + /* 47 */ EVID_47, + /* 48 */ EVID_48, + /* 49 */ EVID_49, + /* 50 */ EVID_50, + /* 51 */ EVID_51, + /* 52 */ EVID_52, + /* 53 */ EVID_53, + /* 54 */ EVID_54, + /* 55 */ EVID_55, + /* 56 */ EVID_56, + /* 57 */ EVID_57, + /* 58 */ EVID_58, + /* 59 */ EVID_59, + /* 60 */ EVID_60, + /* 61 */ EVID_61, + /* 62 */ EVID_62, + /* 63 */ EVID_63, + /* 64 */ EVID_64, + /* 65 */ EVID_65, + /* 66 */ EVID_66, + /* 67 */ EVID_67, + /* 68 */ EVID_68, + /* 69 */ EVID_69, + /* 70 */ EVID_70, + /* 71 */ EVID_71, + /* 72 */ EVID_72, + /* 73 */ EVID_73, + /* 74 */ EVID_74, + /* 75 */ EVID_75, + /* 76 */ EVID_76, + /* 77 */ EVID_77, + /* 78 */ EVID_78, + /* 79 */ EVID_79, + /* 80 */ EVID_80, + /* 81 */ EVID_81, + /* 82 */ EVID_82, + /* 83 */ EVID_83, + /* 84 */ EVID_84, + /* 85 */ EVID_85, + /* 86 */ EVID_86, + /* 87 */ EVID_87, + /* 88 */ EVID_88, + /* 89 */ EVID_89, + /* 90 */ EVID_90, + /* 91 */ EVID_91, + /* 92 */ EVID_92, + /* 93 */ EVID_93, + /* 94 */ EVID_94, + /* 95 */ EVID_95, + /* 96 */ EVID_96, + /* 97 */ EVID_97, + /* 98 */ EVID_98, + /* 99 */ EVID_99, + /* 100 */ EVID_100, + /* 101 */ EVID_101, + /* 102 */ EVID_102, + /* 103 */ EVID_103, + /* 104 */ EVID_104, + /* 105 */ EVID_105, + /* 106 */ EVID_106, + /* 107 */ EVID_107, + /* 200 */ EVID_200 = 200, + /* 300 */ EVID_300 = 300, + /* 4095*/ EVID_FFF = 4095, +} EventActorId; typedef enum EventSfx { /* 0 */ EVSFX_0, diff --git a/include/sf64object.h b/include/sf64object.h index 53ee4eec..574ac14b 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -261,10 +261,14 @@ typedef struct { /* 0x3FC */ f32 sfxSource[3]; } Boss; // size = 0x408 +#define DMG_COLLISION 3 +#define DMG_EXPLOSION 2 #define DMG_BEAM 1 #define DMG_NONE 0 #define DMG_BOMB -1 -#define DMG_zRot_0FC 100 +#define DMG_UNK_100 100 + + typedef struct { /* 0x000 */ Object obj; @@ -963,7 +967,7 @@ typedef Scenery Scenery_35; typedef Scenery Scenery_36; typedef Scenery Scenery_37; typedef Scenery Scenery_38; -typedef Scenery Scenery_39; +typedef Scenery MeteoTunnel; typedef Scenery Scenery_40; typedef Scenery Scenery_41; typedef Scenery Scenery_42; diff --git a/include/sf64player.h b/include/sf64player.h index ccd81441..e0d42f5f 100644 --- a/include/sf64player.h +++ b/include/sf64player.h @@ -86,6 +86,11 @@ typedef enum { /* 9 */ PLAYERSHOT_9, } PlayerShotId; +#define NPC_SHOT_ID 100 +#define CS_SHOT_ID 100 +#define DMG_SRC_2 2 +#define DMG_SRC_100 100 + typedef enum { /* 0 */ LASERS_SINGLE, /* 1 */ LASERS_TWIN, @@ -108,7 +113,7 @@ typedef struct { /* 0x5C */ s32 unk_5C; /* 0x60 */ s32 unk_60; /* 0x64 */ s32 unk_64; - /* 0x68 */ s32 playerNum; + /* 0x68 */ s32 sourceId; /* 0x6C */ u8 bonus; } PlayerShot; // size = 0x70 diff --git a/include/variables.h b/include/variables.h index f8ecd58f..fa6760d2 100644 --- a/include/variables.h +++ b/include/variables.h @@ -7,7 +7,7 @@ #include "sf64player.h" // fox_360 -extern s32 D_360_800C9B4C; +extern s32 gAllRangeSpawnEvent; // fox_bg extern u16 gStarColors[16]; @@ -47,7 +47,7 @@ extern f32 gWarpZoneEvent94Hitbox[]; extern f32 gWarpZoneEvent96Hitbox[]; extern f32 gWarpZoneEvent92Hitbox[]; extern f32 gWarpZoneEvent93Hitbox[]; -extern ObjectInfo D_edata_800CC124[]; +extern ObjectInfo gObjectInfo[]; extern f32* D_edata_800CF964[]; // fox_edisplay diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 36afc6f2..74125aff 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -67,7 +67,7 @@ D_display_800CA23C = 0x800CA23C;//size:0x18 D_display_800CA26C = 0x800CA26C;//size:0x20 D_800CA260 = 0x800CA260;//size:0xC D_display_801613E0 = 0x801613E0;//size:0x18 -D_edata_800CC124 = 0x800CC124;//type:u8 +gObjectInfo = 0x800CC124;//type:u8 D_boss_800C9E90 = 0x800C9E90;//size:0x70 gLeveLClearStatus = 0x800D3180; // size:0x20 diff --git a/linker_scripts/us/symbol_addrs_engine.txt b/linker_scripts/us/symbol_addrs_engine.txt index b2c1b0e9..27c43104 100644 --- a/linker_scripts/us/symbol_addrs_engine.txt +++ b/linker_scripts/us/symbol_addrs_engine.txt @@ -551,11 +551,11 @@ gBombCount = 0x80177DA0; gGameFrameCount = 0x80177DB0; gObjectLoadIndex = 0x80177DC8; gPrevEventActorIndex = 0x80177E70; -D_ctx_80177E78 = 0x80177E78; +gFormationLeaderIndex = 0x80177E78; gRingPassCount = 0x80177E80; -D_ctx_80177E88 = 0x80177E88; // size:0xC +gFormationInitRot = 0x80177E88; // size:0xC gTeamArrowsViewPos = 0x80177E98; -D_ctx_80177F10 = 0x80177F10; +gFormationInitPos = 0x80177F10; D_ctx_80177F20 = 0x80177F20; //size:0xF4 D_ctx_80178028 = 0x80178028; //size:0xF4 D_ctx_8017812C = 0x8017812C; diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index 173c0fa5..d158a64f 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -32,32 +32,6 @@ typedef enum ActorAllRangeState { STATE360_19, } ActorAllRangeState; -/* static */ Vec3f D_360_800C9A90 = { 0.0f, -10.0f, 0.0f }; -/* static */ Vec3f D_360_800C9A9C[4] = { - { 0.0f, 20000.0f, 0.0f }, - { 0.0f, 700.0f, 6500.0f }, - { -300.0f, 800.0f, 6800.0f }, - { 300.0f, 900.0f, 7200.0f }, -}; -/* static */ AllRangeAi D_360_800C9ACC[4] = { AI360_FOX, AI360_FALCO, AI360_SLIPPY, AI360_PEPPY }; -/* static */ s32 D_360_800C9ADC[4] = { -1, AI360_10, AI360_10 + 1, AI360_10 + 2 }; -/* static */ s32 D_360_800C9AEC[4] = { -1, AI360_10 + 11, AI360_10 + 13, AI360_10 + 15 }; -/* static */ Vec3f D_360_800C9AFC[4] = { - { 9500.0f, 5000.0f, 9500.0f }, - { 10000.0f, 5000.0f, 10000.0f }, - { 10000.0f, 5000.0f, 9500.0f }, - { 9500.0f, 5000.0f, 10000.0f }, -}; -/* static */ s32 D_360_800C9B2C[4] = { AI360_FOX, AI360_FALCO, AI360_PEPPY, AI360_SLIPPY }; -/* static */ f32 D_360_800C9B3C[4] = { 330.0f, 90.0f, 280.0f, 70.0f }; -s32 D_360_800C9B4C = 96 * 30; -/* static */ Vec3f D_360_800C9B50[6] = { - { 8000.0f, 500.0f, 0.0f }, { 5000.0f, 400.0f, 0.0f }, { 2000.0f, 300.0f, 0.0f }, - { -500.0f, 250.0f, 0.0f }, { 0.0f, 250.0f, 0.0f }, { 0.0f, 250.0f, 0.0f }, -}; -/* static */ Vec3f D_360_800C9B98 = { 60.0f, 0.0f, -170.0f }; -/* static */ Vec3f D_360_800C9BA4 = { -60.0f, 0.0f, -170.0f }; - s32 gAllRangeSupplyTimer; s32 sStarWolfKillTimer; s16 gStarWolfMsgTimer; @@ -318,7 +292,7 @@ void func_360_8002EE64(Actor* this) { Vec3f spB4; Vec3f spA8; f32 spA0[2]; - Vec3f sp94 = D_360_800C9A90; + Vec3f sp94 = { 0.0f, -10.0f, 0.0f }; s32 pad1; s32 pad2; @@ -377,6 +351,16 @@ void func_360_8002EE64(Actor* this) { } } +static Vec3f sTeamSpawnPos[4] = { + { 0.0f, 20000.0f, 0.0f }, + { 0.0f, 700.0f, 6500.0f }, + { -300.0f, 800.0f, 6800.0f }, + { 300.0f, 900.0f, 7200.0f }, +}; +static AllRangeAi sTeamAi[4] = { AI360_FOX, AI360_FALCO, AI360_SLIPPY, AI360_PEPPY }; +static s32 sTeamSpawnTargets[4] = { -1, AI360_10, AI360_10 + 1, AI360_10 + 2 }; +static s32 sTeamSpawnTargetsKA[4] = { -1, AI360_10 + 11, AI360_10 + 13, AI360_10 + 15 }; + void ActorAllRange_SpawnTeam(void) { Actor* actor; s32 i; @@ -393,14 +377,14 @@ void ActorAllRange_SpawnTeam(void) { if (i == 0) { actor->aiType = AI360_EVENT_HANDLER; } else { - actor->obj.pos.x = D_360_800C9A9C[i].x; - actor->obj.pos.y = D_360_800C9A9C[i].y; - actor->obj.pos.z = D_360_800C9A9C[i].z; - actor->aiType = D_360_800C9ACC[i]; + actor->obj.pos.x = sTeamSpawnPos[i].x; + actor->obj.pos.y = sTeamSpawnPos[i].y; + actor->obj.pos.z = sTeamSpawnPos[i].z; + actor->aiType = sTeamAi[i]; if (gCurrentLevel == LEVEL_KATINA) { - actor->aiIndex = D_360_800C9AEC[i]; + actor->aiIndex = sTeamSpawnTargetsKA[i]; } else { - actor->aiIndex = D_360_800C9ADC[i]; + actor->aiIndex = sTeamSpawnTargets[i]; } actor->state = STATE360_2; actor->unk_0F4.y = 180.0f; @@ -424,6 +408,16 @@ void ActorAllRange_SpawnTeam(void) { } } +static Vec3f sStarWolfSpawnPos[4] = { + { 9500.0f, 5000.0f, 9500.0f }, + { 10000.0f, 5000.0f, 10000.0f }, + { 10000.0f, 5000.0f, 9500.0f }, + { 9500.0f, 5000.0f, 10000.0f }, +}; +static s32 sStarWolfSpawnTargets[4] = { AI360_FOX, AI360_FALCO, AI360_PEPPY, AI360_SLIPPY }; +static f32 sStarWolfVE2SpawnRot[4] = { 330.0f, 90.0f, 280.0f, 70.0f }; +s32 gAllRangeSpawnEvent = 96 * 30; + void ActorAllRange_SpawnStarWolf(void) { Actor* actor; s32 i; @@ -432,12 +426,12 @@ void ActorAllRange_SpawnStarWolf(void) { if (gStarWolfTeamAlive[i] != 0) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.pos.x = D_360_800C9AFC[i].x; - actor->obj.pos.y = D_360_800C9AFC[i].y; - actor->obj.pos.z = D_360_800C9AFC[i].z; + actor->obj.pos.x = sStarWolfSpawnPos[i].x; + actor->obj.pos.y = sStarWolfSpawnPos[i].y; + actor->obj.pos.z = sStarWolfSpawnPos[i].z; actor->obj.id = OBJ_ACTOR_ALLRANGE; actor->aiType = i + AI360_WOLF; - actor->aiIndex = D_360_800C9B2C[i]; + actor->aiIndex = sStarWolfSpawnTargets[i]; gActors[actor->aiIndex].aiIndex = -1; actor->health = 100; actor->unk_0C9 = 1; @@ -447,7 +441,7 @@ void ActorAllRange_SpawnStarWolf(void) { actor->unk_0F4.x = -20.0f; actor->iwork[11] = 1; if (gCurrentLevel == LEVEL_VENOM_2) { - actor->obj.rot.z = D_360_800C9B3C[i]; + actor->obj.rot.z = sStarWolfVE2SpawnRot[i]; actor->itemDrop = DROP_SILVER_STAR; } Object_SetInfo(&actor->info, actor->obj.id); @@ -473,7 +467,7 @@ void ActorAllRange_StarWolfDefeatMesg(u16* msg, RadioCharacterId character) { ActorAllRange_PlayMessage(msg, character); } -void func_360_8002F69C(Actor* this) { +void ActorAllRange_UpdateStarWolfEvents(Actor* this) { Actor* actor; s32 i; @@ -484,12 +478,12 @@ void func_360_8002F69C(Actor* this) { Radio_PlayMessage(gMsg_ID_19465, RCID_FOX); } } - if (((gAllRangeEventTimer + 100) == (0, D_360_800C9B4C)) && (gCurrentLevel != LEVEL_VENOM_2)) { + if ((gAllRangeEventTimer + 100 == (0, gAllRangeSpawnEvent)) && (gCurrentLevel != LEVEL_VENOM_2)) { // fake? SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30); } - if (gAllRangeEventTimer == D_360_800C9B4C) { + if (gAllRangeEventTimer == gAllRangeSpawnEvent) { ActorAllRange_SpawnStarWolf(); this->state = STATE360_3; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; @@ -509,11 +503,11 @@ void func_360_8002F69C(Actor* this) { gPlayer[0].cam.at.y = gActors[AI360_WOLF].obj.pos.y; gPlayer[0].cam.at.z = gActors[AI360_WOLF].obj.pos.z; } - if ((gAllRangeEventTimer > D_360_800C9B4C) && (gStarWolfMsgTimer == 0)) { + if ((gAllRangeEventTimer > gAllRangeSpawnEvent) && (gStarWolfMsgTimer == 0)) { gAllRangeFrameCount++; for (i = AI360_FALCO, actor = &gActors[AI360_FALCO]; i <= AI360_ANDREW; i++, actor++) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->state == STATE360_2) && (actor->health < 70) && - (actor->timer_0C6 != 0) && (actor->dmgSource == 1)) { + (actor->timer_0C6 != 0) && (actor->dmgSource == AI360_FOX + 1)) { if ((gActors[actor->aiIndex].state == STATE360_3) && (gActors[actor->aiIndex].aiType <= AI360_ANDREW)) { gActors[actor->aiIndex].iwork[2] = AI360_FOX; gActors[actor->aiIndex].state = STATE360_2; @@ -560,24 +554,24 @@ void func_360_8002F69C(Actor* this) { } } -void func_360_8002FB4C(Actor* actor) { - Actor* actor2; - Actor* actor1; - s32 var_a0; - s32 j; - s32 i; +void ActorAllRange_ChooseNewTarget(Actor* actor) { + Actor* team; + Actor* enemy; + s32 alreadyTaken; + s32 teamId; + s32 enemyId; - for (i = 10, actor1 = &gActors[10]; i < ARRAY_COUNT(gActors); i++, actor1++) { - if ((actor1->obj.status == OBJ_ACTIVE) && (actor1->obj.id == OBJ_ACTOR_ALLRANGE) && (actor1->unk_0B6 == 0) && - (actor1->aiIndex <= -1)) { - var_a0 = false; - for (j = 1, actor2 = &gActors[1]; j < 4; j++, actor2++) { - if ((j != actor->index) && (i == actor2->aiIndex)) { - var_a0 = true; + for (enemyId = AI360_10, enemy = &gActors[AI360_10]; enemyId < ARRAY_COUNT(gActors); enemyId++, enemy++) { + if ((enemy->obj.status == OBJ_ACTIVE) && (enemy->obj.id == OBJ_ACTOR_ALLRANGE) && (enemy->unk_0B6 == 0) && + (enemy->aiIndex <= -1)) { + alreadyTaken = false; + for (teamId = AI360_FALCO, team = &gActors[AI360_FALCO]; teamId <= AI360_PEPPY; teamId++, team++) { + if ((teamId != actor->index) && (enemyId == team->aiIndex)) { + alreadyTaken = true; } } - if (!var_a0) { - actor->aiIndex = i; + if (!alreadyTaken) { + actor->aiIndex = enemyId; actor->state = STATE360_2; actor->iwork[2] = AI360_FOX; break; @@ -586,29 +580,30 @@ void func_360_8002FB4C(Actor* actor) { } } -void func_360_8002FC00(Actor* this) { - Actor* actor; +void ActorAllRange_UpdateEvemyEvents(Actor* this) { + Actor* enemy; s32 i; - for (i = 0, actor = &gActors[10]; i < 50; i++, actor++) { - if ((actor->obj.status == OBJ_DYING) && (actor->aiIndex >= AI360_FALCO) && (actor->aiIndex <= AI360_PEPPY)) { - Actor* actor2; + for (i = 0, enemy = &gActors[AI360_10]; i < 50; i++, enemy++) { + if ((enemy->obj.status == OBJ_DYING) && (enemy->aiIndex >= AI360_FALCO) && (enemy->aiIndex <= AI360_PEPPY)) { + Actor* enemy2; s32 j; - for (j = 0, actor2 = &gActors[10]; j < 51; j++, actor2++) { - if ((actor2->obj.status == OBJ_ACTIVE) && (actor2->state == STATE360_2) && - (actor2->aiIndex == actor->aiIndex)) { + for (j = 0, enemy2 = &gActors[AI360_10]; j <= 50; j++, enemy2++) { // bug? should be < + if ((enemy2->obj.status == OBJ_ACTIVE) && (enemy2->state == STATE360_2) && + (enemy2->aiIndex == enemy->aiIndex)) { return; } } - if (gTeamShields[actor->aiIndex] > 0) { - func_360_8002FB4C(&gActors[actor->aiIndex]); - if ((actor->iwork[5] != 0) && (actor->dmgSource == 1) && (gActors[actor->aiIndex].iwork[3] == 0)) { - if (gTeamHelpActor == &gActors[actor->aiIndex]) { + if (gTeamShields[enemy->aiIndex] > 0) { + ActorAllRange_ChooseNewTarget(&gActors[enemy->aiIndex]); + if ((enemy->iwork[5] != 0) && (enemy->dmgSource == AI360_FOX + 1) && + (gActors[enemy->aiIndex].iwork[3] == 0)) { + if (gTeamHelpActor == &gActors[enemy->aiIndex]) { gTeamHelpActor = NULL; gTeamHelpTimer = 0; } - switch (gActors[actor->aiIndex].aiType) { + switch (gActors[enemy->aiIndex].aiType) { case AI360_FALCO: ActorAllRange_PlayMessage(gMsg_ID_9160, RCID_FALCO); break; @@ -619,8 +614,8 @@ void func_360_8002FC00(Actor* this) { ActorAllRange_PlayMessage(gMsg_ID_9180, RCID_PEPPY); break; } - gActors[actor->aiIndex].iwork[3] = 200; - gActors[actor->aiIndex].timer_0C4 = 600; + gActors[enemy->aiIndex].iwork[3] = 200; + gActors[enemy->aiIndex].timer_0C4 = 600; } } } @@ -630,7 +625,7 @@ void func_360_8002FC00(Actor* this) { bool AllRange_SupplyEvent(void) { switch (gCurrentLevel) { case LEVEL_FORTUNA: - return gAllRangeEventTimer == D_360_800C9B4C + 2400; + return gAllRangeEventTimer == gAllRangeSpawnEvent + 2400; case LEVEL_BOLSE: return gBosses[2].swork[36] == 4; case LEVEL_KATINA: @@ -814,40 +809,40 @@ void ActorAllRange_ApplyDamage(Actor* this) { Vec3f sp48; Vec3f sp3C; - if (this->dmgType != 0) { + if (this->dmgType != DMG_NONE) { if (this->aiType == AI360_GREAT_FOX) { - this->dmgType = 0; + this->dmgType = DMG_NONE; } - if ((this->dmgType >= 2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + if ((this->dmgType >= DMG_EXPLOSION) && (this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { this->damage = 10; this->timer_0C2 = 10; } if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) && - (this->dmgType == 2)) { - this->dmgType = 0; + (this->dmgType == DMG_EXPLOSION)) { + this->dmgType = DMG_NONE; } - if ((this->dmgType == 2) && (this->fwork[22] > 0.0f)) { - this->dmgType = 0; + if ((this->dmgType == DMG_EXPLOSION) && (this->fwork[22] > 0.0f)) { + this->dmgType = DMG_NONE; } if (this->fwork[23] > 1.0f) { - this->dmgType = 0; + this->dmgType = DMG_NONE; } - if (this->dmgType != 0) { + if (this->dmgType != DMG_NONE) { var_a1 = false; if ((this->unk_0B6 == 3) || ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (this->aiType >= AI360_WOLF)) || ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && - (this->dmgType == 2))) { - this->damage = 0; + (this->dmgType == DMG_EXPLOSION))) { + this->damage = DMG_NONE; var_a1 = true; if (gCurrentLevel == LEVEL_BOLSE) { this->dmgSource = 0; } } if (this->aiType >= AI360_WOLF) { - if (!((this->dmgType == 3) && (this->aiType == AI360_WOLF)) && - !((this->aiType == AI360_MISSILE) && (this->dmgType == 2))) { + if (!((this->dmgType == DMG_COLLISION) && (this->aiType == AI360_WOLF)) && + !((this->aiType == AI360_MISSILE) && (this->dmgType == DMG_EXPLOSION))) { this->health -= this->damage; } } else if ((this->aiType <= AI360_PEPPY) && (this->state != STATE360_6)) { @@ -861,8 +856,8 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->health = 0; if (this->aiType == AI360_MISSILE) { SectorZ_80199900(this, 1); - if (this->dmgSource == 1) { - if (gActors[8].obj.status == OBJ_ACTIVE) { + if (this->dmgSource == AI360_FOX + 1) { + if (gActors[AI360_KATT].obj.status == OBJ_ACTIVE) { Radio_PlayMessage(gMsg_ID_16140, RCID_KATT); } BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10); @@ -870,16 +865,16 @@ void ActorAllRange_ApplyDamage(Actor* this) { D_ctx_80177850 = 15; } else { switch (this->dmgSource) { - case 102: + case AI360_FALCO + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_16170, RCID_FALCO); break; - case 103: + case AI360_SLIPPY + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_16180, RCID_SLIPPY); break; - case 104: + case AI360_PEPPY + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_16175, RCID_PEPPY); break; - case 109: + case AI360_KATT + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_16185, RCID_KATT); break; } @@ -925,7 +920,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { if (this->damage >= 20) { this->timer_0BC = 0; } - if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->dmgSource == 1)) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->dmgSource == AI360_FOX + 1)) { if (gKaAllyKillCount < 2) { ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL); } @@ -969,7 +964,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { sStarWolfKillTimer = 150; } switch (this->dmgSource) { - case 1: + case AI360_FOX + 1: if (this->aiType >= AI360_10) { switch (this->iwork[2]) { case AI360_FALCO: @@ -984,28 +979,28 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } break; - case 102: - case 103: - case 104: + case AI360_FALCO + NPC_SHOT_ID + 1: + case AI360_SLIPPY + NPC_SHOT_ID + 1: + case AI360_PEPPY + NPC_SHOT_ID + 1: if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { if ((gStarWolfTeamAlive[0] + gStarWolfTeamAlive[1] + gStarWolfTeamAlive[2] + gStarWolfTeamAlive[3]) == 0) { switch (this->dmgSource) { - case 102: + case AI360_FALCO + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_9438, RCID_FALCO); break; - case 103: + case AI360_SLIPPY + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_9436, RCID_SLIPPY); break; - case 104: + case AI360_PEPPY + NPC_SHOT_ID + 1: Radio_PlayMessage(gMsg_ID_9437, RCID_PEPPY); break; } } else { - gActors[this->dmgSource - 101].iwork[1] = 80; + gActors[this->dmgSource - NPC_SHOT_ID - 1].iwork[1] = 80; } } else { - gActors[this->dmgSource - 101].iwork[1] = 80; + gActors[this->dmgSource - NPC_SHOT_ID - 1].iwork[1] = 80; } break; } @@ -1054,7 +1049,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->fwork[12] = sp3C.z; } if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { - if (this->dmgType == 3) { + if (this->dmgType == DMG_COLLISION) { switch (this->aiType) { case AI360_FALCO: ActorAllRange_PlayMessage(gMsg_ID_20210, RCID_FALCO); @@ -1071,7 +1066,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } else if (this->dmgSource <= AI360_PEPPY + 101) { if (this->aiType >= AI360_WOLF) { - if (this->dmgSource == 1) { + if (this->dmgSource == AI360_FOX + 1) { if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && !gKaKilledAlly) { gKaKilledAlly = true; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); @@ -1149,7 +1144,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } } - this->dmgType = 0; + this->dmgType = DMG_NONE; } } } @@ -1180,6 +1175,11 @@ bool func_360_80031900(Actor* actor) { return false; } +static Vec3f sSectorZRetreatPath[6] = { + { 8000.0f, 500.0f, 0.0f }, { 5000.0f, 400.0f, 0.0f }, { 2000.0f, 300.0f, 0.0f }, + { -500.0f, 250.0f, 0.0f }, { 0.0f, 250.0f, 0.0f }, { 0.0f, 250.0f, 0.0f }, +}; + void ActorAllRange_Update(Actor* this) { u8 sp10F; s32 sp108; @@ -1207,8 +1207,8 @@ void ActorAllRange_Update(Actor* this) { Vec3f spA8; Vec3f sp9C; Vec3f sp90; - Vec3f sp84 = D_360_800C9B98; - Vec3f sp78 = D_360_800C9BA4; + Vec3f sp84 = { 60.0f, 0.0f, -170.0f }; + Vec3f sp78 = { -60.0f, 0.0f, -170.0f }; s32 pad1; s32 pad2; s32 pad3; @@ -1380,11 +1380,11 @@ void ActorAllRange_Update(Actor* this) { gTeamShields[this->aiType] = -1; gTeamDamage[this->aiType] = 0; if (gCurrentLevel == LEVEL_SECTOR_Z) { - this->fwork[4] = D_360_800C9B50[this->unk_046].x; - this->fwork[5] = D_360_800C9B50[this->unk_046].y; - this->fwork[6] = D_360_800C9B50[this->unk_046].z; - if ((fabsf(this->obj.pos.x - D_360_800C9B50[this->unk_046].x) < 800.0f) && - (fabsf(this->obj.pos.z - D_360_800C9B50[this->unk_046].z) < 800.0f)) { + this->fwork[4] = sSectorZRetreatPath[this->unk_046].x; + this->fwork[5] = sSectorZRetreatPath[this->unk_046].y; + this->fwork[6] = sSectorZRetreatPath[this->unk_046].z; + if ((fabsf(this->obj.pos.x - sSectorZRetreatPath[this->unk_046].x) < 800.0f) && + (fabsf(this->obj.pos.z - sSectorZRetreatPath[this->unk_046].z) < 800.0f)) { this->unk_046++; if (this->unk_046 >= 4) { Object_Kill(&this->obj, this->sfxSource); @@ -1751,7 +1751,7 @@ void ActorAllRange_Update(Actor* this) { (gActors[this->aiIndex].obj.status == OBJ_FREE))) { this->state = STATE360_3; if (gCurrentLevel == LEVEL_BOLSE) { - func_360_8002FB4C(this); + ActorAllRange_ChooseNewTarget(this); } } } @@ -2019,23 +2019,23 @@ void ActorAllRange_Update(Actor* this) { if (Rand_ZeroOne() < 0.8f) { spA8.x = 60.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA8, &sp9C); - func_enmy2_8006EEFC(this->aiType, this->obj.pos.x + sp9C.x + (sp90.x * 1.5f), - this->obj.pos.y + sp9C.y + (sp90.y * 1.5f), - this->obj.pos.z + sp9C.z + (sp90.z * 1.5f), sp90.x, sp90.y, sp90.z, this->obj.rot.x, - this->obj.rot.y, this->obj.rot.z); + Actor_SpawnPlayerLaser(this->aiType, this->obj.pos.x + sp9C.x + (sp90.x * 1.5f), + this->obj.pos.y + sp9C.y + (sp90.y * 1.5f), + this->obj.pos.z + sp9C.z + (sp90.z * 1.5f), sp90.x, sp90.y, sp90.z, + this->obj.rot.x, this->obj.rot.y, this->obj.rot.z); } if (Rand_ZeroOne() < 0.8f) { spA8.x = -60.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA8, &sp9C); - func_enmy2_8006EEFC(this->aiType, this->obj.pos.x + sp9C.x + (sp90.x * 1.5f), - this->obj.pos.y + sp9C.y + (sp90.y * 1.5f), - this->obj.pos.z + sp9C.z + (sp90.z * 1.5f), sp90.x, sp90.y, sp90.z, this->obj.rot.x, - this->obj.rot.y, this->obj.rot.z); + Actor_SpawnPlayerLaser(this->aiType, this->obj.pos.x + sp9C.x + (sp90.x * 1.5f), + this->obj.pos.y + sp9C.y + (sp90.y * 1.5f), + this->obj.pos.z + sp9C.z + (sp90.z * 1.5f), sp90.x, sp90.y, sp90.z, + this->obj.rot.x, this->obj.rot.y, this->obj.rot.z); } } else { - func_enmy2_8006EEFC(this->aiType, this->obj.pos.x + (sp90.x * 1.5f), this->obj.pos.y + (sp90.y * 1.5f), - this->obj.pos.z + (sp90.z * 1.5f), sp90.x, sp90.y, sp90.z, this->obj.rot.x, - this->obj.rot.y, this->obj.rot.z); + Actor_SpawnPlayerLaser(this->aiType, this->obj.pos.x + (sp90.x * 1.5f), this->obj.pos.y + (sp90.y * 1.5f), + this->obj.pos.z + (sp90.z * 1.5f), sp90.x, sp90.y, sp90.z, this->obj.rot.x, + this->obj.rot.y, this->obj.rot.z); } } ActorAllRange_ApplyDamage(this); @@ -2096,7 +2096,7 @@ void ActorAllRange_Update(Actor* this) { func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 15); func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } else { - this->dmgType = 1; + this->dmgType = DMG_BEAM; this->damage = 10; this->health = 0; ActorAllRange_ApplyDamage(this); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 4f9f3bc3..b58c7663 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -56,7 +56,7 @@ void func_beam_80035E78(PlayerShot* shot) { shot->unk_5C = 1; shot->unk_64 = 30; shot->unk_58 = 150; - Audio_PlayBombExplodeSfx(shot->playerNum, shot->sfxSource); + Audio_PlayBombExplodeSfx(shot->sourceId, shot->sfxSource); gScreenFlashTimer = 4; if (shot->obj.pos.y < (gGroundHeight + 450.0f)) { gCameraShake = 15; @@ -88,7 +88,7 @@ void func_beam_80035E78(PlayerShot* shot) { } if (gVersusMode) { - var_v0 = shot->playerNum + 10; + var_v0 = shot->sourceId + 10; } else { var_v0 = 0; } @@ -139,7 +139,7 @@ void func_beam_80036318(PlayerShot* shot) { } else if (shot->obj.id == PLAYERSHOT_8) { shot->scale = 7.5f; for (i = 0; i < ARRAY_COUNT(gActors); i++) { - gActors[i].lockOnTimers[shot->playerNum] = 0; + gActors[i].lockOnTimers[shot->sourceId] = 0; } shot->vel.x = shot->vel.y = shot->vel.z = 0.0f; if (gCurrentLevel == LEVEL_AQUAS) { @@ -149,7 +149,7 @@ void func_beam_80036318(PlayerShot* shot) { } else { if (gVersusMode) { - var_v0_2 = shot->playerNum + 10; + var_v0_2 = shot->sourceId + 10; } else { var_v0_2 = 12; } @@ -256,8 +256,8 @@ s32 func_beam_80036874(PlayerShot* shot, f32* hitboxData, Object* obj) { count = *hitboxData; if (count != 0) { xySizeMod = 10.0f; - if ((shot->playerNum < 4) && - ((gLaserStrength[shot->playerNum] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) { + if ((shot->sourceId < 4) && + ((gLaserStrength[shot->sourceId] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) { xySizeMod += 30.0f; } hitboxData++; @@ -368,8 +368,8 @@ s32 func_beam_80036F88(PlayerShot* shot, Actor* actor) { xySizeMod = 0.0f; if (actor->info.unk_16 == 1) { xySizeMod = fabsf((actor->obj.pos.z + gPathProgress) / 50.0f) + 10.0f; - if ((shot->playerNum < 4) && - ((gLaserStrength[shot->playerNum] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) { + if ((shot->sourceId < 4) && + ((gLaserStrength[shot->sourceId] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) { xySizeMod += 30.0f; } } @@ -394,7 +394,7 @@ s32 func_beam_80036F88(PlayerShot* shot, Actor* actor) { } if (((actor->vwork[29].z != 0.0f) || (actor->vwork[29].x != 0.0f) || (actor->unk_0F4.z != 0.0f) || (actor->vwork[29].y != 0.0f)) && - (actor->unk_0B4 != EINFO_31)) { + (actor->unk_0B4 != EVID_31)) { Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -actor->vwork[29].x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -actor->vwork[29].y * M_DTOR, MTXF_APPLY); @@ -427,7 +427,7 @@ bool func_beam_80037438(PlayerShot* shot, Actor* actor) { f32* hitboxData = actor->info.hitbox; if (((s32) hitboxData[0] != 0) && (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) <= 500.0f)) { - if (shot->playerNum < 4) { + if (shot->sourceId < 4) { temp_fv1 = actor->obj.pos.x - gPlayer[0].cam.eye.x; temp_fa0 = actor->obj.pos.z + gPathProgress - gPlayer[0].cam.eye.z; var_fa1 = (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) / 50.0f) + 20.0f + 10.0f; @@ -436,7 +436,7 @@ bool func_beam_80037438(PlayerShot* shot, Actor* actor) { } if (shotx->id == PLAYERSHOT_8) { var_fa1 = 30.0f; - } else if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { + } else if (gLaserStrength[shot->sourceId] != LASERS_SINGLE) { var_fa1 += 30.0f; } if (fabsf(hitboxData[1] + actor->obj.pos.z - shotx->pos.z) < (hitboxData[2] + var_fa1)) { @@ -652,12 +652,12 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { Vec3f sp44 = { 0.0f, 0.0f, -100.0f }; Vec3f sp38; - actor->dmgType = 1; + actor->dmgType = DMG_BEAM; actor->dmgPart = hitIndex - 1; actor->timer_0C2 = 2; actor->damage = 10; - if ((shot->playerNum < 4) && (gPlayer[shot->playerNum].form != FORM_LANDMASTER)) { - switch (gLaserStrength[shot->playerNum]) { + if ((shot->sourceId < 4) && (gPlayer[shot->sourceId].form != FORM_LANDMASTER)) { + switch (gLaserStrength[shot->sourceId]) { case LASERS_TWIN: actor->damage = 12; break; @@ -665,9 +665,9 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { actor->damage = 15; break; } - } else if ((shot->playerNum >= 100) && (gCurrentLevel == LEVEL_SECTOR_X)) { - if ((gActors[shot->playerNum - 100].obj.id == OBJ_ACTOR_EVENT) && - (gActors[shot->playerNum - 100].iwork[12] == TEAM_ID_BILL)) { + } else if ((shot->sourceId >= NPC_SHOT_ID) && (gCurrentLevel == LEVEL_SECTOR_X)) { + if ((gActors[shot->sourceId - NPC_SHOT_ID].obj.id == OBJ_ACTOR_EVENT) && + (gActors[shot->sourceId - NPC_SHOT_ID].iwork[12] == TEAM_ID_BILL)) { actor->damage = 30; } } @@ -677,19 +677,19 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { if (gCurrentLevel == LEVEL_AQUAS) { actor->damage = 31; } else { - actor->dmgType = 2; + actor->dmgType = DMG_EXPLOSION; actor->damage = 30; - actor->lockOnTimers[shot->playerNum] = 0; + actor->lockOnTimers[shot->sourceId] = 0; } } - actor->dmgSource = shot->playerNum + 1; + actor->dmgSource = shot->sourceId + 1; actor->hitPos.x = shot->obj.pos.x; actor->hitPos.y = shot->obj.pos.y; actor->hitPos.z = shot->obj.pos.z; if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && - ((actor->unk_0B4 == EINFO_48) || (actor->unk_0B4 == EINFO_49) || (actor->unk_0B4 == EINFO_50))) || + ((actor->unk_0B4 == EVID_48) || (actor->unk_0B4 == EVID_49) || (actor->unk_0B4 == EVID_50))) || ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->fwork[23] > 1.0f)) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && (actor->unk_0B4 == EINFO_67)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && (actor->unk_0B4 == EVID_67)) || ((actor->obj.id == OBJ_ACTOR_261) && (shot->obj.id != PLAYERSHOT_8) && ((actor->state < 3) || (actor->state >= 5))) || ((actor->obj.id == OBJ_ACTOR_260) && (shot->obj.id != PLAYERSHOT_8) && (actor->timer_0BC != 0))) { @@ -760,19 +760,19 @@ void func_beam_80038140(PlayerShot* shot) { switch (actor->obj.id) { case OBJ_ACTOR_180: if (func_beam_8003774C(shot, actor->obj.id, &actor->obj)) { - actor->dmgType = 1; - actor->dmgPart = shot->playerNum; + actor->dmgType = DMG_BEAM; + actor->dmgPart = shot->sourceId; return; } break; case OBJ_ACTOR_EVENT: - if (actor->unk_0B4 == EINFO_42) { + if (actor->unk_0B4 == EVID_42) { if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) { - actor->dmgType = 1; - actor->dmgPart = shot->playerNum; + actor->dmgType = DMG_BEAM; + actor->dmgPart = shot->sourceId; return; } - } else if (actor->unk_0B4 == EINFO_63) { + } else if (actor->unk_0B4 == EVID_63) { test.x = fabsf(actor->obj.pos.x - shot->obj.pos.x); test.y = fabsf(actor->obj.pos.y - shot->obj.pos.y); test.z = fabsf(actor->obj.pos.z - shot->obj.pos.z); @@ -791,8 +791,9 @@ void func_beam_80038140(PlayerShot* shot) { if (actor->info.unk_16 != 0) { if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && - (((gCurrentLevel == LEVEL_VENOM_2) && (shot->playerNum < 104)) || - ((gCurrentLevel != LEVEL_VENOM_2) && (shot->playerNum == 0))) && + (((gCurrentLevel == LEVEL_VENOM_2) && + (shot->sourceId <= NPC_SHOT_ID + AI360_PEPPY)) || + ((gCurrentLevel != LEVEL_VENOM_2) && (shot->sourceId == AI360_FOX))) && (shot->obj.id != PLAYERSHOT_8) && (fabsf(actor->obj.pos.x - shot->obj.pos.x) < 500.0f) && (fabsf(actor->obj.pos.y - shot->obj.pos.y) < 300.0f) && @@ -823,8 +824,8 @@ void func_beam_80038140(PlayerShot* shot) { if (gLevelMode == LEVELMODE_ALL_RANGE) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { test.x = 50.0f; - if (gVersusMode && (shot->playerNum < 4) && - !((gLaserStrength[shot->playerNum] == LASERS_SINGLE) && (shot->obj.id != PLAYERSHOT_8))) { + if (gVersusMode && (shot->sourceId < 4) && + !((gLaserStrength[shot->sourceId] == LASERS_SINGLE) && (shot->obj.id != PLAYERSHOT_8))) { test.x = 100.0f; } if (player->barrelRollAlpha >= 100) { @@ -839,7 +840,7 @@ void func_beam_80038140(PlayerShot* shot) { test.y = test.x; } test.z = test.x; - if ((i != shot->playerNum) && + if ((i != shot->sourceId) && ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_DOWN)) && (fabsf(player->trueZpos - shot->obj.pos.z) < test.z) && (fabsf(player->pos.x - shot->obj.pos.x) < test.x) && @@ -871,7 +872,7 @@ void func_beam_80038140(PlayerShot* shot) { } player->unk_284 = 1; if (gCamCount != 1) { - player->unk_288 = shot->playerNum + 1; + player->unk_288 = shot->sourceId + 1; } player->knockback.x = shot->vel.x * 0.1f; player->knockback.y = shot->vel.y * 0.1f; @@ -898,7 +899,7 @@ void func_beam_80038140(PlayerShot* shot) { } } - if ((gLevelMode == LEVELMODE_ALL_RANGE) && (shot->playerNum < 110)) { + if ((gLevelMode == LEVELMODE_ALL_RANGE) && (shot->sourceId < 110)) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if (scenery360->obj.status == OBJ_ACTIVE) { if ((scenery360->obj.id == OBJ_SCENERY_117) || (scenery360->obj.id == OBJ_SCENERY_141) || @@ -926,7 +927,7 @@ void func_beam_80038140(PlayerShot* shot) { } else { temp_v0 = func_beam_80036874(shot, scenery->info.hitbox, &scenery->obj); if (temp_v0 != 0) { - scenery->dmgType = 1; + scenery->dmgType = DMG_BEAM; scenery->dmgPart = temp_v0 - 1; } } @@ -987,7 +988,7 @@ void func_beam_80038140(PlayerShot* shot) { if (shot->obj.id == PLAYERSHOT_4) { Object_Kill(&shot->obj, shot->sfxSource); } else { - if ((boss->obj.id == OBJ_BOSS_316) && (shot->playerNum != 0)) { + if ((boss->obj.id == OBJ_BOSS_316) && (shot->sourceId != TEAM_ID_FOX)) { break; } boss->dmgType = DMG_BEAM; @@ -1002,8 +1003,8 @@ void func_beam_80038140(PlayerShot* shot) { } } else { boss->damage = 10; - if (shot->playerNum < 4) { - switch (gLaserStrength[shot->playerNum]) { + if (shot->sourceId < 4) { + switch (gLaserStrength[shot->sourceId]) { case LASERS_SINGLE: case LASERS_TWIN: break; @@ -1014,7 +1015,7 @@ void func_beam_80038140(PlayerShot* shot) { } } if (boss->obj.id == OBJ_BOSS_314) { - boss->swork[19] = shot->playerNum; + boss->swork[19] = shot->sourceId; } boss->dmgPart = temp_v0 - 1; if (boss->obj.id == OBJ_BOSS_301) { @@ -1114,23 +1115,24 @@ void func_beam_80039210(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, sp6C); } else { var_a1 = 0; - if ((gCurrentLevel != LEVEL_KATINA) && (shot->playerNum >= 104) && (shot->playerNum != 108)) { - if (gActors[shot->playerNum - 100].obj.id != OBJ_ACTOR_EVENT) { + if ((gCurrentLevel != LEVEL_KATINA) && (shot->sourceId > NPC_SHOT_ID + AI360_PEPPY) && + (shot->sourceId != NPC_SHOT_ID + AI360_KATT)) { + if (gActors[shot->sourceId - NPC_SHOT_ID].obj.id != OBJ_ACTOR_EVENT) { var_a1 = 1; - } else if (gActors[shot->playerNum - 100].iwork[12] == TEAM_ID_BILL) { + } else if (gActors[shot->sourceId - NPC_SHOT_ID].iwork[12] == TEAM_ID_BILL) { var_a1 = 2; } } else if (gCurrentLevel == LEVEL_KATINA) { if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) { - if (shot->playerNum >= 104) { - if (gActors[shot->playerNum - 100].unk_0B6 == 0) { + if (shot->sourceId > NPC_SHOT_ID + AI360_PEPPY) { + if (gActors[shot->sourceId - NPC_SHOT_ID].unk_0B6 == 0) { var_a1 = 1; } - if (gActors[shot->playerNum - 100].unk_0B6 == 2) { + if (gActors[shot->sourceId - NPC_SHOT_ID].unk_0B6 == 2) { var_a1 = 2; } } - } else if (gActors[shot->playerNum - 100].unk_0B6 == 34) { + } else if (gActors[shot->sourceId - NPC_SHOT_ID].unk_0B6 == 34) { var_a1 = 1; } } @@ -1177,7 +1179,7 @@ void func_beam_80039210(PlayerShot* shot) { } } else { RCP_SetupDL_64(); - switch (shot->playerNum) { + switch (shot->sourceId) { case 0: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 32, 255); break; @@ -1194,7 +1196,7 @@ void func_beam_80039210(PlayerShot* shot) { Matrix_Scale(gGfxMatrix, 6.0f, 4.0f, 10.0f, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { + if (gLaserStrength[shot->sourceId] != LASERS_SINGLE) { Matrix_Translate(gGfxMatrix, 6.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_302D120); @@ -1272,7 +1274,7 @@ void func_beam_80039A50(PlayerShot* shot) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); if (gVersusMode) { - switch (shot->playerNum) { + switch (shot->sourceId) { case 0: gDPSetEnvColor(gMasterDisp++, 255, 255, 32, 128); break; @@ -1297,7 +1299,7 @@ void func_beam_80039A50(PlayerShot* shot) { if (gVersusMode) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, shot->unk_58); - switch (shot->playerNum) { + switch (shot->sourceId) { case 0: gDPSetEnvColor(gMasterDisp++, 255, 255, 32, shot->unk_58); break; @@ -1323,10 +1325,10 @@ void func_beam_80039A50(PlayerShot* shot) { RCP_SetupDL_40(); if (gVersusMode) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - gDPSetEnvColor(gMasterDisp++, D_800C9C00[shot->playerNum], D_800C9C04[shot->playerNum], - D_800C9C08[shot->playerNum], 255); + gDPSetEnvColor(gMasterDisp++, D_800C9C00[shot->sourceId], D_800C9C04[shot->sourceId], + D_800C9C08[shot->sourceId], 255); RCP_SetupDL(&gMasterDisp, 0x31); - if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { + if (gLaserStrength[shot->sourceId] != LASERS_SINGLE) { Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 48.0f * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.f, 50.0f, 0.0f, MTXF_APPLY); @@ -1375,9 +1377,9 @@ void func_beam_80039A50(PlayerShot* shot) { Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - gDPSetEnvColor(gMasterDisp++, D_800C9C00[shot->playerNum], D_800C9C04[shot->playerNum], - D_800C9C08[shot->playerNum], 255); - if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { + gDPSetEnvColor(gMasterDisp++, D_800C9C00[shot->sourceId], D_800C9C04[shot->sourceId], + D_800C9C08[shot->sourceId], 255); + if (gLaserStrength[shot->sourceId] != LASERS_SINGLE) { Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 48.0f * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.f, 40.0f, 0.0f, MTXF_APPLY); @@ -1420,7 +1422,7 @@ void func_beam_80039A50(PlayerShot* shot) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); if (gVersusMode) { - switch (shot->playerNum) { + switch (shot->sourceId) { case 0: gDPSetEnvColor(gMasterDisp++, 255, 255, 32, 255); break; @@ -1611,7 +1613,7 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { func_effect_8007A6F0(&shot->obj.pos, 0x29121007); } if ((gCamCount != 4) && (gCurrentLevel != LEVEL_AQUAS)) { - if ((shot->playerNum == 0) && (gLaserStrength[0] != LASERS_SINGLE) && + if ((shot->sourceId == TEAM_ID_FOX) && (gLaserStrength[0] != LASERS_SINGLE) && (gPlayer[0].form != FORM_LANDMASTER)) { Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); @@ -1653,7 +1655,7 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { if (shot->unk_64 == 0) { Object_Kill(&shot->obj, shot->sfxSource); return; - } else if ((shot->playerNum < 110) || ((shot->unk_64 % 2) != 0)) { + } else if ((shot->sourceId < NPC_SHOT_ID + AI360_10) || ((shot->unk_64 % 2) != 0)) { func_beam_80038140(shot); } } @@ -1699,39 +1701,39 @@ bool func_beam_8003BB4C(PlayerShot* shot) { } for (i = 0, actor = gActors; i < 60; i++, actor++) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.targetOffset != 0.0f) && - ((actor->lockOnTimers[shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - actor->obj.pos.x) <= var_fa0) && + ((actor->lockOnTimers[shot->sourceId] == 0) && (fabsf(shot->obj.pos.x - actor->obj.pos.x) <= var_fa0) && (fabsf(shot->obj.pos.y - (actor->obj.pos.y + actor->info.targetOffset)) <= var_fa0) && (fabsf(shot->obj.pos.z - actor->obj.pos.z) <= var_fa0))) { - actor->lockOnTimers[shot->playerNum] = 20; - func_enmy_80060F30(gPlayer[shot->playerNum].sfxSource, 0x49008027, shot->playerNum); + actor->lockOnTimers[shot->sourceId] = 20; + func_enmy_80060F30(gPlayer[shot->sourceId].sfxSource, 0x49008027, shot->sourceId); for (j = 0; j < ARRAY_COUNT(gPlayerShots); j++) { if (gPlayerShots[j].obj.id == PLAYERSHOT_4) { Object_Kill(&gPlayerShots[j].obj, gPlayerShots[j].sfxSource); } } - D_display_801615B8[shot->playerNum] = 3.0f; - D_display_801615A8[shot->playerNum] = 300.0f; + D_display_801615B8[shot->sourceId] = 3.0f; + D_display_801615A8[shot->sourceId] = 300.0f; return true; } } if (gVersusMode) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !player->somersault && - (player->form != FORM_ON_FOOT) && (i != shot->playerNum) && - (gVsLockOnTimers[i][shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - player->pos.x) <= var_fa0) && + (player->form != FORM_ON_FOOT) && (i != shot->sourceId) && (gVsLockOnTimers[i][shot->sourceId] == 0) && + (fabsf(shot->obj.pos.x - player->pos.x) <= var_fa0) && (fabsf(shot->obj.pos.y - player->pos.y) <= var_fa0) && (fabsf(shot->obj.pos.z - player->trueZpos) <= var_fa0)) { - gVsLockOnTimers[0][shot->playerNum] = gVsLockOnTimers[1][shot->playerNum] = - gVsLockOnTimers[2][shot->playerNum] = gVsLockOnTimers[3][shot->playerNum] = 0; - gVsLockOnTimers[i][shot->playerNum] = 20; - func_enmy_80060F30(gPlayer[shot->playerNum].sfxSource, 0x49008027, shot->playerNum); + gVsLockOnTimers[0][shot->sourceId] = gVsLockOnTimers[1][shot->sourceId] = + gVsLockOnTimers[2][shot->sourceId] = gVsLockOnTimers[3][shot->sourceId] = 0; + gVsLockOnTimers[i][shot->sourceId] = 20; + func_enmy_80060F30(gPlayer[shot->sourceId].sfxSource, 0x49008027, shot->sourceId); for (j = 0; j < ARRAY_COUNT(gPlayerShots); j++) { if (gPlayerShots[j].obj.id == PLAYERSHOT_4) { Object_Kill(&gPlayerShots[j].obj, gPlayerShots[j].sfxSource); } } - D_display_801615B8[shot->playerNum] = 3.0f; - D_display_801615A8[shot->playerNum] = 300.0f; + D_display_801615B8[shot->sourceId] = 3.0f; + D_display_801615A8[shot->sourceId] = 300.0f; return true; } } @@ -1742,7 +1744,7 @@ bool func_beam_8003BB4C(PlayerShot* shot) { void func_beam_8003BEF4(PlayerShot* shot) { if (gVersusMode) { if ((shot->obj.pos.y < gGroundHeight) || func_beam_8003BB4C(shot) || - !(gControllerHold[shot->playerNum].button & A_BUTTON) || (shot->unk_64 == 0)) { + !(gControllerHold[shot->sourceId].button & A_BUTTON) || (shot->unk_64 == 0)) { Object_Kill(&shot->obj, shot->sfxSource); } } else { @@ -1826,9 +1828,9 @@ void func_beam_8003C3D8(PlayerShot* shot) { gLight3y = shot->obj.pos.y; gLight3z = shot->obj.pos.z; if (gVersusMode) { - gLight3R = D_800C9C18[shot->playerNum]; - gLight3G = D_800C9C1C[shot->playerNum]; - gLight3B = D_800C9C20[shot->playerNum]; + gLight3R = D_800C9C18[shot->sourceId]; + gLight3G = D_800C9C1C[shot->sourceId]; + gLight3B = D_800C9C20[shot->sourceId]; } else { gLight3R = 90; gLight3G = 90; @@ -1860,7 +1862,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { sp64 = scenery->obj.pos.y - shot->obj.pos.y; sp60 = scenery->obj.pos.z - shot->obj.pos.z; if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) { - scenery->dmgType = 2; + scenery->dmgType = DMG_EXPLOSION; } scenery->dmgPart = 0; } @@ -1897,19 +1899,19 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if ((actor->obj.id == OBJ_ACTOR_193) || (actor->obj.id == OBJ_ACTOR_186) || (actor->obj.id == OBJ_ACTOR_190) || (actor->obj.id == OBJ_ACTOR_202) || (actor->obj.id == OBJ_ACTOR_201) || (actor->obj.id == OBJ_ACTOR_187) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_78)) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_38)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_78)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_38)) || (actor->obj.id == OBJ_ACTOR_196)) { - actor->dmgType = 2; + actor->dmgType = DMG_EXPLOSION; actor->dmgPart = 0; - actor->dmgSource = shot->playerNum + 1; + actor->dmgSource = shot->sourceId + 1; actor->damage = damage; if (actor->info.bonus != 0) { shot->bonus++; } } else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->scale >= 0.5f) && (damage > 30)) { - actor->dmgSource = shot->playerNum + 1; + actor->dmgSource = shot->sourceId + 1; actor->vel.x = sp68 * 0.03f; actor->vel.y = sp64 * 0.03f; actor->vel.z = sp60 * 0.03f; @@ -1922,9 +1924,9 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { shot->bonus++; } } else { - actor->dmgType = 2; + actor->dmgType = DMG_EXPLOSION; actor->dmgPart = 0; - actor->dmgSource = shot->playerNum + 1; + actor->dmgSource = shot->sourceId + 1; actor->damage = damage; if (actor->info.bonus != 0) { shot->bonus++; @@ -1969,12 +1971,12 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { } if (gVersusMode) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { - if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->hitTimer == 0)) { + if ((i != shot->sourceId) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->hitTimer == 0)) { sp68 = player->pos.x - shot->obj.pos.x; sp64 = player->pos.y - shot->obj.pos.y; sp60 = player->trueZpos - shot->obj.pos.z; if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) { - player->unk_288 = shot->playerNum + 1; + player->unk_288 = shot->sourceId + 1; switch (player->form) { case FORM_ARWING: Player_ApplyDamage(player, 0, 80); @@ -2006,18 +2008,18 @@ void func_beam_8003CC08(PlayerShot* shot) { func_beam_80035E78(shot); break; } - if ((gPlayer[shot->playerNum].form == FORM_LANDMASTER) || (gPlayer[shot->playerNum].form == FORM_ON_FOOT)) { + if ((gPlayer[shot->sourceId].form == FORM_LANDMASTER) || (gPlayer[shot->sourceId].form == FORM_ON_FOOT)) { shot->vel.y -= 1.0f; Math_SmoothStepToF(&shot->obj.rot.x, -90.0f, 0.05f, 1.0f, 0.0f); } if (shot->unk_64 < 25) { if (gVersusMode) { - if (gControllerPress[shot->playerNum].button & gBombButton[shot->playerNum]) { + if (gControllerPress[shot->sourceId].button & gBombButton[shot->sourceId]) { func_beam_80035E78(shot); break; } } else { - if (gControllerPress[gMainController].button & gBombButton[shot->playerNum]) { + if (gControllerPress[gMainController].button & gBombButton[shot->sourceId]) { func_beam_80035E78(shot); break; } @@ -2091,18 +2093,18 @@ void func_beam_8003CF90(PlayerShot* shot) { if (shot->unk_60 == 0) { for (i = 0, actor = gActors; i < 60; i++, actor++) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.targetOffset != 0.0f) && - (actor->lockOnTimers[shot->playerNum] != 0)) { + (actor->lockOnTimers[shot->sourceId] != 0)) { var_a3 = 1; - actor->lockOnTimers[shot->playerNum] = 2; + actor->lockOnTimers[shot->sourceId] = 2; D_800C9C24 = actor->obj.pos; D_800C9C24.y += actor->info.targetOffset; } } for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { if (((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) && - (gVsLockOnTimers[i][shot->playerNum] != 0)) { + (gVsLockOnTimers[i][shot->sourceId] != 0)) { var_a3 = 1; - gVsLockOnTimers[i][shot->playerNum] = 2; + gVsLockOnTimers[i][shot->sourceId] = 2; D_800C9C24.x = player->pos.x; if (player->form == FORM_ARWING) { D_800C9C24.y = player->pos.y; @@ -2143,7 +2145,7 @@ void func_beam_8003CF90(PlayerShot* shot) { } else { Math_SmoothStepToF(&shot->unk_54, 91.0f, 1.0f, 7.7999997f, 0.f); } - if (!((gPlayer[shot->playerNum].form == FORM_LANDMASTER) && (shot->unk_60 != 0))) { + if (!((gPlayer[shot->sourceId].form == FORM_LANDMASTER) && (shot->unk_60 != 0))) { Vec3f sp44; Vec3f sp38; @@ -2185,7 +2187,7 @@ void func_beam_8003D54C(PlayerShot* shot, s32 index) { func_beam_8003B55C(shot, index); break; case PLAYERSHOT_2: - func_beam_8003B00C(shot, &gPlayer[shot->playerNum]); + func_beam_8003B00C(shot, &gPlayer[shot->sourceId]); break; case PLAYERSHOT_BOMB: func_beam_8003CC08(shot); @@ -2207,7 +2209,7 @@ void func_beam_8003D54C(PlayerShot* shot, s32 index) { func_beam_8003C4D0(shot, 30); if (shot->bonus != 0) { if (gVersusMode) { - gPlayerScores[shot->playerNum] += shot->bonus; + gPlayerScores[shot->sourceId] += shot->bonus; } else { bonus = shot->bonus; if (shot->bonus > 10) { diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index 25238849..2b52d35d 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -78,10 +78,10 @@ UNK_TYPE F_80177DE8; s32 gGameFrameCount; s32 gObjectLoadIndex; s32 gPrevEventActorIndex; -s32 D_ctx_80177E78; +s32 gFormationLeaderIndex; s32 gRingPassCount; -Vec3f D_ctx_80177E88; -Vec3f D_ctx_80177F10; +Vec3f gFormationInitRot; +Vec3f gFormationInitPos; UNK_TYPE F_80178020; s32 D_ctx_8017812C; LevelId gCurrentLevel; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 21467000..8bc30a7c 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -401,7 +401,7 @@ void func_demo_80049968(Actor* actor, s32 arg1) { actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_demo_800C9FD0[arg1]; actor->obj.pos.y = D_demo_800C9FE0[arg1]; - actor->obj.pos.z = D_demo_800C9FF0[arg1] + ((void) 0, gPlayer)[0].trueZpos; + actor->obj.pos.z = D_demo_800C9FF0[arg1] + gPlayer[0].trueZpos; actor->fwork[0] = D_demo_800CA000[arg1]; actor->fwork[1] = D_demo_800CA010[arg1]; actor->unk_0B6 = D_demo_800CA030[arg1]; diff --git a/src/engine/fox_edata_info.c b/src/engine/fox_edata_info.c index 19a34307..fbff7caf 100644 --- a/src/engine/fox_edata_info.c +++ b/src/engine/fox_edata_info.c @@ -92,7 +92,7 @@ f32 gWarpZoneEvent93Hitbox[] = { }; // clang-format off -ObjectInfo D_edata_800CC124[0x190] = { +ObjectInfo gObjectInfo[] = { /* OBJ_SCENERY_0, */ {(void*) D_CO_6015F00, 0, (ObjectFunc) NULL, D_CO_603E3E0, 800.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_SCENERY_1, */ {(void*) D_CO_602E9E0, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_2, */ {(void*) D_CO_601BEC0, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 52da7fef..8be8cda3 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -98,7 +98,7 @@ void Actor202_Draw(Actor202* this) { Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, Actor202_PostLimbDraw, &this->index, &gIdentityMatrix); } -void MeteoTunnel_Draw(Scenery_39* this) { +void MeteoTunnel_Draw(MeteoTunnel* this) { gSPDisplayList(gMasterDisp++, D_ME_601AE40); } @@ -638,13 +638,13 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { case OBJ_ACTOR_TEAM_BOSS: case OBJ_ACTOR_EVENT: switch (gActors[index].unk_0B4) { - case EINFO_3: + case EVID_3: Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A010); break; - case EINFO_81: + case EVID_81: RCP_SetupDL(&gMasterDisp, 0x30); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 255); @@ -1001,14 +1001,14 @@ void Actor_DrawOnRails(Actor* this) { Zoness_80190F08(this); return; } - if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->unk_0B4 == EINFO_200)) { + if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->unk_0B4 == EVID_200)) { Actor194_Draw(this); } else { if (this->info.unk_19 != 0) { this->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&this->obj, this->info.drawType); this->obj.pos.y -= gCameraShakeY; - } else if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->unk_0B4 != EINFO_31)) { + } else if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->unk_0B4 != EVID_31)) { func_edisplay_8005D3CC(&this->obj, this->vwork[29].x, this->vwork[29].y, this->vwork[29].z + this->unk_0F4.z, this->info.drawType); } else { diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 0a721e0b..096b5f76 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -2407,14 +2407,11 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo effect->obj.rot.z = RAND_FLOAT(360.0f); effect->unk_4A = 180; effect->scale2 = 5.0f; - return; - } - - if ((objId == OBJ_EFFECT_355) || (objId == OBJ_EFFECT_377)) { + } else if ((objId == OBJ_EFFECT_355) || (objId == OBJ_EFFECT_377)) { AUDIO_PLAY_SFX(0x31000025, effect->sfxSource, 4); - return; + } else { + AUDIO_PLAY_SFX(0x29002002, effect->sfxSource, 4); } - AUDIO_PLAY_SFX(0x29002002, effect->sfxSource, 4); } void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { @@ -2464,14 +2461,11 @@ void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo effect->obj.rot.z = RAND_FLOAT(360.0f); effect->unk_4A = 180; effect->scale2 = 5.0f; - return; - } - - if ((objId == OBJ_EFFECT_355) || (objId == OBJ_EFFECT_377)) { + } else if ((objId == OBJ_EFFECT_355) || (objId == OBJ_EFFECT_377)) { AUDIO_PLAY_SFX(0x31000025, effect->sfxSource, 4); - return; + } else { + AUDIO_PLAY_SFX(0x29002002, effect->sfxSource, 4); } - AUDIO_PLAY_SFX(0x29002002, effect->sfxSource, 4); } void func_effect_8007EBB8(Effect* effect, ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, @@ -2825,13 +2819,13 @@ bool func_effect_8007FD84(Effect* effect) { (fabsf(actor->obj.pos.z - effect->obj.pos.z) < 100.0f) && (fabsf(actor->obj.pos.x - effect->obj.pos.x) < 100.0f) && (fabsf(actor->obj.pos.y - effect->obj.pos.y) < 100.0f)) { - actor->dmgType = 1; + actor->dmgType = DMG_BEAM; actor->dmgPart = 0; actor->damage = 10; if (effect->obj.id == OBJ_EFFECT_354) { actor->damage = 30; } - actor->dmgSource = 100; + actor->dmgSource = CS_SHOT_ID; return true; } } diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 1a9e13a8..c3f9c42b 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -72,7 +72,7 @@ u32 gWarpRingSfx[] = { 0x19404038, 0x19404139, 0x1940423A, 0x1940433B, 0x1940443C, 0x1940453D, 0x1940463E, 0x1940463E, 0x1940463E, }; -void func_enmy_80060F30(f32* pos, u32 sfxId, s32 arg2) { +void func_enmy_80060F30(f32* pos, u32 sfxId, s32 shotSource) { PRINTF("CHIME SET \n"); PRINTF("BOMB SET 1\n"); PRINTF("BOMB SET 2\n"); @@ -81,7 +81,7 @@ void func_enmy_80060F30(f32* pos, u32 sfxId, s32 arg2) { if (!gVersusMode) { AUDIO_PLAY_SFX(sfxId, gDefaultSfxSource, 4); } else { - AUDIO_PLAY_SFX(sfxId, pos, arg2); + AUDIO_PLAY_SFX(sfxId, pos, shotSource); } } @@ -132,8 +132,8 @@ bool func_enmy_80061148(Vec3f* arg0, f32 arg1) { } void Object_SetInfo(ObjectInfo* info, u32 objId) { - *info = D_edata_800CC124[objId]; - info->hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC124[objId].hitbox); + *info = gObjectInfo[objId]; + info->hitbox = SEGMENTED_TO_VIRTUAL(gObjectInfo[objId].hitbox); if (gLevelMode == LEVELMODE_UNK_2) { info->cullDistance += 200.0f; } @@ -384,7 +384,7 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) { actor->unk_0F4.z = objInit->rot.z; actor->obj.id = OBJ_ACTOR_EVENT; actor->timer_0C2 = 10; - actor->unk_0B4 = EINFO_FFF; + actor->unk_0B4 = EVID_FFF; actor->aiType = objInit->id - ACTOR_EVENT_ID; Object_SetInfo(&actor->info, actor->obj.id); @@ -393,14 +393,14 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) { actor->iwork[1] = gPrevEventActorIndex; actor->iwork[10] = gActors[gPrevEventActorIndex].aiType; actor->fwork[22] = gArwingSpeed; - Matrix_RotateZ(gCalcMatrix, -D_ctx_80177E88.z * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -D_ctx_80177E88.x * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -D_ctx_80177E88.y * M_DTOR, MTXF_APPLY); - sp24.x = actor->obj.pos.x - D_ctx_80177F10.x; - sp24.y = actor->obj.pos.y - D_ctx_80177F10.y; - sp24.z = actor->obj.pos.z - D_ctx_80177F10.z; + Matrix_RotateZ(gCalcMatrix, -gFormationInitRot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -gFormationInitRot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -gFormationInitRot.y * M_DTOR, MTXF_APPLY); + sp24.x = actor->obj.pos.x - gFormationInitPos.x; + sp24.y = actor->obj.pos.y - gFormationInitPos.y; + sp24.z = actor->obj.pos.z - gFormationInitPos.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp24, &actor->vwork[28]); - actor->iwork[9] = D_ctx_80177E78; + actor->iwork[9] = gFormationLeaderIndex; gPrevEventActorIndex = index; Actor_Update(actor); } @@ -902,7 +902,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } else if (actor->scale < 0.0f) { if (Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z)) { - actor->dmgType = 1; + actor->dmgType = DMG_BEAM; actor->damage = 10; actor->dmgPart = -1; actor->hitPos.x = pos->x; @@ -912,7 +912,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } } else if ((mode != 2) && (mode != 3)) { if (Object_CheckSingleHitbox(pos, actor->info.hitbox, &actor->obj.pos)) { - actor->dmgType = 1; + actor->dmgType = DMG_BEAM; actor->damage = 10; actor->dmgPart = -1; if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) || @@ -1547,9 +1547,9 @@ void func_enmy_800656D4(Actor* actor) { if ((fabsf(actor->fwork[27] - actor->obj.pos.x) < 60.0f) && (fabsf(actor->fwork[28] - actor->obj.pos.y) < 60.0f) && (fabsf(actor->fwork[29] - actor->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) { - gActors[spC4].dmgType = 1; + gActors[spC4].dmgType = DMG_BEAM; gActors[spC4].damage = 20; - gActors[spC4].dmgSource = 2; + gActors[spC4].dmgSource = DMG_SRC_2; func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); Object_Kill(&actor->obj, actor->sfxSource); @@ -1583,11 +1583,11 @@ void func_enmy_800656D4(Actor* actor) { sp8C.x = actor->vel.x; sp8C.y = actor->vel.y; sp8C.z = actor->vel.z; - if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->dmgType != 0) || + if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->dmgType != DMG_NONE) || (actor->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); Object_Kill(&actor->obj, actor->sfxSource); - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { actor->itemDrop = DROP_SILVER_RING_50p; if ((gCurrentLevel == LEVEL_CORNERIA)) { if (gLevelMode == LEVELMODE_ALL_RANGE) { @@ -1649,12 +1649,12 @@ void Actor_Despawn(Actor* actor) { s32 i; if (gVersusMode) { - if ((actor->dmgSource > 0) && (actor->dmgSource < 5) && + if ((actor->dmgSource >= 1) && (actor->dmgSource < 4 + 1) && !((D_versus_80178768[0] == 0) && (D_versus_80178768[1] == 0) && (D_versus_80178768[2] == 0))) { gPlayerScores[actor->dmgSource - 1] += actor->info.bonus; } } else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->unk_0B6 == 1))) { - if ((actor->dmgSource == 1) && (actor->info.bonus != 0)) { + if ((actor->dmgSource == AI360_FOX + 1) && (actor->info.bonus != 0)) { gHitCount += actor->info.bonus; D_ctx_80177850 = 15; if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) { @@ -1751,10 +1751,10 @@ void func_enmy_8006654C(Actor* actor) { break; } actor->scale = 0.8f; - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { actor->obj.status = OBJ_DYING; actor->vel.y = RAND_FLOAT(5.0f) + 6.0f; - if (actor->dmgType == 2) { + if (actor->dmgType == DMG_EXPLOSION) { actor->vel.y = -2.0f; } actor->vel.z = -15.0f; @@ -1798,7 +1798,7 @@ void func_enmy_800669A0(Actor* actor) { } } else { actor->obj.rot.y += 5.0f; - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 8.0f); func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); @@ -2003,8 +2003,8 @@ void ActorSupplies_Update(ActorSupplies* this) { Math_SmoothStepToF(&this->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f); } } - if (this->dmgType != 0) { - this->dmgType = 0; + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; this->health -= this->damage; if (this->health <= 0) { func_effect_8007A6F0(&this->obj.pos, 0x2903A008); @@ -2502,7 +2502,7 @@ void Actor_Move(Actor* actor) { var_fv0 = 4000.0f; if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) { + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_56))) { var_fv0 = 8000.0f; } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { var_fv0 = 100000.0f; @@ -2523,9 +2523,9 @@ void Actor_Move(Actor* actor) { gActor194Status[actor->unk_046] = 0; break; case OBJ_ACTOR_EVENT: - if ((actor->unk_0B4 >= EINFO_200) && (actor->unk_0B4 < EINFO_300)) { + if ((actor->unk_0B4 >= EVID_200) && (actor->unk_0B4 < EVID_300)) { gActor194Status[actor->unk_046] = 0; - } else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) { + } else if ((actor->unk_0B4 == EVID_38) && (actor->unk_046 != 2)) { gRingPassCount = -1; } break; diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index bc0401e3..7b7e6c47 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -209,9 +209,9 @@ void Actor202_Update(Actor202* this) { break; } - if (this->dmgType != 0) { + if (this->dmgType != DMG_NONE) { this->health -= 10; - if ((this->health <= 0) || (this->dmgType >= 2)) { + if ((this->health <= 0) || (this->dmgType >= DMG_EXPLOSION)) { func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 10.0f); func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, 8.0f, 30); @@ -220,7 +220,7 @@ void Actor202_Update(Actor202* this) { gHitCount += this->info.bonus; D_ctx_80177850 = 15; } else { - this->dmgType = 0; + this->dmgType = DMG_NONE; this->timer_0C6 = 20; AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); func_effect_8007D1E0(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 5.0f); @@ -478,13 +478,13 @@ void Actor196_Update(Actor196* this) { RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 0.5f); } - if ((this->dmgType != 0) && (this->unk_0B6 != 0)) { + if ((this->dmgType != DMG_NONE) && (this->unk_0B6 != 0)) { func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, this->vel.y, 0.0f, 3.0f, 5); Object_Kill(&this->obj, this->sfxSource); this->itemDrop = DROP_SILVER_RING; Actor_Despawn(this); } - this->dmgType = 0; + this->dmgType = DMG_NONE; } static f32 D_800D001C[5] = { 0.0f, 30.0f, 60.0f, -60.0f, -30.0f }; // could be in-function @@ -870,7 +870,7 @@ void func_enmy2_8006D0F4(Actor* this) { } } -void MeteoTunnel_Update(Scenery_39* this) { +void MeteoTunnel_Update(MeteoTunnel* this) { this->obj.rot.z += 1.0f; } @@ -886,9 +886,9 @@ typedef struct { /* 0x17 */ u8 info_unk_19; /* 0x18 */ f32 targetOffset; /* 0x1C */ u8 bonus; -} UnkStruct_D003C; // size = 0x20 +} EventActorInfo; // size = 0x20 -static UnkStruct_D003C D_800D003C[108] = { +static EventActorInfo sEventActorInfo[108] = { /* 0 */ { D_ENMY_PLANET_40068F0, gCubeHitbox100, 1.0f, 100.0f, 3000.0f, 1, 0, 1, 0, 1.0f, 1 }, /* 1 */ { D_ENMY_PLANET_4006E90, gCubeHitbox100, 1.0f, 100.0f, 3000.0f, 1, 0, 1, 0, 1.0f, 1 }, /* 2 */ { NULL, gCubeHitbox100, 1.0f, 20000.0f, 3000.0f, 1, 0, 2, 0, 0.0f, 0 }, @@ -1073,7 +1073,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { Audio_KillSfxBySource(this->sfxSource); this->unk_0B4 = actorScript[this->aiIndex + 1]; - if (this->unk_0B4 == EINFO_40) { + if (this->unk_0B4 == EVID_40) { this->timer_0C2 = 10000; } else { this->timer_0C2 = 0; @@ -1082,16 +1082,16 @@ void ActorEvent_ProcessScript(ActorEvent* this) { this->fwork[11] = 0.0f; this->fwork[12] = 0.0f; - if ((this->unk_0B4 == EINFO_64) || (this->unk_0B4 == EINFO_81)) { + if ((this->unk_0B4 == EVID_64) || (this->unk_0B4 == EVID_81)) { this->fwork[15] = 0.0f; - } else if (this->unk_0B4 == EINFO_79) { + } else if (this->unk_0B4 == EVID_79) { this->info.drawType = 2; } this->health = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; - if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) { + if ((this->unk_0B4 >= EVID_200) && (this->unk_0B4 < EVID_300)) { this->unk_046 = 100; this->info.hitbox = gCubeHitbox200; this->info.targetOffset = 1.0f; @@ -1104,7 +1104,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { gActor194yPos[i][j] = this->obj.pos.y; gActor194zPos[i][j] = this->obj.pos.z; } - if (this->unk_0B4 == EINFO_200) { + if (this->unk_0B4 == EVID_200) { AUDIO_PLAY_SFX(0x11032049, this->sfxSource, 4); } break; @@ -1116,52 +1116,52 @@ void ActorEvent_ProcessScript(ActorEvent* this) { } } - if ((this->unk_0B4 == EINFO_2) || (this->unk_0B4 == EINFO_43)) { + if ((this->unk_0B4 == EVID_2) || (this->unk_0B4 == EVID_43)) { this->unk_0C9 = 1; this->iwork[11] = 1; } - if (this->unk_0B4 == EINFO_81) { + if (this->unk_0B4 == EVID_81) { this->unk_0C9 = 1; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - if (this->unk_0B4 == EINFO_86) { + if (this->unk_0B4 == EVID_86) { Audio_PlayFanfare(SEQ_ID_KATT, 20, 10, 10); } - if (this->unk_0B4 == EINFO_85) { + if (this->unk_0B4 == EVID_85) { Audio_PlayFanfare(SEQ_ID_BILL, 20, 10, 10); } } - if (this->unk_0B4 == EINFO_103) { + if (this->unk_0B4 == EVID_103) { this->unk_0B6 = 0; } - if (this->unk_0B4 == EINFO_104) { + if (this->unk_0B4 == EVID_104) { this->unk_0B6 = Animation_GetFrameCount(&D_VE2_6014658) - 1; } - if (this->unk_0B4 < EINFO_200) { - this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[this->unk_0B4].hitbox); - this->scale = D_800D003C[this->unk_0B4].scale; - this->info.unk_16 = D_800D003C[this->unk_0B4].info_unk_16; - this->info.unk_14 = D_800D003C[this->unk_0B4].info_unk_14; - this->info.unk_19 = D_800D003C[this->unk_0B4].info_unk_19; - this->info.targetOffset = D_800D003C[this->unk_0B4].targetOffset; - this->info.bonus = D_800D003C[this->unk_0B4].bonus; + if (this->unk_0B4 < EVID_200) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(sEventActorInfo[this->unk_0B4].hitbox); + this->scale = sEventActorInfo[this->unk_0B4].scale; + this->info.unk_16 = sEventActorInfo[this->unk_0B4].info_unk_16; + this->info.unk_14 = sEventActorInfo[this->unk_0B4].info_unk_14; + this->info.unk_19 = sEventActorInfo[this->unk_0B4].info_unk_19; + this->info.targetOffset = sEventActorInfo[this->unk_0B4].targetOffset; + this->info.bonus = sEventActorInfo[this->unk_0B4].bonus; - if (this->unk_0B4 == EINFO_78) { + if (this->unk_0B4 == EVID_78) { this->info.damage = 0; } - this->info.cullDistance = D_800D003C[this->unk_0B4].cullDistance; - this->fwork[25] = D_800D003C[this->unk_0B4].unk_10; + this->info.cullDistance = sEventActorInfo[this->unk_0B4].cullDistance; + this->fwork[25] = sEventActorInfo[this->unk_0B4].unk_10; - switch (D_800D003C[this->unk_0B4].sfx) { + switch (sEventActorInfo[this->unk_0B4].sfx) { case 1: - if (!((gCurrentLevel == LEVEL_SOLAR) || (this->unk_0B4 == EINFO_6) || - ((gCurrentLevel == LEVEL_CORNERIA) && (this->unk_0B4 == EINFO_8)))) { + if (!((gCurrentLevel == LEVEL_SOLAR) || (this->unk_0B4 == EVID_6) || + ((gCurrentLevel == LEVEL_CORNERIA) && (this->unk_0B4 == EVID_8)))) { AUDIO_PLAY_SFX(0x31000011, this->sfxSource, 4); } break; @@ -1191,7 +1191,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { if (this->info.unk_16 == 0) { this->obj.rot.z = this->fwork[23] = this->unk_0F4.z; - if (this->unk_0B4 != EINFO_31) { + if (this->unk_0B4 != EVID_31) { this->unk_0F4.z = 0.0f; } } @@ -1217,14 +1217,14 @@ void ActorEvent_ProcessScript(ActorEvent* this) { ActorEvent_ProcessScript(this); break; - case EV_OPC(EVOP_SET_TO_IWORK_9): - D_ctx_80177E78 = this->index; - D_ctx_80177F10.x = this->obj.pos.x; - D_ctx_80177F10.y = this->obj.pos.y; - D_ctx_80177F10.z = this->obj.pos.z; - D_ctx_80177E88.x = this->obj.rot.x; - D_ctx_80177E88.y = this->obj.rot.y; - D_ctx_80177E88.z = this->obj.rot.z; + case EV_OPC(EVOP_SET_AS_LEADER): + gFormationLeaderIndex = this->index; + gFormationInitPos.x = this->obj.pos.x; + gFormationInitPos.y = this->obj.pos.y; + gFormationInitPos.z = this->obj.pos.z; + gFormationInitRot.x = this->obj.rot.x; + gFormationInitRot.y = this->obj.rot.y; + gFormationInitRot.z = this->obj.rot.z; this->aiIndex += 2; ActorEvent_ProcessScript(this); break; @@ -1250,7 +1250,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { this->timer_04C = 4; } - if (this->unk_048 == EVACT_13) { + if (this->unk_048 == EVACT_TI_DROP_MINE) { this->timer_0BE = 50; } @@ -1323,9 +1323,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) { case EV_OPC(EVOP_DAMAGE_TEAM): if (this->iwork[12] == actorScript[this->aiIndex + 1]) { - this->dmgType = 1; + this->dmgType = DMG_BEAM; this->damage = actorScript[this->aiIndex] & 0x1FF; - this->dmgSource = 100; + this->dmgSource = DMG_SRC_100; } else { gTeamDamage[actorScript[this->aiIndex + 1]] = actorScript[this->aiIndex] & 0x1FF; } @@ -1360,29 +1360,29 @@ void ActorEvent_ProcessScript(ActorEvent* this) { ActorEvent_ProcessScript(this); break; - case EV_OPC(EVOP_SET_STATE_6): - this->state = EVSTATE_6; + case EV_OPC(EVOP_PURSUE_PLAYER): + this->state = EVSTATE_PURSUE_PLAYER; this->timer_0BC = actorScript[this->aiIndex + 1]; this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; break; - case EV_OPC(EVOP_SET_STATE_7): - this->state = EVSTATE_7; + case EV_OPC(EVOP_FLEE_PLAYER): + this->state = EVSTATE_FLEE_PLAYER; this->timer_0BC = actorScript[this->aiIndex + 1]; this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; break; - case EV_OPC(EVOP_SET_STATE_8): - this->state = EVSTATE_8; + case EV_OPC(EVOP_PURSUE_TARGET): + this->state = EVSTATE_PURSUE_TARGET; this->timer_0BC = actorScript[this->aiIndex + 1]; this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; break; - case EV_OPC(EVOP_SET_STATE_9): - this->state = EVSTATE_9; + case EV_OPC(EVOP_FLEE_TARGET): + this->state = EVSTATE_FLEE_TARGET; this->timer_0BC = actorScript[this->aiIndex + 1]; this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; @@ -1403,15 +1403,15 @@ void ActorEvent_ProcessScript(ActorEvent* this) { this->aiIndex += 2; break; - case EV_OPC(EVOP_SET_STATE_14): - this->state = EVSTATE_14; + case EV_OPC(EVOP_PURSUE_CAMERA): + this->state = EVSTATE_PURSUE_CAMERA; this->timer_0BC = actorScript[this->aiIndex + 1]; this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; break; - case EV_OPC(EVOP_SET_STATE_15): - this->state = EVSTATE_15; + case EV_OPC(EVOP_FLEE_CAMERA): + this->state = EVSTATE_FLEE_CAMERA; this->timer_0BC = actorScript[this->aiIndex + 1]; this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; @@ -1468,14 +1468,14 @@ void ActorEvent_ProcessScript(ActorEvent* this) { this->aiIndex += 2; break; - case EV_OPC(EVOP_SET_IWORK_13): + case EV_OPC(EVOP_START_FORMATION): this->timer_0C0 = actorScript[this->aiIndex + 1]; this->iwork[13] = 1; this->aiIndex += 2; ActorEvent_ProcessScript(this); break; - case EV_OPC(EVOP_CLEAR_IWORK_13): + case EV_OPC(EVOP_STOP_FORMATION): this->iwork[13] = 0; this->aiIndex += 2; ActorEvent_ProcessScript(this); @@ -1604,7 +1604,7 @@ void ActorEvent_8006EB64(f32 xPos, f32 yPos, f32 zPos) { } } -void ActorEvent_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_SetupTIMine(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_225; @@ -1618,19 +1618,19 @@ void ActorEvent_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { AUDIO_PLAY_SFX(0x2900201D, actor->sfxSource, 4); } -void ActorEvent_8006EC60(f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_SpawnTIMine(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.status == OBJ_FREE) { - ActorEvent_8006EBC0(&gActors[i], xPos, yPos, zPos); + ActorEvent_SetupTIMine(&gActors[i], xPos, yPos, zPos); break; } } } -void func_enmy2_8006ECBC(PlayerShotId objId, PlayerShot* shot, s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 xVel, - f32 yVel, f32 zVel, f32 xRot, f32 yRot, f32 zRot) { +void Actor_SetupPlayerShot(PlayerShotId objId, PlayerShot* shot, s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, + f32 yVel, f32 zVel, f32 xRot, f32 yRot, f32 zRot) { PlayerShot_Initialize(shot); shot->obj.status = 1; @@ -1655,46 +1655,46 @@ void func_enmy2_8006ECBC(PlayerShotId objId, PlayerShot* shot, s32 unk0E4, f32 x } else { shot->unk_64 = 30; } - shot->playerNum = unk0E4 + 100; + shot->sourceId = actorId + NPC_SHOT_ID; if (gLevelMode == LEVELMODE_ALL_RANGE) { - if (unk0E4 + 100 <= AI360_PEPPY + 100) { + if (actorId + NPC_SHOT_ID <= AI360_PEPPY + NPC_SHOT_ID) { AUDIO_PLAY_SFX(0x2900000D, shot->sfxSource, 4); } else { AUDIO_PLAY_SFX(0x29002002, shot->sfxSource, 4); } - } else if ((unk0E4 < 60) && (gActors[unk0E4].obj.id == OBJ_ACTOR_EVENT) && - (gActors[unk0E4].iwork[12] >= TEAM_ID_FALCO)) { + } else if ((actorId < ARRAY_COUNT(gActors)) && (gActors[actorId].obj.id == OBJ_ACTOR_EVENT) && + (gActors[actorId].iwork[12] >= TEAM_ID_FALCO)) { AUDIO_PLAY_SFX(0x2900000D, shot->sfxSource, 4); - } else if (unk0E4 + 100 == 200) { - shot->playerNum = 100; + } else if (actorId + NPC_SHOT_ID == CS_SHOT_ID + NPC_SHOT_ID) { + shot->sourceId = CS_SHOT_ID; AUDIO_PLAY_SFX(0x19030037, shot->sfxSource, 0); } else { AUDIO_PLAY_SFX(0x29002002, shot->sfxSource, 4); } } -void func_enmy2_8006EEFC(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, - f32 zRot) { +void Actor_SpawnPlayerLaser(s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, + f32 zRot) { s32 i; for (i = 0; i < 10; i++) { if (gPlayerShots[i].obj.status == 0) { - func_enmy2_8006ECBC(PLAYERSHOT_1, &gPlayerShots[i], unk0E4, xPos, yPos, zPos, xVel, yVel, zVel, xRot, yRot, - zRot); + Actor_SetupPlayerShot(PLAYERSHOT_1, &gPlayerShots[i], actorId, xPos, yPos, zPos, xVel, yVel, zVel, xRot, + yRot, zRot); break; } } } -void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, - f32 zRot) { +void Actor_SpawnGreatFoxLaser(s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, + f32 yRot, f32 zRot) { s32 i; for (i = 0; i < 10; i++) { if (gPlayerShots[i].obj.status == 0) { - func_enmy2_8006ECBC(PLAYERSHOT_9, &gPlayerShots[i], unk0E4, xPos, yPos, zPos, xVel, yVel, zVel, xRot, yRot, - zRot); + Actor_SetupPlayerShot(PLAYERSHOT_9, &gPlayerShots[i], actorId, xPos, yPos, zPos, xVel, yVel, zVel, xRot, + yRot, zRot); break; } } @@ -1776,24 +1776,24 @@ void ActorEvent_8006F254(ActorEvent* this) { } void ActorEvent_ProcessActions(ActorEvent* this) { - s32 var_v1; + s32 i; Vec3f sp78; Vec3f sp6C; Sprite* sprite; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->unk_0B4 != EINFO_52) && - (this->unk_0B4 != EINFO_103) && (this->unk_0B4 != EINFO_104) && (this->unk_0B4 != EINFO_48) && - (this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->unk_0B4 != EVID_52) && (this->unk_0B4 != EVID_103) && + (this->unk_0B4 != EVID_104) && (this->unk_0B4 != EVID_48) && (this->unk_0B4 != EVID_49) && + (this->unk_0B4 != EVID_50)) { switch (this->unk_048) { case EVACT_NONE: break; - case EVACT_1: + case EVACT_1: // shoot forward ActorEvent_8006F254(this); this->unk_048 = EVACT_NONE; break; - case EVACT_2: + case EVACT_2: // shoot at player if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); @@ -1801,16 +1801,17 @@ void ActorEvent_ProcessActions(ActorEvent* this) { this->unk_048 = EVACT_NONE; break; - case EVACT_3: + case EVACT_3: // ally shoots forward if (this->timer_0BE == 0) { this->timer_0BE = 6; sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_enmy2_8006EEFC(this->index, this->obj.pos.x + (sp6C.x * 1.5), this->obj.pos.y + (sp6C.y * 1.5), - this->obj.pos.z + (sp6C.z * 1.5), sp6C.x, sp6C.y, sp6C.z, this->unk_0F4.x, - this->unk_0F4.y, this->vwork[29].z + this->unk_0F4.z); + Actor_SpawnPlayerLaser(this->index, this->obj.pos.x + (sp6C.x * 1.5), + this->obj.pos.y + (sp6C.y * 1.5), this->obj.pos.z + (sp6C.z * 1.5), sp6C.x, + sp6C.y, sp6C.z, this->unk_0F4.x, this->unk_0F4.y, + this->vwork[29].z + this->unk_0F4.z); this->timer_0C2 = 2; this->timer_04C--; if (this->timer_04C <= 0) { @@ -1819,7 +1820,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { } break; - case EVACT_4: + case EVACT_4: // shoot blue energy balls ActorEvent_8006EB64(this->obj.pos.x, this->obj.pos.y - 20.0f, this->obj.pos.z); this->unk_048 = EVACT_NONE; break; @@ -1901,7 +1902,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { Object_Kill(&this->obj, this->sfxSource); break; - case EVACT_13: + case EVACT_TI_DROP_MINE: if (this->timer_0BE > 25) { Math_SmoothStepToF(&this->fwork[15], 90.0f, 0.2f, 8.0f, 0.01f); } @@ -1909,7 +1910,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { Math_SmoothStepToF(&this->fwork[15], 0.0f, 0.2f, 8.0f, 0.01f); } if (this->timer_0BE == 30) { - ActorEvent_8006EC60(this->obj.pos.x, this->obj.pos.y - 50.0f, this->obj.pos.z); + ActorEvent_SpawnTIMine(this->obj.pos.x, this->obj.pos.y - 50.0f, this->obj.pos.z); } if (this->timer_0BE == 0) { this->unk_048 = EVACT_NONE; @@ -1933,8 +1934,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_GFOX_COVER_FIRE: - for (var_v1 = 0, sprite = gSprites; var_v1 < 40; var_v1++, sprite++) { - + for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++, sprite++) { if ((sprite->obj.status == OBJ_ACTIVE) && (sprite->obj.id == OBJ_SPRITE_GFOX_TARGET)) { f32 sp64; f32 sp60; @@ -1956,8 +1956,8 @@ void ActorEvent_ProcessActions(ActorEvent* this) { sp6C.y = 0.0f; sp6C.z = 50.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp78); - func_enmy2_8006EFA0(100, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, sp78.x, sp78.y, - sp78.z, sp58, sp54, 0.0f); + Actor_SpawnGreatFoxLaser(CS_SHOT_ID, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, sp78.x, + sp78.y, sp78.z, sp58, sp54, 0.0f); break; } } @@ -1965,7 +1965,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { this->unk_048 = EVACT_NONE; break; - case EVACT_19: + case EVACT_19: // projectile ring used by bee enemies func_effect_80083D2C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); this->unk_048 = EVACT_NONE; break; @@ -1985,8 +1985,8 @@ void ActorEvent_8006FE28(ActorEvent* this) { void ActorEvent_8006FEEC(ActorEvent* this) { s32 i; - if ((this->dmgType != 0) && (this->health != 0)) { - this->dmgType = 0; + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; this->timer_0C6 = 15; this->health -= this->damage; @@ -2029,7 +2029,7 @@ bool ActorEvent_800700A4(ActorEvent* this) { gTeamShields[this->iwork[12]] = -1; gTeamDamage[this->iwork[12]] = 0; this->timer_0C2 = 5000; - this->dmgType = 0; + this->dmgType = DMG_NONE; return true; } return false; @@ -2043,38 +2043,38 @@ void ActorEvent_800701E0(ActorEvent* this) { if (ActorEvent_800700A4(this)) { return; } - if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_67) && (this->dmgPart == 0)) { - this->dmgType = 0; + if ((this->dmgType != DMG_NONE) && (this->unk_0B4 == EVID_67) && (this->dmgPart == 0)) { + this->dmgType = DMG_NONE; } - if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) { - this->dmgType = 0; + if ((this->dmgType != DMG_NONE) && (this->unk_0B4 == EVID_83) && (this->timer_0C2 >= 2)) { + this->dmgType = DMG_NONE; } - if ((this->dmgType != 0) && - (((this->unk_0B4 == EINFO_64) && (this->dmgPart == 2)) || (this->unk_0B4 != EINFO_64))) { + if ((this->dmgType != DMG_NONE) && + (((this->unk_0B4 == EVID_64) && (this->dmgPart == 2)) || (this->unk_0B4 != EVID_64))) { if (this->iwork[12] >= TEAM_ID_KATT) { this->damage = 0; } if ((this->iwork[12] >= TEAM_ID_FALCO) && (this->iwork[12] <= TEAM_ID_PEPPY)) { gTeamShields[this->iwork[12]] -= this->damage; - } else if ((this->unk_0B4 == EINFO_83) && ((this->damage == 30) || (this->damage == 31))) { + } else if ((this->unk_0B4 == EVID_83) && ((this->damage == 30) || (this->damage == 31))) { this->health = 0; } else { this->health -= this->damage; } if (this->health <= 0) { - if (this->unk_0B4 == EINFO_106) { + if (this->unk_0B4 == EVID_106) { BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3); if (1) {} gHitCount += 4; D_ctx_80177850 = 15; } - if (this->unk_0B4 != EINFO_83) { - if ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR)) { + if (this->unk_0B4 != EVID_83) { + if ((this->unk_0B4 == EVID_6) && (gCurrentLevel == LEVEL_SOLAR)) { AUDIO_PLAY_SFX(0x29018036, this->sfxSource, 4); } else { AUDIO_PLAY_SFX(0x2903700B, this->sfxSource, 4); @@ -2088,11 +2088,11 @@ void ActorEvent_800701E0(ActorEvent* this) { } if (((Rand_ZeroOne() < chance) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) && - (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) && - (this->damage <= 30) && (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_64) && - (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_68)) { + (this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_14) && (this->unk_0B4 != EVID_61) && + (this->damage <= 30) && (this->unk_0B4 != EVID_62) && (this->unk_0B4 != EVID_64) && + (this->unk_0B4 != EVID_72) && (this->unk_0B4 != EVID_68)) { func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 4.0f); - this->dmgType = 0; + this->dmgType = DMG_NONE; } this->timer_0C2 = 10; @@ -2103,7 +2103,7 @@ void ActorEvent_800701E0(ActorEvent* this) { if (gLevelType == LEVELTYPE_PLANET) { this->timer_04C = RAND_INT(2.9f); - if (this->unk_0B4 == EINFO_2) { + if (this->unk_0B4 == EVID_2) { this->timer_04C = 1; if (this->obj.pos.x < this->hitPos.x) { func_play_800A69F8(1, this->obj.pos.x + 20.0f, this->obj.pos.y, this->obj.pos.z); @@ -2128,25 +2128,25 @@ void ActorEvent_800701E0(ActorEvent* this) { } } - if (this->unk_0B4 == EINFO_90) { + if (this->unk_0B4 == EVID_90) { this->timer_04C = 999; } } else { switch (this->unk_0B4) { - case EINFO_13: + case EVID_13: func_enmy_800654E4(&this->obj); break; - case EINFO_61: + case EVID_61: Meteo_8018CCF8(this); break; - case EINFO_27: + case EVID_27: this->obj.pos.y -= this->vel.y; this->obj.status = OBJ_ACTIVE; func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f, this->obj.pos.z - this->vel.z, this->scale * 5.0f); - this->dmgType = 0; + this->dmgType = DMG_NONE; this->timer_0C2 = 10000; this->info.targetOffset = 0.0f; gHitCount += this->info.bonus; @@ -2164,14 +2164,14 @@ void ActorEvent_800701E0(ActorEvent* this) { } } - if (this->unk_0B4 == EINFO_82) { + if (this->unk_0B4 == EVID_82) { AUDIO_PLAY_SFX(0x11000055, this->sfxSource, 0); - this->dmgType = 1; + this->dmgType = DMG_BEAM; func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60); } } else { this->timer_0C6 = 20; - if ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR)) { + if ((this->unk_0B4 == EVID_6) && (gCurrentLevel == LEVEL_SOLAR)) { AUDIO_PLAY_SFX(0x29033037, this->sfxSource, 4); } else if (this->health < 20) { AUDIO_PLAY_SFX(0x2943500F, this->sfxSource, 4); @@ -2179,22 +2179,22 @@ void ActorEvent_800701E0(ActorEvent* this) { AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); } - if ((this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_61) && (this->unk_0B4 != EINFO_83)) { + if ((this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_61) && (this->unk_0B4 != EVID_83)) { func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 1.5f); } if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && - (this->unk_0B4 != EINFO_21) && (this->unk_0B4 != EINFO_23)) { + (this->unk_0B4 != EVID_21) && (this->unk_0B4 != EVID_23)) { this->fwork[13] = 20.0f; if (this->obj.pos.x < this->hitPos.x) { this->fwork[13] *= -1.0f; } } - if (this->dmgSource == 1) { + if (this->dmgSource == TEAM_ID_FOX + 1) { switch (this->iwork[12]) { case TEAM_ID_FALCO: - if (this->dmgType == 3) { + if (this->dmgType == DMG_COLLISION) { ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO); } else { ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO); @@ -2202,7 +2202,7 @@ void ActorEvent_800701E0(ActorEvent* this) { break; case TEAM_ID_PEPPY: - if (this->dmgType == 3) { + if (this->dmgType == DMG_COLLISION) { ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY); } else { ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY); @@ -2210,7 +2210,7 @@ void ActorEvent_800701E0(ActorEvent* this) { break; case TEAM_ID_SLIPPY: - if (this->dmgType == 3) { + if (this->dmgType == DMG_COLLISION) { ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY); } else { ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY); @@ -2226,7 +2226,7 @@ void ActorEvent_800701E0(ActorEvent* this) { break; } } - this->dmgType = 0; + this->dmgType = DMG_NONE; } } if ((this->iwork[12] == 0) && (this->iwork[13] == 0) && (this->info.unk_16 != 2) && @@ -2239,13 +2239,13 @@ void ActorEvent_800701E0(ActorEvent* this) { (this->obj.pos.y < (gGroundHeight + 20.0f))) { this->obj.status = OBJ_DYING; this->obj.pos.z -= this->vel.z; - this->dmgType = 1; - if (this->unk_0B4 == EINFO_13) { + this->dmgType = DMG_BEAM; + if (this->unk_0B4 == EVID_13) { this->obj.id = OBJ_ACTOR_182; func_enmy_800654E4(&this->obj); } - if (this->unk_0B4 == EINFO_61) { + if (this->unk_0B4 == EVID_61) { Meteo_8018CCF8(this); } } @@ -2253,9 +2253,9 @@ void ActorEvent_800701E0(ActorEvent* this) { } void ActorEvent_80070BA8(ActorEvent* this) { - if (this->dmgType != 0) { - this->dmgType = 0; - if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->dmgPart == 0))) { + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if ((this->unk_0B4 != EVID_17) || ((this->unk_0B4 == EVID_17) && (this->dmgPart == 0))) { this->timer_0C6 = 10; func_effect_8007C120(this->hitPos.x, this->hitPos.y, this->hitPos.z, this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); @@ -2310,7 +2310,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { case EVC_NONE: break; - case EVC_1: + case EVC_NO_TARGET: if ((gActors[this->iwork[1]].obj.status != OBJ_ACTIVE) || (gActors[this->iwork[1]].health <= 0) || (this->iwork[10] != gActors[this->iwork[1]].aiType)) { ActorEvent_TriggerBranch(this); @@ -2563,14 +2563,14 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { } break; - case EVC_41: + case EVC_NO_LEADER: if ((gActors[this->iwork[9]].obj.status != OBJ_ACTIVE) || ((gActors[this->iwork[9]].scale < 0.0f) && (this->health <= 0))) { ActorEvent_TriggerBranch(this); } break; - case EVC_42: + case EVC_NO_FOLLOWER: for (i = 0; i < ARRAY_COUNT(gActors); i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT) && (gActors[i].iwork[13] != 0) && (i != this->index) && (this->index == gActors[i].iwork[9])) { @@ -2580,7 +2580,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { ActorEvent_TriggerBranch(this); break; - case EVC_43: + case EVC_HAS_FOLLOWER: for (i = 0; i < ARRAY_COUNT(gActors); i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT) && (gActors[i].iwork[13] != 0) && (i != this->index) && (this->index == gActors[i].iwork[9])) { @@ -2591,7 +2591,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { break; case EVC_TOOK_DAMAGE: - if (this->dmgType != 0) { + if (this->dmgType != DMG_NONE) { ActorEvent_TriggerBranch(this); } break; @@ -2615,7 +2615,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { } break; - case EVC_46: + case EVC_ATTACK_GROUP_CLEARED: for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { if (((otherActor->obj.status == OBJ_DYING) || (otherActor->obj.status == OBJ_FREE)) && (otherActor->iwork[15] == this->iwork[15]) && (otherActor->iwork[16] != 0)) { @@ -2717,13 +2717,13 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { } break; - case EVC_62: + case EVC_NOT_CHASED: if (D_enmy_Timer_80161670[this->iwork[12]] == 0) { ActorEvent_TriggerBranch(this); } break; - case EVC_63: + case EVC_CHASED: if (D_enmy_Timer_80161670[this->iwork[12]] != 0) { ActorEvent_TriggerBranch(this); } @@ -2804,17 +2804,17 @@ void ActorEvent_80071DC0(ActorEvent* this) { Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); - if (this->unk_0B4 == EINFO_30) { + if (this->unk_0B4 == EVID_30) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1074) - 1.1f); // off by 1 error? Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1074[rInd], &sp38); } - if (this->unk_0B4 == EINFO_17) { + if (this->unk_0B4 == EVID_17) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D0DD4) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D0DD4[rInd], &sp38); } - if (this->unk_0B4 == EINFO_31) { + if (this->unk_0B4 == EVID_31) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1194) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1194[rInd], &sp38); } @@ -2846,12 +2846,13 @@ void ActorEvent_80071DC0(ActorEvent* this) { void ActorEvent_800720E8(ActorEvent* this) { switch (this->unk_046) { case 0: - if (this->dmgType != 0) { - if (this->dmgType == 2) { + if (this->dmgType != DMG_NONE) { + if (this->dmgType == DMG_EXPLOSION) { this->damage = 3; } - if ((this->dmgSource >= 101) && (gActors[this->dmgSource - 101].unk_0B4 == EINFO_85)) { + if ((this->dmgSource >= NPC_SHOT_ID + 1) && + (gActors[this->dmgSource - NPC_SHOT_ID - 1].unk_0B4 == EVID_85)) { this->damage = 20; } @@ -2870,7 +2871,7 @@ void ActorEvent_800720E8(ActorEvent* this) { } else { AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0); } - this->dmgType = 0; + this->dmgType = DMG_NONE; } break; @@ -2986,15 +2987,15 @@ void ActorEvent_Update(ActorEvent* this) { } return; } - if (((this->unk_0B4 == EINFO_17) || (this->unk_0B4 == EINFO_30) || (this->unk_0B4 == EINFO_31)) && + if (((this->unk_0B4 == EVID_17) || (this->unk_0B4 == EVID_30) || (this->unk_0B4 == EVID_31)) && (this->health <= 0)) { ActorEvent_80071DC0(this); return; } - if (this->unk_0B4 == EINFO_300) { + if (this->unk_0B4 == EVID_300) { gPlayer[0].unk_1A4 = this->index; this->timer_0C2 = 100; - } else if (this->unk_0B4 >= EINFO_200) { + } else if (this->unk_0B4 >= EVID_200) { this->unk_04E++; if (this->unk_04E >= 100) { @@ -3008,8 +3009,8 @@ void ActorEvent_Update(ActorEvent* this) { gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y; gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z; - if (this->dmgType != 0) { - this->dmgType = 0; + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; this->timer_0C6 = 20; this->health -= this->damage; @@ -3026,7 +3027,7 @@ void ActorEvent_Update(ActorEvent* this) { } } - if ((this->unk_0B4 == EINFO_27) && (this->timer_0C2 != 0)) { + if ((this->unk_0B4 == EVID_27) && (this->timer_0C2 != 0)) { this->state = EVSTATE_READY; } @@ -3041,20 +3042,20 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EVSTATE_6: - case EVSTATE_7: - case EVSTATE_14: - case EVSTATE_15: + case EVSTATE_PURSUE_PLAYER: + case EVSTATE_FLEE_PLAYER: + case EVSTATE_PURSUE_CAMERA: + case EVSTATE_FLEE_CAMERA: spF0 = this->obj.pos.x; spEC = this->obj.pos.y; spE8 = this->obj.pos.z; - if ((this->unk_0B4 == EINFO_33) || (this->unk_0B4 == EINFO_68)) { + if ((this->unk_0B4 == EVID_33) || (this->unk_0B4 == EVID_68)) { Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, MTXF_APPLY); - if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { + if ((this->state == EVSTATE_PURSUE_CAMERA) || (this->state == EVSTATE_FLEE_CAMERA)) { spB8.x = gPlayer[0].cam.eye.x - spF0; spB8.y = gPlayer[0].cam.eye.y - (spEC + 25.0f); spB8.z = (gPlayer[0].cam.eye.z * 15.0f) - spE8; @@ -3104,7 +3105,7 @@ void ActorEvent_Update(ActorEvent* this) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - if (this->unk_0B4 == EINFO_68) { + if (this->unk_0B4 == EVID_68) { var_fv0 = 80.0f; } else { var_fv0 = 0.0f; @@ -3118,7 +3119,7 @@ void ActorEvent_Update(ActorEvent* this) { this->fwork[16] = -15.0f; } } else { - if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { + if ((this->state == EVSTATE_PURSUE_CAMERA) || (this->state == EVSTATE_FLEE_CAMERA)) { spCC = gPlayer[0].cam.eye.x; spC8 = gPlayer[0].cam.eye.y; spC4 = gPlayer[0].cam.eye.z; @@ -3133,7 +3134,7 @@ void ActorEvent_Update(ActorEvent* this) { spE0 = Math_RadToDeg(Math_Atan2F(spCC - spF0, spC4 - spE8)); - if ((this->state == EVSTATE_7) || (this->state == EVSTATE_15)) { + if ((this->state == EVSTATE_FLEE_PLAYER) || (this->state == EVSTATE_FLEE_CAMERA)) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; @@ -3166,15 +3167,15 @@ void ActorEvent_Update(ActorEvent* this) { index = gActors[index].iwork[12]; D_enmy_Timer_80161670[index] = 5; /* fallthrough */ - case EVSTATE_8: - case EVSTATE_9: + case EVSTATE_PURSUE_TARGET: + case EVSTATE_FLEE_TARGET: spF0 = this->obj.pos.x; spEC = this->obj.pos.y; spE8 = this->obj.pos.z; spE0 = Math_RadToDeg(Math_Atan2F(gActors[this->iwork[1]].obj.pos.x + spDC - spF0, gActors[this->iwork[1]].obj.pos.z + spD4 - spE8)); - if (this->state == EVSTATE_7) { + if (this->state == EVSTATE_FLEE_PLAYER) { // bug? should be EVSTATE_FLEE_TARGET? spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; @@ -3306,7 +3307,7 @@ void ActorEvent_Update(ActorEvent* this) { } if (this->iwork[6] != 0) { - if ((gLevelMode == LEVELMODE_UNK_2) && (this->unk_0B4 == EINFO_200)) { + if ((gLevelMode == LEVELMODE_UNK_2) && (this->unk_0B4 == EVID_200)) { Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.1f, 10.0f, 0.00001f); Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.1f, 10.0f, 0.00001f); } else { @@ -3338,10 +3339,10 @@ void ActorEvent_Update(ActorEvent* this) { } if (this->fwork[10] > 0.0f) { - if ((this->unk_0B4 == EINFO_13) || (this->unk_0B4 == EINFO_14) || (this->unk_0B4 == EINFO_61) || - (this->unk_0B4 == EINFO_62) || (this->unk_0B4 == EINFO_63) || (this->unk_0B4 == EINFO_64) || - (this->unk_0B4 == EINFO_65) || (this->unk_0B4 == EINFO_66) || (this->unk_0B4 == EINFO_94) || - (this->unk_0B4 == EINFO_95) || (this->unk_0B4 == EINFO_97)) { + if ((this->unk_0B4 == EVID_13) || (this->unk_0B4 == EVID_14) || (this->unk_0B4 == EVID_61) || + (this->unk_0B4 == EVID_62) || (this->unk_0B4 == EVID_63) || (this->unk_0B4 == EVID_64) || + (this->unk_0B4 == EVID_65) || (this->unk_0B4 == EVID_66) || (this->unk_0B4 == EVID_94) || + (this->unk_0B4 == EVID_95) || (this->unk_0B4 == EVID_97)) { this->obj.rot.y -= this->fwork[11] * this->fwork[12]; this->obj.rot.x += this->fwork[11] * this->fwork[12]; } else { @@ -3394,15 +3395,15 @@ void ActorEvent_Update(ActorEvent* this) { ActorEvent_ProcessActions(this); ActorEvent_UpdateTexLines(this); - if (this->unk_0B4 == EINFO_38) { + if (this->unk_0B4 == EVID_38) { ActorEvent_800720E8(this); } else { if (this->scale <= -1.999f) { ActorEvent_80070BA8(this); } else { - if ((this->dmgType == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) && - (this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) { - this->dmgType = 0; + if ((this->dmgType == DMG_BEAM) && (this->scale < 0.5f) && (this->unk_0B4 != EVID_48) && + (this->unk_0B4 != EVID_49) && (this->unk_0B4 != EVID_50)) { + this->dmgType = DMG_NONE; if (gCurrentLevel == LEVEL_METEO) { AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4); } else { @@ -3410,12 +3411,12 @@ void ActorEvent_Update(ActorEvent* this) { } } - if ((this->unk_0B4 < EINFO_200) && (this->unk_0B4 != EINFO_78) && (this->scale >= 0.5f)) { + if ((this->unk_0B4 < EVID_200) && (this->unk_0B4 != EVID_78) && (this->scale >= 0.5f)) { switch (this->unk_0B4) { - case EINFO_71: + case EVID_71: ActorEvent_8006FE28(this); break; - case EINFO_79: + case EVID_79: ActorEvent_8006FEEC(this); break; default: @@ -3426,11 +3427,11 @@ void ActorEvent_Update(ActorEvent* this) { } } switch (this->unk_0B4) { - case EINFO_92: - case EINFO_93: - case EINFO_94: - case EINFO_95: - case EINFO_96: + case EVID_92: + case EVID_93: + case EVID_94: + case EVID_95: + case EVID_96: if (((gGameFrameCount % 8) == 0)) { this->fwork[18] = RAND_FLOAT(255.0f); this->fwork[19] = RAND_FLOAT(255.0f); @@ -3441,7 +3442,7 @@ void ActorEvent_Update(ActorEvent* this) { Math_SmoothStepToF(&this->fwork[17], this->fwork[20], 1.0f, 10.0f, 0.0f); break; - case EINFO_46: + case EVID_46: if (func_play_800A73E4(&spEC, &spFC, this->obj.pos.x, -100.0f, this->obj.pos.z)) { spF0 = 10.0f; @@ -3466,21 +3467,21 @@ void ActorEvent_Update(ActorEvent* this) { this->obj.rot.y = this->unk_0F4.y; break; - case EINFO_31: + case EVID_31: this->obj.rot.z = gGameFrameCount; break; - case EINFO_21: - case EINFO_22: + case EVID_21: + case EVID_22: this->obj.rot.z = gGameFrameCount * 3.0f; break; - case EINFO_3: + case EVID_3: this->unk_0C9 = 1; this->obj.rot.y -= 10.0f; break; - case EINFO_6: + case EVID_6: this->unk_0B6++; if (gCurrentLevel == LEVEL_SOLAR) { if (this->unk_0B6 >= Animation_GetFrameCount(&D_SO_600636C)) { @@ -3495,7 +3496,7 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EINFO_9: + case EVID_9: this->unk_0B6++; if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { this->unk_0B6 = 0; @@ -3505,21 +3506,21 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EINFO_48: - case EINFO_49: - case EINFO_50: + case EVID_48: + case EVID_49: + case EVID_50: SectorY_Actor204_Update(this); break; - case EINFO_52: + case EVID_52: ActorEvent_80072474(this); break; - case EINFO_78: + case EVID_78: ActorSupplies_Update(this); break; - case EINFO_79: + case EVID_79: if (this->timer_0C4 == 0) { this->unk_0B6 += 1; if (Animation_GetFrameCount(&D_ZO_600E5EC) < this->unk_0B6) { @@ -3528,7 +3529,7 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EINFO_80: { + case EVID_80: { Effect* effect; Vec3f sp90; Vec3f sp84; @@ -3635,7 +3636,7 @@ void ActorEvent_Update(ActorEvent* this) { } } break; - case EINFO_81: + case EVID_81: Math_SmoothStepToF(&this->fwork[15], 1.0f, 0.1f, 0.1f, 0.001f); if (this->fwork[15] > 0.5f) { @@ -3657,7 +3658,7 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EINFO_83: + case EVID_83: if (this->health <= 0) { if (this->unk_0B6 == 20) { spD4 = this->obj.pos.z; @@ -3689,7 +3690,7 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EINFO_88: + case EVID_88: if (this->unk_04A == 0) { this->unk_046 += 4; if (this->unk_046 >= 255) { @@ -3705,12 +3706,12 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EINFO_103: - case EINFO_104: + case EVID_103: + case EVID_104: Andross_80187530(this); break; - case EINFO_106: + case EVID_106: this->unk_0B6++; if (this->unk_0B6 >= 6) { this->unk_0B6 = 0; @@ -3803,18 +3804,18 @@ void ActorEvent_Draw(ActorEvent* this) { s16 temp_s0; s32 pad; - if (this->timer_0C6 && (this->unk_0B4 != EINFO_90) && (this->unk_0B4 != EINFO_68) && (this->unk_0B4 != EINFO_72)) { - if ((this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) && - (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_83) && (this->unk_0B4 != EINFO_98) && + if (this->timer_0C6 && (this->unk_0B4 != EVID_90) && (this->unk_0B4 != EVID_68) && (this->unk_0B4 != EVID_72)) { + if ((this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_14) && (this->unk_0B4 != EVID_61) && + (this->unk_0B4 != EVID_62) && (this->unk_0B4 != EVID_83) && (this->unk_0B4 != EVID_98) && (this->scale > 0.5f) && (this->timer_0C6 >= 9) && ((this->timer_0C6 & 3) == 0) && (gPlayState != PLAY_PAUSE)) { func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, this->scale * 0.07f, 3); } - if ((this->unk_0B4 != EINFO_21) && (this->unk_0B4 != EINFO_23) && (this->unk_0B4 != EINFO_79) && - (this->unk_0B4 != EINFO_83) && (this->unk_0B4 != EINFO_27) && (this->unk_0B4 != EINFO_51) && - (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_28) && + if ((this->unk_0B4 != EVID_21) && (this->unk_0B4 != EVID_23) && (this->unk_0B4 != EVID_79) && + (this->unk_0B4 != EVID_83) && (this->unk_0B4 != EVID_27) && (this->unk_0B4 != EVID_51) && + (this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_72) && (this->unk_0B4 != EVID_28) && (this->scale > 0.5f)) { sp40 = SIN_DEG(this->timer_0C6 * 400.0f) * this->timer_0C6; Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, MTXF_APPLY); @@ -3829,10 +3830,10 @@ void ActorEvent_Draw(ActorEvent* this) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } - if ((this->unk_0B4 == EINFO_29) || (this->unk_0B4 == EINFO_59) || (this->unk_0B4 == EINFO_60)) { + if ((this->unk_0B4 == EVID_29) || (this->unk_0B4 == EVID_59) || (this->unk_0B4 == EVID_60)) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - } else if ((this->unk_0B4 == EINFO_82) || (this->unk_0B4 == EINFO_90) || - ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR))) { + } else if ((this->unk_0B4 == EVID_82) || (this->unk_0B4 == EVID_90) || + ((this->unk_0B4 == EVID_6) && (gCurrentLevel == LEVEL_SOLAR))) { if ((this->timer_0C6 % 2) == 0) { RCP_SetupDL(&gMasterDisp, 0x39); } else { @@ -3841,34 +3842,34 @@ void ActorEvent_Draw(ActorEvent* this) { } switch (this->unk_0B4) { - case EINFO_92: - case EINFO_93: - case EINFO_94: - case EINFO_95: - case EINFO_96: + case EVID_92: + case EVID_93: + case EVID_94: + case EVID_95: + case EVID_96: RCP_SetupDL(&gMasterDisp, 0x22); gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[15], (s32) this->fwork[16], (s32) this->fwork[17], 255); - gSPDisplayList(gMasterDisp++, D_800D003C[this->unk_0B4].dList); + gSPDisplayList(gMasterDisp++, sEventActorInfo[this->unk_0B4].dList); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; default: - if ((this->unk_0B4 < EINFO_200) && (D_800D003C[this->unk_0B4].dList != NULL)) { - gSPDisplayList(gMasterDisp++, D_800D003C[this->unk_0B4].dList); + if ((this->unk_0B4 < EVID_200) && (sEventActorInfo[this->unk_0B4].dList != NULL)) { + gSPDisplayList(gMasterDisp++, sEventActorInfo[this->unk_0B4].dList); } switch (this->unk_0B4) { - case EINFO_56: + case EVID_56: Cutscene_DrawGreatFox(); break; - case EINFO_0: + case EVID_0: this->iwork[11] = 1; Actor_DrawEngineAndContrails(this); break; - case EINFO_2: + case EVID_2: this->fwork[15] -= this->fwork[15] * 0.1f; this->fwork[26] -= this->fwork[26] * 0.1f; this->fwork[16] -= this->fwork[16] * 0.1f; @@ -3886,7 +3887,7 @@ void ActorEvent_Draw(ActorEvent* this) { func_edisplay_8005B388(this); break; - case EINFO_43: + case EVID_43: if (gLevelType == LEVELTYPE_PLANET) { gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); } else { @@ -3895,12 +3896,12 @@ void ActorEvent_Draw(ActorEvent* this) { Actor_DrawEngineAndContrails(this); break; - case EINFO_5: + case EVID_5: this->iwork[11] = 1; Actor_DrawEngineAndContrails(this); break; - case EINFO_6: + case EVID_6: if (gCurrentLevel == LEVEL_SOLAR) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Animation_GetFrameData(&D_SO_600636C, this->unk_0B6, sp114); @@ -3912,18 +3913,18 @@ void ActorEvent_Draw(ActorEvent* this) { } break; - case EINFO_7: + case EVID_7: this->iwork[11] = 1; Actor_DrawEngineAndContrails(this); break; - case EINFO_9: + case EVID_9: Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); Animation_GetFrameData(&D_ENMY_PLANET_40001A4, this->unk_0B6, sp114); Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case EINFO_18: + case EVID_18: if (this->fwork[0] > 0.1f) { this->iwork[11] = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); @@ -3932,7 +3933,7 @@ void ActorEvent_Draw(ActorEvent* this) { } break; - case EINFO_19: + case EVID_19: if (this->fwork[0] > 0.1f) { this->iwork[11] = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); @@ -3941,12 +3942,12 @@ void ActorEvent_Draw(ActorEvent* this) { } break; - case EINFO_20: + case EVID_20: RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_A6_601A120); break; - case EINFO_21: + case EVID_21: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6018BF0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -3955,7 +3956,7 @@ void ActorEvent_Draw(ActorEvent* this) { Actor_DrawEngineGlow(this, 2); break; - case EINFO_22: + case EVID_22: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6019730); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -3964,7 +3965,7 @@ void ActorEvent_Draw(ActorEvent* this) { Actor_DrawEngineGlow(this, 2); break; - case EINFO_27: + case EVID_27: if (this->timer_0C2 != 0) { if (((this->timer_0C2 & 3) == 0) && (gPlayState != PLAY_PAUSE)) { func_effect_8007D0E0(RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.x, @@ -3980,13 +3981,13 @@ void ActorEvent_Draw(ActorEvent* this) { } break; - case EINFO_31: + case EVID_31: Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_600E0C0); break; - case EINFO_33: + case EVID_33: Animation_GetFrameData(&D_ENMY_SPACE_400A30C, this->unk_0B6, sp114); Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); @@ -3995,23 +3996,23 @@ void ActorEvent_Draw(ActorEvent* this) { Math_SmoothStepToF(&this->fwork[16], 0.0f, 0.3f, 2.0f, 0.0001f); break; - case EINFO_36: + case EVID_36: Animation_GetFrameData(&D_TI1_700CAF4, this->unk_0B6, sp114); sp114[2].z += this->fwork[15]; Animation_DrawSkeleton(1, D_TI1_700CB60, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case EINFO_38: + case EVID_38: ActorEvent_80074E3C(this); break; - case EINFO_48: - case EINFO_49: - case EINFO_50: + case EVID_48: + case EVID_49: + case EVID_50: SectorY_Actor204_Draw(this); break; - case EINFO_52: + case EVID_52: Animation_GetFrameData(&D_ZO_601F874, this->unk_0B6, sp114); sp114[2].z -= this->fwork[15]; gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -4020,7 +4021,7 @@ void ActorEvent_Draw(ActorEvent* this) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case EINFO_64: + case EVID_64: Matrix_Push(&gGfxMatrix); Matrix_RotateX(gGfxMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); @@ -4036,30 +4037,30 @@ void ActorEvent_Draw(ActorEvent* this) { Matrix_Pop(&gGfxMatrix); break; - case EINFO_67: + case EVID_67: gSPDisplayList(gMasterDisp++, D_ME_6008AA0); RCP_SetupDL(&gMasterDisp, 0x35); gSPDisplayList(gMasterDisp++, D_ME_6009E30); break; - case EINFO_78: + case EVID_78: ActorSupplies_Draw(this); break; - case EINFO_79: + case EVID_79: temp_s0 = this->state; this->state = 2; // actor 235 state Zoness_80190430(this); this->state = temp_s0; break; - case EINFO_80: + case EVID_80: Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_9011200); break; - case EINFO_81: + case EVID_81: if (this->fwork[15] > 0.001f) { Matrix_Scale(gGfxMatrix, this->fwork[15], this->fwork[15], this->fwork[15], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4068,57 +4069,57 @@ void ActorEvent_Draw(ActorEvent* this) { } break; - case EINFO_82: + case EVID_82: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_MA_600DA10); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case EINFO_83: + case EVID_83: Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Animation_GetFrameData(&D_AQ_602201C, this->unk_0B6, sp114); Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case EINFO_85: + case EVID_85: gSPDisplayList(gMasterDisp++, D_D00B880); Actor_DrawEngineAndContrails(this); break; - case EINFO_86: + case EVID_86: gSPDisplayList(gMasterDisp++, D_D009A40); Actor_DrawEngineAndContrails(this); break; - case EINFO_88: + case EVID_88: RCP_SetupDL(&gMasterDisp, 0x16); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, this->unk_046, this->unk_046, this->unk_046, 255); gSPDisplayList(gMasterDisp++, D_AQ_6008970); break; - case EINFO_89: + case EVID_89: RCP_SetupDL(&gMasterDisp, 0x15); gSPDisplayList(gMasterDisp++, D_AQ_6000E10); break; - case EINFO_103: - case EINFO_104: + case EVID_103: + case EVID_104: Andross_8018769C(this); break; - case EINFO_105: + case EVID_105: RCP_SetupDL(&gMasterDisp, 0x23); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 143); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); gSPDisplayList(gMasterDisp++, D_WZ_7000000); break; - case EINFO_106: + case EVID_106: Animation_GetFrameData(&D_ENMY_SPACE_4000080, this->unk_0B6, sp114); Animation_DrawSkeleton(1, D_ENMY_SPACE_400014C, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 0xFFF: + case EVID_FFF: this->timer_0C2 = 10; break; } @@ -4144,7 +4145,7 @@ void func_enmy2_800763A4(Actor* actor) { Vec3f sp4C; s32 pad; - if (actor->unk_0B4 == EINFO_27) { + if (actor->unk_0B4 == EVID_27) { actor->obj.pos.y -= actor->vel.y; actor->obj.status = OBJ_ACTIVE; func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, @@ -4199,7 +4200,7 @@ void func_enmy2_800763A4(Actor* actor) { break; } - if (((actor->timer_0BC % 4U) == 1) && (actor->unk_0B4 != EINFO_13) && (actor->unk_0B4 != EINFO_61)) { + if (((actor->timer_0BC % 4U) == 1) && (actor->unk_0B4 != EVID_13) && (actor->unk_0B4 != EVID_61)) { func_effect_8007D24C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.2f); } @@ -4257,7 +4258,7 @@ void func_enmy2_800763A4(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); } - if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_2)) { + if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_2)) { if (actor->fwork[17] < 360.0f) { func_play_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z); actor->fwork[17] = 777.0f; @@ -4327,7 +4328,7 @@ void func_enmy2_800763A4(Actor* actor) { } } } - if ((actor->dmgType != 0) || (actor->timer_0BC == 0) || + if ((actor->dmgType != DMG_NONE) || (actor->timer_0BC == 0) || ((actor->itemDrop != DROP_NONE) && (actor->obj.id != OBJ_ACTOR_ALLRANGE))) { if (gLevelMode == LEVELMODE_ALL_RANGE) { for (var_s0 = 0; var_s0 < 4; var_s0++) { @@ -4344,12 +4345,12 @@ void func_enmy2_800763A4(Actor* actor) { actor->vel.z, 5.0f, 15); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); } else { - if ((actor->unk_0B4 != EINFO_13) && (actor->unk_0B4 != EINFO_61)) { + if ((actor->unk_0B4 != EVID_13) && (actor->unk_0B4 != EVID_61)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f); } - if (actor->unk_0B4 == EINFO_36) { + if (actor->unk_0B4 == EVID_36) { func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 5.0f, 15); } @@ -4377,7 +4378,7 @@ void func_enmy2_800763A4(Actor* actor) { } void ActorEvent_Dying(ActorEvent* this) { - if ((this->unk_0B4 == EINFO_48) || (this->unk_0B4 == EINFO_49) || (this->unk_0B4 == EINFO_50)) { + if ((this->unk_0B4 == EVID_48) || (this->unk_0B4 == EVID_49) || (this->unk_0B4 == EVID_50)) { SectorY_Actor204_Update(this); } else { func_enmy2_800763A4(this); diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index c1a56913..40c67dcc 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -2460,7 +2460,7 @@ s32 func_hud_8008B774(void) { (gCurrentLevel == LEVEL_SECTOR_Y))) { for (i = 0; i < 60; i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) { - if ((gActors[i].unk_0B4 == EINFO_2) || (gActors[i].unk_0B4 == EINFO_43) || + if ((gActors[i].unk_0B4 == EVID_2) || (gActors[i].unk_0B4 == EVID_43) || ((gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) && ((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) || (gActors[i].aiType == AI360_PEPPY)))) { @@ -4327,9 +4327,9 @@ bool func_hud_80091DF4(Actor* actor) { sp44.y = 0.0f; sp44.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - func_enmy2_8006EEFC(actor->aiType, actor->obj.pos.x + (sp38.x * 1.5), actor->obj.pos.y + (sp38.y * 1.5), - actor->obj.pos.z + (sp38.z * 1.5), sp38.x, sp38.y, sp38.z, actor->obj.rot.x, - actor->obj.rot.y, actor->obj.rot.z); + Actor_SpawnPlayerLaser(actor->aiType, actor->obj.pos.x + (sp38.x * 1.5), actor->obj.pos.y + (sp38.y * 1.5), + actor->obj.pos.z + (sp38.z * 1.5), sp38.x, sp38.y, sp38.z, actor->obj.rot.x, + actor->obj.rot.y, actor->obj.rot.z); } return false; } @@ -4339,9 +4339,9 @@ bool func_hud_80091F00(Actor* actor) { Vec3f sp40; Vec3f sp34; - actor->dmgType = 0; + actor->dmgType = DMG_NONE; - if ((actor->state == 3) || (temp_v0 == 2)) { + if ((actor->state == 3) || (temp_v0 == DMG_EXPLOSION)) { return false; } @@ -4376,7 +4376,7 @@ bool func_hud_80091F00(Actor* actor) { return false; } - if ((actor->dmgType == 3) && (actor->dmgSource == 1)) { + if ((actor->dmgType == DMG_COLLISION) && (actor->dmgSource == AI360_FOX + 1)) { switch (actor->aiType) { case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20210, RCID_FALCO); @@ -4390,7 +4390,7 @@ bool func_hud_80091F00(Actor* actor) { } } - if ((actor->dmgType != 3) && (actor->dmgSource == 1)) { + if ((actor->dmgType != DMG_COLLISION) && (actor->dmgSource == AI360_FOX + 1)) { switch (actor->aiType) { case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20060, RCID_FALCO); @@ -4404,7 +4404,7 @@ bool func_hud_80091F00(Actor* actor) { } } - if ((actor->dmgSource == 2) || (actor->dmgSource == 100)) { + if ((actor->dmgSource == DMG_SRC_2) || (actor->dmgSource == DMG_SRC_100)) { switch (actor->aiType) { case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20030, RCID_FALCO); @@ -4705,7 +4705,7 @@ void ActorTeamBoss_Update(ActorTeamBoss* this) { func_hud_80091B90(this); func_hud_80091DF4(this); - if (this->dmgType != 0) { + if (this->dmgType != DMG_NONE) { func_hud_80091F00(this); } diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 18d3d8c7..b1244887 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -655,9 +655,9 @@ void Play_ClearObjectData(void) { PlayerShot_Initialize(&gPlayerShots[i]); } D_ctx_801782B8 = D_ctx_801782BC = D_ctx_801782C0 = D_ctx_801782D0 = gBossActive = D_ctx_8017828C = D_ctx_8017812C = - gPrevEventActorIndex = D_ctx_80177E78 = gRingPassCount = 0; - D_ctx_80177F10.x = D_ctx_80177F10.y = D_ctx_80177F10.z = D_ctx_80177E88.x = D_ctx_80177E88.y = D_ctx_80177E88.z = - 0.0f; + gPrevEventActorIndex = gFormationLeaderIndex = gRingPassCount = 0; + gFormationInitPos.x = gFormationInitPos.y = gFormationInitPos.z = gFormationInitRot.x = gFormationInitRot.y = + gFormationInitRot.z = 0.0f; for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) { gTeamArrowsViewPos[i].x = gTeamArrowsViewPos[i].y = gTeamArrowsViewPos[i].z = 100.0f; } @@ -1914,20 +1914,20 @@ void func_play_800A8BA4(Player* player) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } } else if (actor->obj.id == OBJ_ACTOR_EVENT) { - if (actor->unk_0B4 == EINFO_42) { + if (actor->unk_0B4 == EVID_42) { temp_v0 = func_play_800A8304(player, ACTOR_EVENT_ID, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } - } else if (actor->unk_0B4 == EINFO_63) { + } else if (actor->unk_0B4 == EVID_63) { spfD4.x = fabsf(actor->obj.pos.x - player->pos.x); spfD4.y = fabsf(actor->obj.pos.y - player->pos.y); spfD4.z = fabsf(actor->obj.pos.z - player->trueZpos); if ((VEC3F_MAG(&spfD4)) < 900.0f) { Player_ApplyDamage(player, 0, actor->info.damage); - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; } } else { temp_v0 = func_play_800A7974(player, actor->info.hitbox, &sp98, actor->obj.pos.x, @@ -1935,7 +1935,7 @@ void func_play_800A8BA4(Player* player) { actor->obj.rot.y, actor->obj.rot.z, actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z); if (temp_v0 != 0) { - if ((temp_v0 < 0) && (actor->unk_0B4 == EINFO_38)) { + if ((temp_v0 < 0) && (actor->unk_0B4 == EVID_38)) { actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032328); if (gRingPassCount >= 0) { actor->unk_046 = 2; @@ -1956,7 +1956,7 @@ void func_play_800A8BA4(Player* player) { } } else { Player_ApplyDamage(player, temp_v0, actor->info.damage); - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; actor->dmgSource = player->num + 1; } } @@ -1967,7 +1967,7 @@ void func_play_800A8BA4(Player* player) { actor->fwork[8] + actor->obj.pos.y + 25.0f, actor->obj.pos.z, actor->fwork[29], actor->fwork[26], actor->obj.rot.z, 0.0f, 0.0f, 0.0f); if (temp_v0 != 0) { - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; if (actor->info.damage) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } else { @@ -1988,7 +1988,7 @@ void func_play_800A8BA4(Player* player) { player->whooshTimer = 4; } } else { - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; if (actor->obj.id == OBJ_ACTOR_190) { actor->dmgType = -1; } @@ -2764,7 +2764,7 @@ void func_play_800AC290(Player* player, PlayerShot* shot, f32 arg2, f32 arg3, Pl shot->unk_64 = 30; } } - shot->playerNum = player->num; + shot->sourceId = player->num; } void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f32 speed) { @@ -2815,7 +2815,7 @@ void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f shot->unk_64 = 40; shot->obj.id = shotId; - shot->playerNum = player->num; + shot->sourceId = player->num; if (shotId == PLAYERSHOT_8) { if (speed <= 65.0f) { shot->unk_5C = 1; @@ -2940,7 +2940,7 @@ void func_play_800ACDC0(Player* player, PlayerShot* shot, PlayerShotId shotId) { shot->unk_64 = 30; shot->unk_58 = 1; - shot->playerNum = player->num; + shot->sourceId = player->num; } void func_play_800AD094(Player* player) { diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index d9ec4dbe..813391e8 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -1403,7 +1403,7 @@ void func_tank_800481F4(Player* player) { actor->vwork[29].z + actor->unk_0F4.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; actor->dmgSource = player->num + 1; } } else if (actor->obj.id == OBJ_ACTOR_207) { @@ -1426,7 +1426,7 @@ void func_tank_800481F4(Player* player) { player->vel.x = 0.0f; player->vel.y = 30.0f; player->pos.x = player->basePos.x; - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; Player_ApplyDamage(player, 0, 5); player->timer_498 = 1; } @@ -1451,7 +1451,7 @@ void func_tank_800481F4(Player* player) { player->vel.x = 0.0f; player->vel.y = 30.0f; player->pos.x = player->basePos.x; - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; if (actor->info.damage != 0) { Player_ApplyDamage(player, 0, 20); } else { @@ -1463,7 +1463,7 @@ void func_tank_800481F4(Player* player) { actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, 0.0f, 0.0f, 0.0f); if (temp_v0 != 0) { - actor->dmgType = 3; + actor->dmgType = DMG_COLLISION; if ((actor->obj.id == OBJ_ACTOR_225) || (actor->obj.id == OBJ_ACTOR_190)) { actor->dmgType = -1; } diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index fe6f3912..3d88e7aa 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -1127,8 +1127,8 @@ s32 Corneria_8018AB64(Actor* actor) { void Corneria_8018ACE0(Actor* actor) { - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->dmgPart == 0) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 200.0f, actor->obj.pos.z, actor->vel.x, @@ -2401,8 +2401,8 @@ void Corneria_8018F044(Scenery* scenery) { switch (scenery->state) { case 0: - if (scenery->dmgType != 0) { - scenery->dmgType = 0; + if (scenery->dmgType != DMG_NONE) { + scenery->dmgType = DMG_NONE; if (scenery->dmgPart < 2) { scenery->unk_44++; scenery->timer_4C = 5; diff --git a/src/overlays/ovl_i1/fox_ve1.c b/src/overlays/ovl_i1/fox_ve1.c index 5da5e486..bdf66425 100644 --- a/src/overlays/ovl_i1/fox_ve1.c +++ b/src/overlays/ovl_i1/fox_ve1.c @@ -339,8 +339,8 @@ void Venom1_80192518(Actor* actor) { f32 temp_fv1_2; Effect* effect; - if (actor->dmgType == 1) { - actor->dmgType = 0; + if (actor->dmgType == DMG_BEAM) { + actor->dmgType = DMG_NONE; func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } @@ -621,8 +621,8 @@ void Venom1_80192CB0(Actor* actor) { } void Venom1_80192CD4(Actor* actor) { - if (actor->dmgType == 1) { - actor->dmgType = 0; + if (actor->dmgType == DMG_BEAM) { + actor->dmgType = DMG_NONE; func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } @@ -763,8 +763,8 @@ void Venom1_80192EB0(Actor* actor) { } break; } - if (actor->dmgType == 1) { - actor->dmgType = 0; + if (actor->dmgType == DMG_BEAM) { + actor->dmgType = DMG_NONE; func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } actor->iwork[0]++; @@ -778,8 +778,8 @@ void Venom1_801933B4(Actor* actor) { void Venom1_801933DC(Actor* actor) { f32* hitboxData; - if (actor->dmgType == 1) { - actor->dmgType = 0; + if (actor->dmgType == DMG_BEAM) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 0); } @@ -1537,8 +1537,8 @@ void Venom1_80194398(Boss* boss) { } } } - if (boss->dmgType == 1) { - boss->dmgType = 0; + if (boss->dmgType == DMG_BEAM) { + boss->dmgType = DMG_NONE; switch (boss->state) { case 0: case 1: diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 2fe0eefe..ac907a3b 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -44,8 +44,8 @@ Vec3f D_i2_80195610[] = { }; void Meteo_80187530(Actor* actor) { - if (actor->dmgType == 1) { - actor->dmgType = 0; + if (actor->dmgType == DMG_BEAM) { + actor->dmgType = DMG_NONE; func_effect_8007A6F0(&actor->obj.pos, 0x2902107D); } } @@ -53,8 +53,8 @@ void Meteo_80187530(Actor* actor) { void Meteo_8018756C(Actor* actor) { Vec3f vec; - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->health -= actor->damage; if (actor->health <= 0) { actor->obj.status = OBJ_DYING; @@ -95,7 +95,7 @@ void Meteo_80187650(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); } - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); Object_Kill(&actor->obj, actor->sfxSource); @@ -132,7 +132,7 @@ void Meteo_801877C4(Actor* actor) { actor->obj.pos.x = actor->fwork[0] + sp44.x; actor->obj.pos.y = actor->fwork[1] + sp44.y; - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { Actor_Despawn(actor); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); @@ -155,7 +155,7 @@ void Meteo_8018795C(Actor* actor) { actor->obj.rot.y += 7.0f; actor->obj.rot.x += 3.3f; - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { Actor_Despawn(actor); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); @@ -191,7 +191,7 @@ void Meteo_80187B08(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); } - if ((actor->dmgType != 0) || (actor->timer_0BC == 0)) { + if ((actor->dmgType != DMG_NONE) || (actor->timer_0BC == 0)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); @@ -385,13 +385,13 @@ void Meteo_80188344(Boss* boss) { if (boss->timer_050 == 0) { boss->state = 2; - boss->dmgType = 0; + boss->dmgType = DMG_NONE; } break; case 2: - if (boss->dmgType == 1) { - boss->dmgType = 0; + if (boss->dmgType == DMG_BEAM) { + boss->dmgType = DMG_NONE; boss->timer_054 = 5; boss->swork[0] += 32; @@ -858,8 +858,8 @@ void Meteo_8018978C(Boss* boss) { } } - if (boss->dmgType != 0) { - boss->dmgType = 0; + if (boss->dmgType != DMG_NONE) { + boss->dmgType = DMG_NONE; if ((boss->dmgPart != 7) && (boss->dmgPart >= 5) && (boss->dmgPart != 5)) { AUDIO_PLAY_SFX(0x29121007, boss->sfxSource, 4); } @@ -2038,10 +2038,10 @@ void Meteo_LevelStart(Player* player) { Matrix_RotateX(gCalcMatrix, M_DTOR * sp68, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - func_enmy2_8006EFA0(100, actor3->obj.pos.x + (D_ctx_80177A48[3] * 74.0f) + (sp4C.x * 0.6f), - actor3->obj.pos.y - 232.0f + (sp4C.y * 0.8f), - actor3->obj.pos.z - 1190.0f + (sp4C.z * 0.8f), sp4C.x, sp4C.y, sp4C.z, sp68, - sp64, 0.0f); + Actor_SpawnGreatFoxLaser(100, actor3->obj.pos.x + (D_ctx_80177A48[3] * 74.0f) + (sp4C.x * 0.6f), + actor3->obj.pos.y - 232.0f + (sp4C.y * 0.8f), + actor3->obj.pos.z - 1190.0f + (sp4C.z * 0.8f), sp4C.x, sp4C.y, sp4C.z, + sp68, sp64, 0.0f); } if (player->csEventTimer == 1) { func_effect_8007D2C8(gActors[player->meTargetIndex].obj.pos.x, diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index 1f058636..533996d5 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -62,9 +62,9 @@ void SectorX_8018F1DC(Actor* actor) { Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_enmy2_8006EEFC(actor->index, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), - actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->unk_0F4.x, - actor->unk_0F4.y + 180.0f, 0.0f); + Actor_SpawnPlayerLaser(actor->index, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), + actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->unk_0F4.x, + actor->unk_0F4.y + 180.0f, 0.0f); } void SectorX_8018F330(Actor* actor) { @@ -393,8 +393,8 @@ void SectorX_80190078(Boss* boss) { } } - if (boss->dmgType != 0) { - boss->dmgType = 0; + if (boss->dmgType != DMG_NONE) { + boss->dmgType = DMG_NONE; if (boss->swork[0] == 1) { if ((boss->dmgPart == 0) && ((boss->fwork[4] < 45.0f) || (boss->fwork[4] > 315.0f))) { AUDIO_PLAY_SFX(0x2903300E, boss->sfxSource, 4); @@ -1492,8 +1492,8 @@ void SectorX_LevelStart(Player* player) { src.y = src.x = 0.0f; src.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_enmy2_8006EEFC(100, 0.0f, player->cam.eye.y + 50.0f, player->cam.eye.z + 20.0f, dest.x, dest.y, - dest.z, xyzDeg, xzDeg, 0.0f); + Actor_SpawnPlayerLaser(CS_SHOT_ID, 0.0f, player->cam.eye.y + 50.0f, player->cam.eye.z + 20.0f, dest.x, + dest.y, dest.z, xyzDeg, xzDeg, 0.0f); } if (gCsFrameCount == 143) { Object_Kill(&gPlayerShots[0].obj, gPlayerShots[0].sfxSource); diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index d893f686..832f3bac 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -2083,7 +2083,7 @@ void Area6_8018D3CC(s32 arg0, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, gPlayerShots[i].unk_60 = 0; gPlayerShots[i].obj.id = PLAYERSHOT_1; gPlayerShots[i].unk_64 = 150; - gPlayerShots[i].playerNum = 100; + gPlayerShots[i].sourceId = CS_SHOT_ID; AUDIO_PLAY_SFX(0x2900000D, gPlayerShots[i].sfxSource, 4); break; @@ -2165,22 +2165,22 @@ void Area6_8018D804(Actor* actor, s32 arg1) { AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); } -void Area6_8018D920(Vec3f* arg0) { - f32 sp6C = arg0->x - arg0->x; - f32 sp68 = arg0->y - arg0->y; - f32 sp64 = arg0->z - 1000.0f - arg0->z; - f32 sp60 = Math_RadToDeg(Math_Atan2F(sp6C, sp64)); - f32 sp5C = Math_RadToDeg(-Math_Atan2F(sp68, sqrtf(SQ(sp6C) + SQ(sp64)))); - Vec3f sp50; - Vec3f sp44; +void Area6_8018D920(Vec3f* pos) { + f32 sp6C = pos->x - pos->x; // what is this calculation? + f32 sp68 = pos->y - pos->y; + f32 sp64 = pos->z - 1000.0f - pos->z; + f32 yRot = Math_RadToDeg(Math_Atan2F(sp6C, sp64)); + f32 xRot = Math_RadToDeg(-Math_Atan2F(sp68, sqrtf(SQ(sp6C) + SQ(sp64)))); + Vec3f speed; + Vec3f vel; - Matrix_RotateY(gCalcMatrix, M_DTOR * sp60, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, M_DTOR * sp5C, MTXF_APPLY); - sp50.x = 0.0f; - sp50.y = 0.0f; - sp50.z = 100.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp50, &sp44); - Area6_8018D3CC(100, arg0->x, arg0->y, arg0->z, sp44.x, sp44.y, sp44.z, sp5C, sp60, 0.0f); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, MTXF_APPLY); + speed.x = 0.0f; + speed.y = 0.0f; + speed.z = 100.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &speed, &vel); + Area6_8018D3CC(CS_SHOT_ID, pos->x, pos->y, pos->z, vel.x, vel.y, vel.z, xRot, yRot, 0.0f); } void Area6_8018DA58(Actor* actor) { diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index 58784a56..b571f65d 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -1625,9 +1625,9 @@ void Aquas_801AD6C0(Actor* actor) { break; case 1: - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { if (actor->health > 0) { - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x29034045, actor->sfxSource, 4); @@ -1722,7 +1722,7 @@ void Aquas_801AD6C0(Actor* actor) { actor->iwork[1]--; if (actor->iwork[1] <= 0) { actor->itemDrop = DROP_NONE; - actor->dmgSource = 2; + actor->dmgSource = DMG_SRC_2; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); } @@ -1850,8 +1850,8 @@ void Aquas_801AE3D8(Actor* actor) { } } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if ((fabsf(D_i3_801C4308[10]) >= 6.0f) && (gBosses[0].state >= 10) && (gBosses[0].swork[AQ_SWK_0] < 2)) { actor->timer_0C6 = 30; @@ -2119,8 +2119,8 @@ void Aquas_801AFA5C(Actor* actor) { actor->obj.rot.y = D_i3_801BFBC8[i]; actor->obj.rot.z = D_i3_801BFBD4[i]; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if ((gBosses[0].state >= 10) && (actor->health != 0) && (actor->damage == 31)) { actor->timer_0BE = 70; actor->health -= actor->damage; @@ -2344,7 +2344,7 @@ void Aquas_801B0B60(Actor* actor) { Vec3f sp44; Vec3f sp38; - if ((actor->dmgType != 0) || (gBosses[0].state >= 16)) { + if ((actor->dmgType != DMG_NONE) || (gBosses[0].state >= 16)) { actor->state = 3; } @@ -2396,7 +2396,7 @@ void Aquas_801B0B60(Actor* actor) { case 3: if (Rand_ZeroOne() < 0.1) { actor->itemDrop = DROP_SILVER_RING_10p; - actor->dmgSource = 2; + actor->dmgSource = DMG_SRC_2; Actor_Despawn(actor); } Object_Kill(&actor->obj, actor->sfxSource); @@ -2842,8 +2842,8 @@ void Aquas_801B134C(Boss* bossAQ) { } Math_SmoothStepToF(&D_i3_801C4308[80], 0.0f, 1.0f, 2.0f, 0); Math_SmoothStepToF(&D_i3_801C4308[11], D_i3_801C4308[80], 0.1f, 2.0f, 0); - if (bossAQ->dmgType != 0) { - bossAQ->dmgType = 0; + if (bossAQ->dmgType != DMG_NONE) { + bossAQ->dmgType = DMG_NONE; if (fabsf(D_i3_801C4308[10]) >= 5.0f) { switch (bossAQ->dmgPart) { case 13: @@ -3790,8 +3790,8 @@ void Aquas_801B50E8(Actor* actor) { } } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->health != 0) { if (actor->damage == 31) { actor->info.bonus = 1; @@ -4115,8 +4115,8 @@ void Aquas_801B638C(Actor* actor) { break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if ((actor->health != 0) && (actor->dmgPart == 0)) { actor->health -= actor->damage; actor->timer_0C6 = 30; @@ -4245,8 +4245,8 @@ void Aquas_801B6FF8(Actor* actor) { actor->unk_0B6 = 0; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->health > -100) { actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -4649,8 +4649,8 @@ void Aquas_801B7C78(Actor* actor) { actor->health = 0; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->health != 0) { actor->info.bonus = 0; if (actor->damage == 31) { @@ -4958,8 +4958,8 @@ void Aquas_801B91A4(Actor* actor) { break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if ((actor->health != 0) && (actor->state != 0)) { actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -5208,8 +5208,8 @@ void Aquas_801BA6A4(Actor* actor) { break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->health -= actor->damage; if (actor->health <= 0) { actor->health = actor->itemDrop = 0; @@ -5275,8 +5275,8 @@ void Aquas_801BADF8(Actor* actor) { break; case 1: - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->damage == 0) { gPlayer[0].hitTimer = 6; gPlayer[0].unk_21C = 0; @@ -5738,8 +5738,8 @@ void Aquas_801BB79C(Actor* actor) { actor->iwork[9] = actor->iwork[12] = 0; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x2903408F, actor->sfxSource, 4); if (actor->damage != 31) { actor->timer_0C0 = actor->timer_0C6 = 40; @@ -5882,8 +5882,8 @@ void Aquas_801BC9A0(Actor* actor) { break; case 1: - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if ((actor->health != 0) && (actor->iwork[3] == 0) && (actor->damage == 31)) { actor->health -= actor->damage; AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); @@ -6436,8 +6436,8 @@ void Aquas_801BE3F8(Actor* actor) { break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->health != 0) { if (actor->state == 2) { actor->health -= actor->damage; diff --git a/src/overlays/ovl_i3/fox_so.c b/src/overlays/ovl_i3/fox_so.c index 3b9fb96f..065a558b 100644 --- a/src/overlays/ovl_i3/fox_so.c +++ b/src/overlays/ovl_i3/fox_so.c @@ -436,7 +436,7 @@ void Solar_8019F20C(Actor* actor) { Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, actor->scale * 6.5f, 2); } - if ((actor->dmgType != 0) || ((actor->obj.id == OBJ_ACTOR_277) && (actor->vel.y < 0.0f))) { + if ((actor->dmgType != DMG_NONE) || ((actor->obj.id == OBJ_ACTOR_277) && (actor->vel.y < 0.0f))) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f); Object_Kill(&actor->obj, actor->sfxSource); if (actor->obj.id == OBJ_ACTOR_277) { @@ -1262,7 +1262,7 @@ void Solar_801A1F80(Boss* bossSO) { Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 120.0f, 1.0f, 3.5f, 0.0f); } if (gBossFrameCount == 60) { - gActors[10].dmgType = 3; + gActors[10].dmgType = DMG_COLLISION; AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); } if (bossSO->timer_050 == 100) { @@ -1493,7 +1493,7 @@ void Solar_801A2C98(Boss* bossSO) { } } if (bossSO->unk_04C == 20) { - gActors[10].dmgType = 3; + gActors[10].dmgType = DMG_COLLISION; AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4); } if (bossSO->unk_04C == 0) { @@ -1527,7 +1527,7 @@ void Solar_801A2C98(Boss* bossSO) { Solar_801A3468(bossSO); } if (bossSO->swork[SO_SWK_11] == 50) { - gActors[9].dmgType = 3; + gActors[9].dmgType = DMG_COLLISION; AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); } } @@ -1554,7 +1554,7 @@ void Solar_801A3128(Boss* bossSO) { Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 2000.0f, 10.0f, 1); } if (bossSO->unk_04C == 40) { - gActors[10].dmgType = 3; + gActors[10].dmgType = DMG_COLLISION; AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4); } if (bossSO->unk_04C == 0) { @@ -1604,7 +1604,7 @@ void Solar_801A3128(Boss* bossSO) { } } if (bossSO->swork[SO_SWK_11] == 50) { - gActors[9].dmgType = 3; + gActors[9].dmgType = DMG_COLLISION; AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); } } @@ -1976,7 +1976,7 @@ void Solar_801A48B8(Boss* bossSO) { if ((bossSO->swork[SO_SWK_0] == 4) && (bossSO->unk_04C >= 60) && (bossSO->unk_04C < 67)) { for (i = 4; i < 60; i++) { if (gActors[i].obj.id == OBJ_ACTOR_278) { - gActors[i].dmgType = 2; + gActors[i].dmgType = DMG_EXPLOSION; break; } } @@ -2098,7 +2098,7 @@ void Solar_801A4EF8(Boss* bossSO) { } } if (bossSO->swork[SO_SWK_11] == 16) { - gActors[10].dmgType = 2; + gActors[10].dmgType = DMG_EXPLOSION; } if (bossSO->obj.pos.y <= -900.0f) { bossSO->state++; @@ -2129,7 +2129,7 @@ void Solar_801A4EF8(Boss* bossSO) { if (bossSO->swork[SO_SWK_11] == 170) { AUDIO_PLAY_SFX(0x29432073, bossSO->sfxSource, 4); bossSO->obj.pos.y = -500.0f; - gActors[9].dmgType = 2; + gActors[9].dmgType = DMG_EXPLOSION; } if (bossSO->swork[SO_SWK_11] <= 170) { bossSO->vel.y = COS_DEG(bossSO->obj.rot.x) * 80.0f; @@ -2177,7 +2177,7 @@ void Solar_801A4EF8(Boss* bossSO) { bossSO->fwork[SO_FWK_0] = 0.01f; } if (bossSO->swork[SO_SWK_11] == 50) { - gActors[9].dmgType = 2; + gActors[9].dmgType = DMG_EXPLOSION; } break; } diff --git a/src/overlays/ovl_i3/fox_zo.c b/src/overlays/ovl_i3/fox_zo.c index 25574f72..6940f397 100644 --- a/src/overlays/ovl_i3/fox_zo.c +++ b/src/overlays/ovl_i3/fox_zo.c @@ -655,8 +655,8 @@ void Zoness_801904CC(Actor* actor) { if (Animation_GetFrameCount(&D_ZO_600E5EC) < actor->unk_0B6) { actor->unk_0B6 = 0; } - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; if (actor->state > 0) { actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -732,8 +732,8 @@ void Zoness_80190A00(Actor* actor) { actor->timer_0C0 = 30; } Zoness_80190790(actor); - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -894,8 +894,8 @@ void Zoness_80191010(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, 0x29018036); break; } - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { @@ -953,8 +953,8 @@ void Zoness_80191680(Actor* actor) { if (actor->obj.pos.z < actor->fwork[0]) { actor->state = 1; } - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); @@ -1220,14 +1220,14 @@ void Zoness_80192094(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); break; } - if ((actor->dmgType != 0) && (actor->state < 3)) { - if (actor->dmgType != 1) { + if ((actor->dmgType != DMG_NONE) && (actor->state < 3)) { + if (actor->dmgType != DMG_BEAM) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5); gHitCount += 6; D_ctx_80177850 = 15; actor->state = 4; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } } @@ -1301,8 +1301,8 @@ void Zoness_80192834(Actor* actor) { } actor->obj.rot.x += 20.0f; actor->obj.rot.x = Math_ModF(actor->obj.rot.x, 360.0f); - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; actor->health -= actor->damage; if (actor->health <= 0) { actor->health = 0; @@ -1438,8 +1438,8 @@ void Zoness_80192E64(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); break; } - if (actor->dmgType != 0) { - if (actor->dmgType != 1) { + if (actor->dmgType != DMG_NONE) { + if (actor->dmgType != DMG_BEAM) { if ((actor->state != 0) && (actor->state != 3)) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2); gHitCount += 3; @@ -1449,7 +1449,7 @@ void Zoness_80192E64(Actor* actor) { } else { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } if (func_play_800A73E4(&sp70, &sp6C, actor->obj.pos.x, actor->obj.pos.y - 1000.0f, actor->obj.pos.z)) { Math_SmoothStepToF(&actor->obj.pos.y, sp70 + 300.0f, 0.1f, 20.0f, 0); @@ -3311,7 +3311,7 @@ void Zoness_8019962C(Boss* bossZO, f32 arg1) { void Zoness_8019969C(Actor* actor) { s32 i; - if ((actor->dmgType != 0) && (actor->health != 0)) { + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { actor->health -= actor->damage; if (actor->health <= 0) { actor->health = 0; @@ -3322,13 +3322,13 @@ void Zoness_8019969C(Actor* actor) { } func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5.0f); actor->itemDrop = DROP_BOMB; - actor->dmgSource = 2; + actor->dmgSource = DMG_SRC_2; actor->obj.pos.z -= 100.0f; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } actor->fwork[0] += 10.0f; Zoness_8018FF50(actor); @@ -3419,17 +3419,17 @@ void Zoness_80199A28(Actor* actor) { } Math_SmoothStepToAngle(&actor->obj.rot.z, sp38, 0.1f, 1.0f, 0); } - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; actor->itemDrop = DROP_SILVER_RING_50p; func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); - actor->dmgSource = 2; + actor->dmgSource = DMG_SRC_2; actor->obj.pos.y += 200.0f; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x1903400F); } else { - if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 800.0f) || (actor->dmgType != 0)) { + if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 800.0f) || (actor->dmgType != DMG_NONE)) { Zoness_801999CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); @@ -3440,7 +3440,7 @@ void Zoness_80199A28(Actor* actor) { if ((actor->timer_0BC == 0) && (actor->iwork[0] == 0)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); actor->itemDrop = DROP_SILVER_RING_50p; - actor->dmgSource = 2; + actor->dmgSource = DMG_SRC_2; actor->obj.pos.y += 200.0f; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); @@ -3515,11 +3515,11 @@ void Zoness_80199F10(Actor* actor) { } break; } - if (actor->dmgType != 0) { - if (actor->dmgType == 1) { + if (actor->dmgType != DMG_NONE) { + if (actor->dmgType == DMG_BEAM) { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } } @@ -3677,11 +3677,11 @@ void Zoness_8019A5D4(Actor* actor) { break; } Zoness_8018FF50(actor); - if (actor->dmgType != 0) { - if (actor->dmgType == 1) { + if (actor->dmgType != DMG_NONE) { + if (actor->dmgType == DMG_BEAM) { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } if (((gGameFrameCount % 8) == 0) && (actor->state != 0) && (actor->iwork[0] < 8) && (func_play_800A73E4(&sp44, &sp40, actor->obj.pos.x, actor->obj.pos.y - 100.0f, actor->obj.pos.z) != 0)) { @@ -3920,8 +3920,8 @@ void Zoness_8019B854(Actor* actor) { Vec3f spA8 = { 0.0f, 0.0f, 0.0f }; Vec3f sp9C; - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); @@ -4053,8 +4053,8 @@ void Zoness_8019BE48(Actor* actor) { actor->state++; break; case 1: - if ((actor->dmgType != 0) && (actor->health != 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { @@ -4383,8 +4383,8 @@ void Zoness_8019D15C(Actor* actor) { Actor* otherActor; if (actor->state == 0) { - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->dmgPart < 2) { AUDIO_PLAY_SFX(0x1903001E, actor->sfxSource, 4); if ((actor->obj.pos.y + 268.0f) < actor->hitPos.y) { diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index 424840f2..94dbde89 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -119,8 +119,8 @@ void Bolse_8018BD60(Actor* this) { } } } - func_360_8002F69C(this); - func_360_8002FC00(this); + ActorAllRange_UpdateStarWolfEvents(this); + ActorAllRange_UpdateEvemyEvents(this); } f32 D_i4_8019EEE4[] = { -200.0f, -100.0f, -0.0f, 100.0f, 200.0f }; @@ -206,7 +206,7 @@ void Bolse_UpdateEventHandler(Actor* this) { switch (this->state) { case 0: - D_360_800C9B4C = 500000; + gAllRangeSpawnEvent = 500000; gAllRangeEventTimer = 0; gStarWolfMsgTimer = 0; this->state = 2; @@ -302,7 +302,7 @@ void Bolse_UpdateEventHandler(Actor* this) { this->iwork[1] = gHitCount; if ((gStarWolfTeamAlive[0] != 0) || (gStarWolfTeamAlive[1] != 0) || (gStarWolfTeamAlive[2] != 0) || (gStarWolfTeamAlive[3] != 0)) { - D_360_800C9B4C = gAllRangeEventTimer + 120; + gAllRangeSpawnEvent = gAllRangeEventTimer + 120; gStarWolfMsgTimer = 1000; } } @@ -332,7 +332,7 @@ void Bolse_UpdateEventHandler(Actor* this) { Math_SmoothStepToF(&player->cam.at.z, actor->obj.pos.z, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 0.2f, 0); - if ((gControllerPress->button & START_BUTTON) || ((D_360_800C9B4C + 300) == gAllRangeEventTimer)) { + if ((gControllerPress->button & START_BUTTON) || ((gAllRangeSpawnEvent + 300) == gAllRangeEventTimer)) { this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); @@ -605,11 +605,11 @@ void Bolse_8018D124(Actor* actor) { bool Bolse_8018D278(Actor* actor) { s32 i; - if (actor->dmgType == 0) { + if (actor->dmgType == DMG_NONE) { return false; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->obj.pos.y += 150.0f; func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 8.0f, 15); @@ -691,13 +691,13 @@ s32 Bolse_8018D4F0(Actor* actor) { bool Bolse_8018D584(Actor* actor) { s32 i; - if (actor->dmgType == 0) { + if (actor->dmgType == DMG_NONE) { return false; } if ((actor->dmgPart < 2) && (actor->state == 0)) { actor->timer_0C6 = 20; - actor->dmgType = 0; + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29024003, actor->sfxSource, 0); actor->health += actor->damage; @@ -1907,7 +1907,7 @@ void Bolse_801912FC(Boss* boss) { } if (boss->state == 2) { - if (boss->dmgType != 0) { + if (boss->dmgType != DMG_NONE) { boss->dmgType = DMG_NONE; if (boss->damage >= 16) { diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index 378f12fd..c58375c5 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -20,7 +20,7 @@ void Fortuna_801875F0(Actor* actor) { } if ((counter < 10) && (actor->timer_0C0 == 0)) { - if (gAllRangeEventTimer < (D_360_800C9B4C - 500)) { + if (gAllRangeEventTimer < (gAllRangeSpawnEvent - 500)) { actor->timer_0C0 = 40; actor->unk_04E++; @@ -63,7 +63,7 @@ void Fortuna_801875F0(Actor* actor) { } } } - func_360_8002F69C(actor); + ActorAllRange_UpdateStarWolfEvents(actor); } f32 D_8019EDEC[] = { 0.0f, 700.0f, 12000.0f }; @@ -115,17 +115,17 @@ void Fortuna_UpdateEvents(Actor* actor) { Radio_PlayMessage(gMsg_ID_9000, RCID_FOX); } - if ((gAllRangeEventTimer + 400) == (0, D_360_800C9B4C)) { + if ((gAllRangeEventTimer + 400) == (0, gAllRangeSpawnEvent)) { Radio_PlayMessage(gMsg_ID_9010, RCID_SLIPPY); } - if ((gAllRangeEventTimer + 240) == (0, D_360_800C9B4C)) { + if ((gAllRangeEventTimer + 240) == (0, gAllRangeSpawnEvent)) { Radio_PlayMessage(gMsg_ID_9375, RCID_ROB64); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); } - if ((gAllRangeEventTimer + 100) == (0, D_360_800C9B4C)) { + if ((gAllRangeEventTimer + 100) == (0, gAllRangeSpawnEvent)) { Radio_PlayMessage(gMsg_ID_9380, RCID_FOX); } @@ -155,7 +155,7 @@ void Fortuna_UpdateEvents(Actor* actor) { gActors[6].aiIndex = gActors[7].aiIndex = -1; } - if ((D_360_800C9B4C < gAllRangeEventTimer) && (gAllRangeEventTimer < 9970) && (gStarWolfTeamAlive[0] == 0) && + if ((gAllRangeSpawnEvent < gAllRangeEventTimer) && (gAllRangeEventTimer < 9970) && (gStarWolfTeamAlive[0] == 0) && (gStarWolfTeamAlive[1] == 0) && (gStarWolfTeamAlive[2] == 0) && (gStarWolfTeamAlive[3] == 0)) { gAllRangeEventTimer = 9970; } @@ -218,7 +218,7 @@ void Fortuna_UpdateEvents(Actor* actor) { switch (actor->state) { case 0: - D_360_800C9B4C = 2880; + gAllRangeSpawnEvent = 2880; for (i = 0; i < 6; i++) { gSavedStarWolfTeamAlive[i] = 1; gStarWolfTeamAlive[i] = 1; @@ -232,7 +232,7 @@ void Fortuna_UpdateEvents(Actor* actor) { player->pos.y = 670.0f; gAllRangeEventTimer = 200; if (gAllRangeCheckpoint != 0) { - gAllRangeEventTimer = D_360_800C9B4C - 1; + gAllRangeEventTimer = gAllRangeSpawnEvent - 1; gHitCount = gSavedHitCount; } } else { @@ -281,7 +281,7 @@ void Fortuna_UpdateEvents(Actor* actor) { Math_SmoothStepToF(&player->cam.at.y, actor4->obj.pos.y, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, actor4->obj.pos.z, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 1.0f, 1000.0f, 0.0f); - if (gAllRangeEventTimer == (D_360_800C9B4C + 2)) { + if (gAllRangeEventTimer == (gAllRangeSpawnEvent + 2)) { gStarWolfMsgTimer = 883; gAllRangeCheckpoint = 1; @@ -292,7 +292,7 @@ void Fortuna_UpdateEvents(Actor* actor) { }; } - if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (D_360_800C9B4C + 440))) { + if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (gAllRangeSpawnEvent + 440))) { actor->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); @@ -489,8 +489,8 @@ void Fortuna_80188AD0(Actor* actor) { actor->obj.pos.y -= 230.0f; } - if ((actor->dmgType != 0) && (actor->state == 0)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->state == 0)) { + actor->dmgType = DMG_NONE; actor->state = 1; actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_FO_600FF64); actor->info.targetOffset = 0.0f; diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index bdae64bc..41233361 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -298,9 +298,9 @@ void Katina_LevelStart(Player* player) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_enmy2_8006EEFC(5, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), - actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->obj.rot.x, - actor->obj.rot.y, actor->obj.rot.z); + Actor_SpawnPlayerLaser(5, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), + actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->obj.rot.x, + actor->obj.rot.y, actor->obj.rot.z); break; case 35: @@ -310,9 +310,9 @@ void Katina_LevelStart(Player* player) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_enmy2_8006EEFC(6, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), - actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->obj.rot.x, - actor->obj.rot.y, actor->obj.rot.z); + Actor_SpawnPlayerLaser(6, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), + actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->obj.rot.x, + actor->obj.rot.y, actor->obj.rot.z); break; case 45: @@ -2104,10 +2104,10 @@ void Katina_80198AA0(Actor* actor) { yVel = (-xSin * 200.0f * 0.5f); xVel = (xCos * 200.0f * 0.5f); zVel = (xCos * 200.0f * 0.5f); - func_enmy2_8006EEFC(actor->aiType, actor->obj.pos.x + ((ySin * xVel) * 1.5f), actor->obj.pos.y + (yVel * 1.5f), - actor->obj.pos.z + ((yCos * zVel) * 1.5f), (ySin * (xCos * 200.0f * 0.5f)), - (-xSin * 200.0f * 0.5f), (yCos * (xCos * 200.0f * 0.5f)), actor->obj.rot.x, - actor->obj.rot.y, actor->obj.rot.z); + Actor_SpawnPlayerLaser(actor->aiType, actor->obj.pos.x + ((ySin * xVel) * 1.5f), + actor->obj.pos.y + (yVel * 1.5f), actor->obj.pos.z + ((yCos * zVel) * 1.5f), + (ySin * (xCos * 200.0f * 0.5f)), (-xSin * 200.0f * 0.5f), + (yCos * (xCos * 200.0f * 0.5f)), actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z); } ActorAllRange_ApplyDamage(actor); radarMark = &gRadarMarks[actor->index]; diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index e087d5a5..5484f7d1 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -59,7 +59,7 @@ void SectorZ_80199900(Actor* actor, s32 arg1) { } if ((D_i4_801A0560 == 3) && (gLeveLClearStatus[LEVEL_ZONESS] != 0)) { - D_360_800C9B4C = gAllRangeEventTimer + 110; + gAllRangeSpawnEvent = gAllRangeEventTimer + 110; } } } @@ -156,7 +156,7 @@ void SectorZ_Missile_Update(Actor* this) { (fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 800.0f)) { SectorZ_80199900(this, 0); gCameraShake = 25; - gBosses[0].dmgType = DMG_zRot_0FC; + gBosses[0].dmgType = DMG_UNK_100; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 0; @@ -251,7 +251,7 @@ void SectorZ_8019A1D0(void) { } void SectorZ_8019A2F4(Actor* actor) { - if (gAllRangeEventTimer == D_360_800C9B4C) { + if (gAllRangeEventTimer == gAllRangeSpawnEvent) { SectorZ_8019A1D0(); gCsFrameCount = 0; actor->timer_0BC = 400; @@ -447,7 +447,7 @@ void SectorZ_8019A3E8(Actor* actor) { break; } - func_360_8002FC00(actor); + ActorAllRange_UpdateEvemyEvents(actor); SectorZ_8019A2F4(actor); } @@ -486,7 +486,7 @@ void SectorZ_UpdateEvents(Actor* actor) { if (gAllRangeCheckpoint != 0) { gHitCount = gSavedHitCount; } - D_360_800C9B4C = 1000000; + gAllRangeSpawnEvent = 1000000; case 2: if (SectorZ_8019AA9C(player) == 0) { @@ -1677,9 +1677,9 @@ void SectorZ_8019E234(Actor* actor) { actor->obj.rot.x += actor->unk_0F4.x; actor->obj.rot.y += actor->unk_0F4.y; - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { actor->timer_0C6 = 20; - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); if (actor->health <= 0) { @@ -1719,8 +1719,8 @@ void SectorZ_8019E454(Boss* boss) { Vec3f src; Vec3f dest; - if (boss->dmgType == DMG_zRot_0FC) { - boss->dmgType = 0; + if (boss->dmgType == DMG_UNK_100) { + boss->dmgType = DMG_NONE; boss->timer_050 = 10; boss->timer_052 = 60; boss->state = 1; diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index 5f482ee0..3ae62ac3 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -730,11 +730,11 @@ void Macbeth_8019BE50(Actor* actor) { } bool Macbeth_8019C4EC(Actor* actor) { - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->dmgPart == 1) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->iwork[7] = 15; D_i5_801BE320[22] = 0; D_i5_801BE320[4] = 120; @@ -899,8 +899,8 @@ void Macbeth_8019C778(Actor* actor) { break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } @@ -961,8 +961,8 @@ void Macbeth_8019CE88(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1098,8 +1098,8 @@ void Macbeth_8019D700(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0); Macbeth_801A015C(actor); Macbeth_8019A830(actor); - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1121,11 +1121,11 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 switch (*arg1) { case 0: - if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || + if (((actor->dmgType != DMG_NONE) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); actor->iwork[arg3 + 6] = 15; @@ -1135,8 +1135,8 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { (*arg1)++; } - } else if ((actor->dmgType != 0) && (actor->dmgPart == 0)) { - actor->dmgType = 0; + } else if ((actor->dmgType != DMG_NONE) && (actor->dmgPart == 0)) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } break; @@ -1158,12 +1158,12 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (*arg1)++; break; case 2: - if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || + if (((actor->dmgType != DMG_NONE) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5])) || ((actor->obj.id == OBJ_ACTOR_209) && (arg3 == 2))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); actor->iwork[arg3 + 6] = 20; @@ -1175,8 +1175,8 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 gHitCount++; (*arg1)++; } - } else if ((actor->dmgType != 0) && (actor->dmgPart == 0)) { - actor->dmgType = 0; + } else if ((actor->dmgType != DMG_NONE) && (actor->dmgPart == 0)) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } break; @@ -1264,8 +1264,8 @@ void Macbeth_8019E410(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1287,11 +1287,11 @@ f32 D_i5_801BE24C; void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f32 arg5, s32* arg6) { switch (*arg1) { case 0: - if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || + if (((actor->dmgType != DMG_NONE) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 10); actor->iwork[7] = 15; @@ -1301,8 +1301,8 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { (*arg1)++; } - } else if (actor->dmgType != 0) { - actor->dmgType = 0; + } else if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Macbeth_8019B580(actor, arg2); @@ -1314,11 +1314,11 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (*arg1)++; break; case 2: - if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || + if (((actor->dmgType != DMG_NONE) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.2f, 10); actor->iwork[7] = 15; @@ -1330,8 +1330,8 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (*arg1)++; } } else { - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -1372,8 +1372,8 @@ void Macbeth_8019EA60(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1393,11 +1393,11 @@ void Macbeth_8019EA60(Actor* actor) { void Macbeth_8019EBF8(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f32 arg5, s32* arg6) { switch (*arg1) { case 0: - if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || + if (((actor->dmgType != DMG_NONE) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 10); actor->iwork[7] = 15; @@ -1408,8 +1408,8 @@ void Macbeth_8019EBF8(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 gHitCount++; (*arg1)++; } - } else if (actor->dmgType != 0) { - actor->dmgType = 0; + } else if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Macbeth_8019B580(actor, arg2); @@ -1465,7 +1465,7 @@ void Macbeth_8019EE68(Actor* actor) { Macbeth_801A015C(actor); Macbeth_8019A87C(actor); if (gCameraShake == 20) { - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1641,11 +1641,11 @@ void Macbeth_8019F164(Actor* actor) { void Macbeth_8019FC54(Actor* actor, s32* arg1, s32* arg2, s32 arg3, s32 arg4, f32 arg5, f32 arg6, s32* arg7) { switch (*arg1) { case 0: - if (((actor->dmgType != 0) && (actor->dmgPart >= arg3) && (arg4 >= actor->dmgPart)) || + if (((actor->dmgType != DMG_NONE) && (actor->dmgPart >= arg3) && (arg4 >= actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; func_effect_8007C120(actor->obj.pos.x + arg5, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg6, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 10); actor->iwork[7] = 15; @@ -1659,8 +1659,8 @@ void Macbeth_8019FC54(Actor* actor, s32* arg1, s32* arg2, s32 arg3, s32 arg4, f3 } (*arg1)++; } - } else if (actor->dmgType != 0) { - actor->dmgType = 0; + } else if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Macbeth_8019B580(actor, arg2); @@ -1712,8 +1712,8 @@ void Macbeth_8019FF9C(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -2783,8 +2783,8 @@ void Macbeth_801A3E98(Actor* actor) { switch (actor->state) { case 0: - if ((actor->dmgType != 0) && (actor->dmgType != 3)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->dmgType != DMG_COLLISION)) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x1903205F, actor->sfxSource, 0); actor->state = 1; } @@ -2812,9 +2812,9 @@ void Macbeth_801A3E98(Actor* actor) { case 3: break; } - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } Math_SmoothStepToF(&actor->fwork[0], 30.0f, 0.4f, 10.0f, 0.0f); Math_SmoothStepToF(&actor->fwork[4], 30.0f, 0.4f, 10.0f, 0.0f); @@ -2946,7 +2946,7 @@ void Macbeth_801A46A0(Actor* actor) { } void Macbeth_801A49B8(Actor* actor) { - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { AUDIO_PLAY_SFX(0x29024003, actor->sfxSource, 0); actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -2955,7 +2955,7 @@ void Macbeth_801A49B8(Actor* actor) { gHitCount++; actor->state = 2; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } } @@ -3031,8 +3031,8 @@ void Macbeth_801A4B24(Actor* actor) { } break; case 5: - if ((actor->dmgType != 0) && (actor->dmgPart == 3)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->dmgPart == 3)) { + actor->dmgType = DMG_NONE; D_MA_801BE2F0[5] = 1; gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[gCurrentLevel]); @@ -3070,8 +3070,8 @@ void Macbeth_801A4B24(Actor* actor) { default: break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Math_SmoothStepToF(&actor->fwork[0], 30, 0.4f, actor->fwork[1], 0.0f); @@ -3153,7 +3153,7 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(arg1->x - actor->obj.pos.x) < 1000.0f) && (fabsf(arg1->z - actor->obj.pos.z) < 1500.0f) && (arg0 != i) && (actor->info.unk_16 != 2) && (actor->timer_0C2 == 0) && (Object_CheckSingleHitbox(arg1, actor->info.hitbox, &actor->obj.pos) != 0)) { - actor->dmgType = 1; + actor->dmgType = DMG_BEAM; actor->dmgPart = -1; actor->hitPos.x = arg1->x; actor->hitPos.y = arg1->y; @@ -3287,8 +3287,8 @@ void Macbeth_801A5E54(Actor* actor) { } Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0] + (actor->fwork[2] * 400.0f), 0.1f, 4.0f, 0.01f); } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -3311,8 +3311,8 @@ void Macbeth_801A5FD0(Actor* actor) { } Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1] + 356.0f, 0.4f, 20.0f, 0.01f); } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -3334,7 +3334,7 @@ void Macbeth_801A6144(Actor* actor) { switch (actor->state) { case 0: - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); @@ -3358,7 +3358,7 @@ void Macbeth_801A6144(Actor* actor) { actor->timer_0BC = 20; actor->state = 1; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } break; case 1: @@ -3410,8 +3410,8 @@ void Macbeth_801A67C8(Actor* actor) { if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -300.0f) { Object_Kill(&actor->obj, actor->sfxSource); } - if ((actor->dmgType != 0) && (actor->dmgPart == -1)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->dmgPart == -1)) { + actor->dmgType = DMG_NONE; if (actor->obj.pos.x <= gPlayer[0].pos.x) { actor->iwork[4] = 1; } else { @@ -4058,8 +4058,8 @@ void Macbeth_801A7E7C(Actor* actor) { actor->state = 4; break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->iwork[9] = 15; D_i5_801BE320[29] -= actor->damage; if (D_i5_801BE320[29] <= 0) { @@ -4489,7 +4489,7 @@ void Macbeth_801A7E7C(Actor* actor) { Math_SmoothStepToF(&D_i5_801BE368[32], actor->obj.pos.x + RAND_FLOAT(500.0f), 0.2f, 20.0f, 0.01f); Math_SmoothStepToF(&D_i5_801BE368[33], actor->obj.pos.y + RAND_FLOAT(100.0f), 0.2f, 10.0f, 0.01f); Math_SmoothStepToF(&D_i5_801BE368[34], actor->obj.pos.y + RAND_FLOAT(500.0f), 0.2f, 20.0f, 0.01f); - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { gPlayer[0].shields = 0; } if (((gGameFrameCount % 16) == 0)) { @@ -4535,8 +4535,8 @@ void Macbeth_801A7E7C(Actor* actor) { default: break; } - if ((actor->dmgType != 0) && (actor->state >= 2)) { - actor->dmgType = 0; + if ((actor->dmgType != DMG_NONE) && (actor->state >= 2)) { + actor->dmgType = DMG_NONE; if ((actor->dmgPart == 0) && (D_i5_801BE320[9] > 0) && ((gPlayer[0].trueZpos - actor->obj.pos.z) > 200.0f)) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); actor->iwork[7] = 15; @@ -4883,8 +4883,8 @@ void Macbeth_801AC438(Actor* actor) { Macbeth_8019A830(actor); break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -5372,8 +5372,8 @@ void Macbeth_801ADD68(Actor* actor) { } else if (actor->iwork[0] > 0) { actor->iwork[0] -= 1; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->iwork[7] = 15; actor->health -= actor->damage; @@ -5394,7 +5394,7 @@ void Macbeth_801ADD68(Actor* actor) { } break; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } static Vec3f D_i5_801BA784[8] = { @@ -5613,9 +5613,9 @@ void Macbeth_801AEC04(Actor* actor) { } else { actor->fwork[1] = 32.0f; } - if ((actor->dmgType != 0) && (actor->dmgPart == 0)) { + if ((actor->dmgType != DMG_NONE) && (actor->dmgPart == 0)) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->health -= actor->damage; actor->timer_0C6 = 15; if (actor->health <= 0) { @@ -6753,9 +6753,9 @@ void Macbeth_801B38E0(void) { } D_ctx_801782B8 = D_ctx_801782BC = D_ctx_801782C0 = D_ctx_801782D0 = gBossActive = D_ctx_8017828C = D_ctx_8017812C = - gPrevEventActorIndex = D_ctx_80177E78 = gRingPassCount = 0; - D_ctx_80177F10.x = D_ctx_80177F10.y = D_ctx_80177F10.z = D_ctx_80177E88.x = D_ctx_80177E88.y = D_ctx_80177E88.z = - 0.0f; + gPrevEventActorIndex = gFormationLeaderIndex = gRingPassCount = 0; + gFormationInitPos.x = gFormationInitPos.y = gFormationInitPos.z = gFormationInitRot.x = gFormationInitRot.y = + gFormationInitRot.z = 0.0f; for (i = 0; i < 10; i++) { gTeamArrowsViewPos[i].x = gTeamArrowsViewPos[i].y = gTeamArrowsViewPos[i].z = 100.0f; diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index b962632c..4030c037 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -304,7 +304,7 @@ void Titania_801895B8(Actor* actor) { actor->vel.y = sp48.y; actor->vel.z = sp48.z; - if (actor->dmgType > 0) { + if (actor->dmgType > DMG_NONE) { if (Rand_ZeroOne() <= 0.25f) { actor->itemDrop = DROP_SILVER_RING_50p; } else { @@ -353,8 +353,8 @@ void Titania_80189CC8(Actor* actor) { f32 temp; if (actor->health > 0) { - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { @@ -493,12 +493,12 @@ void Titania_8018A544(Actor* actor) { actor->unk_0C9 = 1; - if ((actor->scale != 1.0f) && (actor->dmgType == 3)) { + if ((actor->scale != 1.0f) && (actor->dmgType == DMG_COLLISION)) { Object_Kill(&actor->obj, actor->sfxSource); } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 15; actor->health += actor->damage; if (actor->scale == 1.0f) { @@ -652,7 +652,7 @@ void Titania_8018AB44(Actor* actor) { Object_Kill(&actor->obj, actor->sfxSource); break; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } static Vec3f D_i5_801B75AC = { -70.0f, 50.0f, 212.0f }; @@ -774,8 +774,8 @@ void Titania_8018B268(Actor* actor) { Actor* sp3C = actor->iwork[0]; Actor* sp38 = actor->iwork[1]; - if (actor->dmgType > 0) { - actor->dmgType = 0; + if (actor->dmgType > DMG_NONE) { + actor->dmgType = DMG_NONE; if (actor->health > 0) { actor->health -= actor->damage; if (actor->health <= 0) { @@ -1018,11 +1018,11 @@ void Titania_8018B9D0(Actor* actor) { actor->obj.rot.x = (var_fa0 / 130.0f) * 90.0f; - if (actor->dmgType == 1) { + if (actor->dmgType == DMG_BEAM) { AUDIO_PLAY_SFX(0x19020008, actor->sfxSource, 4); sp44 = actor->obj.pos.x - actor->hitPos.x; sp40 = fabsf(sp44); - actor->dmgType = 0; + actor->dmgType = DMG_NONE; actor->state = 1; actor->timer_0BC = 0; actor->timer_0BE = 0; @@ -1299,7 +1299,8 @@ void Titania_8018C8A8(Actor* actor) { actor->iwork[6]--; } - if ((actor->health > 0) && (actor->dmgType > 0) && (actor->dmgType != 3) && (actor->state >= 3)) { + if ((actor->health > 0) && (actor->dmgType > DMG_NONE) && (actor->dmgType != DMG_COLLISION) && + (actor->state >= 3)) { if ((actor->health > 0) && (actor->dmgPart >= 0) && (actor->dmgPart < 3)) { actor->iwork[5] = 10; if (actor->state == 4) { @@ -1321,10 +1322,10 @@ void Titania_8018C8A8(Actor* actor) { } else { AUDIO_PLAY_SFX(0x29034041, actor->sfxSource, 4); } - } else if (actor->dmgType == 1) { + } else if (actor->dmgType == DMG_BEAM) { func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } switch (actor->state) { @@ -1682,7 +1683,7 @@ void Titania_8018C8A8(Actor* actor) { actor->lockOnTimers[TEAM_ID_FOX] = 0; actor->info.targetOffset = 0.0f; } - actor->dmgType = 0; + actor->dmgType = DMG_NONE; } void Titania_8018E2D8(Actor* actor) { @@ -1874,8 +1875,8 @@ void Titania_8018E5F8(Actor* actor) { actor->fwork[3] = sp84.x; actor->fwork[4] = sp84.y; actor->fwork[5] = sp84.z; - if (actor->dmgType > 0) { - actor->dmgType = 0; + if (actor->dmgType > DMG_NONE) { + actor->dmgType = DMG_NONE; actor->timer_0C6 = 10; if (actor->health > 0) { actor->health -= actor->damage; @@ -3160,7 +3161,7 @@ void Titania_80192118(Boss* boss) { } } } - if (boss->dmgType != 0) { + if (boss->dmgType != DMG_NONE) { D_i5_801BBEF0[48]++; } if ((D_i5_801BBEF0[48] >= 3) || (boss->swork[31] >= 90)) { @@ -4729,7 +4730,7 @@ void Titania_80197A94(Boss* boss) { Vec3f sp3C; boss->swork[38]++; - if ((boss->dmgType != 0) && + if ((boss->dmgType != DMG_NONE) && (((boss->state >= 0) && (boss->state <= 1)) || ((boss->state >= 4) && (boss->state <= 6)))) { AUDIO_PLAY_SFX(0x29121007, boss->sfxSource, 4); boss->dmgType = DMG_NONE; diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index fb8b1707..43dbd929 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -324,7 +324,7 @@ void Andross_80188528(Actor* actor) { Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.2f, 0.5f, 0.0f); Math_SmoothStepToF(&actor->vel.y, 0.0f, 0.2f, 0.5f, 0.0f); Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.2f, 0.5f, 0.0f); - if (actor->dmgType != 0) { + if (actor->dmgType != DMG_NONE) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 5); @@ -385,7 +385,7 @@ void Andross_801888F4(Actor* actor) { if ((actor->timer_0BC % 2U) == 1) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); } - if ((actor->timer_0BC == 0) || (actor->dmgType != 0)) { + if ((actor->timer_0BC == 0) || (actor->dmgType != DMG_NONE)) { func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 7.0f, 20); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f, 5); @@ -3242,8 +3242,8 @@ void Andross_80192E94(Actor* actor) { break; } - if (actor->dmgType != 0) { - actor->dmgType = 0; + if (actor->dmgType != DMG_NONE) { + actor->dmgType = DMG_NONE; actor->health -= actor->damage; if (actor->health <= 0) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 06903226..425c48e4 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -2680,9 +2680,9 @@ void SectorY_801A0AC0(Player* player) { for (i = 0; i < 10; i++) { if (gPlayerShots[i].obj.status == OBJ_FREE) { - func_enmy2_8006ECBC(PLAYERSHOT_1, &gPlayerShots[i], 100, gActors[8].obj.pos.x, - gActors[8].obj.pos.y - 200.0f, sp80, sp98.x, sp98.y, sp98.z, sp88, sp84, - 0.0f); + Actor_SetupPlayerShot(PLAYERSHOT_1, &gPlayerShots[i], CS_SHOT_ID, gActors[8].obj.pos.x, + gActors[8].obj.pos.y - 200.0f, sp80, sp98.x, sp98.y, sp98.z, sp88, sp84, + 0.0f); gPlayerShots[i].unk_64 = 200; break; } @@ -2795,9 +2795,9 @@ void SectorY_801A0AC0(Player* player) { for (i = 0; i < 11; i++) { if (gPlayerShots[i].obj.status == OBJ_FREE) { - func_enmy2_8006ECBC(PLAYERSHOT_1, &gPlayerShots[i], 100, gActors[8].obj.pos.x, - gActors[8].obj.pos.y, gActors[8].obj.pos.z, sp98.x, sp98.y, sp98.z, - sp88, sp84, 0.0f); + Actor_SetupPlayerShot(PLAYERSHOT_1, &gPlayerShots[i], CS_SHOT_ID, gActors[8].obj.pos.x, + gActors[8].obj.pos.y, gActors[8].obj.pos.z, sp98.x, sp98.y, sp98.z, + sp88, sp84, 0.0f); gPlayerShots[i].unk_64 = 174; break; } @@ -3716,12 +3716,12 @@ void SectorY_Actor204_Update(Actor204* this) { this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SY_60340C0); } - if ((this->dmgType != 0) && (this->unk_046 != 3)) { + if ((this->dmgType != DMG_NONE) && (this->unk_046 != 3)) { - if (this->dmgType == 2) { + if (this->dmgType == DMG_EXPLOSION) { this->dmgPart = 1; } - this->dmgType = 0; + this->dmgType = DMG_NONE; if (this->dmgPart == 0) { this->iwork[18] = 15; AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); diff --git a/src/overlays/ovl_i6/fox_turret.c b/src/overlays/ovl_i6/fox_turret.c index e70a9689..8551a70e 100644 --- a/src/overlays/ovl_i6/fox_turret.c +++ b/src/overlays/ovl_i6/fox_turret.c @@ -51,7 +51,7 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset, shot->unk_64 = 40; shot->scale = 1.5f; - shot->playerNum = player->num; + shot->sourceId = player->num; } void Turret_801A581C(Player* player, f32 xOffset) { diff --git a/src/overlays/ovl_i6/fox_ve2.c b/src/overlays/ovl_i6/fox_ve2.c index 2fc75bbf..12e03bbc 100644 --- a/src/overlays/ovl_i6/fox_ve2.c +++ b/src/overlays/ovl_i6/fox_ve2.c @@ -21,7 +21,7 @@ void Venom2_80196288(Boss* boss) { } void Venom2_801962F4(Actor* actor) { - func_360_8002F69C(actor); + ActorAllRange_UpdateStarWolfEvents(actor); } static Vec3f D_i6_801A68B0[6] = { @@ -52,10 +52,10 @@ void Venom2_UpdateEvents(Actor* this) { player->pos.x = 0.0f; player->pos.z = 8000.0f; player->pos.y = 670.0f; - D_360_800C9B4C = 120; + gAllRangeSpawnEvent = 120; gStarWolfMsgTimer = 1000; } else { - D_360_800C9B4C = 320; + gAllRangeSpawnEvent = 320; gStarWolfMsgTimer = 1200; this->state = 1; player->pos.x = 0.0f; @@ -95,7 +95,7 @@ void Venom2_UpdateEvents(Actor* this) { break; case 2: Venom2_801962F4(this); - if (((D_360_800C9B4C + 100) < gAllRangeEventTimer) && (gActors[4].obj.status == OBJ_FREE) && + if (((gAllRangeSpawnEvent + 100) < gAllRangeEventTimer) && (gActors[4].obj.status == OBJ_FREE) && (gActors[5].obj.status == OBJ_FREE) && (gActors[6].obj.status == OBJ_FREE) && (gActors[7].obj.status == OBJ_FREE) && (this->timer_0BE == 0)) { this->timer_0BE = 80; @@ -130,7 +130,7 @@ void Venom2_UpdateEvents(Actor* this) { Math_SmoothStepToF(&player->cam.at.y, wolf->obj.pos.y, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, wolf->obj.pos.z, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0, 0.1f, 0.2f, 0.0f); - if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (D_360_800C9B4C + 300))) { + if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (gAllRangeSpawnEvent + 300))) { this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); diff --git a/tools/Torch b/tools/Torch index e6de3268..f24e7ec6 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit e6de326810c4f56810e98d4e2812995df29bfbb9 +Subproject commit f24e7ec63b81bfe24e4daa795cc1e1d690e789cd