diff --git a/.vscode/settings.json b/.vscode/settings.json index b0a698fa..f8e49b75 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -126,7 +126,11 @@ "ast_solar.h": "c", "ast_ve1_boss.h": "c", "ast_arwing.h": "c", - "ast_ending_award_back.h": "c" + "ast_ending_award_back.h": "c", + "fox_edisplay_assets.h": "c", + "ast_versus.h": "c", + "ast_macbeth.h": "c", + "ast_7_ti_1.h": "c" }, "C_Cpp_Runner.msvcBatchPath": "" } \ No newline at end of file diff --git a/assets/yaml/us/ast_andross.yaml b/assets/yaml/us/ast_andross.yaml index 5a57c8f8..bb080985 100644 --- a/assets/yaml/us/ast_andross.yaml +++ b/assets/yaml/us/ast_andross.yaml @@ -9,7 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' - + - '#include "sf64mesg.h"' D_ANDROSS_C000000: {type: TEXTURE, ctype: u8, format: IA8, width: 96, height: 28, offset: 0xC000000, symbol: D_ANDROSS_C000000} diff --git a/assets/yaml/us/ast_aquas.yaml b/assets/yaml/us/ast_aquas.yaml index 5c560ecc..2102f2cb 100644 --- a/assets/yaml/us/ast_aquas.yaml +++ b/assets/yaml/us/ast_aquas.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_AQ_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 96, height: 13, offset: 0x6000000, symbol: D_AQ_6000000 } diff --git a/assets/yaml/us/ast_area_6.yaml b/assets/yaml/us/ast_area_6.yaml index cdc4c6e1..0cdda545 100644 --- a/assets/yaml/us/ast_area_6.yaml +++ b/assets/yaml/us/ast_area_6.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_A6_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 104, height: 28, offset: 0x6000000, symbol: D_A6_6000000 } diff --git a/assets/yaml/us/ast_bolse.yaml b/assets/yaml/us/ast_bolse.yaml index 05a0c894..d4613401 100644 --- a/assets/yaml/us/ast_bolse.yaml +++ b/assets/yaml/us/ast_bolse.yaml @@ -9,7 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' - + - '#include "sf64mesg.h"' # Bolse Defense Outpost D_BO_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 168, height: 19, offset: 0x6000000, symbol: D_BO_6000000 } diff --git a/assets/yaml/us/ast_corneria.yaml b/assets/yaml/us/ast_corneria.yaml index 9d5ae453..473ee309 100644 --- a/assets/yaml/us/ast_corneria.yaml +++ b/assets/yaml/us/ast_corneria.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' # Corneria # Former Army Base diff --git a/assets/yaml/us/ast_macbeth.yaml b/assets/yaml/us/ast_macbeth.yaml index a520cdf0..cfca0b5c 100644 --- a/assets/yaml/us/ast_macbeth.yaml +++ b/assets/yaml/us/ast_macbeth.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_MA_6000000: {type: TEXTURE, format: IA8, ctype: u8, width: 160, height: 28, offset: 0x6000000, symbol: D_MA_6000000} diff --git a/assets/yaml/us/ast_meteo.yaml b/assets/yaml/us/ast_meteo.yaml index 6a0a7afe..2438785a 100644 --- a/assets/yaml/us/ast_meteo.yaml +++ b/assets/yaml/us/ast_meteo.yaml @@ -9,7 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' - + - '#include "sf64mesg.h"' # Meteo # Asteroid Field D_ME_6000000: diff --git a/assets/yaml/us/ast_sector_x.yaml b/assets/yaml/us/ast_sector_x.yaml index 9fb12c11..9368c695 100644 --- a/assets/yaml/us/ast_sector_x.yaml +++ b/assets/yaml/us/ast_sector_x.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_SX_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 176, height: 12, offset: 0x6000000, symbol: D_SX_6000000 } diff --git a/assets/yaml/us/ast_sector_y.yaml b/assets/yaml/us/ast_sector_y.yaml index 97011873..7ce858a7 100644 --- a/assets/yaml/us/ast_sector_y.yaml +++ b/assets/yaml/us/ast_sector_y.yaml @@ -9,6 +9,8 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' + - '#include "sf64mesg.h"' # Sector Y: Combat Zone D_SY_6000000: diff --git a/assets/yaml/us/ast_sector_z.yaml b/assets/yaml/us/ast_sector_z.yaml index 3a389cd4..e5f1cf18 100644 --- a/assets/yaml/us/ast_sector_z.yaml +++ b/assets/yaml/us/ast_sector_z.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' # Sector Z: Combat Zone D_SZ_6000000: diff --git a/assets/yaml/us/ast_solar.yaml b/assets/yaml/us/ast_solar.yaml index 2625e7a5..15b70a94 100644 --- a/assets/yaml/us/ast_solar.yaml +++ b/assets/yaml/us/ast_solar.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_SO_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 112, height: 13, offset: 0x6000000, symbol: D_SO_6000000} diff --git a/assets/yaml/us/ast_titania.yaml b/assets/yaml/us/ast_titania.yaml index 59a30934..051a4bff 100644 --- a/assets/yaml/us/ast_titania.yaml +++ b/assets/yaml/us/ast_titania.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_TI_6000000: {type: TEXTURE, format: IA8, ctype: u8, width: 96, height: 28, offset: 0x6000000, symbol: D_TI_6000000} diff --git a/assets/yaml/us/ast_training.yaml b/assets/yaml/us/ast_training.yaml index 654a8c55..a05776c5 100644 --- a/assets/yaml/us/ast_training.yaml +++ b/assets/yaml/us/ast_training.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_TR_6000000: { type: TEXTURE, format: IA8, offset: 0x6000000, width: 96, height: 12, ctype: u8, symbol: D_TR_6000000 } diff --git a/assets/yaml/us/ast_venom_1.yaml b/assets/yaml/us/ast_venom_1.yaml index 87d29851..80a26529 100644 --- a/assets/yaml/us/ast_venom_1.yaml +++ b/assets/yaml/us/ast_venom_1.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "sf64level.h"' - '#include "structs.h"' + - '#include "sf64mesg.h"' D_VE1_6000000: { type: TEXTURE, format: IA8, width: 96, height: 28, offset: 0x6000000, ctype: u8, symbol: D_VE1_6000000 } diff --git a/assets/yaml/us/ast_versus.yaml b/assets/yaml/us/ast_versus.yaml index 882cb731..4c94c08a 100644 --- a/assets/yaml/us/ast_versus.yaml +++ b/assets/yaml/us/ast_versus.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64mesg.h"' D_versus_3000000: { type: TEXTURE, ctype: u8, format: CI4, width: 16, height: 16, offset: 0x3000000, symbol: D_versus_3000000, tlut: 0x3000080 } diff --git a/assets/yaml/us/ast_zoness.yaml b/assets/yaml/us/ast_zoness.yaml index 29f9a4a2..7798cb8f 100644 --- a/assets/yaml/us/ast_zoness.yaml +++ b/assets/yaml/us/ast_zoness.yaml @@ -9,7 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' - + - '#include "sf64mesg.h"' D_ZO_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 112, height: 28, offset: 0x6000000, symbol: D_ZO_6000000} diff --git a/config.yml b/config.yml index 451b1cab..f4444753 100644 --- a/config.yml +++ b/config.yml @@ -13,4 +13,6 @@ f7475fb11e7e6830f82883412638e8390791ab87: headers: include/assets modding: src/assets enums: - - include/sf64object.h \ No newline at end of file + - include/sf64object.h + - include/sf64level.h + - include/sf64mesg.h \ No newline at end of file diff --git a/include/assets/ast_ending_expert.h b/include/assets/ast_ending_expert.h deleted file mode 100644 index dd36cef8..00000000 --- a/include/assets/ast_ending_expert.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef AST_ENDING_EXPERT_H -#define AST_ENDING_EXPERT_H - -#include "gfx.h" -#include "sf64object.h" -#include "structs.h" - -extern u16 gEndingExpertReward[]; -extern u16 gEndingNormalReward[]; - -#endif diff --git a/include/functions.h b/include/functions.h index d8227470..60da8481 100644 --- a/include/functions.h +++ b/include/functions.h @@ -487,12 +487,6 @@ s32 func_800A7974(Player* player, f32* hitboxData, s32* index, f32 xPos, f32 yPo bool func_800A8054(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, Vec3f* arg7, Vec3f* arg8); void Object_58_Initialize(Object_58*); -// fox_radio -s32 func_800BA7BC(u16*, s32); -void Radio_PlayMessage(u16*, RadioCharacterId); -void func_800BB388(void); -void func_800BB5D0(void); - // fox_versus s32 func_800C1E9C(void); void func_800C1ED4(void); diff --git a/include/gfx.h b/include/gfx.h index eba240b9..3158bc31 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -30,7 +30,7 @@ G_TX_RENDERTILE, 0, cmt, maskt, shiftt, cms, masks, shifts), \ gsDPSetTileSize(G_TX_RENDERTILE, dw, dh, \ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ - ((height)-1) << G_TEXTURE_IMAGE_FRAC), + ((height)-1) << G_TEXTURE_IMAGE_FRAC) #define gDPLoadTileTexture(pkt, timg, fmt, siz, width, height) \ { \ @@ -54,7 +54,7 @@ gsDPLoadSync(), \ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \ - CALC_DXT(width, siz##_BYTES)), + CALC_DXT(width, siz##_BYTES)) #define gSPSetOtherModeHi(pkt, settings) gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_BLENDMASK, 24, settings) #define gsSPSetOtherModeHi(settings) gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_BLENDMASK, 24, settings) diff --git a/include/prevent_context_reordering.h b/include/prevent_context_reordering.h index 254d4221..6aee0559 100644 --- a/include/prevent_context_reordering.h +++ b/include/prevent_context_reordering.h @@ -7,9 +7,9 @@ extern int Dummyhalf; // struct Dummy2 {int x;}; // struct Dummy3 {int x;}; // struct Dummy4 {int x;}; -struct Dummy5 {int x;}; -struct Dummy6 {int x;}; -struct Dummy7 {int x;}; +// struct Dummy5 {int x;}; +// struct Dummy6 {int x;}; +// struct Dummy7 {int x;}; struct Dummy8 {int x;}; struct Dummy9 {int x;}; struct Dummy10 {int x;}; diff --git a/include/sf64level.h b/include/sf64level.h index e6ebe7d2..d744cd7c 100644 --- a/include/sf64level.h +++ b/include/sf64level.h @@ -115,4 +115,149 @@ typedef enum VsStage { /* 2 */ VS_STAGE_SECTOR_Z, } VsStage; +#define EVENT_CMD(opcode, arg1, arg2) ((((opcode) & 0x7F) << 9) | ((arg1) & 0x1FF)), (arg2) +#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(health, info) EVENT_CMD(EVOP_INIT_ACTOR, health, info) +#define EVENT_SET_SPEED(speed, time, flag1, flag2) EVENT_CMD(EVOP_SET_SPEED, (((flag1) & 1) << 8) | (((flag2) & 1) << 7) | ((speed) & 0x7F), time) +#define EVENT_SET_ACCEL(speedTarget, time, flag1, flag2) EVENT_CMD(EVOP_SET_ACCEL, (((flag1) & 1) << 8) | (((flag2) & 1) << 7) | ((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_BRANCH(cond, cmd) EVENT_CMD(EVOP_BRANCH, cmd, cond) +#define EVENT_LOOP(cmd, count) EVENT_CMD(EVOP_LOOP, cmd, count) + +typedef enum EventOpcode { + /* 0 */ EVOP_SET_SPEED, + /* 1 */ EVOP_SET_ACCEL, + /* 2 */ EVOP_2, + /* 3 */ EVOP_3, + /* 4 */ EVOP_4, + /* 8 */ EVOP_8 = 8, + /* 9 */ EVOP_9, + /* 10 */ EVOP_10, + /* 11 */ EVOP_11, + /* 12 */ EVOP_12, + /* 16 */ EVOP_16 = 16, + /* 17 */ EVOP_17, + /* 18 */ EVOP_18, + /* 19 */ EVOP_19, + /* 20 */ EVOP_20, + /* 21 */ EVOP_21, + /* 24 */ EVOP_SET_ROTATE = 24, + /* 25 */ EVOP_STOP_ROTATE, + /* 40 */ EVOP_40 = 40, + /* 41 */ EVOP_41, + /* 42 */ EVOP_42, + /* 43 */ EVOP_43, + /* 44 */ EVOP_44, + /* 45 */ EVOP_45, + /* 46 */ EVOP_46, + /* 47 */ EVOP_47, + /* 48 */ EVOP_48, + /* 56 */ EVOP_56 = 56, + /* 57 */ EVOP_57, + /* 58 */ EVOP_58, + /* 59 */ EVOP_59, + /* 96 */ EVOP_BRANCH = 96, + /* 104 */ EVOP_INIT_ACTOR = 104, + /* 105 */ EVOP_105, + /* 112 */ EVOP_112 = 112, + /* 113 */ EVOP_113, + /* 116 */ EVOP_116 = 116, + /* 118 */ EVOP_118 = 118, + /* 119 */ EVOP_119, + /* 120 */ EVOP_PLAY_MSG, // play message. arg1 is portrait, arg2 is message ID + /* 121 */ EVOP_121, + /* 122 */ EVOP_122, + /* 124 */ EVOP_MAKE_TEXLINE = 124, + /* 125 */ EVOP_STOP_TEXLINE, + /* 126 */ EVOP_LOOP, + /* 127 */ EVOP_STOP_SCRIPT, // stop script +} EventOpcode; + +typedef enum EventCondition { + /* 0 */ EVC_0, + /* 1 */ EVC_1, + /* 2 */ EVC_2, + /* 3 */ EVC_3, + /* 4 */ EVC_4, + /* 5 */ EVC_5, + /* 6 */ EVC_6, + /* 7 */ EVC_7, + /* 8 */ EVC_8, + /* 9 */ EVC_9, + /* 10 */ EVC_10, + /* 11 */ EVC_11, + /* 12 */ EVC_12, + /* 13 */ EVC_13, + /* 14 */ EVC_14, + /* 15 */ EVC_15, + /* 16 */ EVC_16, + /* 17 */ EVC_17, + /* 18 */ EVC_18, + /* 19 */ EVC_19, + /* 20 */ EVC_20, + /* 21 */ EVC_21, + /* 22 */ EVC_22, + /* 23 */ EVC_23, + /* 24 */ EVC_24, + /* 25 */ EVC_25, + /* 26 */ EVC_26, + /* 27 */ EVC_27, + /* 28 */ EVC_28, + /* 29 */ EVC_29, + /* 30 */ EVC_30, + /* 31 */ EVC_31, + /* 32 */ EVC_32, + /* 33 */ EVC_33, + /* 34 */ EVC_34, + /* 35 */ EVC_35, + /* 36 */ EVC_36, + /* 37 */ EVC_37, + /* 38 */ EVC_38, + /* 39 */ EVC_39, + /* 40 */ EVC_40, + /* 41 */ EVC_41, + /* 42 */ EVC_42, + /* 43 */ EVC_43, + /* 44 */ EVC_44, + /* 45 */ EVC_45, + /* 46 */ EVC_46, + /* 47 */ EVC_47, + /* 48 */ EVC_48, + /* 49 */ EVC_49, + /* 50 */ EVC_50, + /* 51 */ EVC_51, + /* 52 */ EVC_52, + /* 53 */ EVC_53, + /* 54 */ EVC_54, + /* 55 */ EVC_55, + /* 56 */ EVC_56, + /* 57 */ EVC_57, + /* 58 */ EVC_58, + /* 59 */ EVC_59, + /* 60 */ EVC_60, + /* 61 */ EVC_61, + /* 62 */ EVC_62, + /* 63 */ EVC_63, + /* 64 */ EVC_64, + /* 65 */ EVC_65, + /* 66 */ EVC_66, + /* 67 */ EVC_67, + /* 68 */ EVC_68, + /* 69 */ EVC_69, + /* 100 */ EVC_100=100, +} EventCondition; + +typedef enum TexLineColor { + /* 0 */ TXLC_WHITE, + /* 1 */ TXLC_LIGHT_BLUE, + /* 2 */ TXLC_BLUE, + /* 3 */ TXLC_GREEN, + /* 4 */ TXLC_RED, + /* 5 */ TXLC_YELLOW, +} TexLineColor; + #endif diff --git a/include/sf64mesg.h b/include/sf64mesg.h index 23fdf80d..81c232f9 100644 --- a/include/sf64mesg.h +++ b/include/sf64mesg.h @@ -18,7 +18,7 @@ bool Message_DisplayText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 len) void Message_DisplayScrollingText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 yRangeHi, s32 yRangeLo, s32 len); bool Message_IsPrintingChar(u16* msgPtr, s32 charPos); -typedef enum { +typedef enum RadioCharacterId { RCID_FOX = 0, RCID_FOX_OPEN, RCID_FOX_RED = 5, @@ -99,6 +99,10 @@ typedef enum { RCID_FOX_EXPERT_OPEN, } RadioCharacterId; +void Radio_PlayMessage(u16*, enum RadioCharacterId); +void func_800BB388(void); +void func_800BB5D0(void); + typedef enum { MSGCHAR_END, MSGCHAR_NWL, diff --git a/include/sf64object.h b/include/sf64object.h index af71cd67..1c2db480 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -85,17 +85,17 @@ typedef struct { } ObjectInit; // size = 0x14 typedef struct { - /* 0x00 */ Gfx* unk_00; - /* 0x04 */ f32* unk_04; - /* 0x08 */ f32 unk_08; - /* 0x0C */ f32 unk_0C; + /* 0x00 */ Gfx* dList; + /* 0x04 */ f32* hitbox; + /* 0x08 */ f32 scale; + /* 0x0C */ f32 info_unk_10; /* 0x10 */ f32 unk_10; - /* 0x14 */ u8 unk_14; - /* 0x15 */ u8 unk_15; - /* 0x16 */ u8 unk_16; - /* 0x17 */ u8 unk_17; - /* 0x18 */ f32 unk_18; - /* 0x1C */ u8 unk_1C; + /* 0x14 */ u8 info_unk_16; + /* 0x15 */ u8 info_unk_14; + /* 0x16 */ u8 sfx; + /* 0x17 */ u8 info_unk_19; + /* 0x18 */ f32 info_unk_1C; + /* 0x1C */ u8 bonus; } UnkStruct_D003C; // size = 0x20 typedef enum ObjectStatus { @@ -275,8 +275,8 @@ typedef struct { /* 0x0D4 */ s16 unk_0D4; /* 0x0D6 */ u16 damage; /* 0x0D8 */ Vec3f unk_0D8; - /* 0x0E4 */ s16 unk_0E4; - /* 0x0E6 */ s16 unk_0E6; + /* 0x0E4 */ s16 aiType; + /* 0x0E6 */ s16 aiIndex; /* 0x0E8 */ Vec3f vel; /* 0x0F4 */ Vec3f unk_0F4; /* 0x100 */ f32 sfxSource[3]; @@ -286,57 +286,6 @@ typedef struct { /* 0x18C */ Vec3f vwork[30]; } Actor; // size = 0x2F4 -#define EVENT_CMD(opcode, arg1, arg2) ((((opcode) & 0x7F) << 9) | ((arg1) & 0x1FF)), (arg2) - -typedef enum EventOpcode { - /* 0 */ EVOP_0, - /* 1 */ EVOP_1, - /* 2 */ EVOP_2, - /* 3 */ EVOP_3, - /* 4 */ EVOP_4, - /* 8 */ EVOP_8 = 8, - /* 9 */ EVOP_9, - /* 10 */ EVOP_10, - /* 11 */ EVOP_11, - /* 12 */ EVOP_12, - /* 16 */ EVOP_16 = 16, - /* 17 */ EVOP_17, - /* 18 */ EVOP_18, - /* 19 */ EVOP_19, - /* 20 */ EVOP_20, - /* 21 */ EVOP_21, - /* 24 */ EVOP_24 = 24, - /* 25 */ EVOP_25, - /* 40 */ EVOP_40 = 40, - /* 41 */ EVOP_41, - /* 42 */ EVOP_42, - /* 43 */ EVOP_43, - /* 44 */ EVOP_44, - /* 45 */ EVOP_45, - /* 46 */ EVOP_46, - /* 47 */ EVOP_47, - /* 48 */ EVOP_48, - /* 56 */ EVOP_56 = 56, - /* 57 */ EVOP_57, - /* 58 */ EVOP_58, - /* 59 */ EVOP_59, - /* 96 */ EVOP_96 = 96, - /* 104 */ EVOP_104 = 104, - /* 105 */ EVOP_105, - /* 112 */ EVOP_112 = 112, - /* 113 */ EVOP_113, - /* 116 */ EVOP_116 = 116, - /* 118 */ EVOP_118 = 118, - /* 119 */ EVOP_119, - /* 120 */ EVOP_120, // play message. arg1 is portrait, arg2 is message ID - /* 121 */ EVOP_121, - /* 122 */ EVOP_122, - /* 124 */ EVOP_124 = 124, - /* 125 */ EVOP_125, - /* 126 */ EVOP_126, - /* 127 */ EVOP_127, // stop script -} EventOpcode; - typedef enum ObjectId { /* -1 */ OBJ_INVALID=-1, /* 0 */ OBJ_80_0, diff --git a/src/main/fox_360.c b/src/main/fox_360.c index 92589a6d..34d17e0f 100644 --- a/src/main/fox_360.c +++ b/src/main/fox_360.c @@ -368,20 +368,20 @@ void func_8002F180(void) { actor->obj.id = OBJ_ACTOR_197; Object_SetInfo(&actor->info, actor->obj.id); if (i == 0) { - actor->unk_0E4 = 1000; + actor->aiType = 1000; } else { actor->obj.pos.x = D_800C9A9C[i].x; actor->obj.pos.y = D_800C9A9C[i].y; actor->obj.pos.z = D_800C9A9C[i].z; - actor->unk_0E4 = D_800C9ACC[i]; + actor->aiType = D_800C9ACC[i]; if (gCurrentLevel == LEVEL_KATINA) { - actor->unk_0E6 = D_800C9AEC[i]; + actor->aiIndex = D_800C9AEC[i]; } else { - actor->unk_0E6 = D_800C9ADC[i]; + actor->aiIndex = D_800C9ADC[i]; } actor->state = 2; actor->unk_0F4.y = 180.0f; - if (actor->unk_0E6 < 0) { + if (actor->aiIndex < 0) { actor->state = 3; } actor->health = 50; @@ -389,7 +389,7 @@ void func_8002F180(void) { actor->unk_0C9 = 1; } actor->iwork[11] = 1; - if (actor->unk_0E4 < 4) { + if (actor->aiType < 4) { AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800CC01C); actor->info.unk_1C = 0.0f; @@ -413,9 +413,9 @@ void func_8002F3E0(void) { actor->obj.pos.y = D_800C9AFC[i].y; actor->obj.pos.z = D_800C9AFC[i].z; actor->obj.id = OBJ_ACTOR_197; - actor->unk_0E4 = i + 4; - actor->unk_0E6 = D_800C9B2C[i]; - gActors[actor->unk_0E6].unk_0E6 = -1; + actor->aiType = i + 4; + actor->aiIndex = D_800C9B2C[i]; + gActors[actor->aiIndex].aiIndex = -1; actor->health = 100; actor->unk_0C9 = 1; actor->unk_0F4.y = 225.0f; @@ -492,16 +492,16 @@ void func_8002F69C(Actor* actor) { for (i = 1, otherActor = &gActors[1]; i < 8; i++, otherActor++) { if ((otherActor->obj.status == OBJ_ACTIVE) && (otherActor->state == 2) && (otherActor->health < 70) && (otherActor->timer_0C6 != 0) && (otherActor->unk_0D4 == 1)) { - if ((gActors[otherActor->unk_0E6].state == 3) && (gActors[otherActor->unk_0E6].unk_0E4 < 8)) { - gActors[otherActor->unk_0E6].iwork[2] = 0; - gActors[otherActor->unk_0E6].state = 2; - gActors[otherActor->unk_0E6].unk_0E6 = otherActor->unk_0E4; - if (D_800CA234 == &gActors[otherActor->unk_0E6]) { + if ((gActors[otherActor->aiIndex].state == 3) && (gActors[otherActor->aiIndex].aiType < 8)) { + gActors[otherActor->aiIndex].iwork[2] = 0; + gActors[otherActor->aiIndex].state = 2; + gActors[otherActor->aiIndex].aiIndex = otherActor->aiType; + if (D_800CA234 == &gActors[otherActor->aiIndex]) { D_800CA234 = NULL; D_Timer_800CA238 = 0; } - if (gActors[otherActor->unk_0E6].iwork[3] == 0) { - switch (gActors[otherActor->unk_0E6].unk_0E4) { + if (gActors[otherActor->aiIndex].iwork[3] == 0) { + switch (gActors[otherActor->aiIndex].aiType) { case 1: func_8002F5F4(gMsg_ID_9160, RCID_FALCO); break; @@ -512,28 +512,28 @@ void func_8002F69C(Actor* actor) { func_8002F5F4(gMsg_ID_9180, RCID_PEPPY); break; } - gActors[otherActor->unk_0E6].iwork[3] = 200; + gActors[otherActor->aiIndex].iwork[3] = 200; } } - if (otherActor->unk_0E4 == 4) { + if (otherActor->aiType == 4) { if (gCurrentLevel != LEVEL_VENOM_2) { otherActor->state = 3; otherActor->unk_04E = 300; } } else { otherActor->state = 3; - otherActor->unk_0E6 = -1; + otherActor->aiIndex = -1; } } } if (gTeamShields[1] <= 0) { - gActors[5].unk_0E6 = 0; + gActors[5].aiIndex = 0; } if (gTeamShields[2] <= 0) { - gActors[7].unk_0E6 = 0; + gActors[7].aiIndex = 0; } if (gTeamShields[3] <= 0) { - gActors[6].unk_0E6 = 0; + gActors[6].aiIndex = 0; } } } @@ -548,15 +548,15 @@ void func_8002FB4C(Actor* actor) { for (i = 10, actor1 = &gActors[10]; i < 60; i++, actor1++) { if ((actor1->obj.status == OBJ_ACTIVE) && (actor1->obj.id == OBJ_ACTOR_197) && (actor1->unk_0B6 == 0) && - (actor1->unk_0E6 < 0)) { + (actor1->aiIndex < 0)) { var_a0 = false; for (j = 1, actor2 = &gActors[1]; j < 4; j++, actor2++) { - if ((j != actor->index) && (i == actor2->unk_0E6)) { + if ((j != actor->index) && (i == actor2->aiIndex)) { var_a0 = true; } } if (!var_a0) { - actor->unk_0E6 = i; + actor->aiIndex = i; actor->state = 2; actor->iwork[2] = 0; break; @@ -570,25 +570,25 @@ void func_8002FC00(Actor* actor) { s32 i; for (i = 0, otherActor = &gActors[10]; i < 50; i++, otherActor++) { - if ((otherActor->obj.status == OBJ_DYING) && (otherActor->unk_0E6 > 0) && (otherActor->unk_0E6 < 4)) { + if ((otherActor->obj.status == OBJ_DYING) && (otherActor->aiIndex > 0) && (otherActor->aiIndex < 4)) { Actor* actor2; s32 j; for (j = 0, actor2 = &gActors[10]; j < 51; j++, actor2++) { if ((actor2->obj.status == OBJ_ACTIVE) && (actor2->state == 2) && - (actor2->unk_0E6 == otherActor->unk_0E6)) { + (actor2->aiIndex == otherActor->aiIndex)) { return; } } - if (gTeamShields[otherActor->unk_0E6] > 0) { - func_8002FB4C(&gActors[otherActor->unk_0E6]); + if (gTeamShields[otherActor->aiIndex] > 0) { + func_8002FB4C(&gActors[otherActor->aiIndex]); if ((otherActor->iwork[5] != 0) && (otherActor->unk_0D4 == 1) && - (gActors[otherActor->unk_0E6].iwork[3] == 0)) { - if (D_800CA234 == &gActors[otherActor->unk_0E6]) { + (gActors[otherActor->aiIndex].iwork[3] == 0)) { + if (D_800CA234 == &gActors[otherActor->aiIndex]) { D_800CA234 = NULL; D_Timer_800CA238 = 0; } - switch (gActors[otherActor->unk_0E6].unk_0E4) { + switch (gActors[otherActor->aiIndex].aiType) { case 1: func_8002F5F4(gMsg_ID_9160, RCID_FALCO); break; @@ -599,8 +599,8 @@ void func_8002FC00(Actor* actor) { func_8002F5F4(gMsg_ID_9180, RCID_PEPPY); break; } - gActors[otherActor->unk_0E6].iwork[3] = 200; - gActors[otherActor->unk_0E6].timer_0C4 = 600; + gActors[otherActor->aiIndex].iwork[3] = 200; + gActors[otherActor->aiIndex].timer_0C4 = 600; } } } @@ -768,7 +768,7 @@ s32 func_8003049C(Actor* actor) { } sp44 = 1200.0f; var_ft5 = 650.0f; - if (actor->unk_0E4 < 8) { + if (actor->aiType < 8) { var_ft5 = 720.0f; } @@ -795,14 +795,14 @@ void func_8003088C(Actor* actor) { Vec3f sp3C; if (actor->unk_0D0 != 0) { - if (actor->unk_0E4 == 100) { + if (actor->aiType == 100) { actor->unk_0D0 = 0; } - if ((actor->unk_0D0 >= 2) && (actor->unk_0E4 >= 4) && (actor->unk_0E4 < 8)) { + if ((actor->unk_0D0 >= 2) && (actor->aiType >= 4) && (actor->aiType < 8)) { actor->damage = 10; actor->timer_0C2 = 10; } - if (((actor->unk_0E4 < 4) || (actor->unk_0E4 == 9) || (actor->unk_0E4 == 8)) && (actor->unk_0D0 == 2)) { + if (((actor->aiType < 4) || (actor->aiType == 9) || (actor->aiType == 8)) && (actor->unk_0D0 == 2)) { actor->unk_0D0 = 0; } if ((actor->unk_0D0 == 2) && (actor->fwork[22] > 0.0f)) { @@ -814,8 +814,8 @@ void func_8003088C(Actor* actor) { if (actor->unk_0D0 != 0) { var_a1 = false; if ((actor->unk_0B6 == 3) || - ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (actor->unk_0E4 >= 4)) || - ((gCurrentLevel == LEVEL_VENOM_2) && (actor->unk_0E4 >= 4) && (actor->unk_0E4 < 10) && + ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (actor->aiType >= 4)) || + ((gCurrentLevel == LEVEL_VENOM_2) && (actor->aiType >= 4) && (actor->aiType < 10) && (actor->unk_0D0 == 2))) { actor->damage = 0; var_a1 = true; @@ -823,21 +823,21 @@ void func_8003088C(Actor* actor) { actor->unk_0D4 = 0; } } - if (actor->unk_0E4 >= 4) { - if (((actor->unk_0D0 != 3) || (actor->unk_0E4 != 4)) && - ((actor->unk_0E4 != 200) || (actor->unk_0D0 != 2))) { + if (actor->aiType >= 4) { + if (((actor->unk_0D0 != 3) || (actor->aiType != 4)) && + ((actor->aiType != 200) || (actor->unk_0D0 != 2))) { actor->health -= actor->damage; } - } else if ((actor->unk_0E4 < 4) && (actor->state != 6)) { - if (actor->unk_0E4 == 1) { - gTeamDamage[actor->unk_0E4] = actor->damage; + } else if ((actor->aiType < 4) && (actor->state != 6)) { + if (actor->aiType == 1) { + gTeamDamage[actor->aiType] = actor->damage; } else { - gTeamDamage[actor->unk_0E4] = actor->damage * 2; + gTeamDamage[actor->aiType] = actor->damage * 2; } } if (actor->health <= 0) { actor->health = 0; - if (actor->unk_0E4 == 200) { + if (actor->aiType == 200) { func_i4_80199900(actor, 1); if (actor->unk_0D4 == 1) { if (gActors[8].obj.status == OBJ_ACTIVE) { @@ -897,7 +897,7 @@ void func_8003088C(Actor* actor) { actor->timer_0BC = RAND_INT(50.0f); } } - if ((actor->unk_0E4 >= 4) && (actor->unk_0E4 < 8)) { + if ((actor->aiType >= 4) && (actor->aiType < 8)) { actor->timer_0BC = RAND_INT(40.0f) + 60.0f; } if (actor->damage >= 20) { @@ -909,7 +909,7 @@ void func_8003088C(Actor* actor) { } D_8015F921++; } - switch (actor->unk_0E4) { + switch (actor->aiType) { case 4: D_80177CD0[0] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { @@ -943,12 +943,12 @@ void func_8003088C(Actor* actor) { } break; } - if ((actor->unk_0E4 >= 4) && (actor->unk_0E4 < 8)) { + if ((actor->aiType >= 4) && (actor->aiType < 8)) { D_8015F904 = 150; } switch (actor->unk_0D4) { case 1: - if (actor->unk_0E4 >= 10) { + if (actor->aiType >= 10) { switch (actor->iwork[2]) { case 1: func_8002F5F4(gMsg_ID_20170, RCID_FALCO); @@ -965,7 +965,7 @@ void func_8003088C(Actor* actor) { case 102: case 103: case 104: - if ((actor->unk_0E4 >= 4) && (actor->unk_0E4 < 8)) { + if ((actor->aiType >= 4) && (actor->aiType < 8)) { if ((D_80177CD0[0] + D_80177CD0[1] + D_80177CD0[2] + D_80177CD0[3]) == 0) { switch (actor->unk_0D4) { case 102: @@ -1003,13 +1003,13 @@ void func_8003088C(Actor* actor) { actor->timer_0C6 = 20; actor->iwork[8] = 20; } - if (actor->unk_0E4 == 200) { + if (actor->aiType == 200) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); } else if (actor->iwork[7] == 0) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); } func_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); - if (actor->unk_0E4 < 100) { + if (actor->aiType < 100) { Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); sp48.x = 30.0f; if (Rand_ZeroOne() < 0.5f) { @@ -1032,7 +1032,7 @@ void func_8003088C(Actor* actor) { } if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { if (actor->unk_0D0 == 3) { - switch (actor->unk_0E4) { + switch (actor->aiType) { case 1: func_8002F5F4(gMsg_ID_20210, RCID_FALCO); break; @@ -1047,17 +1047,17 @@ void func_8003088C(Actor* actor) { break; } } else if (actor->unk_0D4 < 105) { - if (actor->unk_0E4 >= 4) { + if (actor->aiType >= 4) { if (actor->unk_0D4 == 1) { if ((gCurrentLevel == LEVEL_KATINA) && (actor->unk_0B6 == 1) && (D_8015F920 == 0)) { D_8015F920 = 1; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); - } else if (actor->unk_0E4 == 8) { + } else if (actor->aiType == 8) { func_8002F5F4(gMsg_ID_20084, RCID_KATT); - } else if (actor->unk_0E4 == 9) { + } else if (actor->aiType == 9) { func_8002F5F4(gMsg_ID_20085, RCID_BILL); } else if (gCurrentLevel == LEVEL_VENOM_2) { - switch (actor->unk_0E4) { + switch (actor->aiType) { case 4: func_8002F5F4(gMsg_ID_19454, RCID_WOLF); break; @@ -1074,7 +1074,7 @@ void func_8003088C(Actor* actor) { } } } else if (actor->unk_0D4 == 1) { - switch (actor->unk_0E4) { + switch (actor->aiType) { case 1: func_8002F5F4(gMsg_ID_20060, RCID_FALCO); break; @@ -1086,15 +1086,15 @@ void func_8003088C(Actor* actor) { break; } } - } else if ((actor->unk_0E4 < 4) && (actor->iwork[6] != 0) && (actor->iwork[2] != 0)) { - switch (actor->unk_0E4) { + } else if ((actor->aiType < 4) && (actor->iwork[6] != 0) && (actor->iwork[2] != 0)) { + switch (actor->aiType) { case 1: if (gTeamShields[1] >= 90) { func_8002F5F4(gMsg_ID_9130, RCID_FALCO); } else { Radio_PlayMessage(gMsg_ID_9151, RCID_FALCO); } - if ((D_800CA234 == NULL) || (gTeamShields[actor->unk_0E4] <= 50)) { + if ((D_800CA234 == NULL) || (gTeamShields[actor->aiType] <= 50)) { D_800CA234 = actor; D_Timer_800CA238 = 320; } @@ -1105,7 +1105,7 @@ void func_8003088C(Actor* actor) { } else { Radio_PlayMessage(gMsg_ID_9152, RCID_SLIPPY); } - if ((D_800CA234 == NULL) || (gTeamShields[actor->unk_0E4] <= 50)) { + if ((D_800CA234 == NULL) || (gTeamShields[actor->aiType] <= 50)) { D_800CA234 = actor; D_Timer_800CA238 = 320; } @@ -1116,7 +1116,7 @@ void func_8003088C(Actor* actor) { } else { Radio_PlayMessage(gMsg_ID_9153, RCID_PEPPY); } - if ((D_800CA234 == NULL) || (gTeamShields[actor->unk_0E4] <= 50)) { + if ((D_800CA234 == NULL) || (gTeamShields[actor->aiType] <= 50)) { D_800CA234 = actor; D_Timer_800CA238 = 320; } @@ -1189,13 +1189,13 @@ void func_800319AC(Actor* this) { s32 pad2; s32 pad3; - if (this->unk_0E4 == 1000) { + if (this->aiType == 1000) { this->timer_0C2 = 10; this->info.unk_1C = 0.0f; func_8003010C(this); return; } - if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->unk_0E4 >= 4)) { + if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= 4)) { switch (RAND_INT(3.9f)) { case 0: case 1: @@ -1216,7 +1216,7 @@ void func_800319AC(Actor* this) { this->iwork[16] = 0; } } - if ((this->timer_0CA[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->unk_0E4 < 10) && + if ((this->timer_0CA[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < 10) && (this->timer_0CA[0] < 5) && !(gGameFrameCount & 0x1F)) { this->iwork[16] = 10; } @@ -1275,10 +1275,10 @@ void func_800319AC(Actor* this) { } else { this->iwork[11] = 1; } - if (this->unk_0E4 < 10) { + if (this->aiType < 10) { func_80031858(this); if (this->iwork[10] == 200) { - switch (this->unk_0E4) { + switch (this->aiType) { case 4: case 5: case 6: @@ -1320,11 +1320,11 @@ void func_800319AC(Actor* this) { } sp104 = 0; this->iwork[5] = 0; - if ((this->unk_0E4 > 0) && (this->unk_0E4 < 4) && (gTeamShields[this->unk_0E4] <= 0) && (this->state != 6)) { + if ((this->aiType > 0) && (this->aiType < 4) && (gTeamShields[this->aiType] <= 0) && (this->state != 6)) { this->state = 6; if (this->timer_0C2 < 100) { - gTeamShields[this->unk_0E4] = 1; - switch (this->unk_0E4) { + gTeamShields[this->aiType] = 1; + switch (this->aiType) { case 1: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; @@ -1341,8 +1341,8 @@ void func_800319AC(Actor* this) { AUDIO_PLAY_SFX(0x09000002, this->sfxSource, 0); this->unk_046 = 0; } - gTeamShields[this->unk_0E4] = -1; - gTeamDamage[this->unk_0E4] = 0; + gTeamShields[this->aiType] = -1; + gTeamDamage[this->aiType] = 0; this->iwork[1] = 0; this->timer_0C2 = 10000; } @@ -1352,8 +1352,8 @@ void func_800319AC(Actor* this) { this->iwork[11] = 2; this->fwork[1] = 45.0f; this->fwork[3] = 2.0f; - gTeamShields[this->unk_0E4] = -1; - gTeamDamage[this->unk_0E4] = 0; + gTeamShields[this->aiType] = -1; + gTeamDamage[this->aiType] = 0; if (gCurrentLevel == LEVEL_SECTOR_Z) { this->fwork[4] = D_800C9B50[this->unk_046].x; this->fwork[5] = D_800C9B50[this->unk_046].y; @@ -1385,7 +1385,7 @@ void func_800319AC(Actor* this) { this->fwork[1] = 200.0f; } if (this->timer_0BC == 0) { - if (this->unk_0E4 == 4) { + if (this->aiType == 4) { this->state = 3; if (gCurrentLevel == LEVEL_VENOM_2) { this->unk_04E = 200; @@ -1394,7 +1394,7 @@ void func_800319AC(Actor* this) { } } else { this->state = 2; - if (this->unk_0E4 == 8) { + if (this->aiType == 8) { this->fwork[7] = 360.0f; this->fwork[8] = 0.0f; } @@ -1410,7 +1410,7 @@ void func_800319AC(Actor* this) { } if (this->timer_0BC == 0) { this->state = 3; - if ((gCurrentLevel == LEVEL_BOLSE) && (this->unk_0E6 >= 0)) { + if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex >= 0)) { this->state = 2; } } @@ -1423,30 +1423,30 @@ void func_800319AC(Actor* this) { spEC = fabsf(this->fwork[4] - this->obj.pos.x); spE8 = fabsf(this->fwork[6] - this->obj.pos.z); sp10F = 0xB; - if (this->unk_0E4 == 1) { + if (this->aiType == 1) { spF0 = 0.5f; } else if ((this->unk_0B6 != 2) && (this->unk_0B6 == 3)) { spF0 = 0.5f; } - if (this->unk_0E6 == 0) { + if (this->aiIndex == 0) { spF0 = 0.2f; } - if (this->unk_0E6 < 0) { + if (this->aiIndex < 0) { this->state = 3; } else { - if (gActors[this->unk_0E6].unk_0E4 == 200) { + if (gActors[this->aiIndex].aiType == 200) { spF0 = 0.8f; spF4 = spF8 = 3000.0f; this->fwork[3] = 2.0f; } - if (this->unk_0E6 == 0) { + if (this->aiIndex == 0) { if (gCurrentLevel != LEVEL_VENOM_2) { if (((gPlayer[0].unk_4DC != 0) && (this->iwork[4] > 10)) || ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0))) { this->state = 3; this->unk_04E = 300; this->timer_0BC = 160; - if (this->unk_0E4 == 4) { + if (this->aiType == 4) { func_8002F5F4(gMsg_ID_9369, RCID_WOLF); } break; @@ -1455,8 +1455,8 @@ void func_800319AC(Actor* this) { break; } } - if ((this->unk_0E4 >= 4) && (this->unk_0E4 != 8) && - ((gCurrentLevel != LEVEL_VENOM_2) || (this->unk_0E4 != 4))) { + if ((this->aiType >= 4) && (this->aiType != 8) && + ((gCurrentLevel != LEVEL_VENOM_2) || (this->aiType != 4))) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 100.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; @@ -1467,11 +1467,11 @@ void func_800319AC(Actor* this) { this->fwork[6] = gPlayer[0].unk_138 + spC4; this->fwork[1] = gPlayer[0].unk_0D0 + 10.0f; } - if ((gActors[0].state == 6) && (this->unk_0E4 < 4)) { + if ((gActors[0].state == 6) && (this->aiType < 4)) { this->fwork[3] = 3.0f; this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; this->iwork[11] = 2; - } else if ((gCurrentLevel == LEVEL_VENOM_2) && (this->unk_0E4 >= 4)) { + } else if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { this->fwork[3] = 1.6f; this->fwork[1] = 55.0f; } else { @@ -1485,23 +1485,23 @@ void func_800319AC(Actor* this) { } else { spF0 = 0.7f; } - } else if (this->unk_0E6 != 100) { - if (this->unk_0E4 >= 10) { + } else if (this->aiIndex != 100) { + if (this->aiType >= 10) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 200.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; } - this->fwork[4] = gActors[this->unk_0E6].obj.pos.x + spCC; - this->fwork[5] = gActors[this->unk_0E6].obj.pos.y + spC8; - this->fwork[6] = gActors[this->unk_0E6].obj.pos.z + spC4; - if ((gCurrentLevel == LEVEL_VENOM_2) && (this->unk_0E4 >= 4)) { + this->fwork[4] = gActors[this->aiIndex].obj.pos.x + spCC; + this->fwork[5] = gActors[this->aiIndex].obj.pos.y + spC8; + this->fwork[6] = gActors[this->aiIndex].obj.pos.z + spC4; + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { this->fwork[1] = 55.0f; this->fwork[3] = 1.6f; - } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->unk_0E4 >= 0xB)) { + } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType >= 0xB)) { this->fwork[3] = 1.4f; this->fwork[1] = 50.0f; } else { - this->fwork[1] = gActors[this->unk_0E6].fwork[0] + 10.0f; + this->fwork[1] = gActors[this->aiIndex].fwork[0] + 10.0f; if (this->fwork[1] < 30.0f) { this->fwork[1] = 30.0f; } @@ -1513,11 +1513,11 @@ void func_800319AC(Actor* this) { this->fwork[6] = gBosses[0].obj.pos.z; this->fwork[1] = 40.0f; } - if ((this->unk_0E6 >= 0) && (this->unk_0E6 != 100) && (gActors[0].state != 6)) { + if ((this->aiIndex >= 0) && (this->aiIndex != 100) && (gActors[0].state != 6)) { if (spE8 < spF8) { if (spEC < spF8) { - if (this->unk_0E6 != 0) { - this->fwork[1] = gActors[this->unk_0E6].fwork[0] - 5.0f; + if (this->aiIndex != 0) { + this->fwork[1] = gActors[this->aiIndex].fwork[0] - 5.0f; } else { this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; if ((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5) && @@ -1535,11 +1535,11 @@ void func_800319AC(Actor* this) { this->iwork[5] = 1; if (!((this->index + gGameFrameCount) & sp10F) && (Rand_ZeroOne() < spF0) && func_80031900(this) && ((gActors[0].state == 2) || (gCurrentLevel == LEVEL_TRAINING))) { - if ((this->unk_0E6 == 0) && (gCurrentLevel != LEVEL_TRAINING)) { + if ((this->aiIndex == 0) && (gCurrentLevel != LEVEL_TRAINING)) { if ((this->iwork[4] > 250) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) { if ((Rand_ZeroOne() < 0.5f) || (gCurrentLevel == LEVEL_VENOM_2)) { this->iwork[4] = 0; - switch (this->unk_0E4) { + switch (this->aiType) { case 4: func_8002E4F8(gMsg_ID_19450, RCID_WOLF); break; @@ -1566,47 +1566,47 @@ void func_800319AC(Actor* this) { (gActors[0].obj.status == OBJ_ACTIVE)) { this->timer_0C4 = 600; if (Rand_ZeroOne() < 0.5f) { - gActors[this->unk_0E6].iwork[6]++; - switch (this->unk_0E6) { + gActors[this->aiIndex].iwork[6]++; + switch (this->aiIndex) { case 1: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_19462, RCID_FALCO); - } else if ((gActors[this->unk_0E6].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { + } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_20310, RCID_FALCO); } else { func_8002F5F4(gMsg_ID_9100, RCID_FALCO); } - gActors[this->unk_0E6].iwork[2] = this->unk_0E4; - if ((D_800CA234 == NULL) || (gTeamShields[this->unk_0E6] <= 50)) { - D_800CA234 = &gActors[this->unk_0E6]; + gActors[this->aiIndex].iwork[2] = this->aiType; + if ((D_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { + D_800CA234 = &gActors[this->aiIndex]; D_Timer_800CA238 = 320; } break; case 2: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_19463, RCID_SLIPPY); - } else if ((gActors[this->unk_0E6].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { + } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_20311, RCID_SLIPPY); } else { func_8002F5F4(gMsg_ID_9110, RCID_SLIPPY); } - gActors[this->unk_0E6].iwork[2] = this->unk_0E4; - if ((D_800CA234 == NULL) || (gTeamShields[this->unk_0E6] <= 50)) { - D_800CA234 = &gActors[this->unk_0E6]; + gActors[this->aiIndex].iwork[2] = this->aiType; + if ((D_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { + D_800CA234 = &gActors[this->aiIndex]; D_Timer_800CA238 = 320; } break; case 3: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_19464, 0x1E); - } else if ((gActors[this->unk_0E6].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { + } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_20312, 0x1E); } else { func_8002F5F4(gMsg_ID_9120, 0x1E); } - gActors[this->unk_0E6].iwork[2] = this->unk_0E4; - if ((D_800CA234 == NULL) || (gTeamShields[this->unk_0E6] <= 50)) { - D_800CA234 = &gActors[this->unk_0E6]; + gActors[this->aiIndex].iwork[2] = this->aiType; + if ((D_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { + D_800CA234 = &gActors[this->aiIndex]; D_Timer_800CA238 = 320; } break; @@ -1632,14 +1632,14 @@ void func_800319AC(Actor* this) { break; } } else { - switch (this->unk_0E4) { + switch (this->aiType) { case 1: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_8002F5F4(gMsg_ID_9211, RCID_FALCO); } else { func_8002F5F4(gMsg_ID_9190, RCID_FALCO); } - gActors[this->unk_0E6].iwork[2] = 1; + gActors[this->aiIndex].iwork[2] = 1; break; case 2: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { @@ -1647,7 +1647,7 @@ void func_800319AC(Actor* this) { } else { func_8002F5F4(gMsg_ID_9200, RCID_SLIPPY); } - gActors[this->unk_0E6].iwork[2] = 2; + gActors[this->aiIndex].iwork[2] = 2; break; case 3: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { @@ -1655,7 +1655,7 @@ void func_800319AC(Actor* this) { } else { func_8002F5F4(gMsg_ID_9210, RCID_PEPPY); } - gActors[this->unk_0E6].iwork[2] = 3; + gActors[this->aiIndex].iwork[2] = 3; break; case 4: if (gCurrentLevel != LEVEL_VENOM_2) { @@ -1676,12 +1676,12 @@ void func_800319AC(Actor* this) { break; case 5: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->unk_0E6 == 1)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 1)) { func_8002F5F4(gMsg_ID_9323, RCID_LEON); } else { func_8002F5F4(gMsg_ID_19451, RCID_LEON); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->unk_0E6 == 1)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 1)) { func_8002F5F4(gMsg_ID_9323, RCID_LEON); } else { func_8002F5F4(gMsg_ID_9300, RCID_LEON); @@ -1689,12 +1689,12 @@ void func_800319AC(Actor* this) { break; case 6: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->unk_0E6 == 3)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 3)) { func_8002F5F4(gMsg_ID_9324, RCID_PIGMA); } else { func_8002F5F4(gMsg_ID_19452, RCID_PIGMA); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->unk_0E6 == 3)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 3)) { func_8002F5F4(gMsg_ID_9324, RCID_PIGMA); } else { func_8002F5F4(gMsg_ID_9310, RCID_PIGMA); @@ -1702,12 +1702,12 @@ void func_800319AC(Actor* this) { break; case 7: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->unk_0E6 == 2)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 2)) { func_8002F5F4(gMsg_ID_9325, RCID_ANDREW); } else { func_8002F5F4(gMsg_ID_19453, RCID_ANDREW); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->unk_0E6 == 2)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 2)) { func_8002F5F4(gMsg_ID_9325, RCID_ANDREW); } else { func_8002F5F4(gMsg_ID_9320, RCID_ANDREW); @@ -1719,9 +1719,9 @@ void func_800319AC(Actor* this) { } else { this->iwork[4] = 0; } - if ((this->unk_0E6 > 0) && - ((gActors[this->unk_0E6].obj.status == OBJ_DYING) || (gActors[this->unk_0E6].state == 6) || - (gActors[this->unk_0E6].obj.status == OBJ_FREE))) { + if ((this->aiIndex > 0) && + ((gActors[this->aiIndex].obj.status == OBJ_DYING) || (gActors[this->aiIndex].state == 6) || + (gActors[this->aiIndex].obj.status == OBJ_FREE))) { this->state = 3; if (gCurrentLevel == LEVEL_BOLSE) { func_8002FB4C(this); @@ -1733,9 +1733,9 @@ void func_800319AC(Actor* this) { case 3: sp104 = 1; if (this->timer_0BC == 0) { - if ((this->unk_0E4 < 10) || (gCurrentLevel == LEVEL_BOLSE)) { + if ((this->aiType < 10) || (gCurrentLevel == LEVEL_BOLSE)) { if (gCurrentLevel == LEVEL_VENOM_2) { - if (this->unk_0E4 >= 4) { + if (this->aiType >= 4) { this->fwork[3] = 1.6f; this->fwork[1] = 55.0f; } else { @@ -1754,7 +1754,7 @@ void func_800319AC(Actor* this) { this->fwork[10] = 30.0f; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->unk_0E4 == 8)) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->aiType == 8)) { spE4 = RAND_FLOAT_CENTERED(0.0f); spE0 = RAND_FLOAT_CENTERED(500.0f); spDC = RAND_FLOAT_CENTERED(5000.0f) + 12000.0f; @@ -1788,12 +1788,12 @@ void func_800319AC(Actor* this) { this->timer_0C0 = RAND_INT(200.0f) + 200; this->fwork[10] = 30.0f; } - if ((this->unk_0E6 > 0) && (gActors[this->unk_0E6].obj.id == OBJ_ACTOR_197) && - (gActors[this->unk_0E6].timer_0C2 == 0) && (gActors[this->unk_0E6].obj.status == OBJ_ACTIVE)) { + if ((this->aiIndex > 0) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_197) && + (gActors[this->aiIndex].timer_0C2 == 0) && (gActors[this->aiIndex].obj.status == OBJ_ACTIVE)) { this->state = 2; this->iwork[2] = 0; } - if (this->unk_0E6 == 0) { + if (this->aiIndex == 0) { if (this->unk_04E != 0) { this->unk_04E--; } @@ -1883,9 +1883,9 @@ void func_800319AC(Actor* this) { spD4 = this->fwork[19]; sp108 = 0; if (sp104 == 1) { - if (this->unk_0E4 < 100) { + if (this->aiType < 100) { sp108 = func_8003049C(this); - if ((sp108 != 0) && (this->unk_0E4 < 10) && (this->timer_0BE == 0) && + if ((sp108 != 0) && (this->aiType < 10) && (this->timer_0BE == 0) && ((this->fwork[7] < 0.01f) || (this->fwork[7] > 359.9f))) { this->timer_0BE = RAND_INT(200.0f) + 200; if (Rand_ZeroOne() < 0.5f) { @@ -1898,7 +1898,7 @@ void func_800319AC(Actor* this) { } } if (sp108 != 0) { - if ((this->unk_0E4 < 10) || (gCurrentLevel != LEVEL_FORTUNA)) { + if ((this->aiType < 10) || (gCurrentLevel != LEVEL_FORTUNA)) { spD8 += 40.0f * sp108; } else { spD8 += 20.0f * sp108; @@ -1937,7 +1937,7 @@ void func_800319AC(Actor* this) { } if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) { Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[7], 0.2f, 100.0f, 0.01f); - if ((this->unk_0E4 == 8) && !(gGameFrameCount & 1)) { + if ((this->aiType == 8) && !(gGameFrameCount & 1)) { if ((this->fwork[7] > 10.0f) && (this->fwork[7] < 350.0f)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); @@ -1983,7 +1983,7 @@ void func_800319AC(Actor* this) { sp90.x = spBC * sp90.z; sp90.z = spB4 * sp90.z; - if ((gCurrentLevel == LEVEL_VENOM_2) && (this->unk_0E4 >= 4)) { + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); @@ -1992,19 +1992,19 @@ void func_800319AC(Actor* this) { if (Rand_ZeroOne() < 0.8f) { spA8.x = 60.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA8, &sp9C); - func_8006EEFC(this->unk_0E4, this->obj.pos.x + sp9C.x + (sp90.x * 1.5f), + func_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); } if (Rand_ZeroOne() < 0.8f) { spA8.x = -60.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA8, &sp9C); - func_8006EEFC(this->unk_0E4, this->obj.pos.x + sp9C.x + (sp90.x * 1.5f), + func_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); } } else { - func_8006EEFC(this->unk_0E4, this->obj.pos.x + (sp90.x * 1.5f), this->obj.pos.y + (sp90.y * 1.5f), + func_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); } @@ -2012,10 +2012,10 @@ void func_800319AC(Actor* this) { func_8003088C(this); radarMark = &gRadarMarks[this->index]; radarMark->unk_00 = 1; - if (this->unk_0E4 == 200) { + if (this->aiType == 200) { radarMark->unk_02 = 100; } else { - radarMark->unk_02 = this->unk_0E4; + radarMark->unk_02 = this->aiType; } if (gCurrentLevel == LEVEL_TRAINING) { radarMark->unk_02 = 4; @@ -2027,7 +2027,7 @@ void func_800319AC(Actor* this) { if (this->iwork[1] != 0) { this->iwork[1]--; if ((this->iwork[1] == 0) && (gActors[0].state == 2) && (gRadioState == 0)) { - switch (this->unk_0E4) { + switch (this->aiType) { case 1: func_8002F5F4(gMsg_ID_9220, RCID_FALCO); break; @@ -2045,8 +2045,8 @@ void func_800319AC(Actor* this) { } } if ((gCurrentLevel != LEVEL_KATINA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && (this->timer_0C2 == 0)) { - if (((this->unk_0E4 >= 10) && (this->unk_0E4 < 100)) || - ((this->unk_0E4 >= 4) && (this->unk_0E4 < 10) && (this->timer_0C6 != 0))) { + if (((this->aiType >= 10) && (this->aiType < 100)) || + ((this->aiType >= 4) && (this->aiType < 10) && (this->timer_0C6 != 0))) { s32 var_a3 = 0; if (((gCurrentLevel == LEVEL_BOLSE) || (gCurrentLevel == LEVEL_SECTOR_Z)) && (this->timer_0C6 == 0)) { @@ -2060,7 +2060,7 @@ void func_800319AC(Actor* this) { this->obj.pos.x -= this->vel.x; this->obj.pos.y -= this->vel.y; this->obj.pos.z -= this->vel.z; - if ((temp_v0_27 >= 2) && (this->unk_0E4 >= 0xB)) { + if ((temp_v0_27 >= 2) && (this->aiType >= 0xB)) { this->timer_0BE = 2; this->obj.status = OBJ_DYING; this->unk_044 = 0; @@ -2169,8 +2169,8 @@ void func_80035448(Actor* actor) { Vec3f sp7C[30]; f32 pad2; - if (actor->unk_0E4 != 1000) { - if ((actor->iwork[8] != 0) && (actor->unk_0E4 < 100)) { + if (actor->aiType != 1000) { + if ((actor->iwork[8] != 0) && (actor->aiType < 100)) { pad2 = SIN_DEG(actor->iwork[8] * 400.0f); sp38 = actor->iwork[8] * pad2; Matrix_RotateY(gGfxMatrix, M_DTOR * sp38, 1); @@ -2182,7 +2182,7 @@ void func_80035448(Actor* actor) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPFogPosition(gMasterDisp++, gFogNear, 1005); } - switch (actor->unk_0E4) { + switch (actor->aiType) { case 0: case 1: case 2: @@ -2278,7 +2278,7 @@ void func_80035448(Actor* actor) { } else if (gCurrentLevel == LEVEL_VERSUS) { gSPDisplayList(gMasterDisp++, D_versus_3015740); } else if (gCurrentLevel == LEVEL_TRAINING) { - if (actor->unk_0E6 == 0) { + if (actor->aiIndex == 0) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F00F200); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); func_8005B1E8(actor, 3); diff --git a/src/main/fox_beam.c b/src/main/fox_beam.c index 84f33a19..2cf71104 100644 --- a/src/main/fox_beam.c +++ b/src/main/fox_beam.c @@ -786,7 +786,7 @@ void func_80038140(PlayerShot* shot) { default: if (actor->info.unk_16 != 0) { if (actor->obj.id == OBJ_ACTOR_197) { - if ((actor->unk_0E4 >= 4) && (actor->unk_0E4 < 10) && + if ((actor->aiType >= 4) && (actor->aiType < 10) && (((gCurrentLevel == LEVEL_VENOM_2) && (shot->playerNum < 104)) || ((gCurrentLevel != LEVEL_VENOM_2) && (shot->playerNum == 0))) && (shot->obj.id != PLAYERSHOT_8) && diff --git a/src/main/fox_display.c b/src/main/fox_display.c index 9b72b43a..fa8bba54 100644 --- a/src/main/fox_display.c +++ b/src/main/fox_display.c @@ -61,7 +61,7 @@ void func_80051B30(void) { sp7C = 1; } RCP_SetupDL(&gMasterDisp, 0xC); - switch (D_800CA234->unk_0E4) { + switch (D_800CA234->aiType) { case 3: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 30, 0, 255); break; diff --git a/src/main/fox_edisplay.c b/src/main/fox_edisplay.c index a25e6293..a516471d 100644 --- a/src/main/fox_edisplay.c +++ b/src/main/fox_edisplay.c @@ -1,4 +1,3 @@ - #include "global.h" #include "fox_edisplay_assets.h" #include "assets/ast_katina.h" @@ -19,7 +18,7 @@ #include "assets/ast_enmy_planet.h" #include "assets/ast_ve1_boss.h" #include "assets/ast_zoness.h" - +#include "prevent_bss_reordering.h" Vec3f D_801615D0; Vec3f D_801615E0; s32 D_801615EC; @@ -1017,7 +1016,7 @@ void Actor_Draw2(Actor* actor) { func_8005F1EC(actor->sfxSource); if (((actor->obj.id == OBJ_ACTOR_198) || ((actor->obj.id == OBJ_ACTOR_203) && (actor->unk_0B6 > 0))) && (D_80161410 > 0)) { - Matrix_MultVec3f(gGfxMatrix, &sp34, &D_80177E98[actor->unk_0E4]); + Matrix_MultVec3f(gGfxMatrix, &sp34, &D_80177E98[actor->aiType]); } } if ((actor->timer_0CA[0] != 0) && (D_80161410 > 0)) { @@ -1049,7 +1048,7 @@ void Actor_Draw1(Actor* actor) { Matrix_Pop(&gGfxMatrix); var_fv0 = 0.0f; var_fv1 = -12000.0f; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->unk_0E4 >= 100)) { + if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType >= 100)) { var_fv0 = 1000.0f; var_fv1 = -25000.0f; } @@ -1062,7 +1061,7 @@ void Actor_Draw1(Actor* actor) { actor->info.draw(&actor->obj); D_801615EC = 1; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->obj.id == OBJ_ACTOR_197) && - (actor->unk_0E4 == 200)) { + (actor->aiType == 200)) { D_80177E98[0] = D_801615E0; } } @@ -1072,7 +1071,7 @@ void Actor_Draw1(Actor* actor) { Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_801615E0); if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) || - ((actor->obj.id == OBJ_ACTOR_197) && (actor->unk_0E4 >= 100)) || + ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType >= 100)) || ((actor->obj.id == OBJ_ACTOR_195) && (actor->info.bonus != 0))) { var_ft5 = var_fv0 = 3000.0f; var_fv1 = -29000.0f; @@ -1095,9 +1094,9 @@ void Actor_Draw1(Actor* actor) { D_801615EC = 1; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (((actor->obj.id == OBJ_ACTOR_197) && - ((actor->unk_0E4 < 4) || (actor->unk_0E4 == 8) || (actor->unk_0E4 == 9))) || + ((actor->aiType < 4) || (actor->aiType == 8) || (actor->aiType == 9))) || (actor->obj.id == OBJ_ACTOR_198))) { - D_80177E98[actor->unk_0E4] = D_801615E0; + D_80177E98[actor->aiType] = D_801615E0; } } } @@ -1286,7 +1285,7 @@ void func_8005EA24(Actor* actor) { Matrix_RotateY(gGfxMatrix, (actor->obj.rot.y + 180.0f) * M_DTOR, 1); Matrix_RotateZ(gGfxMatrix, actor->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (actor->unk_0E4 < 4) { + if (actor->aiType < 4) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); @@ -1296,7 +1295,7 @@ void func_8005EA24(Actor* actor) { } else { gSPDisplayList(gMasterDisp++, D_KA_600DBC0); } - } else if ((actor->unk_0E4 < 8) || (gCurrentLevel != LEVEL_FORTUNA)) { + } else if ((actor->aiType < 8) || (gCurrentLevel != LEVEL_FORTUNA)) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F014310); } else if (gCurrentLevel == LEVEL_FORTUNA) { gSPDisplayList(gMasterDisp++, D_FO_6009F90); diff --git a/src/main/fox_enmy.c b/src/main/fox_enmy.c index f28ed725..29d3f8c8 100644 --- a/src/main/fox_enmy.c +++ b/src/main/fox_enmy.c @@ -383,13 +383,13 @@ void func_80061F0C(Actor* actor, ObjectInit* objInit, s32 arg2) { actor->obj.id = OBJ_ACTOR_200; actor->timer_0C2 = 10; actor->unk_0B4 = 4095; - actor->unk_0E4 = objInit->id - OBJ_UNK_1000; + actor->aiType = objInit->id - OBJ_UNK_1000; Object_SetInfo(&actor->info, actor->obj.id); actor->info.unk_10 = 3000.0f; actor->fwork[25] = 20000.0f; actor->iwork[1] = D_80177E70; - actor->iwork[10] = gActors[D_80177E70].unk_0E4; + actor->iwork[10] = gActors[D_80177E70].aiType; actor->fwork[22] = D_80161A54; Matrix_RotateZ(gCalcMatrix, -D_80177E88.z * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, -D_80177E88.x * M_DTOR, 1); @@ -885,7 +885,7 @@ s32 func_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(pos->x - actor->obj.pos.x) < 1000.0f) && (fabsf(pos->z - actor->obj.pos.z) < 1500.0f) && (index != i) && (actor->info.unk_16 != 2) && - ((actor->obj.id != OBJ_ACTOR_197) || (actor->unk_0E4 >= 4)) && (actor->timer_0C2 == 0)) { + ((actor->obj.id != OBJ_ACTOR_197) || (actor->aiType >= 4)) && (actor->timer_0C2 == 0)) { if (actor->obj.id == OBJ_ACTOR_180) { if (func_8006326C(pos, arg2, actor->obj.id, &actor->obj)) { return 2; @@ -906,8 +906,8 @@ s32 func_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { actor->unk_0D0 = 1; actor->damage = 10; actor->unk_0D2 = -1; - if (((actor->obj.id != OBJ_ACTOR_200) || (actor->iwork[12] == 0)) && - ((actor->obj.id != OBJ_ACTOR_197) || ((actor->unk_0E4 >= 10) && (actor->unk_0E4 < 100)))) { + if (!(((actor->obj.id == OBJ_ACTOR_200) && (actor->iwork[12] != 0)) || + ((actor->obj.id == OBJ_ACTOR_197) && ((actor->aiType < 10) || (actor->aiType >= 100))))) { actor->health = 0; } actor->unk_0D8.x = pos->x; @@ -1665,7 +1665,7 @@ void func_80066254(Actor* actor) { D_80161A62 = 0; } if (actor->obj.id == OBJ_ACTOR_197) { - if ((actor->unk_0E4 >= 4) && (actor->unk_0E4 < 8)) { + if ((actor->aiType >= 4) && (actor->aiType < 8)) { func_8002E3E0(actor); } } diff --git a/src/main/fox_enmy2.c b/src/main/fox_enmy2.c index aadca886..038a0817 100644 --- a/src/main/fox_enmy2.c +++ b/src/main/fox_enmy2.c @@ -988,73 +988,73 @@ u8 D_800D0DBC[6][4] = { }; void func_8006D36C(Actor* actor) { - u16** var_v1; - u16* temp_s1; - u16* temp_v0_4; + u16** levelScripts; + u16* actorScript; + u16* msg; u16* test; s32 i; s32 j; switch (gCurrentLevel) { case LEVEL_VENOM_ANDROSS: - var_v1 = SEGMENTED_TO_VIRTUAL(D_ANDROSS_C037E3C); + levelScripts = SEGMENTED_TO_VIRTUAL(D_ANDROSS_C037E3C); break; case LEVEL_CORNERIA: - var_v1 = SEGMENTED_TO_VIRTUAL(D_CO_603D9E8); + levelScripts = SEGMENTED_TO_VIRTUAL(D_CO_603D9E8); break; case LEVEL_METEO: - var_v1 = SEGMENTED_TO_VIRTUAL(D_ME_602F3AC); + levelScripts = SEGMENTED_TO_VIRTUAL(D_ME_602F3AC); break; case LEVEL_AQUAS: - var_v1 = SEGMENTED_TO_VIRTUAL(D_AQ_60308B8); + levelScripts = SEGMENTED_TO_VIRTUAL(D_AQ_60308B8); break; case LEVEL_TITANIA: - var_v1 = SEGMENTED_TO_VIRTUAL(D_TI_600631C); + levelScripts = SEGMENTED_TO_VIRTUAL(D_TI_600631C); break; case LEVEL_SECTOR_X: - var_v1 = SEGMENTED_TO_VIRTUAL(D_SX_60320D0); + levelScripts = SEGMENTED_TO_VIRTUAL(D_SX_60320D0); break; case LEVEL_UNK_4: - var_v1 = SEGMENTED_TO_VIRTUAL(D_A6_60289FC); + levelScripts = SEGMENTED_TO_VIRTUAL(D_A6_60289FC); break; case LEVEL_AREA_6: - var_v1 = SEGMENTED_TO_VIRTUAL(D_A6_6027F50); + levelScripts = SEGMENTED_TO_VIRTUAL(D_A6_6027F50); break; case LEVEL_SECTOR_Y: - var_v1 = SEGMENTED_TO_VIRTUAL(D_SY_6032E18); + levelScripts = SEGMENTED_TO_VIRTUAL(D_SY_6032E18); break; case LEVEL_SOLAR: - var_v1 = SEGMENTED_TO_VIRTUAL(D_SO_6020DD0); + levelScripts = SEGMENTED_TO_VIRTUAL(D_SO_6020DD0); break; case LEVEL_ZONESS: - var_v1 = SEGMENTED_TO_VIRTUAL(D_ZO_602AAC0); + levelScripts = SEGMENTED_TO_VIRTUAL(D_ZO_602AAC0); break; case LEVEL_VENOM_1: - var_v1 = SEGMENTED_TO_VIRTUAL(D_VE1_601B1E4); + levelScripts = SEGMENTED_TO_VIRTUAL(D_VE1_601B1E4); break; case LEVEL_MACBETH: - var_v1 = SEGMENTED_TO_VIRTUAL(D_MA_60381D8); + levelScripts = SEGMENTED_TO_VIRTUAL(D_MA_60381D8); break; case LEVEL_TRAINING: - var_v1 = SEGMENTED_TO_VIRTUAL(D_TR_6009B34); + levelScripts = SEGMENTED_TO_VIRTUAL(D_TR_6009B34); break; default: - var_v1 = SEGMENTED_TO_VIRTUAL(D_CO_603D9E8); + levelScripts = SEGMENTED_TO_VIRTUAL(D_CO_603D9E8); break; } - temp_s1 = SEGMENTED_TO_VIRTUAL(var_v1[actor->unk_0E4]); + actorScript = SEGMENTED_TO_VIRTUAL(levelScripts[actor->aiType]); - switch (temp_s1[actor->unk_0E6] & 0xFE00) { - case EVOP_127 << 9: + switch (actorScript[actor->aiIndex] & (0x7F << 9)) { + case EVOP_STOP_SCRIPT << 9: actor->state = 200; if (actor->info.unk_10 > 10000.0f) { actor->info.unk_10 = 100.0f; } break; - case EVOP_104 << 9: + case EVOP_INIT_ACTOR << 9: Audio_KillSfxBySource(actor->sfxSource); - actor->unk_0B4 = temp_s1[actor->unk_0E6 + 1]; + actor->unk_0B4 = actorScript[actor->aiIndex + 1]; if (actor->unk_0B4 == 40) { actor->timer_0C2 = 10000; @@ -1071,8 +1071,8 @@ void func_8006D36C(Actor* actor) { actor->info.drawType = 2; } - actor->health = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->health = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; if ((actor->unk_0B4 >= 200) && (actor->unk_0B4 < 300)) { actor->unk_046 = 100; @@ -1126,22 +1126,22 @@ void func_8006D36C(Actor* actor) { } if (actor->unk_0B4 < 200) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[actor->unk_0B4].unk_04); - actor->scale = D_800D003C[actor->unk_0B4].unk_08; - actor->info.unk_16 = D_800D003C[actor->unk_0B4].unk_14; - actor->info.unk_14 = D_800D003C[actor->unk_0B4].unk_15; - actor->info.unk_19 = D_800D003C[actor->unk_0B4].unk_17; - actor->info.unk_1C = D_800D003C[actor->unk_0B4].unk_18; - actor->info.bonus = D_800D003C[actor->unk_0B4].unk_1C; + actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[actor->unk_0B4].hitbox); + actor->scale = D_800D003C[actor->unk_0B4].scale; + actor->info.unk_16 = D_800D003C[actor->unk_0B4].info_unk_16; + actor->info.unk_14 = D_800D003C[actor->unk_0B4].info_unk_14; + actor->info.unk_19 = D_800D003C[actor->unk_0B4].info_unk_19; + actor->info.unk_1C = D_800D003C[actor->unk_0B4].info_unk_1C; + actor->info.bonus = D_800D003C[actor->unk_0B4].bonus; if (actor->unk_0B4 == 78) { actor->info.damage = 0; } - actor->info.unk_10 = D_800D003C[actor->unk_0B4].unk_0C; + actor->info.unk_10 = D_800D003C[actor->unk_0B4].info_unk_10; actor->fwork[25] = D_800D003C[actor->unk_0B4].unk_10; - switch (D_800D003C[actor->unk_0B4].unk_16) { + switch (D_800D003C[actor->unk_0B4].sfx) { case 1: if (!((gCurrentLevel == LEVEL_SOLAR) || (actor->unk_0B4 == 6) || ((gCurrentLevel == LEVEL_CORNERIA) && (actor->unk_0B4 == 8)))) { @@ -1183,20 +1183,20 @@ void func_8006D36C(Actor* actor) { break; case EVOP_105 << 9: - actor->iwork[12] = temp_s1[actor->unk_0E6 + 1]; + actor->iwork[12] = actorScript[actor->aiIndex + 1]; if (actor->iwork[12] < 4) { D_800CFF80[actor->iwork[12]] = actor->index; } - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_113 << 9: - actor->iwork[15] = temp_s1[actor->unk_0E6 + 1]; - actor->iwork[16] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->iwork[15] = actorScript[actor->aiIndex + 1]; + actor->iwork[16] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; func_8006D36C(actor); break; @@ -1208,115 +1208,115 @@ void func_8006D36C(Actor* actor) { D_80177E88.x = actor->obj.rot.x; D_80177E88.y = actor->obj.rot.y; D_80177E88.z = actor->obj.rot.z; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_112 << 9: - if (temp_s1[actor->unk_0E6 + 1] == 0xE) { - actor->state = 0xA; + if (actorScript[actor->aiIndex + 1] == 14) { + actor->state = 10; actor->fwork[11] = 0.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; break; } - if (temp_s1[actor->unk_0E6 + 1] == 0xF) { + if (actorScript[actor->aiIndex + 1] == 15) { actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800CBEC4); - actor->state = 0xB; - actor->unk_0E6 += 2; + actor->state = 11; + actor->aiIndex += 2; break; } - actor->unk_048 = temp_s1[actor->unk_0E6 + 1]; + actor->unk_048 = actorScript[actor->aiIndex + 1]; if (actor->unk_048 == 3) { actor->timer_04C = 4; } - if (actor->unk_048 == 0xD) { - actor->timer_0BE = 0x32; + if (actor->unk_048 == 13) { + actor->timer_0BE = 50; } - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_116 << 9: - actor->unk_044 = temp_s1[actor->unk_0E6 + 1]; - actor->unk_0E6 += 2; + actor->unk_044 = actorScript[actor->aiIndex + 1]; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_118 << 9: - Audio_SetBaseSfxReverb(temp_s1[actor->unk_0E6 + 1]); - actor->unk_0E6 += 2; + Audio_SetBaseSfxReverb(actorScript[actor->aiIndex + 1]); + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_120 << 9: - temp_v0_4 = Message_PtrFromId(temp_s1[actor->unk_0E6 + 1]); - if ((temp_v0_4 != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { - Radio_PlayMessage(temp_v0_4, temp_s1[actor->unk_0E6] & 0x1FF); + case EVOP_PLAY_MSG << 9: + msg = Message_PtrFromId(actorScript[actor->aiIndex + 1]); + if ((msg != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + Radio_PlayMessage(msg, actorScript[actor->aiIndex] & 0x1FF); } - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_119 << 9: - if ((D_80161A88 == 2) && (temp_s1[actor->unk_0E6 + 1] != 2)) { + if ((D_80161A88 == 2) && (actorScript[actor->aiIndex + 1] != 2)) { Audio_KillSfxBySourceAndId(gPlayer[0].sfxSource, 0x1100000B); } - D_80161A88 = temp_s1[actor->unk_0E6 + 1]; - actor->unk_0E6 += 2; + D_80161A88 = actorScript[actor->aiIndex + 1]; + actor->aiIndex += 2; func_8006D36C(actor); actor->obj.status = OBJ_FREE; break; case EVOP_56 << 9: - D_800CFF90 = temp_s1[actor->unk_0E6] & 0x1FF; - D_80161690 = temp_s1[actor->unk_0E6 + 1]; - actor->unk_0E6 += 2; + D_800CFF90 = actorScript[actor->aiIndex] & 0x1FF; + D_80161690 = actorScript[actor->aiIndex + 1]; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_57 << 9: - gTeamShields[temp_s1[actor->unk_0E6 + 1]] = 0xFF; - actor->unk_0E6 += 2; + gTeamShields[actorScript[actor->aiIndex + 1]] = 0xFF; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_58 << 9: - func_8001D2FC(actor->sfxSource, temp_s1[actor->unk_0E6 + 1]); - actor->unk_0E6 += 2; + func_8001D2FC(actor->sfxSource, actorScript[actor->aiIndex + 1]); + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_59 << 9: - func_8001D3A0(actor->sfxSource, temp_s1[actor->unk_0E6 + 1]); - actor->unk_0E6 += 2; + func_8001D3A0(actor->sfxSource, actorScript[actor->aiIndex + 1]); + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_122 << 9: SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_121 << 9: - if (actor->iwork[12] == temp_s1[actor->unk_0E6 + 1]) { + if (actor->iwork[12] == actorScript[actor->aiIndex + 1]) { actor->unk_0D0 = 1; - actor->damage = temp_s1[actor->unk_0E6] & 0x1FF; + actor->damage = actorScript[actor->aiIndex] & 0x1FF; actor->unk_0D4 = 100; } else { - gTeamDamage[temp_s1[actor->unk_0E6 + 1]] = temp_s1[actor->unk_0E6] & 0x1FF; + gTeamDamage[actorScript[actor->aiIndex + 1]] = actorScript[actor->aiIndex] & 0x1FF; } - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_124 << 9: + case EVOP_MAKE_TEXLINE << 9: actor->iwork[7] = 1; for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) { if (gTexturedLines[i].mode == 0) { @@ -1325,98 +1325,98 @@ void func_8006D36C(Actor* actor) { gTexturedLines[i].unk_04.x = actor->obj.pos.x - actor->vel.x; gTexturedLines[i].unk_04.y = actor->obj.pos.y - actor->vel.y; gTexturedLines[i].unk_04.z = actor->obj.pos.z - actor->vel.z; - gTexturedLines[i].unk_2C = D_800D0DBC[temp_s1[actor->unk_0E6 + 1]][0]; - gTexturedLines[i].unk_2D = D_800D0DBC[temp_s1[actor->unk_0E6 + 1]][1]; - gTexturedLines[i].unk_2E = D_800D0DBC[temp_s1[actor->unk_0E6 + 1]][2]; - gTexturedLines[i].unk_2F = D_800D0DBC[temp_s1[actor->unk_0E6 + 1]][3]; + gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[actor->aiIndex + 1]][0]; + gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[actor->aiIndex + 1]][1]; + gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[actor->aiIndex + 1]][2]; + gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[actor->aiIndex + 1]][3]; actor->iwork[8] = i; break; } } - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_125 << 9: + case EVOP_STOP_TEXLINE << 9: actor->iwork[7] = 0; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_40 << 9: actor->state = 6; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; case EVOP_41 << 9: actor->state = 7; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; case EVOP_42 << 9: actor->state = 8; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; case EVOP_43 << 9: actor->state = 9; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; case EVOP_45 << 9: actor->state = 1; - actor->iwork[1] = D_800CFF80[temp_s1[actor->unk_0E6] & 0x1FF]; - actor->fwork[17] = temp_s1[actor->unk_0E6 + 1]; + actor->iwork[1] = D_800CFF80[actorScript[actor->aiIndex] & 0x1FF]; + actor->fwork[17] = actorScript[actor->aiIndex + 1]; actor->timer_0BC = 0; - actor->unk_0E6 += 2; + actor->aiIndex += 2; break; case EVOP_44 << 9: actor->state = 0xD; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; case EVOP_46 << 9: actor->state = 0xE; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; case EVOP_47 << 9: actor->state = 0xF; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->fwork[24] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; break; - case EVOP_96 << 9: - actor->iwork[2] = temp_s1[actor->unk_0E6 + 1]; - actor->iwork[3] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->unk_0E6 += 2; + case EVOP_BRANCH << 9: + actor->iwork[2] = actorScript[actor->aiIndex + 1]; + actor->iwork[3] = actorScript[actor->aiIndex] & 0x1FF; + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_126 << 9: - if (temp_s1[actor->unk_0E6 + 1] < actor->iwork[0]) { - actor->unk_0E6 += 2; + case EVOP_LOOP << 9: + if (actorScript[actor->aiIndex + 1] < actor->iwork[0]) { + actor->aiIndex += 2; actor->iwork[0] = 0; - } else if ((temp_s1[actor->unk_0E6] & 0x1FF) < 200) { - actor->unk_0E6 = (temp_s1[actor->unk_0E6] & 0x1FF) * 2; + } else if ((actorScript[actor->aiIndex] & 0x1FF) < 200) { + actor->aiIndex = (actorScript[actor->aiIndex] & 0x1FF) * 2; actor->iwork[0]++; } else { - actor->unk_0E4 = (temp_s1[actor->unk_0E6] & 0x1FF) - 200; - actor->unk_0E6 = 0; + actor->aiType = (actorScript[actor->aiIndex] & 0x1FF) - 200; + actor->aiIndex = 0; actor->iwork[0] = 0; } func_8006D36C(actor); @@ -1424,131 +1424,131 @@ void func_8006D36C(Actor* actor) { case EVOP_48 << 9: actor->state = 1; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; - actor->unk_0E6 += 2; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; + actor->aiIndex += 2; break; - case EVOP_0 << 9: - actor->fwork[0] = temp_s1[actor->unk_0E6] & 0x7F; + case EVOP_SET_SPEED << 9: + actor->fwork[0] = actorScript[actor->aiIndex] & 0x7F; actor->fwork[1] = actor->fwork[0]; - actor->iwork[5] = temp_s1[actor->unk_0E6] & 0x180; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; + actor->iwork[5] = actorScript[actor->aiIndex] & 0x180; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; actor->state = 1; - actor->unk_0E6 += 2; + actor->aiIndex += 2; break; case EVOP_2 << 9: - actor->fwork[22] = temp_s1[actor->unk_0E6 + 1] & 0xFF; - actor->unk_0E6 += 2; + actor->fwork[22] = actorScript[actor->aiIndex + 1] & 0xFF; + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_1 << 9: - actor->fwork[1] = temp_s1[actor->unk_0E6] & 0x7F; - actor->iwork[5] = temp_s1[actor->unk_0E6] & 0x180; - actor->timer_0BC = temp_s1[actor->unk_0E6 + 1]; + case EVOP_SET_ACCEL << 9: + actor->fwork[1] = actorScript[actor->aiIndex] & 0x7F; + actor->iwork[5] = actorScript[actor->aiIndex] & 0x180; + actor->timer_0BC = actorScript[actor->aiIndex + 1]; actor->state = 1; - actor->unk_0E6 += 2; + actor->aiIndex += 2; break; case EVOP_4 << 9: - actor->timer_0C0 = temp_s1[actor->unk_0E6 + 1]; + actor->timer_0C0 = actorScript[actor->aiIndex + 1]; actor->iwork[13] = 1; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_8 << 9: actor->iwork[13] = 0; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_9 << 9: actor->state = 2; - actor->fwork[2] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[3] = temp_s1[actor->unk_0E6 + 1] * 0.1f; - actor->unk_0E6 += 2; + actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; + actor->aiIndex += 2; break; case EVOP_10 << 9: actor->state = 3; - actor->fwork[2] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[3] = temp_s1[actor->unk_0E6 + 1] * 0.1f; - actor->unk_0E6 += 2; + actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; + actor->aiIndex += 2; break; case EVOP_11 << 9: actor->state = 4; - actor->fwork[2] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[3] = temp_s1[actor->unk_0E6 + 1] * 0.1f; - actor->unk_0E6 += 2; + actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; + actor->aiIndex += 2; break; case EVOP_12 << 9: actor->state = 5; - actor->fwork[2] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[3] = temp_s1[actor->unk_0E6 + 1] * 0.1f; - actor->unk_0E6 += 2; + actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; + actor->aiIndex += 2; break; case EVOP_16 << 9: - actor->fwork[4] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[5] = temp_s1[actor->unk_0E6 + 1] * 0.1f; + actor->fwork[4] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[5] = actorScript[actor->aiIndex + 1] * 0.1f; actor->fwork[6] = 1.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_17 << 9: - actor->fwork[4] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[5] = temp_s1[actor->unk_0E6 + 1] * 0.1f; + actor->fwork[4] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[5] = actorScript[actor->aiIndex + 1] * 0.1f; actor->fwork[6] = -1.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_18 << 9: - actor->fwork[7] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[8] = temp_s1[actor->unk_0E6 + 1] * 0.1f; + actor->fwork[7] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[8] = actorScript[actor->aiIndex + 1] * 0.1f; actor->fwork[9] = 1.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_19 << 9: - actor->fwork[7] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[8] = temp_s1[actor->unk_0E6 + 1] * 0.1f; + actor->fwork[7] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[8] = actorScript[actor->aiIndex + 1] * 0.1f; actor->fwork[9] = -1.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_20 << 9: - actor->fwork[10] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[11] = temp_s1[actor->unk_0E6 + 1] * 0.1f; + actor->fwork[10] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[11] = actorScript[actor->aiIndex + 1] * 0.1f; actor->fwork[12] = 1.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; case EVOP_21 << 9: - actor->fwork[10] = temp_s1[actor->unk_0E6] & 0x1FF; - actor->fwork[11] = temp_s1[actor->unk_0E6 + 1] * 0.1f; + actor->fwork[10] = actorScript[actor->aiIndex] & 0x1FF; + actor->fwork[11] = actorScript[actor->aiIndex + 1] * 0.1f; actor->fwork[12] = -1.0f; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_24 << 9: + case EVOP_SET_ROTATE << 9: actor->iwork[6] = 1; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; - case EVOP_25 << 9: + case EVOP_STOP_ROTATE << 9: actor->iwork[6] = 0; - actor->unk_0E6 += 2; + actor->aiIndex += 2; func_8006D36C(actor); break; } @@ -2249,13 +2249,13 @@ void func_80070BA8(Actor* actor) { void func_80070CEC(Actor* actor) { if (actor->iwork[3] < 200) { - actor->unk_0E6 = actor->iwork[3] * 2; + actor->aiIndex = actor->iwork[3] * 2; actor->iwork[0] = 0; actor->iwork[2] = 0; func_8006D36C(actor); } else { - actor->unk_0E4 = actor->iwork[3] - 200; - actor->unk_0E6 = 0; + actor->aiType = actor->iwork[3] - 200; + actor->aiIndex = 0; actor->iwork[0] = 0; actor->iwork[2] = 0; func_8006D36C(actor); @@ -2282,239 +2282,239 @@ void func_80070D44(Actor* actor) { } switch (actor->iwork[2]) { - case 0: + case EVC_0: break; - case 1: + case EVC_1: if ((gActors[actor->iwork[1]].obj.status != OBJ_ACTIVE) || (gActors[actor->iwork[1]].health <= 0) || - (actor->iwork[10] != gActors[actor->iwork[1]].unk_0E4)) { + (actor->iwork[10] != gActors[actor->iwork[1]].aiType)) { func_80070CEC(actor); } break; - case 2: + case EVC_2: if (var_v1 == 3) { func_80070CEC(actor); } break; - case 3: + case EVC_3: if (var_v1 == 2) { func_80070CEC(actor); } break; - case 4: + case EVC_4: if (var_v1 == 1) { func_80070CEC(actor); } break; - case 5: + case EVC_5: if (var_v1 == 0) { func_80070CEC(actor); } break; - case 6: + case EVC_6: if (gTeamShields[1] > 0) { func_80070CEC(actor); } break; - case 7: + case EVC_7: if (gTeamShields[3] > 0) { func_80070CEC(actor); } break; - case 8: + case EVC_8: if (gTeamShields[2] > 0) { func_80070CEC(actor); } break; - case 9: + case EVC_9: if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 100.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { func_80070CEC(actor); } break; - case 10: + case EVC_10: if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 400.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { func_80070CEC(actor); } break; - case 11: + case EVC_11: if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 700.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { func_80070CEC(actor); } break; - case 12: + case EVC_12: if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 200.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { func_80070CEC(actor); } break; - case 13: + case EVC_13: if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -100.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { func_80070CEC(actor); } break; - case 14: + case EVC_14: if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -400.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { func_80070CEC(actor); } break; - case 15: + case EVC_15: if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -700.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { func_80070CEC(actor); } break; - case 16: + case EVC_16: if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -200.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { func_80070CEC(actor); } break; - case 17: + case EVC_17: if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 100.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { func_80070CEC(actor); } break; - case 18: + case EVC_18: if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 400.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { func_80070CEC(actor); } break; - case 19: + case EVC_19: if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 700.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { func_80070CEC(actor); } break; - case 20: + case EVC_20: if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 200.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { func_80070CEC(actor); } break; - case 21: + case EVC_21: if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -100.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { func_80070CEC(actor); } break; - case 22: + case EVC_22: if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -400.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { func_80070CEC(actor); } break; - case 23: + case EVC_23: if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -700.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { func_80070CEC(actor); } break; - case 24: + case EVC_24: if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -200.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { func_80070CEC(actor); } break; - case 25: + case EVC_25: if (gPlayer[0].shields >= Play_GetMaxShields()) { func_80070CEC(actor); } break; - case 26: + case EVC_26: if (gPlayer[0].shields >= (Play_GetMaxShields() * 3 / 4)) { func_80070CEC(actor); } break; - case 27: + case EVC_27: if (gPlayer[0].shields >= (Play_GetMaxShields() / 2)) { func_80070CEC(actor); } break; - case 28: + case EVC_28: if (gPlayer[0].shields >= (Play_GetMaxShields() / 4)) { func_80070CEC(actor); } break; - case 29: + case EVC_29: if (gPlayer[0].shields == 0) { func_80070CEC(actor); } break; - case 30: + case EVC_30: if (gPlayer[0].unk_270 >= 5) { func_80070CEC(actor); } break; - case 31: + case EVC_31: if (gPlayer[0].unk_270 != 0) { func_80070CEC(actor); } break; - case 32: + case EVC_32: if (gPlayer[0].unk_270 == 0) { func_80070CEC(actor); } break; - case 33: + case EVC_33: if (gPlayer[0].unk_250 >= 16.8f) { func_80070CEC(actor); } break; - case 34: + case EVC_34: if (gPlayer[0].unk_250 <= 8.4f) { func_80070CEC(actor); } break; - case 35: + case EVC_35: if (gPlayer[0].wings.unk_14 > -8.0f) { func_80070CEC(actor); } break; - case 36: + case EVC_36: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_TWIN)) { func_80070CEC(actor); } break; - case 37: + case EVC_37: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_HYPER)) { func_80070CEC(actor); } break; - case 38: + case EVC_38: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_UNK_3)) { func_80070CEC(actor); } break; - case 39: + case EVC_39: for (i = 0; i < ARRAY_COUNT(gPlayerShots); i++) { if ((gPlayerShots[i].obj.status == 1) && (fabsf(actor->obj.pos.x - gPlayerShots[i].obj.pos.x) < 150.0f) && @@ -2526,7 +2526,7 @@ void func_80070D44(Actor* actor) { } break; - case 40: + case EVC_40: for (i = 0; i < ARRAY_COUNT(gPlayerShots); i++) { if ((gPlayerShots[i].obj.status == 1) && (fabsf(actor->obj.pos.x - gPlayerShots[i].obj.pos.x) < 300.0f) && @@ -2538,14 +2538,14 @@ void func_80070D44(Actor* actor) { } break; - case 41: + case EVC_41: if ((gActors[actor->iwork[9]].obj.status != OBJ_ACTIVE) || ((gActors[actor->iwork[9]].scale < 0.0f) && (actor->health <= 0))) { func_80070CEC(actor); } break; - case 42: + case EVC_42: for (i = 0; i < ARRAY_COUNT(gActors); i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200) && (gActors[i].iwork[13] != 0) && (i != actor->index) && (actor->index == gActors[i].iwork[9])) { @@ -2555,7 +2555,7 @@ void func_80070D44(Actor* actor) { func_80070CEC(actor); break; - case 43: + case EVC_43: for (i = 0; i < ARRAY_COUNT(gActors); i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200) && (gActors[i].iwork[13] != 0) && (i != actor->index) && (actor->index == gActors[i].iwork[9])) { @@ -2565,13 +2565,13 @@ void func_80070D44(Actor* actor) { } break; - case 44: + case EVC_44: if (actor->unk_0D0 != 0) { func_80070CEC(actor); } break; - case 45: + case EVC_45: var_v1_4 = 7; switch (gCurrentLevel) { case LEVEL_CORNERIA: @@ -2589,7 +2589,7 @@ void func_80070D44(Actor* actor) { } break; - case 46: + case EVC_46: 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] == actor->iwork[15]) && (otherActor->iwork[16] != 0)) { @@ -2598,7 +2598,7 @@ void func_80070D44(Actor* actor) { } break; - case 47: + case EVC_47: if (gControllerPress[gMainController].button & R_CBUTTONS) { func_8001AF40(0); D_800CFF90 = 0; @@ -2607,121 +2607,121 @@ void func_80070D44(Actor* actor) { } break; - case 48: + case EVC_48: if ((gPlayer[0].wings.rightState <= WINGSTATE_BROKEN) || (gPlayer[0].wings.leftState <= WINGSTATE_BROKEN)) { func_80070CEC(actor); } break; - case 49: + case EVC_49: if (D_800D3180[LEVEL_METEO] != 0) { func_80070CEC(actor); } break; - case 50: + case EVC_50: if (D_800D3180[LEVEL_FORTUNA] != 0) { func_80070CEC(actor); } break; - case 51: + case EVC_51: if (D_800D3180[LEVEL_SECTOR_X] != 0) { func_80070CEC(actor); } break; - case 52: + case EVC_52: if (D_800D3180[LEVEL_TITANIA] != 0) { func_80070CEC(actor); } break; - case 53: + case EVC_53: if (D_800D3180[LEVEL_BOLSE] != 0) { func_80070CEC(actor); } break; - case 54: + case EVC_54: if (D_800D3180[LEVEL_SECTOR_Y] != 0) { func_80070CEC(actor); } break; - case 55: + case EVC_55: if (D_800D3180[LEVEL_KATINA] != 0) { func_80070CEC(actor); } break; - case 56: + case EVC_56: if (D_800D3180[LEVEL_SOLAR] != 0) { func_80070CEC(actor); } break; - case 57: + case EVC_57: if (D_800D3180[LEVEL_MACBETH] != 0) { func_80070CEC(actor); } break; - case 58: + case EVC_58: if (D_800D3180[LEVEL_AQUAS] != 0) { func_80070CEC(actor); } break; - case 59: + case EVC_59: if (D_800D3180[LEVEL_ZONESS] != 0) { func_80070CEC(actor); } break; - case 60: + case EVC_60: if (D_800D3180[LEVEL_SECTOR_Z] != 0) { func_80070CEC(actor); } break; - case 61: + case EVC_61: if (D_800D3180[LEVEL_AREA_6] != 0) { func_80070CEC(actor); } break; - case 62: + case EVC_62: if (D_Timer_80161670[actor->iwork[12]] == 0) { func_80070CEC(actor); } break; - case 63: + case EVC_63: if (D_Timer_80161670[actor->iwork[12]] != 0) { func_80070CEC(actor); } break; - case 64: + case EVC_64: if (D_80161684 != 0) { func_80070CEC(actor); } break; - case 65: + case EVC_65: if (gHitCount >= 30) { func_80070CEC(actor); } break; - case 66: + case EVC_66: if (gHitCount >= 80) { func_80070CEC(actor); } break; - case 67: + case EVC_67: if (gExpertMode) { func_80070CEC(actor); } @@ -3822,12 +3822,12 @@ void func_80074FF0(Actor* actor) { gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) actor->fwork[15], (s32) actor->fwork[16], (s32) actor->fwork[17], 255); - gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].unk_00); + gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].dList); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; default: - if ((actor->unk_0B4 < 200) && (D_800D003C[actor->unk_0B4].unk_00 != NULL)) { - gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].unk_00); + if ((actor->unk_0B4 < 200) && (D_800D003C[actor->unk_0B4].dList != NULL)) { + gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].dList); } switch (actor->unk_0B4) { @@ -4220,7 +4220,7 @@ void func_800763A4(Actor* actor) { func_8007D2C8(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 3.0f); - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->unk_0E4 < 8)) { + if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { func_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_8007A6F0(&actor->obj.pos, 0x2903A008); @@ -4285,7 +4285,7 @@ void func_800763A4(Actor* actor) { actor->timer_0BE = 2; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->unk_0E4 < 8)) { + if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { func_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_8007A6F0(&actor->obj.pos, 0x2903A008); @@ -4323,7 +4323,7 @@ void func_800763A4(Actor* actor) { actor->timer_0BE = 2; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->unk_0E4 < 8)) { + if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { func_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_8007A6F0(&actor->obj.pos, 0x2903A008); diff --git a/src/main/fox_hud.c b/src/main/fox_hud.c index e380d1e7..9ad48204 100644 --- a/src/main/fox_hud.c +++ b/src/main/fox_hud.c @@ -2464,7 +2464,7 @@ s32 func_8008B774(void) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) { if ((gActors[i].unk_0B4 == 2) || (gActors[i].unk_0B4 == 43) || ((gActors[i].obj.id == 198) && - ((gActors[i].unk_0E4 == 1) || (gActors[i].unk_0E4 == 2) || (gActors[i].unk_0E4 == 3)))) { + ((gActors[i].aiType == 1) || (gActors[i].aiType == 2) || (gActors[i].aiType == 3)))) { if (gActors[i].timer_0C6) { ret = 1; } else { @@ -3839,7 +3839,7 @@ bool func_8009092C(Actor* actor) { Boss* boss; s32 i = 0; - if (actor->unk_0E6 != 0) { + if (actor->aiIndex != 0) { return true; } @@ -3848,10 +3848,10 @@ bool func_8009092C(Actor* actor) { for (i = 1; i < 4; i++, boss++) { if (boss->obj.status == OBJ_ACTIVE) { var_s5 = true; - if (actor->unk_0E6 == 0) { - actor->unk_0E6 = i; + if (actor->aiIndex == 0) { + actor->aiIndex = i; } else if (Rand_ZeroOne() > 0.4f) { - actor->unk_0E6 = i; + actor->aiIndex = i; } actor->state = 0; } @@ -3938,9 +3938,9 @@ bool func_80090CCC(Actor* actor) { bool ret = false; if (func_8009092C(actor)) { - actor->fwork[6] = gBosses[actor->unk_0E6].obj.pos.z; - actor->fwork[5] = gBosses[actor->unk_0E6].obj.pos.y; - actor->fwork[4] = gBosses[actor->unk_0E6].obj.pos.x; + actor->fwork[6] = gBosses[actor->aiIndex].obj.pos.z; + actor->fwork[5] = gBosses[actor->aiIndex].obj.pos.y; + actor->fwork[4] = gBosses[actor->aiIndex].obj.pos.x; } else { actor->fwork[6] = gBosses[0].obj.pos.z; actor->fwork[5] = gBosses[0].obj.pos.y; @@ -3967,9 +3967,9 @@ bool func_80090CCC(Actor* actor) { actor->fwork[10] = 30.0f; } - if (gBosses[actor->unk_0E6].obj.status == OBJ_FREE) { + if (gBosses[actor->aiIndex].obj.status == OBJ_FREE) { actor->state = 1; - actor->unk_0E6 = 0; + actor->aiIndex = 0; actor->iwork[6] = 0; ret = true; } @@ -4002,7 +4002,7 @@ s32 func_80090E8C(Actor* actor) { } } - if (actor->unk_0E4 == 1) { + if (actor->aiType == 1) { var_fv1_2 = 3000.0f; } else { var_fv1_2 = 5000.0f; @@ -4034,7 +4034,7 @@ bool func_800910C0(Actor* actor) { actor->fwork[5] = actor->vwork[28].y; actor->fwork[6] = gBosses[0].obj.pos.z + actor->vwork[28].z; - if (actor->unk_0E4 == 1) { + if (actor->aiType == 1) { var_fv1 = 1500.0f; } else { var_fv1 = 3000.0f; @@ -4063,7 +4063,7 @@ void func_80091254(Actor* actor) { bool func_80091298(Actor* actor) { actor->fwork[1] = gPlayer[0].unk_0D0 + 10.0f; actor->fwork[3] = 3.6f; - actor->fwork[4] = gPlayer[0].pos.x + ((f32) (actor->unk_0E4 - 2) * 700.0f); + actor->fwork[4] = gPlayer[0].pos.x + ((f32) (actor->aiType - 2) * 700.0f); actor->fwork[5] = gPlayer[0].pos.y; actor->fwork[6] = gPlayer[0].unk_138; @@ -4080,9 +4080,9 @@ bool func_80091368(Actor* actor) { actor->fwork[5] = 20000.0f; actor->iwork[1] = 1; actor->iwork[5] = 1; - gTeamShields[actor->unk_0E4] = 1; + gTeamShields[actor->aiType] = 1; - switch (actor->unk_0E4) { + switch (actor->aiType) { case 1: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; @@ -4095,7 +4095,7 @@ bool func_80091368(Actor* actor) { Radio_PlayMessage(gMsg_ID_20222, RCID_SLIPPY); break; } - gTeamShields[actor->unk_0E4] = -1; + gTeamShields[actor->aiType] = -1; break; case 1: @@ -4140,7 +4140,7 @@ void func_800914FC(Actor* actor) { break; } - if ((gTeamShields[actor->unk_0E4] <= 0) && (actor->state != 3)) { + if ((gTeamShields[actor->aiType] <= 0) && (actor->state != 3)) { actor->iwork[5] = 0; actor->state = 3; } @@ -4195,7 +4195,7 @@ bool func_800915FC(Actor* actor) { boss = &gBosses[0]; y = 650.0f; - if (actor->unk_0E4 < 8) { + if (actor->aiType < 8) { y = 720.0f; } @@ -4335,7 +4335,7 @@ bool func_80091DF4(Actor* actor) { sp44.y = 0.0f; sp44.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - func_8006EEFC(actor->unk_0E4, actor->obj.pos.x + (sp38.x * 1.5), actor->obj.pos.y + (sp38.y * 1.5), + func_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); } @@ -4378,14 +4378,14 @@ bool func_80091F00(Actor* actor) { actor->fwork[14] = sp34.y; actor->fwork[12] = sp34.z; - gTeamShields[actor->unk_0E4] = actor->health; + gTeamShields[actor->aiType] = actor->health; if (gRadioState != 0) { return false; } if ((actor->unk_0D0 == 3) && (actor->unk_0D4 == 1)) { - switch (actor->unk_0E4) { + switch (actor->aiType) { case 1: Radio_PlayMessage(gMsg_ID_20210, RCID_FALCO); break; @@ -4399,7 +4399,7 @@ bool func_80091F00(Actor* actor) { } if ((actor->unk_0D0 != 3) && (actor->unk_0D4 == 1)) { - switch (actor->unk_0E4) { + switch (actor->aiType) { case 1: Radio_PlayMessage(gMsg_ID_20060, RCID_FALCO); break; @@ -4413,7 +4413,7 @@ bool func_80091F00(Actor* actor) { } if ((actor->unk_0D4 == 2) || (actor->unk_0D4 == 100)) { - switch (actor->unk_0E4) { + switch (actor->aiType) { case 1: Radio_PlayMessage(gMsg_ID_20030, RCID_FALCO); break; @@ -4432,7 +4432,7 @@ bool func_80091F00(Actor* actor) { void func_80092244(Actor* actor) { gRadarMarks[actor->index].unk_00 = 1; - gRadarMarks[actor->index].unk_02 = actor->unk_0E4; + gRadarMarks[actor->index].unk_02 = actor->aiType; gRadarMarks[actor->index].pos.x = actor->obj.pos.x; gRadarMarks[actor->index].pos.y = actor->obj.pos.y; gRadarMarks[actor->index].pos.z = actor->obj.pos.z; @@ -4442,15 +4442,15 @@ void func_80092244(Actor* actor) { void func_800922F4(Actor* actor) { s32 temp; - if ((gTeamShields[actor->unk_0E4] < 64) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + if ((gTeamShields[actor->aiType] < 64) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { temp = 7; - if (gTeamShields[actor->unk_0E4] > 16) { + if (gTeamShields[actor->aiType] > 16) { temp = 15; } - if (gTeamShields[actor->unk_0E4] > 32) { + if (gTeamShields[actor->aiType] > 32) { temp = 31; } - if (gTeamShields[actor->unk_0E4] > 48) { + if (gTeamShields[actor->aiType] > 48) { temp = 63; } @@ -4673,16 +4673,16 @@ void func_80092D48(Actor* actor) { if (gCurrentLevel != LEVEL_TITANIA) { actor->fwork[1] = 40.0f; actor->fwork[3] = 1.2f; - actor->unk_0E4 = (D_800D1970 & 3) + 1; + actor->aiType = (D_800D1970 & 3) + 1; D_800D1970++; } else { actor->state = 7; - actor->unk_0E4 = 2; + actor->aiType = 2; actor->iwork[5] = 0; gTeamShields[2] = 255; } - actor->iwork[12] = D_800D22A8[actor->unk_0E4 - 1]; + actor->iwork[12] = D_800D22A8[actor->aiType - 1]; actor->iwork[11] = 1; if (gLevelType == LEVELTYPE_PLANET) { @@ -4695,7 +4695,7 @@ void func_80092D48(Actor* actor) { Object_Kill(&actor->obj, actor->sfxSource); } - if (gTeamShields[actor->unk_0E4] <= 0) { + if (gTeamShields[actor->aiType] <= 0) { Object_Kill(&actor->obj, actor->sfxSource); } } @@ -4703,7 +4703,7 @@ void func_80092D48(Actor* actor) { void func_80092EC0(Actor* actor) { f32 var_fv1; - actor->health = gTeamShields[actor->unk_0E4]; + actor->health = gTeamShields[actor->aiType]; switch (actor->unk_048) { case 0: diff --git a/src/main/fox_versus.c b/src/main/fox_versus.c index 7d75419c..e7aefa35 100644 --- a/src/main/fox_versus.c +++ b/src/main/fox_versus.c @@ -1996,7 +1996,7 @@ void func_800C26C8(void) { actor->obj.pos.x = dest.x; actor->obj.pos.y = dest.y; actor->obj.pos.z = dest.z; - actor->unk_0E4 = i + 10; + actor->aiType = i + 10; actor->health = 24; actor->timer_0C2 = 30; diff --git a/src/main/gfx_data.c b/src/main/gfx_data.c index 1b3bd859..3c173160 100644 --- a/src/main/gfx_data.c +++ b/src/main/gfx_data.c @@ -85,16 +85,9 @@ Vtx D_Vtx_800D9760[] = { Gfx D_Gfx_800D9860[] = { // unused - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_MIRROR | G_TX_WRAP, 5, G_TX_NOLOD, - G_TX_MIRROR | G_TX_WRAP, 5, G_TX_NOLOD), - gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_Tex_800D99F8), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), - gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 1023, 256), + gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 5, 5, + G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32), gsSPVertex(D_Vtx_800D9760, 16, 0), gsSP1Triangle(2, 1, 0, 0), gsSP1Triangle(3, 2, 0, 0), @@ -128,16 +121,9 @@ Vtx D_Vtx_800D9950[] = { Gfx D_Gfx_800D9990[] = { // unused gsDPSetPrimColor(0, 0, 0xFF, 0xFF, 0xFF, 0xFF), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD), - gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x001C, 0x001C), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_Tex_800D99F8), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), - gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 63, 1024), + gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, + G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), gsSPVertex(D_Vtx_800D9950, 4, 0), gsSP1Triangle(1, 2, 3, 0), gsSP1Triangle(1, 3, 0, 0), @@ -302,16 +288,9 @@ u16 D_Tex_800DA1F8[1024] = { Gfx D_Gfx_800DA9F8[] = { // unused - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD), - gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x001C, 0x001C), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_Tex_800D99F8), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), - gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 63, 1024), + gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, + G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), gsSPVertex(D_Vtx_800D9910, 4, 0), gsSP1Triangle(0, 1, 2, 0), gsSP1Triangle(0, 2, 3, 0), @@ -327,16 +306,9 @@ Vtx D_Vtx_800DAA58[] = { Gfx D_Gfx_800DAA98[] = { // unused - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD), - gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x001C, 0x001C), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_Tex_800D99F8), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), - gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 63, 1024), + gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, + G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), gsSPVertex(D_Vtx_800DAA58, 4, 0), gsSP1Triangle(0, 1, 2, 0), gsSP1Triangle(0, 2, 3, 0), @@ -365,16 +337,9 @@ Vtx D_Vtx_800DAB40[] = { Gfx D_Gfx_800DAB80[] = { // unused - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD), - gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x001C, 0x001C), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_Tex_800D99F8), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), - gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 63, 1024), + gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, + G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), gsSPVertex(D_Vtx_800DAB40, 4, 0), gsSP1Triangle(0, 2, 1, 0), gsSP1Triangle(0, 1, 3, 0), @@ -390,16 +355,9 @@ Vtx D_Vtx_800DABE0[] = { Gfx D_Gfx_800DAC20[] = { // used in fox_edisplay - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD), - gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x001C, 0x001C), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_Tex_800DA1F8), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), - gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 63, 1024), + gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, + G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTileTexture(D_Tex_800DA1F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), gsSPVertex(D_Vtx_800DABE0, 4, 0), gsSP1Triangle(0, 2, 1, 0), gsSP1Triangle(0, 3, 2, 0), diff --git a/src/overlays/ovl_i1/fox_tr360.c b/src/overlays/ovl_i1/fox_tr360.c index 60f09c7d..74c37bac 100644 --- a/src/overlays/ovl_i1/fox_tr360.c +++ b/src/overlays/ovl_i1/fox_tr360.c @@ -150,7 +150,7 @@ void func_i1_80199024(Actor* actor) { func_8003088C(actor); radarMark = &gRadarMarks[actor->index]; radarMark->unk_00 = 1; - radarMark->unk_02 = actor->unk_0E4; + radarMark->unk_02 = actor->aiType; radarMark->pos.x = actor->obj.pos.x; radarMark->pos.y = actor->obj.pos.y; radarMark->pos.z = actor->obj.pos.z; @@ -200,17 +200,17 @@ void func_i1_8019949C(void) { actor->obj.pos.y = 2000.0f; actor->obj.pos.z = sp38.z; actor->unk_0F4.y = gGameFrameCount * 6.0f; - actor->unk_0E4 = i + 10; + actor->aiType = i + 10; actor->health = 24; actor->unk_0C9 = actor->iwork[11] = 1; actor->timer_0C2 = 30; Object_SetInfo(&actor->info, actor->obj.id); AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); if ((i + 10) == 10) { - actor->unk_0E6 = 0; + actor->aiIndex = 0; actor->health = 50; } else { - actor->unk_0E6 = -1; + actor->aiIndex = -1; actor->info.action = (ObjectFunc) func_i1_80199024; } break; diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index 742f0efb..19d01462 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "assets/ast_sector_x.h" @@ -33,7 +34,7 @@ void func_i2_8018F030(void) { actor->obj.pos.y = gPlayer[0].camEye.y + 200.0f; actor->obj.pos.z = gPlayer[0].camEye.z - D_80177D20 + 300.0f; actor->iwork[11] = 1; - actor->unk_0E4 = 2; + actor->aiType = 2; Object_SetInfo(&actor->info, actor->obj.id); Radio_PlayMessage(gMsg_ID_5475, RCID_SLIPPY); break; diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index c96ed8ca..de4264c1 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -60,11 +60,11 @@ void func_i4_8018BD60(Actor* actor) { actorPtr->obj.pos.y = 1000.0f; actorPtr->obj.pos.z = D_i4_8019EED4[actor->unk_04E]; actorPtr->state = 1; - actorPtr->unk_0E6 = -1; + actorPtr->aiIndex = -1; actorPtr->health = 24; actorPtr->iwork[11] = 1; actorPtr->unk_044 = 2; - actorPtr->unk_0E4 = i; + actorPtr->aiType = i; Object_SetInfo(&actorPtr->info, actorPtr->obj.id); AUDIO_PLAY_SFX(0x3100000CU, actorPtr->sfxSource, 4U); break; @@ -102,30 +102,30 @@ void func_i4_8018BEF8(Actor* actor, s32 arg1) { actorPtr->state = 1; actorPtr->timer_0C4 = 300; - actorPtr->unk_0E4 = i; - actorPtr->unk_0E6 = -1; + actorPtr->aiType = i; + actorPtr->aiIndex = -1; if (i < 13) { - actorPtr->unk_0E6 = 2; - gActors[2].unk_0E6 = -1; + actorPtr->aiIndex = 2; + gActors[2].aiIndex = -1; } if ((i == 17) || (i == 18)) { - actorPtr->unk_0E6 = 0; + actorPtr->aiIndex = 0; } if ((i == 20) || (i == 21)) { - actorPtr->unk_0E6 = 3; - gActors[3].unk_0E6 = -1; + actorPtr->aiIndex = 3; + gActors[3].aiIndex = -1; } if (i == 22) { - actorPtr->unk_0E6 = 1; - gActors[1].unk_0E6 = -1; + actorPtr->aiIndex = 1; + gActors[1].aiIndex = -1; } if ((D_i4_801A0530 > 16000) && ((i == 23) || (i == 24))) { - actorPtr->unk_0E6 = 0; + actorPtr->aiIndex = 0; } actorPtr->health = 24; @@ -342,13 +342,13 @@ void func_i4_8018C158(Actor* actor) { break; case 6: - gActors[1].unk_0E6 = 0; + gActors[1].aiIndex = 0; gActors[1].state = 2; - gActors[2].unk_0E6 = 0; + gActors[2].aiIndex = 0; gActors[2].state = 2; - gActors[3].unk_0E6 = 0; + gActors[3].aiIndex = 0; gActors[3].state = 2; - gActors[4].unk_0E6 = gActors[5].unk_0E6 = gActors[6].unk_0E6 = gActors[7].unk_0E6 = -1; + gActors[4].aiIndex = gActors[5].aiIndex = gActors[6].aiIndex = gActors[7].aiIndex = -1; break; } diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index d62dbea0..5c5a67bd 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -38,17 +38,17 @@ void func_i4_801875F0(Actor* actor) { actorPtr->obj.pos.z = gBosses[0].obj.pos.z; actorPtr->state = 1; actorPtr->timer_0BC = 100; - actorPtr->unk_0E4 = i + 10; - actorPtr->unk_0E6 = -1; + actorPtr->aiType = i + 10; + actorPtr->aiIndex = -1; if ((i == 3) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->unk_0E6 = 2; + actorPtr->aiIndex = 2; } if ((i == 4) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->unk_0E6 = 3; + actorPtr->aiIndex = 3; } if ((i == 5) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->unk_0E6 = 1; + actorPtr->aiIndex = 1; } actorPtr->unk_0F4.x = 3.0f; @@ -80,7 +80,7 @@ void func_i4_80187884(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { actor->obj.pos.y = yPos; actor->obj.pos.z = zPos; actor->obj.id = OBJ_ACTOR_197; - actor->unk_0E4 = 4; + actor->aiType = 4; actor->unk_0C9 = 1; actor->state = 0; actor->timer_0BC = 10000; @@ -151,8 +151,8 @@ void func_i4_80187960(Actor* actor) { if (D_8015F928 == 8540) { Radio_PlayMessage(gMsg_ID_9400, RCID_ROB64); Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_10 | 0x8000, 0, 0); - gActors[1].unk_0E6 = gActors[2].unk_0E6 = gActors[3].unk_0E6 = gActors[4].unk_0E6 = gActors[5].unk_0E6 = - gActors[6].unk_0E6 = gActors[7].unk_0E6 = -1; + gActors[1].aiIndex = gActors[2].aiIndex = gActors[3].aiIndex = gActors[4].aiIndex = gActors[5].aiIndex = + gActors[6].aiIndex = gActors[7].aiIndex = -1; } if ((D_800C9B4C < D_8015F928) && (D_8015F928 < 9970) && (D_80177CD0[0] == 0) && (D_80177CD0[1] == 0) && @@ -362,11 +362,11 @@ void func_i4_80187960(Actor* actor) { case 6: actor->iwork[0] += 1; if (D_80177930 == 0) { - actor1->unk_0E6 = 0; + actor1->aiIndex = 0; actor1->state = 2; - actor2->unk_0E6 = 0; + actor2->aiIndex = 0; actor2->state = 2; - actor3->unk_0E6 = 0; + actor3->aiIndex = 0; actor3->state = 2; if (actor->iwork[0] == 130) { Vec3f sp50 = { 0.0f, 0.0f, -10000 }; @@ -382,7 +382,7 @@ void func_i4_80187960(Actor* actor) { actor19->state = 4; actor19->unk_0F4.y = player->unk_0E8 + player->unk_114 + 180.0f; actor19->unk_0F4.x = 15.0f; - actor19->unk_0E4 = 0x64; + actor19->aiType = 100; actor19->fwork[1] = 90.0f; actor19->fwork[0] = 90.0f; Object_SetInfo(&actor19->info, actor19->obj.id); diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index f47247ff..0cca3422 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -579,9 +579,9 @@ void func_i4_80194458(Boss* boss, Vec3f* pos, f32 arg2) { actor->timer_0BC = 20; actor->unk_0F4.y = arg2; actor->unk_0F4.x = -30.0f; - actor->unk_0E4 = i + 10; + actor->aiType = i + 10; actor->unk_0B6 = D_i4_8019F198[i - 10]; - actor->unk_0E6 = D_i4_8019F1C0[i - 10]; + actor->aiIndex = D_i4_8019F1C0[i - 10]; actor->health = 24; if (actor->unk_0B6 >= 2) { actor->health = 1000; @@ -1749,8 +1749,8 @@ void func_i4_801981F8(Actor* actor) { actor_it->obj.pos.z = dest.z; actor_it->unk_0F4.y = actor->unk_04E * 18.0f; actor_it->state = 1; - actor_it->unk_0E4 = i + 10; - actor_it->unk_0E6 = D_i4_8019F444[i]; + actor_it->aiType = i + 10; + actor_it->aiIndex = D_i4_8019F444[i]; actor_it->unk_0F4.x = 3.0f; actor_it->health = 24; if (actor_it->unk_0B6 >= 2) { @@ -1786,8 +1786,8 @@ void func_i4_8019848C(void) { actor->obj.pos.x = 0; actor->obj.pos.y = 1000.0f; actor->state = 1; - actor->unk_0E4 = 9; - actor->unk_0E6 = 27; + actor->aiType = 9; + actor->aiIndex = 27; actor->unk_0B6 = 2; actor->health = 1000; actor->iwork[11] = 1; @@ -1832,11 +1832,11 @@ void func_i4_80198594(Actor* actor) { break; case 6: - gActors[1].unk_0E6 = 0; + gActors[1].aiIndex = 0; gActors[1].state = 2; - gActors[2].unk_0E6 = 0; + gActors[2].aiIndex = 0; gActors[2].state = 2; - gActors[3].unk_0E6 = 0; + gActors[3].aiIndex = 0; gActors[3].state = 2; break; } @@ -1962,26 +1962,26 @@ void func_i4_80198AA0(Actor* actor) { state = 1; xDist = fabsf(actor->fwork[4] - actor->obj.pos.x); yDist = fabsf(actor->fwork[6] - actor->obj.pos.z); - if (actor->unk_0E6 < 0) { + if (actor->aiIndex < 0) { actor->state = 3; } else { - if (actor->unk_0E4 >= 10) { + if (actor->aiType >= 10) { xPos = __sinf(((actor->index * 45) + gGameFrameCount) * M_DTOR) * 200.0f; yPos = __cosf(((actor->index * 45) + (gGameFrameCount * 2)) * M_DTOR) * 200.0f; zPos = __sinf(((actor->index * 45) + gGameFrameCount) * M_DTOR) * 200.0f; } - actor->fwork[4] = gActors[actor->unk_0E6].obj.pos.x + xPos; - actor->fwork[5] = gActors[actor->unk_0E6].obj.pos.y + yPos; - actor->fwork[6] = gActors[actor->unk_0E6].obj.pos.z + zPos; - actor->fwork[1] = gActors[actor->unk_0E6].fwork[0] + 10.0f; + actor->fwork[4] = gActors[actor->aiIndex].obj.pos.x + xPos; + actor->fwork[5] = gActors[actor->aiIndex].obj.pos.y + yPos; + actor->fwork[6] = gActors[actor->aiIndex].obj.pos.z + zPos; + actor->fwork[1] = gActors[actor->aiIndex].fwork[0] + 10.0f; if (actor->fwork[1] < 30.0f) { actor->fwork[1] = 30.0f; } actor->fwork[3] = 1.4f; - if (actor->unk_0E6 >= 0) { + if (actor->aiIndex >= 0) { if (yDist < 800.0f) { if (xDist < 800.0f) { - actor->fwork[1] = gActors[actor->unk_0E6].fwork[0] - 5.0f; + actor->fwork[1] = gActors[actor->aiIndex].fwork[0] - 5.0f; } } else if (actor->timer_0C0 == 0) { actor->timer_0C0 = RAND_INT(200.0f) + 200; @@ -1999,9 +1999,9 @@ void func_i4_80198AA0(Actor* actor) { actor->iwork[4] = 0; } - if ((actor->unk_0E6 > 0) && - ((gActors[actor->unk_0E6].obj.status == 3) || (gActors[actor->unk_0E6].state == 6) || - gActors[actor->unk_0E6].obj.status == OBJ_FREE)) { + if ((actor->aiIndex > 0) && + ((gActors[actor->aiIndex].obj.status == 3) || (gActors[actor->aiIndex].state == 6) || + gActors[actor->aiIndex].obj.status == OBJ_FREE)) { actor->state = 3; } } @@ -2032,7 +2032,7 @@ void func_i4_80198AA0(Actor* actor) { actor->fwork[10] = 30.0f; } - if ((actor->unk_0E6 > 0) && (gActors[actor->unk_0E6].obj.status == OBJ_ACTIVE)) { + if ((actor->aiIndex > 0) && (gActors[actor->aiIndex].obj.status == OBJ_ACTIVE)) { actor->state = 2; actor->iwork[2] = 0; } @@ -2105,7 +2105,7 @@ void func_i4_80198AA0(Actor* actor) { yVel = (-xSin * 200.0f * 0.5f); xVel = (xCos * 200.0f * 0.5f); zVel = (xCos * 200.0f * 0.5f); - func_8006EEFC(actor->unk_0E4, actor->obj.pos.x + ((ySin * xVel) * 1.5f), actor->obj.pos.y + (yVel * 1.5f), + func_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); @@ -2113,7 +2113,7 @@ void func_i4_80198AA0(Actor* actor) { func_8003088C(actor); radarMark = &gRadarMarks[actor->index]; radarMark->unk_00 = 1; - radarMark->unk_02 = actor->unk_0E4; + radarMark->unk_02 = actor->aiType; radarMark->pos.x = actor->obj.pos.x; radarMark->pos.y = actor->obj.pos.y; radarMark->pos.z = actor->obj.pos.z; @@ -2137,7 +2137,7 @@ void func_i4_801995B4(Actor* actor) { } } - if ((actor->iwork[8] != 0) && (actor->unk_0E4 < 100)) { + if ((actor->iwork[8] != 0) && (actor->aiType < 100)) { angle = __sinf(actor->iwork[8] * 400.0f * M_DTOR) * actor->iwork[8]; Matrix_RotateY(gGfxMatrix, M_DTOR * angle, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * angle, 1); diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index eb7ef214..fc6f7f17 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -143,7 +143,7 @@ void func_i4_80199C60(Actor* missile) { if (xDist) {} if (zDist) {} - if (missile->unk_0E4 < 100) { + if (missile->aiType < 100) { xDist = SIN_DEG((missile->index * 45) + gGameFrameCount) * 5000.0f; zDist = COS_DEG((missile->index * 45) + (gGameFrameCount * 2)) * 5000.0f; } else { @@ -186,7 +186,7 @@ void func_i4_80199FCC(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_197; - actor->unk_0E4 = 200; + actor->aiType = 200; actor->obj.pos.x = D_i4_8019F4C0[arg1].x; actor->obj.pos.y = D_i4_8019F4C0[arg1].y; @@ -210,7 +210,7 @@ void func_i4_8019A0F8(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_197; - actor->unk_0E4 = arg1 + 13; + actor->aiType = arg1 + 13; actor->obj.pos.x = gActors[10].obj.pos.x + D_i4_8019F4E4[arg1].x; actor->obj.pos.y = gActors[10].obj.pos.y + D_i4_8019F4E4[arg1].y; @@ -236,8 +236,8 @@ void func_i4_8019A1D0(void) { actor->obj.pos.y = 4500.0f; actor->obj.pos.z = 30000.0f; - actor->unk_0E4 = 8; - actor->unk_0E6 = 12; + actor->aiType = 8; + actor->aiIndex = 12; actor->health = 10000; actor->unk_0F4.y = 180.0f; actor->state = 0; @@ -285,54 +285,54 @@ void func_i4_8019A3E8(Actor* actor) { if (gTeamShields[1] > 0) { if (gActors[1].iwork[2] == 0) { if (gActors[10].obj.status == 2) { - if (gActors[1].unk_0E6 != 10) { + if (gActors[1].aiIndex != 10) { Radio_PlayMessage(gMsg_ID_16040, RCID_FALCO); } - gActors[1].unk_0E6 = 10; + gActors[1].aiIndex = 10; } else { - gActors[1].unk_0E6 = 13; + gActors[1].aiIndex = 13; } } else { - gActors[1].unk_0E6 = -1; + gActors[1].aiIndex = -1; } } if (gTeamShields[3] > 0) { if (gActors[3].iwork[2] == 0) { if (gActors[12].obj.status == 2) { - if (gActors[3].unk_0E6 != 12) { + if (gActors[3].aiIndex != 12) { Radio_PlayMessage(gMsg_ID_16046, RCID_PEPPY); } - gActors[3].unk_0E6 = 12; + gActors[3].aiIndex = 12; } else { - gActors[3].unk_0E6 = 15; + gActors[3].aiIndex = 15; } } else { - gActors[3].unk_0E6 = -1; + gActors[3].aiIndex = -1; } } if (D_i4_801A0564 != 0) { if (gActors[11].obj.status == 2) { - if (gActors[8].unk_0E6 != 11) { + if (gActors[8].aiIndex != 11) { Radio_PlayMessage(gMsg_ID_16135, RCID_KATT); } - gActors[8].unk_0E6 = 11; + gActors[8].aiIndex = 11; } else { - gActors[8].unk_0E6 = -1; + gActors[8].aiIndex = -1; } } else if (gTeamShields[2] > 0) { if (gActors[2].iwork[2] == 0) { if (gActors[11].obj.status == 2) { - if (gActors[2].unk_0E6 != 11) { + if (gActors[2].aiIndex != 11) { Radio_PlayMessage(gMsg_ID_16047, RCID_SLIPPY); } - gActors[2].unk_0E6 = 11; + gActors[2].aiIndex = 11; } else { - gActors[2].unk_0E6 = 14; + gActors[2].aiIndex = 14; } } else { - gActors[2].unk_0E6 = -1; + gActors[2].aiIndex = -1; } } } @@ -363,24 +363,24 @@ void func_i4_8019A3E8(Actor* actor) { actorPtr->unk_0F4.y = actor->unk_04E * 18.0f; actorPtr->state = 3; - actorPtr->unk_0E4 = i + 13; - actorPtr->unk_0E6 = -1; + actorPtr->aiType = i + 13; + actorPtr->aiIndex = -1; if (D_8015F928 >= 0) { if (((i + 13) == 23) || ((i + 13) == 24)) { - actorPtr->unk_0E6 = 2; + actorPtr->aiIndex = 2; actorPtr->state = 2; } if ((i + 13) == 25) { - actorPtr->unk_0E6 = 0; + actorPtr->aiIndex = 0; actorPtr->state = 2; } if (((i + 13) == 26) || ((i + 13) == 27)) { - actorPtr->unk_0E6 = 3; + actorPtr->aiIndex = 3; actorPtr->state = 2; } if ((i + 13) == 28) { - actorPtr->unk_0E6 = 1; + actorPtr->aiIndex = 1; actorPtr->state = 2; } } @@ -566,15 +566,15 @@ void func_i4_8019AB8C(Actor* actor) { break; case 6: - gActors[1].unk_0E6 = 0; + gActors[1].aiIndex = 0; gActors[1].state = 2; - gActors[2].unk_0E6 = 0; + gActors[2].aiIndex = 0; gActors[2].state = 2; - gActors[3].unk_0E6 = 0; + gActors[3].aiIndex = 0; gActors[3].state = 2; for (i = 10; i < ARRAY_COUNT(gActors); i++) { - gActors[i].unk_0E6 = -1; + gActors[i].aiIndex = -1; gActors[i].state = 3; } break; @@ -588,22 +588,22 @@ void func_i4_8019AB8C(Actor* actor) { break; case 9780: - gActors[13].unk_0E6 = -1; + gActors[13].aiIndex = -1; gActors[13].state = 3; break; case 9740: - gActors[14].unk_0E6 = -1; + gActors[14].aiIndex = -1; gActors[14].state = 3; break; case 9730: - gActors[15].unk_0E6 = -1; + gActors[15].aiIndex = -1; gActors[15].state = 3; break; case 9710: - gActors[16].unk_0E6 = -1; + gActors[16].aiIndex = -1; gActors[16].state = 3; break; } @@ -761,12 +761,12 @@ void func_i4_8019B888(void) { actor->obj.id = OBJ_ACTOR_197; Object_SetInfo(&actor->info, actor->obj.id); if (i == 0) { - actor->unk_0E4 = 1000; + actor->aiType = 1000; } else { actor->obj.pos.x = gPlayer[0].pos.x + D_i4_8019F5EC[i].x; actor->obj.pos.y = gPlayer[0].pos.y + D_i4_8019F5EC[i].y; actor->obj.pos.z = gPlayer[0].pos.z + D_i4_8019F5EC[i].z; - actor->unk_0E4 = i; + actor->aiType = i; actor->state = 2; actor->unk_0F4.y = 270.0f; actor->health = 255; diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index 99a8f20e..c7d4a0d8 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -536,8 +536,8 @@ void func_i6_80189098(Boss* boss) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_197; - actor->unk_0E4 = 10; - actor->unk_0E6 = 0; + actor->aiType = 10; + actor->aiIndex = 0; actor->health = 200; actor->obj.pos.x = 200.0f; actor->obj.pos.y = 0.0f; @@ -550,8 +550,8 @@ void func_i6_80189098(Boss* boss) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_197; - actor->unk_0E4 = 10; - actor->unk_0E6 = 0; + actor->aiType = 10; + actor->aiIndex = 0; actor->health = 200; actor->obj.pos.x = -200.0f; actor->obj.pos.y = 0.0f; diff --git a/tools/Torch b/tools/Torch index d9eae785..a96d89cf 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit d9eae785d4094ac9005c16f29977690455d13818 +Subproject commit a96d89cfa6690549d7c775d247417038e9a07fbc