mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-18 21:18:17 -04:00
partially finish code_0x8012EC80, document all of gSaveContext (#138)
* not ok, why? * OK! * fix data * finish data etc * work on save context * save finished * first func done * roomInf * done for now * add missing file * add most og names for struct members * fix accidental change * Update z_en_ginko_man.c * Update z_scene.c * maybe fix stuff hopefully * proto * sasa * Update include/z64save.h Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> * Update z64save.h Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>
This commit is contained in:
@@ -0,0 +1,406 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
// Bit Flag array in which gBitFlags[n] is literally (1 << n)
|
||||
u32 gBitFlags[] = {
|
||||
(1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7),
|
||||
(1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15),
|
||||
(1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22), (1 << 23),
|
||||
(1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
|
||||
};
|
||||
|
||||
u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
|
||||
u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF };
|
||||
u32 gUpgradeMasks[] = {
|
||||
0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000,
|
||||
};
|
||||
u32 gUpgradeNegMasks[] = {
|
||||
0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF,
|
||||
};
|
||||
u8 gEquipShifts[] = { 0, 4, 8, 12 };
|
||||
u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20, 0, 0, 0, 30, 0, 40, 0, 50 };
|
||||
|
||||
u16 gUpgradeCapacities[][4] = {
|
||||
{ 0, 20, 30, 40 }, // Bomb Bags
|
||||
{ 0, 0, 0, 0 }, // Unused (Scale)
|
||||
{ 0, 0, 0, 0 }, // Unused (Strength)
|
||||
{ 99, 200, 500, 500 }, // Wallets
|
||||
{ 0, 30, 40, 50 }, // Quivers
|
||||
{ 0, 10, 20, 30 }, // Unused (Deku Stick)
|
||||
{ 0, 20, 30, 40 }, // Unused (Deku Nut)
|
||||
};
|
||||
|
||||
u32 gGsFlagsMask[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 };
|
||||
u32 gGsFlagsShift[] = { 0, 8, 16, 24 };
|
||||
|
||||
// TODO: use symbols for these icon textures once textures are properly in C
|
||||
void* gItemIcons[] = {
|
||||
0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000,
|
||||
0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000,
|
||||
0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000,
|
||||
0x0801B000, 0x0801C000, 0x0801D000, 0x0801E000, 0x0801F000, 0x08020000, 0x08021000, 0x08022000, 0x08023000,
|
||||
0x08024000, 0x08025000, 0x08026000, 0x08027000, 0x08028000, 0x08029000, 0x0802A000, 0x0802B000, 0x0802C000,
|
||||
0x0802D000, 0x0802E000, 0x0802F000, 0x08030000, 0x08031000, 0x08032000, 0x08033000, 0x08034000, 0x08035000,
|
||||
0x08036000, 0x08037000, 0x08038000, 0x08039000, 0x0803A000, 0x0803B000, 0x0803C000, 0x0803D000, 0x0803E000,
|
||||
0x0803F000, 0x08040000, 0x08041000, 0x08042000, 0x08043000, 0x08044000, 0x08045000, 0x08046000, 0x08047000,
|
||||
0x08048000, 0x08049000, 0x0804A000, 0x0804B000, 0x0804C000, 0x0804D000, 0x0804E000, 0x0804F000, 0x08050000,
|
||||
0x08051000, 0x08052000, 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, 0x08059000,
|
||||
0x0805A000, 0x0805B000, 0x0805C000, 0x0805D000, 0x0805E000, 0x0805F000, 0x08060000, 0x08062000, 0x08062000,
|
||||
0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000,
|
||||
0x08062000, 0x08061000, 0x09000000, 0x09000900, 0x09001200, 0x08062000, 0x08062000, 0x08062000, 0x09003600,
|
||||
0x09004800, 0x09003F00, 0x09005100, 0x09005A00, 0x09006300, 0x09006C00, 0x08062180, 0x08062A80, 0x08063380,
|
||||
0x020028A0, 0x020025A0, 0x020027A0, 0x020026A0, 0x020024A0,
|
||||
};
|
||||
|
||||
// Used to map item IDs to inventory slots
|
||||
u8 gItemSlots[] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
|
||||
0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x05, 0x05, 0x05, 0x05, 0x05, 0x0B, 0x0B, 0x11,
|
||||
0x11, 0x11, 0x1D, 0x23, 0x29, 0x2F, 0x28, 0x26, 0x19, 0x20, 0x1E, 0x2C, 0x24, 0x25, 0x18, 0x27,
|
||||
0x1C, 0x2B, 0x21, 0x2A, 0x2D, 0x1B, 0x1F, 0x1A, 0x22, 0x2E, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
u16 gItemPrices[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20, 20, 0, 20,
|
||||
5, 20, 20, 50, 50, 200, 20, 20, 20, 200, 5, 0, 200, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
// Used to map scene indexes to their region in Termina
|
||||
u16 gScenesPerRegion[11][27] = {
|
||||
// Great Bay
|
||||
{
|
||||
SCENE_30GYOSON,
|
||||
SCENE_LABO,
|
||||
SCENE_FISHERMAN,
|
||||
SCENE_SINKAI,
|
||||
SCENE_31MISAKI,
|
||||
SCENE_TORIDE,
|
||||
SCENE_KAIZOKU,
|
||||
SCENE_PIRATE,
|
||||
SCENE_35TAKI,
|
||||
SCENE_KINDAN2,
|
||||
-1,
|
||||
},
|
||||
// Zora Hall
|
||||
{
|
||||
SCENE_33ZORACITY,
|
||||
SCENE_BANDROOM,
|
||||
-1,
|
||||
},
|
||||
// Romani Ranch
|
||||
{
|
||||
SCENE_F01,
|
||||
SCENE_ROMANYMAE,
|
||||
SCENE_OMOYA,
|
||||
SCENE_F01C,
|
||||
SCENE_F01_B,
|
||||
SCENE_KOEPONARACE,
|
||||
-1,
|
||||
},
|
||||
// Deku Palace
|
||||
{
|
||||
SCENE_22DEKUCITY,
|
||||
SCENE_DEKU_KING,
|
||||
SCENE_26SARUNOMORI,
|
||||
SCENE_DANPEI,
|
||||
-1,
|
||||
},
|
||||
// Southern Swamp
|
||||
{
|
||||
SCENE_20SICHITAI,
|
||||
SCENE_20SICHITAI2,
|
||||
SCENE_MAP_SHOP,
|
||||
SCENE_WITCH_SHOP,
|
||||
SCENE_21MITURINMAE,
|
||||
SCENE_KINSTA1,
|
||||
-1,
|
||||
},
|
||||
// Clock Town
|
||||
{
|
||||
SCENE_00KEIKOKU, SCENE_TENMON_DAI, SCENE_13HUBUKINOMITI,
|
||||
SCENE_24KEMONOMITI, SCENE_SYATEKI_MORI, SCENE_IKANAMAE,
|
||||
SCENE_TOWN, SCENE_SYATEKI_MIZU, SCENE_BOWLING,
|
||||
SCENE_TAKARAYA, SCENE_YADOYA, SCENE_SONCHONOIE,
|
||||
SCENE_MILK_BAR, SCENE_ICHIBA, SCENE_BOMYA,
|
||||
SCENE_AYASHIISHOP, SCENE_8ITEMSHOP, SCENE_DOUJOU,
|
||||
SCENE_POSTHOUSE, SCENE_TAKARAKUJI, SCENE_BACKTOWN,
|
||||
SCENE_CLOCKTOWER, SCENE_INSIDETOWER, SCENE_OKUJOU,
|
||||
SCENE_ALLEY, SCENE_DEKUTES, -1,
|
||||
},
|
||||
// Snowhead
|
||||
{
|
||||
SCENE_10YUKIYAMANOMURA,
|
||||
SCENE_10YUKIYAMANOMURA2,
|
||||
SCENE_KAJIYA,
|
||||
SCENE_12HAKUGINMAE,
|
||||
SCENE_14YUKIDAMANOMITI,
|
||||
SCENE_GORONRACE,
|
||||
SCENE_GORON_HAKA,
|
||||
SCENE_17SETUGEN,
|
||||
SCENE_17SETUGEN2,
|
||||
-1,
|
||||
},
|
||||
// Ikana Graveyard
|
||||
{
|
||||
SCENE_BOTI,
|
||||
SCENE_DANPEI2TEST,
|
||||
-1,
|
||||
},
|
||||
// Ikana Canyon
|
||||
{
|
||||
SCENE_CASTLE,
|
||||
SCENE_IKNINSIDE,
|
||||
SCENE_IKANA,
|
||||
SCENE_SECOM,
|
||||
SCENE_MUSICHOUSE,
|
||||
SCENE_RANDOM,
|
||||
SCENE_REDEAD,
|
||||
SCENE_TOUGITES,
|
||||
SCENE_HAKASHITA,
|
||||
-1,
|
||||
},
|
||||
// Goron Village
|
||||
{
|
||||
SCENE_11GORONNOSATO,
|
||||
SCENE_11GORONNOSATO2,
|
||||
SCENE_16GORON_HOUSE,
|
||||
SCENE_GORONSHOP,
|
||||
-1,
|
||||
},
|
||||
// Stone Tower
|
||||
{
|
||||
SCENE_F40,
|
||||
SCENE_F41,
|
||||
-1,
|
||||
},
|
||||
};
|
||||
|
||||
s32 func_8012EC80(GlobalContext* globalCtx) {
|
||||
if (gSaveContext.buttonStatus[0] == BTN_DISABLED) {
|
||||
return 0xFF;
|
||||
} else if (gSaveContext.unk_1015 == 0xFF) {
|
||||
return 0xFF;
|
||||
} else if (gSaveContext.equips.buttonItems[((gSaveContext.playerForm == 4) ? 0 : gSaveContext.playerForm)][0] ==
|
||||
0xFF) {
|
||||
if (globalCtx->interfaceCtx.unk_21C != 0) {
|
||||
if (globalCtx->interfaceCtx.unk_21E != 0) {
|
||||
return globalCtx->interfaceCtx.unk_21E;
|
||||
}
|
||||
}
|
||||
return 0xFF;
|
||||
} else {
|
||||
return gSaveContext.equips.buttonItems[((gSaveContext.playerForm == 4) ? 0 : gSaveContext.playerForm)][0];
|
||||
}
|
||||
}
|
||||
|
||||
void func_8012ED34(s16 equipment);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012ED34.asm")
|
||||
|
||||
u8 func_8012ED78(GlobalContext* globalCtx, s16 equipment);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012ED78.asm")
|
||||
|
||||
void func_8012EDE8(s16 arg0, u32 arg1);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012EDE8.asm")
|
||||
|
||||
s32 func_8012EE34(s16 arg0) {
|
||||
s16 num = 0;
|
||||
|
||||
if (arg0 >= 0x20) {
|
||||
if (arg0 < 0x40) {
|
||||
num = 1;
|
||||
} else if (arg0 < 0x60) {
|
||||
num = 2;
|
||||
} else if (arg0 < 0x80) {
|
||||
num = 3;
|
||||
} else if (arg0 < 0xA0) {
|
||||
num = 4;
|
||||
} else if (arg0 < 0xC0) {
|
||||
num = 5;
|
||||
} else if (arg0 < 0xE0) {
|
||||
num = 6;
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.roomInf[125][num] & gBitFlags[arg0 - (num << 5)]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */ u16 D_801C2380[12][6] = {
|
||||
{
|
||||
SCENE_00KEIKOKU,
|
||||
SCENE_BOTI,
|
||||
SCENE_13HUBUKINOMITI,
|
||||
SCENE_24KEMONOMITI,
|
||||
SCENE_IKANAMAE,
|
||||
SCENE_TOWN,
|
||||
},
|
||||
{
|
||||
SCENE_ICHIBA,
|
||||
SCENE_BACKTOWN,
|
||||
SCENE_CLOCKTOWER,
|
||||
SCENE_ALLEY,
|
||||
-1,
|
||||
},
|
||||
{
|
||||
SCENE_20SICHITAI,
|
||||
SCENE_20SICHITAI2,
|
||||
SCENE_21MITURINMAE,
|
||||
SCENE_22DEKUCITY,
|
||||
SCENE_DEKU_KING,
|
||||
SCENE_KINSTA1,
|
||||
},
|
||||
{ -1 },
|
||||
{
|
||||
SCENE_10YUKIYAMANOMURA,
|
||||
SCENE_10YUKIYAMANOMURA2,
|
||||
SCENE_11GORONNOSATO,
|
||||
SCENE_11GORONNOSATO2,
|
||||
SCENE_16GORON_HOUSE,
|
||||
SCENE_12HAKUGINMAE,
|
||||
},
|
||||
{
|
||||
SCENE_14YUKIDAMANOMITI,
|
||||
SCENE_GORONRACE,
|
||||
SCENE_17SETUGEN,
|
||||
SCENE_17SETUGEN2,
|
||||
-1,
|
||||
},
|
||||
{
|
||||
SCENE_F01,
|
||||
SCENE_ROMANYMAE,
|
||||
SCENE_OMOYA,
|
||||
SCENE_F01C,
|
||||
SCENE_F01_B,
|
||||
SCENE_KOEPONARACE,
|
||||
},
|
||||
{ -1 },
|
||||
{
|
||||
SCENE_30GYOSON,
|
||||
SCENE_SINKAI,
|
||||
SCENE_31MISAKI,
|
||||
SCENE_TORIDE,
|
||||
SCENE_KAIZOKU,
|
||||
SCENE_33ZORACITY,
|
||||
},
|
||||
{
|
||||
SCENE_35TAKI,
|
||||
-1,
|
||||
},
|
||||
{
|
||||
SCENE_F40,
|
||||
SCENE_F41,
|
||||
SCENE_CASTLE,
|
||||
SCENE_IKANA,
|
||||
SCENE_REDEAD,
|
||||
-1,
|
||||
},
|
||||
};
|
||||
|
||||
#ifdef NON_EQUIVALENT
|
||||
// loop seems wrong?
|
||||
void func_8012EF0C(s16 arg0) {
|
||||
s16 i;
|
||||
s16 num;
|
||||
s16 sceneIndex;
|
||||
|
||||
if ((arg0 >= 0) && (arg0 < ARRAY_COUNT(D_801C2380))) {
|
||||
i = 0;
|
||||
num = 0;
|
||||
sceneIndex = D_801C2380[arg0][i];
|
||||
|
||||
while (sceneIndex != 0xFFFF) {
|
||||
sceneIndex = D_801C2380[arg0][i];
|
||||
if (sceneIndex < 0x20) {
|
||||
num = 0;
|
||||
} else if (sceneIndex < 0x40) {
|
||||
num = 1;
|
||||
} else if (sceneIndex < 0x60) {
|
||||
num = 2;
|
||||
} else if (sceneIndex < 0x80) {
|
||||
num = 3;
|
||||
} else if (sceneIndex < 0xA0) {
|
||||
num = 4;
|
||||
} else if (sceneIndex < 0xC0) {
|
||||
num = 5;
|
||||
} else if (sceneIndex < 0xE0) {
|
||||
num = 6;
|
||||
}
|
||||
|
||||
gSaveContext.roomInf[125][sceneIndex] |= gBitFlags[(-(num << 7)) + num];
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
gSaveContext.unk_F60 |= 3;
|
||||
} else if (i == 1) {
|
||||
gSaveContext.unk_F60 |= 0x1C;
|
||||
} else if (i == 2) {
|
||||
gSaveContext.unk_F60 |= 0xE0;
|
||||
} else if (i == 3) {
|
||||
gSaveContext.unk_F60 |= 0x100;
|
||||
} else if (i == 4) {
|
||||
gSaveContext.unk_F60 |= 0x1E00;
|
||||
} else if (i == 5) {
|
||||
gSaveContext.unk_F60 |= 0x6000;
|
||||
}
|
||||
}
|
||||
|
||||
dREG(82) = 0;
|
||||
}
|
||||
#else
|
||||
void func_8012EF0C(s16 arg0);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012EF0C.asm")
|
||||
#endif
|
||||
|
||||
void func_8012F0EC(s16 arg0);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012F0EC.asm")
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc
|
||||
void func_8012F1BC(s16 sceneIndex) {
|
||||
if (sceneIndex == SCENE_KINSTA1) {
|
||||
gSaveContext.roomInf[126][0] = ((((gSaveContext.roomInf[126][0] & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
|
||||
(gSaveContext.roomInf[126][0] & 0xFFFF);
|
||||
} else {
|
||||
gSaveContext.roomInf[126][0] =
|
||||
((gSaveContext.roomInf[126][0] + 1) & 0xFFFF) | (gSaveContext.roomInf[126][0] & 0xFFFF0000);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void func_8012F1BC(s16 arg0);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012F1BC.asm")
|
||||
#endif
|
||||
|
||||
s16 func_8012F22C(s16 sceneIndex) {
|
||||
if (sceneIndex == SCENE_KINSTA1) {
|
||||
return (gSaveContext.roomInf[126][0] & 0xFFFF0000) >> 0x10;
|
||||
} else {
|
||||
return gSaveContext.roomInf[126][0] & 0xFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8012F278(GlobalContext* globalCtx);
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012F278.asm")
|
||||
|
||||
u32 D_801C2410[] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
|
||||
0x01010101, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000101, 0x01000000, 0x01010101, 0x01010101, 0x01010101,
|
||||
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00010100, 0x00000101, 0x01010101,
|
||||
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000001, 0x00000001, 0x01000000,
|
||||
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01010101, 0x01010101, 0x01010101,
|
||||
0x00010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
|
||||
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
+18
-18
@@ -813,22 +813,22 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s16 func_800A7650(s16 dropId) {
|
||||
s16 maxLife;
|
||||
s16 healthCapacity;
|
||||
|
||||
if ((((dropId == ITEM00_BOMBS_A) || (dropId == ITEM00_BOMBS_0) || (dropId == ITEM00_BOMBS_B)) &&
|
||||
(gSaveContext.perm.inv.items[D_801C207E] == 0xFF)) ||
|
||||
(gSaveContext.inventory.items[gItemSlots[6]] == 0xFF)) ||
|
||||
(((dropId == ITEM00_ARROWS_10) || (dropId == ITEM00_ARROWS_30) || (dropId == ITEM00_ARROWS_40) ||
|
||||
(dropId == ITEM00_ARROWS_50)) &&
|
||||
(gSaveContext.perm.inv.items[D_801C2079] == 0xFF)) ||
|
||||
(((dropId == ITEM00_MAGIC_LARGE) || (dropId == ITEM00_MAGIC_SMALL)) && (gSaveContext.perm.unk24.unk14 == 0))) {
|
||||
(gSaveContext.inventory.items[gItemSlots[1]] == 0xFF)) ||
|
||||
(((dropId == ITEM00_MAGIC_LARGE) || (dropId == ITEM00_MAGIC_SMALL)) && (gSaveContext.magicLevel == 0))) {
|
||||
return ITEM00_NO_DROP;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
if (dropId == ITEM00_HEART) {
|
||||
maxLife = gSaveContext.perm.unk24.maxLife;
|
||||
if (maxLife == gSaveContext.perm.unk24.currentLife) {
|
||||
healthCapacity = gSaveContext.healthCapacity;
|
||||
if (healthCapacity == gSaveContext.health) {
|
||||
return ITEM00_RUPEE_GREEN;
|
||||
}
|
||||
}
|
||||
@@ -1071,9 +1071,9 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
|
||||
if (dropId == ITEM00_MASK) {
|
||||
dropQuantity = 1;
|
||||
if (gSaveContext.perm.unk20 != 1) {
|
||||
if (gSaveContext.perm.unk20 != 2) {
|
||||
if (gSaveContext.perm.unk20 != 4) {
|
||||
if (gSaveContext.playerForm != 1) {
|
||||
if (gSaveContext.playerForm != 2) {
|
||||
if (gSaveContext.playerForm != 4) {
|
||||
dropId = ITEM00_RUPEE_GREEN;
|
||||
} else {
|
||||
dropId = ITEM00_ARROWS_10;
|
||||
@@ -1102,39 +1102,39 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
}
|
||||
|
||||
if (dropId == ITEM00_FLEXIBLE) {
|
||||
if (gSaveContext.perm.unk24.currentLife < 0x11) {
|
||||
if (gSaveContext.health < 0x11) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
|
||||
spawnPos->z, 0, 0, 0, 2);
|
||||
func_800F0568(globalCtx, spawnPos, 0x28, 0x28E7);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gSaveContext.perm.unk24.currentLife < 0x31) {
|
||||
if (gSaveContext.health < 0x31) {
|
||||
params = 0x10;
|
||||
dropId = ITEM00_HEART;
|
||||
dropQuantity = 3;
|
||||
} else if (gSaveContext.perm.unk24.currentLife < 0x51) {
|
||||
} else if (gSaveContext.health < 0x51) {
|
||||
params = 0x10;
|
||||
dropId = ITEM00_HEART;
|
||||
dropQuantity = 1;
|
||||
} else if ((gSaveContext.perm.unk24.unk14 != 0) && (gSaveContext.perm.unk24.currentMagic == 0)) {
|
||||
} else if ((gSaveContext.magicLevel != 0) && (gSaveContext.magic == 0)) {
|
||||
params = 0xD0;
|
||||
dropId = ITEM00_MAGIC_LARGE;
|
||||
dropQuantity = 1;
|
||||
} else if ((gSaveContext.perm.unk24.unk14 != 0) &&
|
||||
((gSaveContext.perm.unk24.unk14 >> 1) >= gSaveContext.perm.unk24.currentMagic)) {
|
||||
} else if ((gSaveContext.magicLevel != 0) &&
|
||||
((gSaveContext.magicLevel >> 1) >= gSaveContext.magic)) {
|
||||
params = 0xD0;
|
||||
dropId = ITEM00_MAGIC_LARGE;
|
||||
dropQuantity = 1;
|
||||
} else if (gSaveContext.perm.inv.quantities[D_801C2078[1]] < 6) {
|
||||
} else if (gSaveContext.inventory.ammo[gItemSlots[1]] < 6) {
|
||||
params = 0xA0;
|
||||
dropId = ITEM00_ARROWS_30;
|
||||
dropQuantity = 1;
|
||||
} else if (gSaveContext.perm.inv.quantities[D_801C2078[6]] < 6) {
|
||||
} else if (gSaveContext.inventory.ammo[gItemSlots[6]] < 6) {
|
||||
params = 0xB0;
|
||||
dropId = ITEM00_BOMBS_A;
|
||||
dropQuantity = 1;
|
||||
} else if (gSaveContext.perm.unk24.unk14 < 11) {
|
||||
} else if (gSaveContext.rupees < 11) {
|
||||
params = 0xA0;
|
||||
dropId = ITEM00_RUPEE_RED;
|
||||
dropQuantity = 1;
|
||||
|
||||
+29
-29
@@ -148,12 +148,12 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s32 loadedCount;
|
||||
void* nextObject;
|
||||
s16 playerObjectId;
|
||||
u8 unk20;
|
||||
u8 playerForm;
|
||||
|
||||
globalCtx->linkActorEntry = (ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) +
|
||||
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
|
||||
if ((globalCtx->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
|
||||
(gSaveContext.extra.unk10 == 0x02 && gSaveContext.extra.unk42 == 0x0CFF)) {
|
||||
(gSaveContext.respawnFlag == 0x02 && gSaveContext.respawn[1].playerParams == 0x0CFF)) {
|
||||
// Skull Kid Object
|
||||
Object_Spawn(&globalCtx->objectCtx, OBJECT_STK);
|
||||
return;
|
||||
@@ -163,8 +163,8 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
nextObject = globalCtx2->objectCtx.status[globalCtx2->objectCtx.num].segment;
|
||||
globalCtx->objectCtx.num = loadedCount;
|
||||
globalCtx->objectCtx.spawnedObjectCount = loadedCount;
|
||||
unk20 = gSaveContext.perm.unk20;
|
||||
playerObjectId = gLinkFormObjectIndexes[unk20];
|
||||
playerForm = gSaveContext.playerForm;
|
||||
playerObjectId = gLinkFormObjectIndexes[playerForm];
|
||||
gActorOverlayTable[0].initInfo->objectId = playerObjectId;
|
||||
Object_Spawn(&globalCtx->objectCtx, playerObjectId);
|
||||
|
||||
@@ -384,7 +384,7 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
u32 dayTime;
|
||||
|
||||
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
|
||||
gSaveContext.extra.environmentTime = gSaveContext.perm.time =
|
||||
gSaveContext.environmentTime = gSaveContext.time =
|
||||
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
|
||||
}
|
||||
|
||||
@@ -394,32 +394,32 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->kankyoContext.unk2 = 0;
|
||||
}
|
||||
|
||||
if ((gSaveContext.perm.inv.items[0] == 0xFF) && (globalCtx->kankyoContext.unk2 != 0)) {
|
||||
if ((gSaveContext.inventory.items[0] == 0xFF) && (globalCtx->kankyoContext.unk2 != 0)) {
|
||||
globalCtx->kankyoContext.unk2 = 5;
|
||||
}
|
||||
|
||||
if (gSaveContext.extra.unk2b8 == 0) {
|
||||
if (gSaveContext.unk_3F58 == 0) {
|
||||
REG(15) = globalCtx->kankyoContext.unk2;
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.perm.time;
|
||||
dayTime = gSaveContext.time;
|
||||
globalCtx->kankyoContext.unk4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.perm.time;
|
||||
dayTime = gSaveContext.time;
|
||||
globalCtx->kankyoContext.unk8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.perm.time;
|
||||
dayTime = gSaveContext.time;
|
||||
globalCtx->kankyoContext.unkC = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
|
||||
|
||||
if (globalCtx->kankyoContext.unk2 == 0 && gSaveContext.perm.cutscene < 0xFFF0) {
|
||||
gSaveContext.extra.environmentTime = gSaveContext.perm.time;
|
||||
if (globalCtx->kankyoContext.unk2 == 0 && gSaveContext.cutscene < 0xFFF0) {
|
||||
gSaveContext.environmentTime = gSaveContext.time;
|
||||
|
||||
if (gSaveContext.extra.environmentTime >= 0x2AAA && gSaveContext.extra.environmentTime < 0x4555) {
|
||||
gSaveContext.extra.environmentTime = 0x3555;
|
||||
} else if (gSaveContext.extra.environmentTime >= 0x4555 && gSaveContext.extra.environmentTime < 0x5555) {
|
||||
gSaveContext.extra.environmentTime = 0x5555;
|
||||
} else if (gSaveContext.extra.environmentTime >= 0xAAAA && gSaveContext.extra.environmentTime < 0xB555) {
|
||||
gSaveContext.extra.environmentTime = 0xB555;
|
||||
} else if (gSaveContext.extra.environmentTime >= 0xC000 && gSaveContext.extra.environmentTime < 0xCAAA) {
|
||||
gSaveContext.extra.environmentTime = 0xCAAA;
|
||||
if (gSaveContext.environmentTime >= 0x2AAA && gSaveContext.environmentTime < 0x4555) {
|
||||
gSaveContext.environmentTime = 0x3555;
|
||||
} else if (gSaveContext.environmentTime >= 0x4555 && gSaveContext.environmentTime < 0x5555) {
|
||||
gSaveContext.environmentTime = 0x5555;
|
||||
} else if (gSaveContext.environmentTime >= 0xAAAA && gSaveContext.environmentTime < 0xB555) {
|
||||
gSaveContext.environmentTime = 0xB555;
|
||||
} else if (gSaveContext.environmentTime >= 0xC000 && gSaveContext.environmentTime < 0xCAAA) {
|
||||
gSaveContext.environmentTime = 0xCAAA;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void Scene_HeaderCmdSoundSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->unk814 = cmd->soundSettings.musicSeq;
|
||||
globalCtx->unk815 = cmd->soundSettings.nighttimeSFX;
|
||||
|
||||
if (gSaveContext.extra.unk276 == 0xFF || func_801A8A50(0) == 0x57) {
|
||||
if (gSaveContext.seqIndex == 0xFF || func_801A8A50(0) == 0x57) {
|
||||
audio_setBGM(cmd->soundSettings.bgmId);
|
||||
}
|
||||
}
|
||||
@@ -465,9 +465,9 @@ void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
SceneCmd** altHeaderList;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
if (gSaveContext.extra.sceneSetupIndex) {
|
||||
if (gSaveContext.sceneSetupIndex) {
|
||||
altHeaderList = (SceneCmd**)Lib_SegmentedToVirtual(cmd->altHeaders.segment);
|
||||
altHeader = altHeaderList[gSaveContext.extra.sceneSetupIndex - 1];
|
||||
altHeader = altHeaderList[gSaveContext.sceneSetupIndex - 1];
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ProcessHeader(globalCtx, (SceneCmd*)Lib_SegmentedToVirtual(altHeader));
|
||||
@@ -509,24 +509,24 @@ void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd)
|
||||
s16 i = 0;
|
||||
|
||||
while (true) {
|
||||
if (scenesPerMapArea[i].scenes[j] == 0xFFFF) {
|
||||
if (gScenesPerRegion[i][j] == 0xFFFF) {
|
||||
i++;
|
||||
j = 0;
|
||||
|
||||
if (i == (s32)(sizeof(scenesPerMapArea) / sizeof(SceneIdList))) {
|
||||
if (i == ARRAY_COUNT(gScenesPerRegion)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == scenesPerMapArea[i].scenes[j]) {
|
||||
if (globalCtx->sceneNum == gScenesPerRegion[i][j]) {
|
||||
break;
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
if (i < (s32)(sizeof(scenesPerMapArea) / sizeof(SceneIdList))) {
|
||||
gSaveContext.perm.mapsVisited = (gBitFlags[i] | gSaveContext.perm.mapsVisited) | gSaveContext.perm.mapsVisited;
|
||||
if (i < ARRAY_COUNT(gScenesPerRegion)) {
|
||||
gSaveContext.mapsVisited = (gBitFlags[i] | gSaveContext.mapsVisited) | gSaveContext.mapsVisited;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,5 +609,5 @@ u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup) {
|
||||
* Creates an entrance index from the current entrance index with the given spawn index.
|
||||
*/
|
||||
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex) {
|
||||
return Entrance_CreateIndex(gSaveContext.perm.entranceIndex >> 9, spawnIndex, 0);
|
||||
return Entrance_CreateIndex(gSaveContext.entranceIndex >> 9, spawnIndex, 0);
|
||||
}
|
||||
|
||||
@@ -2657,7 +2657,7 @@ static EntranceTableEntry* sCutsceneEntranceTable[] = {
|
||||
#define SCENE_ENTRANCE_NONE() \
|
||||
{ 0, NULL, NULL }
|
||||
|
||||
/*static*/ SceneEntranceTableEntry sSceneEntranceTable[] = {
|
||||
static SceneEntranceTableEntry sSceneEntranceTable[] = {
|
||||
SCENE_ENTRANCE(sMayorsResidenceEntranceTable, "Z2_SONCHONOIE"),
|
||||
SCENE_ENTRANCE(sMajorasLairEntranceTable, "Z2_LAST_BS"),
|
||||
SCENE_ENTRANCE(sMagicHagsPotionShopEntranceTable, "Z2_WITCH_SHOP"),
|
||||
|
||||
+10
-9
@@ -13,8 +13,8 @@ s32 func_8013A240(GlobalContext* globalCtx) {
|
||||
s32 seen;
|
||||
s32 count = 0;
|
||||
|
||||
gSaveContext.perm.pictoFlags0 = 0;
|
||||
gSaveContext.perm.pictoFlags1 = 0;
|
||||
gSaveContext.roomInf[123][3] = 0;
|
||||
gSaveContext.roomInf[123][4] = 0;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_20SICHITAI) {
|
||||
func_8013A41C(1);
|
||||
@@ -77,29 +77,30 @@ s32 func_8013A240(GlobalContext* globalCtx) {
|
||||
|
||||
void func_8013A41C(s32 flag) {
|
||||
if (flag < 0x20) {
|
||||
gSaveContext.perm.pictoFlags0 |= (1 << flag);
|
||||
gSaveContext.roomInf[123][3] |= (1 << flag);
|
||||
} else {
|
||||
flag &= 0x1F;
|
||||
gSaveContext.perm.pictoFlags1 |= (1 << flag);
|
||||
gSaveContext.roomInf[123][4] |= (1 << flag);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8013A46C(s32 flag) {
|
||||
if (flag < 0x20) {
|
||||
gSaveContext.perm.pictoFlags0 &= ~(1 << flag);
|
||||
gSaveContext.roomInf[123][3] &= ~(1 << flag);
|
||||
} else {
|
||||
flag &= 0x1F;
|
||||
gSaveContext.perm.pictoFlags1 &= ~(1 << flag);
|
||||
gSaveContext.roomInf[123][4] &= ~(1 << flag);
|
||||
}
|
||||
}
|
||||
|
||||
u32 func_8013A4C4(s32 flag) {
|
||||
SaveContextPerm* save = &gSaveContext.perm;
|
||||
SaveContext* saveCtx = &gSaveContext;
|
||||
|
||||
if (flag < 0x20) {
|
||||
return save->pictoFlags0 & (1 << flag);
|
||||
return saveCtx->roomInf[123][3] & (1 << flag);
|
||||
} else {
|
||||
flag &= 0x1F;
|
||||
return save->pictoFlags1 & (1 << flag);
|
||||
return saveCtx->roomInf[123][4] & (1 << flag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ void BgKin2Fence_HandleMaskCode(BgKin2Fence* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & 2) {
|
||||
hitMask = BgKin2Fence_CheckHitMask(this);
|
||||
if (hitMask >= 0) {
|
||||
nextMask = (s8)gSaveContext.perm.spiderHouseMaskOrder[this->masksHit];
|
||||
nextMask = (s8)gSaveContext.spiderHouseMaskOrder[this->masksHit];
|
||||
if (hitMask == nextMask) {
|
||||
play_sound(0x4807);
|
||||
this->masksHit += 1;
|
||||
|
||||
@@ -99,7 +99,7 @@ void BgLotus_Wait(BgLotus* this, GlobalContext* globalCtx) {
|
||||
EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 8);
|
||||
this->timer = 40;
|
||||
}
|
||||
if (gSaveContext.perm.unk20 != 3) {
|
||||
if (gSaveContext.playerForm != 3) {
|
||||
this->timer = 40;
|
||||
this->dyna.actor.flags |= 0x10;
|
||||
this->actionFunc = BgLotus_Sink;
|
||||
|
||||
@@ -30,7 +30,7 @@ const ActorInit Dm_Ravine_InitVars = {
|
||||
|
||||
void DmRavine_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DmRavine* this = THIS;
|
||||
u8 flag = gSaveContext.perm.weekEventReg[0];
|
||||
u8 flag = gSaveContext.weekEventReg[0];
|
||||
if (((flag & 0x10) | cREG(0)) != 0) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
return;
|
||||
|
||||
@@ -142,11 +142,11 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
|
||||
|
||||
func_80169E6C(globalCtx, 3, 0x4FF);
|
||||
|
||||
gSaveContext.extra.unk78 = this->actor.world.pos.y;
|
||||
gSaveContext.extra.unk80 = this->actor.home.rot.y;
|
||||
gSaveContext.respawn[3].pos.y = this->actor.world.pos.y;
|
||||
gSaveContext.respawn[3].yaw = this->actor.home.rot.y;
|
||||
|
||||
// save the params lower byte for En_Torch to decide what item to use in the grotto chest
|
||||
gSaveContext.extra.unk87 = GET_DOORANA_ITEMFLAGS(this);
|
||||
gSaveContext.respawn[3].data = GET_DOORANA_ITEMFLAGS(this);
|
||||
|
||||
// most grottos in the game use their zrotation as their entrance index, not params
|
||||
if (DOORANA_TYPE_ROTATION_ENTRANCE(entranceIndex)) {
|
||||
|
||||
@@ -63,7 +63,7 @@ void EnCha_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.home.rot.z = 0;
|
||||
this->actionFunc = EnCha_Idle;
|
||||
this->actor.home.rot.x = this->actor.home.rot.z;
|
||||
gSaveContext.perm.weekEventReg[60] &= 0xFB;
|
||||
gSaveContext.weekEventReg[60] &= 0xFB;
|
||||
}
|
||||
|
||||
void EnCha_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -85,16 +85,16 @@ void EnCha_Ring(EnCha* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.perm.weekEventReg[60] & 4) {
|
||||
if (gSaveContext.weekEventReg[60] & 4) {
|
||||
Audio_PlayActorSound2(&this->actor, 0x289E);
|
||||
gSaveContext.perm.weekEventReg[60] &= 0xFB;
|
||||
gSaveContext.weekEventReg[60] &= 0xFB;
|
||||
this->actor.home.rot.z = 0x7D0;
|
||||
}
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
Audio_PlayActorSound2(&this->actor, 0x289E);
|
||||
this->actor.home.rot.z = 0x7D0;
|
||||
if (!(gSaveContext.perm.weekEventReg[51] & 4)) {
|
||||
gSaveContext.perm.weekEventReg[51] |= 4;
|
||||
if (!(gSaveContext.weekEventReg[51] & 4)) {
|
||||
gSaveContext.weekEventReg[51] |= 4;
|
||||
this->actionFunc = EnCha_Ring;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,13 +111,13 @@ void EnGinkoMan_Idle(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
dYaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
|
||||
EnGinkoMan_SwitchAnimation(this, globalCtx);
|
||||
if (func_800B84D0(&this->actor, globalCtx)) { // Listen for dialogue start?
|
||||
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) {
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
|
||||
func_801518B0(globalCtx, 0x44C, &this->actor);
|
||||
this->curTextId = 0x44C; // would you like to make an account
|
||||
} else {
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
if ((CURRENT_DAY == 3) && (gSaveContext.perm.isNight == 1)) {
|
||||
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
|
||||
func_801518B0(globalCtx, 0x467, &this->actor);
|
||||
this->curTextId = 0x467; // "What's this? You need somethin' on a day like this?
|
||||
} else {
|
||||
@@ -151,7 +151,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
|
||||
case 0: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue)
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
if ((gSaveContext.perm.weekEventReg[10] & 8) != 0) {
|
||||
if ((gSaveContext.weekEventReg[10] & 8) != 0) {
|
||||
func_801518B0(globalCtx, 0x44E, &this->actor);
|
||||
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
|
||||
} else {
|
||||
@@ -185,7 +185,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
if (this->curTextId == 0x453) { // "That's it? That ain't nothing at all, big spender!
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
|
||||
}
|
||||
globalCtx->msgCtx.bankRupees = gSaveContext.perm.bankRupees & 0xFFFF;
|
||||
globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
|
||||
func_801518B0(globalCtx, 0x45A, &this->actor);
|
||||
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
|
||||
}
|
||||
@@ -200,11 +200,11 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
|
||||
/***** WARNING: this case is non-equivelent ****/
|
||||
|
||||
tempEDC = gSaveContext.perm.bankRupees & 0xFFFF;
|
||||
tempEDC = gSaveContext.roomInf[127][0] & 0xFFFF;
|
||||
if ((tempEDC >= 200) && (this->previousBankValue < 200) &&
|
||||
((gSaveContext.perm.weekEventReg[0x3B] & 0x40) == 0)) {
|
||||
((gSaveContext.weekEventReg[0x3B] & 0x40) == 0)) {
|
||||
// block_20:
|
||||
gSaveContext.perm.weekEventReg[0x3B] = gSaveContext.perm.weekEventReg[0x3B] | 0x40;
|
||||
gSaveContext.weekEventReg[0x3B] = gSaveContext.weekEventReg[0x3B] | 0x40;
|
||||
func_801518B0(globalCtx, 0x45B, &this->actor);
|
||||
this->curTextId = 0x45B; // "What's this? You've already saved up 200 Rupees!?!
|
||||
return;
|
||||
@@ -212,24 +212,24 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
|
||||
// "branch likely" when shouldn't be
|
||||
if ((tempEDC >= 1000) && ((this->previousBankValue) < 1000) &&
|
||||
(gSaveContext.perm.weekEventReg[0x3B] & 0x80) == 0) {
|
||||
(gSaveContext.weekEventReg[0x3B] & 0x80) == 0) {
|
||||
// block_24:
|
||||
gSaveContext.perm.weekEventReg[0x3B] |= 0x80;
|
||||
gSaveContext.weekEventReg[0x3B] |= 0x80;
|
||||
func_801518B0(globalCtx, 0x45C, &this->actor);
|
||||
this->curTextId = 0x45C; // "What's this? You've already saved up 1000 Rupees!?!
|
||||
return;
|
||||
} // bright blue arrow
|
||||
|
||||
if ((this->previousBankValue) >= 5000) { // added back in because missing
|
||||
if ((((s16)tempEDC) < 5000) && ((gSaveContext.perm.weekEventReg[0x3B] & 1) == 0)) {
|
||||
gSaveContext.perm.weekEventReg[0x3B] |= 1;
|
||||
if ((((s16)tempEDC) < 5000) && ((gSaveContext.weekEventReg[0x3B] & 1) == 0)) {
|
||||
gSaveContext.weekEventReg[0x3B] |= 1;
|
||||
func_801518B0(globalCtx, 0x45D, &this->actor);
|
||||
this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?!
|
||||
return;
|
||||
} else { // olive arrow
|
||||
// block_28:
|
||||
if (this->previousBankValue < gSaveContext.perm.bankRupees) {
|
||||
// if (*previousBankValue < gSaveContext.perm.bankRupees) {
|
||||
if (this->previousBankValue < gSaveContext.roomInf[127][0]) {
|
||||
// if (*previousBankValue < gSaveContext.roomInf[127][0]) {
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
func_801518B0(globalCtx, 0x45E, &this->actor);
|
||||
this->curTextId =
|
||||
@@ -277,7 +277,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
return;
|
||||
case 25: // "There! Now I'll know you when I see you!"
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
|
||||
globalCtx->msgCtx.bankRupees = gSaveContext.perm.bankRupees & 0xFFFF;
|
||||
globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
|
||||
func_801518B0(globalCtx, 0x45A, &this->actor);
|
||||
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
|
||||
return;
|
||||
@@ -293,10 +293,10 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
case 32: // "Ah, yes...[Link], right? If I remember, you're the little guy who deposited [rupees]."
|
||||
case 50: // "Your deposits total [rupees]."
|
||||
if (this->choiceDepositWithdrawl == GINKOMAN_CHOICE_DEPOSIT) {
|
||||
if ((u32)(gSaveContext.perm.bankRupees & 0xFFFF) >= 0x1388) {
|
||||
if ((u32)(gSaveContext.roomInf[127][0] & 0xFFFF) >= 0x1388) {
|
||||
func_801518B0(globalCtx, 0x45F, &this->actor);
|
||||
this->curTextId = 0x45F; // "Excuuuse me! But I can't take anymore deposits!
|
||||
} else if (gSaveContext.perm.unk24.currentRupees == 0) {
|
||||
} else if (gSaveContext.rupees == 0) {
|
||||
func_801518B0(globalCtx, 0x458, &this->actor);
|
||||
this->curTextId =
|
||||
0x458; // "Hmm...You play mean jokes, little guy! You haven't even got a single Rupee!
|
||||
@@ -304,7 +304,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
func_801518B0(globalCtx, 0x479, &this->actor);
|
||||
this->curTextId = 0x479; // "Well, are you gonna make a deposit?"
|
||||
}
|
||||
} else if ((CURRENT_DAY == 3) && (gSaveContext.perm.isNight == 1)) {
|
||||
} else if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
|
||||
func_801518B0(globalCtx, 0x46D, &this->actor);
|
||||
// "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just rumors!"
|
||||
this->curTextId = 0x46D;
|
||||
@@ -342,12 +342,12 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
|
||||
case 38: // "What's this? It's a waste to take out such a tiny bit! ...But if you say so!"
|
||||
case 39: // Use it wisely...
|
||||
case 40: // "Aw, you're taking out all that? If you spend it like that, it'll all be gone before you know it!"
|
||||
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) {
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
|
||||
func_801518B0(globalCtx, 0x478, &this->actor);
|
||||
// "Look, little guy, all the Rupees you deposited are gone, so you can't use that stamp anymore."
|
||||
this->curTextId = 0x478;
|
||||
} else {
|
||||
globalCtx->msgCtx.bankRupees = gSaveContext.perm.bankRupees & 0xFFFF;
|
||||
globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
|
||||
func_801518B0(globalCtx, 0x45A, &this->actor);
|
||||
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
|
||||
}
|
||||
@@ -386,13 +386,13 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
|
||||
case 0x44E: // "...So, what'll it be?
|
||||
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
|
||||
if ((gSaveContext.perm.bankRupees & 0xFFFF) >= 0x1388) {
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) >= 0x1388) {
|
||||
play_sound(0x4806); // NA_SE_SY_ERROR
|
||||
func_801518B0(globalCtx, 0x45F, &this->actor);
|
||||
this->curTextId = 0x45F; // bank full, cannot accept more
|
||||
return;
|
||||
} else {
|
||||
if (gSaveContext.perm.unk24.currentRupees > 0) {
|
||||
if (gSaveContext.rupees > 0) {
|
||||
func_8019F208(0x4806);
|
||||
func_801518B0(globalCtx, 0x44F, &this->actor);
|
||||
this->curTextId = 0x44F; // "All right! so..."
|
||||
@@ -413,7 +413,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
case 0x452: // Really? are you really depositing rupees?
|
||||
|
||||
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
|
||||
if (gSaveContext.perm.unk24.currentRupees < globalCtx->msgCtx.bankRupeesSelected) {
|
||||
if (gSaveContext.rupees < globalCtx->msgCtx.bankRupeesSelected) {
|
||||
play_sound(0x4806); // NA_SE_SY_ERROR
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
func_801518B0(globalCtx, 0x459, &this->actor);
|
||||
@@ -432,20 +432,20 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
func_801518B0(globalCtx, 0x453, &this->actor);
|
||||
this->curTextId = 0x453; // That's it? That aint nothing at all
|
||||
}
|
||||
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) {
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
|
||||
this->newAccountFlag = 1;
|
||||
}
|
||||
func_801159EC((s16) - (s32)globalCtx->msgCtx.bankRupeesSelected);
|
||||
this->previousBankValue = gSaveContext.perm.bankRupees;
|
||||
this->previousBankValue = gSaveContext.roomInf[127][0];
|
||||
|
||||
gSaveContext.perm.bankRupees =
|
||||
((gSaveContext.perm.bankRupees & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
|
||||
(gSaveContext.perm.bankRupees & 0xFFFF0000);
|
||||
gSaveContext.roomInf[127][0] =
|
||||
((gSaveContext.roomInf[127][0] & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
|
||||
(gSaveContext.roomInf[127][0] & 0xFFFF0000);
|
||||
}
|
||||
} else { // GINKOMAN_CHOICE_NO
|
||||
func_8019F230();
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) { // @B74
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) { // @B74
|
||||
func_801518B0(globalCtx, 0x456, &this->actor);
|
||||
this->curTextId = 0x456; // Is that so? think about it
|
||||
} else {
|
||||
@@ -481,7 +481,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
// 0xEDC: bankRupees
|
||||
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
|
||||
// s32 casts required for slt instead of sltu
|
||||
if ((s32)((gSaveContext.perm.bankRupees & 0xFFFF)) <
|
||||
if ((s32)((gSaveContext.roomInf[127][0] & 0xFFFF)) <
|
||||
((s32)(globalCtx->msgCtx.bankRupeesSelected + this->serviceFee))) {
|
||||
play_sound(0x4806); // NA_SE_SY_ERROR
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); // @ D30
|
||||
@@ -491,8 +491,8 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
}
|
||||
|
||||
// check if wallet is big enough
|
||||
if ((D_801C1E2C[(gSaveContext.perm.inv.unk48 & D_801C1DD0) >> D_801C1E08]) <
|
||||
(globalCtx->msgCtx.bankRupeesSelected + gSaveContext.perm.unk24.currentRupees)) {
|
||||
if ((D_801C1E2C[(gSaveContext.inventory.upgrades & gUpgradeMasks[4]) >> gUpgradeShifts[2]]) <
|
||||
(globalCtx->msgCtx.bankRupeesSelected + gSaveContext.rupees)) {
|
||||
play_sound(0x4806); // NA_SE_SY_ERROR
|
||||
func_801518B0(globalCtx, 0x475, &this->actor);
|
||||
this->curTextId = 0x475; // You can't hold that many in your wallet
|
||||
@@ -510,11 +510,11 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
func_801518B0(globalCtx, 0x472, &this->actor);
|
||||
this->curTextId = 0x472; // It's a waste to take out such a tiny bit
|
||||
}
|
||||
this->previousBankValue = (s16)gSaveContext.perm.bankRupees;
|
||||
gSaveContext.perm.bankRupees =
|
||||
(((gSaveContext.perm.bankRupees & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
|
||||
this->previousBankValue = (s16)gSaveContext.roomInf[127][0];
|
||||
gSaveContext.roomInf[127][0] =
|
||||
(((gSaveContext.roomInf[127][0] & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
|
||||
this->serviceFee) |
|
||||
(gSaveContext.perm.bankRupees & 0xFFFF0000);
|
||||
(gSaveContext.roomInf[127][0] & 0xFFFF0000);
|
||||
func_801159EC((s16)globalCtx->msgCtx.bankRupeesSelected, &gSaveContext); // cast req
|
||||
return;
|
||||
} else {
|
||||
@@ -546,7 +546,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
if (globalCtx->msgCtx.bankRupeesSelected == 0) {
|
||||
func_801518B0(globalCtx, 0x46F, &this->actor);
|
||||
this->curTextId = 0x46F; // "Zero Rupees?!? That's a cruel joke!"
|
||||
} else if (gSaveContext.perm.isNight == 1) {
|
||||
} else if (gSaveContext.isNight == 1) {
|
||||
func_801518B0(globalCtx, 0x477, &this->actor);
|
||||
this->curTextId = 0x477; // "...You know, at this time of day there's a 4 Rupee service charge...
|
||||
} else {
|
||||
@@ -604,15 +604,16 @@ void EnGinkoMan_BankAward(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
this->actor.parent = NULL;
|
||||
EnGinkoMan_SetupBankAward2(this);
|
||||
} else if (this->curTextId == 0x45B) { // "Whats this, you already saved up 200?"
|
||||
if (((&gSaveContext)->perm.weekEventReg[10] & 8) == 0) {
|
||||
if (!(gSaveContext.weekEventReg[10] & 8)) {
|
||||
func_800B8A1C(&this->actor, globalCtx,
|
||||
((u32)((s32)(&gSaveContext)->perm.inv.unk48 & D_801C1DD0) >> D_801C1E08) + 8, 500.0f, 100.0f);
|
||||
((u32)(gSaveContext.inventory.upgrades & gUpgradeMasks[4]) >> gUpgradeShifts[4]) + 8, 500.0f,
|
||||
100.0f);
|
||||
} else {
|
||||
func_800B8A1C(&this->actor, globalCtx, 2, 500.0f, 100.0f);
|
||||
}
|
||||
} else if (this->curTextId == 0x45C) { // "Whats this, you already saved up 5000?"
|
||||
func_800B8A1C(&this->actor, globalCtx, 2, 500.0f, 100.0f);
|
||||
} else if (((&gSaveContext)->perm.weekEventReg[0x3B] & 8) == 0) {
|
||||
} else if (!(gSaveContext.weekEventReg[0x3B] & 8)) {
|
||||
func_800B8A1C(&this->actor, globalCtx, 12, 500.0f, 100.0f);
|
||||
} else {
|
||||
func_800B8A1C(&this->actor, globalCtx, 2, 500.0f, 100.0f);
|
||||
@@ -631,10 +632,10 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
GlobalContext* gCtx; // = globalCtx;
|
||||
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
if (((gSaveContext.perm.weekEventReg[0xA] & 8) == 0) && (this->curTextId == 0x45B)) {
|
||||
if ((!(gSaveContext.weekEventReg[0xA] & 8)) && (this->curTextId == 0x45B)) {
|
||||
// "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take
|
||||
// it!"
|
||||
gSaveContext.perm.weekEventReg[0xA] |= 8;
|
||||
gSaveContext.weekEventReg[0xA] |= 8;
|
||||
func_801518B0(globalCtx, 0x47A, &this->actor);
|
||||
|
||||
if (1) { // might be fake, but it solves almost everything
|
||||
@@ -651,8 +652,8 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
} else if (this->curTextId == 0x45D) { // saved up 5000 rupees for HP
|
||||
gCtx = globalCtx;
|
||||
if ((func_80152498(&gCtx->msgCtx, globalCtx) == 6) && (func_80147624(globalCtx) != 0)) {
|
||||
if ((gSaveContext.perm.weekEventReg[0x3B] & 8) == 0) {
|
||||
gSaveContext.perm.weekEventReg[0x3B] |= 8;
|
||||
if (!(gSaveContext.weekEventReg[0x3B] & 8)) {
|
||||
gSaveContext.weekEventReg[0x3B] |= 8;
|
||||
}
|
||||
EnGinkoMan_SetupIdle(this);
|
||||
}
|
||||
@@ -686,8 +687,8 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
|
||||
case 0x469: // "Excuse me, but let me take a look at you..."
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
globalCtx->msgCtx.bankRupees = (gSaveContext.perm.bankRupees & 0xFFFF);
|
||||
if ((CURRENT_DAY == 3) && (gSaveContext.perm.isNight == 1)) {
|
||||
globalCtx->msgCtx.bankRupees = (gSaveContext.roomInf[127][0] & 0xFFFF);
|
||||
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
|
||||
func_801518B0(globalCtx, 0x46C, &this->actor);
|
||||
this->curTextId = 0x46C; // "Ah, yes...[Link], right?
|
||||
} else {
|
||||
|
||||
@@ -53,7 +53,5 @@ typedef enum {
|
||||
|
||||
// values to get wallet capacity
|
||||
extern u16 D_801C1E2C[]; // wallet capacities
|
||||
extern u32 D_801C1DD0; // bit mask for wallet size in savecontext
|
||||
extern u8 D_801C1E08; // bit shift on index to align
|
||||
|
||||
#endif // Z_EN_GINKO_MAN_H
|
||||
|
||||
@@ -117,7 +117,7 @@ void EnJcMato_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnJcMato* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (!(gSaveContext.owl.unk4 & 1)) {
|
||||
if (!(gSaveContext.eventInf[4] & 1)) {
|
||||
EnJcMato_CheckForHit(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ static u8 sChestContents[] = { 0x02, 0x04, 0x05, 0x06, 0x36, 0x3A, 0x14, 0x14 };
|
||||
|
||||
void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnTorch* this = THIS;
|
||||
s8 returnData = gSaveContext.extra.unk87;
|
||||
s8 returnData = gSaveContext.respawn[3].data;
|
||||
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0,
|
||||
|
||||
@@ -113,9 +113,9 @@ void func_80A66278(EnWarpUzu* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_80A66384(EnWarpUzu* this, GlobalContext* globalCtx) {
|
||||
globalCtx->nextEntranceIndex = 0x22A0;
|
||||
gSaveContext.extra.unk24 = globalCtx->nextEntranceIndex;
|
||||
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
|
||||
func_80169EFC(globalCtx);
|
||||
gSaveContext.extra.unk10 = -2;
|
||||
gSaveContext.respawnFlag = -2;
|
||||
this->actionFunc = EnWarpUzu_DoNothing;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ extern Gfx D_060011E0[];
|
||||
void ObjDinner_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjDinner* this = THIS;
|
||||
|
||||
if (gSaveContext.perm.isNight != 1 || (CURRENT_DAY == 3 && gSaveContext.perm.weekEventReg[0x16] & 1)) {
|
||||
if (gSaveContext.isNight != true || (CURRENT_DAY == 3 && gSaveContext.weekEventReg[0x16] & 1)) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
Actor_SetScale(&this->actor, 0.1f);
|
||||
|
||||
@@ -53,8 +53,8 @@ void ObjMoonStone_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.flags |= 9;
|
||||
func_80C0662C(this);
|
||||
} else {
|
||||
if ((gSaveContext.perm.weekEventReg[74] & 0x40) == 0) {
|
||||
if ((gSaveContext.perm.weekEventReg[74] & 0x80)) {
|
||||
if ((gSaveContext.weekEventReg[74] & 0x40) == 0) {
|
||||
if ((gSaveContext.weekEventReg[74] & 0x80)) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, 1, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, 0, 0, -1);
|
||||
}
|
||||
@@ -102,14 +102,14 @@ void func_80C0670C(ObjMoonStone* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80C0673C(ObjMoonStone* this) {
|
||||
if ((gSaveContext.perm.weekEventReg[74] & 0x80) == 0) {
|
||||
if ((gSaveContext.weekEventReg[74] & 0x80) == 0) {
|
||||
this->actor.draw = NULL;
|
||||
}
|
||||
this->actionFunc = func_80C06768;
|
||||
}
|
||||
|
||||
void func_80C06768(ObjMoonStone* this, GlobalContext* globalCtx) {
|
||||
if ((gSaveContext.perm.weekEventReg[74] & 0x80)) {
|
||||
if ((gSaveContext.weekEventReg[74] & 0x80)) {
|
||||
if (this->actor.draw == 0) {
|
||||
this->actor.draw = ObjMoonStone_Draw;
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, 1, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
@@ -133,7 +133,7 @@ void func_80C0685C(ObjMoonStone* this) {
|
||||
|
||||
void func_80C06870(ObjMoonStone* this, GlobalContext* globalCtx) {
|
||||
if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) {
|
||||
gSaveContext.perm.weekEventReg[74] |= 0x40;
|
||||
gSaveContext.weekEventReg[74] |= 0x40;
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,11 +197,11 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.extra.sceneSetupIndex == 2) && (globalCtx->csCtx.unk12 == 0)) {
|
||||
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk12 == 0)) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968);
|
||||
ObjTokeiStep_InitSteps(this);
|
||||
ObjTokeiStep_SetupBeginOpen(this);
|
||||
} else if (!((CURRENT_DAY != 3) || (gSaveContext.perm.time >= 0x4000)) || gSaveContext.perm.day >= 4) {
|
||||
} else if (!((CURRENT_DAY != 3) || (gSaveContext.time >= 0x4000)) || gSaveContext.day >= 4) {
|
||||
this->dyna.actor.draw = ObjTokeiStep_DrawOpen;
|
||||
ObjTokeiStep_InitStepsOpen(this);
|
||||
ObjTokeiStep_SetupDoNothingOpen(this);
|
||||
|
||||
Reference in New Issue
Block a user