mirror of
https://github.com/n64decomp/banjo-kazooie.git
synced 2025-02-10 23:09:18 +00:00
Merge branch 'master' of https://gitlab.com/banjo.decomp/banjo-kazooie into core1_docu
This commit is contained in:
commit
9495386470
@ -2140,7 +2140,7 @@ segments:
|
||||
# # - [0x108D450, c, code_2900]
|
||||
# # - [0x108D4E0, c, code_2990]
|
||||
# # - [0x108EB10, c, code_3FC0]
|
||||
# # - [0x108EBC0, c, code_4070]
|
||||
# # - [0x108EBC0, c, ch/jumptutorial]
|
||||
# # - [0x108F020, c, code_44D0]
|
||||
# # - [0x108F210, c, code_46C0]
|
||||
# # - [0x108F220, .data, code_0]
|
||||
@ -2151,7 +2151,7 @@ segments:
|
||||
# # - [0x108F3B0, .data, ch/vegetables]
|
||||
# # - [0x108F6C0, .data, code_2990]
|
||||
# # - [0x108F750, .data, code_3FC0]
|
||||
# # - [0x108F810, .data, code_4070]
|
||||
# # - [0x108F810, .data, ch/jumptutorial]
|
||||
# # - [0x108F840, .data, code_44D0]
|
||||
# # - [0x108F870, .rodata, code_5B0]
|
||||
# # - [0x108F890, .rodata, ch/attacktutorial]
|
||||
|
@ -2136,9 +2136,9 @@ segments:
|
||||
- [0x108B8B0, c, ch/attacktutorial]
|
||||
- [0x108C070, c, ch/vegetables]
|
||||
- [0x108D450, c, code_2900]
|
||||
- [0x108D4E0, c, code_2990]
|
||||
- [0x108D4E0, c, ch/smbottles]
|
||||
- [0x108EB10, c, code_3FC0]
|
||||
- [0x108EBC0, c, code_4070]
|
||||
- [0x108EBC0, c, ch/jumptutorial]
|
||||
- [0x108F020, c, code_44D0]
|
||||
- [0x108F210, c, code_46C0]
|
||||
- [0x108F220, .data, code_0]
|
||||
@ -2147,14 +2147,14 @@ segments:
|
||||
- [0x108F350, .data, code_BF0]
|
||||
- [0x108F380, .data, ch/attacktutorial]
|
||||
- [0x108F3B0, .data, ch/vegetables]
|
||||
- [0x108F6C0, .data, code_2990]
|
||||
- [0x108F6C0, .data, ch/smbottles]
|
||||
- [0x108F750, .data, code_3FC0]
|
||||
- [0x108F810, .data, code_4070]
|
||||
- [0x108F810, .data, ch/jumptutorial]
|
||||
- [0x108F840, .data, code_44D0]
|
||||
- [0x108F870, .rodata, code_5B0]
|
||||
- [0x108F890, .rodata, ch/attacktutorial]
|
||||
- [0x108F930, .rodata, ch/vegetables]
|
||||
- [0x108F960, .rodata, code_2990]
|
||||
- [0x108F960, .rodata, ch/smbottles]
|
||||
- [0x108FA70, .rodata, code_44D0]
|
||||
- [0x108FA80, .bss, code_F0]
|
||||
- name: cutscenes
|
||||
|
290
include/enums.h
290
include/enums.h
@ -328,7 +328,7 @@ enum volatile_flags_e {
|
||||
VOLATILE_FLAG_74_SANDCASTLE_INFINITE_EGGS,
|
||||
VOLATILE_FLAG_75_SANDCASTLE_INFINITE_RED_FEATHERS,
|
||||
VOLATILE_FLAG_76_SANDCASTLE_INFINITE_GOLD_FEATHERS,
|
||||
VOLATILE_FLAG_77, // unused
|
||||
VOLATILE_FLAG_77_SANDCASTLE_SET_HEALTH_TO_MAX,
|
||||
VOLATILE_FLAG_78_SANDCASTLE_NO_BONUS,
|
||||
VOLATILE_FLAG_79, // unused
|
||||
VOLATILE_FLAG_7A, // unused
|
||||
@ -1980,7 +1980,8 @@ enum actor_e
|
||||
ACTOR_166_TOPPER_A,
|
||||
ACTOR_167_ATTACK_TUTORIAL,
|
||||
|
||||
ACTOR_16F_QUARRIE = 0x16F,
|
||||
ACTOR_16E_UNKNOWN = 0x16E,
|
||||
ACTOR_16F_QUARRIE,
|
||||
|
||||
ACTOR_172_RBB_EGG_TOLL = 0x172,
|
||||
|
||||
@ -2147,6 +2148,8 @@ enum actor_e
|
||||
|
||||
ACTOR_33F_WOZZA_IN_CAVE = 0x33F,
|
||||
|
||||
ACTOR_349_UNKNOWN = 0x349,
|
||||
|
||||
ACTOR_34D_BEE_SWARM = 0x34D,
|
||||
ACTOR_34E_LIMBO,
|
||||
ACTOR_34F_MUMMUM,
|
||||
@ -2210,7 +2213,8 @@ enum actor_e
|
||||
|
||||
ACTOR_3AF_GRUNTY_SHADOW = 0x3AF,
|
||||
|
||||
ACTOR_3BA_UNKOWN = 0x3ba,
|
||||
ACTOR_3B9_JUMP_TUTORIAL = 0x3B9,
|
||||
ACTOR_3BA_UNKNOWN,
|
||||
|
||||
ACTOR_3BF_GRUNTLING_BLUE = 0x3bf,
|
||||
ACTOR_3C0_GRUNTLING_BLACK,
|
||||
@ -2439,6 +2443,25 @@ enum bs_e
|
||||
BS_A5_WONDERWING_UNKA5
|
||||
};
|
||||
|
||||
enum sm_specific_flags {
|
||||
SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES = 0x1,
|
||||
SM_SPECIFIC_FLAG_2,
|
||||
SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED,
|
||||
SM_SPECIFIC_FLAG_4,
|
||||
SM_SPECIFIC_FLAG_5,
|
||||
|
||||
SM_SPECIFIC_FLAG_7 = 0x7,
|
||||
SM_SPECIFIC_FLAG_8_ABILITY_HOLD_A_JUMP_HIGHER_UNLOCKED,
|
||||
SM_SPECIFIC_FLAG_9_ABILITY_FEATHERY_UNLOCKED,
|
||||
SM_SPECIFIC_FLAG_A,
|
||||
|
||||
SM_SPECIFIC_FLAG_C = 0xC,
|
||||
|
||||
SM_SPECIFIC_FLAG_E = 0xE,
|
||||
SM_SPECIFIC_FLAG_F,
|
||||
SM_SPECIFIC_FLAG_10
|
||||
};
|
||||
|
||||
enum mm_specific_flags {
|
||||
MM_SPECIFIC_FLAG_0_CHIMPY_STUMP_RAISED,
|
||||
MM_SPECIFIC_FLAG_1_ORANGE_HAS_BEEN_COLLECTED,
|
||||
@ -2487,11 +2510,10 @@ enum item_e
|
||||
ITEM_6_HOURGLASS,
|
||||
ITEM_7_SKULL_HOURGLASS,
|
||||
|
||||
|
||||
ITEM_9_PROPELLOR = 0x9,
|
||||
|
||||
ITEM_B_XMAS_TREE = 0xb,
|
||||
ITEM_C_NOTE = 0xC,
|
||||
ITEM_C_NOTE,
|
||||
ITEM_D_EGGS,
|
||||
ITEM_E_JIGGY,
|
||||
ITEM_F_RED_FEATHER,
|
||||
@ -2921,6 +2943,11 @@ enum asset_e
|
||||
ASSET_220_ANIM_SIR_SLUSH_DIE = 0x220,
|
||||
ASSET_221_ANIM_WOZZA_IN_CAVE,
|
||||
|
||||
ASSET_223_ANIM_TOPPER_UNKNOWN = 0x223,
|
||||
ASSET_224_ANIM_TOPPER_UNKNOWN,
|
||||
ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN,
|
||||
ASSET_226_ANIM_BAWL_UNKNOWN,
|
||||
ASSET_227_ANIM_BAWL_UNKNOWN,
|
||||
ASSET_228_ANIM_BANJO_SLED = 0x228,
|
||||
ASSET_229_ANIM_WHIPCRACK_ATTACK,
|
||||
ASSET_22A_ANIM_WHIPCRACK_IDLE,
|
||||
@ -3504,14 +3531,14 @@ enum asset_e
|
||||
// 4ea FP Finish Banner
|
||||
// 4eb FP Start Banner
|
||||
// 4ec FP Race Rostrum
|
||||
MODEL_TOPPER = 0x4ed,
|
||||
MODEL_COLLYWOBBLE = 0x4ee,
|
||||
MODEL_BAWL = 0x4ef,
|
||||
// 4f0 Colliwobble Large Stem (Upon Death)
|
||||
// 4f1 Colliwobble Small Stem (Upon Death)
|
||||
// 4f2 Colliwobble Large Leaf (Upon Death)
|
||||
// 4f3 Colliwobble Small Leaf (Upon Death)
|
||||
// 4f4 Colliwobble Stem (Upon Death)
|
||||
ASSET_4ED_MODEL_TOPPER = 0x4ed,
|
||||
ASSET_4EE_MODEL_COLLYWOBBLE,
|
||||
ASSET_4EF_MODEL_BAWL,
|
||||
ASSET_4F0_MODEL_UNKNOWN, // 4f0 Colliwobble Large Stem (Upon Death)
|
||||
ASSET_4F1_MODEL_UNKNOWN, // 4f1 Colliwobble Small Stem (Upon Death)
|
||||
ASSET_4F2_MODEL_UNKNOWN, // 4f2 Colliwobble Large Leaf (Upon Death)
|
||||
ASSET_4F3_MODEL_UNKNOWN, // 4f3 Colliwobble Small Leaf (Upon Death)
|
||||
ASSET_4F4_MODEL_UNKNOWN, // 4f4 Colliwobble Stem (Upon Death)
|
||||
// 4f5 CCW Spring Switch
|
||||
// 4f6 CCW Summer Switch
|
||||
// 4f7 CCW Autumn Switch
|
||||
@ -4386,8 +4413,8 @@ enum asset_e
|
||||
ASSET_DF6_TEXT_BOTTLES_HIGH_JUMP_LEARN,
|
||||
ASSET_DF7_TEXT_BOTTLES_FEATHERY_FLAP_LEARN,
|
||||
ASSET_DF8_TEXT_BOTTLES_FLAP_FLIP_LEARN,
|
||||
|
||||
ASSET_DFA_TEXT_BOTTLES_JUMP_REFRESHER = 0xDFA,
|
||||
ASSET_DF9_TEXT_BOTTLES_UNKNOWN,
|
||||
ASSET_DFA_TEXT_BOTTLES_JUMP_REFRESHER,
|
||||
ASSET_DFB_TEXT_BOTTLES_DIVE_LEARN,
|
||||
ASSET_DFC_TEXT_UNKNOWN,
|
||||
ASSET_DFD_TEXT_BOTTLES_SWIM_LEARN,
|
||||
@ -4399,9 +4426,9 @@ enum asset_e
|
||||
ASSET_E03_TEXT_BOTTLES_CLIMB_REFRESHER,
|
||||
ASSET_E04_TEXT_BOTTLES_BEAK_BARGE_LEARN,
|
||||
ASSET_E05_TEXT_UNKNOWN,
|
||||
ASSET_E06_TEXT_BOTTLES_BEAK_BARGE_REFRESHER = 0xE06,
|
||||
|
||||
ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL = 0xE08,
|
||||
ASSET_E06_TEXT_BOTTLES_BEAK_BARGE_REFRESHER,
|
||||
ASSET_E07_TEXT_BOTTLES_UNKNOWN,
|
||||
ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL,
|
||||
ASSET_E09_TEXT_BOTTLES_SKIPPED_TUTORIAL,
|
||||
ASSET_E0A_TEXT_BOTTLES_REFUSE_HELP_1,
|
||||
ASSET_E0B_TEXT_BOTTLES_REFUSE_HELP_2,
|
||||
@ -4419,8 +4446,10 @@ enum asset_e
|
||||
ASSET_E17_TEXT_UNKNOWN,
|
||||
ASSET_E18_TEXT_UNKNOWN,
|
||||
ASSET_E19_TEXT_UNKNOWN,
|
||||
|
||||
ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT = 0xE1D,
|
||||
ASSET_E1A_TEXT_BOTTLES_UNKNOWN,
|
||||
ASSET_E1B_TEXT_BOTTLES_UNKNOWN,
|
||||
ASSET_E1C_TEXT_BOTTLES_UNKNOWN,
|
||||
ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT,
|
||||
|
||||
ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER = VER_SELECT(0xE1F, 0xa61, 0, 0),
|
||||
ASSET_E20_DIALOG_BOTTLES_BONUS_NOT_READY,
|
||||
@ -4431,7 +4460,7 @@ enum asset_e
|
||||
ASSET_E35_DIALOG_BOTTLES_BONUS_REMINDER = VER_SELECT(0xE35, 0xa77, 0, 0),
|
||||
|
||||
ASSET_E37_TEXT_BOTTLES_STOP_WASTING_TIME_AFTER_FURNACE_FUN = 0xE37, // Talk to bottles after beating furnace fun
|
||||
ASSET_E38_TEXT_UNKNOWN,
|
||||
ASSET_E38_DIALOG_CHEATING_ERASE_SAVE_CONFIRMATION,
|
||||
|
||||
ASSET_E57_DIALOG_FIRST_JIGGY = VER_SELECT(0xF57, 0xabd, 0, 0),
|
||||
|
||||
@ -4450,8 +4479,8 @@ enum asset_e
|
||||
|
||||
ASSET_FAD_TEXT_UNKNOWN = 0xfad,
|
||||
|
||||
ASSET_FBE_TEXT_UNKNOWN = 0xfbe,
|
||||
ASSET_FBF_TEXT_UNKNOWN,
|
||||
ASSET_FBE_DIALOG_CHEATING_ERASE_SAVE_WARNING = 0xfbe,
|
||||
ASSET_FBF_DIALOG_ERASED_SAVE,
|
||||
|
||||
ASSET_10A1_DIALOG_BRENTILDA_MEET = 0x10A1,
|
||||
ASSET_10A2_TEXT_UNKNOWN,
|
||||
@ -4500,6 +4529,210 @@ enum asset_e
|
||||
ASSET_1157_TEXT_FINALBOSS_PHASE_5_OPTION_4,
|
||||
ASSET_1158_TEXT_FINALBOSS_PHASE_5_OPTION_5,
|
||||
|
||||
ASSET_1213_FF_QUIZ_QUESTION = 0x1213,
|
||||
ASSET_1214_FF_QUIZ_QUESTION,
|
||||
ASSET_1215_FF_QUIZ_QUESTION,
|
||||
ASSET_1216_FF_QUIZ_QUESTION,
|
||||
ASSET_1217_FF_QUIZ_QUESTION,
|
||||
ASSET_1218_FF_QUIZ_QUESTION,
|
||||
ASSET_1219_FF_QUIZ_QUESTION,
|
||||
ASSET_121A_FF_QUIZ_QUESTION,
|
||||
ASSET_121B_FF_QUIZ_QUESTION,
|
||||
ASSET_121C_FF_QUIZ_QUESTION,
|
||||
ASSET_121D_FF_QUIZ_QUESTION,
|
||||
ASSET_121E_FF_QUIZ_QUESTION,
|
||||
ASSET_121F_FF_QUIZ_QUESTION,
|
||||
ASSET_1220_FF_QUIZ_QUESTION,
|
||||
ASSET_1221_FF_QUIZ_QUESTION,
|
||||
ASSET_1222_FF_QUIZ_QUESTION,
|
||||
ASSET_1223_FF_QUIZ_QUESTION,
|
||||
ASSET_1224_FF_QUIZ_QUESTION,
|
||||
ASSET_1225_FF_QUIZ_QUESTION,
|
||||
ASSET_1226_FF_QUIZ_QUESTION,
|
||||
ASSET_1227_FF_QUIZ_QUESTION,
|
||||
ASSET_1228_FF_QUIZ_QUESTION,
|
||||
ASSET_1229_FF_QUIZ_QUESTION,
|
||||
ASSET_122A_FF_QUIZ_QUESTION,
|
||||
ASSET_122B_FF_QUIZ_QUESTION,
|
||||
ASSET_122C_FF_QUIZ_QUESTION,
|
||||
ASSET_122D_FF_QUIZ_QUESTION,
|
||||
ASSET_122E_FF_QUIZ_QUESTION,
|
||||
ASSET_122F_FF_QUIZ_QUESTION,
|
||||
ASSET_1230_FF_QUIZ_QUESTION,
|
||||
ASSET_1231_FF_QUIZ_QUESTION,
|
||||
ASSET_1232_FF_QUIZ_QUESTION,
|
||||
ASSET_1233_FF_QUIZ_QUESTION,
|
||||
ASSET_1234_FF_QUIZ_QUESTION,
|
||||
ASSET_1235_FF_QUIZ_QUESTION,
|
||||
ASSET_1236_FF_QUIZ_QUESTION,
|
||||
ASSET_1237_FF_QUIZ_QUESTION,
|
||||
ASSET_1238_FF_QUIZ_QUESTION,
|
||||
ASSET_1239_FF_QUIZ_QUESTION,
|
||||
ASSET_123A_FF_QUIZ_QUESTION,
|
||||
ASSET_123B_FF_QUIZ_QUESTION,
|
||||
ASSET_123C_FF_QUIZ_QUESTION,
|
||||
ASSET_123D_FF_QUIZ_QUESTION,
|
||||
ASSET_123E_FF_QUIZ_QUESTION,
|
||||
ASSET_123F_FF_QUIZ_QUESTION,
|
||||
ASSET_1240_FF_QUIZ_QUESTION,
|
||||
ASSET_1241_FF_QUIZ_QUESTION,
|
||||
ASSET_1242_FF_QUIZ_QUESTION,
|
||||
ASSET_1243_FF_QUIZ_QUESTION,
|
||||
ASSET_1244_FF_QUIZ_QUESTION,
|
||||
ASSET_1245_FF_QUIZ_QUESTION,
|
||||
ASSET_1246_FF_QUIZ_QUESTION,
|
||||
ASSET_1247_FF_QUIZ_QUESTION,
|
||||
ASSET_1248_FF_QUIZ_QUESTION,
|
||||
ASSET_1249_FF_QUIZ_QUESTION,
|
||||
ASSET_124A_FF_QUIZ_QUESTION,
|
||||
ASSET_124B_FF_QUIZ_QUESTION,
|
||||
ASSET_124C_FF_QUIZ_QUESTION,
|
||||
ASSET_124D_FF_QUIZ_QUESTION,
|
||||
ASSET_124E_FF_QUIZ_QUESTION,
|
||||
ASSET_124F_FF_QUIZ_QUESTION,
|
||||
ASSET_1250_FF_QUIZ_QUESTION,
|
||||
ASSET_1251_FF_QUIZ_QUESTION,
|
||||
ASSET_1252_FF_QUIZ_QUESTION,
|
||||
ASSET_1253_FF_QUIZ_QUESTION,
|
||||
ASSET_1254_FF_QUIZ_QUESTION,
|
||||
ASSET_1255_FF_QUIZ_QUESTION,
|
||||
ASSET_1256_FF_QUIZ_QUESTION,
|
||||
ASSET_1257_FF_QUIZ_QUESTION,
|
||||
ASSET_1258_FF_QUIZ_QUESTION,
|
||||
ASSET_1259_FF_QUIZ_QUESTION,
|
||||
ASSET_125A_FF_QUIZ_QUESTION,
|
||||
ASSET_125B_FF_QUIZ_QUESTION,
|
||||
ASSET_125C_FF_QUIZ_QUESTION,
|
||||
ASSET_125D_FF_QUIZ_QUESTION,
|
||||
ASSET_125E_FF_QUIZ_QUESTION,
|
||||
ASSET_125F_FF_QUIZ_QUESTION,
|
||||
ASSET_1260_FF_QUIZ_QUESTION,
|
||||
ASSET_1261_FF_QUIZ_QUESTION,
|
||||
ASSET_1262_FF_QUIZ_QUESTION,
|
||||
ASSET_1263_FF_QUIZ_QUESTION,
|
||||
ASSET_1264_FF_QUIZ_QUESTION,
|
||||
ASSET_1265_FF_QUIZ_QUESTION,
|
||||
ASSET_1266_FF_QUIZ_QUESTION,
|
||||
ASSET_1267_FF_QUIZ_QUESTION,
|
||||
ASSET_1268_FF_QUIZ_QUESTION,
|
||||
ASSET_1269_FF_QUIZ_QUESTION,
|
||||
ASSET_126A_FF_QUIZ_QUESTION,
|
||||
ASSET_126B_FF_QUIZ_QUESTION,
|
||||
ASSET_126C_FF_QUIZ_QUESTION,
|
||||
ASSET_126D_FF_QUIZ_QUESTION,
|
||||
ASSET_126E_FF_QUIZ_QUESTION,
|
||||
ASSET_126F_FF_QUIZ_QUESTION,
|
||||
ASSET_1270_FF_QUIZ_QUESTION,
|
||||
ASSET_1271_FF_QUIZ_QUESTION,
|
||||
ASSET_1272_FF_QUIZ_QUESTION,
|
||||
ASSET_1273_FF_QUIZ_QUESTION,
|
||||
ASSET_1274_FF_QUIZ_QUESTION,
|
||||
ASSET_1275_FF_QUIZ_QUESTION,
|
||||
ASSET_1276_FF_QUIZ_QUESTION,
|
||||
|
||||
ASSET_12DB_FF_PICTURE_QUESTION = 0x12DB,
|
||||
ASSET_12DC_FF_PICTURE_QUESTION,
|
||||
ASSET_12DD_FF_PICTURE_QUESTION,
|
||||
ASSET_12DE_FF_PICTURE_QUESTION,
|
||||
ASSET_12DF_FF_PICTURE_QUESTION,
|
||||
ASSET_12E0_FF_PICTURE_QUESTION,
|
||||
ASSET_12E1_FF_PICTURE_QUESTION,
|
||||
ASSET_12E2_FF_PICTURE_QUESTION,
|
||||
ASSET_12E3_FF_PICTURE_QUESTION,
|
||||
ASSET_12E4_FF_PICTURE_QUESTION,
|
||||
ASSET_12E5_FF_PICTURE_QUESTION,
|
||||
ASSET_12E6_FF_PICTURE_QUESTION,
|
||||
ASSET_12E7_FF_PICTURE_QUESTION,
|
||||
ASSET_12E8_FF_PICTURE_QUESTION,
|
||||
ASSET_12E9_FF_PICTURE_QUESTION,
|
||||
ASSET_12EA_FF_PICTURE_QUESTION,
|
||||
ASSET_12EB_FF_PICTURE_QUESTION,
|
||||
ASSET_12EC_FF_PICTURE_QUESTION,
|
||||
ASSET_12ED_FF_PICTURE_QUESTION,
|
||||
|
||||
ASSET_13A3_FF_SOUND_QUESTION = 0x13A3,
|
||||
ASSET_13A4_FF_SOUND_QUESTION,
|
||||
ASSET_13A5_FF_SOUND_QUESTION,
|
||||
ASSET_13A6_FF_SOUND_QUESTION,
|
||||
ASSET_13A7_FF_SOUND_QUESTION,
|
||||
ASSET_13A8_FF_SOUND_QUESTION,
|
||||
ASSET_13A9_FF_SOUND_QUESTION,
|
||||
ASSET_13AA_FF_SOUND_QUESTION,
|
||||
ASSET_13AB_FF_SOUND_QUESTION,
|
||||
ASSET_13AC_FF_SOUND_QUESTION,
|
||||
ASSET_13AD_FF_SOUND_QUESTION,
|
||||
ASSET_13AE_FF_SOUND_QUESTION,
|
||||
ASSET_13AF_FF_SOUND_QUESTION,
|
||||
ASSET_13B0_FF_SOUND_QUESTION,
|
||||
ASSET_13B1_FF_SOUND_QUESTION,
|
||||
ASSET_13B2_FF_SOUND_QUESTION,
|
||||
ASSET_13B3_FF_SOUND_QUESTION,
|
||||
ASSET_13B4_FF_SOUND_QUESTION,
|
||||
ASSET_13B5_FF_SOUND_QUESTION,
|
||||
ASSET_13B6_FF_SOUND_QUESTION,
|
||||
ASSET_13B7_FF_SOUND_QUESTION,
|
||||
ASSET_13B8_FF_SOUND_QUESTION,
|
||||
ASSET_13B9_FF_SOUND_QUESTION,
|
||||
ASSET_13BA_FF_SOUND_QUESTION,
|
||||
ASSET_13BB_FF_SOUND_QUESTION,
|
||||
ASSET_13BC_FF_SOUND_QUESTION,
|
||||
ASSET_13BD_FF_SOUND_QUESTION,
|
||||
ASSET_13BE_FF_SOUND_QUESTION,
|
||||
ASSET_13BF_FF_SOUND_QUESTION,
|
||||
ASSET_13C0_FF_SOUND_QUESTION,
|
||||
ASSET_13C1_FF_SOUND_QUESTION,
|
||||
ASSET_13C2_FF_SOUND_QUESTION,
|
||||
ASSET_13C3_FF_SOUND_QUESTION,
|
||||
ASSET_13C4_FF_SOUND_QUESTION,
|
||||
ASSET_13C5_FF_SOUND_QUESTION,
|
||||
ASSET_13C6_FF_SOUND_QUESTION,
|
||||
ASSET_13C7_FF_SOUND_QUESTION,
|
||||
ASSET_13C8_FF_SOUND_QUESTION,
|
||||
ASSET_13C9_FF_SOUND_QUESTION,
|
||||
ASSET_13CA_FF_SOUND_QUESTION,
|
||||
ASSET_13CB_FF_SOUND_QUESTION,
|
||||
ASSET_13CC_FF_SOUND_QUESTION,
|
||||
ASSET_13CD_FF_SOUND_QUESTION,
|
||||
ASSET_13CE_FF_SOUND_QUESTION,
|
||||
ASSET_13CF_FF_SOUND_QUESTION,
|
||||
ASSET_13D0_FF_SOUND_QUESTION,
|
||||
ASSET_13D1_FF_SOUND_QUESTION,
|
||||
ASSET_13D2_FF_SOUND_QUESTION,
|
||||
ASSET_13D3_FF_SOUND_QUESTION,
|
||||
ASSET_13D4_FF_SOUND_QUESTION,
|
||||
ASSET_13D5_FF_SOUND_QUESTION,
|
||||
|
||||
ASSET_1407_FF_GRUNTY_QUESTION = 0x1407,
|
||||
ASSET_1408_FF_GRUNTY_QUESTION,
|
||||
ASSET_1409_FF_GRUNTY_QUESTION,
|
||||
ASSET_140A_FF_GRUNTY_QUESTION,
|
||||
ASSET_140B_FF_GRUNTY_QUESTION,
|
||||
ASSET_140C_FF_GRUNTY_QUESTION,
|
||||
ASSET_140D_FF_GRUNTY_QUESTION,
|
||||
ASSET_140E_FF_GRUNTY_QUESTION,
|
||||
ASSET_140F_FF_GRUNTY_QUESTION,
|
||||
ASSET_1410_FF_GRUNTY_QUESTION,
|
||||
ASSET_1411_FF_GRUNTY_QUESTION,
|
||||
ASSET_1412_FF_GRUNTY_QUESTION,
|
||||
ASSET_1413_FF_GRUNTY_QUESTION,
|
||||
ASSET_1414_FF_GRUNTY_QUESTION,
|
||||
ASSET_1415_FF_GRUNTY_QUESTION,
|
||||
ASSET_1416_FF_GRUNTY_QUESTION,
|
||||
ASSET_1417_FF_GRUNTY_QUESTION,
|
||||
ASSET_1418_FF_GRUNTY_QUESTION,
|
||||
ASSET_1419_FF_GRUNTY_QUESTION,
|
||||
ASSET_141A_FF_GRUNTY_QUESTION,
|
||||
ASSET_141B_FF_GRUNTY_QUESTION,
|
||||
ASSET_141C_FF_GRUNTY_QUESTION,
|
||||
ASSET_141D_FF_GRUNTY_QUESTION,
|
||||
ASSET_141E_FF_GRUNTY_QUESTION,
|
||||
ASSET_141F_FF_GRUNTY_QUESTION,
|
||||
ASSET_1420_FF_GRUNTY_QUESTION,
|
||||
ASSET_1421_FF_GRUNTY_QUESTION,
|
||||
ASSET_1422_FF_GRUNTY_QUESTION,
|
||||
ASSET_1423_FF_GRUNTY_QUESTION,
|
||||
ASSET_1424_FF_GRUNTY_QUESTION,
|
||||
|
||||
ASSET_146B_MODEL_TTC_TREASURE_TROVE_COVE_OPA = 0x146B,
|
||||
ASSET_146C_MODEL_TTC_TREASURE_TROVE_COVE_XLU,
|
||||
ASSET_146D_MODEL_TTC_NIPPERS_SHELL_OPA,
|
||||
@ -4855,13 +5088,15 @@ enum marker_e{
|
||||
|
||||
MARKER_124_BOGGY_1 = 0x124,
|
||||
|
||||
MARKER_126_UNKNOWN = 0x126,
|
||||
MARKER_127_BAT = 0x127,
|
||||
MARKER_128_COLLYWOBBLE_A,
|
||||
MARKER_129_BAWL_A,
|
||||
MARKER_12A_TOPPER_A,
|
||||
MARKER_12B_ATTACK_TUTORIAL,
|
||||
|
||||
MARKER_135_QUARRIE = 0x135,
|
||||
MARKER_134_UNKNOWN = 0x134,
|
||||
MARKER_135_QUARRIE,
|
||||
|
||||
MARKER_161_GV_WITCH_SWITCH = 0x161,
|
||||
MARKER_162_BGS_WITCH_SWITCH,
|
||||
@ -4937,6 +5172,8 @@ enum marker_e{
|
||||
MARKER_1E9_MUMBO_COST_SIGN,
|
||||
MARKER_1EA_GRUNTLING_RED,
|
||||
|
||||
MARKER_1ED_JUMP_TUTORIAL = 0x1ED,
|
||||
|
||||
MARKER_1F1_GRUNTLING_BLACK = 0x1F1,
|
||||
|
||||
MARKER_1F4_TOOTS = 0x1F4,
|
||||
@ -5135,6 +5372,11 @@ enum marker_collision_func_type_e {
|
||||
MARKER_COLLISION_FUNC_2_DIE
|
||||
};
|
||||
|
||||
enum vegetable_e {
|
||||
VEGETABLE_1_TOPPER = 1,
|
||||
VEGETABLE_2_BAWL,
|
||||
VEGETABLE_3_COLLY_WOBBLE
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -508,7 +508,7 @@ f32 climbGetBottomY(void);
|
||||
f32 climbGetTopY(void);
|
||||
void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]);
|
||||
|
||||
void pfsManager_getControllerFaceButtonState(s32, s32 [6]);
|
||||
void controller_copyFaceButtons(s32, s32 [6]);
|
||||
|
||||
void __spawnQueue_add_1(GenFunction_1, s32);
|
||||
#define SPAWNQUEUE_ADD_1(method, arg0) __spawnQueue_add_1((GenFunction_1) (method), reinterpret_cast(s32, (arg0)))
|
||||
|
@ -146,7 +146,7 @@ typedef struct jinjo_s{
|
||||
}ActorLocal_Jinjo;
|
||||
|
||||
typedef struct ch_sm_4070{
|
||||
s32 unk0;
|
||||
s32 dialog_id;
|
||||
}ActorLocal_SM_4070;
|
||||
|
||||
typedef struct actor_s{
|
||||
|
@ -1,7 +1,7 @@
|
||||
sm_func_80386810 = 0x80386810;
|
||||
mm_func_803888B0 = 0x803888B0;
|
||||
TTC_resetSpawnableActors = 0x80388AC0;
|
||||
ttc_func_8038BF8C = 0x8038BF8C;
|
||||
code26D0_resetSpawnableActorsForTTC = 0x80388AC0;
|
||||
code_3E30_isSecretCheatCodeRelatedValueEqualToScrambledAddressValue = 0x8038BF8C;
|
||||
cc_func_803870E0 = 0x803870E0;
|
||||
cc_func_80387DA0 = 0x80387DA0;
|
||||
bgs_func_803885DC = 0x803885DC;
|
||||
|
@ -658,7 +658,7 @@ void chvilegame_update(Actor *this) {
|
||||
}
|
||||
if (this->state == 5) {
|
||||
if (local->unkC == 7) {
|
||||
pfsManager_getControllerFaceButtonState(0, sp30);
|
||||
controller_copyFaceButtons(0, sp30);
|
||||
if ((sp30[FACE_BUTTON(BUTTON_B)] > 0) && func_8038C2A8(local->vile_marker)) {
|
||||
func_8038A068(this, 0xA);
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ void CC_func_80388F4C(void){
|
||||
if(D_80389FA0.unk21 == 3){
|
||||
func_8034A174(D_80389FA0.unk34, 6, sp48);
|
||||
if(ml_distance_vec3f(sp48, sp6C) <= 130.0f && sp6C[1] - sp48[1] < 50.0f){
|
||||
func_8031D04C(0x21, 1);
|
||||
func_8031D04C(MAP_21_CC_WITCH_SWITCH_ROOM, 1);
|
||||
}
|
||||
}//L80389260
|
||||
|
||||
|
@ -137,7 +137,7 @@ void func_803870F8(Actor *this){
|
||||
sp3C[1] = this->position_y + 100;
|
||||
sp3C[2] = this->position_z;
|
||||
if(ml_distance_vec3f(&sp3C, &sp70) < 120.0f){
|
||||
func_8031D04C(0x22, (local->unk0 == 1)? 7 : 6);
|
||||
func_8031D04C(MAP_22_CC_INSIDE_CLANKER, (local->unk0 == 1)? 7 : 6);
|
||||
}
|
||||
}//L80387500
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ void func_803896FC(Actor *this){
|
||||
|
||||
sp58 = func_8038BE20(this->position);
|
||||
sp54 = time_getDelta();
|
||||
pfsManager_getControllerFaceButtonState(0, sp3C);
|
||||
controller_copyFaceButtons(0, sp3C);
|
||||
|
||||
if(!this->volatile_initialized){
|
||||
this->volatile_initialized = TRUE;
|
||||
|
@ -2,219 +2,249 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* chAttackTutorial - controls bottle teaching moves in spiral*/
|
||||
|
||||
//external
|
||||
/* extern functions */
|
||||
void timed_exitStaticCamera(f32);
|
||||
void func_8028F918(s32);
|
||||
|
||||
//public
|
||||
void func_80387764(ActorMarker *);
|
||||
void chAttackTutorial_setState(Actor * this, s32 arg1);
|
||||
/* public functions */
|
||||
void chAttackTutorial_talk(ActorMarker *);
|
||||
void chAttackTutorial_setState(Actor *this, s32 state);
|
||||
void chAttackTutorial_update(Actor *);
|
||||
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_8038AC20 = { MARKER_12B_ATTACK_TUTORIAL, ACTOR_167_ATTACK_TUTORIAL, 0,
|
||||
enum chAttackTutorial_state_e {
|
||||
ATTACK_TUTORIAL_STATE_1_UNKNOWN = 1,
|
||||
ATTACK_TUTORIAL_STATE_2_UNKNOWN,
|
||||
ATTACK_TUTORIAL_STATE_3_UNKNOWN,
|
||||
ATTACK_TUTORIAL_STATE_4_UNKNOWN,
|
||||
ATTACK_TUTORIAL_STATE_5_UNKNOWN
|
||||
};
|
||||
|
||||
ActorInfo D_8038AC20 = {
|
||||
MARKER_12B_ATTACK_TUTORIAL, ACTOR_167_ATTACK_TUTORIAL, NULL,
|
||||
1, NULL,
|
||||
chAttackTutorial_update, actor_update_func_80326224, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void __chAttackTutorial_spawnEnemy(ActorMarker *marker, s32 enemy_id){
|
||||
void __chAttackTutorial_enemy(ActorMarker *marker, enum actor_e enemy_id) {
|
||||
Actor *actor = marker_getActor(marker);
|
||||
s32 pad;
|
||||
Actor *other = spawn_child_actor(enemy_id, &actor);
|
||||
Actor *enemy = spawn_child_actor(enemy_id, &actor);
|
||||
|
||||
actor->unk100 = other->marker;
|
||||
other->unk100 = actor->marker;
|
||||
if(actor->unk10_12 == 3 && actor->unk38_31 == 1){
|
||||
other->unk38_31 = 1;
|
||||
}else{//L803871D4
|
||||
other->unk38_31 = 0;
|
||||
actor->unk100 = enemy->marker;
|
||||
enemy->unk100 = actor->marker;
|
||||
|
||||
if (actor->unk10_12 == VEGETABLE_3_COLLY_WOBBLE && actor->unk38_31 == 1) {
|
||||
enemy->unk38_31 = 1;
|
||||
}
|
||||
other->unk10_12 = 1;
|
||||
if(marker);
|
||||
else {//L803871D4
|
||||
enemy->unk38_31 = 0;
|
||||
}
|
||||
|
||||
enemy->unk10_12 = VEGETABLE_1_TOPPER;
|
||||
if (marker);
|
||||
}
|
||||
|
||||
s32 SM_func_803871FC(Actor *this, s32 arg1){
|
||||
volatile s32 sp1C;
|
||||
s32 tmp_v0;
|
||||
|
||||
sp1C = (arg1 == 1)? ACTOR_166_TOPPER_A : (tmp_v0 = (arg1 == 2)? ACTOR_165_BAWL_A : ACTOR_164_COLLYWOBBLE_A);
|
||||
__spawnQueue_add_2(__chAttackTutorial_spawnEnemy, this->marker, sp1C);
|
||||
|
||||
s32 __chAttackTutorial_spawnEnemy(Actor *this, enum vegetable_e vegetable_id) {
|
||||
volatile enum actor_e enemy_id;
|
||||
|
||||
enemy_id = vegetable_id == VEGETABLE_1_TOPPER ? ACTOR_166_TOPPER_A :
|
||||
vegetable_id == VEGETABLE_2_BAWL ? ACTOR_165_BAWL_A : ACTOR_164_COLLYWOBBLE_A;
|
||||
|
||||
__spawnQueue_add_2(__chAttackTutorial_enemy, this->marker, enemy_id);
|
||||
}
|
||||
|
||||
void func_80387258(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
chAttackTutorial_setState(marker_getActor(marker), 2);
|
||||
void __chAttackTutorial_learnedTextActions(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
|
||||
chAttackTutorial_setState(marker_getActor(marker), ATTACK_TUTORIAL_STATE_2_UNKNOWN);
|
||||
}
|
||||
|
||||
void func_80387288(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
void __chAttackTutorial_learnedTextCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
|
||||
Actor *actor = marker_getActor(marker);
|
||||
func_8028F918(0);
|
||||
switch(text_id){
|
||||
case 0xe15://L803872C8
|
||||
|
||||
switch (text_id) {
|
||||
case ASSET_E15_TEXT_UNKNOWN://L803872C8
|
||||
ability_unlock(ABILITY_C_ROLL);
|
||||
chAttackTutorial_setState(actor, 2);
|
||||
chAttackTutorial_setState(actor, ATTACK_TUTORIAL_STATE_2_UNKNOWN);
|
||||
break;
|
||||
case 0xe17://L803872E4
|
||||
|
||||
case ASSET_E17_TEXT_UNKNOWN://L803872E4
|
||||
ability_unlock(ABILITY_B_RATATAT_RAP);
|
||||
chAttackTutorial_setState(actor, 2);
|
||||
chAttackTutorial_setState(actor, ATTACK_TUTORIAL_STATE_2_UNKNOWN);
|
||||
break;
|
||||
}//L803872FC
|
||||
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}
|
||||
|
||||
void chAttackTutorial_setState(Actor * this, s32 arg1){
|
||||
switch (arg1)
|
||||
{
|
||||
case 5:
|
||||
if(this->unk10_12 == 0){
|
||||
ability_unlock(ABILITY_4_CLAW_SWIPE);
|
||||
gcdialog_showText(ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN, 0xE, this->unk1C, this->marker, func_80387288, func_80387258);
|
||||
}
|
||||
else{
|
||||
gcdialog_showText((this->unk10_12 == 1) ? ASSET_E15_TEXT_UNKNOWN : ASSET_E17_TEXT_UNKNOWN, 0xE, this->unk1C, this->marker, func_80387288, NULL);
|
||||
}
|
||||
break;
|
||||
case 2://L803873E0
|
||||
|
||||
this->unk38_31 = 0;
|
||||
SM_func_803871FC(this, ++this->unk10_12);
|
||||
break;
|
||||
case 3://L8038742C
|
||||
mapSpecificFlags_set(5,1);
|
||||
mapSpecificFlags_set(0xC, 1);
|
||||
marker_despawn(this->marker);
|
||||
break;
|
||||
case 4://L80387454
|
||||
mapSpecificFlags_set(0xC, 1);
|
||||
if(!honeycombscore_get(HONEYCOMB_17_SM_COLIWOBBLE)){
|
||||
this->unk10_12 = 3;
|
||||
this->unk38_31 = 1;
|
||||
SM_func_803871FC(this, this->unk10_12);
|
||||
}
|
||||
break;
|
||||
void chAttackTutorial_setState(Actor *this, s32 state) {
|
||||
switch (state) {
|
||||
case ATTACK_TUTORIAL_STATE_5_UNKNOWN:
|
||||
if (this->unk10_12 == NULL) {
|
||||
ability_unlock(ABILITY_4_CLAW_SWIPE);
|
||||
gcdialog_showText(ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN, 0xE, this->unk1C, this->marker, __chAttackTutorial_learnedTextCallback, __chAttackTutorial_learnedTextActions);
|
||||
}
|
||||
else {
|
||||
gcdialog_showText(this->unk10_12 == VEGETABLE_1_TOPPER ? ASSET_E15_TEXT_UNKNOWN : ASSET_E17_TEXT_UNKNOWN, 0xE, this->unk1C, this->marker, __chAttackTutorial_learnedTextCallback, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case ATTACK_TUTORIAL_STATE_2_UNKNOWN://L803873E0
|
||||
this->unk38_31 = 0;
|
||||
__chAttackTutorial_spawnEnemy(this, ++this->unk10_12);
|
||||
break;
|
||||
|
||||
case ATTACK_TUTORIAL_STATE_3_UNKNOWN://L8038742C
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_5, TRUE);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_C, TRUE);
|
||||
marker_despawn(this->marker);
|
||||
break;
|
||||
|
||||
case ATTACK_TUTORIAL_STATE_4_UNKNOWN://L80387454
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_C, TRUE);
|
||||
|
||||
if (!honeycombscore_get(HONEYCOMB_17_SM_COLIWOBBLE)) {
|
||||
this->unk10_12 = VEGETABLE_3_COLLY_WOBBLE;
|
||||
this->unk38_31 = 1;
|
||||
__chAttackTutorial_spawnEnemy(this, this->unk10_12);
|
||||
}
|
||||
break;
|
||||
}//L803874A8
|
||||
subaddie_set_state(this, arg1);
|
||||
|
||||
subaddie_set_state(this, state);
|
||||
}
|
||||
|
||||
int func_803874C4(void){
|
||||
return ability_isUnlocked(ABILITY_4_CLAW_SWIPE)
|
||||
&& ability_isUnlocked(ABILITY_C_ROLL)
|
||||
&& ability_isUnlocked(ABILITY_B_RATATAT_RAP);
|
||||
int __chAttackTutorial_isEveryAbilitiesUnlocked(void) {
|
||||
return ability_isUnlocked(ABILITY_4_CLAW_SWIPE) &&
|
||||
ability_isUnlocked(ABILITY_C_ROLL) &&
|
||||
ability_isUnlocked(ABILITY_B_RATATAT_RAP);
|
||||
}
|
||||
|
||||
void chAttackTutorial_update(Actor *this){
|
||||
f32 sp2C;
|
||||
Actor *bottles;
|
||||
|
||||
if(!this->initialized){
|
||||
//find closest tutorial bottles
|
||||
bottles = actorArray_findClosestActorFromActorId(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp2C);
|
||||
if(bottles != NULL){
|
||||
this->unk1C_x = bottles->position_x;
|
||||
this->unk1C_y = bottles->position_y;
|
||||
this->unk1C_z = bottles->position_z;
|
||||
}else{
|
||||
{this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;}
|
||||
void chAttackTutorial_update(Actor *this) {
|
||||
f32 distance_to_bottles;
|
||||
Actor *bottles_ptr;
|
||||
|
||||
if (!this->initialized) {
|
||||
bottles_ptr = actorArray_findClosestActorFromActorId(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &distance_to_bottles);
|
||||
|
||||
if (bottles_ptr != NULL) {
|
||||
this->unk1C_x = bottles_ptr->position_x;
|
||||
this->unk1C_y = bottles_ptr->position_y;
|
||||
this->unk1C_z = bottles_ptr->position_z;
|
||||
}
|
||||
this->unk10_12 = (ability_isUnlocked(ABILITY_C_ROLL))? 2 : (ability_isUnlocked(ABILITY_4_CLAW_SWIPE)? 1:0);
|
||||
else {
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
}
|
||||
|
||||
this->unk10_12 = ability_isUnlocked(ABILITY_C_ROLL) ? VEGETABLE_2_BAWL :
|
||||
ability_isUnlocked(ABILITY_4_CLAW_SWIPE) ? VEGETABLE_1_TOPPER : NULL;
|
||||
|
||||
this->initialized = TRUE;
|
||||
}
|
||||
|
||||
switch(this->state){
|
||||
case 1://L80387610
|
||||
if(mapSpecificFlags_get(4))
|
||||
chAttackTutorial_setState(this, 5);
|
||||
|
||||
if(func_803874C4() || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE))
|
||||
chAttackTutorial_setState(this, 4);
|
||||
break;
|
||||
case 2://L80387658
|
||||
if(mapSpecificFlags_get(7)){
|
||||
func_80387764(this->marker);
|
||||
mapSpecificFlags_set(7,0);
|
||||
switch (this->state) {
|
||||
case ATTACK_TUTORIAL_STATE_1_UNKNOWN://L80387610
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_4)) {
|
||||
chAttackTutorial_setState(this, ATTACK_TUTORIAL_STATE_5_UNKNOWN);
|
||||
}
|
||||
|
||||
if (__chAttackTutorial_isEveryAbilitiesUnlocked() || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) {
|
||||
chAttackTutorial_setState(this, ATTACK_TUTORIAL_STATE_4_UNKNOWN);
|
||||
}
|
||||
break;
|
||||
case 5://L80387680
|
||||
|
||||
case ATTACK_TUTORIAL_STATE_2_UNKNOWN://L80387658
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_7)) {
|
||||
chAttackTutorial_talk(this->marker);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_7, FALSE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ATTACK_TUTORIAL_STATE_5_UNKNOWN://L80387680
|
||||
break;
|
||||
}////L80387680
|
||||
}
|
||||
|
||||
void func_80387690(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
void __chAttackTutorial_attackTextCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
|
||||
Actor *actor = marker_getActor(marker);
|
||||
switch(text_id){
|
||||
case 0xDFF:
|
||||
|
||||
switch (text_id) {
|
||||
case ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN:
|
||||
func_8028F918(0);
|
||||
break;
|
||||
case 0xE14:
|
||||
case 0xE16:
|
||||
case 0xE18:
|
||||
SM_func_803871FC(actor, actor->unk10_12);
|
||||
|
||||
case ASSET_E14_TEXT_UNKNOWN:
|
||||
case ASSET_E16_TEXT_UNKNOWN:
|
||||
case ASSET_E18_TEXT_UNKNOWN:
|
||||
__chAttackTutorial_spawnEnemy(actor, actor->unk10_12);
|
||||
break;
|
||||
case 0xE15:
|
||||
|
||||
case ASSET_E15_TEXT_UNKNOWN:
|
||||
ability_unlock(ABILITY_C_ROLL);
|
||||
chAttackTutorial_setState(actor, 2);
|
||||
chAttackTutorial_setState(actor, ATTACK_TUTORIAL_STATE_2_UNKNOWN);
|
||||
break;
|
||||
case 0xE17:
|
||||
|
||||
case ASSET_E17_TEXT_UNKNOWN:
|
||||
ability_unlock(ABILITY_B_RATATAT_RAP);
|
||||
chAttackTutorial_setState(actor, 2);
|
||||
chAttackTutorial_setState(actor, ATTACK_TUTORIAL_STATE_2_UNKNOWN);
|
||||
break;
|
||||
case 0xE12:
|
||||
case 0xE19:
|
||||
chAttackTutorial_setState(actor, 3);
|
||||
|
||||
case ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES:
|
||||
case ASSET_E19_TEXT_UNKNOWN:
|
||||
chAttackTutorial_setState(actor, ATTACK_TUTORIAL_STATE_3_UNKNOWN);
|
||||
break;
|
||||
}
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}//*/
|
||||
|
||||
void func_80387764(ActorMarker * marker){
|
||||
s32 sp34;
|
||||
int temp_a2;
|
||||
s32 sp2C = 4;
|
||||
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}
|
||||
|
||||
void chAttackTutorial_talk(ActorMarker *marker) {
|
||||
s32 text_id;
|
||||
int try_count;
|
||||
s32 text_flags = 4;
|
||||
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
temp_a2 = actor->unk38_31 ? 1 : 0 ;
|
||||
if( temp_a2 ){
|
||||
sp2C = 0xE;
|
||||
try_count = BOOL(actor->unk38_31);
|
||||
|
||||
if (try_count) {
|
||||
text_flags = 0xE;
|
||||
}
|
||||
|
||||
switch (actor->unk10_12) {
|
||||
case 0x1: //L803877D8
|
||||
sp34 = temp_a2 ? ASSET_E15_TEXT_UNKNOWN : ASSET_E14_TEXT_UNKNOWN; //dialog enums
|
||||
case VEGETABLE_1_TOPPER: //L803877D8
|
||||
text_id = try_count ? ASSET_E15_TEXT_UNKNOWN : ASSET_E14_TEXT_UNKNOWN;
|
||||
break;
|
||||
|
||||
case 0x2: //L803877F4
|
||||
sp34 = temp_a2 ? ASSET_E17_TEXT_UNKNOWN : ASSET_E16_TEXT_UNKNOWN; //dialog enums
|
||||
case VEGETABLE_2_BAWL: //L803877F4
|
||||
text_id = try_count ? ASSET_E17_TEXT_UNKNOWN : ASSET_E16_TEXT_UNKNOWN;
|
||||
break;
|
||||
|
||||
case 3: //L80387810
|
||||
sp34 = temp_a2 ? ASSET_E19_TEXT_UNKNOWN : ASSET_E18_TEXT_UNKNOWN; //dialog enums
|
||||
case VEGETABLE_3_COLLY_WOBBLE: //L80387810
|
||||
text_id = try_count ? ASSET_E19_TEXT_UNKNOWN : ASSET_E18_TEXT_UNKNOWN;
|
||||
break;
|
||||
|
||||
default:
|
||||
//sp34 = actor->unk38_31;
|
||||
break;
|
||||
}//L8038782C
|
||||
|
||||
if (sp34 == ASSET_E19_TEXT_UNKNOWN) {
|
||||
if (text_id == ASSET_E19_TEXT_UNKNOWN) {
|
||||
func_8028F94C(2, actor->unk1C);
|
||||
}
|
||||
//L80387848
|
||||
if (!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities() && temp_a2) {
|
||||
mapSpecificFlags_set(3, 1);
|
||||
sp34 = ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES;
|
||||
}//L80387848
|
||||
|
||||
if (!mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && chmole_learnedAllSpiralMountainAbilities() && try_count) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED, TRUE);
|
||||
text_id = ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES;
|
||||
}//L80387898
|
||||
|
||||
if (temp_a2) {
|
||||
if (try_count) {
|
||||
timed_setStaticCameraToNode(0.0f, 6);
|
||||
}//L803878B0
|
||||
|
||||
gcdialog_showText(sp34, sp2C, actor->unk1C, actor->marker, func_80387690, NULL);
|
||||
gcdialog_showText(text_id, text_flags, actor->unk1C, actor->marker, __chAttackTutorial_attackTextCallback, NULL);
|
||||
actor->unk38_31++;
|
||||
}
|
||||
|
163
src/SM/ch/jumptutorial.c
Normal file
163
src/SM/ch/jumptutorial.c
Normal file
@ -0,0 +1,163 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
Actor *func_802D94B4(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void timed_exitStaticCamera(f32);
|
||||
|
||||
/* public functions */
|
||||
void chJumpTutorial_update(Actor *this);
|
||||
void chJumpTutorial_setState(Actor *this, s32 state);
|
||||
|
||||
/* .data */
|
||||
enum chJumpTutorial_state_e {
|
||||
JUMP_TUTORIAL_STATE_1_IDLE = 1,
|
||||
JUMP_TUTORIAL_STATE_2_TEACHING,
|
||||
JUMP_TUTORIAL_STATE_3_DISAPPEARED
|
||||
};
|
||||
|
||||
ActorInfo D_8038B0B0 = {
|
||||
MARKER_1ED_JUMP_TUTORIAL, ACTOR_3B9_JUMP_TUTORIAL, NULL,
|
||||
1, NULL,
|
||||
chJumpTutorial_update, actor_update_func_80326224, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void __chJumpTutorial_setStaticCameraToNode4(Actor *this) {
|
||||
timed_setStaticCameraToNode(0.0f, 4);
|
||||
}
|
||||
|
||||
void __chJumpTutorial_textCallback(ActorMarker *caller, enum asset_e text_id, s32 arg2) {
|
||||
Actor *actor = marker_getActor(caller);
|
||||
|
||||
if (text_id == ASSET_DF9_TEXT_BOTTLES_UNKNOWN || text_id == ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES) {
|
||||
chJumpTutorial_setState(actor, JUMP_TUTORIAL_STATE_3_DISAPPEARED);
|
||||
}
|
||||
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}
|
||||
|
||||
void chJumpTutorial_setState(Actor *this, s32 state) {
|
||||
switch (state) {
|
||||
case JUMP_TUTORIAL_STATE_2_TEACHING://L8038A50C
|
||||
this->sm_4070.dialog_id = NULL;
|
||||
player_getPosition(this->velocity);
|
||||
func_8028F918(0);
|
||||
|
||||
if (ability_isUnlocked(ABILITY_7_FEATHERY_FLAP)) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_9_ABILITY_FEATHERY_UNLOCKED, TRUE);
|
||||
}
|
||||
else if (ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)) {//L8038A540
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_8_ABILITY_HOLD_A_JUMP_HIGHER_UNLOCKED, TRUE);
|
||||
}
|
||||
else {//L8038A560
|
||||
__chJumpTutorial_setStaticCameraToNode4(this);
|
||||
ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER);
|
||||
|
||||
gcdialog_showText(ASSET_DF6_TEXT_BOTTLES_HIGH_JUMP_LEARN, 0xe, this->unk1C, this->marker, __chJumpTutorial_textCallback, NULL);
|
||||
this->sm_4070.dialog_id = ASSET_E1A_TEXT_BOTTLES_UNKNOWN;
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_8_ABILITY_HOLD_A_JUMP_HIGHER_UNLOCKED, FALSE);
|
||||
}
|
||||
break;
|
||||
|
||||
case JUMP_TUTORIAL_STATE_3_DISAPPEARED://L8038A5B0
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_5, TRUE);
|
||||
break;
|
||||
}//L8038A5BC
|
||||
|
||||
subaddie_set_state(this, state);
|
||||
}
|
||||
|
||||
void chJumpTutorial_update(Actor *this) {
|
||||
f32 plyr_pos[3];
|
||||
s32 face_buttons[6];
|
||||
f32 distance_to_bottles;
|
||||
Actor *bottles_ptr;
|
||||
s32 dialog_id;
|
||||
|
||||
if (!this->initialized) {
|
||||
bottles_ptr = actorArray_findClosestActorFromActorId(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &distance_to_bottles);
|
||||
|
||||
if (bottles_ptr) {
|
||||
this->unk1C_x = bottles_ptr->position_x;
|
||||
this->unk1C_y = bottles_ptr->position_y;
|
||||
this->unk1C_z = bottles_ptr->position_z;
|
||||
}
|
||||
else {//L8038A630
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
}//L8038A644
|
||||
|
||||
this->initialized = TRUE;
|
||||
}//L8038A650
|
||||
|
||||
controller_copyFaceButtons(0, face_buttons);
|
||||
|
||||
switch (this->state) {
|
||||
case JUMP_TUTORIAL_STATE_1_IDLE://L8038A688
|
||||
if (fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL)) {
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
else if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_E)) {
|
||||
chJumpTutorial_setState(this, JUMP_TUTORIAL_STATE_2_TEACHING);
|
||||
}
|
||||
break;
|
||||
|
||||
case JUMP_TUTORIAL_STATE_2_TEACHING://L8038A6C8
|
||||
if (!func_803114B0()) {
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_8_ABILITY_HOLD_A_JUMP_HIGHER_UNLOCKED)) {
|
||||
__chJumpTutorial_setStaticCameraToNode4(this);
|
||||
ability_unlock(ABILITY_7_FEATHERY_FLAP);
|
||||
|
||||
gcdialog_showText(ASSET_DF7_TEXT_BOTTLES_FEATHERY_FLAP_LEARN, 0xa, this->unk1C, this->marker, __chJumpTutorial_textCallback, NULL);
|
||||
this->sm_4070.dialog_id = ASSET_E1B_TEXT_BOTTLES_UNKNOWN;
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_8_ABILITY_HOLD_A_JUMP_HIGHER_UNLOCKED, FALSE);
|
||||
}//L8038A730
|
||||
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_9_ABILITY_FEATHERY_UNLOCKED)) {
|
||||
__chJumpTutorial_setStaticCameraToNode4(this);
|
||||
ability_unlock(ABILITY_8_FLAP_FLIP);
|
||||
|
||||
gcdialog_showText(ASSET_DF8_TEXT_BOTTLES_FLAP_FLIP_LEARN, 0xa, this->unk1C, this->marker, __chJumpTutorial_textCallback, NULL);
|
||||
this->sm_4070.dialog_id = ASSET_E1C_TEXT_BOTTLES_UNKNOWN;
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_9_ABILITY_FEATHERY_UNLOCKED, FALSE);
|
||||
}//L8038A794
|
||||
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_A)) {
|
||||
__chJumpTutorial_setStaticCameraToNode4(this);
|
||||
func_8028F94C(2, this->unk1C);
|
||||
|
||||
if (!mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && chmole_learnedAllSpiralMountainAbilities()) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED, TRUE);
|
||||
dialog_id = ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES;
|
||||
}
|
||||
else {
|
||||
dialog_id = ASSET_DF9_TEXT_BOTTLES_UNKNOWN;
|
||||
}
|
||||
|
||||
gcdialog_showText(dialog_id, 0xe, this->unk1C, this->marker, __chJumpTutorial_textCallback, NULL);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_A, FALSE);
|
||||
this->sm_4070.dialog_id = NULL;
|
||||
}
|
||||
}//L8038A828
|
||||
|
||||
player_getPosition(plyr_pos);
|
||||
plyr_pos[0] = this->velocity_x;
|
||||
plyr_pos[2] = this->velocity_z;
|
||||
func_8028FAB0(plyr_pos);
|
||||
|
||||
if (func_8028EFC8() && face_buttons[FACE_BUTTON(BUTTON_B)] == TRUE && func_8028F20C()) {
|
||||
if (this->sm_4070.dialog_id) {
|
||||
gcdialog_showText(dialog_id = this->sm_4070.dialog_id, 0, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case JUMP_TUTORIAL_STATE_3_DISAPPEARED://L8038A8A0
|
||||
marker_despawn(this->marker);
|
||||
break;
|
||||
}//L8038A8AC
|
||||
}
|
638
src/SM/ch/smbottles.c
Normal file
638
src/SM/ch/smbottles.c
Normal file
@ -0,0 +1,638 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
Actor *func_802D94B4(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void func_8028E668(f32 *, f32, f32, f32);
|
||||
void func_80328FB0(Actor *, f32);
|
||||
void func_8030DA44(u8);
|
||||
void timed_exitStaticCamera(f32);
|
||||
void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
|
||||
|
||||
/* typedefs and declarations */
|
||||
enum chSmBottles_state_e {
|
||||
SM_BOTTLES_STATE_1_UNKNOWN = 1,
|
||||
SM_BOTTLES_STATE_2_UNKNOWN,
|
||||
SM_BOTTLES_STATE_3_UNKNOWN,
|
||||
SM_BOTTLES_STATE_4_UNKNOWN,
|
||||
SM_BOTTLES_STATE_5_UNKNOWN
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
s16 teach_text_id;
|
||||
s16 refresher_text_id;
|
||||
s8 camera_node;
|
||||
s8 ability;
|
||||
} ChSmBottlesDialog;
|
||||
|
||||
/* public functions */
|
||||
void chSmBottles_update(Actor *this);
|
||||
void __chSmBottles_talk(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chSmBottlesAnimations[6] = {
|
||||
{NULL, 0.0f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 4.5f},
|
||||
{ASSET_13B_ANIM_BOTTLES_IDLE, 7.0f},
|
||||
{ASSET_139_ANIM_BOTTLES_EXIT, 1.7f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}
|
||||
};
|
||||
|
||||
ActorInfo chBottles = {
|
||||
MARKER_B7_TUTORIAL_BOTTLES, ACTOR_12B_TUTORIAL_BOTTLES, ASSET_387_MODEL_BOTTLES,
|
||||
1, chSmBottlesAnimations,
|
||||
chSmBottles_update, actor_update_func_80326224, func_802D94B4,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ChSmBottlesDialog chSmBottlesDialogTable[8] = {
|
||||
{ASSET_DF3_TEXT_BOTTLES_INTRODUCTION, ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL, 0x1, -1},
|
||||
{ASSET_DF4_TEXT_BOTTLES_CAMERA_CONTROL_LEARN, ASSET_DF5_TEXT_BOTTLES_CAMERA_CONTROL_REFRESHER, 0x3, ABILITY_3_CAMERA_CONTROL},
|
||||
{ASSET_DFB_TEXT_BOTTLES_DIVE_LEARN, ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER, 0x5, ABILITY_F_DIVE},
|
||||
{-1, ASSET_E00_TEXT_BOTTLES_ATTACK_REFRESHER, 0x6, ABILITY_B_RATATAT_RAP},
|
||||
{ASSET_E04_TEXT_BOTTLES_BEAK_BARGE_LEARN, ASSET_E06_TEXT_BOTTLES_BEAK_BARGE_REFRESHER, 0x8, ABILITY_0_BARGE},
|
||||
{-1, ASSET_DFA_TEXT_BOTTLES_JUMP_REFRESHER, 0x4, ABILITY_8_FLAP_FLIP},
|
||||
{ASSET_E01_TEXT_BOTTLES_CLIMB_LEARN, ASSET_E03_TEXT_BOTTLES_CLIMB_REFRESHER, 0x7, ABILITY_5_CLIMB},
|
||||
{ASSET_E10_TEXT_BOTTLES_BRIDGE_BROKEN, ASSET_E11_TEXT_BOTTLES_BRIDGE_STILL_BROKEN, 0x11, -1},
|
||||
};
|
||||
|
||||
s32 chSmBottlesDialogIndex = 0;
|
||||
|
||||
/* .code */
|
||||
|
||||
/**
|
||||
* @brief Checks if any Spiral Mountain abilities have been learned
|
||||
*/
|
||||
bool __chSmBottles_isAnySpiralMountainAbilityLearned(void) {
|
||||
return ability_isUnlocked(ABILITY_F_DIVE) ||
|
||||
ability_isUnlocked(ABILITY_4_CLAW_SWIPE) ||
|
||||
ability_isUnlocked(ABILITY_C_ROLL) ||
|
||||
ability_isUnlocked(ABILITY_B_RATATAT_RAP) ||
|
||||
ability_isUnlocked(ABILITY_0_BARGE) ||
|
||||
ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER) ||
|
||||
ability_isUnlocked(ABILITY_7_FEATHERY_FLAP) ||
|
||||
ability_isUnlocked(ABILITY_8_FLAP_FLIP) ||
|
||||
ability_isUnlocked(ABILITY_5_CLIMB);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets all Spiral Mountain abilities to used & disables the noise
|
||||
* played when the player uses an ability for the first time.
|
||||
*/
|
||||
void __chSmBottles_setHasUsedSpiralMountainAbilities(void) {
|
||||
ability_unlock(ABILITY_3_CAMERA_CONTROL);
|
||||
ability_setHasUsed(ABILITY_0_BARGE);
|
||||
ability_setHasUsed(ABILITY_1_BEAK_BOMB);
|
||||
ability_setHasUsed(ABILITY_2_BEAK_BUSTER);
|
||||
ability_setHasUsed(ABILITY_3_CAMERA_CONTROL);
|
||||
ability_setHasUsed(ABILITY_4_CLAW_SWIPE);
|
||||
ability_setHasUsed(ABILITY_5_CLIMB);
|
||||
ability_setHasUsed(ABILITY_B_RATATAT_RAP);
|
||||
ability_setHasUsed(ABILITY_C_ROLL);
|
||||
ability_setHasUsed(ABILITY_A_HOLD_A_JUMP_HIGHER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unlocks all of the Spiral Mountain moves.
|
||||
*/
|
||||
void __chSmBottles_skipIntroTutorial(void) {
|
||||
ability_unlock(ABILITY_F_DIVE);
|
||||
ability_unlock(ABILITY_4_CLAW_SWIPE);
|
||||
ability_unlock(ABILITY_C_ROLL);
|
||||
ability_unlock(ABILITY_B_RATATAT_RAP);
|
||||
ability_unlock(ABILITY_0_BARGE);
|
||||
ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER);
|
||||
ability_unlock(ABILITY_7_FEATHERY_FLAP);
|
||||
ability_unlock(ABILITY_8_FLAP_FLIP);
|
||||
ability_unlock(ABILITY_5_CLIMB);
|
||||
__chSmBottles_setHasUsedSpiralMountainAbilities();
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief If the player is talking to Intro Bottles for the first time, use the
|
||||
* camera that points to the lair. Otherwise, use the camera for the ability.
|
||||
*/
|
||||
void __chSmBottles_setStaticCameraToNode(Actor *this) {
|
||||
if (this->unkF4_8 == 1 && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES)) {
|
||||
timed_setStaticCameraToNode(0.0f, 0x12);
|
||||
}
|
||||
else { //L80388F68
|
||||
timed_setStaticCameraToNode(0.0f, chSmBottlesDialogTable[this->unkF4_8 - 1].camera_node);
|
||||
}
|
||||
}
|
||||
|
||||
void __chSmBottles_setState(Actor *this, s32 next_state) {
|
||||
Actor *other;
|
||||
ActorMarker *molehillMarker;
|
||||
|
||||
switch (this->state) {
|
||||
case SM_BOTTLES_STATE_1_UNKNOWN://L80388FE8
|
||||
this->unk138_23 = 1;
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_4_UNKNOWN://L80388FF8
|
||||
this->unk138_23 = 0;
|
||||
|
||||
case SM_BOTTLES_STATE_2_UNKNOWN://L80389004
|
||||
func_8030DA44(this->unk44_31);
|
||||
this->unk44_31 = 0;
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_5_UNKNOWN://L80389018
|
||||
this->unk138_23 = 0;
|
||||
func_8028F918(0);
|
||||
break;
|
||||
}//L8038902C
|
||||
|
||||
switch (next_state) {
|
||||
case SM_BOTTLES_STATE_4_UNKNOWN:
|
||||
other = subaddie_getLinkedActor(this);
|
||||
molehillMarker = this->unk100;
|
||||
|
||||
if (molehillMarker && other && molehillMarker->id == 0xB8) {
|
||||
subaddie_set_state_with_direction(other, 3, 0.0001f, 1);
|
||||
}
|
||||
|
||||
actor_playAnimationOnce(this);
|
||||
|
||||
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
|
||||
sfxsource_setSfxId(this->unk44_31, 0x3f9);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
|
||||
sfxsource_setSampleRate(this->unk44_31, 0x6590);
|
||||
|
||||
func_8028F918(0);
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_1_UNKNOWN:
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_5_UNKNOWN:
|
||||
__chSmBottles_setStaticCameraToNode(this);
|
||||
func_8028F94C(2, this->position);
|
||||
__chSmBottles_talk(this);
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_3_UNKNOWN:
|
||||
actor_loopAnimation(this);
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_2_UNKNOWN:
|
||||
other = subaddie_getLinkedActor(this);
|
||||
molehillMarker = this->unk100;
|
||||
|
||||
if (molehillMarker && other && molehillMarker->id == 0xB8) {
|
||||
subaddie_set_state_with_direction(other, 2, 0.0001f, 1);
|
||||
}
|
||||
|
||||
animctrl_setSmoothTransition(this->animctrl, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
|
||||
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
|
||||
sfxsource_setSfxId(this->unk44_31, 0x3f9);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
|
||||
sfxsource_setSampleRate(this->unk44_31, 0x6590);
|
||||
|
||||
__chSmBottles_setStaticCameraToNode(this);
|
||||
func_8028F94C(2, this->position);
|
||||
break;
|
||||
}
|
||||
|
||||
subaddie_set_state_with_direction(this, next_state, 0.0001f, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Performs actions depending on what move is being learned
|
||||
*
|
||||
*/
|
||||
static void __chSmBottles_textActions(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
switch (arg2) {
|
||||
case 3:
|
||||
timed_setStaticCameraToNode(0.0f, 2);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_4, TRUE);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
timed_setStaticCameraToNode(0.0f, 0x12);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
comusic_playTrack(COMUSIC_2B_DING_B);
|
||||
break;
|
||||
|
||||
case 0xff:
|
||||
__chSmBottles_setStaticCameraToNode(actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void __chSmBottles_textCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
if (!mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && chmole_learnedAllSpiralMountainAbilities()) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED, TRUE);
|
||||
gcdialog_showText(ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, __chSmBottles_textCallback, NULL);
|
||||
}//L8038933C
|
||||
else {
|
||||
if (!(text_id == ASSET_DF3_TEXT_BOTTLES_INTRODUCTION || text_id == ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER || text_id == ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT)) {
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}
|
||||
|
||||
switch (text_id) {
|
||||
case ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED:
|
||||
break;
|
||||
|
||||
case ASSET_DF3_TEXT_BOTTLES_INTRODUCTION: /* 2FB8 803893A8 3C188039 */
|
||||
gcdialog_showText(ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER, 0x8e, actor->position, actor->marker, __chSmBottles_textCallback, __chSmBottles_textActions);
|
||||
break;
|
||||
|
||||
case ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER: /* 2FEC 803893DC 9209003B */
|
||||
actor->unk38_0 = TRUE;
|
||||
break;
|
||||
|
||||
case ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT: /* 2FFC 803893EC 920B0138 */
|
||||
actor->has_met_before = FALSE;
|
||||
actor->lifetime_value = 0.0f;
|
||||
break;
|
||||
|
||||
case ASSET_DF6_TEXT_BOTTLES_HIGH_JUMP_LEARN: /* 3014 80389404 0C0A3E46 */
|
||||
case ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN: /* 3014 80389404 0C0A3E46 */
|
||||
func_8028F918(0);
|
||||
break;
|
||||
|
||||
case ASSET_E09_TEXT_BOTTLES_SKIPPED_TUTORIAL:
|
||||
case ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES:
|
||||
__chSmBottles_setState(actor, SM_BOTTLES_STATE_4_UNKNOWN);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (actor->state != SM_BOTTLES_STATE_5_UNKNOWN) {
|
||||
gcdialog_showText(ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED, 0x4, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
__chSmBottles_setState(actor, actor->state == SM_BOTTLES_STATE_5_UNKNOWN ? SM_BOTTLES_STATE_1_UNKNOWN : SM_BOTTLES_STATE_4_UNKNOWN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __chSmBottles_getRefresherDialog(Actor *this, s32 *text_id, s32 *text_flags) {
|
||||
// Selects the learn and refresh dialogs.
|
||||
// Gives the player the ability if not learned.
|
||||
if (ability_isUnlocked(chSmBottlesDialogTable[this->unkF4_8 - 1].ability)) {
|
||||
if (fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL)) {
|
||||
*text_id = chSmBottlesDialogIndex + ASSET_E0A_TEXT_BOTTLES_REFUSE_HELP_1;
|
||||
chSmBottlesDialogIndex++;
|
||||
chSmBottlesDialogIndex = MIN(chSmBottlesDialogIndex, 5);
|
||||
|
||||
if (*text_id != ASSET_E0E_TEXT_BOTTLES_REFUSE_HELP_5) {
|
||||
*text_flags |= 1;
|
||||
}
|
||||
}
|
||||
else {//L8038956C
|
||||
*text_flags |= 1;
|
||||
*text_id = chSmBottlesDialogTable[this->unkF4_8 - 1].refresher_text_id;
|
||||
|
||||
if (*text_id == ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER && !ability_hasUsed(ABILITY_3_CAMERA_CONTROL)) {
|
||||
*text_id = ASSET_DFD_TEXT_BOTTLES_SWIM_LEARN;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {//L803895C0
|
||||
*text_id = chSmBottlesDialogTable[this->unkF4_8 - 1].teach_text_id;
|
||||
ability_unlock(chSmBottlesDialogTable[this->unkF4_8 - 1].ability);
|
||||
}
|
||||
}
|
||||
|
||||
void __chSmBottles_talk(Actor *this) {
|
||||
s32 text_id;
|
||||
s32 text_flags;
|
||||
|
||||
text_flags = 0xe;
|
||||
text_id = 0;
|
||||
|
||||
switch (this->unkF4_8) {
|
||||
case 1://L8038965C
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES)) {
|
||||
text_flags |= 1;
|
||||
|
||||
if (fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL)) {
|
||||
text_id = chSmBottlesDialogIndex + ASSET_E0A_TEXT_BOTTLES_REFUSE_HELP_1;
|
||||
chSmBottlesDialogIndex++;
|
||||
chSmBottlesDialogIndex = MIN(chSmBottlesDialogIndex, 5);
|
||||
}
|
||||
else {//L803896C0
|
||||
text_id = chSmBottlesDialogTable[this->unkF4_8 - 1].refresher_text_id;
|
||||
}
|
||||
}
|
||||
else {//L803896E8
|
||||
text_id = chSmBottlesDialogTable[this->unkF4_8 - 1].teach_text_id;
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8://L80389720
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED)) {
|
||||
if (fileProgressFlag_get(FILEPROG_A6_FURNACE_FUN_COMPLETE)) {
|
||||
text_id = ASSET_E37_TEXT_BOTTLES_STOP_WASTING_TIME_AFTER_FURNACE_FUN;
|
||||
text_flags |= 1;
|
||||
}
|
||||
else if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_F)) { //L80389758
|
||||
text_id = ASSET_E0F_TEXT_BOTTLES_STOP_WASTING_TIME_BEFORE_FURNACE_FUN;
|
||||
text_flags |= 1;
|
||||
}
|
||||
else {//L80389780
|
||||
__chSmBottles_setHasUsedSpiralMountainAbilities();
|
||||
text_id = fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL) ? 0xe1e : 0xe13;
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_F, TRUE);
|
||||
} //L803897B4
|
||||
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_2, TRUE);
|
||||
}
|
||||
else {//L803897C8
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_2)) {
|
||||
text_id = chSmBottlesDialogTable[this->unkF4_8 - 1].refresher_text_id;
|
||||
text_flags |= 1;
|
||||
}
|
||||
else {
|
||||
text_id = chSmBottlesDialogTable[this->unkF4_8 - 1].teach_text_id;
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_2, TRUE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 4://L80389848
|
||||
if (!(ability_isUnlocked(ABILITY_4_CLAW_SWIPE) && ability_isUnlocked(ABILITY_C_ROLL) && ability_isUnlocked(ABILITY_B_RATATAT_RAP))) {//L803898D4
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_4, TRUE);
|
||||
}
|
||||
else {//L803898E4
|
||||
__chSmBottles_getRefresherDialog(this, &text_id, &text_flags);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6://L803898A0
|
||||
if (!(ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER) && ability_isUnlocked(ABILITY_7_FEATHERY_FLAP) && ability_isUnlocked(ABILITY_8_FLAP_FLIP))) {//L803898D4
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_E, TRUE);
|
||||
}
|
||||
else {//L803898E4
|
||||
__chSmBottles_getRefresherDialog(this, &text_id, &text_flags);
|
||||
}
|
||||
break;
|
||||
|
||||
default://L803898F8
|
||||
__chSmBottles_getRefresherDialog(this, &text_id, &text_flags);
|
||||
break;
|
||||
}//L80389904
|
||||
|
||||
if (text_id) {
|
||||
gcdialog_showText(text_id, text_flags, this->position, this->marker, __chSmBottles_textCallback, __chSmBottles_textActions);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Spawns a molehill for the actor
|
||||
*/
|
||||
void __chSmBottles_spawnMolehill(ActorMarker *marker) {
|
||||
Actor *this;
|
||||
Actor *molehill;
|
||||
s32 pad;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
molehill = spawn_child_actor(ACTOR_12C_MOLEHILL, &this);
|
||||
this->unk100 = molehill->marker;
|
||||
|
||||
if (marker);
|
||||
}
|
||||
|
||||
void __chSmBottles_free(Actor *this) {
|
||||
u8 tmp = this->unk44_31;
|
||||
|
||||
if (tmp) {
|
||||
func_8030DA44(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void chSmBottles_update(Actor *this) {
|
||||
s32 face_buttons[6];
|
||||
f32 plyr_pos[3];
|
||||
void *sp40;
|
||||
int sp34;
|
||||
int button_pressed;
|
||||
|
||||
// Checks the actor's selector value is lower than 0x9
|
||||
// Anything higher is a non-Spiral Mountain ability, and should use a different actor id
|
||||
if (this->unkF4_8 >= 9) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->initialized) {
|
||||
this->marker->propPtr->unk8_3 = 0;
|
||||
actor_collisionOff(this);
|
||||
this->initialized = TRUE;
|
||||
marker_setFreeMethod(this->marker, __chSmBottles_free);
|
||||
|
||||
if (this->unkF4_8 == 1 || this->unkF4_8 == 8) {//L80389A30
|
||||
sp40 = nodeprop_findByActorIdAndActorPosition(ACTOR_349_UNKNOWN, this);
|
||||
|
||||
if (!sp40) {
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
this->actor_specific_1_f = 300.0f;
|
||||
}
|
||||
else { //L80389A68
|
||||
nodeprop_getPosition(sp40, this->unk1C);
|
||||
this->actor_specific_1_f = nodeprop_getRadius(sp40);
|
||||
}//L80389A8C
|
||||
|
||||
if (this->unkF4_8 == 1) {
|
||||
if (volatileFlag_get(VOLATILE_FLAG_1) || volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)) {
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_3_UNKNOWN);
|
||||
}
|
||||
}
|
||||
}//L80389AC8
|
||||
|
||||
if (__chSmBottles_isAnySpiralMountainAbilityLearned()) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES, TRUE);
|
||||
|
||||
if (chmole_learnedAllSpiralMountainAbilities()) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED, TRUE);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_2, TRUE);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_C, TRUE);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_F, TRUE);
|
||||
}
|
||||
}
|
||||
}//L80389B20
|
||||
|
||||
if (!this->volatile_initialized) {
|
||||
__spawnQueue_add_1((GenFunction_1) __chSmBottles_spawnMolehill, reinterpret_cast(s32, this->marker));
|
||||
this->volatile_initialized = TRUE;
|
||||
}//L80389B4C
|
||||
|
||||
if (this->unk138_23) {
|
||||
func_8028E668(this->position, 180.0f, -40.0f, 120.0f);
|
||||
}//L80389B64
|
||||
|
||||
controller_copyFaceButtons(0, face_buttons); //get face buttons press counters
|
||||
player_getPosition(plyr_pos);
|
||||
|
||||
switch (this->state) {
|
||||
case SM_BOTTLES_STATE_1_UNKNOWN://L80389BAC
|
||||
this->yaw_ideal = (f32) func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
|
||||
if ((this->unkF4_8 == 1 && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES)) ||
|
||||
(this->unkF4_8 == 8 && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_2)) ||
|
||||
(this->unkF4_8 == 8 && mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_F))
|
||||
) {//L80389C50
|
||||
if (((ml_distance_vec3f(plyr_pos, this->unk1C) < this->actor_specific_1_f) && func_8028F20C()) ||
|
||||
mapSpecificFlags_get(SM_SPECIFIC_FLAG_10)
|
||||
) {//L80389C8C
|
||||
if (func_80329530(this, 0x96)) {
|
||||
func_8028F45C(9, this->position);
|
||||
}
|
||||
|
||||
//L80389CA4
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_2_UNKNOWN);
|
||||
}
|
||||
}
|
||||
else {//L80389CBC
|
||||
if (!func_80329530(this, 0xfa) || func_8028ECAC() || !func_8028F20C() || func_8028EC04()) {
|
||||
break;
|
||||
}
|
||||
|
||||
sp34 = (chSmBottlesDialogTable[this->unkF4_8 - 1].ability + 1) && ability_isUnlocked(chSmBottlesDialogTable[this->unkF4_8 - 1].ability);
|
||||
|
||||
if (!sp34 && this->unkF4_8 != 1 || fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL) == 0 || chSmBottlesDialogIndex < 6) {
|
||||
if (this->unkF4_8 != 8 || !fileProgressFlag_get(FILEPROG_FC_DEFEAT_GRUNTY)) {
|
||||
if (func_8028EFC8() && face_buttons[FACE_BUTTON(BUTTON_B)] == 1) {
|
||||
if (sp34 || this->unkF4_8 == 1 || this->unkF4_8 == 8) {
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_5_UNKNOWN);
|
||||
}
|
||||
else {
|
||||
if (func_80329530(this, 0x96) && !sp34) {
|
||||
func_8028F45C(9, this->position);
|
||||
}
|
||||
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_2_UNKNOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_2_UNKNOWN://L80389E2C
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
|
||||
if (0.0 < animctrl_getAnimTimer(this->animctrl) && animctrl_getAnimTimer(this->animctrl) < 0.16) {
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}//L80389EA0
|
||||
|
||||
if (actor_animationIsAt(this, 0.9999f)) {
|
||||
if (!mapSpecificFlags_get(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES)) {
|
||||
__chSmBottles_talk(this);
|
||||
}
|
||||
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_3_UNKNOWN);
|
||||
}//L80389EE0
|
||||
else if (actor_animationIsAt(this, 0.14f)) {
|
||||
FUNC_8030E8B4(SFX_C6_SHAKING_MOUTH, 1.2f, 24000, this->position, 1250, 2500);
|
||||
}
|
||||
else if (actor_animationIsAt(this, 0.4f)) { //L80389F14
|
||||
FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 24000, this->position, 1250, 2500);
|
||||
}
|
||||
else if (actor_animationIsAt(this, 0.75f)) {//L80389F48
|
||||
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500);
|
||||
}
|
||||
else if (actor_animationIsAt(this, 0.35f)) {//L80389F78
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES)) {
|
||||
__chSmBottles_talk(this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_3_UNKNOWN://L80389FAC
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
|
||||
if ((actor_animationIsAt(this, 0.37f) ||
|
||||
actor_animationIsAt(this, 0.66f) ||
|
||||
actor_animationIsAt(this, 0.85f)) && randf() < 0.2
|
||||
) {
|
||||
animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl) ^ 1);
|
||||
}//L8038A088
|
||||
else if (actor_animationIsAt(this, 0.25f) ||
|
||||
actor_animationIsAt(this, 0.28f) ||
|
||||
actor_animationIsAt(this, 0.31f)
|
||||
) {
|
||||
func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.4f, 1.55f), 16000, this->position, 1250.0f, 2500.0f);
|
||||
} //L8038A0D8
|
||||
else if (actor_animationIsAt(this, 0.45f) ||
|
||||
actor_animationIsAt(this, 0.48f) ||
|
||||
actor_animationIsAt(this, 0.51f) ||
|
||||
actor_animationIsAt(this, 0.7f) ||
|
||||
actor_animationIsAt(this, 0.73f) ||
|
||||
actor_animationIsAt(this, 0.76f)
|
||||
) {
|
||||
func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.35f, 1.5f), 6000, this->position, 1250.0f, 2500.0f);
|
||||
}//L8038A194
|
||||
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_5)) {
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_5, FALSE);
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_4_UNKNOWN);
|
||||
}//L8038A1B8
|
||||
|
||||
button_pressed = -1;
|
||||
|
||||
if (this->unk38_0) {
|
||||
this->lifetime_value += time_getDelta();
|
||||
|
||||
if (func_803114C4() != 0xe1d) {
|
||||
if (face_buttons[FACE_BUTTON(BUTTON_A)] == TRUE) {
|
||||
button_pressed = 1;
|
||||
}
|
||||
else if (face_buttons[FACE_BUTTON(BUTTON_B)] == TRUE) {
|
||||
button_pressed = 0;
|
||||
}
|
||||
}//L8038A218
|
||||
|
||||
if (button_pressed != -1) {
|
||||
fileProgressFlag_set(FILEPROG_DB_SKIPPED_TUTORIAL, button_pressed ? 0 : 1);
|
||||
gcdialog_showText(button_pressed ? ASSET_E07_TEXT_BOTTLES_UNKNOWN : ASSET_E09_TEXT_BOTTLES_SKIPPED_TUTORIAL, 0xe, this->position, this->marker, __chSmBottles_textCallback,__chSmBottles_textActions);
|
||||
|
||||
if (!button_pressed) {
|
||||
__chSmBottles_skipIntroTutorial();
|
||||
}
|
||||
|
||||
this->unk38_0 = FALSE;
|
||||
}
|
||||
else if (!this->has_met_before && 5.0 < this->lifetime_value) {
|
||||
gcdialog_showText(ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT, 0x86, this->position, this->marker, __chSmBottles_textCallback, NULL);
|
||||
this->has_met_before = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_BOTTLES_STATE_4_UNKNOWN: //L8038A31C
|
||||
if (0.35 < animctrl_getAnimTimer(this->animctrl) && animctrl_getAnimTimer(this->animctrl) < 0.9) {
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}
|
||||
else if (actor_animationIsAt(this, 0.9999f)) { //L8038A378
|
||||
__chSmBottles_setState(this, SM_BOTTLES_STATE_1_UNKNOWN);
|
||||
func_80386540();
|
||||
}
|
||||
break;
|
||||
}//L8038A3A0
|
||||
}
|
@ -2,203 +2,223 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
|
||||
|
||||
//external
|
||||
f32 mapModel_getFloorY(f32*);
|
||||
/* extern functions */
|
||||
f32 mapModel_getFloorY(f32 *);
|
||||
void spawnQueue_bundle_f32(s32, f32, f32, f32);
|
||||
void timed_mapSpecificFlags_setTrue(f32, s32);
|
||||
void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
|
||||
|
||||
//typedefs
|
||||
typedef struct ch_vegatable{
|
||||
/* typedefs and declarations */
|
||||
enum chVegetables_state_e {
|
||||
VEGETABLES_STATE_1_UNKNOWN = 1,
|
||||
VEGETABLES_STATE_2_UNKNOWN,
|
||||
VEGETABLES_STATE_3_UNKNOWN,
|
||||
VEGETABLES_STATE_4_UNKNOWN
|
||||
};
|
||||
|
||||
typedef struct ch_vegetable {
|
||||
TUPLE(f32, unk0);
|
||||
s32 unkC;
|
||||
s32 vegetable_id;
|
||||
u32 pad10_31: 19;
|
||||
u32 unk10_12: 4;
|
||||
u32 pad10_8: 9;
|
||||
} ChVeg;
|
||||
|
||||
//public
|
||||
Actor *func_80387DF4(ActorMarker *, Gfx**, Mtx**, Vtx **);
|
||||
void func_80388080(Actor *);
|
||||
/* public functions */
|
||||
Actor *chVegetablesDraw(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void chVegetablesUpdate(Actor *);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chCarrotAnimations[5] = {
|
||||
{0, 0.0f},
|
||||
{0x223, 1000000.0f},
|
||||
{0x223, 1.0f},
|
||||
{0x224, 0.75f},
|
||||
{0x223, 1.0f}
|
||||
ActorAnimationInfo chTopperAnimations[5] = {
|
||||
{NULL, 0.0f},
|
||||
{ASSET_223_ANIM_TOPPER_UNKNOWN, 1000000.0f},
|
||||
{ASSET_223_ANIM_TOPPER_UNKNOWN, 1.0f},
|
||||
{ASSET_224_ANIM_TOPPER_UNKNOWN, 0.75f},
|
||||
{ASSET_223_ANIM_TOPPER_UNKNOWN, 1.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_8038AC78 = { MARKER_12A_TOPPER_A, ACTOR_166_TOPPER_A, MODEL_TOPPER, 1, chCarrotAnimations,
|
||||
func_80388080, actor_update_func_80326224, func_80387DF4,
|
||||
ActorInfo D_8038AC78 = {
|
||||
MARKER_12A_TOPPER_A, ACTOR_166_TOPPER_A, ASSET_4ED_MODEL_TOPPER,
|
||||
1, chTopperAnimations,
|
||||
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
|
||||
2000, 0, 1.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_8038AC9C = { MARKER_1E6_TOPPER_B, ACTOR_TOPPER_B, MODEL_TOPPER, 1, chCarrotAnimations,
|
||||
func_80388080, actor_update_func_80326224, func_80387DF4,
|
||||
ActorInfo D_8038AC9C = {
|
||||
MARKER_1E6_TOPPER_B, ACTOR_TOPPER_B, ASSET_4ED_MODEL_TOPPER,
|
||||
1, chTopperAnimations,
|
||||
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
|
||||
2000, 0, 1.0f, 0
|
||||
};
|
||||
|
||||
ActorAnimationInfo chOnionAnimations[5] = {
|
||||
{0, 0.0f},
|
||||
{0x226, 1000000.0f},
|
||||
{0x226, 1.0f},
|
||||
{0x227, 0.75f},
|
||||
{0x226, 1.0f}
|
||||
ActorAnimationInfo chBawlAnimations[5] = {
|
||||
{NULL, 0.0f},
|
||||
{ASSET_226_ANIM_BAWL_UNKNOWN, 1000000.0f},
|
||||
{ASSET_226_ANIM_BAWL_UNKNOWN, 1.0f},
|
||||
{ASSET_227_ANIM_BAWL_UNKNOWN, 0.75f},
|
||||
{ASSET_226_ANIM_BAWL_UNKNOWN, 1.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_8038ACE8 = { MARKER_129_BAWL_A, ACTOR_165_BAWL_A, MODEL_BAWL, 1, chOnionAnimations,
|
||||
func_80388080, actor_update_func_80326224, func_80387DF4,
|
||||
ActorInfo D_8038ACE8 = {
|
||||
MARKER_129_BAWL_A, ACTOR_165_BAWL_A, ASSET_4EF_MODEL_BAWL,
|
||||
1, chBawlAnimations,
|
||||
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
|
||||
0, 0, 1.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_8038AD0C = { MARKER_1E7_BAWL_B, ACTOR_BAWL_B, MODEL_BAWL, 1, chOnionAnimations,
|
||||
func_80388080, actor_update_func_80326224, func_80387DF4,
|
||||
ActorInfo D_8038AD0C = {
|
||||
MARKER_1E7_BAWL_B, ACTOR_BAWL_B, ASSET_4EF_MODEL_BAWL,
|
||||
1, chBawlAnimations,
|
||||
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
|
||||
0, 0, 1.0f, 0
|
||||
};
|
||||
|
||||
ActorAnimationInfo chCauliflowerAnimations[5] = {
|
||||
{0, 0.0f},
|
||||
{0x225, 10000000.0f},
|
||||
{0x225, 1.0f},
|
||||
{0x225, 10000000.0f},
|
||||
{0x225, 1.0f}
|
||||
ActorAnimationInfo chCollywobbleAnimations[5] = {
|
||||
{NULL, 0.0f},
|
||||
{ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 10000000.0f},
|
||||
{ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 1.0f},
|
||||
{ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 10000000.0f},
|
||||
{ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 1.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_8038AD58 = { MARKER_128_COLLYWOBBLE_A, ACTOR_164_COLLYWOBBLE_A, MODEL_COLLYWOBBLE, 1, chCauliflowerAnimations,
|
||||
func_80388080, actor_update_func_80326224, func_80387DF4,
|
||||
ActorInfo D_8038AD58 = {
|
||||
MARKER_128_COLLYWOBBLE_A, ACTOR_164_COLLYWOBBLE_A, ASSET_4EE_MODEL_COLLYWOBBLE,
|
||||
1, chCollywobbleAnimations,
|
||||
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
|
||||
0, 0, 2.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_8038AD7C = { MARKER_1E8_COLLYWOBBLE_B, ACTOR_COLLYWOBBLE_B, MODEL_COLLYWOBBLE, 1, chCauliflowerAnimations,
|
||||
func_80388080, actor_update_func_80326224, func_80387DF4,
|
||||
ActorInfo D_8038AD7C = {
|
||||
MARKER_1E8_COLLYWOBBLE_B, ACTOR_COLLYWOBBLE_B, ASSET_4EE_MODEL_COLLYWOBBLE,
|
||||
1, chCollywobbleAnimations,
|
||||
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
|
||||
0, 0, 2.0f, 0
|
||||
};
|
||||
|
||||
s32 D_8038ADA0[3] = {0xFF, 0xFF, 0xFF};
|
||||
s32 D_8038ADA0[3] = {0xFF, 0xFF, 0xFF};
|
||||
|
||||
ParticleScaleAndLifetimeRanges D_8038ADAC = {
|
||||
{0.1f, 0.5f},
|
||||
{1.5f, 3.0f},
|
||||
{0.0f, 0.01f},
|
||||
{1.0f, 1.5f},
|
||||
{0.1f, 0.5f},
|
||||
{1.5f, 3.0f},
|
||||
{0.0f, 0.01f},
|
||||
{1.0f, 1.5f},
|
||||
0.0f, 0.01f,
|
||||
};
|
||||
|
||||
ParticleSettingsVelocityPosition D_8038ADD4 = {
|
||||
{{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}},
|
||||
{{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}}
|
||||
{{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}}
|
||||
};
|
||||
|
||||
ParticleScaleAndLifetimeRanges D_8038AE04 = {
|
||||
{0.5f, 0.75f},
|
||||
{0.4f, 0.6f},
|
||||
{0.4f, 0.6f},
|
||||
{0.0f, 0.01f},
|
||||
{4.0f, 4.0f},
|
||||
{4.0f, 4.0f},
|
||||
0.0f, 0.2f
|
||||
};
|
||||
|
||||
ParticleSettingsVelocityAccelerationPosition D_8038AE2C = {
|
||||
{{-100.0f, 200.0f, -100.0f}, {100.0f, 400.0f, 100.0f}},
|
||||
{{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}},
|
||||
{{-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}}
|
||||
{{-100.0f, 200.0f, -100.0f}, {100.0f, 400.0f, 100.0f}},
|
||||
{{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}},
|
||||
{{-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}}
|
||||
};
|
||||
|
||||
ParticleScaleAndLifetimeRanges D_8038AE74 = {
|
||||
{1.0f, 1.0f},
|
||||
{1.0f, 1.0f},
|
||||
{0.0f, 0.01f},
|
||||
{2.0f, 2.0f},
|
||||
{1.0f, 1.0f},
|
||||
{1.0f, 1.0f},
|
||||
{0.0f, 0.01f},
|
||||
{2.0f, 2.0f},
|
||||
0.0f, 0.5f
|
||||
};
|
||||
|
||||
ParticleSettingsVelocityAccelerationPosition D_8038AE9C = {
|
||||
{{-100.0f, 400.0f, -100.0f}, {100.0f, 600.0f, 100.0f}},
|
||||
{{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}},
|
||||
{{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}}
|
||||
{{-100.0f, 400.0f, -100.0f}, {100.0f, 600.0f, 100.0f}},
|
||||
{{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}},
|
||||
{{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}}
|
||||
};
|
||||
|
||||
ParticleScaleAndLifetimeRanges D_8038AEE4 = {
|
||||
{0.6f, 0.8f},
|
||||
{0.5f, 0.7f},
|
||||
{0.0f, 0.01f},
|
||||
{4.0f, 4.0f},
|
||||
{0.6f, 0.8f},
|
||||
{0.5f, 0.7f},
|
||||
{0.0f, 0.01f},
|
||||
{4.0f, 4.0f},
|
||||
0.0f, 0.5f
|
||||
};
|
||||
|
||||
ParticleSettingsVelocityAccelerationPosition D_8038AF0C ={
|
||||
{{-200.0f, 200.0f, -200.0f}, {200.0f, 600.0f, 200.0f}},
|
||||
{{0.0f, -900.0f, 0.0f}, {0.0f, -900.0f, 0.0f}},
|
||||
{{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}},
|
||||
ParticleSettingsVelocityAccelerationPosition D_8038AF0C = {
|
||||
{{-200.0f, 200.0f, -200.0f}, {200.0f, 600.0f, 200.0f}},
|
||||
{{ 0.0f, -900.0f, 0.0f}, { 0.0f, -900.0f, 0.0f}},
|
||||
{{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}},
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_80387910(ParticleEmitter *arg0, f32 *arg1, s32 arg2){
|
||||
void __chVegetables_emitDust(ParticleEmitter *pCtrl, f32 *pos, s32 n) {
|
||||
s32 sp24[3] = D_8038ADA0;
|
||||
particleEmitter_setRGB(arg0, sp24);
|
||||
particleEmitter_setSprite(arg0, ASSET_700_SPRITE_DUST);
|
||||
particleEmitter_setStartingFrameRange(arg0, 0, 7);
|
||||
particleEmitter_setPosition(arg0, arg1);
|
||||
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038ADAC);
|
||||
particleEmitter_setPositionAndVelocityRanges(arg0, &D_8038ADD4);
|
||||
particleEmitter_emitN(arg0, arg2);
|
||||
particleEmitter_setRGB(pCtrl, sp24);
|
||||
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
|
||||
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
|
||||
particleEmitter_setPosition(pCtrl, pos);
|
||||
particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038ADAC);
|
||||
particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038ADD4);
|
||||
particleEmitter_emitN(pCtrl, n);
|
||||
}
|
||||
|
||||
void func_803879B8(ParticleEmitter *arg0, f32 *arg1, s32 arg2, enum asset_e model_id){
|
||||
particleEmitter_func_802EF9F8(arg0, 0.6f);
|
||||
particleEmitter_func_802EFA18(arg0, 2);
|
||||
particleEmitter_setModel(arg0, model_id);
|
||||
particleEmitter_setPosition(arg0, arg1);
|
||||
particleEmitter_setDrawMode(arg0, 2);
|
||||
particleEmitter_setAngularVelocityRange(arg0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
|
||||
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038AE04);
|
||||
particleEmitter_setVelocityAccelerationAndPositionRanges(arg0, &D_8038AE2C);
|
||||
particleEmitter_emitN(arg0, arg2);
|
||||
void func_803879B8(ParticleEmitter *pCtrl, f32 *pos, s32 n, enum asset_e model_id) {
|
||||
particleEmitter_func_802EF9F8(pCtrl, 0.6f);
|
||||
particleEmitter_func_802EFA18(pCtrl, 2);
|
||||
particleEmitter_setModel(pCtrl, model_id);
|
||||
particleEmitter_setPosition(pCtrl, pos);
|
||||
particleEmitter_setDrawMode(pCtrl, 2);
|
||||
particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
|
||||
particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038AE04);
|
||||
particleEmitter_setVelocityAccelerationAndPositionRanges(pCtrl, &D_8038AE2C);
|
||||
particleEmitter_emitN(pCtrl, n);
|
||||
}
|
||||
|
||||
void func_80387A80(ParticleEmitter *arg0, f32 *arg1, s32 arg2, enum asset_e model_id){
|
||||
particleEmitter_func_802EF9F8(arg0, 0.6f);
|
||||
particleEmitter_func_802EFA18(arg0, 3);
|
||||
particleEmitter_setModel(arg0, model_id);
|
||||
particleEmitter_setPosition(arg0, arg1);
|
||||
particleEmitter_setDrawMode(arg0, 2);
|
||||
particleEmitter_setAngularVelocityRange(arg0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
|
||||
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038AE74);
|
||||
particleEmitter_setVelocityAccelerationAndPositionRanges(arg0, &D_8038AE9C);
|
||||
particleEmitter_emitN(arg0, arg2);
|
||||
void func_80387A80(ParticleEmitter *pCtrl, f32 *pos, s32 n, enum asset_e model_id) {
|
||||
particleEmitter_func_802EF9F8(pCtrl, 0.6f);
|
||||
particleEmitter_func_802EFA18(pCtrl, 3);
|
||||
particleEmitter_setModel(pCtrl, model_id);
|
||||
particleEmitter_setPosition(pCtrl, pos);
|
||||
particleEmitter_setDrawMode(pCtrl, 2);
|
||||
particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
|
||||
particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038AE74);
|
||||
particleEmitter_setVelocityAccelerationAndPositionRanges(pCtrl, &D_8038AE9C);
|
||||
particleEmitter_emitN(pCtrl, n);
|
||||
}
|
||||
|
||||
void func_80387B48(ParticleEmitter *arg0, f32 arg1[3], s32 arg2, enum asset_e model_id){
|
||||
particleEmitter_func_802EF9F8(arg0, 0.7f);
|
||||
particleEmitter_func_802EFA18(arg0, 4);
|
||||
particleEmitter_setModel(arg0, model_id);
|
||||
particleEmitter_setPosition(arg0, arg1);
|
||||
particleEmitter_setDrawMode(arg0, 2);
|
||||
particleEmitter_setAngularVelocityRange(arg0, 150.0f, -300.0f, -300.0f, 300.0f, 300.0f, -150.0f);
|
||||
particleEmitter_setSfx(arg0, SFX_1F_HITTING_AN_ENEMY_3, 8000);
|
||||
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038AEE4);
|
||||
particleEmitter_setVelocityAccelerationAndPositionRanges(arg0, &D_8038AF0C);
|
||||
particleEmitter_emitN(arg0, arg2);
|
||||
void func_80387B48(ParticleEmitter *pCtrl, f32 pos[3], s32 n, enum asset_e model_id) {
|
||||
particleEmitter_func_802EF9F8(pCtrl, 0.7f);
|
||||
particleEmitter_func_802EFA18(pCtrl, 4);
|
||||
particleEmitter_setModel(pCtrl, model_id);
|
||||
particleEmitter_setPosition(pCtrl, pos);
|
||||
particleEmitter_setDrawMode(pCtrl, 2);
|
||||
particleEmitter_setAngularVelocityRange(pCtrl, 150.0f, -300.0f, -300.0f, 300.0f, 300.0f, -150.0f);
|
||||
particleEmitter_setSfx(pCtrl, SFX_1F_HITTING_AN_ENEMY_3, 8000);
|
||||
particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038AEE4);
|
||||
particleEmitter_setVelocityAccelerationAndPositionRanges(pCtrl, &D_8038AF0C);
|
||||
particleEmitter_emitN(pCtrl, n);
|
||||
}
|
||||
|
||||
void func_80387C28(Actor * this){
|
||||
ChVeg * local = (ChVeg *)&this->local;
|
||||
f32 sp30[3];
|
||||
void __chVegetables_dieActor(Actor *this) {
|
||||
ChVeg *local = (ChVeg *) &this->local;
|
||||
f32 pos[3];
|
||||
|
||||
FUNC_8030E8B4(SFX_111_WHIPCRACK_DEATH, 1.0f, 32000, this->position, 1000, 2000);
|
||||
if(local->unkC == 3){
|
||||
sp30[0] = this->position_x;
|
||||
sp30[1] = this->position_y;
|
||||
sp30[2] = this->position_z;
|
||||
sp30[1] += 50.0f;
|
||||
func_80387B48(partEmitMgr_newEmitter(0xC), sp30, 0xC, 0x4F4);
|
||||
func_803879B8(partEmitMgr_newEmitter(4), sp30, 0x4, 0x4F2);
|
||||
func_803879B8(partEmitMgr_newEmitter(4), sp30, 0x4, 0x4F3);
|
||||
sp30[1] += 50.0f;
|
||||
func_80387910(partEmitMgr_newEmitter(8), sp30, 8);
|
||||
|
||||
if (local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE) {
|
||||
pos[0] = this->position_x;
|
||||
pos[1] = this->position_y;
|
||||
pos[2] = this->position_z;
|
||||
pos[1] += 50.0f;
|
||||
|
||||
func_80387B48(partEmitMgr_newEmitter(12), pos, 0xC, ASSET_4F4_MODEL_UNKNOWN);
|
||||
func_803879B8(partEmitMgr_newEmitter(4), pos, 0x4, ASSET_4F2_MODEL_UNKNOWN);
|
||||
func_803879B8(partEmitMgr_newEmitter(4), pos, 0x4, ASSET_4F3_MODEL_UNKNOWN);
|
||||
|
||||
pos[1] += 50.0f;
|
||||
__chVegetables_emitDust(partEmitMgr_newEmitter(8), pos, 8);
|
||||
}//L80387D18
|
||||
|
||||
if (this->unk38_31) {
|
||||
@ -207,34 +227,37 @@ void func_80387C28(Actor * this){
|
||||
__spawnQueue_add_4((GenFunction_4) spawnQueue_bundle_f32, BUNDLE_1F_SM_EMPTY_HONEYCOMB, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z));
|
||||
}//L80387D64
|
||||
|
||||
timed_mapSpecificFlags_setTrue(1.5f, 7);
|
||||
timed_mapSpecificFlags_setTrue(1.5f, SM_SPECIFIC_FLAG_7);
|
||||
actor_collisionOff(this);
|
||||
if(local->unkC != 3){
|
||||
subaddie_set_state_with_direction(this, 3, 0.0f, 1);
|
||||
|
||||
if (local->vegetable_id != VEGETABLE_3_COLLY_WOBBLE) {
|
||||
subaddie_set_state_with_direction(this, VEGETABLES_STATE_3_UNKNOWN, 0.0f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80387DCC(ActorMarker *marker, ActorMarker *other_marker){
|
||||
func_80387C28(marker_getActor(marker));
|
||||
void __chVegetables_die(ActorMarker *marker, ActorMarker *other_marker) {
|
||||
__chVegetables_dieActor(marker_getActor(marker));
|
||||
}
|
||||
|
||||
Actor *func_80387DF4(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){
|
||||
Actor *chVegetablesDraw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3) {
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
if(actor->has_met_before)
|
||||
if (actor->has_met_before) {
|
||||
func_8033A470(3, 7);
|
||||
else
|
||||
}
|
||||
else {
|
||||
func_8033A45C(3, 0);
|
||||
}
|
||||
|
||||
return actor_draw(marker, gdl, mptr, arg3);
|
||||
}
|
||||
|
||||
void func_80387E64(Actor *this){
|
||||
ChVeg *local = (ChVeg *)&this->local;
|
||||
void func_80387E64(Actor *this) {
|
||||
ChVeg *local = (ChVeg *) &this->local;
|
||||
|
||||
this->unk1C_x = randf2(-50.0f, 50.0f);
|
||||
this->unk1C_y = randf2(-50.0f, 50.0f);
|
||||
@ -245,252 +268,293 @@ void func_80387E64(Actor *this){
|
||||
this->unk1C_z = local->unk0_z + this->unk1C_z;
|
||||
}
|
||||
|
||||
void func_80387F00(Actor *this){
|
||||
ChVeg *local = (ChVeg *)&this->local;
|
||||
|
||||
this->position_y += (mapSpecificFlags_get(0xC) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) ? 120.0 : 180.0;
|
||||
void func_80387F00(Actor *this) {
|
||||
ChVeg *local = (ChVeg *) &this->local;
|
||||
|
||||
this->position_y += mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 120.0 : 180.0;
|
||||
|
||||
local->unk0_x = this->position_x;
|
||||
local->unk0_y = this->position_y;
|
||||
local->unk0_z = this->position_z;
|
||||
|
||||
this->velocity_x = 0.0f;
|
||||
this->velocity_y = 0.0f;
|
||||
this->velocity_z = 0.0f;
|
||||
|
||||
func_80387E64(this);
|
||||
}
|
||||
|
||||
int func_80387FA8(Actor *this, ChVeg *local, s32 yaw, s32 arg3){
|
||||
int func_80387FA8(Actor *this, ChVeg *local, s32 yaw, s32 arg3) {
|
||||
f32 sp24[3];
|
||||
f32 sp18[3];
|
||||
|
||||
|
||||
sp18[0] = arg3;
|
||||
sp18[1] = 0.0f;
|
||||
sp18[2] = 0.0f;
|
||||
|
||||
ml_vec3f_yaw_rotate_copy(sp18, sp18, yaw - 90.0);
|
||||
|
||||
sp24[0] = sp18[0] + local->unk0_x;
|
||||
sp24[1] = sp18[1] + local->unk0_y;
|
||||
sp24[2] = sp18[2] + local->unk0_z;
|
||||
if(func_80307258(sp24, this->unk10_25 - 1, this->unk10_18 - 1) == -1)
|
||||
|
||||
if (func_80307258(sp24, this->unk10_25 - 1, this->unk10_18 - 1) == -1) {
|
||||
return 0;
|
||||
else
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80388080(Actor *this){
|
||||
void chVegetablesUpdate(Actor *this) {
|
||||
f32 temp_velZ;
|
||||
f32 temp_velX;
|
||||
f32 temp_f0;
|
||||
f32 sp78;
|
||||
f32 tick;
|
||||
f32 sp6C[3];
|
||||
f32 sp60[3];
|
||||
f32 sp54[3];
|
||||
ChVeg *local = (ChVeg *)&this->local; //sp38
|
||||
f32 sp30;
|
||||
f32 position[3];
|
||||
ChVeg *local = (ChVeg *) &this->local; //sp38
|
||||
f32 unused;
|
||||
|
||||
|
||||
|
||||
if(!this->initialized){
|
||||
switch(this->marker->id){
|
||||
if (!this->initialized) {
|
||||
switch (this->marker->id) {
|
||||
default:
|
||||
local->unkC = 3; //cauliflower
|
||||
local->vegetable_id = VEGETABLE_3_COLLY_WOBBLE; //cauliflower
|
||||
break;
|
||||
case 0x12A: //L803880F0
|
||||
case 0x1E6: //L803880F0
|
||||
local->unkC = 1; //carrot
|
||||
|
||||
case MARKER_12A_TOPPER_A: //L803880F0
|
||||
case MARKER_1E6_TOPPER_B: //L803880F0
|
||||
local->vegetable_id = VEGETABLE_1_TOPPER; //carrot
|
||||
break;
|
||||
case 0x129: //L80388100
|
||||
case 0x1E7: //L80388100
|
||||
local->unkC = 2; //onion
|
||||
|
||||
case MARKER_129_BAWL_A: //L80388100
|
||||
case MARKER_1E7_BAWL_B: //L80388100
|
||||
local->vegetable_id = VEGETABLE_2_BAWL; //onion
|
||||
break;
|
||||
}
|
||||
|
||||
actor_collisionOff(this);
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, func_80387DCC);
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, __chVegetables_die);
|
||||
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
this->position_y -= 200.f;
|
||||
|
||||
do{//L80388154
|
||||
do {//L80388154
|
||||
temp_velX = randf2(-10.0f, 10.0f);
|
||||
temp_f0 =(0.0f <= temp_velX) ? temp_velX : -temp_velX;
|
||||
}while(temp_f0 < 5.0);
|
||||
temp_f0 = 0.0f <= temp_velX ? temp_velX : -temp_velX;
|
||||
} while (temp_f0 < 5.0);
|
||||
|
||||
do{//L803881AC
|
||||
do {//L803881AC
|
||||
temp_velZ = randf2(-10.0f, 10.0f);
|
||||
temp_f0 =(0.0f <= temp_velZ) ? temp_velZ : -temp_velZ;
|
||||
}while(temp_f0 < 5.0);
|
||||
temp_f0 = 0.0f <= temp_velZ ? temp_velZ : -temp_velZ;
|
||||
} while (temp_f0 < 5.0);
|
||||
|
||||
this->velocity_x = temp_velX;
|
||||
this->velocity_y = (local->unkC == 3) ? 90.0f : 70.0f;
|
||||
this->velocity_y = local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE ? 90.0f : 70.0f;
|
||||
this->velocity_z = temp_velZ;
|
||||
|
||||
this->has_met_before = TRUE;
|
||||
this->unk138_23 = 0;
|
||||
this->unk38_0 = 0;
|
||||
this->initialized = TRUE;
|
||||
this->scale = 0.5;
|
||||
}//L80388278
|
||||
switch (this->state)
|
||||
{
|
||||
case 1: //L803882B0
|
||||
if(mapSpecificFlags_get(0xC) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) || this->unk10_12){
|
||||
//L803882E4
|
||||
if(mapSpecificFlags_get(0xC) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){ //L8038830C
|
||||
this->unk1C_y += (local->unkC == 3)? 120.0 : 0.0;
|
||||
}else{//L80388350
|
||||
this->unk1C_y += (local->unkC == 3)? 270.0 : 85.0;
|
||||
}
|
||||
//L80388384
|
||||
subaddie_set_state(this, 4);
|
||||
}
|
||||
break;
|
||||
case 4: //L8038839C
|
||||
this->position_x = this->velocity_x + this->position_x;
|
||||
this->position_y = this->velocity_y + this->position_y;
|
||||
this->position_z = this->velocity_z + this->position_z;
|
||||
this->velocity_y -= 5.0f;
|
||||
this->scale = MIN(this->scale + 0.05, 1.0);
|
||||
if(this->velocity_y < 0.0f && this->position_y < this->unk1C_y){
|
||||
this->position_y = mapModel_getFloorY(this->position);
|
||||
if(local->unkC == 3)
|
||||
func_80387F00(this);
|
||||
|
||||
actor_collisionOn(this);
|
||||
subaddie_set_state(this, 2);
|
||||
}//L80388494
|
||||
switch (this->state) {
|
||||
case VEGETABLES_STATE_1_UNKNOWN: //L803882B0
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(
|
||||
VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) || this->unk10_12) {//L803882E4
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) { //L8038830C
|
||||
this->unk1C_y += local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE ? 120.0 : 0.0;
|
||||
}
|
||||
else {//L80388350
|
||||
this->unk1C_y += local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE ? 270.0 : 85.0;
|
||||
}
|
||||
//L80388384
|
||||
subaddie_set_state(this, VEGETABLES_STATE_4_UNKNOWN);
|
||||
}
|
||||
break;
|
||||
|
||||
if(!this->unk138_23){
|
||||
if(0.0f < this->position_y){
|
||||
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1000, 2000);
|
||||
this->unk138_23 = 1;
|
||||
this->scale = 1.0f;
|
||||
}
|
||||
}
|
||||
case VEGETABLES_STATE_4_UNKNOWN: //L8038839C
|
||||
this->position_x = this->velocity_x + this->position_x;
|
||||
this->position_y = this->velocity_y + this->position_y;
|
||||
this->position_z = this->velocity_z + this->position_z;
|
||||
|
||||
break;
|
||||
case 2: //L803884E4
|
||||
if(this->unk38_0){
|
||||
if(func_80329480(this)){
|
||||
this->unk38_0 = 0;
|
||||
}
|
||||
}else{//L80388520
|
||||
if(local->unkC == 1){
|
||||
this->actor_specific_1_f = 3.0f;
|
||||
if(mapSpecificFlags_get(0xC) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){//L80388554
|
||||
if(!func_80329030(this, 0) && func_80329480(this)){
|
||||
func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4);
|
||||
this->unk38_0 = 1;
|
||||
}//L803885A0
|
||||
if(func_803292E0(this)){
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}
|
||||
else{//L803885CC
|
||||
if(randf() < 0.02){
|
||||
func_80328CEC(this, (s32)this->yaw, 0x1E, 0x5A);
|
||||
}
|
||||
}//L80388B68
|
||||
this->velocity_y -= 5.0f;
|
||||
this->scale = MIN(this->scale + 0.05, 1.0);
|
||||
|
||||
if (this->velocity_y < 0.0f && this->position_y < this->unk1C_y) {
|
||||
this->position_y = mapModel_getFloorY(this->position);
|
||||
|
||||
if (local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE) {
|
||||
func_80387F00(this);
|
||||
}
|
||||
else{//L80388618
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
|
||||
actor_collisionOn(this);
|
||||
subaddie_set_state(this, VEGETABLES_STATE_2_UNKNOWN);
|
||||
}//L80388494
|
||||
|
||||
if (!this->unk138_23) {
|
||||
if (0.0f < this->position_y) {
|
||||
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1000, 2000);
|
||||
this->unk138_23 = 1;
|
||||
this->scale = 1.0f;
|
||||
}
|
||||
}
|
||||
else if(local->unkC == 2){//L80388634
|
||||
this->actor_specific_1_f = 4.0f;
|
||||
if(!func_80329030(this, 0) && func_80329480(this)){
|
||||
func_80328CEC(this, (s32)this->yaw, 0x78, 0xB4);
|
||||
this->unk38_0 = 1;
|
||||
}//L80388698
|
||||
if(mapSpecificFlags_get(0xC) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) && func_803292E0(this))){
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}else{//L803886E4
|
||||
if(randf() < 0.02){//D_8038B1D0){
|
||||
func_80328CEC(this, (s32)this->yaw, 0x1E, 0x5A);
|
||||
}
|
||||
break;
|
||||
|
||||
case VEGETABLES_STATE_2_UNKNOWN: //L803884E4
|
||||
if (this->unk38_0) {
|
||||
if (func_80329480(this)) {
|
||||
this->unk38_0 = 0;
|
||||
}
|
||||
}else{//L80388730
|
||||
sp78 = time_getDelta();
|
||||
sp6C[0] = this->unk1C_x - this->position_x;
|
||||
sp6C[1] = this->unk1C_y - this->position_y;
|
||||
sp6C[2] = this->unk1C_z - this->position_z;
|
||||
if( LENGTH_VEC3F(sp6C) < 40.0f){
|
||||
ml_vec3f_set_length(sp6C, 400.0f);
|
||||
}
|
||||
else{
|
||||
ml_vec3f_set_length(sp6C, 100.0f);
|
||||
}
|
||||
this->position_x += this->velocity_x*sp78 + sp6C[0]*sp78*sp78;
|
||||
this->position_y += this->velocity_y*sp78 + sp6C[1]*sp78*sp78;
|
||||
this->position_z += this->velocity_z*sp78 + sp6C[2]*sp78*sp78;
|
||||
this->velocity_x += sp6C[0]*sp78;
|
||||
this->velocity_y += sp6C[1]*sp78;
|
||||
this->velocity_z += sp6C[2]*sp78;
|
||||
if(gu_sqrtf(this->velocity_z*this->velocity_z + (this->velocity_x*this->velocity_x + this->velocity_y*this->velocity_y)) > 50.0f){
|
||||
ml_vec3f_set_length(this->velocity, 50.0f);
|
||||
}
|
||||
if(ml_distance_vec3f(this->position, this->unk1C) < 20.0f){
|
||||
func_80387E64(this);
|
||||
}
|
||||
this->actor_specific_1_f = 5.0f;
|
||||
if(mapSpecificFlags_get(0xC) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE))){ //L8038892C
|
||||
if(!func_80387FA8(this, local, (s32)this->yaw, (s32)this->actor_specific_1_f)){
|
||||
if(func_80329480(this)){
|
||||
func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4);
|
||||
}
|
||||
else {//L80388520
|
||||
if (local->vegetable_id == VEGETABLE_1_TOPPER) {
|
||||
this->actor_specific_1_f = 3.0f;
|
||||
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) {//L80388554
|
||||
if (!func_80329030(this, 0) && func_80329480(this)) {
|
||||
func_80328CEC(this, (s32) this->yaw, 0x78, 0xb4);
|
||||
this->unk38_0 = 1;
|
||||
}//L80388994
|
||||
}else{ //L803889A0
|
||||
}//L803885A0
|
||||
|
||||
this->position_x -= local->unk0_x;
|
||||
this->position_y -= local->unk0_y;
|
||||
this->position_z -= local->unk0_z;
|
||||
this->unk1C_x -= local->unk0_x;
|
||||
this->unk1C_y -= local->unk0_y;
|
||||
this->unk1C_z -= local->unk0_z;
|
||||
TUPLE_ASSIGN(sp60, this->actor_specific_1_f, 0.0f, 0.0f);
|
||||
ml_vec3f_yaw_rotate_copy(sp60, sp60, this->yaw - 90.0);
|
||||
local->unk0_x = sp60[0] + local->unk0_x;
|
||||
local->unk0_y = sp60[1] + local->unk0_y;
|
||||
local->unk0_z = sp60[2] + local->unk0_z;
|
||||
this->position_x = local->unk0_x + this->position_x;
|
||||
this->position_y = local->unk0_y + this->position_y;
|
||||
this->position_z = local->unk0_z + this->position_z;
|
||||
this->unk1C_x = local->unk0_x + this->unk1C_x;
|
||||
this->unk1C_y = local->unk0_y + this->unk1C_y;
|
||||
this->unk1C_z = local->unk0_z + this->unk1C_z;
|
||||
}//L80388AD8
|
||||
if(func_803292E0(this)){
|
||||
if (func_803292E0(this)) {
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}//L803885CC
|
||||
else if (randf() < 0.02) {
|
||||
func_80328CEC(this, (s32) this->yaw, 0x1E, 0x5A);
|
||||
}//L80388B68
|
||||
}
|
||||
else {//L80388618
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}else{//L80388B04
|
||||
if(randf() < 0.01){
|
||||
func_80328CEC(this, (s32)this->yaw, 0x1e, 0x5A);
|
||||
}
|
||||
}
|
||||
else if (local->vegetable_id == VEGETABLE_2_BAWL) {//L80388634
|
||||
this->actor_specific_1_f = 4.0f;
|
||||
|
||||
if (!func_80329030(this, 0) && func_80329480(this)) {
|
||||
func_80328CEC(this, (s32) this->yaw, 0x78, 0xB4);
|
||||
this->unk38_0 = 1;
|
||||
}//L80388698
|
||||
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) && func_803292E0(
|
||||
this))) {
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}//L803886E4
|
||||
else if (randf() < 0.02) {//D_8038B1D0){
|
||||
func_80328CEC(this, (s32) this->yaw, 0x1E, 0x5A);
|
||||
}
|
||||
}
|
||||
else {//L80388730
|
||||
tick = time_getDelta();
|
||||
|
||||
sp6C[0] = this->unk1C_x - this->position_x;
|
||||
sp6C[1] = this->unk1C_y - this->position_y;
|
||||
sp6C[2] = this->unk1C_z - this->position_z;
|
||||
|
||||
if (LENGTH_VEC3F(sp6C) < 40.0f) {
|
||||
ml_vec3f_set_length(sp6C, 400.0f);
|
||||
}
|
||||
else {
|
||||
ml_vec3f_set_length(sp6C, 100.0f);
|
||||
}
|
||||
|
||||
this->position_x += this->velocity_x * tick + sp6C[0] * tick * tick;
|
||||
this->position_y += this->velocity_y * tick + sp6C[1] * tick * tick;
|
||||
this->position_z += this->velocity_z * tick + sp6C[2] * tick * tick;
|
||||
|
||||
this->velocity_x += sp6C[0] * tick;
|
||||
this->velocity_y += sp6C[1] * tick;
|
||||
this->velocity_z += sp6C[2] * tick;
|
||||
|
||||
if (gu_sqrtf(SQ(this->velocity_z) + (SQ(this->velocity_x) + SQ(this->velocity_y))) > 50.0f) {
|
||||
ml_vec3f_set_length(this->velocity, 50.0f);
|
||||
}
|
||||
|
||||
if (ml_distance_vec3f(this->position, this->unk1C) < 20.0f) {
|
||||
func_80387E64(this);
|
||||
}
|
||||
|
||||
this->actor_specific_1_f = 5.0f;
|
||||
|
||||
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE))) { //L8038892C
|
||||
if (!func_80387FA8(this, local, (s32) this->yaw, (s32) this->actor_specific_1_f)) {
|
||||
if (func_80329480(this)) {
|
||||
func_80328CEC(this, (s32) this->yaw, 0x78, 0xb4);
|
||||
this->unk38_0 = 1;
|
||||
}//L80388994
|
||||
}
|
||||
else { //L803889A0
|
||||
this->position_x -= local->unk0_x;
|
||||
this->position_y -= local->unk0_y;
|
||||
this->position_z -= local->unk0_z;
|
||||
|
||||
this->unk1C_x -= local->unk0_x;
|
||||
this->unk1C_y -= local->unk0_y;
|
||||
this->unk1C_z -= local->unk0_z;
|
||||
|
||||
TUPLE_ASSIGN(sp60, this->actor_specific_1_f, 0.0f, 0.0f)
|
||||
ml_vec3f_yaw_rotate_copy(sp60, sp60, this->yaw - 90.0);
|
||||
|
||||
local->unk0_x = sp60[0] + local->unk0_x;
|
||||
local->unk0_y = sp60[1] + local->unk0_y;
|
||||
local->unk0_z = sp60[2] + local->unk0_z;
|
||||
|
||||
this->position_x = local->unk0_x + this->position_x;
|
||||
this->position_y = local->unk0_y + this->position_y;
|
||||
this->position_z = local->unk0_z + this->position_z;
|
||||
|
||||
this->unk1C_x = local->unk0_x + this->unk1C_x;
|
||||
this->unk1C_y = local->unk0_y + this->unk1C_y;
|
||||
this->unk1C_z = local->unk0_z + this->unk1C_z;
|
||||
}//L80388AD8
|
||||
|
||||
if (func_803292E0(this)) {
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}//L80388B04
|
||||
else if (randf() < 0.01) {
|
||||
func_80328CEC(this, (s32) this->yaw, 0x1e, 0x5A);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
//L80388B50
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
else { //L80388B50
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
}
|
||||
}
|
||||
}//L80388B68
|
||||
|
||||
func_80328FB0(this, 2.0f);
|
||||
|
||||
if (local->vegetable_id != VEGETABLE_3_COLLY_WOBBLE && actor_animationIsAt(this, 0.3f)) {
|
||||
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.0f, 22000, this->position, 1000, 2000);
|
||||
}
|
||||
|
||||
if (local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE && actor_animationIsAt(this, 0.4f)) {
|
||||
FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 0.9f, 8000, this->position, 1000, 2000);
|
||||
}
|
||||
break;
|
||||
|
||||
case VEGETABLES_STATE_3_UNKNOWN: //L80388BFC
|
||||
if (actor_animationIsAt(this, local->vegetable_id == VEGETABLE_2_BAWL ? 0.4 : 0.05)) {
|
||||
position[0] = this->position_x;
|
||||
position[1] = this->position_y;
|
||||
position[2] = this->position_z;
|
||||
|
||||
if (local->vegetable_id == VEGETABLE_1_TOPPER) {
|
||||
position[1] += 150.0f;
|
||||
}
|
||||
|
||||
this->has_met_before = FALSE;
|
||||
func_80387A80(partEmitMgr_newEmitter(3), position, 3,
|
||||
local->vegetable_id == VEGETABLE_1_TOPPER ? ASSET_4F0_MODEL_UNKNOWN : ASSET_4F1_MODEL_UNKNOWN);
|
||||
}//L80388CC4
|
||||
|
||||
if (actor_animationIsAt(this, 0.75f)) {
|
||||
func_80326310(this);
|
||||
}
|
||||
}//L80388B68
|
||||
func_80328FB0(this, 2.0f);
|
||||
|
||||
if(local->unkC != 3 && actor_animationIsAt(this, 0.3f))
|
||||
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.0f, 22000, this->position, 1000, 2000);
|
||||
|
||||
if(local->unkC == 3 && actor_animationIsAt(this, 0.4f)){
|
||||
FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 0.9f, 8000, this->position, 1000, 2000);
|
||||
}
|
||||
break;
|
||||
case 3: //L80388BFC
|
||||
if(actor_animationIsAt(this, (local->unkC == 2) ? 0.4 : 0.05)){
|
||||
sp54[0] = this->position_x;
|
||||
sp54[1] = this->position_y;
|
||||
sp54[2] = this->position_z;
|
||||
if(local->unkC == 1)
|
||||
sp54[1] += 150.0f;
|
||||
this->has_met_before = FALSE;
|
||||
func_80387A80(partEmitMgr_newEmitter(3), sp54, 3, (local->unkC == 1)? 0x4f0: 0x4f1);
|
||||
}//L80388CC4
|
||||
|
||||
if(actor_animationIsAt(this, 0.75f))
|
||||
func_80326310(this);
|
||||
break;
|
||||
break;
|
||||
}//L80388CE0
|
||||
}//*/
|
||||
|
@ -1,594 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
//external
|
||||
Actor *func_802D94B4(ActorMarker*, Gfx**, Mtx**, Vtx**);
|
||||
void func_8028E668(f32*, f32, f32, f32);
|
||||
void func_80328FB0(Actor *, f32);
|
||||
void func_8030DA44(u8);
|
||||
void timed_exitStaticCamera(f32);
|
||||
void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
|
||||
|
||||
//static types
|
||||
typedef struct {
|
||||
s16 learn_text;
|
||||
s16 refresher_text;
|
||||
s8 camera_node;
|
||||
s8 ability;
|
||||
} ChSmMoleDescription;
|
||||
|
||||
//public
|
||||
void chsmmole_Update(Actor * this);
|
||||
void chsmmole_80389610(Actor * this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo smMoleAnimations[6] = {
|
||||
{0, 0.0f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 4.5f},
|
||||
{ASSET_13B_ANIM_BOTTLES_IDLE, 7.0f},
|
||||
{ASSET_139_ANIM_BOTTLES_EXIT, 1.7f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}
|
||||
};
|
||||
|
||||
ActorInfo chSmMole = {
|
||||
MARKER_B7_TUTORIAL_BOTTLES, ACTOR_12B_TUTORIAL_BOTTLES, ASSET_387_MODEL_BOTTLES,
|
||||
1, smMoleAnimations,
|
||||
chsmmole_Update, actor_update_func_80326224, func_802D94B4,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ChSmMoleDescription smMoleTable[8] = {
|
||||
{ASSET_DF3_TEXT_BOTTLES_INTRODUCTION, ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL, 1, -1},
|
||||
{ASSET_DF4_TEXT_BOTTLES_CAMERA_CONTROL_LEARN, ASSET_DF5_TEXT_BOTTLES_CAMERA_CONTROL_REFRESHER, 3, ABILITY_3_CAMERA_CONTROL},
|
||||
{ASSET_DFB_TEXT_BOTTLES_DIVE_LEARN, ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER, 5, ABILITY_F_DIVE},
|
||||
{ -1, ASSET_E00_TEXT_BOTTLES_ATTACK_REFRESHER, 6, ABILITY_B_RATATAT_RAP},
|
||||
{ASSET_E04_TEXT_BOTTLES_BEAK_BARGE_LEARN, ASSET_E06_TEXT_BOTTLES_BEAK_BARGE_REFRESHER, 8, ABILITY_0_BARGE},
|
||||
{ -1, ASSET_DFA_TEXT_BOTTLES_JUMP_REFRESHER, 4, ABILITY_8_FLAP_FLIP},
|
||||
{ASSET_E01_TEXT_BOTTLES_CLIMB_LEARN, ASSET_E03_TEXT_BOTTLES_CLIMB_REFRESHER, 7, ABILITY_5_CLIMB},
|
||||
{ASSET_E10_TEXT_BOTTLES_BRIDGE_BROKEN, ASSET_E11_TEXT_BOTTLES_BRIDGE_STILL_BROKEN, 0x11, -1},
|
||||
};
|
||||
|
||||
s32 D_8038AFE4 = 0;
|
||||
|
||||
|
||||
/* .code */
|
||||
|
||||
/**
|
||||
* @brief Checks if any Spiral Mountain abilities have been learned
|
||||
*/
|
||||
int chsmmole_learnedAnySpiralMountainAbilities(void){
|
||||
return ability_isUnlocked(ABILITY_F_DIVE)
|
||||
|| ability_isUnlocked(ABILITY_4_CLAW_SWIPE)
|
||||
|| ability_isUnlocked(ABILITY_C_ROLL)
|
||||
|| ability_isUnlocked(ABILITY_B_RATATAT_RAP)
|
||||
|| ability_isUnlocked(ABILITY_0_BARGE)
|
||||
|| ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)
|
||||
|| ability_isUnlocked(ABILITY_7_FEATHERY_FLAP)
|
||||
|| ability_isUnlocked(ABILITY_8_FLAP_FLIP)
|
||||
|| ability_isUnlocked(ABILITY_5_CLIMB);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets all Spiral Mountain abilities to used & disables the noise
|
||||
* played when the player uses an ability for the first time.
|
||||
*/
|
||||
void chsmmole_setSpiralMountainAbilitiesAsUsed(void){
|
||||
ability_unlock(ABILITY_3_CAMERA_CONTROL);
|
||||
ability_setHasUsed(ABILITY_0_BARGE);
|
||||
ability_setHasUsed(ABILITY_1_BEAK_BOMB);
|
||||
ability_setHasUsed(ABILITY_2_BEAK_BUSTER);
|
||||
ability_setHasUsed(ABILITY_3_CAMERA_CONTROL);
|
||||
ability_setHasUsed(ABILITY_4_CLAW_SWIPE);
|
||||
ability_setHasUsed(ABILITY_5_CLIMB);
|
||||
ability_setHasUsed(ABILITY_B_RATATAT_RAP);
|
||||
ability_setHasUsed(ABILITY_C_ROLL);
|
||||
ability_setHasUsed(ABILITY_A_HOLD_A_JUMP_HIGHER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unlocks all of the Spiral Mountain moves.
|
||||
*/
|
||||
void chsmmole_skipIntroTutorial(void){
|
||||
ability_unlock(ABILITY_F_DIVE);
|
||||
ability_unlock(ABILITY_4_CLAW_SWIPE);
|
||||
ability_unlock(ABILITY_C_ROLL);
|
||||
ability_unlock(ABILITY_B_RATATAT_RAP);
|
||||
ability_unlock(ABILITY_0_BARGE);
|
||||
ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER);
|
||||
ability_unlock(ABILITY_7_FEATHERY_FLAP);
|
||||
ability_unlock(ABILITY_8_FLAP_FLIP);
|
||||
ability_unlock(ABILITY_5_CLIMB);
|
||||
chsmmole_setSpiralMountainAbilitiesAsUsed();
|
||||
mapSpecificFlags_set(3,1);
|
||||
}
|
||||
/**
|
||||
* @brief If the player is talking to Intro Bottles for the first time, use the
|
||||
* camera that points to the lair. Otherwise, use the camera for the ability.
|
||||
*/
|
||||
void chsmmole_setSpiralMountainStaticCamera(Actor *this){
|
||||
|
||||
if(this->unkF4_8 == 1 && !mapSpecificFlags_get(1)){
|
||||
timed_setStaticCameraToNode(0.0f, 0x12);
|
||||
}
|
||||
else{ //L80388F68
|
||||
timed_setStaticCameraToNode(0.0f, smMoleTable[this->unkF4_8 -1].camera_node);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80388FA0(Actor *this, s32 arg1){
|
||||
Actor *other;
|
||||
ActorMarker *myOther;
|
||||
|
||||
switch(this->state){
|
||||
case 1://L80388FE8
|
||||
this->unk138_23 = 1;
|
||||
break;
|
||||
case 4://L80388FF8
|
||||
this->unk138_23 = 0;
|
||||
case 2://L80389004
|
||||
func_8030DA44(this->unk44_31);
|
||||
this->unk44_31 = 0;
|
||||
break;
|
||||
case 5://L80389018
|
||||
this->unk138_23 = 0;
|
||||
func_8028F918(0);
|
||||
|
||||
break;
|
||||
}//L8038902C
|
||||
|
||||
switch(arg1){
|
||||
case 4:
|
||||
other = subaddie_getLinkedActor(this);
|
||||
myOther = this->unk100;
|
||||
if(myOther && other && myOther->id == 0xB8)
|
||||
subaddie_set_state_with_direction(other, 3, 0.0001f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
|
||||
sfxsource_setSfxId(this->unk44_31, 0x3f9);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
|
||||
sfxsource_setSampleRate(this->unk44_31, 0x6590);
|
||||
func_8028F918(0);
|
||||
break;
|
||||
case 1:
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
break;
|
||||
case 5:
|
||||
chsmmole_setSpiralMountainStaticCamera(this);
|
||||
func_8028F94C(2,this->position);
|
||||
chsmmole_80389610(this);
|
||||
break;
|
||||
case 3:
|
||||
actor_loopAnimation(this);
|
||||
break;
|
||||
case 2:
|
||||
other = subaddie_getLinkedActor(this);
|
||||
myOther = this->unk100;
|
||||
if(myOther && other && myOther->id == 0xB8)
|
||||
subaddie_set_state_with_direction(other, 2, 0.0001f, 1);
|
||||
animctrl_setSmoothTransition(this->animctrl, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
|
||||
sfxsource_setSfxId(this->unk44_31, 0x3f9);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
|
||||
sfxsource_setSampleRate(this->unk44_31, 0x6590);
|
||||
chsmmole_setSpiralMountainStaticCamera(this);
|
||||
func_8028F94C(2, this->position);
|
||||
break;
|
||||
}
|
||||
subaddie_set_state_with_direction(this, arg1, 0.0001f, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Performs actions depending on what move is being learned
|
||||
*
|
||||
*/
|
||||
static void __chsmmole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
switch(arg2){
|
||||
case 3:
|
||||
timed_setStaticCameraToNode(0.0f, 2);
|
||||
break;
|
||||
case 4:
|
||||
mapSpecificFlags_set(4,1);
|
||||
break;
|
||||
case 5:
|
||||
timed_setStaticCameraToNode(0.0f, 0x12);
|
||||
break;
|
||||
case 6:
|
||||
comusic_playTrack(COMUSIC_2B_DING_B);
|
||||
break;
|
||||
case 0xff:
|
||||
chsmmole_setSpiralMountainStaticCamera(actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *actor;
|
||||
|
||||
actor = marker_getActor(marker);
|
||||
if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities()){
|
||||
mapSpecificFlags_set(3, 1);
|
||||
gcdialog_showText(ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, func_803892C8, NULL);
|
||||
}//L8038933C
|
||||
else{
|
||||
if(!(text_id == ASSET_DF3_TEXT_BOTTLES_INTRODUCTION
|
||||
|| text_id == ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER
|
||||
|| text_id == ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT)){
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}
|
||||
switch(text_id){
|
||||
case ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED:
|
||||
break;
|
||||
case ASSET_DF3_TEXT_BOTTLES_INTRODUCTION: /* 2FB8 803893A8 3C188039 */
|
||||
gcdialog_showText(ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER, 0x8e, actor->position, actor->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions);
|
||||
break;
|
||||
|
||||
case ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER: /* 2FEC 803893DC 9209003B */
|
||||
actor->unk38_0 = 1;
|
||||
break;
|
||||
|
||||
case ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT: /* 2FFC 803893EC 920B0138 */
|
||||
actor->has_met_before = FALSE;
|
||||
actor->lifetime_value = 0.0f;
|
||||
break;
|
||||
|
||||
case ASSET_DF6_TEXT_BOTTLES_HIGH_JUMP_LEARN: /* 3014 80389404 0C0A3E46 */
|
||||
case ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN: /* 3014 80389404 0C0A3E46 */
|
||||
func_8028F918(0);
|
||||
break;
|
||||
|
||||
case ASSET_E09_TEXT_BOTTLES_SKIPPED_TUTORIAL:
|
||||
case ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES:
|
||||
func_80388FA0(actor,4);
|
||||
break;
|
||||
|
||||
default:
|
||||
if(actor->state != 5)
|
||||
gcdialog_showText(ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED, 4, NULL, NULL, NULL, NULL);
|
||||
|
||||
func_80388FA0(actor, actor->state == 5 ? 1:4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void chsmmole_learnAbility(Actor * this, s32* arg1, s32 *arg2){
|
||||
// Selects the learn and refresh dialogs.
|
||||
// Gives the player the ability if not learned.
|
||||
if(ability_isUnlocked(smMoleTable[this->unkF4_8 -1].ability)){
|
||||
if(fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL)){
|
||||
*arg1 = D_8038AFE4 + ASSET_E0A_TEXT_BOTTLES_REFUSE_HELP_1;
|
||||
D_8038AFE4++;
|
||||
D_8038AFE4 = MIN(D_8038AFE4, 5);
|
||||
if(*arg1 != ASSET_E0E_TEXT_BOTTLES_REFUSE_HELP_5){
|
||||
*arg2 |= 1;
|
||||
}
|
||||
}else{//L8038956C
|
||||
*arg2 |= 1;
|
||||
*arg1 = smMoleTable[this->unkF4_8 -1].refresher_text;
|
||||
if(*arg1 == ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER && !ability_hasUsed(ABILITY_3_CAMERA_CONTROL)){
|
||||
*arg1 = ASSET_DFD_TEXT_BOTTLES_SWIM_LEARN;
|
||||
}
|
||||
}
|
||||
}else{//L803895C0
|
||||
*arg1 = smMoleTable[this->unkF4_8 -1].learn_text;
|
||||
ability_unlock(smMoleTable[this->unkF4_8 -1].ability);
|
||||
}
|
||||
}
|
||||
|
||||
void chsmmole_80389610(Actor * this){
|
||||
s32 sp2C;
|
||||
s32 sp28;
|
||||
|
||||
sp28 = 0xe;
|
||||
sp2C = 0;
|
||||
|
||||
switch(this->unkF4_8){
|
||||
case 1://L8038965C
|
||||
if(mapSpecificFlags_get(1)){
|
||||
sp28 |= 1;
|
||||
if(fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL)){
|
||||
sp2C = D_8038AFE4 + 0xE0A; //dialog index
|
||||
D_8038AFE4++;
|
||||
D_8038AFE4 = MIN(D_8038AFE4, 5);
|
||||
}else{//L803896C0
|
||||
sp2C = smMoleTable[this->unkF4_8 -1].refresher_text;
|
||||
}
|
||||
}
|
||||
else{//L803896E8
|
||||
sp2C = smMoleTable[this->unkF4_8 -1].learn_text;
|
||||
mapSpecificFlags_set(1,1);
|
||||
}
|
||||
break;
|
||||
case 8://L80389720
|
||||
if(mapSpecificFlags_get(3)){
|
||||
if(fileProgressFlag_get(FILEPROG_A6_FURNACE_FUN_COMPLETE)){
|
||||
sp2C = ASSET_E37_TEXT_BOTTLES_STOP_WASTING_TIME_AFTER_FURNACE_FUN;
|
||||
sp28 |= 1;
|
||||
}else{//L80389758
|
||||
if(mapSpecificFlags_get(0xf)){
|
||||
sp2C = ASSET_E0F_TEXT_BOTTLES_STOP_WASTING_TIME_BEFORE_FURNACE_FUN;
|
||||
sp28 |= 1;
|
||||
}else{//L80389780
|
||||
chsmmole_setSpiralMountainAbilitiesAsUsed();
|
||||
sp2C = fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL) ? 0xe1e : 0xe13;
|
||||
mapSpecificFlags_set(0xf, 1);
|
||||
}
|
||||
} //L803897B4
|
||||
mapSpecificFlags_set(2, 1);
|
||||
}
|
||||
else{//L803897C8
|
||||
if(mapSpecificFlags_get(2)){
|
||||
sp2C = smMoleTable[this->unkF4_8 -1].refresher_text;
|
||||
sp28 |= 1;
|
||||
}
|
||||
else{
|
||||
sp2C = smMoleTable[this->unkF4_8 -1].learn_text;
|
||||
mapSpecificFlags_set(2, 1);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 4://L80389848
|
||||
if( !ability_isUnlocked(ABILITY_4_CLAW_SWIPE)
|
||||
|| !ability_isUnlocked(ABILITY_C_ROLL)
|
||||
|| !ability_isUnlocked(ABILITY_B_RATATAT_RAP)
|
||||
){//L803898D4
|
||||
mapSpecificFlags_set(4, 1);
|
||||
}
|
||||
else{//L803898E4
|
||||
chsmmole_learnAbility(this, &sp2C, &sp28);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6://L803898A0
|
||||
if( !ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)
|
||||
|| !ability_isUnlocked(ABILITY_7_FEATHERY_FLAP)
|
||||
|| !ability_isUnlocked(ABILITY_8_FLAP_FLIP)
|
||||
){//L803898D4
|
||||
mapSpecificFlags_set(0xE, 1);
|
||||
}
|
||||
else{//L803898E4
|
||||
chsmmole_learnAbility(this, &sp2C, &sp28);
|
||||
}
|
||||
break;
|
||||
default://L803898F8
|
||||
chsmmole_learnAbility(this, &sp2C, &sp28);
|
||||
break;
|
||||
}//L80389904
|
||||
if(sp2C){
|
||||
gcdialog_showText(sp2C, sp28, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Spawns a molehill for the actor
|
||||
*/
|
||||
void chsmmole_spawnMolehill(ActorMarker * marker){
|
||||
Actor *actor;
|
||||
Actor *other;
|
||||
s32 pad;
|
||||
|
||||
actor = marker_getActor(marker);
|
||||
other = spawn_child_actor(ACTOR_12C_MOLEHILL, &actor);
|
||||
actor->unk100 = other->marker;
|
||||
|
||||
if(marker);
|
||||
}
|
||||
|
||||
void func_80389984(Actor * this){
|
||||
u8 tmp;
|
||||
|
||||
tmp = this->unk44_31;
|
||||
if(tmp)
|
||||
func_8030DA44(tmp);
|
||||
}
|
||||
|
||||
void chsmmole_Update(Actor * this){
|
||||
// Sets up the initial functions and state for the actor
|
||||
s32 sp50[6]; // face buttons
|
||||
f32 sp44[3]; // player position
|
||||
void *sp40;
|
||||
int sp34;
|
||||
int user_input;
|
||||
|
||||
// Checks the actor's selector value is lower than 0x9
|
||||
// Anything higher is a non-Spiral Mountain ability, and should use a different actor id
|
||||
if(this->unkF4_8 >= 9)
|
||||
return;
|
||||
|
||||
if(!this->initialized){
|
||||
this->marker->propPtr->unk8_3 = 0;
|
||||
actor_collisionOff(this);
|
||||
this->initialized = TRUE;
|
||||
marker_setFreeMethod(this->marker, func_80389984);
|
||||
if(this->unkF4_8 == 1 || this->unkF4_8 == 8){//L80389A30
|
||||
sp40 = nodeprop_findByActorIdAndActorPosition(0x349, this);
|
||||
if(!sp40){
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
this->actor_specific_1_f = 300.0f;
|
||||
} else{ //L80389A68
|
||||
nodeprop_getPosition(sp40, this->unk1C);
|
||||
this->actor_specific_1_f = nodeprop_getRadius(sp40);
|
||||
}//L80389A8C
|
||||
if(this->unkF4_8 == 1){
|
||||
if(volatileFlag_get(VOLATILE_FLAG_1) || volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)){
|
||||
func_80388FA0(this, 3);
|
||||
}
|
||||
}
|
||||
}//L80389AC8
|
||||
if(chsmmole_learnedAnySpiralMountainAbilities()){
|
||||
mapSpecificFlags_set(1,1);
|
||||
|
||||
if(chmole_learnedAllSpiralMountainAbilities()){
|
||||
mapSpecificFlags_set(3, 1);
|
||||
mapSpecificFlags_set(2, 1);
|
||||
mapSpecificFlags_set(0xC, 1);
|
||||
mapSpecificFlags_set(0xF, 1);
|
||||
}
|
||||
}
|
||||
}//L80389B20
|
||||
|
||||
if(!this->volatile_initialized){
|
||||
__spawnQueue_add_1((GenFunction_1)chsmmole_spawnMolehill, reinterpret_cast(s32, this->marker));
|
||||
this->volatile_initialized = TRUE;
|
||||
}//L80389B4C
|
||||
|
||||
if(this->unk138_23){
|
||||
func_8028E668(this->position, 180.0f, -40.0f, 120.0f);
|
||||
}//L80389B64
|
||||
|
||||
pfsManager_getControllerFaceButtonState(0,sp50); //get face buttons press counters
|
||||
player_getPosition(sp44);
|
||||
switch (this->state)
|
||||
{
|
||||
case 1://L80389BAC
|
||||
this->yaw_ideal = (f32)func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if( (this->unkF4_8 == 1 && !mapSpecificFlags_get(1))
|
||||
|| (this->unkF4_8 == 8 && !mapSpecificFlags_get(2))
|
||||
|| (this->unkF4_8 == 8 && mapSpecificFlags_get(3) && !mapSpecificFlags_get(0xF))
|
||||
){//L80389C50
|
||||
|
||||
if( ((ml_distance_vec3f(sp44, this->unk1C) < this->actor_specific_1_f) && func_8028F20C())
|
||||
|| mapSpecificFlags_get(0x10)
|
||||
){//L80389C8C
|
||||
if(func_80329530(this, 0x96))
|
||||
func_8028F45C(9, this->position);
|
||||
//L80389CA4
|
||||
func_80388FA0(this, 2);
|
||||
}
|
||||
}
|
||||
else{//L80389CBC
|
||||
if( !func_80329530(this, 0xfa)
|
||||
|| func_8028ECAC()
|
||||
|| !func_8028F20C()
|
||||
|| func_8028EC04()
|
||||
) break;
|
||||
|
||||
sp34 = !((!(smMoleTable[this->unkF4_8-1].ability + 1)) || (!ability_isUnlocked( smMoleTable[this->unkF4_8-1].ability)));
|
||||
if( (!sp34 && this->unkF4_8 != 1)
|
||||
|| fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL) == 0
|
||||
|| D_8038AFE4 < 6
|
||||
){
|
||||
if(this->unkF4_8 != 8 || !fileProgressFlag_get(FILEPROG_FC_DEFEAT_GRUNTY)){
|
||||
if( func_8028EFC8()
|
||||
&& sp50[FACE_BUTTON(BUTTON_B)] == 1
|
||||
){
|
||||
if(sp34 || this->unkF4_8 == 1 || this->unkF4_8 == 8){
|
||||
func_80388FA0(this, 5);
|
||||
}
|
||||
else{
|
||||
if(func_80329530(this, 0x96) && !sp34){
|
||||
func_8028F45C(9, this->position);
|
||||
}
|
||||
func_80388FA0(this, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2://L80389E2C
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if( (f64) 0.0 < animctrl_getAnimTimer(this->animctrl)
|
||||
&& animctrl_getAnimTimer(this->animctrl) < 0.16
|
||||
){
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}//L80389EA0
|
||||
if(actor_animationIsAt(this, 0.9999f)){
|
||||
if(!mapSpecificFlags_get(1)){
|
||||
chsmmole_80389610(this);
|
||||
}
|
||||
func_80388FA0(this, 3);
|
||||
}//L80389EE0
|
||||
else if(actor_animationIsAt(this, 0.14f)){
|
||||
FUNC_8030E8B4(SFX_C6_SHAKING_MOUTH, 1.2f, 24000, this->position, 1250, 2500);
|
||||
}else if(actor_animationIsAt(this, 0.4f)){ //L80389F14
|
||||
FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 24000, this->position, 1250, 2500);
|
||||
}else if(actor_animationIsAt(this, 0.75f)){//L80389F48
|
||||
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500);
|
||||
|
||||
}else if(actor_animationIsAt(this, 0.35f)){//L80389F78
|
||||
if(mapSpecificFlags_get(1)){
|
||||
chsmmole_80389610(this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3://L80389FAC
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if( ( actor_animationIsAt(this, 0.37f)
|
||||
|| actor_animationIsAt(this, 0.66f)
|
||||
|| actor_animationIsAt(this, 0.85f)
|
||||
)
|
||||
&& randf() < 0.2
|
||||
){
|
||||
animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl)^1);
|
||||
}//L8038A088
|
||||
else if( actor_animationIsAt(this, 0.25f)
|
||||
|| actor_animationIsAt(this, 0.28f)
|
||||
|| actor_animationIsAt(this, 0.31f)
|
||||
){
|
||||
func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.4f, 1.55f), 16000, this->position, 1250.0f, 2500.0f);
|
||||
} //L8038A0D8
|
||||
else if( actor_animationIsAt(this, 0.45f)
|
||||
|| actor_animationIsAt(this, 0.48f)
|
||||
|| actor_animationIsAt(this, 0.51f)
|
||||
|| actor_animationIsAt(this, 0.7f)
|
||||
|| actor_animationIsAt(this, 0.73f)
|
||||
|| actor_animationIsAt(this, 0.76f)
|
||||
){
|
||||
func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.35f, 1.5f), 6000, this->position, 1250.0f, 2500.0f);
|
||||
}//L8038A194
|
||||
|
||||
if(mapSpecificFlags_get(5)){
|
||||
mapSpecificFlags_set(5,0);
|
||||
func_80388FA0(this, 4);
|
||||
}//L8038A1B8
|
||||
user_input = -1;
|
||||
if(this->unk38_0){
|
||||
this->lifetime_value += time_getDelta();
|
||||
if(func_803114C4() != 0xe1d){
|
||||
if(sp50[FACE_BUTTON(BUTTON_A)] == 1)
|
||||
user_input = 1; //A button pressed
|
||||
else if(sp50[FACE_BUTTON(BUTTON_B)] == 1)
|
||||
user_input = 0; //B button pressed
|
||||
}//L8038A218
|
||||
|
||||
if( user_input != -1){ //button was pressed
|
||||
fileProgressFlag_set(FILEPROG_DB_SKIPPED_TUTORIAL, (user_input)?0:1);
|
||||
gcdialog_showText((user_input)? 0xe07 : 0xe09, 0xe, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions);
|
||||
if(!user_input){
|
||||
chsmmole_skipIntroTutorial(); //give all SM moves
|
||||
}
|
||||
this->unk38_0 = 0;
|
||||
}else if(!this->has_met_before && 5.0 < this->lifetime_value){
|
||||
gcdialog_showText(0xe1d, 0x86, this->position, this->marker, func_803892C8, NULL);
|
||||
this->has_met_before = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4://L8038A31C
|
||||
if( 0.35 < animctrl_getAnimTimer(this->animctrl)
|
||||
&& animctrl_getAnimTimer(this->animctrl) < 0.9
|
||||
){
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}else{//L8038A378
|
||||
if(actor_animationIsAt(this, 0.9999f)){
|
||||
func_80388FA0(this, 1);
|
||||
func_80386540();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}//L8038A3A0
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
//extern
|
||||
Actor *func_802D94B4(ActorMarker *, Gfx **, Mtx **, Vtx**);
|
||||
void timed_exitStaticCamera(f32);
|
||||
|
||||
//public
|
||||
void SM_func_8038A5D8(Actor *this);
|
||||
void func_8038A4DC(Actor *this, s32 arg1);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_8038B0B0 = { 0x1ED, 0x3B9, 0, 1, NULL,
|
||||
SM_func_8038A5D8, actor_update_func_80326224, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
|
||||
/* .code */
|
||||
void func_8038A460(Actor *this){
|
||||
timed_setStaticCameraToNode(0.0f,4);
|
||||
}
|
||||
|
||||
void func_8038A488(ActorMarker *caller, enum asset_e text_id, s32 arg2){
|
||||
Actor *actor = marker_getActor(caller);
|
||||
if(text_id == 0xdf9 || text_id == 0xe12){
|
||||
func_8038A4DC(actor, 3);
|
||||
}
|
||||
timed_exitStaticCamera(0.0f);
|
||||
}
|
||||
|
||||
void func_8038A4DC(Actor *this, s32 arg1){
|
||||
switch(arg1){
|
||||
case 2://L8038A50C
|
||||
this->sm_4070.unk0 = 0;
|
||||
player_getPosition(this->velocity);
|
||||
func_8028F918(0);
|
||||
if(ability_isUnlocked(ABILITY_7_FEATHERY_FLAP)){
|
||||
mapSpecificFlags_set(9,1);
|
||||
}else if(ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)){//L8038A540
|
||||
mapSpecificFlags_set(8,1);
|
||||
}else{//L8038A560
|
||||
func_8038A460(this);
|
||||
ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER);
|
||||
gcdialog_showText(0xdf6, 0xe, this->unk1C, this->marker, func_8038A488, NULL);
|
||||
this->sm_4070.unk0 = 0xe1a;
|
||||
mapSpecificFlags_set(8, 0);
|
||||
}
|
||||
break;
|
||||
case 3://L8038A5B0
|
||||
mapSpecificFlags_set(5, 1);
|
||||
break;
|
||||
}//L8038A5BC
|
||||
subaddie_set_state(this, arg1);
|
||||
}
|
||||
|
||||
void SM_func_8038A5D8(Actor *this){
|
||||
f32 sp5C[3];
|
||||
s32 sp44[6];
|
||||
f32 sp40;
|
||||
Actor *temp_v0;
|
||||
s32 temp_a0;
|
||||
|
||||
if(!this->initialized){
|
||||
temp_v0 = actorArray_findClosestActorFromActorId(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp40);
|
||||
if(temp_v0){
|
||||
this->unk1C_x = temp_v0->position_x;
|
||||
this->unk1C_y = temp_v0->position_y;
|
||||
this->unk1C_z = temp_v0->position_z;
|
||||
}
|
||||
else{//L8038A630
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
}//L8038A644
|
||||
this->initialized = TRUE;
|
||||
}//L8038A650
|
||||
|
||||
pfsManager_getControllerFaceButtonState(0, sp44);
|
||||
switch (this->state)
|
||||
{
|
||||
case 1://L8038A688
|
||||
if(fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL)){
|
||||
marker_despawn(this->marker);
|
||||
}else{
|
||||
if(mapSpecificFlags_get(0xe)){
|
||||
func_8038A4DC(this, 2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2://L8038A6C8
|
||||
if(!func_803114B0()){
|
||||
if(mapSpecificFlags_get(8)){
|
||||
func_8038A460(this);
|
||||
ability_unlock(ABILITY_7_FEATHERY_FLAP);
|
||||
gcdialog_showText(0xdf7, 0xa, this->unk1C, this->marker, func_8038A488, NULL);
|
||||
this->sm_4070.unk0 = 0xe1b;
|
||||
mapSpecificFlags_set(8,0);
|
||||
}//L8038A730
|
||||
|
||||
if(mapSpecificFlags_get(9)){
|
||||
func_8038A460(this);
|
||||
ability_unlock(ABILITY_8_FLAP_FLIP);
|
||||
gcdialog_showText(0xdf8, 0xa, this->unk1C, this->marker, func_8038A488, NULL);
|
||||
this->sm_4070.unk0 = 0xe1c;
|
||||
mapSpecificFlags_set(9,0);
|
||||
}//L8038A794
|
||||
|
||||
if(mapSpecificFlags_get(0xa)){
|
||||
func_8038A460(this);
|
||||
func_8028F94C(2, this->unk1C);
|
||||
|
||||
if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities()){
|
||||
mapSpecificFlags_set(3,1);
|
||||
temp_a0 = 0xe12;
|
||||
}else{
|
||||
temp_a0 = 0xdf9;
|
||||
}
|
||||
|
||||
gcdialog_showText(temp_a0, 0xe, this->unk1C, this->marker, func_8038A488, NULL);
|
||||
mapSpecificFlags_set(0xa,0);
|
||||
this->sm_4070.unk0 = 0;
|
||||
}
|
||||
}//L8038A828
|
||||
player_getPosition(sp5C);
|
||||
sp5C[0] = this->velocity_x;
|
||||
sp5C[2] = this->velocity_z;
|
||||
func_8028FAB0(sp5C);
|
||||
if( func_8028EFC8()
|
||||
&& sp44[FACE_BUTTON(BUTTON_B)] == 1
|
||||
&& func_8028F20C()
|
||||
){
|
||||
if(this->sm_4070.unk0)
|
||||
gcdialog_showText(temp_a0 = this->sm_4070.unk0, 0, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3://L8038A8A0
|
||||
marker_despawn(this->marker);
|
||||
break;
|
||||
}//L8038A8AC
|
||||
}
|
@ -18,7 +18,7 @@ ActorInfo D_8038B0E0 = { 0x1F0, 0x3BD, 0, 0, NULL,
|
||||
|
||||
/* .code */
|
||||
void func_8038A8C0(ActorMarker *arg0){
|
||||
mapSpecificFlags_set(0x10, 0);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_10, FALSE);
|
||||
func_8028E6EC(2);
|
||||
func_8028F918(0);
|
||||
}
|
||||
@ -44,13 +44,13 @@ void func_8038A8F8(Actor *this){
|
||||
if(sp2C < (f32) this->unkF4_8)
|
||||
func_80388D48();
|
||||
|
||||
if( !mapSpecificFlags_get(0x10) && sp2C < (f32) this->unkF4_8 && 1780.0f < func_8028E82C()){
|
||||
if( !mapSpecificFlags_get(2)
|
||||
|| (mapSpecificFlags_get(3) && !mapSpecificFlags_get(0xf))
|
||||
if( !mapSpecificFlags_get(SM_SPECIFIC_FLAG_10) && sp2C < (f32) this->unkF4_8 && 1780.0f < func_8028E82C()){
|
||||
if( !mapSpecificFlags_get(SM_SPECIFIC_FLAG_2)
|
||||
|| (mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_F))
|
||||
){ //L8038AA54
|
||||
this->yaw_ideal = ml_distance_vec3f(this->velocity, this->unk1C) / 150.0;
|
||||
func_8028F3D8(this->unk1C, this->yaw_ideal, func_8038A8C0, this->marker);
|
||||
mapSpecificFlags_set(0x10, 1);
|
||||
mapSpecificFlags_set(SM_SPECIFIC_FLAG_10, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ void SM_func_80386FE0(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_8038ABF0 = {
|
||||
0x134, 0x16E, 0,
|
||||
MARKER_134_UNKNOWN, ACTOR_16E_UNKNOWN, NULL,
|
||||
1, NULL,
|
||||
SM_func_80386FE0, actor_update_func_80326224, func_80325340,
|
||||
2000, 0, 0.0f, 0
|
||||
|
@ -18,7 +18,7 @@ extern ActorInfo D_8038AD58; //ch cauliflower A
|
||||
extern ActorInfo D_8038AC9C; //chCarrot FreeRange?
|
||||
extern ActorInfo D_8038AD0C; //ch onion B
|
||||
extern ActorInfo D_8038AD7C; //ch cauliflower B
|
||||
extern ActorInfo chSmMole; //chSmMole bottles
|
||||
extern ActorInfo chBottles; //chSmMole bottles
|
||||
extern ActorInfo D_8038B0B0; //chJumpTutorial code_4070
|
||||
extern ActorInfo D_8038B0E0;
|
||||
extern ActorInfo D_8038B008; //chBanjosBed
|
||||
@ -149,7 +149,7 @@ void SM_func_80386810(void)
|
||||
spawnableActorList_add(&D_8038AC9C, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_25);
|
||||
spawnableActorList_add(&D_8038AD0C, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_25);
|
||||
spawnableActorList_add(&D_8038AD7C, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_21 | ACTOR_FLAG_UNKNOWN_25);
|
||||
spawnableActorList_add(&chSmMole, actor_new, ACTOR_FLAG_UNKNOWN_8);
|
||||
spawnableActorList_add(&chBottles, actor_new, ACTOR_FLAG_UNKNOWN_8);
|
||||
spawnableActorList_add(&D_8038B0B0, actor_new, ACTOR_FLAG_NONE);
|
||||
spawnableActorList_add(&D_8038B0E0, actor_new, ACTOR_FLAG_NONE);
|
||||
spawnableActorList_add(&D_8038B008, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_9 | ACTOR_FLAG_UNKNOWN_10);
|
||||
|
@ -70,7 +70,7 @@ static void __chLockup_close(Actor *this){
|
||||
}
|
||||
|
||||
static void __chLockup_open(Actor *this){
|
||||
func_80389468();
|
||||
code3040_func_80389468();
|
||||
subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_OPENING, 0.2f, 1);
|
||||
this->unk38_31 = 1;
|
||||
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
|
||||
|
@ -25,11 +25,12 @@ extern ActorInfo gChTreasurehuntRedQuestionMark;
|
||||
extern ActorInfo gChTreasurehuntRedX;
|
||||
extern ActorInfo gChTreasure;
|
||||
|
||||
void code26D0_genericUpdateFunc(Actor *this);
|
||||
void code26D0_palmTreeUpdateFunc(Actor *this);
|
||||
void code26D0_lighthouseAUpdateFunc(Actor *this);
|
||||
void func_802D3D54(Actor *this);
|
||||
void code26D0_sharkfoodIslandUpdateFunc(Actor *this);
|
||||
extern void func_802D3D54(Actor *this);
|
||||
|
||||
static void __code26D0_genericUpdateFunc(Actor *this);
|
||||
static void __code26D0_palmTreeUpdateFunc(Actor *this);
|
||||
static void __code26D0_lighthouseAUpdateFunc(Actor *this);
|
||||
static void __code26D0_sharkfoodIslandUpdateFunc(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo gBlubberShipTopHatch = {
|
||||
@ -49,47 +50,47 @@ ActorInfo gLighthouseDoor = {
|
||||
ActorInfo gSharkfoodIsland = {
|
||||
MARKER_167_SHARKFOOD_ISLAND, ACTOR_25C_SHARKFOOD_ISLAND, ASSET_50A_MODEL_SHARKFOOD_ISLAND,
|
||||
0x1, NULL,
|
||||
code26D0_sharkfoodIslandUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
__code26D0_sharkfoodIslandUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo gLighthouseA = {
|
||||
MARKER_267_LIGHTHOUSE_A, ACTOR_2E2_LIGHTHOUSE_A, ASSET_3BD_MODEL_LIGHTHOUSE_A,
|
||||
0x1, NULL,
|
||||
code26D0_lighthouseAUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
__code26D0_lighthouseAUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo gLighthouseB = {
|
||||
MARKER_26A_LIGHTHOUSE_B, ACTOR_2DF_LIGHTHOUSE_B, ASSET_3BE_MODEL_LIGHTHOUSE_B,
|
||||
0x1, NULL,
|
||||
code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
__code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo gStairs1 = {
|
||||
MARKER_268_STAIRS_1, ACTOR_2E0_TTC_STAIRS_1, ASSET_3B6_MODEL_TTC_STAIRS_1,
|
||||
0x1, NULL,
|
||||
code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
__code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo gStairs2 = {
|
||||
MARKER_269_STAIRS_2, ACTOR_2E1_TTC_STAIRS_2, ASSET_3B7_MODEL_TTC_STAIRS_1,
|
||||
0x1, NULL,
|
||||
code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
__code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo gPalmTree = {
|
||||
MARKER_1D5_PALM_TREE, ACTOR_31E_PALM_TREE, ASSET_3A9_MODEL_PALM_TREE,
|
||||
0x1, NULL,
|
||||
code26D0_palmTreeUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
__code26D0_palmTreeUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void TTC_resetSpawnableActors(void)
|
||||
void code26D0_resetSpawnableActorsForTTC(void)
|
||||
{
|
||||
spawnableActorList_add(&gBlubberShipTopHatch, actor_new, ACTOR_FLAG_NONE);
|
||||
spawnableActorList_add(&gLighthouseDoor, actor_new, ACTOR_FLAG_NONE);
|
||||
@ -112,14 +113,14 @@ void TTC_resetSpawnableActors(void)
|
||||
spawnableActorList_add(&gChClam, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_25);
|
||||
}
|
||||
|
||||
void code26D0_genericUpdateFunc(Actor *this){
|
||||
static void __code26D0_genericUpdateFunc(Actor *this){
|
||||
if(!this->initialized){
|
||||
func_802D3D74(this);
|
||||
this->initialized = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void code26D0_palmTreeUpdateFunc(Actor *this){
|
||||
static void __code26D0_palmTreeUpdateFunc(Actor *this){
|
||||
if(!this->initialized){
|
||||
func_802D3D74(this);
|
||||
this->initialized = TRUE;
|
||||
@ -127,21 +128,21 @@ void code26D0_palmTreeUpdateFunc(Actor *this){
|
||||
}
|
||||
}
|
||||
|
||||
void code26D0_spawnLighthouseB(s32 arg0){
|
||||
static void __code26D0_spawnLighthouseB(s32 arg0){
|
||||
ActorMarker *marker = reinterpret_cast(ActorMarker *, arg0);
|
||||
Actor *this = marker_getActor(marker);
|
||||
spawn_child_actor(ACTOR_2DF_LIGHTHOUSE_B, &this);
|
||||
}
|
||||
|
||||
void code26D0_lighthouseAUpdateFunc(Actor *this){
|
||||
code26D0_genericUpdateFunc(this);
|
||||
static void __code26D0_lighthouseAUpdateFunc(Actor *this){
|
||||
__code26D0_genericUpdateFunc(this);
|
||||
if(!this->volatile_initialized){
|
||||
__spawnQueue_add_1((GenFunction_1)code26D0_spawnLighthouseB, (s32)this->marker);
|
||||
__spawnQueue_add_1((GenFunction_1)__code26D0_spawnLighthouseB, (s32)this->marker);
|
||||
this->volatile_initialized = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void code26D0_sharkfoodIslandUpdateFunc(Actor *this){
|
||||
static void __code26D0_sharkfoodIslandUpdateFunc(Actor *this){
|
||||
f32 player_position[3];
|
||||
|
||||
if(!this->initialized){
|
||||
@ -160,7 +161,7 @@ void code26D0_sharkfoodIslandUpdateFunc(Actor *this){
|
||||
else{
|
||||
this->position_y = -1000.0f;
|
||||
}
|
||||
}//L80388E7C
|
||||
}
|
||||
|
||||
if(this->position_y == 700.0f){
|
||||
player_getPosition(player_position);
|
||||
|
@ -5,8 +5,11 @@
|
||||
extern s32 D_80276CB0;
|
||||
|
||||
/* .data */
|
||||
// code crc0
|
||||
s32 D_8038C750 = 0x0016D2FD;
|
||||
// code crc1
|
||||
s32 D_8038C754 = 0xFB70B01D;
|
||||
// data crc
|
||||
s32 D_8038C758 = 0x0004EFAC;
|
||||
|
||||
/* .bss */
|
||||
@ -15,17 +18,17 @@ struct {
|
||||
s32 unk4;
|
||||
u8 pad8[4];
|
||||
s32 unkC;
|
||||
}D_8038D6F0;
|
||||
} sD_8038D6F0;
|
||||
|
||||
/* .code */
|
||||
void func_80389430(void){
|
||||
void __code3040_func_80389430(){
|
||||
if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){
|
||||
func_8029CF48(2, 1, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80389468(void){
|
||||
if(D_8038D6F0.unk4 != D_8038C754 || D_8038D6F0.unkC != D_80276CB0){
|
||||
func_80389430();
|
||||
void code3040_func_80389468(void){
|
||||
if(sD_8038D6F0.unk4 != D_8038C754 || sD_8038D6F0.unkC != D_80276CB0){
|
||||
__code3040_func_80389430();
|
||||
}
|
||||
}
|
||||
|
1334
src/TTC/code_3E30.c
1334
src/TTC/code_3E30.c
File diff suppressed because it is too large
Load Diff
@ -70,7 +70,7 @@ f32 func_8024E420(s32 arg0, s32 arg1, s32 arg2) {
|
||||
return phi_f2 *= arg0;
|
||||
}
|
||||
|
||||
void pfsManager_getControllerFaceButtonState(s32 controller_index, s32 dst[6]){
|
||||
void controller_copyFaceButtons(s32 controller_index, s32 dst[6]){
|
||||
dst[FACE_BUTTON(BUTTON_A)] = D_80281138[controller_index].face_button[FACE_BUTTON(BUTTON_A)];
|
||||
dst[FACE_BUTTON(BUTTON_B)] = D_80281138[controller_index].face_button[FACE_BUTTON(BUTTON_B)];
|
||||
dst[FACE_BUTTON(BUTTON_C_LEFT)] = D_80281138[controller_index].face_button[FACE_BUTTON(BUTTON_C_LEFT)];
|
||||
|
@ -19,7 +19,7 @@ extern void func_803458E4(f32[4], f32[4], f32[4], f32);
|
||||
#define CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT (CH_BOTTLES_BONUS_PUZZLE_HEIGHT * CH_BOTTLES_BONUS_PUZZLE_WIDTH)
|
||||
|
||||
/* .extern symbols??? */
|
||||
extern u8 D_8037DCC0[7];
|
||||
extern u8 gCompletedBottleBonusGames[7];
|
||||
extern u8 D_8037DCC7;
|
||||
extern u8 D_8037DCC8;
|
||||
extern u8 D_8037DCC9;
|
||||
@ -422,7 +422,7 @@ void chBottlesBonus_completedPuzzle(void) {
|
||||
Actor *actor;
|
||||
|
||||
actor = marker_getActor(chBottlesBonusMarker);
|
||||
D_8037DCC0[chBottleBonusPuzzleIndex] = TRUE;
|
||||
gCompletedBottleBonusGames[chBottleBonusPuzzleIndex] = TRUE;
|
||||
func_80311714(0);
|
||||
gcdialog_showText(D_803681A0[chBottleBonusPuzzleIndex + 1].text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_IncrementPuzzle, NULL);
|
||||
func_80311714(1);
|
||||
@ -600,7 +600,7 @@ Actor *chBottlesBonus_new(s32 position[3], s32 yaw, ActorInfo *actor_info, u32 f
|
||||
void chBottlesBonus_func_802DEB80(void) {
|
||||
int i;
|
||||
for(i = 0; i < 7; i++){
|
||||
D_8037DCC0[i] = 0;
|
||||
gCompletedBottleBonusGames[i] = 0;
|
||||
}
|
||||
D_8037DCC7 = 0;
|
||||
D_8037DCC8 = 0;
|
||||
|
@ -39,7 +39,7 @@ void __chCrab_802CB040(Actor *this) {
|
||||
void __chCrab_802CB078(Actor *this) {
|
||||
u32 temp_t9;
|
||||
|
||||
if ((this->modelCacheIndex != ACTOR_F2_BLACK_SNIPPET) || func_8038B550()) {
|
||||
if ((this->modelCacheIndex != ACTOR_F2_BLACK_SNIPPET) || code3E30_hasBanjoKazooieCodeBeenEntered()) {
|
||||
temp_t9 = (u32) this->unk38_31 >> 0x16;
|
||||
if (this->unk38_31 != 0) {
|
||||
this->unk38_31--;
|
||||
@ -159,7 +159,7 @@ bool __chCrab_802CB76C(ActorMarker *marker, ActorMarker *other) {
|
||||
Actor *this;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
if ((this->modelCacheIndex == ACTOR_F2_BLACK_SNIPPET) && !func_8038B550()) {
|
||||
if ((this->modelCacheIndex == ACTOR_F2_BLACK_SNIPPET) && !code3E30_hasBanjoKazooieCodeBeenEntered()) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -81,7 +81,7 @@ s32 mm_hut_smash_count;
|
||||
u32 CH_TREASUREHUNT_PUZZLE_CURRENT_STEP;
|
||||
struct FF_StorageStruct* D_8037DCB8;
|
||||
s32 D_8037DCBC;
|
||||
u8 D_8037DCC0[7];
|
||||
u8 gCompletedBottleBonusGames[7]; // bottle bonus puzzle?
|
||||
u8 D_8037DCC7;
|
||||
u8 D_8037DCC8;
|
||||
u8 D_8037DCC9;
|
||||
@ -331,7 +331,7 @@ void func_802C4C14(Actor *this){
|
||||
}
|
||||
else{//L802C4D24
|
||||
func_8024E60C(0, sp74);
|
||||
pfsManager_getControllerFaceButtonState(0, sp5C);
|
||||
controller_copyFaceButtons(0, sp5C);
|
||||
controller_getJoystick(0, &sp54);
|
||||
switch(this->state){
|
||||
case 2:
|
||||
@ -426,7 +426,7 @@ void func_802C4C14(Actor *this){
|
||||
if(sp74[0] == 1){
|
||||
if(gameFile_isNotEmpty(sp84)){
|
||||
func_8031877C(chGameSelectTopZoombox);
|
||||
func_803183A4(chGameSelectTopZoombox, (&D_80365DFC)[func_8031B5B0()]);
|
||||
func_803183A4(chGameSelectTopZoombox, (&D_80365DFC)[code94620_func_8031B5B0()]);
|
||||
D_8037DD2C = 1;
|
||||
subaddie_set_state(this, 5);
|
||||
}
|
||||
@ -549,7 +549,7 @@ void func_802C4C14(Actor *this){
|
||||
}
|
||||
|
||||
void func_802C5740(Actor * this){
|
||||
int i = func_8031B5B0();
|
||||
int i = code94620_func_8031B5B0();
|
||||
D_8037DCE0.unk0 = (&D_80365DF4)[i];
|
||||
D_8037DCE0.unk4 = (&D_80365DF8)[i];
|
||||
|
||||
@ -558,7 +558,7 @@ void func_802C5740(Actor * this){
|
||||
if(chGameSelectBottomZoombox == NULL){
|
||||
chGameSelectBottomZoombox = gczoombox_new(0xA0, ZOOMBOX_SPRITE_C_BANJO_2, 2, 0, NULL);
|
||||
gczoombox_open(chGameSelectBottomZoombox);
|
||||
func_803184C8(chGameSelectBottomZoombox, 30.0f, 5, 2, 0.4f, 0, 0);
|
||||
gczoombox_func_803184C8(chGameSelectBottomZoombox, 30.0f, 5, 2, 0.4f, 0, 0);
|
||||
}//L802C57FC
|
||||
|
||||
if(chGameSelectTopZoombox == NULL){
|
||||
|
@ -7,8 +7,8 @@ Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void chmole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2);
|
||||
|
||||
typedef struct{
|
||||
s16 learn_text;
|
||||
s16 refresher_text;
|
||||
s16 teach_text_id;
|
||||
s16 refresher_text_id;
|
||||
s8 camera_node;
|
||||
s8 ability;
|
||||
} ChMoleDescription;
|
||||
@ -154,12 +154,12 @@ void chmole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){
|
||||
// Also releases the camera
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
if( arg1 == moleTable[actor->unkF4_8-9].learn_text
|
||||
if( arg1 == moleTable[actor->unkF4_8-9].teach_text_id
|
||||
&& item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)
|
||||
){
|
||||
gcdialog_showText(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions);
|
||||
}//L802D9738
|
||||
else if(arg1 == moleTable[actor->unkF4_8-9].learn_text || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){
|
||||
else if(arg1 == moleTable[actor->unkF4_8-9].teach_text_id || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){
|
||||
gcdialog_showText(chmole_learnedAllGameAbilities()? 0xa87 : chmole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, chmole_healthRefill, NULL);
|
||||
}
|
||||
else{//L802D97BC
|
||||
@ -224,13 +224,13 @@ int chmole_learnAbility(Actor *this){
|
||||
// Known Ability: Refresher Dialog
|
||||
if(ability_isUnlocked(moleTable[this->unkF4_8-9].ability)){
|
||||
sp28 = 0xf;
|
||||
sp2C = moleTable[this->unkF4_8-9].refresher_text;
|
||||
sp2C = moleTable[this->unkF4_8-9].refresher_text_id;
|
||||
}//L802D99EC
|
||||
// New Ability: Learn Dialog & Misc Actions
|
||||
else{
|
||||
func_80347A14(0);
|
||||
this->has_met_before = TRUE;
|
||||
sp2C = moleTable[this->unkF4_8-9].learn_text;
|
||||
sp2C = moleTable[this->unkF4_8-9].teach_text_id;
|
||||
ability_unlock(moleTable[this->unkF4_8-9].ability);
|
||||
switch(moleTable[this->unkF4_8-9].ability){
|
||||
case ABILITY_9_FLIGHT:
|
||||
@ -376,7 +376,7 @@ void chmole_update(Actor *this){
|
||||
}
|
||||
}
|
||||
}//L802D9F34
|
||||
pfsManager_getControllerFaceButtonState(0, sp50); // get face buttons press counters
|
||||
controller_copyFaceButtons(0, sp50); // get face buttons press counters
|
||||
switch(this->state){
|
||||
case 1://L802D9F70
|
||||
this->yaw_ideal = func_80329784(this);
|
||||
|
@ -314,7 +314,7 @@ void chMumbo_update(Actor *this) {
|
||||
&& func_8028F20C()
|
||||
&& func_8028EFC8()
|
||||
){
|
||||
pfsManager_getControllerFaceButtonState(0, face_buttons);
|
||||
controller_copyFaceButtons(0, face_buttons);
|
||||
if(face_buttons[FACE_BUTTON(BUTTON_B)] == 1){
|
||||
if (D_8037DDF0 == TRANSFORM_7_WISHWASHY) {
|
||||
this->unk38_31 = 0;
|
||||
|
@ -11,7 +11,7 @@ extern void func_802F9D38(s32);
|
||||
extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32);
|
||||
extern void ml_vec3f_assign(f32[3], f32, f32, f32);
|
||||
extern void func_802EE2E8(Actor *arg0, s32 arg1, s32 cnt, s32 arg3, f32 arg4, f32 arg5, f32 arg6);
|
||||
extern void func_80319EA4(void);
|
||||
extern void gcquiz_func_80319EA4(void);
|
||||
extern void fileProgressFlag_set(enum file_progress_e, bool);
|
||||
|
||||
void func_802D3D54(Actor *this);
|
||||
@ -360,6 +360,7 @@ void func_802D3CC8(ActorMarker *marker){
|
||||
func_802D31AC(marker, NULL);
|
||||
}
|
||||
|
||||
// used as init function
|
||||
void func_802D3CE8(Actor *this){
|
||||
if(!this->initialized){
|
||||
marker_setCollisionScripts(this->marker, NULL, func_802D3138, func_802D31AC);
|
||||
@ -372,6 +373,7 @@ void func_802D3D54(Actor *this){
|
||||
func_802D3CE8(this);
|
||||
}
|
||||
|
||||
// used as init function
|
||||
void func_802D3D74(Actor *this){
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
actor_collisionOff(this);
|
||||
@ -813,7 +815,7 @@ void func_802D5178(s32 arg0, enum file_progress_e arg1, s32 arg2, enum map_e arg
|
||||
|
||||
void func_802D520C(Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
if(volatileFlag_get(VOLATILE_FLAG_1) && map_get() != MAP_8E_GL_FURNACE_FUN){
|
||||
func_80319214(gfx, mtx, vtx);
|
||||
gcquiz_draw(gfx, mtx, vtx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1007,12 +1009,12 @@ void func_802D5628(void){
|
||||
case 0x15:// L802D5AB4
|
||||
case 0x2d:// L802D5AB4
|
||||
if(D_80367684 && D_80367684 == map_get()){
|
||||
func_80319EA4();
|
||||
gcquiz_func_80319EA4();
|
||||
if(0.0f < D_8037DE08){
|
||||
D_8037DE08 -= time_getDelta();
|
||||
}
|
||||
else{//L802D5B24
|
||||
pfsManager_getControllerFaceButtonState(0, sp50); //get button inputs
|
||||
controller_copyFaceButtons(0, sp50); //get button inputs
|
||||
if(sp50[FACE_BUTTON(BUTTON_B)] == 1){
|
||||
func_80324C58();
|
||||
func_802D6114();
|
||||
|
@ -134,7 +134,7 @@ void func_802E35D8(void ) {
|
||||
}
|
||||
} else if (D_8037E8C0.unk14 == 3) {
|
||||
sp38 = 0;
|
||||
pfsManager_getControllerFaceButtonState(0, &sp40);
|
||||
controller_copyFaceButtons(0, &sp40);
|
||||
for(i = 0; i < 6; i++){
|
||||
if (sp40[i] == 1) {
|
||||
sp38++;
|
||||
|
@ -624,7 +624,7 @@ s32 getGameMode(void){
|
||||
return D_8037E8E0.game_mode;
|
||||
}
|
||||
|
||||
int func_802E4A08(void){
|
||||
bool func_802E4A08(void){
|
||||
return (D_8037E8E0.game_mode == GAME_MODE_6_FILE_PLAYBACK)
|
||||
|| (D_8037E8E0.game_mode == GAME_MODE_5_UNKNOWN)
|
||||
|| (D_8037E8E0.game_mode == GAME_MODE_7_ATTRACT_DEMO)
|
||||
|
@ -386,7 +386,7 @@ void func_802F5060(s32 textureId){
|
||||
tmp_a2 = func_802546E4(D_80380AB8[1]);
|
||||
if(tmp_a2 & 0xF)
|
||||
tmp_a2 += 0x10 - (tmp_a2 & 0xF);
|
||||
if(!func_8033BDAC(SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK, D_80380AB8[1],tmp_a2)){
|
||||
if(!code_B3A80_func_8033BDAC(SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK, D_80380AB8[1],tmp_a2)){
|
||||
assetcache_release(D_80380AB8[1]);
|
||||
D_80380AB8[1] = assetcache_get(SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK);
|
||||
}
|
||||
@ -394,7 +394,7 @@ void func_802F5060(s32 textureId){
|
||||
tmp_a2 = func_802546E4(D_80380AB8[3]);
|
||||
if(tmp_a2 & 0xF)
|
||||
tmp_a2 += 0x10 - (tmp_a2 & 0xF);
|
||||
if(!func_8033BDAC(SPRITE_BOLD_FONT_LETTERS_ALPHAMASK, D_80380AB8[3],tmp_a2)){
|
||||
if(!code_B3A80_func_8033BDAC(SPRITE_BOLD_FONT_LETTERS_ALPHAMASK, D_80380AB8[3],tmp_a2)){
|
||||
assetcache_release(D_80380AB8[3]);
|
||||
D_80380AB8[3] = assetcache_get(SPRITE_BOLD_FONT_LETTERS_ALPHAMASK);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ ItemPrint D_803692F8[0x2C] = {
|
||||
/* .bss */
|
||||
s32 D_803810B0;
|
||||
f32 itemPrintValues[0x2C]; //item_print_value
|
||||
s32 D_80381168[0x2C]; //comusic_e
|
||||
s32 D_80381168[0x2C]; // item_e => comusic_e
|
||||
f32 D_80381218[0x2C]; //item_sfx_volume???
|
||||
s32 D_803812C8[0x2C]; //comusic_e
|
||||
s32 D_80381378[0x2C]; //sfx_e
|
||||
|
@ -7,57 +7,71 @@
|
||||
extern void item_set(enum item_e, s32);
|
||||
extern void func_8025A55C(s32, s32, s32);
|
||||
|
||||
enum gcquiz_state {
|
||||
GCQUIZ_STATE_0_INITIAL, //803197F0
|
||||
GCQUIZ_STATE_1_SHOW_QUESTION_VIA_ZOOMBOX, //80319910
|
||||
GCQUIZ_STATE_2_SHOW_PORTRAITS_FOR_QUESTION, //8031994C
|
||||
GCQUIZ_STATE_3_UNKNOWN, //80319B78
|
||||
GCQUIZ_STATE_4_UNKNOWN, //80319B78
|
||||
GCQUIZ_STATE_5_UNKNOWN, //80319B78
|
||||
GCQUIZ_STATE_6_SELECT_QUIZ_ANSWER, //80319B84
|
||||
GCQUIZ_STATE_7_CHECK_GIVEN_ANSWER, //80319C0C
|
||||
GCQUIZ_STATE_8_UNKNOWN, //80319CFC
|
||||
GCQUIZ_STATE_9_UNKNOWN, //80319D6C
|
||||
GCQUIZ_STATE_A_UNKNOWN //80319D80
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
u8 cmd;
|
||||
u8 string_size;
|
||||
//u8 str[];
|
||||
}StringBin;
|
||||
} StringBin_Unused;
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
}QuizQuestionBin_Struct_1;
|
||||
} QuizQuestionBin_Unused;
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
}QuizQuestionBin;
|
||||
} QuizQuestionBin;
|
||||
|
||||
typedef struct{
|
||||
s32 unk0[4][4];
|
||||
}Struct_Core2_91E10_1;
|
||||
s32 answer_options[4][4]; // first dimension = zoombox index, second dimension = value (0-3), third dimension = answer
|
||||
} QuizQuestionStruct;
|
||||
|
||||
typedef struct {
|
||||
s8 unk0; //question_type
|
||||
s8 unk1; //question_indx
|
||||
s8 unk2;
|
||||
u8 unk3;
|
||||
s32 unk4;
|
||||
void (*unk8)(s32, s32);
|
||||
s8 question_type; // enum ff_question_type_e
|
||||
s8 question_index;
|
||||
s8 unk2; // always -1?
|
||||
u8 quiz_question_time; // is either 0 or 10 (from __code5ED0_getQuizQuestionTime)
|
||||
s32 unk4; // always 0
|
||||
void (*unk8)(s32, s8); // gets called with unk4 and unk11
|
||||
QuizQuestionBin *unkC; //asset_bin
|
||||
u8 unk10; //state
|
||||
u8 state;
|
||||
s8 unk11;
|
||||
s8 unk12;
|
||||
u8 unk13; //selected_box_indx
|
||||
u8 unk14;
|
||||
u8 unk15; //cursor_cooldown
|
||||
u8 unk16;
|
||||
u8 unk17;
|
||||
u8 unk18[4];
|
||||
s8 unk1C[4];
|
||||
s8 unk20[4]; //portrait_id
|
||||
GcZoombox *unk24[4]; //zoombox
|
||||
Struct_Core2_91E10_1 unk34;
|
||||
}Struct_Core2_91E10;
|
||||
s8 selected_answer_index;
|
||||
u8 answer_cursor_index;
|
||||
u8 unk14; // relevant for state = 9, from 0 to 4?
|
||||
u8 answer_cursor_cooldown;
|
||||
u8 unk16; // some value for zoombox (gczoombox_func_803184C8)
|
||||
u8 unk17; // some value for zoombox (gczoombox_func_803184C8)
|
||||
u8 answer_str_counts[4];
|
||||
s8 answer_values[4];
|
||||
s8 portait_ids[4];
|
||||
GcZoombox *zoomboxes[4];
|
||||
QuizQuestionStruct quiz_question;
|
||||
} Struct_Core2_91E10;
|
||||
|
||||
void func_803197AC(s32 arg0);
|
||||
void func_80319E20(s32 arg0, s32 arg1);
|
||||
void func_8031A3E4(void);
|
||||
static void __gcquiz_advanceStateTo(enum gcquiz_state state);
|
||||
static void __gcquiz_func_80319E20(s32 portrait_id, s32 state);
|
||||
static void __gcquiz_closeZoomboxes(void);
|
||||
|
||||
u8 D_8036D940[] = {
|
||||
0,
|
||||
#define SELECTABLE_PORTAIT_COUNT 0x2C
|
||||
|
||||
static u8 sPortraits[SELECTABLE_PORTAIT_COUNT+1] = {
|
||||
NULL,
|
||||
ZOOMBOX_SPRITE_11_CHIMPY,
|
||||
ZOOMBOX_SPRITE_12_CONGA,
|
||||
ZOOMBOX_SPRITE_13_BLUBBER,
|
||||
@ -105,57 +119,59 @@ u8 D_8036D940[] = {
|
||||
};
|
||||
|
||||
/* .bss */
|
||||
Struct_Core2_91E10 *D_803830E0;
|
||||
Struct_Core2_91E10 *sD_803830E0;
|
||||
|
||||
/* .code */
|
||||
void func_80318DA0(s8 *ptr, u8 min_indx, u8 max_indx, s32 min_value, s32 max_value){
|
||||
static void __gcquiz_uniquelyRandomizeValuesInPointer(s8 *ptr, u8 min_index, u8 max_index, s32 min_value, s32 max_value){
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 unique;
|
||||
bool is_unique;
|
||||
|
||||
for(i = min_indx; i <= max_indx; i++){
|
||||
/* assign unique random value*/
|
||||
do{
|
||||
/*assign random value */
|
||||
ptr[i] = randi2(min_value, max_value + 1);
|
||||
unique = TRUE;
|
||||
/* test uniqueness */
|
||||
for(j = min_indx; j < i; j++){
|
||||
if (ptr[i] == ptr[j]) {
|
||||
unique = FALSE;
|
||||
break;
|
||||
}
|
||||
for (i = min_index; i <= max_index; i++){
|
||||
/* assign is_unique random value*/
|
||||
do {
|
||||
/*assign random value */
|
||||
ptr[i] = randi2(min_value, max_value + 1);
|
||||
is_unique = TRUE;
|
||||
/* test uniqueness */
|
||||
for(j = min_index; j < i; j++){
|
||||
if (ptr[i] == ptr[j]) {
|
||||
is_unique = FALSE;
|
||||
break;
|
||||
}
|
||||
}while(unique == FALSE);
|
||||
}
|
||||
} while(is_unique == FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80318E90(void) {
|
||||
D_803830E0->unk20[0] = 0;
|
||||
func_80318DA0(D_803830E0->unk20, 1, 3, 1, 0x2C);
|
||||
static void __gcquiz_randomizePortaitIds(void) {
|
||||
sD_803830E0->portait_ids[0] = 0;
|
||||
__gcquiz_uniquelyRandomizeValuesInPointer(sD_803830E0->portait_ids, 1, 3, 1, SELECTABLE_PORTAIT_COUNT);
|
||||
}
|
||||
|
||||
//__gcquiz_get_type_start_id
|
||||
enum asset_e func_80318ED8(enum ff_question_type_e question_type){
|
||||
switch(question_type){
|
||||
case FFQT_1_PICTURE: return 0x12DB;
|
||||
case FFQT_2_SOUND: return 0x13A3;
|
||||
case FFQT_3_GRUNTY: return 0x1407;
|
||||
static enum asset_e __gcquiz_get_type_start_id(enum ff_question_type_e question_type) {
|
||||
switch(question_type) {
|
||||
case FFQT_1_PICTURE: return ASSET_12DB_FF_PICTURE_QUESTION;
|
||||
case FFQT_2_SOUND: return ASSET_13A3_FF_SOUND_QUESTION;
|
||||
case FFQT_3_GRUNTY: return ASSET_1407_FF_GRUNTY_QUESTION;
|
||||
}
|
||||
return 0x1213;
|
||||
|
||||
return ASSET_1213_FF_QUIZ_QUESTION;
|
||||
}
|
||||
|
||||
//__gcquiz_get_type_end_id
|
||||
enum asset_e func_80318F1C(enum ff_question_type_e question_type){
|
||||
switch(question_type){
|
||||
case FFQT_1_PICTURE: return 0x12EE;
|
||||
case FFQT_2_SOUND: return 0x13D6;
|
||||
case FFQT_3_GRUNTY: return 0x1425;
|
||||
static enum asset_e __gcquiz_get_type_end_id(enum ff_question_type_e question_type){
|
||||
switch(question_type) {
|
||||
case FFQT_1_PICTURE: return ASSET_12ED_FF_PICTURE_QUESTION + 1;
|
||||
case FFQT_2_SOUND: return ASSET_13D5_FF_SOUND_QUESTION + 1;
|
||||
case FFQT_3_GRUNTY: return ASSET_1424_FF_GRUNTY_QUESTION + 1;
|
||||
}
|
||||
return 0x1277;
|
||||
|
||||
return ASSET_1276_FF_QUIZ_QUESTION + 1;
|
||||
}
|
||||
|
||||
s32 func_80318F60(enum ff_question_type_e question_type, s32 q_indx, s32 arg2) {
|
||||
|
||||
// get correct question index?
|
||||
static s32 __gcquiz_func_80318F60(enum ff_question_type_e question_type, s32 q_index, s32 arg2) {
|
||||
s32 phi_v1;
|
||||
s32 phi_a0;
|
||||
|
||||
@ -163,7 +179,7 @@ s32 func_80318F60(enum ff_question_type_e question_type, s32 q_indx, s32 arg2) {
|
||||
phi_v1 = arg2;
|
||||
} else {
|
||||
if (question_type == FFQT_3_GRUNTY) {
|
||||
phi_a0 = volatileFlag_getN((q_indx * 2) + VOLATILE_FLAG_26_FF_GRUNTY_QUESTIONS, 2);
|
||||
phi_a0 = volatileFlag_getN((q_index * 2) + VOLATILE_FLAG_26_FF_GRUNTY_QUESTIONS, 2);
|
||||
} else {
|
||||
phi_a0 = 0;
|
||||
}
|
||||
@ -172,285 +188,287 @@ s32 func_80318F60(enum ff_question_type_e question_type, s32 q_indx, s32 arg2) {
|
||||
return phi_v1;
|
||||
}
|
||||
|
||||
bool func_80318FB4(enum ff_question_type_e question_type){
|
||||
static bool __gcquiz_isSoundQuestion(enum ff_question_type_e question_type){
|
||||
return question_type == FFQT_2_SOUND;
|
||||
}
|
||||
|
||||
s32 func_80318FC0(s32 arg0){
|
||||
switch(arg0){
|
||||
static s32 __gcquiz_getZoomboxY(s32 arg0){
|
||||
switch(arg0) {
|
||||
case 1: return 40;
|
||||
case 2: return 80;
|
||||
case 3: return 120;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80319004(s32 arg0){
|
||||
static s32 __gcquiz_func_80319004(s32 arg0){
|
||||
return arg0 == 0 ? 3 : 2;
|
||||
}
|
||||
|
||||
s32 func_8031901C(s32 arg0){
|
||||
static s32 __gcquiz_return0(s32 arg0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool func_80319028(s32 arg0){
|
||||
static bool __gcquiz_isZero(s32 arg0){
|
||||
return arg0 != 0 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
//__gcquiz_animation_duration
|
||||
f32 func_80319040(s32 arg0){
|
||||
static f32 __gcquiz_animation_duration(s32 arg0){
|
||||
return 0.4f;
|
||||
}
|
||||
|
||||
void func_80319050(void) {
|
||||
void gcquiz_init() {
|
||||
s32 i;
|
||||
|
||||
D_803830E0 = malloc(0x74);
|
||||
D_803830E0->unkC = malloc(0x400);
|
||||
D_803830E0->unk16 = 0x14U;
|
||||
D_803830E0->unk17 = 0x1E;
|
||||
D_803830E0->unk20[0] = 0;
|
||||
D_803830E0->unk24[0] = gczoombox_new(func_80318FC0(0), 0, func_80319004(0), func_8031901C(0), func_80319E20);
|
||||
func_803184C8(D_803830E0->unk24[0], (f32)D_803830E0->unk16, 5, 2, func_80319040(0), func_80319028(0), 0);
|
||||
sD_803830E0 = malloc(sizeof(Struct_Core2_91E10));
|
||||
sD_803830E0->unkC = malloc(0x400);
|
||||
sD_803830E0->unk16 = 0x14U;
|
||||
sD_803830E0->unk17 = 0x1E;
|
||||
sD_803830E0->portait_ids[0] = 0;
|
||||
sD_803830E0->zoomboxes[0] = gczoombox_new(__gcquiz_getZoomboxY(0), 0, __gcquiz_func_80319004(0), __gcquiz_return0(0), __gcquiz_func_80319E20);
|
||||
gczoombox_func_803184C8(sD_803830E0->zoomboxes[0], (f32)sD_803830E0->unk16, 5, 2, __gcquiz_animation_duration(0), __gcquiz_isZero(0), 0);
|
||||
for(i = 1; i < 4; i++){
|
||||
D_803830E0->unk20[i] = 0;
|
||||
D_803830E0->unk24[i] = NULL;
|
||||
sD_803830E0->portait_ids[i] = 0;
|
||||
sD_803830E0->zoomboxes[i] = NULL;
|
||||
}
|
||||
func_803197AC(0);
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_0_INITIAL);
|
||||
}
|
||||
|
||||
void func_80319190(void) {
|
||||
void gcquiz_free() {
|
||||
s32 i;
|
||||
|
||||
if (D_803830E0 != NULL) {
|
||||
free(D_803830E0->unkC);
|
||||
D_803830E0->unkC = NULL;
|
||||
if (sD_803830E0 != NULL) {
|
||||
free(sD_803830E0->unkC);
|
||||
sD_803830E0->unkC = NULL;
|
||||
for(i = 0; i < 4; i++){
|
||||
gczoombox_free(D_803830E0->unk24[i]);
|
||||
D_803830E0->unk24[i] = NULL;
|
||||
gczoombox_free(sD_803830E0->zoomboxes[i]);
|
||||
sD_803830E0->zoomboxes[i] = NULL;
|
||||
}
|
||||
free(D_803830E0);
|
||||
D_803830E0 = NULL;
|
||||
free(sD_803830E0);
|
||||
sD_803830E0 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80319214(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
|
||||
void gcquiz_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
|
||||
s32 i;
|
||||
|
||||
if (D_803830E0 != NULL) {
|
||||
if (sD_803830E0 != NULL) {
|
||||
for(i = 0; i < 4; i++){
|
||||
gczoombox_draw(D_803830E0->unk24[i], gfx, mtx, vtx);
|
||||
gczoombox_draw(sD_803830E0->zoomboxes[i], gfx, mtx, vtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool func_803192A4(enum ff_question_type_e q_type, s32 q_indx, s32 arg2) {
|
||||
//#define NEXT(iter) (*(((char *)(iter))++))
|
||||
//#define SKIP(iter,n) (((char *)(iter)) += (n))
|
||||
// randomize quiz question?
|
||||
static bool __gcquiz_func_803192A4(enum ff_question_type_e q_type, s32 q_index, s32 arg2) {
|
||||
char *char_iter;
|
||||
s32 temp_s0;
|
||||
enum asset_e quiz_question_index;
|
||||
s32 temp_s2;
|
||||
s32 str_cnt;
|
||||
s32 phi_v1;
|
||||
s32 sp60;
|
||||
s32 zoombox_text_index;
|
||||
s32 phi_a1;
|
||||
s32 sp58;
|
||||
s32 sp54;
|
||||
s32 sp50;
|
||||
s32 sp4C;
|
||||
s32 sp48;
|
||||
s32 sp44;
|
||||
s32 temp_v0_3;
|
||||
s32 str_size;
|
||||
s32 quiz_question_bin_unk0;
|
||||
s32 quiz_question_bin_unk1;
|
||||
s32 quiz_question_bin_unk2;
|
||||
s32 first_answer_cmd;
|
||||
s32 second_answer_cmd;
|
||||
s32 third_answer_cmd;
|
||||
s32 cmd;
|
||||
s32 option_text;
|
||||
|
||||
temp_s0 = func_80318ED8(q_type) + q_indx;
|
||||
if (func_8031A3BC()) {
|
||||
return 0;
|
||||
quiz_question_index = __gcquiz_get_type_start_id(q_type) + q_index;
|
||||
if (gcquiz_isNotInInitialState()) {
|
||||
return FALSE;
|
||||
}
|
||||
if (func_8033BDAC(temp_s0, D_803830E0->unkC, 0x400) == 0) {
|
||||
free(D_803830E0->unkC);
|
||||
D_803830E0->unkC = (QuizQuestionBin *) assetcache_get(temp_s0);
|
||||
|
||||
// not in asset cache?
|
||||
if (code_B3A80_func_8033BDAC(quiz_question_index, sD_803830E0->unkC, 0x400) == 0) {
|
||||
free(sD_803830E0->unkC);
|
||||
sD_803830E0->unkC = (QuizQuestionBin *) assetcache_get(quiz_question_index);
|
||||
}
|
||||
char_iter = D_803830E0->unkC;
|
||||
sp58 = *(char_iter++); // NEXT
|
||||
sp54 = *(char_iter++); // NEXT
|
||||
sp50 = *(char_iter++); // NEXT
|
||||
sp4C = ((sp54 >= 2) ? func_80318F60(q_type, q_indx, arg2) : 0) + 1;
|
||||
if (((sp50 == 0) || (func_80318FB4(q_type) != 0)) != 0) {
|
||||
|
||||
char_iter = sD_803830E0->unkC;
|
||||
quiz_question_bin_unk0 = *(char_iter++); // NEXT
|
||||
quiz_question_bin_unk1 = *(char_iter++); // NEXT
|
||||
quiz_question_bin_unk2 = *(char_iter++); // NEXT
|
||||
first_answer_cmd = ((quiz_question_bin_unk1 >= 2) ? __gcquiz_func_80318F60(q_type, q_index, arg2) : 0) + 1;
|
||||
// is sound question or quiz_question_bin_unk2 == 0
|
||||
if (((quiz_question_bin_unk2 == 0) || (__gcquiz_isSoundQuestion(q_type) != FALSE)) != FALSE) {
|
||||
do {
|
||||
sp48 = randi2(0, sp54 + sp50) + 1;
|
||||
} while (sp48 == sp4C);
|
||||
second_answer_cmd = randi2(0, quiz_question_bin_unk1 + quiz_question_bin_unk2) + 1;
|
||||
} while (second_answer_cmd == first_answer_cmd);
|
||||
do {
|
||||
sp44 = randi2(0, sp54 + sp50) + 1;
|
||||
} while (sp44 == sp4C || sp44 == sp48);
|
||||
third_answer_cmd = randi2(0, quiz_question_bin_unk1 + quiz_question_bin_unk2) + 1;
|
||||
} while (third_answer_cmd == first_answer_cmd || third_answer_cmd == second_answer_cmd);
|
||||
} else {
|
||||
sp48 = randi2(0, sp50) + sp54 + 1;
|
||||
second_answer_cmd = randi2(0, quiz_question_bin_unk2) + quiz_question_bin_unk1 + 1;
|
||||
do {
|
||||
sp44 = randi2(0, sp50) + sp54 + 1;
|
||||
} while (sp44 == sp48);
|
||||
third_answer_cmd = randi2(0, quiz_question_bin_unk2) + quiz_question_bin_unk1 + 1;
|
||||
} while (third_answer_cmd == second_answer_cmd);
|
||||
}
|
||||
|
||||
char_iter += 2*func_8031B5B0(); // SKIP
|
||||
char_iter += 2*code94620_func_8031B5B0(); // SKIP
|
||||
phi_v1 = *(char_iter++); // NEXT
|
||||
phi_v1 += (*(char_iter++) << 8);
|
||||
char_iter = (s32)D_803830E0->unkC + phi_v1;
|
||||
str_cnt = *(char_iter++); // NEXT
|
||||
char_iter = (s32)sD_803830E0->unkC + phi_v1;
|
||||
str_cnt = *(char_iter++); // NEXT char_iter = 5
|
||||
|
||||
for(phi_a1 = 0; phi_a1 < 4; phi_a1++){
|
||||
D_803830E0->unk18[phi_a1] = 0;
|
||||
sD_803830E0->answer_str_counts[phi_a1] = 0;
|
||||
}
|
||||
|
||||
|
||||
for(phi_a1 = 0; phi_a1 < str_cnt; phi_a1++){
|
||||
temp_v0_3 = *(char_iter++); // NEXT
|
||||
str_size = *(char_iter++); // NEXT
|
||||
temp_v0_3 -= 0x80;
|
||||
|
||||
// cmd = 0x80 - 0x83
|
||||
cmd = *(char_iter++); // NEXT char_iter = 6
|
||||
option_text = *(char_iter++); // NEXT char_iter = 7
|
||||
cmd -= 0x80;
|
||||
|
||||
if ((temp_v0_3 == 0) || (temp_v0_3 == sp4C) || (temp_v0_3 == sp48) || (temp_v0_3 == sp44)) {
|
||||
if (temp_v0_3 == 0) {
|
||||
sp60 = 0;
|
||||
} else if (temp_v0_3 == sp4C) {
|
||||
sp60 = 1;
|
||||
} else if (temp_v0_3 == sp48) {
|
||||
sp60 = 2;
|
||||
} else if (temp_v0_3 == sp44) {
|
||||
sp60 = 3;
|
||||
if ((cmd == 0) || (cmd == first_answer_cmd) || (cmd == second_answer_cmd) || (cmd == third_answer_cmd)) {
|
||||
if (cmd == 0) { // grunty
|
||||
zoombox_text_index = 0;
|
||||
} else if (cmd == first_answer_cmd) { // first answer
|
||||
zoombox_text_index = 1;
|
||||
} else if (cmd == second_answer_cmd) { // second answer
|
||||
zoombox_text_index = 2;
|
||||
} else if (cmd == third_answer_cmd) { // third answer
|
||||
zoombox_text_index = 3;
|
||||
} else{
|
||||
sp60 = sp60;
|
||||
zoombox_text_index = zoombox_text_index;
|
||||
}
|
||||
|
||||
D_803830E0->unk34.unk0[sp60][D_803830E0->unk18[sp60]++] = char_iter;
|
||||
sD_803830E0->quiz_question.answer_options[zoombox_text_index][sD_803830E0->answer_str_counts[zoombox_text_index]++] = char_iter;
|
||||
}
|
||||
char_iter += str_size; // SKIP
|
||||
char_iter += option_text; // SKIP
|
||||
}
|
||||
//#undef NEXT
|
||||
//#undef SKIP
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void func_803196D0(s32 arg0) {
|
||||
gczoombox_open(D_803830E0->unk24[arg0]);
|
||||
gczoombox_maximize(D_803830E0->unk24[arg0]);
|
||||
gczoombox_setStrings(D_803830E0->unk24[arg0], D_803830E0->unk18[D_803830E0->unk1C[arg0]], D_803830E0->unk34.unk0[D_803830E0->unk1C[arg0]]);
|
||||
void __gcquiz_openZoomboxAndMaximizeWithStringsAt(s32 zoombox_index) {
|
||||
gczoombox_open(sD_803830E0->zoomboxes[zoombox_index]);
|
||||
gczoombox_maximize(sD_803830E0->zoomboxes[zoombox_index]);
|
||||
gczoombox_setStrings(
|
||||
sD_803830E0->zoomboxes[zoombox_index],
|
||||
sD_803830E0->answer_str_counts[sD_803830E0->answer_values[zoombox_index]],
|
||||
sD_803830E0->quiz_question.answer_options[sD_803830E0->answer_values[zoombox_index]]
|
||||
);
|
||||
}
|
||||
|
||||
//__gcquiz_set_box_highlight
|
||||
void func_80319758(s32 indx, bool arg1){
|
||||
gczoombox_highlight(D_803830E0->unk24[indx], arg1);
|
||||
func_80318C48(D_803830E0->unk24[indx], arg1);
|
||||
void __gcquiz_set_box_highlight(s32 index, bool arg1){
|
||||
gczoombox_highlight(sD_803830E0->zoomboxes[index], arg1);
|
||||
gczoombox_func_80318C48(sD_803830E0->zoomboxes[index], arg1);
|
||||
}
|
||||
|
||||
void func_803197AC(s32 arg0){
|
||||
static void __gcquiz_advanceStateTo(enum gcquiz_state state){
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
switch(arg0){
|
||||
case 0: //803197F0
|
||||
D_803830E0->unk0 = 0;
|
||||
D_803830E0->unk1 = 0;
|
||||
D_803830E0->unk3 = 0;
|
||||
D_803830E0->unk8 = 0;
|
||||
D_803830E0->unk12 = -1;
|
||||
D_803830E0->unk14 = 0;
|
||||
D_803830E0->unk11 = -2;
|
||||
func_803184C8(D_803830E0->unk24[0], (f32) D_803830E0->unk16, 5, 2, func_80319040(0), func_80319028(0), 0);
|
||||
func_80318774(D_803830E0->unk24[0]);
|
||||
gczoombox_highlight(D_803830E0->unk24[0], 1);
|
||||
switch(state){
|
||||
case GCQUIZ_STATE_0_INITIAL:
|
||||
sD_803830E0->question_type = 0;
|
||||
sD_803830E0->question_index = 0;
|
||||
sD_803830E0->quiz_question_time = 0;
|
||||
sD_803830E0->unk8 = NULL;
|
||||
sD_803830E0->selected_answer_index = -1;
|
||||
sD_803830E0->unk14 = 0;
|
||||
sD_803830E0->unk11 = -2;
|
||||
gczoombox_func_803184C8(sD_803830E0->zoomboxes[0], (f32) sD_803830E0->unk16, 5, 2, __gcquiz_animation_duration(0), __gcquiz_isZero(0), 0);
|
||||
gczoombox_setUnk13ATo0(sD_803830E0->zoomboxes[0]);
|
||||
gczoombox_highlight(sD_803830E0->zoomboxes[0], TRUE);
|
||||
for(i = 0; i < 4; i++){
|
||||
D_803830E0->unk1C[i] = -1;
|
||||
sD_803830E0->answer_values[i] = -1;
|
||||
for(j = 0; j < 4; j++){
|
||||
D_803830E0->unk34.unk0[i][j] = 0;
|
||||
sD_803830E0->quiz_question.answer_options[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: //80319910
|
||||
gczoombox_open(D_803830E0->unk24[0]);
|
||||
gczoombox_maximize(D_803830E0->unk24[0]);
|
||||
gczoombox_setStrings(D_803830E0->unk24[0], D_803830E0->unk18[0], D_803830E0->unk34.unk0[0]);
|
||||
case GCQUIZ_STATE_1_SHOW_QUESTION_VIA_ZOOMBOX:
|
||||
gczoombox_open(sD_803830E0->zoomboxes[0]);
|
||||
gczoombox_maximize(sD_803830E0->zoomboxes[0]);
|
||||
gczoombox_setStrings(sD_803830E0->zoomboxes[0], sD_803830E0->answer_str_counts[0], sD_803830E0->quiz_question.answer_options[0]);
|
||||
break;
|
||||
|
||||
case 2: //8031994C
|
||||
if (D_803830E0->unk0 != -1) {
|
||||
func_80318E90();
|
||||
case GCQUIZ_STATE_2_SHOW_PORTRAITS_FOR_QUESTION:
|
||||
if (sD_803830E0->question_type != -1) {
|
||||
__gcquiz_randomizePortaitIds();
|
||||
for(i = 1; i < 4; i++){
|
||||
D_803830E0->unk24[i] = gczoombox_new(func_80318FC0(i), D_8036D940[D_803830E0->unk20[i]], func_80319004(i), func_8031901C(i), func_80319E20);
|
||||
func_803184C8(D_803830E0->unk24[i], (f32)D_803830E0->unk17, 5, 2, func_80319040(i), func_80319028(i), 0);
|
||||
sD_803830E0->zoomboxes[i] = gczoombox_new(__gcquiz_getZoomboxY(i), sPortraits[sD_803830E0->portait_ids[i]], __gcquiz_func_80319004(i), __gcquiz_return0(i), __gcquiz_func_80319E20);
|
||||
gczoombox_func_803184C8(sD_803830E0->zoomboxes[i], (f32)sD_803830E0->unk17, 5, 2, __gcquiz_animation_duration(i), __gcquiz_isZero(i), 0);
|
||||
}
|
||||
} else {
|
||||
for(i = 1; i < 4; i++){
|
||||
D_803830E0->unk24[i] = gczoombox_new(func_80318FC0(i), D_803830E0->unk20[i], 1, func_8031901C(i), func_80319E20);
|
||||
func_803184C8(D_803830E0->unk24[i], (f32)D_803830E0->unk17, 5, 2, func_80319040(i), func_80319028(i), 0);
|
||||
sD_803830E0->zoomboxes[i] = gczoombox_new(__gcquiz_getZoomboxY(i), sD_803830E0->portait_ids[i], 1, __gcquiz_return0(i), __gcquiz_func_80319E20);
|
||||
gczoombox_func_803184C8(sD_803830E0->zoomboxes[i], (f32)sD_803830E0->unk17, 5, 2, __gcquiz_animation_duration(i), __gcquiz_isZero(i), 0);
|
||||
}
|
||||
}
|
||||
timedFunc_set_1(0.0f, func_803197AC, 3);
|
||||
timedFunc_set_1(0.0f, func_803196D0, 1);
|
||||
timedFunc_set_1(0.2f, func_803196D0, 2);
|
||||
timedFunc_set_1(0.4f, func_803196D0, 3);
|
||||
timedFunc_set_1(0.0f, __gcquiz_advanceStateTo, GCQUIZ_STATE_3_UNKNOWN);
|
||||
timedFunc_set_1(0.0f, __gcquiz_openZoomboxAndMaximizeWithStringsAt, 1);
|
||||
timedFunc_set_1(0.2f, __gcquiz_openZoomboxAndMaximizeWithStringsAt, 2);
|
||||
timedFunc_set_1(0.4f, __gcquiz_openZoomboxAndMaximizeWithStringsAt, 3);
|
||||
break;
|
||||
|
||||
case 3: //80319B78
|
||||
case 4: //80319B78
|
||||
case 5: //80319B78
|
||||
if(1){}
|
||||
case GCQUIZ_STATE_3_UNKNOWN:
|
||||
case GCQUIZ_STATE_4_UNKNOWN:
|
||||
case GCQUIZ_STATE_5_UNKNOWN:
|
||||
break;
|
||||
|
||||
case 6: //80319B84
|
||||
item_set(ITEM_0_HOURGLASS_TIMER, D_803830E0->unk3 * 60 - 1);
|
||||
case GCQUIZ_STATE_6_SELECT_QUIZ_ANSWER:
|
||||
item_set(ITEM_0_HOURGLASS_TIMER, sD_803830E0->quiz_question_time * 60 - 1);
|
||||
item_set(ITEM_6_HOURGLASS, TRUE);
|
||||
D_803830E0->unk15 = 0;
|
||||
D_803830E0->unk13 = 1U;
|
||||
sD_803830E0->answer_cursor_cooldown = 0;
|
||||
sD_803830E0->answer_cursor_index = 1U;
|
||||
|
||||
for (i = 1; i < 4; i++) {
|
||||
func_80319758(i, BOOL(i == D_803830E0->unk13));
|
||||
__gcquiz_set_box_highlight(i, BOOL(i == sD_803830E0->answer_cursor_index));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 7: //80319C0C
|
||||
if (D_803830E0->unk0 != -1) {
|
||||
D_803830E0->unk11 = (D_803830E0->unk12 == -1) ? -1
|
||||
: (D_803830E0->unk1C[D_803830E0->unk12] == 1) ? 1
|
||||
case GCQUIZ_STATE_7_CHECK_GIVEN_ANSWER:
|
||||
if (sD_803830E0->question_type != -1) {
|
||||
sD_803830E0->unk11 = (sD_803830E0->selected_answer_index == -1) ? -1
|
||||
: (sD_803830E0->answer_values[sD_803830E0->selected_answer_index] == 1) ? 1
|
||||
: 0;
|
||||
} else {
|
||||
D_803830E0->unk11 = (s8) D_803830E0->unk12;
|
||||
sD_803830E0->unk11 = (s8) sD_803830E0->selected_answer_index;
|
||||
}
|
||||
if (D_803830E0->unk12 != -1) {
|
||||
if (sD_803830E0->selected_answer_index != -1) {
|
||||
for(i = 1; i < 4; i++){
|
||||
if (i != D_803830E0->unk12) {
|
||||
gczoombox_minimize(D_803830E0->unk24[i]);
|
||||
gczoombox_close(D_803830E0->unk24[i]);
|
||||
if (i != sD_803830E0->selected_answer_index) {
|
||||
gczoombox_minimize(sD_803830E0->zoomboxes[i]);
|
||||
gczoombox_close(sD_803830E0->zoomboxes[i]);
|
||||
} else {
|
||||
func_80318C48(D_803830E0->unk24[i], 0);
|
||||
gczoombox_func_80318C48(sD_803830E0->zoomboxes[i], FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
timedFunc_set_1(1.0f, func_803197AC, 8);
|
||||
timedFunc_set_1(1.0f, __gcquiz_advanceStateTo, GCQUIZ_STATE_8_UNKNOWN);
|
||||
item_set(ITEM_6_HOURGLASS, FALSE);
|
||||
break;
|
||||
|
||||
case 8: //80319CFC
|
||||
if (D_803830E0->unk0 != -1) {
|
||||
comusic_playTrack((D_803830E0->unk11 == 1)? COMUSIC_2B_DING_B : COMUSIC_2C_BUZZER);
|
||||
case GCQUIZ_STATE_8_UNKNOWN:
|
||||
if (sD_803830E0->question_type != -1) {
|
||||
comusic_playTrack((sD_803830E0->unk11 == 1)? COMUSIC_2B_DING_B : COMUSIC_2C_BUZZER);
|
||||
} else {
|
||||
comusic_playTrack(COMUSIC_2B_DING_B);
|
||||
}
|
||||
timedFunc_set_1(1.0f, func_803197AC, 9);
|
||||
timedFunc_set_1(1.0f, __gcquiz_advanceStateTo, GCQUIZ_STATE_9_UNKNOWN);
|
||||
break;
|
||||
|
||||
case 9: //80319D6C
|
||||
func_8031A3E4();
|
||||
case GCQUIZ_STATE_9_UNKNOWN:
|
||||
__gcquiz_closeZoomboxes();
|
||||
break;
|
||||
|
||||
case 10: //80319D80
|
||||
if (D_803830E0->unk8 != NULL) {
|
||||
D_803830E0->unk8(D_803830E0->unk4, D_803830E0->unk11);
|
||||
case GCQUIZ_STATE_A_UNKNOWN:
|
||||
if (sD_803830E0->unk8 != NULL) {
|
||||
sD_803830E0->unk8(sD_803830E0->unk4, sD_803830E0->unk11);
|
||||
}
|
||||
for(i = 1; i < 4; i++){
|
||||
gczoombox_free(D_803830E0->unk24[i]);
|
||||
D_803830E0->unk24[i] = NULL;
|
||||
gczoombox_free(sD_803830E0->zoomboxes[i]);
|
||||
sD_803830E0->zoomboxes[i] = NULL;
|
||||
}
|
||||
func_8025A55C(-1, 500, 10);
|
||||
break;
|
||||
@ -458,109 +476,112 @@ void func_803197AC(s32 arg0){
|
||||
default:
|
||||
break;
|
||||
}
|
||||
D_803830E0->unk10 = arg0;
|
||||
sD_803830E0->state = state;
|
||||
}
|
||||
|
||||
void func_80319E20(s32 arg0, s32 arg1) {
|
||||
if (arg1 == 3) {
|
||||
if (arg0 == D_803830E0->unk20[0]) {
|
||||
if (D_803830E0->unk8 != NULL) {
|
||||
D_803830E0->unk8(D_803830E0->unk4, D_803830E0->unk11);
|
||||
void __gcquiz_func_80319E20(s32 portrait_id, s32 zoombox_state) {
|
||||
if (zoombox_state == 3) {
|
||||
if (portrait_id == sD_803830E0->portait_ids[0]) {
|
||||
if (sD_803830E0->unk8 != NULL) {
|
||||
sD_803830E0->unk8(sD_803830E0->unk4, sD_803830E0->unk11);
|
||||
}
|
||||
} else {
|
||||
func_803197AC(D_803830E0->unk10 + 1);
|
||||
__gcquiz_advanceStateTo(sD_803830E0->state + 1);
|
||||
}
|
||||
} else if (arg1 == 5) {
|
||||
D_803830E0->unk14++;
|
||||
} else if (zoombox_state == 5) {
|
||||
sD_803830E0->unk14++;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80319EA4(void) {
|
||||
s32 sp58[6];
|
||||
f32 sp4C[3];
|
||||
// handle selection in zoombox?
|
||||
void gcquiz_func_80319EA4(void) {
|
||||
s32 face_button_states[6];
|
||||
f32 joystick_states[3];
|
||||
s32 phi_s0;
|
||||
f32 sp44;
|
||||
|
||||
if(getGameMode() != GAME_MODE_3_NORMAL && func_802E4A08() == 0)
|
||||
if(getGameMode() != GAME_MODE_3_NORMAL && func_802E4A08() == FALSE)
|
||||
return;
|
||||
|
||||
if(D_803830E0 == NULL)
|
||||
if(sD_803830E0 == NULL)
|
||||
return;
|
||||
|
||||
pfsManager_getControllerFaceButtonState(0, sp58);
|
||||
controller_getJoystick(0, sp4C);
|
||||
controller_copyFaceButtons(0, face_button_states);
|
||||
controller_getJoystick(0, joystick_states);
|
||||
for(phi_s0 = 0; phi_s0 < 4; phi_s0++){
|
||||
gczoombox_update(D_803830E0->unk24[phi_s0]);
|
||||
gczoombox_update(sD_803830E0->zoomboxes[phi_s0]);
|
||||
}
|
||||
|
||||
switch (D_803830E0->unk10) {
|
||||
case 1:
|
||||
if (func_8028EFC8() && (sp58[FACE_BUTTON(BUTTON_B)] == 1)) {
|
||||
sp44 = func_80319040(0);
|
||||
func_803184C8(D_803830E0->unk24[0], 100.0f, 2, 4, sp44, func_80319028(0), 0);
|
||||
switch (sD_803830E0->state) {
|
||||
case GCQUIZ_STATE_1_SHOW_QUESTION_VIA_ZOOMBOX:
|
||||
if (func_8028EFC8() && (face_button_states[FACE_BUTTON(BUTTON_B)] == 1)) {
|
||||
sp44 = __gcquiz_animation_duration(0);
|
||||
gczoombox_func_803184C8(sD_803830E0->zoomboxes[0], 100.0f, 2, 4, sp44, __gcquiz_isZero(0), 0);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (D_803830E0->unk15 > 0) {
|
||||
D_803830E0->unk15--;
|
||||
case GCQUIZ_STATE_6_SELECT_QUIZ_ANSWER:
|
||||
if (sD_803830E0->answer_cursor_cooldown > 0) {
|
||||
sD_803830E0->answer_cursor_cooldown--;
|
||||
} else {
|
||||
if (sp4C[1] > 0.75) {
|
||||
if (D_803830E0->unk13 >= 2) {
|
||||
func_80319758(D_803830E0->unk13, 0);
|
||||
D_803830E0->unk13--;
|
||||
func_80319758(D_803830E0->unk13, 1);
|
||||
func_803160A8(D_803830E0->unk24[D_803830E0->unk13]);
|
||||
D_803830E0->unk15 = 4U;
|
||||
if (joystick_states[1] > 0.75) {
|
||||
if (sD_803830E0->answer_cursor_index >= 2) {
|
||||
__gcquiz_set_box_highlight(sD_803830E0->answer_cursor_index, FALSE);
|
||||
sD_803830E0->answer_cursor_index--;
|
||||
__gcquiz_set_box_highlight(sD_803830E0->answer_cursor_index, TRUE);
|
||||
gczoombox_func_803160A8(sD_803830E0->zoomboxes[sD_803830E0->answer_cursor_index]);
|
||||
sD_803830E0->answer_cursor_cooldown = 4U;
|
||||
}
|
||||
} else if (sp4C[1] < -0.75) {
|
||||
if (D_803830E0->unk13 < 3) {
|
||||
func_80319758(D_803830E0->unk13, 0);
|
||||
D_803830E0->unk13++;
|
||||
func_80319758(D_803830E0->unk13, 1);
|
||||
func_803160A8(D_803830E0->unk24[D_803830E0->unk13]);
|
||||
D_803830E0->unk15 = 4U;
|
||||
} else if (joystick_states[1] < -0.75) {
|
||||
if (sD_803830E0->answer_cursor_index < 3) {
|
||||
__gcquiz_set_box_highlight(sD_803830E0->answer_cursor_index, FALSE);
|
||||
sD_803830E0->answer_cursor_index++;
|
||||
__gcquiz_set_box_highlight(sD_803830E0->answer_cursor_index, TRUE);
|
||||
gczoombox_func_803160A8(sD_803830E0->zoomboxes[sD_803830E0->answer_cursor_index]);
|
||||
sD_803830E0->answer_cursor_cooldown = 4U;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((sp58[FACE_BUTTON(BUTTON_A)] == 1) || (item_empty(ITEM_0_HOURGLASS_TIMER))) {
|
||||
D_803830E0->unk12 = (u8) D_803830E0->unk13;
|
||||
if ((face_button_states[FACE_BUTTON(BUTTON_A)] == 1) || (item_empty(ITEM_0_HOURGLASS_TIMER))) {
|
||||
sD_803830E0->selected_answer_index = (u8) sD_803830E0->answer_cursor_index;
|
||||
}
|
||||
if ((s8) D_803830E0->unk12 != -1) {
|
||||
func_803197AC(7);
|
||||
if ((s8) sD_803830E0->selected_answer_index != -1) {
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_7_CHECK_GIVEN_ANSWER);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (D_803830E0->unk14 == 4) {
|
||||
func_803197AC(0xA);
|
||||
case GCQUIZ_STATE_9_UNKNOWN:
|
||||
if (sD_803830E0->unk14 == 4) {
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_A_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
func_803197AC(0);
|
||||
case GCQUIZ_STATE_A_UNKNOWN:
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_0_INITIAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool func_8031A154(enum ff_question_type_e q_type, s32 q_indx, s32 arg2, s32 arg3, s32 arg4, void (*arg5)(s32, s32)) {
|
||||
if (func_803192A4(q_type, q_indx, arg2) != 0) {
|
||||
D_803830E0->unk0 = q_type;
|
||||
D_803830E0->unk1 = q_indx;
|
||||
D_803830E0->unk2 = arg2;
|
||||
D_803830E0->unk3 = arg3;
|
||||
D_803830E0->unk4 = arg4;
|
||||
D_803830E0->unk8 = arg5;
|
||||
bool gcquiz_func_8031A154(enum ff_question_type_e q_type, s32 q_index, s32 arg2, s32 arg3, s32 arg4, void (*arg5)(s32, s8)) {
|
||||
if (__gcquiz_func_803192A4(q_type, q_index, arg2) != FALSE) {
|
||||
sD_803830E0->question_type = q_type;
|
||||
sD_803830E0->question_index = q_index;
|
||||
sD_803830E0->unk2 = arg2;
|
||||
sD_803830E0->quiz_question_time = arg3;
|
||||
sD_803830E0->unk4 = arg4;
|
||||
sD_803830E0->unk8 = arg5;
|
||||
item_set(ITEM_6_HOURGLASS, FALSE);
|
||||
func_80318DA0(D_803830E0->unk1C, 1, 3, 1, 3);
|
||||
__gcquiz_uniquelyRandomizeValuesInPointer(sD_803830E0->answer_values, 1, 3, 1, 3);
|
||||
func_8025A55C(6000, 500, 10);
|
||||
func_803197AC(1);
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_1_SHOW_QUESTION_VIA_ZOOMBOX);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool func_8031A22C(u8 *arg0, s8 *arg1, Struct_Core2_91E10_1 *arg2, s32 arg3, void (*arg4)(s32, s32)) {
|
||||
// unused but making this static differs checksum
|
||||
bool __gcquiz_unused(u8 *arg0, s8 *arg1, QuizQuestionStruct *arg2, s32 arg3, void (*arg4)(s32, s8)) {
|
||||
s32 temp_v0;
|
||||
s8 *temp_a2;
|
||||
s8 *temp_s0;
|
||||
@ -574,81 +595,81 @@ bool func_8031A22C(u8 *arg0, s8 *arg1, Struct_Core2_91E10_1 *arg2, s32 arg3, voi
|
||||
s32 j;
|
||||
s8 *phi_s0;
|
||||
|
||||
if (func_8031A3BC()) {
|
||||
return 0;
|
||||
if (gcquiz_isNotInInitialState()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for(i = 0; i < 4; i++){
|
||||
D_803830E0->unk20[i] = arg0[i];
|
||||
D_803830E0->unk18[i] = arg1[i];
|
||||
sD_803830E0->portait_ids[i] = arg0[i];
|
||||
sD_803830E0->answer_str_counts[i] = arg1[i];
|
||||
for(j = 0; j < arg1[i]; j++){
|
||||
D_803830E0->unk34.unk0[i][j] = arg2->unk0[i][j];
|
||||
sD_803830E0->quiz_question.answer_options[i][j] = arg2->answer_options[i][j];
|
||||
}
|
||||
D_803830E0->unk1C[i] = i;
|
||||
sD_803830E0->answer_values[i] = i;
|
||||
}
|
||||
if (D_803830E0->unk20[0] != 0) {
|
||||
gczoombox_loadSprite(D_803830E0->unk24[0], D_803830E0->unk20[0]);
|
||||
if (sD_803830E0->portait_ids[0] != NULL) {
|
||||
gczoombox_loadSprite(sD_803830E0->zoomboxes[0], sD_803830E0->portait_ids[0]);
|
||||
}
|
||||
D_803830E0->unk0 = -1;
|
||||
D_803830E0->unk1 = -1;
|
||||
D_803830E0->unk2 = -1;
|
||||
D_803830E0->unk3 = (s8) arg3;
|
||||
D_803830E0->unk4 = 0;
|
||||
D_803830E0->unk8 = arg4;
|
||||
sD_803830E0->question_type = -1;
|
||||
sD_803830E0->question_index = -1;
|
||||
sD_803830E0->unk2 = -1;
|
||||
sD_803830E0->quiz_question_time = (s8) arg3;
|
||||
sD_803830E0->unk4 = 0;
|
||||
sD_803830E0->unk8 = arg4;
|
||||
func_8025A55C(6000, 500, 10);
|
||||
func_803197AC(1);
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_1_SHOW_QUESTION_VIA_ZOOMBOX);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void func_8031A388(u8 arg0, u8 arg1) {
|
||||
if (D_803830E0 != NULL) {
|
||||
D_803830E0->unk16 = arg0;
|
||||
D_803830E0->unk17 = arg1;
|
||||
// unused but making this static differs checksum
|
||||
void __gcquiz_unused2(u8 arg0, u8 arg1) {
|
||||
if (sD_803830E0 != NULL) {
|
||||
sD_803830E0->unk16 = arg0;
|
||||
sD_803830E0->unk17 = arg1;
|
||||
}
|
||||
}
|
||||
|
||||
bool func_8031A3BC(void){
|
||||
return (D_803830E0 != NULL)? D_803830E0->unk10 != 0: FALSE;
|
||||
bool gcquiz_isNotInInitialState(){
|
||||
return (sD_803830E0 != NULL) ? sD_803830E0->state != GCQUIZ_STATE_0_INITIAL: FALSE;
|
||||
}
|
||||
|
||||
//gcquiz_close
|
||||
void func_8031A3E4(void){
|
||||
static void __gcquiz_closeZoomboxes(){
|
||||
s32 i;
|
||||
if(D_803830E0 != NULL){
|
||||
if(sD_803830E0 != NULL){
|
||||
for(i = 0; i < 4; i++){
|
||||
gczoombox_minimize(D_803830E0->unk24[i]);
|
||||
gczoombox_close(D_803830E0->unk24[i]);
|
||||
gczoombox_minimize(sD_803830E0->zoomboxes[i]);
|
||||
gczoombox_close(sD_803830E0->zoomboxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_8031A454(void){
|
||||
// unused but making this static differs checksum
|
||||
s32 gcquiz_unused3(){
|
||||
return 4;
|
||||
}
|
||||
|
||||
//__gcquiz_get_type_count
|
||||
s32 func_8031A45C(enum ff_question_type_e question_type){
|
||||
return func_80318F1C(question_type) - func_80318ED8(question_type);
|
||||
s32 gcquiz_getLastIndexOfQuestionType(enum ff_question_type_e question_type) {
|
||||
return __gcquiz_get_type_end_id(question_type) - __gcquiz_get_type_start_id(question_type);
|
||||
}
|
||||
|
||||
void func_8031A48C(void) {
|
||||
if ((D_803830E0 != NULL) && (D_803830E0->unk10 == 1)) {
|
||||
func_803197AC(2);
|
||||
void gcquiz_func_8031A48C(void) {
|
||||
if ((sD_803830E0 != NULL) && (sD_803830E0->state == GCQUIZ_STATE_1_SHOW_QUESTION_VIA_ZOOMBOX)) {
|
||||
__gcquiz_advanceStateTo(GCQUIZ_STATE_2_SHOW_PORTRAITS_FOR_QUESTION);
|
||||
}
|
||||
}
|
||||
|
||||
//gcquiz_defrag
|
||||
void func_8031A4CC(void) {
|
||||
void gcquiz_defrag() {
|
||||
s32 i;
|
||||
|
||||
if (D_803830E0 != NULL) {
|
||||
if (sD_803830E0 != NULL) {
|
||||
for(i = 0; i < 4; i++){
|
||||
gczoombox_defrag(D_803830E0->unk24[i]);
|
||||
D_803830E0->unk24[i] = (GcZoombox *)defrag(D_803830E0->unk24[i]);
|
||||
gczoombox_defrag(sD_803830E0->zoomboxes[i]);
|
||||
sD_803830E0->zoomboxes[i] = (GcZoombox *)defrag(sD_803830E0->zoomboxes[i]);
|
||||
}
|
||||
|
||||
if (func_8031A3BC() == 0) {
|
||||
D_803830E0->unkC = (QuizQuestionBin *)defrag(D_803830E0->unkC);
|
||||
if (gcquiz_isNotInInitialState() == FALSE) {
|
||||
sD_803830E0->unkC = (QuizQuestionBin *)defrag(sD_803830E0->unkC);
|
||||
}
|
||||
D_803830E0 = (Struct_Core2_91E10 *)defrag(D_803830E0);
|
||||
sD_803830E0 = (Struct_Core2_91E10 *)defrag(sD_803830E0);
|
||||
}
|
||||
}
|
||||
|
@ -10,10 +10,9 @@ struct {
|
||||
u8 unk0;
|
||||
char *ptr;
|
||||
s32 index;
|
||||
}
|
||||
s_dialogBin;
|
||||
} s_dialogBin;
|
||||
|
||||
s32 func_8031B5B0(void) {
|
||||
s32 code94620_func_8031B5B0(void) {
|
||||
return s_dialogBin.unk0;
|
||||
}
|
||||
|
||||
@ -55,7 +54,7 @@ char *dialogBin_get(enum asset_e text_id) {
|
||||
//get text_bin from asset cache
|
||||
s_dialogBin.ptr = assetcache_get(text_id);
|
||||
sp1C = s_dialogBin.ptr + 1;
|
||||
sp1C += func_8031B5B0()*2;
|
||||
sp1C += code94620_func_8031B5B0()*2;
|
||||
var_a0 = *(sp1C++);
|
||||
var_a0 += *(sp1C++)<< 8;
|
||||
if(sp1C);
|
||||
|
@ -231,8 +231,9 @@ void func_8031CE70(f32 *arg0, enum map_e arg1, s32 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8031D04C(enum map_e arg0, s32 arg1) {
|
||||
func_8031CB50(arg0, arg1, 0);
|
||||
// set map and exit id?
|
||||
void func_8031D04C(enum map_e arg0, s32 exit_id) {
|
||||
func_8031CB50(arg0, exit_id, 0);
|
||||
}
|
||||
|
||||
void func_8031D06C(enum map_e arg0, s32 arg1) {
|
||||
|
@ -208,15 +208,15 @@ void func_80322B3C(s32 arg0, s32 arg1){ return; }
|
||||
void __overlay_ttc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; }
|
||||
|
||||
void __overlay_ttc_release(void){
|
||||
func_8038B04C();
|
||||
code3E30_overlayRelease();
|
||||
}
|
||||
|
||||
void overlay_ttc_init(void){
|
||||
func_8038B094();
|
||||
code3E30_overlayInit();
|
||||
}
|
||||
|
||||
void __overlay_ttc_update(void){
|
||||
func_8038B2F0();
|
||||
code3E30_overlayUpdate();
|
||||
}
|
||||
|
||||
void func_80322BB8(s32 arg0, s32 arg1){ return; }
|
||||
|
@ -321,7 +321,7 @@ s32 func_80334ECC(void) {
|
||||
phi_v1 = 0x1F;
|
||||
}
|
||||
if (((phi_v1 & phi_v0) == 3) && (overlayManagergetLoadedId() == OVERLAY_5_BEACH)) {
|
||||
if ((ttc_func_8038BF8C() == 0) || (D_80370250 != 0)) {
|
||||
if ((code_3E30_isSecretCheatCodeRelatedValueEqualToScrambledAddressValue() == FALSE) || (D_80370250 != 0)) {
|
||||
D_80370250 = (u8)1;
|
||||
for (phi_v0 = 0; phi_v0 != 0x8F0D180; phi_v0++){
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ void func_8033BD8C(void* arg0){
|
||||
func_8033B0D0(arg0);
|
||||
}
|
||||
|
||||
s32 func_8033BDAC(enum asset_e id, void *dst, s32 size) {
|
||||
s32 code_B3A80_func_8033BDAC(enum asset_e id, void *dst, s32 size) {
|
||||
s32 comp_size;
|
||||
s32 var_s0;
|
||||
s32 sp34;
|
||||
|
@ -8,7 +8,7 @@ extern struct FF_StorageStruct *D_8037DCB8;
|
||||
|
||||
void func_80350E00(void){
|
||||
quizQuestionAskedBitfield_defrag();
|
||||
func_8031A4CC();
|
||||
gcquiz_defrag();
|
||||
if(D_8037DCB8 == NULL)
|
||||
return;
|
||||
|
||||
|
@ -128,7 +128,7 @@ void volatileFlag_setAndTriggerDialog_4(enum volatile_flags_e arg0) {
|
||||
volatileFlag_setAndTriggerDialog(arg0, 4);
|
||||
}
|
||||
|
||||
// called for WISHYWASHYBANJO dialog
|
||||
// called for WISHYWASHYBANJO dialog, mumbo jumbo speaking?
|
||||
void volatileFlag_setAndTriggerDialog_E(enum volatile_flags_e arg0) {
|
||||
volatileFlag_setAndTriggerDialog(arg0, 0xE);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ void func_80363500(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80373DC0= {
|
||||
0x1EE, ACTOR_3BA_UNKOWN, 0,
|
||||
0x1EE, ACTOR_3BA_UNKNOWN, 0,
|
||||
0, NULL,
|
||||
func_80363500, actor_update_func_80326224, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
|
@ -27,7 +27,7 @@ void func_80295448(void){
|
||||
D_8037C310.unk0[0] = controller_getStartButton(0);
|
||||
func_8024E60C(0, &D_8037C310.unk0[1]);
|
||||
func_8024E6E0(0, &D_8037C310.unk0[4]);
|
||||
pfsManager_getControllerFaceButtonState(0, &D_8037C310.unk0[8]);
|
||||
controller_copyFaceButtons(0, &D_8037C310.unk0[8]);
|
||||
for(i=0; i<0xE; i++){//L802954A8
|
||||
D_8037C310.unk7E[i] = D_8037C310.unk70[i];
|
||||
if(D_8037C310.unk70[i]){
|
||||
|
@ -377,7 +377,7 @@ void gcdialog_update(void) {
|
||||
pfsManager_getFirstControllerFaceButtonState(0, controller_face_buttons);
|
||||
func_8024E640(0, controller_side_buttons);
|
||||
} else {
|
||||
pfsManager_getControllerFaceButtonState(0, controller_face_buttons);
|
||||
controller_copyFaceButtons(0, controller_face_buttons);
|
||||
func_8024E60C(0, controller_side_buttons);
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ void func_80310A5C(s32 next_state, s32 arg1, s32 arg2, s32 arg3, s32 arg4){
|
||||
f32 tmpf;
|
||||
for(i = 0, tmpf = 0.4f; i< 2; i++){
|
||||
if(g_Dialog.zoombox[i]){
|
||||
func_803184C8(g_Dialog.zoombox[i], arg2, next_state, arg1, tmpf, arg3, arg4);
|
||||
gczoombox_func_803184C8(g_Dialog.zoombox[i], arg2, next_state, arg1, tmpf, arg3, arg4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ void gcpausemenu_zoomboxes_initMainMenu(void) {
|
||||
s32 i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
D_80383010.zoombox[i] = gczoombox_new(D_8036C4E0[i].y, D_8036C4E0[i].portrait, 2, 0, gcpausemenu_zoombox_callback);
|
||||
func_803184C8(D_80383010.zoombox[i], 60.0f, 5, 2, 0.3f, 0, 0);
|
||||
gczoombox_func_803184C8(D_80383010.zoombox[i], 60.0f, 5, 2, 0.3f, 0, 0);
|
||||
func_80318640(D_80383010.zoombox[i], 0x1C, 0.75f, 0.9f, 0);
|
||||
func_80318760(D_80383010.zoombox[i], 8000);
|
||||
}
|
||||
@ -251,7 +251,7 @@ void gcpausemenu_zoomboxes_initTotalsMenu(void) {
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
D_80383010.zoombox[i] = gczoombox_new(D_8036C520[i].y, D_8036C520[i].portrait, (i == 3) ? 1 : 2, 0, gcpausemenu_zoombox_callback);
|
||||
func_803184C8(D_80383010.zoombox[i], 40.0f, 5, 2, 0.3f, 0, 0);
|
||||
gczoombox_func_803184C8(D_80383010.zoombox[i], 40.0f, 5, 2, 0.3f, 0, 0);
|
||||
func_80318640(D_80383010.zoombox[i], 0x46, 0.9f, 0.7f, 1);
|
||||
func_80318760(D_80383010.zoombox[i], 8000);
|
||||
}
|
||||
@ -933,7 +933,7 @@ s32 gcPauseMenu_update(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pfsManager_getControllerFaceButtonState(0, face_button);
|
||||
controller_copyFaceButtons(0, face_button);
|
||||
controller_getJoystick(0, joystick);
|
||||
func_8024E60C(0, sp60);
|
||||
func_8024E6E0(0, sp50);
|
||||
@ -1003,7 +1003,7 @@ s32 gcPauseMenu_update(void) {
|
||||
}//L80313664
|
||||
else {
|
||||
if (D_80383010.selection == PAUSE_SELECTION_2_VIEW_TOTALS && !D_80383010.unk3_6) {
|
||||
func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
gczoombox_func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
D_80383010.unk3_6 = 1;
|
||||
}
|
||||
|
||||
@ -1015,7 +1015,7 @@ s32 gcPauseMenu_update(void) {
|
||||
D_80383010.selection--;
|
||||
}
|
||||
gczoombox_highlight(D_80383010.zoombox[D_80383010.selection], TRUE);
|
||||
func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
gczoombox_func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
D_80383010.unk3_6 = 0;
|
||||
D_80383010.unk7 = 6;
|
||||
}
|
||||
@ -1028,7 +1028,7 @@ s32 gcPauseMenu_update(void) {
|
||||
D_80383010.selection++;
|
||||
}
|
||||
gczoombox_highlight(D_80383010.zoombox[D_80383010.selection], 1);
|
||||
func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
gczoombox_func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
D_80383010.unk3_6 = 0;
|
||||
D_80383010.unk7 = 6;
|
||||
}
|
||||
@ -1036,7 +1036,7 @@ s32 gcPauseMenu_update(void) {
|
||||
}
|
||||
|
||||
if (D_80383010.selection == 2 && !D_80383010.unk3_6 && D_80383010.unk7 == 3) {
|
||||
func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
gczoombox_func_803160A8(D_80383010.zoombox[D_80383010.selection]);
|
||||
D_80383010.unk3_6 = 1;
|
||||
}
|
||||
break;
|
||||
|
@ -764,7 +764,7 @@ void func_80315C90(GcZoombox *this, s32 arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_803160A8(GcZoombox *this) {
|
||||
void gczoombox_func_803160A8(GcZoombox *this) {
|
||||
f32 temp_f14;
|
||||
f32 phi_f14;
|
||||
s32 phi_a0;
|
||||
@ -879,7 +879,7 @@ void func_80316764(GcZoombox *this, s32 arg1) {
|
||||
f32 pad0;
|
||||
|
||||
if (!this->unk1A4_10 ) {
|
||||
pfsManager_getControllerFaceButtonState(0, sp38);
|
||||
controller_copyFaceButtons(0, sp38);
|
||||
func_8024E60C(0, sp2C);
|
||||
phi_f0 = time_getDelta();
|
||||
} else {
|
||||
@ -1065,7 +1065,7 @@ void gczoombox_update(GcZoombox *this){
|
||||
return;
|
||||
|
||||
if( !this->unk1A4_10 ){
|
||||
pfsManager_getControllerFaceButtonState(0, sp58);
|
||||
controller_copyFaceButtons(0, sp58);
|
||||
func_8024E60C(0, sp4C);
|
||||
tmp_f0 = time_getDelta();
|
||||
}
|
||||
@ -1449,7 +1449,7 @@ GcZoombox *gczoombox_new(s32 y, GcZoomboxSprite portrait_id, s32 arg2, s32 arg3,
|
||||
animctrl_setIndex(this->anim_ctrl, ASSET_138_ANIM_ZOOMBOX);
|
||||
animctrl_start(this->anim_ctrl, "gczoombox.c", 0x6fd);
|
||||
|
||||
func_803184C8(this, 15.0f, 5, 2, 0.4f, 0, 0); //func_803184C8(this, 15.0f, 5, 2, D_80378940, 0, 0);
|
||||
gczoombox_func_803184C8(this, 15.0f, 5, 2, 0.4f, 0, 0); //gczoombox_func_803184C8(this, 15.0f, 5, 2, D_80378940, 0, 0);
|
||||
this->unk176 = D_8036C6C0[portrait_id].unk2;
|
||||
this->unk177 = D_8036C6C0[portrait_id].unk3;
|
||||
this->unk100 = 0;
|
||||
@ -1556,14 +1556,14 @@ void func_803184B8(GcZoombox *this){
|
||||
this->unk13A &= (u8)~(0x20);
|
||||
}
|
||||
|
||||
void func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6) {
|
||||
void gczoombox_func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 animation_duration, bool arg5, bool arg6) {
|
||||
|
||||
if (this != NULL) {
|
||||
this->unk182 = arg2;
|
||||
this->unk184 = arg3;
|
||||
this->unk190 = 1.0 / arg1;
|
||||
if (this->anim_ctrl != NULL) {
|
||||
animctrl_setDuration(this->anim_ctrl, arg4);
|
||||
animctrl_setDuration(this->anim_ctrl, animation_duration);
|
||||
}
|
||||
this->unk1A4_12 = BOOL(arg5);
|
||||
this->unk1A4_10 = BOOL(arg6);
|
||||
@ -1581,8 +1581,8 @@ bool func_8031857C(GcZoombox *this, u8 *str){
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void gczoombox_highlight(GcZoombox *this, bool arg1){
|
||||
if(arg1)
|
||||
void gczoombox_highlight(GcZoombox *this, bool should_highlight){
|
||||
if(should_highlight)
|
||||
this->highlighted = 1;
|
||||
else
|
||||
this->highlighted = 0;
|
||||
@ -1630,7 +1630,7 @@ void func_80318760(GcZoombox *this, s32 arg1){
|
||||
this->unk12E = arg1;
|
||||
}
|
||||
|
||||
void func_80318774(GcZoombox *this){
|
||||
void gczoombox_setUnk13ATo0(GcZoombox *this){
|
||||
this->unk13A = 0;
|
||||
}
|
||||
|
||||
@ -1763,10 +1763,10 @@ void gczoombox_defrag(GcZoombox *this) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80318C48(GcZoombox *this, s32 arg1) {
|
||||
void gczoombox_func_80318C48(GcZoombox *this, bool arg1) {
|
||||
if (this != NULL) {
|
||||
if (this->unk1A4_30) {
|
||||
if (arg1 != 0) {
|
||||
if (arg1 != FALSE) {
|
||||
if (this->unk0[0] == 0xFD) {
|
||||
this->unk0[1] = 0x68;
|
||||
} else {
|
||||
@ -1781,7 +1781,7 @@ void func_80318C48(GcZoombox *this, s32 arg1) {
|
||||
}
|
||||
}
|
||||
if (this->unk1A4_29) {
|
||||
if (arg1 != 0) {
|
||||
if (arg1 != FALSE) {
|
||||
if (this->unk30[0] == 0xFD) {
|
||||
this->unk30[1] = 0x68;
|
||||
return;
|
||||
|
@ -207,7 +207,7 @@ typedef struct {
|
||||
|
||||
|
||||
void gczoombox_free(GcZoombox *this);
|
||||
void func_803160A8(GcZoombox *this);
|
||||
void gczoombox_func_803160A8(GcZoombox *this);
|
||||
void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx);
|
||||
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, BKSpriteDisplayData *arg5, f32 arg6);
|
||||
void func_80316764(GcZoombox *this, s32 arg1);
|
||||
@ -231,7 +231,7 @@ void func_80318488(GcZoombox *this);
|
||||
void func_80318498(GcZoombox *this);
|
||||
void gczoombox_resolve_minimize(GcZoombox *this);
|
||||
void func_803184B8(GcZoombox *this);
|
||||
void func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6);
|
||||
void gczoombox_func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6);
|
||||
bool func_8031857C(GcZoombox *this, u8 *str);
|
||||
void gczoombox_highlight(GcZoombox *this, bool arg1);
|
||||
bool gczoombox_is_highlighted(GcZoombox *this);
|
||||
@ -239,7 +239,7 @@ void func_80318614(GcZoombox *this, int arg1);
|
||||
void func_80318640(GcZoombox *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4);
|
||||
void func_80318734(GcZoombox *this, f32 arg1);
|
||||
void func_80318760(GcZoombox *this, s32 arg1);
|
||||
void func_80318774(GcZoombox *this);
|
||||
void gczoombox_setUnk13ATo0(GcZoombox *this);
|
||||
bool func_8031877C(GcZoombox *this);
|
||||
bool func_803188B4(GcZoombox *this);
|
||||
bool func_80318964(GcZoombox *this);
|
||||
@ -247,6 +247,6 @@ bool gczoombox_loadSprite(GcZoombox *this, GcZoomboxSprite arg1);
|
||||
void func_80318B7C(GcZoombox *this, s32 arg1);
|
||||
bool func_80318BEC(GcZoombox *this);
|
||||
void gczoombox_defrag(GcZoombox *this);
|
||||
void func_80318C48(GcZoombox *this, s32 arg1);
|
||||
void gczoombox_func_80318C48(GcZoombox *this, bool arg1);
|
||||
|
||||
#endif // __BANJO_KAZOOIE_CORE2_GC_ZOOMBOX_H__
|
||||
|
@ -374,7 +374,7 @@ void spawnQueue_reset(void){
|
||||
GV_func_8038F154();
|
||||
break;
|
||||
case OVERLAY_5_BEACH:
|
||||
TTC_resetSpawnableActors();
|
||||
code26D0_resetSpawnableActorsForTTC();
|
||||
break;
|
||||
case OVERLAY_6_JUNGLE:
|
||||
MM_func_803888B0();
|
||||
|
@ -71,7 +71,7 @@ void gzquiz_initGruntyQuestions(void) {
|
||||
if (fileProgressFlag_get(FILEPROG_5C_FF_PATTERN_SET) && !volatileFlag_get(VOLATILE_FLAG_62_FF_GRUNTY_QUESTIONS_INITIALIZED)) {
|
||||
rand_seed(fileProgressFlag_getN(FILEPROG_D3_FF_PATTERN, 8));
|
||||
|
||||
for(i = 0; i < func_8031A45C(FFQT_3_GRUNTY); i++){
|
||||
for(i = 0; i < gcquiz_getLastIndexOfQuestionType(FFQT_3_GRUNTY); i++){
|
||||
question_id = VOLATILE_FLAG_26_FF_GRUNTY_QUESTIONS + 2 * i;
|
||||
pattern = randi2(0, 3);
|
||||
|
||||
@ -120,7 +120,7 @@ void chBrentilda_update(Actor *this) {
|
||||
func_8028E668(this->position, 280.0f, -40.0f, 160.0f);
|
||||
this->yaw_ideal = (f32) func_80329784(this);
|
||||
func_80328FB0(this, 3.0f);
|
||||
pfsManager_getControllerFaceButtonState(0, sp78);
|
||||
controller_copyFaceButtons(0, sp78);
|
||||
player_getPosition(sp64);
|
||||
temp_f0 = sp64[1] - this->position[1];
|
||||
if ((temp_f0 > -100.0f) && (temp_f0 < 350.0f)) {
|
||||
|
@ -548,7 +548,7 @@ void func_8038CCEC(void)
|
||||
free(D_8037DCB8);
|
||||
D_8037DCB8 = NULL;
|
||||
|
||||
func_80319190();
|
||||
gcquiz_free();
|
||||
quizQuestionAskedBitfield_free();
|
||||
func_802C5994();
|
||||
}
|
||||
@ -590,7 +590,7 @@ void func_8038CE28(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
func_80319050();
|
||||
gcquiz_init();
|
||||
D_8037DCB8 = malloc(sizeof(struct FF_StorageStruct));
|
||||
quizQuestionAskedBitfield_init();
|
||||
|
||||
@ -681,9 +681,8 @@ void lair_func_8038CF18(void)
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_8038D0AC(s32 questionType, s32 a1)
|
||||
static s32 __code5ED0_getQuizQuestionTime(s32 questionType, s32 a1)
|
||||
{
|
||||
// :morphone: tf
|
||||
return 10;
|
||||
}
|
||||
|
||||
@ -912,7 +911,7 @@ void func_8038D670(enum FF_Action next_state) {
|
||||
func_8028F918(2);
|
||||
if (D_8037DCB8->ffQuestionType != FFQT_4_MINIGAME) {
|
||||
func_8038CE00();
|
||||
func_8031A154(D_8037DCB8->ffQuestionType, D_8037DCB8->unkD, D_8037DCB8->unkE, func_8038D0AC(D_8037DCB8->ffQuestionType, D_8037DCB8->unkC), 0, &func_8038D3F0);
|
||||
gcquiz_func_8031A154(D_8037DCB8->ffQuestionType, D_8037DCB8->unkD, D_8037DCB8->unkE, __code5ED0_getQuizQuestionTime(D_8037DCB8->ffQuestionType, D_8037DCB8->unkC), 0, &func_8038D3F0);
|
||||
} else {
|
||||
func_8038D4BC();
|
||||
}
|
||||
@ -943,7 +942,7 @@ void func_8038D670(enum FF_Action next_state) {
|
||||
break;
|
||||
}//L8038D91C
|
||||
}
|
||||
func_8031A48C();
|
||||
gcquiz_func_8031A48C();
|
||||
break;
|
||||
|
||||
case FFA_6_TRIGGER_QUESTION_POST_EFFECTS: //L8038D940
|
||||
@ -1157,9 +1156,9 @@ void lair_func_8038E0B0(void) {
|
||||
&& (D_8037DCB8 != NULL)
|
||||
&& (D_8037DCB8->unk0 != NULL)
|
||||
){
|
||||
func_80319EA4();
|
||||
gcquiz_func_80319EA4();
|
||||
func_8038C9D0();
|
||||
pfsManager_getControllerFaceButtonState(0, sp48);
|
||||
controller_copyFaceButtons(0, sp48);
|
||||
func_8024E60C(0, sp3C);
|
||||
if (D_8037DCB8->currFfMode < 3) {
|
||||
player_getPosition(D_8037DCB8->playerPosition);
|
||||
@ -1328,7 +1327,7 @@ void lair_func_8038E768(Gfx **dl, Mtx **m, Vtx **v)
|
||||
if (map_get() != MAP_8E_GL_FURNACE_FUN)
|
||||
return;
|
||||
|
||||
func_80319214(dl, m, v);
|
||||
gcquiz_draw(dl, m, v);
|
||||
gczoombox_draw(D_8037DCB8->unk20, dl, m, v);
|
||||
}
|
||||
|
||||
|
@ -468,7 +468,7 @@ void lair_func_8038F924(Actor *this) {
|
||||
particleEmitter_emitN(sp54, 6);
|
||||
}
|
||||
}
|
||||
pfsManager_getControllerFaceButtonState(0, sp7C);
|
||||
controller_copyFaceButtons(0, sp7C);
|
||||
func_8024E60C(0, sp6C);
|
||||
func_8038EDBC(this);
|
||||
switch(this->state){
|
||||
|
@ -108,7 +108,7 @@ void func_803902B8(Actor *this) {
|
||||
this->unk38_0 = sp58;
|
||||
sp58 = ml_vec3f_within_distance(this->position, sp5C, 400.0f);
|
||||
if (fileProgressFlag_get(sp54 + FILEPROG_AD_CHEATO_BLUEEGGS_UNLOCKED)) {
|
||||
pfsManager_getControllerFaceButtonState(0, sp3C);
|
||||
controller_copyFaceButtons(0, sp3C);
|
||||
sp58 &= (sp3C[FACE_BUTTON(BUTTON_B)] == 1) || func_8028EC04();
|
||||
}
|
||||
if (sp58 && !*(s32 *)&this->local) {
|
||||
|
@ -131,7 +131,7 @@ void func_80390E28(Actor *this) {
|
||||
|
||||
switch (this->state) {
|
||||
case 0:
|
||||
if( !func_8031A3BC() && (sp38 < 2) && (randf() < 0.1) && !mapSpecificFlags_get(0xA) && !volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)) {
|
||||
if( gcquiz_isNotInInitialState() == FALSE && (sp38 < 2) && (randf() < 0.1) && !mapSpecificFlags_get(0xA) && !volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)) {
|
||||
sp38++;
|
||||
mapSpecificFlags_setN(0, sp38, 2);
|
||||
func_80390D3C(this, (randf() < 0.5) ? 2 :1);
|
||||
|
@ -240,7 +240,7 @@ void func_80391B04(Actor *this) {
|
||||
func_8038E9A4(local->unk10, this->position);
|
||||
switch (this->state) { /* irregular */
|
||||
case 1:
|
||||
if (func_8031A3BC() || mapSpecificFlags_get(0xA)) {
|
||||
if (gcquiz_isNotInInitialState() || mapSpecificFlags_get(0xA)) {
|
||||
func_80391810(this, 4);
|
||||
break;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ void func_80392700(Actor *this) {
|
||||
this->marker->unk2C_2 = TRUE;
|
||||
}
|
||||
}
|
||||
this->unk58_0 = !func_8031A3BC();
|
||||
this->unk58_0 = !gcquiz_isNotInInitialState();
|
||||
}
|
||||
|
||||
|
||||
|
210
tools/generate_asset_enums.py
Normal file
210
tools/generate_asset_enums.py
Normal file
@ -0,0 +1,210 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import yaml
|
||||
import re
|
||||
import os
|
||||
from typing import Dict, List
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def build_asset_map(assets_file: str) -> Dict[str, str]:
|
||||
file_types_to_skip = (
|
||||
'LevelSetup', # 0x071D - 0x07B5
|
||||
'DemoInput', # 0x09A2 - 0x0A0A
|
||||
'QuizQuestion', # 0x1213 - 0x13D5
|
||||
'GruntyQuestion', # 0x1407 - 0x1424
|
||||
'Midi' # 0x1516 - 0x15C2
|
||||
)
|
||||
|
||||
file_type_to_asset_type = {
|
||||
'Animation': 'ANIM',
|
||||
'Model': 'MODEL',
|
||||
'Sprite_I4': 'SPRITE',
|
||||
'Sprite_I8': 'SPRITE',
|
||||
'Sprite_CI4': 'SPRITE',
|
||||
'Sprite_CI8': 'SPRITE',
|
||||
'Sprite_RGBA16': 'SPRITE',
|
||||
'Sprite_RGBA32': 'SPRITE',
|
||||
'Sprite_UNKNOWN(256)': 'SPRITE',
|
||||
'Dialog': 'DIALOG',
|
||||
}
|
||||
|
||||
asset_map = {}
|
||||
with open(assets_file, 'r') as stream:
|
||||
try:
|
||||
data = yaml.safe_load(stream)
|
||||
if "files" not in data:
|
||||
raise Exception("Expected to find 'files' key in assets file")
|
||||
files = data["files"]
|
||||
for file in files:
|
||||
file_type = file["type"]
|
||||
if file_type in file_types_to_skip:
|
||||
continue
|
||||
|
||||
if file_type not in file_type_to_asset_type:
|
||||
continue
|
||||
|
||||
asset_type = file_type_to_asset_type[file_type]
|
||||
address = file["uid"]
|
||||
asset_map[f"{address:X}"] = f"ASSET_{address:X}_{asset_type}_UNKNOWN"
|
||||
except yaml.YAMLError as exc:
|
||||
print(exc)
|
||||
|
||||
return asset_map
|
||||
|
||||
|
||||
def get_existing_asset_enums(assets_enum_file: str) -> Dict[str, str]:
|
||||
with open(assets_enum_file, "r") as enums_stream:
|
||||
existing_asset_match = re.compile(r"^\s*(ASSET_([A-F0-9]+)_\w+)", re.IGNORECASE)
|
||||
existing_asset_mappings = {}
|
||||
for line in enums_stream:
|
||||
asset_line = existing_asset_match.match(line)
|
||||
if asset_line is not None:
|
||||
asset_address = asset_line.group(2).upper()
|
||||
existing_asset_mappings[asset_address] = asset_line.group(1)
|
||||
|
||||
return existing_asset_mappings
|
||||
|
||||
|
||||
def build_asset_enum(asset_map: Dict[str, str], existing_assets: Dict[str, str]) -> List[str]:
|
||||
asset_enum_lines = []
|
||||
address_already_defined = False
|
||||
for i in range(1, int(0x1516)):
|
||||
address = f"{i:X}"
|
||||
if address in existing_assets:
|
||||
if address_already_defined is False:
|
||||
asset_enum_lines.append(
|
||||
f"{existing_assets[address]} = 0x{address},")
|
||||
address_already_defined = True
|
||||
else:
|
||||
asset_enum_lines.append(f"{existing_assets[address]},")
|
||||
elif address in asset_map:
|
||||
if address_already_defined is False:
|
||||
asset_enum_lines.append(f"{asset_map[address]} = 0x{address},")
|
||||
address_already_defined = True
|
||||
else:
|
||||
asset_enum_lines.append(f"{asset_map[address]},")
|
||||
else:
|
||||
asset_enum_lines.append(f"// {address} unused")
|
||||
address_already_defined = False
|
||||
|
||||
asset_enum_lines = remove_unnecessary_unused_asset_lines(asset_enum_lines)
|
||||
|
||||
# Remove trailing comma in last asset line
|
||||
last_line: str = asset_enum_lines[-1]
|
||||
if last_line.endswith(","):
|
||||
last_line = last_line.replace(",", "")
|
||||
asset_enum_lines[-1] = last_line
|
||||
|
||||
return map(lambda x: f" {x}", asset_enum_lines)
|
||||
|
||||
|
||||
def remove_unnecessary_unused_asset_lines(lines: List[str]) -> List[str]:
|
||||
prev_unused = False
|
||||
unused_asset_line_indexes = []
|
||||
# Create list of lines that contain "// xx is unused"
|
||||
for idx, line in enumerate(lines):
|
||||
if line.endswith('unused') is False:
|
||||
continue
|
||||
|
||||
if idx + 1 >= len(lines):
|
||||
continue
|
||||
|
||||
prev: str | None = lines[idx - 1]
|
||||
prev_unused = prev is not None and prev.endswith('unused')
|
||||
|
||||
next: str | None = lines[idx + 1]
|
||||
next_unused = next is not None and next.endswith('unused')
|
||||
|
||||
if prev_unused and next_unused:
|
||||
unused_asset_line_indexes.append(idx)
|
||||
|
||||
# "Group" lines where multiple "// xx is unused" lines occur in a row
|
||||
groups = []
|
||||
group = []
|
||||
target = None
|
||||
for idx, line_index in enumerate(unused_asset_line_indexes):
|
||||
if target is not None and target > idx:
|
||||
continue
|
||||
else:
|
||||
target = None
|
||||
|
||||
for next in range(0, len(unused_asset_line_indexes) - idx):
|
||||
if unused_asset_line_indexes[next + idx] == line_index + next:
|
||||
group.append(next + idx)
|
||||
else:
|
||||
break
|
||||
|
||||
if len(group) == 0:
|
||||
continue
|
||||
|
||||
combine_from_index = group[0]
|
||||
combine_from = unused_asset_line_indexes[combine_from_index]
|
||||
combine_to_index = group[len(group)-1]
|
||||
combine_to = unused_asset_line_indexes[combine_to_index]
|
||||
groups.append((combine_from - 1, combine_to + 1))
|
||||
group = []
|
||||
target = next + idx
|
||||
|
||||
# Replace the "unnecessary" lines with a single line that lists the range that is unused
|
||||
offset = 0
|
||||
address_regex = re.compile(r"^// (\w+) unused$")
|
||||
for group in groups:
|
||||
(start, end) = group
|
||||
start -= offset
|
||||
start_line = lines[start]
|
||||
start_match = address_regex.match(start_line)
|
||||
|
||||
end -= offset
|
||||
end_line = lines[end]
|
||||
end_match = address_regex.match(end_line)
|
||||
|
||||
if start_match is not None and end_match is not None:
|
||||
lines[start:end+1] = [
|
||||
f"// 0x{start_match.group(1)} - 0x{end_match.group(1)} unused"
|
||||
]
|
||||
|
||||
offset += end - start
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def write_enum_file(asset_lines: List[str], out_file: str):
|
||||
with open(out_file, "w") as enums_out:
|
||||
lines = [
|
||||
"enum asset_e",
|
||||
"{",
|
||||
*asset_lines,
|
||||
"};"
|
||||
]
|
||||
enums_out.write("\n".join(lines))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Generate asset_e enum from assets/assets.yaml and include/enums.h files',
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter
|
||||
)
|
||||
parser.add_argument(
|
||||
'basedir',
|
||||
type=str,
|
||||
help="base directory (containing src/)"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
asset_map = build_asset_map(
|
||||
assets_file=f"{args.basedir}{os.sep}assets{os.sep}assets.yaml"
|
||||
)
|
||||
existing_assets = get_existing_asset_enums(
|
||||
assets_enum_file=f"{args.basedir}{os.sep}include{os.sep}enums.h"
|
||||
)
|
||||
|
||||
asset_enum_lines = build_asset_enum(asset_map, existing_assets)
|
||||
write_enum_file(
|
||||
asset_enum_lines,
|
||||
out_file=f"{args.basedir}{os.sep}assets.h"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
x
Reference in New Issue
Block a user