mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 13:53:49 -07:00
Merge branch 'develop' of https://github.com/HarbourMasters/Shipwright into develop
This commit is contained in:
commit
16f52c03b9
287 changed files with 56540 additions and 4175 deletions
|
@ -10,8 +10,6 @@ void AudioHeap_DiscardSampleCaches(void);
|
|||
void AudioHeap_DiscardSampleBank(s32 sampleBankId);
|
||||
void AudioHeap_DiscardSampleBanks(void);
|
||||
|
||||
extern bool gUseLegacySD;
|
||||
|
||||
f32 func_800DDE20(f32 arg0) {
|
||||
return 256.0f * gAudioContext.audioBufferParameters.unkUpdatesPerFrameScaled / arg0;
|
||||
}
|
||||
|
@ -1205,15 +1203,6 @@ void AudioHeap_DiscardSampleCacheEntry(SampleCacheEntry* entry) {
|
|||
|
||||
void AudioHeap_UnapplySampleCache(SampleCacheEntry* entry, SoundFontSample* sample)
|
||||
{
|
||||
if (!gUseLegacySD)
|
||||
return;
|
||||
|
||||
if (sample != NULL) {
|
||||
if (sample->sampleAddr == entry->allocatedAddr) {
|
||||
sample->sampleAddr = entry->sampleAddr;
|
||||
sample->medium = entry->origMedium;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SampleCacheEntry* AudioHeap_AllocPersistentSampleCacheEntry(size_t size) {
|
||||
|
@ -1248,6 +1237,8 @@ void AudioHeap_DiscardSampleCaches(void) {
|
|||
s32 fontId;
|
||||
s32 j;
|
||||
|
||||
return;
|
||||
|
||||
numFonts = gAudioContext.soundFontTable->numEntries;
|
||||
for (fontId = 0; fontId < numFonts; fontId++) {
|
||||
sampleBankId1 = gAudioContext.soundFonts[fontId].sampleBankId1;
|
||||
|
@ -1317,6 +1308,8 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) {
|
|||
u32* fakematch;
|
||||
s32 pad[4];
|
||||
|
||||
return;
|
||||
|
||||
sampleBankTable = gAudioContext.sampleBankTable;
|
||||
numFonts = gAudioContext.soundFontTable->numEntries;
|
||||
change.oldAddr = AudioHeap_SearchCaches(SAMPLE_TABLE, CACHE_EITHER, sampleBankId);
|
||||
|
|
|
@ -82,8 +82,6 @@ char* fontMap[256];
|
|||
uintptr_t fontStart;
|
||||
uint32_t fontOffsets[8192];
|
||||
|
||||
bool gUseLegacySD = false;
|
||||
|
||||
void AudioLoad_DecreaseSampleDmaTtls(void) {
|
||||
u32 i;
|
||||
|
||||
|
@ -483,26 +481,15 @@ void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* ret
|
|||
u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts) {
|
||||
s32 index;
|
||||
|
||||
if (!gUseLegacySD)
|
||||
{
|
||||
if (seqId == 255)
|
||||
return NULL;
|
||||
if (seqId == 255)
|
||||
return NULL;
|
||||
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||
|
||||
if (sDat.numFonts == 0)
|
||||
return NULL;
|
||||
if (sDat.numFonts == 0)
|
||||
return NULL;
|
||||
|
||||
return sDat.fonts;
|
||||
} else {
|
||||
index = ((u16*)gAudioContext.sequenceFontTable)[seqId];
|
||||
|
||||
*outNumFonts = gAudioContext.sequenceFontTable[index++];
|
||||
if (*outNumFonts == 0) {
|
||||
return NULL;
|
||||
}
|
||||
return &gAudioContext.sequenceFontTable[index];
|
||||
}
|
||||
return sDat.fonts;
|
||||
}
|
||||
|
||||
void AudioLoad_DiscardSeqFonts(s32 seqId) {
|
||||
|
@ -578,38 +565,19 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
|
|||
s32 numFonts;
|
||||
s32 fontId;
|
||||
|
||||
if (gUseLegacySD && seqId >= gAudioContext.numSequences) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
AudioSeq_SequencePlayerDisable(seqPlayer);
|
||||
|
||||
fontId = 0xFF;
|
||||
index = ((u16*)gAudioContext.sequenceFontTable)[seqId];
|
||||
numFonts = gAudioContext.sequenceFontTable[index++];
|
||||
//index = ((u16*)gAudioContext.sequenceFontTable)[seqId];
|
||||
//numFonts = gAudioContext.sequenceFontTable[index++];
|
||||
|
||||
if (gUseLegacySD) {
|
||||
index = ((u16*)gAudioContext.sequenceFontTable)[seqId];
|
||||
numFonts = gAudioContext.sequenceFontTable[index++];
|
||||
SequenceData seqData2 = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||
|
||||
while (numFonts > 0) {
|
||||
fontId = gAudioContext.sequenceFontTable[index++];
|
||||
|
||||
AudioLoad_SyncLoadFont(fontId); // NOTE: If this is commented out, then enemies will play child link sounds...
|
||||
|
||||
numFonts--;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < seqData2.numFonts; i++)
|
||||
{
|
||||
SequenceData seqData2 = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||
|
||||
for (int i = 0; i < seqData2.numFonts; i++)
|
||||
{
|
||||
fontId = seqData2.fonts[i];
|
||||
AudioLoad_SyncLoadFont(fontId); // NOTE: If this is commented out, then enemies will play child link sounds...
|
||||
numFonts--;
|
||||
}
|
||||
fontId = seqData2.fonts[i];
|
||||
AudioLoad_SyncLoadFont(fontId); // NOTE: If this is commented out, then enemies will play child link sounds...
|
||||
//numFonts--;
|
||||
}
|
||||
|
||||
seqData = AudioLoad_SyncLoadSeq(seqId);
|
||||
|
@ -620,10 +588,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
|
|||
|
||||
AudioSeq_ResetSequencePlayer(seqPlayer);
|
||||
seqPlayer->seqId = seqId;
|
||||
if (gUseLegacySD)
|
||||
seqPlayer->defaultFont = AudioLoad_GetRealTableIndex(FONT_TABLE, fontId);
|
||||
else
|
||||
seqPlayer->defaultFont = fontId;
|
||||
seqPlayer->defaultFont = fontId;
|
||||
|
||||
seqPlayer->seqData = seqData;
|
||||
seqPlayer->enabled = 1;
|
||||
|
@ -667,8 +632,8 @@ uintptr_t AudioLoad_TrySyncLoadSampleBank(u32 sampleBankId, u32* outMedium, s32
|
|||
return ret;
|
||||
}
|
||||
|
||||
cachePolicy = sampleBankTable->entries[sampleBankId].cachePolicy;
|
||||
if (cachePolicy == 4 || noLoad == true) {
|
||||
//cachePolicy = sampleBankTable->entries[sampleBankId].cachePolicy;
|
||||
if (/* cachePolicy == 4 || */ noLoad == true) {
|
||||
*outMedium = sampleBankTable->entries[sampleBankId].medium;
|
||||
return sampleBankTable->entries[realTableId].romAddr;
|
||||
}
|
||||
|
@ -695,31 +660,24 @@ SoundFontData* AudioLoad_SyncLoadFont(u32 fontId) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!gUseLegacySD) {
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont
|
||||
(fontMap[fontId]);
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
|
||||
sampleBankId1 = sf->sampleBankId1;
|
||||
sampleBankId2 = sf->sampleBankId2;
|
||||
} else {
|
||||
|
||||
sampleBankId1 = gAudioContext.soundFonts[realFontId].sampleBankId1;
|
||||
sampleBankId2 = gAudioContext.soundFonts[realFontId].sampleBankId2;
|
||||
}
|
||||
sampleBankId1 = sf->sampleBankId1;
|
||||
sampleBankId2 = sf->sampleBankId2;
|
||||
|
||||
relocInfo.sampleBankId1 = sampleBankId1;
|
||||
relocInfo.sampleBankId2 = sampleBankId2;
|
||||
if (sampleBankId1 != 0xFF) {
|
||||
relocInfo.baseAddr1 = AudioLoad_TrySyncLoadSampleBank(sampleBankId1, &relocInfo.medium1, false);
|
||||
} else {
|
||||
//if (sampleBankId1 != 0xFF) {
|
||||
//relocInfo.baseAddr1 = AudioLoad_TrySyncLoadSampleBank(sampleBankId1, &relocInfo.medium1, false);
|
||||
//} else {
|
||||
relocInfo.baseAddr1 = 0;
|
||||
}
|
||||
//}
|
||||
|
||||
if (sampleBankId2 != 0xFF) {
|
||||
relocInfo.baseAddr2 = AudioLoad_TrySyncLoadSampleBank(sampleBankId2, &relocInfo.medium2, false);
|
||||
} else {
|
||||
//if (sampleBankId2 != 0xFF) {
|
||||
//relocInfo.baseAddr2 = AudioLoad_TrySyncLoadSampleBank(sampleBankId2, &relocInfo.medium2, false);
|
||||
//} else {
|
||||
relocInfo.baseAddr2 = 0;
|
||||
}
|
||||
//}
|
||||
|
||||
ret = AudioLoad_SyncLoad(FONT_TABLE, fontId, &didAllocate);
|
||||
if (ret == NULL) {
|
||||
|
@ -752,7 +710,7 @@ uintptr_t AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
|
|||
char* seqData = 0;
|
||||
SoundFont* fnt;
|
||||
|
||||
if (!gUseLegacySD && tableType == SEQUENCE_TABLE)
|
||||
if (tableType == SEQUENCE_TABLE)
|
||||
{
|
||||
SequenceData sData = ResourceMgr_LoadSeqByName(sequenceMap[id]);
|
||||
seqData = sData.seqData;
|
||||
|
@ -761,7 +719,7 @@ uintptr_t AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
|
|||
cachePolicy = sData.cachePolicy;
|
||||
romAddr = 0;
|
||||
}
|
||||
else if (!gUseLegacySD && tableType == FONT_TABLE)
|
||||
else if (tableType == FONT_TABLE)
|
||||
{
|
||||
fnt = ResourceMgr_LoadAudioSoundFont(fontMap[id]);
|
||||
size = sizeof(SoundFont);
|
||||
|
@ -771,12 +729,12 @@ uintptr_t AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
|
|||
}
|
||||
else
|
||||
{
|
||||
table = AudioLoad_GetLoadTable(tableType);
|
||||
size = table->entries[realId].size;
|
||||
//table = AudioLoad_GetLoadTable(tableType);
|
||||
//size = table->entries[realId].size;
|
||||
//size = ALIGN16(size);
|
||||
medium = table->entries[id].medium;
|
||||
cachePolicy = table->entries[id].cachePolicy;
|
||||
romAddr = table->entries[realId].romAddr;
|
||||
//medium = table->entries[id].medium;
|
||||
//cachePolicy = table->entries[id].cachePolicy;
|
||||
//romAddr = table->entries[realId].romAddr;
|
||||
}
|
||||
|
||||
switch (cachePolicy) {
|
||||
|
@ -811,13 +769,13 @@ uintptr_t AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
|
|||
if (medium == MEDIUM_UNK) {
|
||||
AudioLoad_SyncDmaUnkMedium(romAddr, ret, size, (s16)table->unkMediumParam);
|
||||
} else {
|
||||
if (!gUseLegacySD && tableType == SEQUENCE_TABLE && seqData != NULL) {
|
||||
if (tableType == SEQUENCE_TABLE && seqData != NULL) {
|
||||
AudioLoad_SyncDma(seqData, ret, size, medium);
|
||||
} else if (!gUseLegacySD && tableType == FONT_TABLE) {
|
||||
} else if (tableType == FONT_TABLE) {
|
||||
AudioLoad_SyncDma(fnt, ret, size, medium);
|
||||
}
|
||||
else {
|
||||
AudioLoad_SyncDma(romAddr, ret, size, medium);
|
||||
//AudioLoad_SyncDma(romAddr, ret, size, medium);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -843,17 +801,17 @@ uintptr_t AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
|
|||
|
||||
u32 AudioLoad_GetRealTableIndex(s32 tableType, u32 id)
|
||||
{
|
||||
if ((tableType == SEQUENCE_TABLE || tableType == FONT_TABLE) && !gUseLegacySD) {
|
||||
if ((tableType == SEQUENCE_TABLE || tableType == FONT_TABLE)) {
|
||||
return id;
|
||||
}
|
||||
|
||||
AudioTable* table = AudioLoad_GetLoadTable(tableType);
|
||||
//AudioTable* table = AudioLoad_GetLoadTable(tableType);
|
||||
|
||||
// If the size is 0, then this entry actually redirects to another entry.
|
||||
// The rom address is actually an index into the same table where the "real" data is.
|
||||
if (table->entries[id].size == 0) {
|
||||
id = table->entries[id].romAddr;
|
||||
}
|
||||
//if (table->entries[id].size == 0) {
|
||||
//id = table->entries[id].romAddr;
|
||||
//}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
@ -906,77 +864,37 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* mem, RelocInfo* relocInfo
|
|||
s32 numInstruments = 0;
|
||||
s32 numSfx = 0;
|
||||
|
||||
if (gUseLegacySD) {
|
||||
numDrums = gAudioContext.soundFonts[fontId].numDrums;
|
||||
numInstruments = gAudioContext.soundFonts[fontId].numInstruments;
|
||||
numSfx = gAudioContext.soundFonts[fontId].numSfx;
|
||||
} else {
|
||||
sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
numDrums = sf->numDrums;
|
||||
numInstruments = sf->numInstruments;
|
||||
numSfx = sf->numSfx;
|
||||
}
|
||||
sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
numDrums = sf->numDrums;
|
||||
numInstruments = sf->numInstruments;
|
||||
numSfx = sf->numSfx;
|
||||
|
||||
void** ptrs = (void**)mem;
|
||||
|
||||
#define BASE_OFFSET(x) (void*)((u32)(x) + (u32)(mem))
|
||||
|
||||
reloc2 = ptrs[0];
|
||||
if ((reloc2 != 0 || !gUseLegacySD) && (numDrums != 0))
|
||||
if ((numDrums != 0))
|
||||
{
|
||||
ptrs[0] = BASE_OFFSET(reloc2);
|
||||
for (i = 0; i < numDrums; i++)
|
||||
{
|
||||
if (gUseLegacySD)
|
||||
reloc = ((Drum**)ptrs[0])[i];
|
||||
drum = sf->drums[i];
|
||||
|
||||
if (reloc != 0 || !gUseLegacySD)
|
||||
if (!drum->loaded)
|
||||
{
|
||||
if (gUseLegacySD)
|
||||
{
|
||||
reloc = BASE_OFFSET(reloc);
|
||||
((Drum**)ptrs[0])[i] = drum = reloc;
|
||||
}
|
||||
|
||||
if (!gUseLegacySD)
|
||||
drum = sf->drums[i];
|
||||
|
||||
if (!drum->loaded)
|
||||
{
|
||||
if (!gUseLegacySD)
|
||||
{
|
||||
AudioLoad_RelocateSample(&sf->drums[i]->sound, mem, relocInfo, fontOffsets[fontId]);
|
||||
//reloc = drum->envelope;
|
||||
drum->loaded = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
AudioLoad_RelocateSample(&drum->sound, mem, relocInfo, fontOffsets[fontId]);
|
||||
reloc = drum->envelope;
|
||||
drum->envelope = BASE_OFFSET(reloc);
|
||||
drum->loaded = 1;
|
||||
}
|
||||
}
|
||||
AudioLoad_RelocateSample(&sf->drums[i]->sound, mem, relocInfo, fontOffsets[fontId]);
|
||||
drum->loaded = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reloc2 = ptrs[1];
|
||||
if ((reloc2 != 0 || !gUseLegacySD) && (numSfx != 0)) {
|
||||
if (numSfx != 0) {
|
||||
ptrs[1] = BASE_OFFSET(reloc2);
|
||||
for (i = 0; i < numSfx; i++) {
|
||||
reloc = (SoundFontSound*)ptrs[1] + i;
|
||||
if (reloc != 0 || !gUseLegacySD)
|
||||
{
|
||||
if (!gUseLegacySD) {
|
||||
AudioLoad_RelocateSample(&sf->soundEffects[i].sample, mem, relocInfo, fontOffsets[fontId]);
|
||||
} else {
|
||||
sfx = reloc;
|
||||
if (sfx->sample != NULL) {
|
||||
AudioLoad_RelocateSample(sfx, mem, relocInfo, fontOffsets[fontId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
AudioLoad_RelocateSample(&sf->soundEffects[i].sample, mem, relocInfo, fontOffsets[fontId]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -984,46 +902,28 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* mem, RelocInfo* relocInfo
|
|||
numInstruments = 0x7E;
|
||||
}
|
||||
|
||||
int startI = gUseLegacySD ? 2 : 0;
|
||||
int startEC = gUseLegacySD ? 2 + numInstruments - 1 : numInstruments - 1;
|
||||
//for (i = 2; i <= 2 + numInstruments - 1; i++) {
|
||||
int startI = 0;
|
||||
int startEC = numInstruments - 1;
|
||||
for (i = startI; i <= startEC; i++) {
|
||||
if (!gUseLegacySD || ptrs[i] != NULL)
|
||||
{
|
||||
ptrs[i] = BASE_OFFSET(ptrs[i]);
|
||||
ptrs[i] = BASE_OFFSET(ptrs[i]);
|
||||
inst = sf->instruments[i];
|
||||
|
||||
if (gUseLegacySD)
|
||||
inst = ptrs[i];
|
||||
else
|
||||
inst = sf->instruments[i];
|
||||
|
||||
if (inst != NULL && !inst->loaded) {
|
||||
if (inst->normalRangeLo != 0)
|
||||
{
|
||||
AudioLoad_RelocateSample(&inst->lowNotesSound, mem, relocInfo, fontOffsets[fontId]);
|
||||
}
|
||||
AudioLoad_RelocateSample(&inst->normalNotesSound, mem, relocInfo, fontOffsets[fontId]);
|
||||
if (inst->normalRangeHi != 0x7F) {
|
||||
AudioLoad_RelocateSample(&inst->highNotesSound, mem, relocInfo, fontOffsets[fontId]);
|
||||
}
|
||||
|
||||
reloc = inst->envelope;
|
||||
|
||||
if (gUseLegacySD)
|
||||
inst->envelope = BASE_OFFSET(reloc);
|
||||
|
||||
inst->loaded = 1;
|
||||
if (inst != NULL && !inst->loaded) {
|
||||
if (inst->normalRangeLo != 0)
|
||||
{
|
||||
AudioLoad_RelocateSample(&inst->lowNotesSound, mem, relocInfo, fontOffsets[fontId]);
|
||||
}
|
||||
AudioLoad_RelocateSample(&inst->normalNotesSound, mem, relocInfo, fontOffsets[fontId]);
|
||||
if (inst->normalRangeHi != 0x7F) {
|
||||
AudioLoad_RelocateSample(&inst->highNotesSound, mem, relocInfo, fontOffsets[fontId]);
|
||||
}
|
||||
|
||||
reloc = inst->envelope;
|
||||
inst->loaded = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#undef BASE_OFFSET
|
||||
|
||||
if (gUseLegacySD) {
|
||||
gAudioContext.soundFonts[fontId].drums = ptrs[0];
|
||||
gAudioContext.soundFonts[fontId].soundEffects = ptrs[1];
|
||||
gAudioContext.soundFonts[fontId].instruments = (Instrument**)(ptrs + 2);
|
||||
}
|
||||
}
|
||||
|
||||
void AudioLoad_SyncDma(uintptr_t devAddr, u8* addr, size_t size, s32 medium) {
|
||||
|
@ -1209,24 +1109,6 @@ s32 AudioLoad_AssertValidAddr(uintptr_t ramAddr, uintptr_t startAddr, size_t siz
|
|||
#define BASE_ROM_OFFSET(x) (uintptr_t)((uintptr_t)(x) + (uintptr_t)(romAddr))
|
||||
|
||||
void AudioLoad_InitSwapFontSampleHeaders(SoundFontSample* sample, uintptr_t romAddr) {
|
||||
size_t maxSoundFontSize = 0x3AA0; // soundFont 0 is the largest size at 0x3AA0
|
||||
AdpcmLoop* loop;
|
||||
AdpcmBook* book;
|
||||
|
||||
if (((uintptr_t)sample->loop > maxSoundFontSize) || ((uintptr_t)sample->book > maxSoundFontSize) ) {
|
||||
bswapSoundFontSample(sample);
|
||||
|
||||
loop = (AdpcmLoop*)BASE_ROM_OFFSET(sample->loop);
|
||||
if ((uint32_t)loop->end > (uint32_t)0xFFFF) {
|
||||
bswapAdpcmLoop(loop);
|
||||
}
|
||||
|
||||
book = (AdpcmBook*)BASE_ROM_OFFSET(sample->book);
|
||||
if (book->order > 0xFFFF) {
|
||||
bswapAdpcmBook(book);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void AudioLoad_InitSwapFont(void) {
|
||||
|
@ -1273,7 +1155,6 @@ void AudioLoad_InitSwapFont(void) {
|
|||
|
||||
if (drumList[i] != NULL) {
|
||||
drum = (Drum*)BASE_ROM_OFFSET(drumList[i]);
|
||||
bswapDrum(drum);
|
||||
|
||||
sample = (SoundFontSample*)BASE_ROM_OFFSET(drum->sound.sample);
|
||||
AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
|
||||
|
@ -1289,7 +1170,6 @@ void AudioLoad_InitSwapFont(void) {
|
|||
for (i = 0; i < numSfxs; i++) {
|
||||
|
||||
sfx = &sfxList[i];
|
||||
bswapSoundFontSound(sfx);
|
||||
|
||||
if (sfx->sample != NULL) {
|
||||
SoundFontSample* sample = (SoundFontSample*)BASE_ROM_OFFSET(sfx->sample);
|
||||
|
@ -1309,7 +1189,6 @@ void AudioLoad_InitSwapFont(void) {
|
|||
|
||||
if (instList[i] != NULL) {
|
||||
inst = BASE_ROM_OFFSET(instList[i]);
|
||||
bswapInstrument(inst);
|
||||
|
||||
if (inst->normalRangeLo != 0) {
|
||||
sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->lowNotesSound.sample);
|
||||
|
@ -1402,79 +1281,50 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
|
|||
gAudioContext.aiBuffers[i] = AudioHeap_AllocZeroed(&gAudioContext.audioInitPool, AIBUF_LEN * sizeof(s16));
|
||||
}
|
||||
|
||||
gAudioContext.sequenceTable = (AudioTable*)gSequenceTable;
|
||||
gAudioContext.soundFontTable = (AudioTable*)gSoundFontTable;
|
||||
gAudioContext.sampleBankTable = (AudioTable*)gSampleBankTable;
|
||||
gAudioContext.sequenceFontTable = gSequenceFontTable;
|
||||
gAudioContext.numSequences = gAudioContext.sequenceTable->numEntries;
|
||||
//gAudioContext.sequenceTable = (AudioTable*)gSequenceTable;
|
||||
//gAudioContext.soundFontTable = (AudioTable*)gSoundFontTable;
|
||||
//gAudioContext.sampleBankTable = (AudioTable*)gSampleBankTable;
|
||||
//gAudioContext.sequenceFontTable = gSequenceFontTable;
|
||||
//gAudioContext.numSequences = gAudioContext.sequenceTable->numEntries;
|
||||
|
||||
gAudioContext.audioResetSpecIdToLoad = 0;
|
||||
gAudioContext.resetStatus = 1;
|
||||
|
||||
AudioHeap_ResetStep();
|
||||
|
||||
uintptr_t seqStart = ResourceMgr_LoadFileRaw(_AudioseqSegmentRomStart);
|
||||
uintptr_t bankStart = ResourceMgr_LoadFileRaw(_AudiobankSegmentRomStart);
|
||||
uintptr_t tableStart = ResourceMgr_LoadFileRaw(_AudiotableSegmentRomStart);
|
||||
int seqListSize = 0;
|
||||
char** seqList = ResourceMgr_ListFiles("audio/sequences*", &seqListSize);
|
||||
|
||||
// If we have the old audioseq files present (and this is a 32-bit build), use the legacy audio system
|
||||
if (seqStart != NULL && bankStart != NULL && tableStart != NULL)
|
||||
gUseLegacySD = true;
|
||||
|
||||
fontStart = bankStart;
|
||||
|
||||
AudioLoad_InitTable(gAudioContext.sequenceTable, seqStart, 0);
|
||||
AudioLoad_InitTable(gAudioContext.soundFontTable, bankStart, 0);
|
||||
AudioLoad_InitTable(gAudioContext.sampleBankTable, tableStart, 0);
|
||||
|
||||
if (gUseLegacySD)
|
||||
numFonts = gAudioContext.soundFontTable->numEntries;
|
||||
|
||||
if (gUseLegacySD)
|
||||
for (size_t i = 0; i < seqListSize; i++)
|
||||
{
|
||||
gAudioContext.soundFonts = AudioHeap_Alloc(&gAudioContext.audioInitPool, numFonts * sizeof(SoundFont));
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(seqList[i]);
|
||||
|
||||
for (i = 0; i < numFonts; i++) {
|
||||
AudioLoad_InitSoundFontMeta(i);
|
||||
}
|
||||
char* str = malloc(strlen(seqList[i]) + 1);
|
||||
strcpy(str, seqList[i]);
|
||||
|
||||
AudioLoad_InitSwapFont();
|
||||
} else {
|
||||
int seqListSize = 0;
|
||||
char** seqList = ResourceMgr_ListFiles("audio/sequences*", &seqListSize);
|
||||
sequenceMap[sDat.seqNumber] = str;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < seqListSize; i++)
|
||||
{
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(seqList[i]);
|
||||
free(seqList);
|
||||
|
||||
char* str = malloc(strlen(seqList[i]) + 1);
|
||||
strcpy(str, seqList[i]);
|
||||
int fntListSize = 0;
|
||||
char** fntList = ResourceMgr_ListFiles("audio/fonts*", &fntListSize);
|
||||
|
||||
sequenceMap[sDat.seqNumber] = str;
|
||||
}
|
||||
for (int i = 0; i < fntListSize; i++)
|
||||
{
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fntList[i]);
|
||||
|
||||
free(seqList);
|
||||
char* str = malloc(strlen(fntList[i]) + 1);
|
||||
strcpy(str, fntList[i]);
|
||||
|
||||
int fntListSize = 0;
|
||||
char** fntList = ResourceMgr_ListFiles("audio/fonts*", &fntListSize);
|
||||
|
||||
for (int i = 0; i < fntListSize; i++)
|
||||
{
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fntList[i]);
|
||||
|
||||
char* str = malloc(strlen(fntList[i]) + 1);
|
||||
strcpy(str, fntList[i]);
|
||||
|
||||
fontMap[sf->fntIndex] = str;
|
||||
}
|
||||
fontMap[sf->fntIndex] = str;
|
||||
}
|
||||
|
||||
numFonts = fntListSize;
|
||||
|
||||
free(fntList);
|
||||
gAudioContext.soundFonts = AudioHeap_Alloc(&gAudioContext.audioInitPool, numFonts * sizeof(SoundFont));
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (temp_v0_3 = AudioHeap_Alloc(&gAudioContext.audioInitPool, D_8014A6C4.permanentPoolSize), temp_v0_3 == NULL) {
|
||||
// cast away const from D_8014A6C4
|
||||
|
@ -1648,11 +1498,6 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* isDone) {
|
|||
AudioTable* seqTable;
|
||||
size_t size;
|
||||
|
||||
if (gUseLegacySD && seqId >= gAudioContext.numSequences) {
|
||||
*isDone = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
seqId = AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId);
|
||||
seqTable = AudioLoad_GetLoadTable(SEQUENCE_TABLE);
|
||||
slowLoad = &gAudioContext.slowLoads[gAudioContext.slowLoadPos];
|
||||
|
@ -1663,19 +1508,11 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* isDone) {
|
|||
slowLoad->sample.sampleAddr = NULL;
|
||||
slowLoad->isDone = isDone;
|
||||
|
||||
if (!gUseLegacySD)
|
||||
{
|
||||
SequenceData sData = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||
char* seqData = sData.seqData;
|
||||
size = sData.seqDataSize;
|
||||
slowLoad->curDevAddr = seqData;
|
||||
slowLoad->medium = sData.medium;
|
||||
} else {
|
||||
size = seqTable->entries[seqId].size;
|
||||
size = ALIGN16(size);
|
||||
slowLoad->curDevAddr = seqTable->entries[seqId].romAddr;
|
||||
slowLoad->medium = seqTable->entries[seqId].medium;
|
||||
}
|
||||
SequenceData sData = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||
char* seqData = sData.seqData;
|
||||
size = sData.seqDataSize;
|
||||
slowLoad->curDevAddr = seqData;
|
||||
slowLoad->medium = sData.medium;
|
||||
|
||||
slowLoad->curRamAddr = ramAddr;
|
||||
slowLoad->status = LOAD_STATUS_START;
|
||||
|
@ -1889,61 +1726,10 @@ void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, size_t size) {
|
|||
void AudioLoad_AsyncDmaUnkMedium(uintptr_t devAddr, uintptr_t ramAddr, size_t size, s16 arg3) {
|
||||
}
|
||||
|
||||
#define RELOC(v, base) (reloc = (uintptr_t)((uintptr_t)(v) + (uintptr_t)(base)))
|
||||
|
||||
void AudioLoad_RelocateSample(SoundFontSound* sound, SoundFontData* mem, RelocInfo* relocInfo, int fontId) {
|
||||
size_t maxSoundBankSize = 0x3EB2A0; // sample bank 0 is largest size at 0x3EB2A0
|
||||
if (gUseLegacySD)
|
||||
{
|
||||
// NOTE: This is hack to detect whether or not the sample has been relocated.
|
||||
if ((uintptr_t)mem <= maxSoundBankSize) {
|
||||
assert("mem for sound font bank is too low.");
|
||||
}
|
||||
}
|
||||
|
||||
SoundFontSample* sample;
|
||||
void* reloc;
|
||||
|
||||
// NOTE: Seems precarious to assume the RAM is never <= 0x3EB2A0, but it largely works.
|
||||
if ((uintptr_t)sound->sample < maxSoundBankSize || !gUseLegacySD)
|
||||
{
|
||||
if (!gUseLegacySD) {
|
||||
SoundFontSample* sample2 = sound;
|
||||
} else {
|
||||
sample = sound->sample = RELOC(sound->sample, mem);
|
||||
|
||||
if (sample->size != 0 && sample->unk_bit25 != 1) {
|
||||
sample->loop = RELOC(sample->loop, mem);
|
||||
sample->book = RELOC(sample->book, mem);
|
||||
|
||||
// Resolve the sample medium 2-bit bitfield into a real value based on relocInfo.
|
||||
switch (sample->medium) {
|
||||
case 0:
|
||||
sample->sampleAddr = RELOC(sample->sampleAddr, relocInfo->baseAddr1);
|
||||
sample->medium = relocInfo->medium1;
|
||||
break;
|
||||
case 1:
|
||||
sample->sampleAddr = RELOC(sample->sampleAddr, relocInfo->baseAddr2);
|
||||
sample->medium = relocInfo->medium2;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
// Invalid? This leaves sample->medium as MEDIUM_CART and MEDIUM_DISK_DRIVE
|
||||
// respectively, and the sampleAddr unrelocated.
|
||||
break;
|
||||
}
|
||||
|
||||
sample->unk_bit25 = 1;
|
||||
if (sample->unk_bit26 && (sample->medium != MEDIUM_RAM)) {
|
||||
gAudioContext.usedSamples[gAudioContext.numUsedSamples++] = sample;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void AudioLoad_RelocateSample(SoundFontSound* sound, SoundFontData* mem, RelocInfo* relocInfo, int fontId)
|
||||
{
|
||||
}
|
||||
|
||||
#undef RELOC
|
||||
|
||||
void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* mem, RelocInfo* relocInfo, s32 async) {
|
||||
AudioPreloadReq* preload;
|
||||
AudioPreloadReq* topPreload;
|
||||
|
@ -2190,17 +1976,11 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, RelocInfo* relocInfo
|
|||
|
||||
gAudioContext.numUsedSamples = 0;
|
||||
|
||||
if (!gUseLegacySD) {
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
|
||||
numDrums = sf->numDrums;
|
||||
numInstruments = sf->numInstruments;
|
||||
numSfx = sf->numSfx;
|
||||
} else {
|
||||
numDrums = gAudioContext.soundFonts[fontId].numDrums;
|
||||
numInstruments = gAudioContext.soundFonts[fontId].numInstruments;
|
||||
numSfx = gAudioContext.soundFonts[fontId].numSfx;
|
||||
}
|
||||
numDrums = sf->numDrums;
|
||||
numInstruments = sf->numInstruments;
|
||||
numSfx = sf->numSfx;
|
||||
|
||||
for (i = 0; i < numInstruments; i++) {
|
||||
instrument = Audio_GetInstrumentInner(fontId, i);
|
||||
|
@ -2326,15 +2106,11 @@ void AudioLoad_LoadPermanentSamples(void) {
|
|||
fontId = AudioLoad_GetRealTableIndex(FONT_TABLE, gAudioContext.permanentCache[i].id);
|
||||
//fontId = gAudioContext.permanentCache[i].id;
|
||||
|
||||
if (!gUseLegacySD) {
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
relocInfo.sampleBankId1 = sf->sampleBankId1;
|
||||
relocInfo.sampleBankId2 = sf->sampleBankId2;
|
||||
} else {
|
||||
relocInfo.sampleBankId1 = gAudioContext.soundFonts[fontId].sampleBankId1;
|
||||
relocInfo.sampleBankId2 = gAudioContext.soundFonts[fontId].sampleBankId2;
|
||||
}
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
relocInfo.sampleBankId1 = sf->sampleBankId1;
|
||||
relocInfo.sampleBankId2 = sf->sampleBankId2;
|
||||
|
||||
/*
|
||||
if (relocInfo.sampleBankId1 != 0xFF) {
|
||||
relocInfo.sampleBankId1 = AudioLoad_GetRealTableIndex(SAMPLE_TABLE, relocInfo.sampleBankId1);
|
||||
relocInfo.medium1 = sampleBankTable->entries[relocInfo.sampleBankId1].medium;
|
||||
|
@ -2344,6 +2120,8 @@ void AudioLoad_LoadPermanentSamples(void) {
|
|||
relocInfo.sampleBankId2 = AudioLoad_GetRealTableIndex(SAMPLE_TABLE, relocInfo.sampleBankId2);
|
||||
relocInfo.medium2 = sampleBankTable->entries[relocInfo.sampleBankId2].medium;
|
||||
}
|
||||
*/
|
||||
|
||||
AudioLoad_PreloadSamplesForFont(fontId, false, &relocInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -288,7 +288,8 @@ void Audio_ProcessNotes(void) {
|
|||
|
||||
f32 resampRate = gAudioContext.audioBufferParameters.resampleRate;
|
||||
|
||||
if (!gUseLegacySD && !noteSubEu2->bitField1.isSyntheticWave && noteSubEu2->sound.soundFontSound != NULL &&
|
||||
// CUSTOM SAMPLE CHECK
|
||||
if (!noteSubEu2->bitField1.isSyntheticWave && noteSubEu2->sound.soundFontSound != NULL &&
|
||||
noteSubEu2->sound.soundFontSound->sample != NULL &&
|
||||
noteSubEu2->sound.soundFontSound->sample->sampleRateMagicValue == 'RIFF') {
|
||||
resampRate = CALC_RESAMPLE_FREQ(noteSubEu2->sound.soundFontSound->sample->sampleRate);
|
||||
|
@ -330,24 +331,12 @@ Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId) {
|
|||
}
|
||||
|
||||
int instCnt = 0;
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
|
||||
if (gUseLegacySD) {
|
||||
instCnt = gAudioContext.soundFonts[fontId].numInstruments;
|
||||
inst = gAudioContext.soundFonts[fontId].instruments[instId];
|
||||
if (instId >= sf->numInstruments)
|
||||
return NULL;
|
||||
|
||||
if (instId >= gAudioContext.soundFonts[fontId].numInstruments)
|
||||
if (instId >= instCnt) {
|
||||
gAudioContext.audioErrorFlags = ((fontId << 8) + instId) + 0x3000000;
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
|
||||
if (instId >= sf->numInstruments)
|
||||
return NULL;
|
||||
|
||||
inst = sf->instruments[instId];
|
||||
}
|
||||
inst = sf->instruments[instId];
|
||||
|
||||
if (inst == NULL) {
|
||||
gAudioContext.audioErrorFlags = ((fontId << 8) + instId) + 0x1000000;
|
||||
|
@ -369,18 +358,10 @@ Drum* Audio_GetDrum(s32 fontId, s32 drumId) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (gUseLegacySD) {
|
||||
if (drumId >= gAudioContext.soundFonts[fontId].numDrums) {
|
||||
gAudioContext.audioErrorFlags = ((fontId << 8) + drumId) + 0x4000000;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
drum = gAudioContext.soundFonts[fontId].drums[drumId];
|
||||
} else {
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
drum = sf->drums[drumId];
|
||||
}
|
||||
|
||||
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
drum = sf->drums[drumId];
|
||||
|
||||
if (drum == NULL) {
|
||||
gAudioContext.audioErrorFlags = ((fontId << 8) + drumId) + 0x5000000;
|
||||
}
|
||||
|
@ -400,17 +381,8 @@ SoundFontSound* Audio_GetSfx(s32 fontId, s32 sfxId) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (gUseLegacySD) {
|
||||
if (sfxId >= gAudioContext.soundFonts[fontId].numSfx) {
|
||||
gAudioContext.audioErrorFlags = ((fontId << 8) + sfxId) + 0x4000000;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sfx = &gAudioContext.soundFonts[fontId].soundEffects[sfxId];
|
||||
} else {
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
sfx = &sf->soundEffects[sfxId];
|
||||
}
|
||||
SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]);
|
||||
sfx = &sf->soundEffects[sfxId];
|
||||
|
||||
if (sfx == NULL) {
|
||||
gAudioContext.audioErrorFlags = ((fontId << 8) + sfxId) + 0x5000000;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
|
||||
extern bool gUseLegacySD;
|
||||
extern char* sequenceMap[256];
|
||||
|
||||
#define PORTAMENTO_IS_SPECIAL(x) ((x).mode & 0x80)
|
||||
|
@ -1062,18 +1061,14 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
|||
result = (u8)parameters[0];
|
||||
command = (u8)parameters[0];
|
||||
|
||||
if (seqPlayer->defaultFont != 0xFF) {
|
||||
if (gUseLegacySD) {
|
||||
offset = ((u16*)gAudioContext.sequenceFontTable)[seqPlayer->seqId];
|
||||
lowBits = gAudioContext.sequenceFontTable[offset];
|
||||
command = gAudioContext.sequenceFontTable[offset + lowBits - result];
|
||||
} else {
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]);
|
||||
command = sDat.fonts[sDat.numFonts - result - 1];
|
||||
}
|
||||
if (seqPlayer->defaultFont != 0xFF)
|
||||
{
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]);
|
||||
command = sDat.fonts[sDat.numFonts - result - 1];
|
||||
}
|
||||
|
||||
if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command)) {
|
||||
if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command))
|
||||
{
|
||||
channel->fontId = command;
|
||||
}
|
||||
|
||||
|
@ -1178,18 +1173,20 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
|||
result = (u8)parameters[0];
|
||||
command = (u8)parameters[0];
|
||||
|
||||
if (seqPlayer->defaultFont != 0xFF) {
|
||||
if (gUseLegacySD) {
|
||||
offset = ((u16*)gAudioContext.sequenceFontTable)[seqPlayer->seqId];
|
||||
lowBits = gAudioContext.sequenceFontTable[offset];
|
||||
command = gAudioContext.sequenceFontTable[offset + lowBits - result];
|
||||
} else {
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]);
|
||||
command = sDat.fonts[sDat.numFonts - result - 1];
|
||||
}
|
||||
if (seqPlayer->defaultFont != 0xFF)
|
||||
{
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]);
|
||||
|
||||
// The game apparantely would sometimes do negative array lookups, the result of which would get rejected by AudioHeap_SearchCaches, never
|
||||
// changing the actual fontid.
|
||||
if (result > sDat.numFonts)
|
||||
break;
|
||||
|
||||
command = sDat.fonts[(sDat.numFonts - result - 1)];
|
||||
}
|
||||
|
||||
if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command)) {
|
||||
if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command))
|
||||
{
|
||||
channel->fontId = command;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <string.h>
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
|
@ -9,6 +10,9 @@ ViMode sViMode;
|
|||
FaultClient sGameFaultClient;
|
||||
u16 sLastButtonPressed;
|
||||
|
||||
// Forward declared, because this in a C++ header.
|
||||
int gfx_create_framebuffer(uint32_t width, uint32_t height);
|
||||
|
||||
void GameState_FaultPrint(void) {
|
||||
static char sBtnChars[] = "ABZSuldr*+LRudlr";
|
||||
s32 i;
|
||||
|
|
|
@ -433,6 +433,7 @@ static void RunFrame()
|
|||
{
|
||||
u32 size;
|
||||
char faultMsg[0x50];
|
||||
static bool hasSetupSkybox = false;
|
||||
|
||||
switch (runFrameContext.state) {
|
||||
case 0:
|
||||
|
@ -465,6 +466,14 @@ static void RunFrame()
|
|||
}
|
||||
GameState_Init(runFrameContext.gameState, runFrameContext.ovl->init, &runFrameContext.gfxCtx);
|
||||
|
||||
// Setup the normal skybox once before entering any game states to avoid the 0xabababab crash.
|
||||
// The crash is due to certain skyboxes not loading all the data they need from Skybox_Setup.
|
||||
if (!hasSetupSkybox) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)runFrameContext.gameState;
|
||||
Skybox_Setup(globalCtx, &globalCtx->skyboxCtx, SKYBOX_NORMAL_SKY);
|
||||
hasSetupSkybox = true;
|
||||
}
|
||||
|
||||
uint64_t freq = GetFrequency();
|
||||
|
||||
while (GameState_IsRunning(runFrameContext.gameState))
|
||||
|
|
|
@ -269,7 +269,7 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) {
|
|||
input->press.stick_y += (s8)(input->cur.stick_y - input->prev.stick_y);
|
||||
}
|
||||
|
||||
controllerCallback.rumble = CVar_GetS32("gRumbleEnabled", 0) && (padMgr->rumbleEnable[0] > 0);
|
||||
controllerCallback.rumble = (padMgr->rumbleEnable[0] > 0);
|
||||
|
||||
if (HealthMeter_IsCritical()) {
|
||||
controllerCallback.ledColor = 0;
|
||||
|
|
|
@ -843,9 +843,12 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
|
|||
case SCENE_GERUDOWAY:
|
||||
texture = gThievesHideoutTitleCardENGTex;
|
||||
break;
|
||||
case SCENE_GANONTIKA:
|
||||
case SCENE_GANON_TOU:
|
||||
texture = gGanonsCastleTitleCardENGTex;
|
||||
break;
|
||||
case SCENE_GANONTIKA:
|
||||
texture = gInsideGanonsCastleTitleCardENGTex;
|
||||
break;
|
||||
case SCENE_TAKARAYA:
|
||||
texture = gTreasureBoxShopTitleCardENGTex;
|
||||
break;
|
||||
|
@ -1968,6 +1971,24 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
|
||||
if (((player->heldActor != NULL) && (getItemId > GI_NONE) && (getItemId < GI_MAX)) ||
|
||||
(!(player->stateFlags1 & 0x20000800))) {
|
||||
if ((getItemId != GI_NONE)) {
|
||||
player->getItemId = getItemId;
|
||||
player->interactRangeActor = &player->actor;
|
||||
player->getItemDirection = player->actor.shape.rot.y;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
|
@ -5960,3 +5981,58 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 GetChestGameRandoGetItemId(s8 room, s16 ogDrawId, GlobalContext* globalCtx) {
|
||||
if (GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) {
|
||||
// RANDOTODO update this logic when we implement keysanity
|
||||
// because 3drando replaces the keys not the rupees
|
||||
if (ogDrawId == GID_RUPEE_GREEN ||
|
||||
ogDrawId == GID_RUPEE_BLUE ||
|
||||
ogDrawId == GID_RUPEE_RED)
|
||||
{
|
||||
switch(room) {
|
||||
case 1:
|
||||
if(!Flags_GetCollectible(globalCtx, 0x1B)) {
|
||||
return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_1, GI_RUPEE_GREEN);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(!Flags_GetCollectible(globalCtx, 0x1C)) {
|
||||
return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_2, GI_RUPEE_GREEN);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(!Flags_GetCollectible(globalCtx, 0x1D)) {
|
||||
return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_3, GI_RUPEE_BLUE);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if(!Flags_GetCollectible(globalCtx, 0x1E)) {
|
||||
return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_4, GI_RUPEE_BLUE);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if(!Flags_GetCollectible(globalCtx, 0x1F)) {
|
||||
return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_5, GI_RUPEE_RED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ogDrawId == GID_HEART_PIECE) {
|
||||
return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_REWARD, GI_HEART_PIECE);
|
||||
}
|
||||
|
||||
return GI_NONE;
|
||||
}
|
||||
|
||||
s16 GetChestGameRandoGiDrawId(s8 room, s16 ogDrawId, GlobalContext* globalCtx) {
|
||||
s32 randoGetItemId = GetChestGameRandoGetItemId(room, ogDrawId, globalCtx);
|
||||
|
||||
if(randoGetItemId != GI_NONE) {
|
||||
return GetItemModelFromId(randoGetItemId);
|
||||
}
|
||||
|
||||
return ogDrawId;
|
||||
}
|
||||
|
|
|
@ -1584,9 +1584,19 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
|||
BgCheck_SetSubdivisionDimension(colCtx->minBounds.z, colCtx->subdivAmount.z, &colCtx->maxBounds.z,
|
||||
&colCtx->subdivLength.z, &colCtx->subdivLengthInv.z);
|
||||
|
||||
#ifdef _SOH64 // BGCheck needs more memory on 64 bits because it crashes on some areas
|
||||
// OTRTODO: Re-enable when the below DynaPoly workaround is removed.
|
||||
// #ifdef _SOH64 // BGCheck needs more memory on 64 bits because it crashes on some areas
|
||||
// colCtx->memSize *= 2;
|
||||
// #endif
|
||||
|
||||
// BGCheck needs a higher polygon and vertex count due to removed object dependencies.
|
||||
// Otherwise Forest Temple checkered room will crash due to the hallway actor being killed a frame late.
|
||||
//
|
||||
// OTRTODO: This is a workaround. The proper solution to fix this crash is to manage object loading / unloading
|
||||
// the same as N64.
|
||||
colCtx->memSize *= 2;
|
||||
#endif
|
||||
colCtx->dyna.polyListMax *= 2;
|
||||
colCtx->dyna.vtxListMax *= 2;
|
||||
|
||||
memSize = colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y * colCtx->subdivAmount.z +
|
||||
colCtx->colHeader->numPolygons * sizeof(u8) + colCtx->dyna.polyNodesMax * sizeof(SSNode) +
|
||||
|
|
|
@ -1409,7 +1409,125 @@ s32 Camera_Noop(Camera* camera) {
|
|||
return true;
|
||||
}
|
||||
|
||||
s32 SetCameraManual(Camera* camera) {
|
||||
f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x;
|
||||
f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y;
|
||||
|
||||
if ((fabsf(newCamX) >= 15.0f || fabsf(newCamY) >= 15.0f) && camera->globalCtx->manualCamera == false) {
|
||||
camera->globalCtx->manualCamera = true;
|
||||
|
||||
VecSph eyeAdjustment;
|
||||
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &camera->at, &camera->eye);
|
||||
|
||||
camera->globalCtx->camX = eyeAdjustment.yaw;
|
||||
camera->globalCtx->camY = eyeAdjustment.pitch;
|
||||
}
|
||||
|
||||
if (camera->globalCtx->manualCamera) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 Camera_Free(Camera* camera) {
|
||||
Normal1* norm1 = (Normal1*)camera->paramData;
|
||||
|
||||
f32 playerHeight = Player_GetHeight(camera->player);
|
||||
f32 sp94;
|
||||
CamColChk camBgChk;
|
||||
PosRot* playerPosRot = &camera->playerPosRot;
|
||||
Vec3f at;
|
||||
|
||||
sCameraInterfaceFlags = norm1->interfaceFlags;
|
||||
|
||||
if (RELOAD_PARAMS) {
|
||||
VecSph eyeAdjustment1;
|
||||
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment1, &camera->at, &camera->eye);
|
||||
|
||||
camera->globalCtx->camX = eyeAdjustment1.yaw;
|
||||
camera->globalCtx->camY = eyeAdjustment1.pitch;
|
||||
|
||||
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
|
||||
f32 yNormal = (1.0f + PCT(R_CAM_YOFFSET_NORM) - PCT(R_CAM_YOFFSET_NORM) * (68.0f / playerHeight));
|
||||
sp94 = yNormal * PCT(playerHeight);
|
||||
|
||||
norm1->yOffset = NEXTSETTING * sp94;
|
||||
norm1->distMin = NEXTSETTING * sp94;
|
||||
norm1->distMax = NEXTSETTING * sp94;
|
||||
norm1->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
norm1->unk_0C = NEXTSETTING;
|
||||
norm1->unk_10 = NEXTSETTING;
|
||||
norm1->unk_14 = NEXTPCT;
|
||||
norm1->fovTarget = NEXTSETTING;
|
||||
norm1->atLERPScaleMax = NEXTPCT;
|
||||
norm1->interfaceFlags = NEXTSETTING;
|
||||
}
|
||||
|
||||
if (R_RELOAD_CAM_PARAMS) {
|
||||
Camera_CopyPREGToModeValues(camera);
|
||||
}
|
||||
|
||||
VecSph eyeAdjustment;
|
||||
const f32 camSpeed = 0.5f;
|
||||
|
||||
camera->animState = 0;
|
||||
|
||||
at.x = Camera_LERPCeilF(camera->player->actor.world.pos.x, camera->at.x, camSpeed, 1.0f);
|
||||
at.y = Camera_LERPCeilF(camera->player->actor.world.pos.y + (camera->player->rideActor != NULL ? Player_GetHeight(camera->player) / 2 : Player_GetHeight(camera->player)) / 1.2f, camera->at.y, camSpeed, 1.0f);
|
||||
at.z = Camera_LERPCeilF(camera->player->actor.world.pos.z, camera->at.z, camSpeed, 1.0f);
|
||||
|
||||
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &at, &camera->eye);
|
||||
|
||||
camBgChk.pos = camera->eye;
|
||||
|
||||
float maxRadius = 150.0f;
|
||||
if (Camera_BGCheckInfo(camera, &at, &camBgChk)) {
|
||||
VecSph collSphere;
|
||||
OLib_Vec3fDiffToVecSphGeo(&collSphere, &at, &camBgChk.pos);
|
||||
float rad = collSphere.r;
|
||||
|
||||
if (rad >= maxRadius) {
|
||||
camera->dist = eyeAdjustment.r = Camera_LERPCeilF(maxRadius, camera->dist, camSpeed / 4, 1.0f);
|
||||
} else {
|
||||
camera->dist = eyeAdjustment.r = rad;
|
||||
}
|
||||
} else {
|
||||
camera->dist = eyeAdjustment.r = Camera_LERPCeilF(maxRadius, camera->dist, camSpeed / 4, 1.0f);
|
||||
}
|
||||
|
||||
f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x;
|
||||
f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y;
|
||||
|
||||
camera->globalCtx->camX += newCamX;
|
||||
camera->globalCtx->camY += newCamY;
|
||||
|
||||
if (camera->globalCtx->camY > 0x32A4) {
|
||||
camera->globalCtx->camY = 0x32A4;
|
||||
}
|
||||
if (camera->globalCtx->camY < -0x228C) {
|
||||
camera->globalCtx->camY = -0x228C;
|
||||
}
|
||||
|
||||
eyeAdjustment.yaw = camera->globalCtx->camX;
|
||||
eyeAdjustment.pitch = camera->globalCtx->camY;
|
||||
|
||||
Camera_Vec3fVecSphGeoAdd(&camera->eye, &at, &eyeAdjustment);
|
||||
|
||||
camera->at = at;
|
||||
camera->fov = Camera_LERPCeilF(60.0f, camera->fov, camSpeed / 2, 1.0f);
|
||||
camera->roll = 0;
|
||||
camera->eyeNext = camera->eye;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 Camera_Normal1(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -1637,6 +1755,11 @@ s32 Camera_Normal1(Camera* camera) {
|
|||
}
|
||||
|
||||
s32 Camera_Normal2(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -1803,6 +1926,11 @@ s32 Camera_Normal2(Camera* camera) {
|
|||
|
||||
// riding epona
|
||||
s32 Camera_Normal3(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -1997,6 +2125,8 @@ s32 Camera_Parallel1(Camera* camera) {
|
|||
OLib_Vec3fDiffToVecSphGeo(&atToEyeDir, at, eye);
|
||||
OLib_Vec3fDiffToVecSphGeo(&atToEyeNextDir, at, eyeNext);
|
||||
|
||||
camera->globalCtx->manualCamera = false;
|
||||
|
||||
switch (camera->animState) {
|
||||
case 0:
|
||||
case 0xA:
|
||||
|
@ -2162,6 +2292,11 @@ s32 Camera_Parallel0(Camera* camera) {
|
|||
* Generic jump, jumping off ledges
|
||||
*/
|
||||
s32 Camera_Jump1(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -2307,6 +2442,11 @@ s32 Camera_Jump1(Camera* camera) {
|
|||
|
||||
// Climbing ladders/vines
|
||||
s32 Camera_Jump2(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -2489,6 +2629,11 @@ s32 Camera_Jump2(Camera* camera) {
|
|||
|
||||
// swimming
|
||||
s32 Camera_Jump3(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -2946,6 +3091,11 @@ s32 Camera_Battle3(Camera* camera) {
|
|||
* setting value.
|
||||
*/
|
||||
s32 Camera_Battle4(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
@ -4476,6 +4626,11 @@ s32 Camera_Data4(Camera* camera) {
|
|||
* Hanging off of a ledge
|
||||
*/
|
||||
s32 Camera_Unique1(Camera* camera) {
|
||||
if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) {
|
||||
Camera_Free(camera);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
|
|
|
@ -244,7 +244,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
case 3:
|
||||
if (sp3F != 0) {
|
||||
Flags_SetEnv(globalCtx, 0);
|
||||
if (gSaveContext.entranceIndex == 0x0053) {
|
||||
if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) {
|
||||
Flags_SetEnv(globalCtx, 2);
|
||||
}
|
||||
}
|
||||
|
@ -491,6 +491,12 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 temp = 0;
|
||||
|
||||
// Automatically skip certain cutscenes when in rando
|
||||
// cmd->base == 33: Zelda escaping with impa cutscene
|
||||
bool randoCsSkip = (gSaveContext.n64ddFlag && cmd->base == 33);
|
||||
bool debugCsSkip = (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) &&
|
||||
(gSaveContext.fileNum != 0xFEDC) && CVar_GetS32("gDebugEnabled", 0));
|
||||
|
||||
if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) &&
|
||||
(csCtx->frames > 20) &&
|
||||
(CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) ||
|
||||
|
@ -501,9 +507,8 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
|
|||
temp = 1;
|
||||
}
|
||||
|
||||
if ((csCtx->frames == cmd->startFrame) || (temp != 0) ||
|
||||
((csCtx->frames > 20) && CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) &&
|
||||
(gSaveContext.fileNum != 0xFEDC)) && CVar_GetS32("gDebugEnabled", 0)) {
|
||||
if ((csCtx->frames == cmd->startFrame) || (temp != 0) || ((csCtx->frames > 20) && (randoCsSkip || debugCsSkip))) {
|
||||
|
||||
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
|
||||
Audio_SetCutsceneFlag(0);
|
||||
gSaveContext.unk_1410 = 1;
|
||||
|
@ -2047,6 +2052,18 @@ void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) {
|
|||
u8 requiredAge;
|
||||
s16 i;
|
||||
|
||||
if (gSaveContext.n64ddFlag &&
|
||||
// don't skip epona escape cutscenes
|
||||
gSaveContext.entranceIndex != 650 &&
|
||||
gSaveContext.entranceIndex != 654 &&
|
||||
gSaveContext.entranceIndex != 658 &&
|
||||
gSaveContext.entranceIndex != 1142 &&
|
||||
// don't skip nabooru iron knuckle cs
|
||||
gSaveContext.entranceIndex != 141) {
|
||||
gSaveContext.showTitleCard = false;
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) {
|
||||
entranceCutscene = &sEntranceCutsceneTable[i];
|
||||
|
||||
|
@ -2073,29 +2090,43 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
|
|||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
|
||||
Flags_SetEventChkInf(0xAC);
|
||||
gSaveContext.entranceIndex = 0x0123;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xAC);
|
||||
gSaveContext.entranceIndex = 0x0123;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
} else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x0100) &&
|
||||
(gSaveContext.eventChkInf[4] & 0x0200) && (gSaveContext.eventChkInf[4] & 0x0400) &&
|
||||
!Flags_GetEventChkInf(0xAA)) {
|
||||
Flags_SetEventChkInf(0xAA);
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xAA);
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
} else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(0xC1)) {
|
||||
Flags_SetEventChkInf(0xC1);
|
||||
Item_Give(globalCtx, ITEM_OCARINA_FAIRY);
|
||||
gSaveContext.entranceIndex = 0x011E;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xC1);
|
||||
Item_Give(globalCtx, ITEM_OCARINA_FAIRY);
|
||||
gSaveContext.entranceIndex = 0x011E;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) {
|
||||
Flags_SetEventChkInf(0xC4);
|
||||
gSaveContext.entranceIndex = 0x0053;
|
||||
gSaveContext.cutsceneIndex = 0xFFF8;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xC4);
|
||||
gSaveContext.entranceIndex = 0x0053;
|
||||
gSaveContext.cutsceneIndex = 0xFFF8;
|
||||
}
|
||||
} else if (!Flags_GetEventChkInf(0xC7) &&
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO)) {
|
||||
Flags_SetEventChkInf(0xC7);
|
||||
gSaveContext.entranceIndex = 0x0517;
|
||||
|
||||
// If we are rando and tower escape skip is on, then set the flag to say we saw the towers fall
|
||||
// and exit.
|
||||
if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_SKIP_TOWER_ESCAPE)) {
|
||||
return;
|
||||
}
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,11 @@ void GetItem_DrawSmallRupee(GlobalContext* globalCtx, s16 drawId);
|
|||
void GetItem_DrawScale(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawBulletBag(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawWallet(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawJewel(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawJewelKokiri(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawJewelGoron(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawJewelZora(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawGenericMusicNote(GlobalContext* globalCtx, s16 drawId);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
|
@ -367,6 +372,19 @@ DrawItemTableEntry sDrawItemTable[] = {
|
|||
{ GetItem_DrawOpa0, { gGiKokiriSwordDL } },
|
||||
// gold skulltula token, OBJECT_ST
|
||||
{ GetItem_DrawSkullToken, { object_st_DL_004DB0, object_st_DL_004EB8 } },
|
||||
|
||||
{ GetItem_DrawJewelKokiri, { gGiKokiriEmeraldGemDL, gGiKokiriEmeraldSettingDL } },
|
||||
{ GetItem_DrawJewelGoron, { gGiGoronRubyGemDL, gGiGoronRubySettingDL } },
|
||||
{ GetItem_DrawJewelZora, { gGiZoraSapphireGemDL, gGiZoraSapphireSettingDL } },
|
||||
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } }, //Generic
|
||||
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } }, //Zelda's Lullaby
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } }, //Epona's song
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } }, //Saria's song
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } }, //Sun's song
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } }, //Song of time
|
||||
{ GetItem_DrawGenericMusicNote, { gGiSongNoteDL } } //Song of storms
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -379,6 +397,96 @@ void GetItem_Draw(GlobalContext* globalCtx, s16 drawId) {
|
|||
|
||||
// All remaining functions in this file are draw functions referenced in the table and called by the function above
|
||||
|
||||
/* 0x0178 */ u8 primXluColor[3];
|
||||
/* 0x017B */ u8 envXluColor[3];
|
||||
/* 0x017E */ u8 primOpaColor[3];
|
||||
/* 0x0181 */ u8 envOpaColor[3];
|
||||
|
||||
void GetItem_DrawJewelKokiri(GlobalContext* globalCtx, s16 drawId) {
|
||||
primXluColor[2] = 160;
|
||||
primXluColor[0] = 255;
|
||||
primXluColor[1] = 255;
|
||||
envXluColor[0] = 0;
|
||||
envXluColor[1] = 255;
|
||||
envXluColor[2] = 0;
|
||||
primOpaColor[2] = 170;
|
||||
primOpaColor[0] = 255;
|
||||
primOpaColor[1] = 255;
|
||||
envOpaColor[1] = 120;
|
||||
envOpaColor[0] = 150;
|
||||
envOpaColor[2] = 0;
|
||||
|
||||
GetItem_DrawJewel(globalCtx, drawId);
|
||||
}
|
||||
|
||||
void GetItem_DrawJewelGoron(GlobalContext* globalCtx, s16 drawId) {
|
||||
primXluColor[1] = 170;
|
||||
primXluColor[0] = 255;
|
||||
primXluColor[2] = 255;
|
||||
envXluColor[2] = 100;
|
||||
envXluColor[0] = 255;
|
||||
envXluColor[1] = 0;
|
||||
primOpaColor[2] = 170;
|
||||
primOpaColor[0] = 255;
|
||||
primOpaColor[1] = 255;
|
||||
envOpaColor[1] = 120;
|
||||
envOpaColor[0] = 150;
|
||||
envOpaColor[2] = 0;
|
||||
|
||||
GetItem_DrawJewel(globalCtx, drawId);
|
||||
}
|
||||
|
||||
void GetItem_DrawJewelZora(GlobalContext* globalCtx, s16 drawId) {
|
||||
primXluColor[0] = 50;
|
||||
primXluColor[1] = 255;
|
||||
primXluColor[2] = 255;
|
||||
envXluColor[2] = 150;
|
||||
envXluColor[0] = 50;
|
||||
envXluColor[1] = 0;
|
||||
primOpaColor[2] = 170;
|
||||
primOpaColor[0] = 255;
|
||||
primOpaColor[1] = 255;
|
||||
envOpaColor[1] = 120;
|
||||
envOpaColor[0] = 150;
|
||||
envOpaColor[2] = 0;
|
||||
|
||||
GetItem_DrawJewel(globalCtx, drawId);
|
||||
}
|
||||
|
||||
void GetItem_DrawJewel(GlobalContext* globalCtx, s16 drawId) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 9,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 % 256, (256 - (0 % 256)) - 1, 64, 64, 1, 0 % 256,
|
||||
(256 - (0 % 256)) - 1, 16, 16));
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 8, Gfx_TexScroll(globalCtx->state.gfxCtx, (u8)0, (u8)0, 16, 16));
|
||||
|
||||
Matrix_Push();
|
||||
Matrix_RotateZYX(0, -0x4000, 0x4000, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2597),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2599),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
|
||||
// func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primXluColor[0], primXluColor[1], primXluColor[2], 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, envXluColor[0], envXluColor[1], envXluColor[2], 255);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
// func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 128, primOpaColor[0], primOpaColor[1], primOpaColor[2], 255);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, envOpaColor[0], envOpaColor[1], envOpaColor[2], 255);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void GetItem_DrawMaskOrBombchu(GlobalContext* globalCtx, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
|
@ -690,6 +798,31 @@ void GetItem_DrawOpa0Xlu1(GlobalContext* globalCtx, s16 drawId) {
|
|||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void GetItem_DrawGenericMusicNote(GlobalContext* globalCtx, s16 drawId) {
|
||||
s32 pad;
|
||||
s16 color_slot = drawId-120; //0 = generic
|
||||
s16* colors[7][3] = {
|
||||
{255,255,255}, //Generic Song (full white)
|
||||
{109, 73,143}, //Lullaby
|
||||
{217,110, 48}, //Epona
|
||||
{ 62,109, 23}, //Saria
|
||||
{237,231, 62}, //Sun
|
||||
{ 98,177,211}, //Time
|
||||
{146,146,146} //Storms
|
||||
};
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, __FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gsDPSetGrayscaleColor(POLY_OPA_DISP++, colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 255);
|
||||
gsSPGrayscale(POLY_OPA_DISP++, true);
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gsSPGrayscale(POLY_OPA_DISP++, false);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void GetItem_DrawXlu01(GlobalContext* globalCtx, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
|
||||
#define FLAGS 0
|
||||
|
||||
//Used to force variable to be used in different function, feel free to correct me if you have a better way
|
||||
static s16 DroppedItemRot = 0;
|
||||
|
||||
void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
@ -341,6 +338,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
s16 spawnParam8000 = this->actor.params & 0x8000;
|
||||
s32 pad1;
|
||||
|
||||
this->ogParams = this->actor.params;
|
||||
|
||||
this->collectibleFlag = (this->actor.params & 0x3F00) >> 8;
|
||||
|
||||
this->actor.params &= 0xFF;
|
||||
|
@ -358,76 +357,16 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
switch (this->actor.params) {
|
||||
case ITEM00_RUPEE_GREEN:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_RUPEE_BLUE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
}
|
||||
case ITEM00_RUPEE_RED:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.015f);
|
||||
this->scale = 0.015f;
|
||||
yOffset = 750.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_SMALL_KEY:
|
||||
this->unk_158 = 0;
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.03f);
|
||||
this->scale = 0.03f;
|
||||
yOffset = 350.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_HEART_PIECE:
|
||||
this->unk_158 = 0;
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.5f);
|
||||
this->scale = 0.5f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
yOffset = 650.0f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_HEART:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
yOffset = 25.0f;
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
shadowScale = 0.5f;
|
||||
} else {
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
yOffset = 430.0f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_HEART_CONTAINER:
|
||||
yOffset = 430.0f;
|
||||
|
@ -436,155 +375,19 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->scale = 0.02f;
|
||||
break;
|
||||
case ITEM00_ARROWS_SINGLE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
yOffset = 400.0f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_ARROWS_SMALL:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_ARROWS_MEDIUM:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_ARROWS_LARGE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.035f);
|
||||
this->scale = 0.035f;
|
||||
yOffset = 250.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_BOMBS_A:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_BOMBS_B:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_NUTS:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_STICK:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_MAGIC_SMALL:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_SEEDS:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
}
|
||||
case ITEM00_BOMBS_SPECIAL:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.03f);
|
||||
this->scale = 0.03f;
|
||||
yOffset = 320.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_MAGIC_LARGE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.5f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.045 - 1e-10);
|
||||
this->scale = 0.045 - 1e-10;
|
||||
yOffset = 320.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_RUPEE_ORANGE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.45f);
|
||||
this->scale = 0.45f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.045 - 1e-10);
|
||||
this->scale = 0.045 - 1e-10;
|
||||
yOffset = 750.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_RUPEE_PURPLE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
Actor_SetScale(&this->actor, 0.4f);
|
||||
this->scale = 0.4f;
|
||||
yOffset = 50.0f;
|
||||
shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.03f);
|
||||
this->scale = 0.03f;
|
||||
yOffset = 750.0f;
|
||||
}
|
||||
break;
|
||||
case ITEM00_FLEXIBLE:
|
||||
yOffset = 500.0f;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
@ -705,7 +508,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
break;
|
||||
}
|
||||
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
}
|
||||
|
||||
|
@ -721,46 +525,40 @@ void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) { //set the rotation system on selected model only :)
|
||||
if ((this->actor.params == ITEM_RUPEE_GOLD) || (this->actor.params == ITEM_RUPEE_PURPLE) ||
|
||||
(this->actor.params == ITEM00_ARROWS_SINGLE) || (this->actor.params == ITEM00_ARROWS_SMALL) ||
|
||||
(this->actor.params == ITEM00_ARROWS_MEDIUM) || (this->actor.params == ITEM00_ARROWS_LARGE) ||
|
||||
(this->actor.params == ITEM00_BOMBS_A) || (this->actor.params == ITEM00_BOMBS_B) ||
|
||||
(this->actor.params == ITEM00_NUTS) || (this->actor.params == ITEM00_STICK) ||
|
||||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) || (this->actor.params == ITEM00_SMALL_KEY) ||
|
||||
(this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL)) {
|
||||
this->actor.shape.rot.y = DroppedItemRot;
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == ITEM00_HEART_PIECE)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
} else {
|
||||
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
|
||||
if (this->unk_15A == -1) {
|
||||
if (Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
||||
0) {
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
} else {
|
||||
if (Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
||||
0) {
|
||||
this->unk_15A = -1;
|
||||
if (!CVar_GetS32("gNewDrops", 0)){
|
||||
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == ITEM00_HEART_PIECE)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
} else {
|
||||
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
|
||||
if (this->unk_15A == -1) {
|
||||
if (Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
||||
0) {
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
} else {
|
||||
if (Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
||||
0) {
|
||||
this->unk_15A = -1;
|
||||
}
|
||||
}
|
||||
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
|
||||
}
|
||||
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->actor.params == ITEM00_HEART_PIECE) {
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
if ((CVar_GetS32("gNewDrops", 0) !=0) && !gSaveContext.n64ddFlag) {
|
||||
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 20.0f + 50.0f;
|
||||
} else {
|
||||
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY) {
|
||||
this->actor.shape.yOffset = 600.0f;
|
||||
}
|
||||
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
|
||||
if (this->unk_154 == 0) {
|
||||
|
@ -786,7 +584,7 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
|
|||
f32 originalVelocity;
|
||||
Vec3f effectPos;
|
||||
|
||||
if (this->actor.params <= ITEM00_RUPEE_RED) {
|
||||
if (this->actor.params <= ITEM00_RUPEE_RED && !CVar_GetS32("gNewDrops", 0)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
|
||||
|
@ -884,9 +682,9 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.world.pos = player->actor.world.pos;
|
||||
|
||||
if (this->actor.params <= ITEM00_RUPEE_RED) {
|
||||
if (this->actor.params <= ITEM00_RUPEE_RED && !CVar_GetS32("gNewDrops", 0)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
} else if (this->actor.params == ITEM00_HEART) {
|
||||
} else if (this->actor.params == ITEM00_HEART && !CVar_GetS32("gNewDrops", 0)) {
|
||||
this->actor.shape.rot.y = 0;
|
||||
}
|
||||
|
||||
|
@ -910,9 +708,19 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
EnItem00* this = (EnItem00*)thisx;
|
||||
s32 pad;
|
||||
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) { //Update 3D Model rotation on frame update :)
|
||||
DroppedItemRot += 250;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) { //set the rotation system on selected model only :)
|
||||
|
||||
if ((this->actor.params == ITEM00_RUPEE_GREEN) || (this->actor.params == ITEM00_RUPEE_BLUE) ||
|
||||
(this->actor.params == ITEM00_RUPEE_RED) || (this->actor.params == ITEM00_ARROWS_SINGLE) ||
|
||||
(this->actor.params == ITEM00_ARROWS_SMALL) || (this->actor.params == ITEM00_ARROWS_MEDIUM) ||
|
||||
(this->actor.params == ITEM00_ARROWS_LARGE) || (this->actor.params == ITEM00_BOMBS_A) ||
|
||||
(this->actor.params == ITEM00_BOMBS_B) || (this->actor.params == ITEM00_NUTS) ||
|
||||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) ||
|
||||
(this->actor.params == ITEM00_SMALL_KEY) || (this->actor.params == ITEM00_MAGIC_LARGE) ||
|
||||
(this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL) || this->actor.params == ITEM00_HEART_PIECE) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_15A > 0) {
|
||||
this->unk_15A--;
|
||||
|
@ -1072,6 +880,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
params = &this->actor.params;
|
||||
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
}
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
}
|
||||
|
||||
|
@ -1120,40 +931,92 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnItem00* this = (EnItem00*)thisx;
|
||||
f32 mtxScale;
|
||||
|
||||
|
||||
if (!(this->unk_156 & this->unk_158)) {
|
||||
switch (this->actor.params) {
|
||||
case ITEM00_RUPEE_GREEN:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_GREEN);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_GREEN);
|
||||
break;
|
||||
}
|
||||
case ITEM00_RUPEE_BLUE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_BLUE);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_BLUE);
|
||||
break;
|
||||
}
|
||||
case ITEM00_RUPEE_RED:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_RED);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_RED);
|
||||
break;
|
||||
} else {
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
Actor_SetScale(&this->actor, 0.015f);
|
||||
this->scale = 0.015f;
|
||||
this->actor.shape.yOffset = 750.0f;
|
||||
EnItem00_DrawRupee(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
case ITEM00_RUPEE_ORANGE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_GOLD);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.45f);
|
||||
this->scale = 0.45f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_GOLD);
|
||||
break;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.045 - 1e-10);
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
this->scale = 0.045 - 1e-10;
|
||||
this->actor.shape.yOffset = 750.0f;
|
||||
EnItem00_DrawRupee(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
case ITEM00_RUPEE_PURPLE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_PURPLE);
|
||||
} else {
|
||||
EnItem00_DrawRupee(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.4f);
|
||||
this->scale = 0.4f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_RUPEE_PURPLE);
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.03f);
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
this->scale = 0.03f;
|
||||
this->actor.shape.yOffset = 750.0f;
|
||||
EnItem00_DrawRupee(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
case ITEM00_HEART_PIECE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
if (CVar_GetS32("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
||||
Actor_SetScale(&this->actor, 0.5f);
|
||||
this->scale = 0.5f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_HEART_PIECE);
|
||||
} else {
|
||||
this->actor.shape.yOffset = 650.0f;
|
||||
this->actor.shape.shadowScale = 0.03f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
EnItem00_DrawHeartPiece(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
|
@ -1161,89 +1024,165 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
EnItem00_DrawHeartContainer(this, globalCtx);
|
||||
break;
|
||||
case ITEM00_HEART:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_HEART);
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
this->actor.shape.yOffset = 25.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
Actor_SetScale(&this->actor, 0.3f);
|
||||
this->scale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_HEART);
|
||||
mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
break;
|
||||
} else {
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
} else {
|
||||
mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_HEART);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
this->actor.shape.yOffset = 430.0f;
|
||||
this->actor.shape.shadowScale = 0.03f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
} else {
|
||||
mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_HEART);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
case ITEM00_BOMBS_A:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_BOMB);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_BOMB);
|
||||
break;
|
||||
}
|
||||
case ITEM00_BOMBS_B:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_BOMB);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_BOMB);
|
||||
break;
|
||||
}
|
||||
case ITEM00_BOMBS_SPECIAL:
|
||||
case ITEM00_ARROWS_SINGLE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
|
||||
break;
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
|
||||
break;
|
||||
}
|
||||
case ITEM00_ARROWS_SMALL:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
|
||||
break;
|
||||
}
|
||||
case ITEM00_ARROWS_MEDIUM:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_MEDIUM);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_MEDIUM);
|
||||
break;
|
||||
}
|
||||
case ITEM00_ARROWS_LARGE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_LARGE);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_ARROWS_LARGE);
|
||||
break;
|
||||
}
|
||||
case ITEM00_NUTS:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_NUTS);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_NUTS);
|
||||
break;
|
||||
}
|
||||
case ITEM00_STICK:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_STICK);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_STICK);
|
||||
break;
|
||||
}
|
||||
case ITEM00_MAGIC_LARGE:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_MAGIC_LARGE);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
GetItem_Draw(globalCtx, GID_MAGIC_LARGE);
|
||||
break;
|
||||
}
|
||||
case ITEM00_MAGIC_SMALL:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_MAGIC_SMALL);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_MAGIC_SMALL);
|
||||
break;
|
||||
}
|
||||
case ITEM00_SEEDS:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
GetItem_Draw(globalCtx, GID_SEEDS);
|
||||
break;
|
||||
}
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.shape.shadowScale = 0.3f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
GetItem_Draw(globalCtx, GID_SEEDS);
|
||||
break;
|
||||
}
|
||||
case ITEM00_SMALL_KEY:
|
||||
if (CVar_GetS32("gNewDrops", 0) !=0) {
|
||||
if (CVar_GetS32("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
this->scale = 0.2f;
|
||||
this->actor.shape.yOffset = 50.0f;
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
this->actor.shape.shadowScale = 0.5f;
|
||||
GetItem_Draw(globalCtx, GID_KEY_SMALL);
|
||||
} else {
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.03f);
|
||||
this->scale = 0.03f;
|
||||
this->actor.shape.yOffset = 320.0f;
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
this->actor.world.rot.x = 0;
|
||||
this->actor.shape.rot.y = 0;
|
||||
EnItem00_DrawCollectible(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
|
@ -1265,6 +1204,67 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, s16 getItemId) {
|
||||
s16 color_slot;
|
||||
switch (getItemId) {
|
||||
case GI_MINUET_OF_FOREST:
|
||||
case GI_SINGLE_MAGIC:
|
||||
case GI_DOUBLE_MAGIC:
|
||||
color_slot = 0;
|
||||
break;
|
||||
case GI_BOLERO_OF_FIRE:
|
||||
case GI_DOUBLE_DEFENSE:
|
||||
color_slot = 1;
|
||||
break;
|
||||
case GI_SERENADE_OF_WATER:
|
||||
color_slot = 2;
|
||||
break;
|
||||
case GI_REQUIEM_OF_SPIRIT:
|
||||
color_slot = 3;
|
||||
break;
|
||||
case GI_NOCTURNE_OF_SHADOW:
|
||||
color_slot = 4;
|
||||
break;
|
||||
case GI_PRELUDE_OF_LIGHT:
|
||||
color_slot = 5;
|
||||
break;
|
||||
}
|
||||
|
||||
s16* colors[7][3] = {
|
||||
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
|
||||
{ 177, 35, 35 }, // Bolero and Double Defense Colors
|
||||
{ 115, 251, 253 }, // Serenade Color
|
||||
{ 177, 122, 35 }, // Requiem Color
|
||||
{ 177, 28, 212 }, // Nocturne Color
|
||||
{ 255, 255, 92 }, // Prelude Color
|
||||
{ 255, 255, 255} // White Color placeholder
|
||||
};
|
||||
|
||||
s16* colorsEnv[7][3] = {
|
||||
{ 30, 110, 30 }, // Minuet and Magic Upgrades Colors
|
||||
{ 90, 10, 10 }, // Bolero and Double Defense Colors
|
||||
{ 35, 35, 177 }, // Serenade Color
|
||||
{ 70, 20, 10 }, // Requiem Color
|
||||
{ 100, 20, 140 }, // Nocturne Color
|
||||
{ 100, 100, 10 }, // Prelude Color
|
||||
{ 154, 154, 154 } // White Color placeholder
|
||||
};
|
||||
static Vec3f velocity = { 0.0f, 0.2f, 0.0f };
|
||||
static Vec3f accel = { 0.0f, 0.05f, 0.0f };
|
||||
Color_RGBA8 primColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 };
|
||||
Color_RGBA8 envColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 };
|
||||
Vec3f pos;
|
||||
|
||||
// velocity.x = Rand_CenteredFloat(3.0f);
|
||||
// velocity.z = Rand_CenteredFloat(3.0f);
|
||||
velocity.y = -0.05f;
|
||||
accel.y = -0.025f;
|
||||
pos.x = Rand_CenteredFloat(32.0f) + Parent->world.pos.x;
|
||||
pos.y = (Rand_ZeroOne() * 6.0f) + Parent->world.pos.y + 25;
|
||||
pos.z = Rand_CenteredFloat(32.0f) + Parent->world.pos.z;
|
||||
EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 1000, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Function used for Rupee types of En_Item00.
|
||||
*/
|
||||
|
@ -1297,27 +1297,37 @@ void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) {
|
|||
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
|
||||
*/
|
||||
void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 texIndex = this->actor.params - 3;
|
||||
if ((gSaveContext.n64ddFlag && this->getItemId != GI_NONE) || this->actor.params == ITEM00_SMALL_KEY) {
|
||||
f32 mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
s32 randoGetItemId = GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId));
|
||||
} else {
|
||||
s32 texIndex = this->actor.params - 3;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
|
||||
if (this->actor.params == ITEM00_BOMBS_SPECIAL) {
|
||||
texIndex = 1;
|
||||
} else if (this->actor.params >= ITEM00_ARROWS_SMALL) {
|
||||
texIndex -= 3;
|
||||
if (this->actor.params == ITEM00_BOMBS_SPECIAL) {
|
||||
texIndex = 1;
|
||||
} else if (this->actor.params >= ITEM00_ARROWS_SMALL) {
|
||||
texIndex -= 3;
|
||||
}
|
||||
|
||||
POLY_OPA_DISP = func_800946E4(POLY_OPA_DISP);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex]));
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
POLY_OPA_DISP = func_800946E4(POLY_OPA_DISP);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex]));
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1347,17 +1357,27 @@ void EnItem00_DrawHeartContainer(EnItem00* this, GlobalContext* globalCtx) {
|
|||
* Draw Function used for the Piece of Heart type of En_Item00.
|
||||
*/
|
||||
void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
f32 mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
s32 randoGetItemId = GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId));
|
||||
} else {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@ Gfx sWipeDList[] = {
|
|||
G_TX_MIRROR | G_TX_WRAP, 6, 6, 11, 1),
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsSPDisplayList(0x08000000),
|
||||
gsSPDisplayList(SEG_ADDR(8, 0)),
|
||||
gsSPVertex(sWipe1Vtx, 25, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
|
||||
gsSP2Triangles(5, 6, 7, 0, 6, 8, 9, 0),
|
||||
|
@ -89,6 +89,7 @@ void TransitionWipe_Draw(void* thisx, Gfx** gfxP) {
|
|||
TransitionWipe* this = (TransitionWipe*)thisx;
|
||||
s32 pad[4];
|
||||
Gfx* tex;
|
||||
Gfx* wipeDl = sWipeDList;
|
||||
|
||||
modelView = this->modelView[this->frame];
|
||||
|
||||
|
|
|
@ -72,7 +72,9 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
|||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
||||
ASSERT(horseActor != NULL);
|
||||
} else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) &&
|
||||
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
|
||||
(((Flags_GetEventChkInf(0x18) != 0) && (!gSaveContext.n64ddFlag ||
|
||||
(gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) &&
|
||||
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE)))) || DREG(1) != 0)) {
|
||||
// "Set by existence of horse %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18),
|
||||
DREG(1));
|
||||
|
|
|
@ -2095,10 +2095,8 @@ void func_80075B44(GlobalContext* globalCtx) {
|
|||
{
|
||||
// OTRTODO: This is where corrupt audio happens. Commenting this out seems to not introduce any side effects?
|
||||
// Further investigation is needed...
|
||||
|
||||
if (gUseLegacySD)
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_CRITTER_4 << 4 | NATURE_CHANNEL_CRITTER_5,
|
||||
CHANNEL_IO_PORT_1, 1);
|
||||
//Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_CRITTER_4 << 4 | NATURE_CHANNEL_CRITTER_5,
|
||||
//CHANNEL_IO_PORT_1, 1);
|
||||
}
|
||||
globalCtx->envCtx.unk_E0++;
|
||||
break;
|
||||
|
|
|
@ -162,7 +162,11 @@ void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec) {
|
|||
|
||||
while (listHead != NULL) {
|
||||
info = listHead->info;
|
||||
bindFuncs[info->type](lights, &info->params, vec);
|
||||
// OTRTODO: we do not know the root cause of the info->type value being invalid
|
||||
// but this prevents it from crashing the game on the game over screen
|
||||
if (info->type < 3) {
|
||||
bindFuncs[info->type](lights, &info->params, vec);
|
||||
}
|
||||
listHead = listHead->next;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -543,6 +543,7 @@ void Message_DrawTextboxIcon(GlobalContext* globalCtx, Gfx** p, s16 x, s16 y) {
|
|||
s16 envG;
|
||||
s16 envB;
|
||||
u8* iconTexture = font->iconBuf;
|
||||
gSPInvalidateTexCache(gfx++, iconTexture);
|
||||
|
||||
if (sTextIsCredits) {
|
||||
return;
|
||||
|
@ -1672,9 +1673,73 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
|
|||
//font->msgLength, __FILE__, __LINE__);
|
||||
} else {
|
||||
Message_FindMessage(globalCtx, textId);
|
||||
msgCtx->msgLength = font->msgLength;
|
||||
char* src = (uintptr_t)font->msgOffset;
|
||||
memcpy(font->msgBuf, src, font->msgLength);
|
||||
// if we're rando'd and talking to a gossip stone
|
||||
if (gSaveContext.n64ddFlag &&
|
||||
textId == 0x2053 &&
|
||||
GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) != 0 &&
|
||||
(GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) == 1 ||
|
||||
(GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) == 2 &&
|
||||
Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) ||
|
||||
(GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) == 3 &&
|
||||
CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)))) {
|
||||
|
||||
s16 actorParams = msgCtx->talkActor->params;
|
||||
|
||||
// if we're in a generic grotto
|
||||
if (globalCtx->sceneNum == 62 && actorParams == 14360) {
|
||||
// look for the chest in the actorlist to determine
|
||||
// which grotto we're in
|
||||
int numOfActorLists = sizeof(globalCtx->actorCtx.actorLists)/sizeof(globalCtx->actorCtx.actorLists[0]);
|
||||
for(int i = 0; i < numOfActorLists; i++) {
|
||||
if(globalCtx->actorCtx.actorLists[i].length) {
|
||||
if(globalCtx->actorCtx.actorLists[i].head->id == 10) {
|
||||
// set the params for the hint check to be negative chest params
|
||||
actorParams = 0 - globalCtx->actorCtx.actorLists[i].head->params;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RandomizerCheck hintCheck = GetCheckFromActor(globalCtx->sceneNum, msgCtx->talkActor->id, actorParams);
|
||||
|
||||
// Pass the sizeof the message buffer so we don't hardcode any sizes and can rely on globals.
|
||||
// If no hint can be found, this just returns 0 size and doesn't modify the buffer, so no worries.
|
||||
msgCtx->msgLength = font->msgLength = CopyHintFromCheck(hintCheck, font->msgBuf, sizeof(font->msgBuf));
|
||||
} else if (gSaveContext.n64ddFlag && (textId == 0x7040 || textId == 0x7088)) {
|
||||
// rando hints at altar
|
||||
msgCtx->msgLength = font->msgLength = CopyAltarMessage(font->msgBuf, sizeof(font->msgBuf));
|
||||
} else if (textId == 0x00b4 && CVar_GetS32("gInjectSkulltulaCount", 0) != 0) {
|
||||
switch (gSaveContext.language) {
|
||||
case LANGUAGE_FRA:
|
||||
strcpy(font->msgBuf, "\x08\x13\x71Vous obtenez un \x05\x41Symbole de\x01Skulltula d'or\x05\x40! "
|
||||
"Vous avez\x01\collect\x96 "
|
||||
"\x05\x41\x19\x05\x40 symboles en tout!\x02");
|
||||
break;
|
||||
case LANGUAGE_GER:
|
||||
strcpy(font->msgBuf, "\x08\x13\x71\Du erh\x93lst ein \x05\x41Goldene\x01Skulltula-Symbol\x05\x40\! "
|
||||
"Du hast\x01insgesamt "
|
||||
"\x05\x41\x19\x05\x40 symbol gesammelt!\x02");
|
||||
break;
|
||||
case LANGUAGE_ENG: default:
|
||||
strcpy(font->msgBuf,
|
||||
"\x08\x13\x71You got a \x05\x41Gold Skulltula Token\x05\x40!\x01You've collected "
|
||||
"\x05\x41\x19\x05\x40 tokens\x01in total!\x02");
|
||||
break;
|
||||
}
|
||||
msgCtx->msgLength = font->msgLength = strlen(font->msgBuf);
|
||||
} else if (gSaveContext.n64ddFlag && (textId == 0x10A2 || textId == 0x10DC || textId == 0x10DD)) {
|
||||
msgCtx->msgLength = font->msgLength = CopyScrubMessage(textId, font->msgBuf, sizeof(font->msgBuf));
|
||||
} else if (gSaveContext.n64ddFlag && textId == 0x70CC) {
|
||||
if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) {
|
||||
msgCtx->msgLength = font->msgLength = CopyGanonText(font->msgBuf, sizeof(font->msgBuf));
|
||||
} else {
|
||||
msgCtx->msgLength = font->msgLength = CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf));
|
||||
}
|
||||
} else {
|
||||
msgCtx->msgLength = font->msgLength;
|
||||
char* src = (uintptr_t)font->msgOffset;
|
||||
memcpy(font->msgBuf, src, font->msgLength);
|
||||
}
|
||||
}
|
||||
|
||||
msgCtx->textBoxProperties = font->charTexBuf[0];
|
||||
|
@ -1724,8 +1789,15 @@ void Message_StartTextbox(GlobalContext* globalCtx, u16 textId, Actor* actor) {
|
|||
osSyncPrintf(VT_RST);
|
||||
|
||||
msgCtx->ocarinaAction = 0xFFFF;
|
||||
Message_OpenText(globalCtx, textId);
|
||||
msgCtx->talkActor = actor;
|
||||
// we need the talkActor for gossip stones in rando
|
||||
// so we need to switch the order of these lines
|
||||
if (gSaveContext.n64ddFlag && textId == 0x2053) {
|
||||
msgCtx->talkActor = actor;
|
||||
Message_OpenText(globalCtx, textId);
|
||||
} else {
|
||||
Message_OpenText(globalCtx, textId);
|
||||
msgCtx->talkActor = actor;
|
||||
}
|
||||
msgCtx->msgMode = MSGMODE_TEXT_START;
|
||||
msgCtx->stateTimer = 0;
|
||||
msgCtx->textDelayTimer = 0;
|
||||
|
@ -2578,10 +2650,18 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
|
|||
}
|
||||
break;
|
||||
case MSGMODE_SETUP_DISPLAY_SONG_PLAYED:
|
||||
Message_DrawText(globalCtx, &gfx);
|
||||
Audio_OcaSetInstrument(1);
|
||||
Audio_OcaSetInstrument(1);
|
||||
Audio_OcaSetSongPlayback(msgCtx->lastPlayedSong + 1, 1);
|
||||
if (CVar_GetS32("gFastOcarinaPlayback", 0) == 0 ||
|
||||
globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_TIME ||
|
||||
globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS ||
|
||||
globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) {
|
||||
Message_DrawText(globalCtx, &gfx);
|
||||
Audio_OcaSetInstrument(1);
|
||||
Audio_OcaSetInstrument(1);
|
||||
Audio_OcaSetSongPlayback(msgCtx->lastPlayedSong + 1, 1);
|
||||
} else {
|
||||
Audio_OcaSetInstrument(1);
|
||||
Audio_OcaSetInstrument(1);
|
||||
}
|
||||
if (msgCtx->lastPlayedSong != OCARINA_SONG_SCARECROW) {
|
||||
Audio_PlayFanfare(sOcarinaSongFanfares[msgCtx->lastPlayedSong]);
|
||||
Audio_SetSoundBanksMute(0x20);
|
||||
|
@ -2624,7 +2704,15 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
|
|||
Message_ContinueTextbox(globalCtx, msgCtx->lastPlayedSong + 0x893); // You played [song name]
|
||||
Message_Decode(globalCtx);
|
||||
msgCtx->msgMode = MSGMODE_DISPLAY_SONG_PLAYED_TEXT;
|
||||
msgCtx->stateTimer = 20;
|
||||
|
||||
if (CVar_GetS32("gFastOcarinaPlayback", 0) == 0 || globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_TIME
|
||||
|| globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS ||
|
||||
globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) {
|
||||
msgCtx->stateTimer = 20;
|
||||
} else {
|
||||
msgCtx->stateTimer = 1;
|
||||
}
|
||||
|
||||
Message_DrawText(globalCtx, &gfx);
|
||||
break;
|
||||
case MSGMODE_DISPLAY_SONG_PLAYED_TEXT:
|
||||
|
@ -2731,7 +2819,11 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
|
|||
msgCtx->ocarinaStaff->state);
|
||||
msgCtx->lastPlayedSong = msgCtx->ocarinaStaff->state;
|
||||
msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_SUCCESS;
|
||||
Item_Give(globalCtx, ITEM_SONG_MINUET + gOcarinaSongItemMap[msgCtx->ocarinaStaff->state]);
|
||||
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Item_Give(globalCtx, ITEM_SONG_MINUET + gOcarinaSongItemMap[msgCtx->ocarinaStaff->state]);
|
||||
}
|
||||
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// "z_message.c Song Acquired"
|
||||
osSyncPrintf("z_message.c 取得メロディ=%d\n", ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state);
|
||||
|
@ -3136,6 +3228,8 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
|
|||
* the last value being saved in a static variable.
|
||||
*/
|
||||
void Message_DrawDebugVariableChanged(s16* var, GraphicsContext* gfxCtx) {
|
||||
if (!CVar_GetS32("gDebugEnabled", 0)) { return; }
|
||||
|
||||
static s16 sVarLastValue = 0;
|
||||
static s16 sFillTimer = 0;
|
||||
s32 pad;
|
||||
|
|
|
@ -791,7 +791,12 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act
|
|||
break;
|
||||
case 4100:
|
||||
csInfo->keyFrames = D_801225D4;
|
||||
csInfo->keyFrameCnt = 5;
|
||||
// RANDO: Waterfall opening cutscene skips to the end of the cutscene data earlier by doing this
|
||||
if (!(gSaveContext.n64ddFlag)) {
|
||||
csInfo->keyFrameCnt = 5;
|
||||
} else {
|
||||
csInfo->keyFrameCnt = 2;
|
||||
}
|
||||
|
||||
player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = 0x3FFC;
|
||||
func_800C0808(globalCtx, camIdx, player, CAM_SET_CS_C);
|
||||
|
|
|
@ -1557,6 +1557,70 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
osSyncPrintf("item_get_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.inventory.items[slot]);
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (item == ITEM_SINGLE_MAGIC) {
|
||||
gSaveContext.magicAcquired = true;
|
||||
gSaveContext.unk_13F6 = 0x30;
|
||||
Magic_Fill(globalCtx);
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_DOUBLE_MAGIC) {
|
||||
if (!gSaveContext.magicAcquired) {
|
||||
gSaveContext.magicAcquired = true;
|
||||
}
|
||||
gSaveContext.doubleMagic = true;
|
||||
gSaveContext.unk_13F6 = 0x60;
|
||||
gSaveContext.magicLevel = 0;
|
||||
Magic_Fill(globalCtx);
|
||||
return ITEM_NONE;
|
||||
}
|
||||
|
||||
if (item == ITEM_DOUBLE_DEFENSE) {
|
||||
gSaveContext.doubleDefense = true;
|
||||
gSaveContext.inventory.defenseHearts = 20;
|
||||
gSaveContext.healthAccumulator = 0x140;
|
||||
return ITEM_NONE;
|
||||
}
|
||||
|
||||
if (item >= ITEM_BOTTLE_WITH_RED_POTION &&
|
||||
item <= ITEM_BOTTLE_WITH_BIG_POE) {
|
||||
temp = SLOT(ITEM_BOTTLE);
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (gSaveContext.inventory.items[temp + i] == ITEM_NONE) {
|
||||
switch (item) {
|
||||
case ITEM_BOTTLE_WITH_RED_POTION:
|
||||
item = ITEM_POTION_RED;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_GREEN_POTION:
|
||||
item = ITEM_POTION_GREEN;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_BLUE_POTION:
|
||||
item = ITEM_POTION_BLUE;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_FAIRY:
|
||||
item = ITEM_FAIRY;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_FISH:
|
||||
item = ITEM_FISH;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_BLUE_FIRE:
|
||||
item = ITEM_BLUE_FIRE;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_BUGS:
|
||||
item = ITEM_BUG;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_POE:
|
||||
item = ITEM_POE;
|
||||
break;
|
||||
case ITEM_BOTTLE_WITH_BIG_POE:
|
||||
item = ITEM_BIG_POE;
|
||||
break;
|
||||
}
|
||||
|
||||
gSaveContext.inventory.items[temp + i] = item;
|
||||
return ITEM_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) {
|
||||
gSaveContext.inventory.questItems |= gBitFlags[item - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST];
|
||||
|
||||
|
@ -1637,9 +1701,43 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
gSaveContext.inventory.equipment |= (gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]);
|
||||
return ITEM_NONE;
|
||||
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
|
||||
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
// Boss Key, Compass, and Dungeon Map exceptions for rando.
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (globalCtx->sceneNum == 13) { // ganon's castle -> ganon's tower
|
||||
gSaveContext.inventory.dungeonItems[10] |= 1;
|
||||
} else if (globalCtx->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
|
||||
gSaveContext.inventory.dungeonItems[6] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
}
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
}
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_KEY_SMALL) {
|
||||
// Small key exceptions for rando.
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (globalCtx->sceneNum == 10) { // ganon's tower -> ganon's castle
|
||||
if (gSaveContext.inventory.dungeonKeys[13] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[13] = 1;
|
||||
return ITEM_NONE;
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonKeys[13]++;
|
||||
return ITEM_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
|
||||
if (gSaveContext.inventory.dungeonKeys[6] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[6] = 1;
|
||||
return ITEM_NONE;
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonKeys[6]++;
|
||||
return ITEM_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1;
|
||||
return ITEM_NONE;
|
||||
|
@ -1712,9 +1810,15 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
return ITEM_NONE;
|
||||
} else if (item == ITEM_WALLET_ADULT) {
|
||||
Inventory_ChangeUpgrade(UPG_WALLET, 1);
|
||||
if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_FULL_WALLETS)) {
|
||||
Rupees_ChangeBy(200);
|
||||
}
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_WALLET_GIANT) {
|
||||
Inventory_ChangeUpgrade(UPG_WALLET, 2);
|
||||
if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_FULL_WALLETS)) {
|
||||
Rupees_ChangeBy(500);
|
||||
}
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_STICK_UPGRADE_20) {
|
||||
if (gSaveContext.inventory.items[slot] == ITEM_NONE) {
|
||||
|
@ -1746,12 +1850,30 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
return ITEM_NONE;
|
||||
} else if (item == ITEM_LONGSHOT) {
|
||||
INV_CONTENT(item) = item;
|
||||
// always update "equips" as this is what is currently on the c-buttons
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
if (gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) {
|
||||
gSaveContext.equips.buttonItems[i] = ITEM_LONGSHOT;
|
||||
Interface_LoadItemIcon1(globalCtx, i);
|
||||
}
|
||||
}
|
||||
// update the adult/child equips when rando'd (accounting for equp swapped hookshot as child)
|
||||
if (gSaveContext.n64ddFlag && LINK_IS_CHILD) {
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.adultEquips.buttonItems); i++) {
|
||||
if (gSaveContext.adultEquips.buttonItems[i] == ITEM_HOOKSHOT) {
|
||||
gSaveContext.adultEquips.buttonItems[i] = ITEM_LONGSHOT;
|
||||
Interface_LoadItemIcon1(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gSaveContext.n64ddFlag && LINK_IS_ADULT) {
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); i++) {
|
||||
if (gSaveContext.childEquips.buttonItems[i] == ITEM_HOOKSHOT) {
|
||||
gSaveContext.childEquips.buttonItems[i] = ITEM_LONGSHOT;
|
||||
Interface_LoadItemIcon1(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_STICK) {
|
||||
if (gSaveContext.inventory.items[slot] == ITEM_NONE) {
|
||||
|
@ -1880,12 +2002,31 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
return ITEM_NONE;
|
||||
} else if (item == ITEM_OCARINA_TIME) {
|
||||
INV_CONTENT(ITEM_OCARINA_TIME) = ITEM_OCARINA_TIME;
|
||||
// always update "equips" as this is what is currently on the c-buttons
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
if (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) {
|
||||
gSaveContext.equips.buttonItems[i] = ITEM_OCARINA_TIME;
|
||||
Interface_LoadItemIcon1(globalCtx, i);
|
||||
}
|
||||
}
|
||||
|
||||
// update the adult/child equips when rando'd
|
||||
if (gSaveContext.n64ddFlag && LINK_IS_CHILD) {
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.adultEquips.buttonItems); i++) {
|
||||
if (gSaveContext.adultEquips.buttonItems[i] == ITEM_OCARINA_FAIRY) {
|
||||
gSaveContext.adultEquips.buttonItems[i] = ITEM_OCARINA_TIME;
|
||||
Interface_LoadItemIcon1(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gSaveContext.n64ddFlag && LINK_IS_ADULT) {
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); i++) {
|
||||
if (gSaveContext.childEquips.buttonItems[i] == ITEM_OCARINA_FAIRY) {
|
||||
gSaveContext.childEquips.buttonItems[i] = ITEM_OCARINA_TIME;
|
||||
Interface_LoadItemIcon1(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_BEAN) {
|
||||
if (gSaveContext.inventory.items[slot] == ITEM_NONE) {
|
||||
|
@ -2028,7 +2169,15 @@ u8 Item_CheckObtainability(u8 item) {
|
|||
osSyncPrintf("item_get_non_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.inventory.items[slot]);
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (item == ITEM_SINGLE_MAGIC || item == ITEM_DOUBLE_MAGIC || item == ITEM_DOUBLE_DEFENSE) {
|
||||
return ITEM_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
if ((item >= ITEM_SONG_MINUET) && (item <= ITEM_SONG_STORMS)) {
|
||||
return ITEM_NONE;
|
||||
} else if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) {
|
||||
return ITEM_NONE;
|
||||
} else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_SKULL_TOKEN)) {
|
||||
return ITEM_NONE;
|
||||
|
@ -2037,25 +2186,25 @@ u8 Item_CheckObtainability(u8 item) {
|
|||
return ITEM_NONE;
|
||||
} else if ((gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]) &
|
||||
gSaveContext.inventory.equipment) {
|
||||
return item;
|
||||
return gSaveContext.n64ddFlag ? ITEM_NONE : item;
|
||||
} else {
|
||||
return ITEM_NONE;
|
||||
}
|
||||
} else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) {
|
||||
if ((gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]) & gSaveContext.inventory.equipment) {
|
||||
return item;
|
||||
return gSaveContext.n64ddFlag ? ITEM_NONE : item;
|
||||
} else {
|
||||
return ITEM_NONE;
|
||||
}
|
||||
} else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) {
|
||||
if ((gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]) & gSaveContext.inventory.equipment) {
|
||||
return item;
|
||||
return gSaveContext.n64ddFlag ? ITEM_NONE : item;
|
||||
} else {
|
||||
return ITEM_NONE;
|
||||
}
|
||||
} else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) {
|
||||
if ((gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & gSaveContext.inventory.equipment) {
|
||||
return item;
|
||||
return gSaveContext.n64ddFlag ? ITEM_NONE : item;
|
||||
} else {
|
||||
return ITEM_NONE;
|
||||
}
|
||||
|
@ -3326,6 +3475,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) {
|
||||
// Start Button Texture, Color & Label
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
if (CVar_GetS32("gHudColors", 1) == 0) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 0, 0, interfaceCtx->startAlpha);
|
||||
} else if (CVar_GetS32("gHudColors", 1) == 1) {
|
||||
|
|
|
@ -193,6 +193,70 @@ void Gameplay_Destroy(GameState* thisx) {
|
|||
gGlobalCtx = NULL;
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSongOfTime(GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F) && gSaveContext.nextTransition == 0xFF) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SONG_OF_TIME);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardNocturne(GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((gSaveContext.entranceIndex == 0x00DB ||
|
||||
gSaveContext.entranceIndex == 0x0191 ||
|
||||
gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
|
||||
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL &&
|
||||
!Player_InBlockingCsMode(globalCtx, player) && !Flags_GetEventChkInf(0xAA)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_NOCTURNE_OF_SHADOW);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
Flags_SetEventChkInf(0xAA);
|
||||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardRequiem(GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL &&
|
||||
!Player_InBlockingCsMode(globalCtx, player)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SONG_OF_TIME);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
Flags_SetEventChkInf(0xAC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && LINK_IS_ADULT &&
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA) &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1E) && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
|
||||
globalCtx->sceneLoadFlag == 0 && player->getItemId == GI_NONE) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ARROW_LIGHT);
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSariaGift(GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
if (gSaveContext.entranceIndex == 0x05E0) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY);
|
||||
|
||||
if ((!Flags_GetEventChkInf(0xC1) || (player->getItemId == getItemId && getItemId != GI_ICE_TRAP)) &&
|
||||
player != NULL && !Player_InBlockingCsMode(globalCtx, player)) {
|
||||
GiveItemWithoutActor(globalCtx, getItemId);
|
||||
Flags_SetEventChkInf(0xC1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Gameplay_Init(GameState* thisx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)thisx;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
@ -207,6 +271,14 @@ void Gameplay_Init(GameState* thisx) {
|
|||
u8 tempSetupIndex;
|
||||
s32 pad[2];
|
||||
|
||||
if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_SKIP_CHILD_STEALTH)) {
|
||||
if (gSaveContext.entranceIndex == 0x7A) {
|
||||
gSaveContext.entranceIndex = 0x400;
|
||||
} else if (gSaveContext.entranceIndex == 0x296) {
|
||||
gSaveContext.entranceIndex = 0x23D;
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.entranceIndex == -1) {
|
||||
gSaveContext.entranceIndex = 0;
|
||||
globalCtx->state.running = false;
|
||||
|
@ -383,6 +455,19 @@ void Gameplay_Init(GameState* thisx) {
|
|||
Camera_InitPlayerSettings(&globalCtx->mainCamera, player);
|
||||
Camera_ChangeMode(&globalCtx->mainCamera, CAM_MODE_NORMAL);
|
||||
|
||||
// OTRTODO: Bounds check cameraDataList to guard against scenes spawning the player with
|
||||
// an out of bounds background camera index. This requires adding an extra field to the
|
||||
// CollisionHeader struct to save the length of cameraDataList.
|
||||
// Fixes Dodongo's Cavern blue warp crash.
|
||||
{
|
||||
CollisionHeader* colHeader = BgCheck_GetCollisionHeader(&globalCtx->colCtx, BGCHECK_SCENE);
|
||||
|
||||
// If the player's start cam is out of bounds, set it to 0xFF so it isn't used.
|
||||
if (colHeader != NULL && ((player->actor.params & 0xFF) >= colHeader->cameraDataListLen)) {
|
||||
player->actor.params |= 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
playerStartCamId = player->actor.params & 0xFF;
|
||||
if (playerStartCamId != 0xFF) {
|
||||
osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartCamId);
|
||||
|
@ -422,7 +507,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
|
||||
input = globalCtx->state.input;
|
||||
|
||||
if ((SREG(1) < 0) || (DREG(0) != 0)) {
|
||||
if ((SREG(1) < 0) || (DREG(0) != 0)) {
|
||||
SREG(1) = 0;
|
||||
ZeldaArena_Display();
|
||||
}
|
||||
|
@ -445,6 +530,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
ActorOverlayTable_LogPrint();
|
||||
}
|
||||
|
||||
if (CVar_GetS32("gFreeCamera", 0) && Player_InCsMode(globalCtx)) {
|
||||
globalCtx->manualCamera = false;
|
||||
}
|
||||
|
||||
gSegments[4] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment);
|
||||
gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
||||
gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment);
|
||||
|
@ -1042,6 +1131,14 @@ skip:
|
|||
|
||||
Environment_Update(globalCtx, &globalCtx->envCtx, &globalCtx->lightCtx, &globalCtx->pauseCtx, &globalCtx->msgCtx,
|
||||
&globalCtx->gameOverCtx, globalCtx->state.gfxCtx);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoRewardSariaGift(globalCtx, RC_LW_GIFT_FROM_SARIA);
|
||||
GivePlayerRandoRewardSongOfTime(globalCtx, RC_SONG_FROM_OCARINA_OF_TIME);
|
||||
GivePlayerRandoRewardZeldaLightArrowsGift(globalCtx, RC_TOT_LIGHT_ARROWS_CUTSCENE);
|
||||
GivePlayerRandoRewardNocturne(globalCtx, RC_SHEIK_IN_KAKARIKO);
|
||||
GivePlayerRandoRewardRequiem(globalCtx, RC_SHEIK_AT_COLOSSUS);
|
||||
}
|
||||
}
|
||||
|
||||
void Gameplay_DrawOverlayElements(GlobalContext* globalCtx) {
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#define NUM_DUNGEONS 8
|
||||
#define NUM_TRIALS 6
|
||||
|
||||
/**
|
||||
* Initialize new save.
|
||||
* This save has an empty inventory with 3 hearts and single magic.
|
||||
|
@ -24,6 +27,400 @@ void Sram_InitDebugSave(void) {
|
|||
Save_InitFile(true);
|
||||
}
|
||||
|
||||
// RANDOTODO replace most of these GiveLink functions with calls to
|
||||
// Item_Give in z_parameter, we'll need to update Item_Give to ensure
|
||||
// nothing breaks when calling it without a valid globalCtx first
|
||||
void GiveLinkRupees(int numOfRupees) {
|
||||
int maxRupeeCount;
|
||||
if (CUR_UPG_VALUE(UPG_WALLET) == 0) {
|
||||
maxRupeeCount = 99;
|
||||
} else if (CUR_UPG_VALUE(UPG_WALLET) == 1) {
|
||||
maxRupeeCount = 200;
|
||||
} else if (CUR_UPG_VALUE(UPG_WALLET) == 2) {
|
||||
maxRupeeCount = 500;
|
||||
}
|
||||
|
||||
int newRupeeCount = gSaveContext.rupees;
|
||||
newRupeeCount += numOfRupees;
|
||||
|
||||
if (newRupeeCount > maxRupeeCount) {
|
||||
gSaveContext.rupees = maxRupeeCount;
|
||||
} else {
|
||||
gSaveContext.rupees = newRupeeCount;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkRupeesByGetItemId(GetItemID giid) {
|
||||
if (giid == GI_RUPEE_GREEN) {
|
||||
GiveLinkRupees(1);
|
||||
} else if (giid == GI_RUPEE_BLUE) {
|
||||
GiveLinkRupees(5);
|
||||
} else if (giid == GI_RUPEE_RED) {
|
||||
GiveLinkRupees(20);
|
||||
} else if (giid == GI_RUPEE_PURPLE) {
|
||||
GiveLinkRupees(50);
|
||||
} else if (giid == GI_RUPEE_GOLD) {
|
||||
GiveLinkRupees(100);
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkBombchus(GetItemID giid) {
|
||||
INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU;
|
||||
if (giid == GI_BOMBCHUS_5) {
|
||||
AMMO(ITEM_BOMBCHU) += 5;
|
||||
} else if (giid == GI_BOMBCHUS_10) {
|
||||
AMMO(ITEM_BOMBCHU) += 10;
|
||||
} else if (giid == GI_BOMBCHUS_20) {
|
||||
AMMO(ITEM_BOMBCHU) += 20;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDekuSticks(int howManySticks) {
|
||||
int maxStickCount;
|
||||
if (CUR_UPG_VALUE(UPG_STICKS) == 0) {
|
||||
INV_CONTENT(ITEM_STICK) = ITEM_STICK;
|
||||
Inventory_ChangeUpgrade(UPG_STICKS, 1);
|
||||
maxStickCount = 10;
|
||||
} else if (CUR_UPG_VALUE(UPG_STICKS) == 1) {
|
||||
maxStickCount = 10;
|
||||
} else if (CUR_UPG_VALUE(UPG_STICKS) == 2) {
|
||||
maxStickCount = 20;
|
||||
} else if (CUR_UPG_VALUE(UPG_STICKS) == 3) {
|
||||
maxStickCount = 30;
|
||||
}
|
||||
|
||||
if ((AMMO(ITEM_STICK) + howManySticks) > maxStickCount) {
|
||||
AMMO(ITEM_STICK) = maxStickCount;
|
||||
} else {
|
||||
AMMO(ITEM_STICK) += howManySticks;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDekuSticksByGetItemId(GetItemID giid) {
|
||||
if (giid == GI_STICKS_1) {
|
||||
GiveLinkDekuSticks(1);
|
||||
} else if (giid == GI_STICKS_5) {
|
||||
GiveLinkDekuSticks(5);
|
||||
} else if (giid == GI_STICKS_10) {
|
||||
GiveLinkDekuSticks(10);
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDekuNuts(int howManyNuts) {
|
||||
int maxNutCount;
|
||||
if (CUR_UPG_VALUE(UPG_NUTS) == 0) {
|
||||
INV_CONTENT(ITEM_NUT) = ITEM_NUT;
|
||||
Inventory_ChangeUpgrade(UPG_NUTS, 1);
|
||||
maxNutCount = 20;
|
||||
} else if (CUR_UPG_VALUE(UPG_NUTS) == 1) {
|
||||
maxNutCount = 20;
|
||||
} else if (CUR_UPG_VALUE(UPG_NUTS) == 2) {
|
||||
maxNutCount = 30;
|
||||
} else if (CUR_UPG_VALUE(UPG_NUTS) == 3) {
|
||||
maxNutCount = 40;
|
||||
}
|
||||
|
||||
if ((AMMO(ITEM_NUT) + howManyNuts) > maxNutCount) {
|
||||
AMMO(ITEM_NUT) = maxNutCount;
|
||||
} else {
|
||||
AMMO(ITEM_NUT) += howManyNuts;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDekuNutsByGetItemId(GetItemID giid) {
|
||||
if (giid == GI_NUTS_5) {
|
||||
GiveLinkDekuNuts(5);
|
||||
} else if (giid == GI_NUTS_10) {
|
||||
GiveLinkDekuNuts(10);
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkBeans() {
|
||||
INV_CONTENT(ITEM_BEAN) = ITEM_BEAN;
|
||||
AMMO(ITEM_BEAN)++;
|
||||
}
|
||||
|
||||
void GiveLinkKokiriSword() {
|
||||
uint32_t bitMask = 1 << 0;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkGiantsKnife() {
|
||||
gSaveContext.bgsFlag = 0;
|
||||
gSaveContext.swordHealth = 8;
|
||||
uint32_t bitMask = 1 << 2;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkBiggoronSword() {
|
||||
gSaveContext.bgsFlag = 1;
|
||||
gSaveContext.swordHealth = 8;
|
||||
uint32_t bitMask = 1 << 2;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkDekuShield() {
|
||||
uint32_t bitMask = 1 << 4;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkHylianShield() {
|
||||
uint32_t bitMask = 1 << 5;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkMirrorShield() {
|
||||
uint32_t bitMask = 1 << 6;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkGoronTunic() {
|
||||
uint32_t bitMask = 1 << 9;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkZoraTunic() {
|
||||
uint32_t bitMask = 1 << 10;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkIronBoots() {
|
||||
uint32_t bitMask = 1 << 13;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkHoverBoots() {
|
||||
uint32_t bitMask = 1 << 14;
|
||||
gSaveContext.inventory.equipment |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkStoneOfAgony() {
|
||||
uint32_t bitMask = 1 << QUEST_STONE_OF_AGONY;
|
||||
gSaveContext.inventory.questItems |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkGerudoCard() {
|
||||
uint32_t bitMask = 1 << QUEST_GERUDO_CARD;
|
||||
gSaveContext.inventory.questItems |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkPieceOfHeart() {
|
||||
int32_t pohCount = (gSaveContext.inventory.questItems & 0xF0000000) >> 28;
|
||||
pohCount++;
|
||||
gSaveContext.inventory.questItems |= (pohCount << 28);
|
||||
}
|
||||
|
||||
void GiveLinkHeartContainer() {
|
||||
gSaveContext.healthCapacity += 16;
|
||||
gSaveContext.health += 16;
|
||||
}
|
||||
|
||||
void GiveLinkBulletBagUpgrade(GetItemID giid) {
|
||||
if (giid == GI_SLINGSHOT) {
|
||||
INV_CONTENT(ITEM_SLINGSHOT) = ITEM_SLINGSHOT;
|
||||
AMMO(ITEM_SLINGSHOT) = 30;
|
||||
Inventory_ChangeUpgrade(UPG_BULLET_BAG, 1);
|
||||
} else if (giid == GI_BULLET_BAG_40) {
|
||||
Inventory_ChangeUpgrade(UPG_BULLET_BAG, 2);
|
||||
AMMO(ITEM_SLINGSHOT) = 40;
|
||||
} else if (giid == GI_BULLET_BAG_50) {
|
||||
Inventory_ChangeUpgrade(UPG_BULLET_BAG, 3);
|
||||
AMMO(ITEM_SLINGSHOT) = 50;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkQuiverUpgrade(GetItemID giid) {
|
||||
if (giid == GI_BOW) {
|
||||
INV_CONTENT(ITEM_BOW) = ITEM_BOW;
|
||||
Inventory_ChangeUpgrade(UPG_QUIVER, 1);
|
||||
AMMO(ITEM_BOW) = 30;
|
||||
} else if (giid == GI_QUIVER_40) {
|
||||
Inventory_ChangeUpgrade(UPG_QUIVER, 2);
|
||||
AMMO(ITEM_BOW) = 40;
|
||||
} else if (giid == GI_QUIVER_50) {
|
||||
Inventory_ChangeUpgrade(UPG_QUIVER, 3);
|
||||
AMMO(ITEM_BOW) = 50;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkBombBagUpgrade(GetItemID giid) {
|
||||
if (giid == GI_BOMB_BAG_20) {
|
||||
INV_CONTENT(ITEM_BOMB) = ITEM_BOMB;
|
||||
Inventory_ChangeUpgrade(UPG_BOMB_BAG, 1);
|
||||
AMMO(ITEM_BOMB) = 20;
|
||||
} else if (giid == GI_BOMB_BAG_30) {
|
||||
Inventory_ChangeUpgrade(UPG_BOMB_BAG, 2);
|
||||
AMMO(ITEM_BOMB) = 30;
|
||||
} else if (giid == GI_BOMB_BAG_40) {
|
||||
Inventory_ChangeUpgrade(UPG_BOMB_BAG, 3);
|
||||
AMMO(ITEM_BOMB) = 40;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkStrengthUpgrade(GetItemID giid) {
|
||||
if (giid == GI_BRACELET) {
|
||||
Inventory_ChangeUpgrade(UPG_STRENGTH, 1);
|
||||
} else if (giid == GI_GAUNTLETS_SILVER) {
|
||||
Inventory_ChangeUpgrade(UPG_STRENGTH, 2);
|
||||
} else if (giid == GI_GAUNTLETS_GOLD) {
|
||||
Inventory_ChangeUpgrade(UPG_STRENGTH, 3);
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkScaleUpgrade(GetItemID giid) {
|
||||
if (giid == GI_SCALE_SILVER) {
|
||||
Inventory_ChangeUpgrade(UPG_SCALE, 1);
|
||||
} else if (giid == GI_SCALE_GOLD) {
|
||||
Inventory_ChangeUpgrade(UPG_SCALE, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkWalletUpgrade(GetItemID giid) {
|
||||
if (giid == GI_WALLET_ADULT) {
|
||||
Inventory_ChangeUpgrade(UPG_WALLET, 1);
|
||||
} else if (giid == GI_WALLET_GIANT) {
|
||||
Inventory_ChangeUpgrade(UPG_WALLET, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDekuStickUpgrade(GetItemID giid) {
|
||||
if (giid == GI_STICK_UPGRADE_20) {
|
||||
INV_CONTENT(ITEM_STICK) = ITEM_STICK;
|
||||
Inventory_ChangeUpgrade(UPG_STICKS, 2);
|
||||
AMMO(ITEM_STICK) = 20;
|
||||
} else if (giid == GI_STICK_UPGRADE_30) {
|
||||
Inventory_ChangeUpgrade(UPG_STICKS, 3);
|
||||
AMMO(ITEM_STICK) = 30;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDekuNutUpgrade(GetItemID giid) {
|
||||
if (giid == GI_NUT_UPGRADE_30) {
|
||||
INV_CONTENT(ITEM_NUT) = ITEM_NUT;
|
||||
Inventory_ChangeUpgrade(UPG_NUTS, 2);
|
||||
AMMO(ITEM_NUT) = 30;
|
||||
} else if (giid == GI_NUT_UPGRADE_40) {
|
||||
Inventory_ChangeUpgrade(UPG_NUTS, 3);
|
||||
AMMO(ITEM_NUT) = 40;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkMagic(GetItemID giid) {
|
||||
if (giid == GI_SINGLE_MAGIC) {
|
||||
gSaveContext.magicLevel = 1;
|
||||
gSaveContext.magicAcquired = true;
|
||||
gSaveContext.doubleMagic = false;
|
||||
} else if (giid == GI_DOUBLE_MAGIC) {
|
||||
gSaveContext.magicLevel = 2;
|
||||
gSaveContext.magicAcquired = true;
|
||||
gSaveContext.doubleMagic = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinkDoubleDefense() {
|
||||
gSaveContext.doubleDefense = 1;
|
||||
gSaveContext.inventory.defenseHearts = 20;
|
||||
}
|
||||
|
||||
void GiveLinkSong(GetItemID getItemId) {
|
||||
uint32_t bitMask;
|
||||
|
||||
switch (getItemId) {
|
||||
case GI_ZELDAS_LULLABY:
|
||||
bitMask = 1 << QUEST_SONG_LULLABY;
|
||||
break;
|
||||
case GI_SUNS_SONG:
|
||||
bitMask = 1 << QUEST_SONG_SUN;
|
||||
break;
|
||||
case GI_EPONAS_SONG:
|
||||
bitMask = 1 << QUEST_SONG_EPONA;
|
||||
break;
|
||||
case GI_SONG_OF_STORMS:
|
||||
bitMask = 1 << QUEST_SONG_STORMS;
|
||||
break;
|
||||
case GI_SONG_OF_TIME:
|
||||
bitMask = 1 << QUEST_SONG_TIME;
|
||||
break;
|
||||
case GI_SARIAS_SONG:
|
||||
bitMask = 1 << QUEST_SONG_SARIA;
|
||||
break;
|
||||
case GI_MINUET_OF_FOREST:
|
||||
bitMask = 1 << QUEST_SONG_MINUET;
|
||||
break;
|
||||
case GI_BOLERO_OF_FIRE:
|
||||
bitMask = 1 << QUEST_SONG_BOLERO;
|
||||
break;
|
||||
case GI_SERENADE_OF_WATER:
|
||||
bitMask = 1 << QUEST_SONG_SERENADE;
|
||||
break;
|
||||
case GI_NOCTURNE_OF_SHADOW:
|
||||
bitMask = 1 << QUEST_SONG_NOCTURNE;
|
||||
break;
|
||||
case GI_REQUIEM_OF_SPIRIT:
|
||||
bitMask = 1 << QUEST_SONG_REQUIEM;
|
||||
break;
|
||||
case GI_PRELUDE_OF_LIGHT:
|
||||
bitMask = 1 << QUEST_SONG_PRELUDE;
|
||||
break;
|
||||
}
|
||||
|
||||
gSaveContext.inventory.questItems |= bitMask;
|
||||
}
|
||||
|
||||
void GiveLinkDungeonReward(GetItemID getItemId) {
|
||||
s16 item;
|
||||
|
||||
u8 medallion = 0;
|
||||
|
||||
switch (getItemId) {
|
||||
case GI_MEDALLION_FOREST:
|
||||
item = ITEM_MEDALLION_FOREST;
|
||||
medallion = 1;
|
||||
break;
|
||||
case GI_MEDALLION_FIRE:
|
||||
item = ITEM_MEDALLION_FIRE;
|
||||
medallion = 1;
|
||||
break;
|
||||
case GI_MEDALLION_WATER:
|
||||
item = ITEM_MEDALLION_WATER;
|
||||
medallion = 1;
|
||||
break;
|
||||
case GI_MEDALLION_SHADOW:
|
||||
item = ITEM_MEDALLION_SHADOW;
|
||||
medallion = 1;
|
||||
break;
|
||||
case GI_MEDALLION_SPIRIT:
|
||||
item = ITEM_MEDALLION_SPIRIT;
|
||||
medallion = 1;
|
||||
break;
|
||||
case GI_MEDALLION_LIGHT:
|
||||
item = ITEM_MEDALLION_LIGHT;
|
||||
medallion = 1;
|
||||
break;
|
||||
case GI_STONE_KOKIRI:
|
||||
item = ITEM_KOKIRI_EMERALD;
|
||||
break;
|
||||
case GI_STONE_GORON:
|
||||
item = ITEM_GORON_RUBY;
|
||||
break;
|
||||
case GI_STONE_ZORA:
|
||||
item = ITEM_ZORA_SAPPHIRE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (medallion == 1) {
|
||||
gSaveContext.inventory.questItems |= gBitFlags[item - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST];
|
||||
} else {
|
||||
gSaveContext.inventory.questItems |= gBitFlags[item - ITEM_KOKIRI_EMERALD + QUEST_KOKIRI_EMERALD];
|
||||
}
|
||||
}
|
||||
|
||||
void GiveLinksPocketMedallion() {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(RC_LINKS_POCKET, RG_NONE);
|
||||
|
||||
GiveLinkDungeonReward(getItemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy save currently on the buffer to Save Context and complete various tasks to open the save.
|
||||
* This includes:
|
||||
|
@ -141,7 +538,7 @@ void Sram_OpenSave() {
|
|||
}
|
||||
|
||||
// if zelda cutscene has been watched but lullaby was not obtained, restore cutscene and take away letter
|
||||
if ((gSaveContext.eventChkInf[4] & 1) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY)) {
|
||||
if ((gSaveContext.eventChkInf[4] & 1) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) {
|
||||
i = gSaveContext.eventChkInf[4] & ~1;
|
||||
gSaveContext.eventChkInf[4] = i;
|
||||
|
||||
|
@ -202,6 +599,278 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
|
|||
gSaveContext.playerName[offset] = Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->playerName[offset];
|
||||
}
|
||||
|
||||
if (CVar_GetS32("gRandomizer", 0) != 0 &&
|
||||
strcmp(CVar_GetString("gSpoilerLog", ""), "") != 0) {
|
||||
// Set N64DD Flags for save file
|
||||
fileChooseCtx->n64ddFlags[fileChooseCtx->buttonIndex] = 1;
|
||||
fileChooseCtx->n64ddFlag = 1;
|
||||
gSaveContext.n64ddFlag = 1;
|
||||
|
||||
// Sets all the dungeons to incomplete when generating a rando save. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/82
|
||||
for (u8 i = 0; i < NUM_DUNGEONS; i++) {
|
||||
gSaveContext.dungeonsDone[i] = 0;
|
||||
}
|
||||
|
||||
// Sets all Ganon's Trials to incomplete when generating a rando save. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
|
||||
for (u8 i = 0; i < NUM_TRIALS; i++) {
|
||||
gSaveContext.trialsDone[i] = 0;
|
||||
}
|
||||
|
||||
// Set Cutscene flags to skip them
|
||||
gSaveContext.eventChkInf[0xC] |= 0x10; // returned to tot with medallions
|
||||
gSaveContext.eventChkInf[0xC] |= 0x20; //sheik at tot pedestal
|
||||
gSaveContext.eventChkInf[4] |= 0x20; // master sword pulled
|
||||
gSaveContext.eventChkInf[4] |= 0x8000; // entered master sword chamber
|
||||
gSaveContext.infTable[0] |= 1;
|
||||
// RANDTODO: Don't skip this scene if Don't Skip Glitch Useful Cutscenes is enabled.
|
||||
gSaveContext.infTable[17] |= 0x400; // Darunia in Fire Temple
|
||||
gSaveContext.cutsceneIndex = 0;
|
||||
Flags_SetEventChkInf(5);
|
||||
|
||||
// Skip boss cutscenes
|
||||
gSaveContext.eventChkInf[7] |= 1; // gohma
|
||||
gSaveContext.eventChkInf[7] |= 2; // dodongo
|
||||
gSaveContext.eventChkInf[7] |= 4; // phantom ganon
|
||||
gSaveContext.eventChkInf[7] |= 8; // volvagia
|
||||
gSaveContext.eventChkInf[7] |= 0x10; // morpha
|
||||
gSaveContext.eventChkInf[7] |= 0x20; // twinrova
|
||||
gSaveContext.eventChkInf[7] |= 0x40; // barinade
|
||||
gSaveContext.eventChkInf[7] |= 0x80; // bongo bongo
|
||||
|
||||
// Skip cutscene before Nabooru fight
|
||||
gSaveContext.eventChkInf[3] |= 0x800;
|
||||
gSaveContext.eventChkInf[12] |= 1;
|
||||
|
||||
// Give Link's pocket item
|
||||
GiveLinksPocketMedallion();
|
||||
|
||||
int openForest = GetRandoSettingValue(RSK_FOREST);
|
||||
switch (openForest) {
|
||||
case 0: // closed
|
||||
break;
|
||||
case 1: // open
|
||||
Flags_SetEventChkInf(7);
|
||||
gSaveContext.eventChkInf[0] |= 0x10;
|
||||
break;
|
||||
case 2: // closed deku
|
||||
Flags_SetEventChkInf(7);
|
||||
break;
|
||||
}
|
||||
|
||||
int doorOfTime = GetRandoSettingValue(RSK_DOOR_OF_TIME);
|
||||
switch (doorOfTime) {
|
||||
case 0: // open
|
||||
gSaveContext.eventChkInf[4] |= 0x800;
|
||||
break;
|
||||
}
|
||||
|
||||
int kakGate = GetRandoSettingValue(RSK_KAK_GATE);
|
||||
switch (kakGate) {
|
||||
case 1: // open
|
||||
gSaveContext.infTable[7] |= 0x40;
|
||||
break;
|
||||
}
|
||||
|
||||
if(GetRandoSettingValue(RSK_STARTING_KOKIRI_SWORD)) GiveLinkKokiriSword();
|
||||
if(GetRandoSettingValue(RSK_STARTING_DEKU_SHIELD)) GiveLinkDekuShield();
|
||||
|
||||
if(GetRandoSettingValue(RSK_STARTING_OCARINA)) {
|
||||
INV_CONTENT(ITEM_OCARINA_FAIRY) = ITEM_OCARINA_FAIRY;
|
||||
}
|
||||
|
||||
if(GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES)) {
|
||||
uint32_t mapBitMask = 1 << 1;
|
||||
uint32_t compassBitMask = 1 << 2;
|
||||
uint32_t startingDungeonItemsBitMask = mapBitMask | compassBitMask;
|
||||
for(int scene = 0; scene <= 9; scene++) {
|
||||
gSaveContext.inventory.dungeonItems[scene] |= startingDungeonItemsBitMask;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetRandoSettingValue(RSK_STARTING_CONSUMABLES)) {
|
||||
GiveLinkDekuSticks(10);
|
||||
GiveLinkDekuNuts(20);
|
||||
}
|
||||
|
||||
if(GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA)) {
|
||||
s32 giid = GetRandomizedItemIdFromKnownCheck(RC_SONG_FROM_IMPA, GI_ZELDAS_LULLABY);
|
||||
|
||||
if(giid >= GI_ZELDAS_LULLABY && giid <= GI_PRELUDE_OF_LIGHT) {
|
||||
GiveLinkSong(giid);
|
||||
} else if (giid == GI_RUPEE_GREEN ||
|
||||
giid == GI_RUPEE_BLUE ||
|
||||
giid == GI_RUPEE_RED ||
|
||||
giid == GI_RUPEE_PURPLE ||
|
||||
giid == GI_RUPEE_GOLD) {
|
||||
GiveLinkRupeesByGetItemId(giid);
|
||||
} else if (giid == GI_BOMBCHUS_10 ||
|
||||
giid == GI_BOMBCHUS_5 ||
|
||||
giid == GI_BOMBCHUS_20) {
|
||||
GiveLinkBombchus(giid);
|
||||
} else if (giid == GI_STICKS_1 ||
|
||||
giid == GI_STICKS_5 ||
|
||||
giid == GI_STICKS_10) {
|
||||
GiveLinkDekuSticksByGetItemId(giid);
|
||||
} else if (giid == GI_NUTS_5 ||
|
||||
giid == GI_NUTS_10) {
|
||||
GiveLinkDekuNutsByGetItemId(giid);
|
||||
} else if (giid == GI_BEAN) {
|
||||
GiveLinkBeans();
|
||||
} else if (giid >= GI_MEDALLION_LIGHT && giid <= GI_STONE_ZORA) {
|
||||
GiveLinkDungeonReward(giid);
|
||||
} else if (giid == GI_SWORD_KOKIRI) {
|
||||
GiveLinkKokiriSword();
|
||||
} else if (giid == GI_SWORD_BGS) {
|
||||
GiveLinkBiggoronSword();
|
||||
} else if (giid == GI_SWORD_KNIFE) {
|
||||
GiveLinkGiantsKnife();
|
||||
} else if (giid == GI_SHIELD_DEKU) {
|
||||
GiveLinkDekuShield();
|
||||
} else if (giid == GI_SHIELD_HYLIAN) {
|
||||
GiveLinkHylianShield();
|
||||
} else if (giid == GI_SHIELD_MIRROR) {
|
||||
GiveLinkMirrorShield();
|
||||
} else if (giid == GI_TUNIC_GORON) {
|
||||
GiveLinkGoronTunic();
|
||||
} else if (giid == GI_TUNIC_ZORA) {
|
||||
GiveLinkZoraTunic();
|
||||
} else if (giid == GI_BOOTS_IRON) {
|
||||
GiveLinkIronBoots();
|
||||
} else if (giid == GI_BOOTS_HOVER) {
|
||||
GiveLinkHoverBoots();
|
||||
} else if (giid == GI_SLINGSHOT ||
|
||||
giid == GI_BULLET_BAG_40 ||
|
||||
giid == GI_BULLET_BAG_50) {
|
||||
GiveLinkBulletBagUpgrade(giid);
|
||||
} else if (giid == GI_BOW ||
|
||||
giid == GI_QUIVER_40 ||
|
||||
giid == GI_QUIVER_50) {
|
||||
GiveLinkQuiverUpgrade(giid);
|
||||
} else if (giid == GI_BOMB_BAG_20 ||
|
||||
giid == GI_BOMB_BAG_30 ||
|
||||
giid == GI_BOMB_BAG_40) {
|
||||
GiveLinkBombBagUpgrade(giid);
|
||||
} else if (giid == GI_BRACELET ||
|
||||
giid == GI_GAUNTLETS_SILVER ||
|
||||
giid == GI_GAUNTLETS_GOLD) {
|
||||
GiveLinkStrengthUpgrade(giid);
|
||||
} else if (giid == GI_SCALE_SILVER ||
|
||||
giid == GI_SCALE_GOLD) {
|
||||
GiveLinkScaleUpgrade(giid);
|
||||
} else if (giid == GI_WALLET_ADULT ||
|
||||
giid == GI_WALLET_GIANT) {
|
||||
GiveLinkWalletUpgrade(giid);
|
||||
} else if (giid == GI_STONE_OF_AGONY) {
|
||||
GiveLinkStoneOfAgony();
|
||||
} else if (giid == GI_GERUDO_CARD) {
|
||||
GiveLinkGerudoCard();
|
||||
} else if (giid == GI_HEART_PIECE) {
|
||||
GiveLinkPieceOfHeart();
|
||||
} else if (giid == GI_HEART_CONTAINER) {
|
||||
GiveLinkHeartContainer();
|
||||
} else if (giid == GI_STICK_UPGRADE_20 ||
|
||||
giid == GI_STICK_UPGRADE_30) {
|
||||
GiveLinkDekuStickUpgrade(giid);
|
||||
} else if (giid == GI_NUT_UPGRADE_30 ||
|
||||
giid == GI_NUT_UPGRADE_40) {
|
||||
GiveLinkDekuNutUpgrade(giid);
|
||||
} else if (giid == GI_SINGLE_MAGIC ||
|
||||
giid == GI_DOUBLE_MAGIC) {
|
||||
GiveLinkMagic(giid);
|
||||
} else if (giid == GI_DOUBLE_DEFENSE) {
|
||||
GiveLinkDoubleDefense();
|
||||
} else {
|
||||
s32 iid = GetItemIDFromGetItemID(giid);
|
||||
if (iid != -1) INV_CONTENT(iid) = iid;
|
||||
}
|
||||
|
||||
// malon/talon back at ranch
|
||||
gSaveContext.eventChkInf[1] |= (1 << 0);
|
||||
gSaveContext.eventChkInf[1] |= (1 << 2);
|
||||
gSaveContext.eventChkInf[1] |= (1 << 3);
|
||||
gSaveContext.eventChkInf[1] |= (1 << 4);
|
||||
|
||||
// Got item from impa
|
||||
gSaveContext.eventChkInf[5] |= 0x200;
|
||||
|
||||
// make sure saria is at SFM
|
||||
gSaveContext.eventChkInf[4] |= (1 << 0);
|
||||
|
||||
// set this at the end to ensure we always start with the letter
|
||||
// this is for the off chance we got the weird egg from impa (which should never happen)
|
||||
INV_CONTENT(ITEM_LETTER_ZELDA) = ITEM_LETTER_ZELDA;
|
||||
}
|
||||
|
||||
if (GetRandoSettingValue(RSK_FULL_WALLETS)) {
|
||||
GiveLinkRupees(9001);
|
||||
}
|
||||
|
||||
// For Ganon's boss key "Start With" is 0
|
||||
if(GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == 0) {
|
||||
gSaveContext.inventory.dungeonItems[10] |= 1;
|
||||
}
|
||||
|
||||
HIGH_SCORE(HS_POE_POINTS) = 1000 - (100 * GetRandoSettingValue(RSK_BIG_POE_COUNT));
|
||||
|
||||
if(GetRandoSettingValue(RSK_SKIP_EPONA_RACE)) {
|
||||
gSaveContext.eventChkInf[1] |= (1 << 8);
|
||||
}
|
||||
|
||||
// skip the z target talk instructions by the kokiri shop
|
||||
gSaveContext.sceneFlags[85].swch |= (1 << 0x1F);
|
||||
|
||||
//Ruto already met in jabu and spawns down the hole immediately
|
||||
gSaveContext.infTable[20] |= 2;
|
||||
gSaveContext.infTable[20] |= 4;
|
||||
|
||||
// Go away ruto (water temple first cutscene)
|
||||
gSaveContext.sceneFlags[05].swch |= (1 << 0x10);
|
||||
|
||||
// Opens locked Water Temple door to prevent softlocks
|
||||
// West door on the middle level that leads to the water raising thing
|
||||
// Happens in 3DS rando and N64 rando as well
|
||||
gSaveContext.sceneFlags[05].swch |= (1 << 0x15);
|
||||
|
||||
// Skip intro cutscene when bombing mud wall in Dodongo's cavern
|
||||
// this also makes the lower jaw render, and the eyes react to explosives
|
||||
Flags_SetEventChkInf(0xB0);
|
||||
|
||||
// skip verbose lake owl, skip to "i'm on my way back to the castle"
|
||||
gSaveContext.infTable[25] |= 0x20;
|
||||
|
||||
// fast gerudo fortress
|
||||
if (GetRandoSettingValue(RSK_GERUDO_FORTRESS) == 1 || GetRandoSettingValue(RSK_GERUDO_FORTRESS) == 2) {
|
||||
gSaveContext.eventChkInf[9] |= 2;
|
||||
gSaveContext.eventChkInf[9] |= 4;
|
||||
gSaveContext.eventChkInf[9] |= 8;
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x02);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x03);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x04);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x06);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x07);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x08);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x10);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x12);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x13);
|
||||
gSaveContext.sceneFlags[12].collect |= (1 << 0x0A);
|
||||
gSaveContext.sceneFlags[12].collect |= (1 << 0x0E);
|
||||
gSaveContext.sceneFlags[12].collect |= (1 << 0x0F);
|
||||
}
|
||||
|
||||
// open gerudo fortress
|
||||
if (GetRandoSettingValue(RSK_GERUDO_FORTRESS) == 2) {
|
||||
gSaveContext.eventChkInf[9] |= 1;
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x01);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x05);
|
||||
gSaveContext.sceneFlags[12].swch |= (1 << 0x11);
|
||||
gSaveContext.sceneFlags[12].collect |= (1 << 0x0C);
|
||||
|
||||
if (!GetRandoSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD)) {
|
||||
GiveLinkGerudoCard();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Save_SaveFile();
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,19 @@ const ActorInit Bg_Dy_Yoseizo_InitVars = {
|
|||
NULL,
|
||||
};
|
||||
|
||||
void GivePlayerRandoRewardGreatFairy(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum);
|
||||
|
||||
if (this->actor.parent == GET_PLAYER(globalCtx) && !Flags_GetTreasure(globalCtx, this->fountainType + 1) &&
|
||||
!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
Flags_SetTreasure(globalCtx, this->fountainType + 1);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (!Flags_GetTreasure(globalCtx, this->fountainType + 1)) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void BgDyYoseizo_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
|
||||
|
@ -182,6 +195,18 @@ void BgDyYoseizo_Bob(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
|||
void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
||||
if (Flags_GetSwitch(globalCtx, 0x38)) {
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
|
||||
if(gSaveContext.n64ddFlag) {
|
||||
gSaveContext.healthAccumulator = 0x140;
|
||||
Magic_Fill(globalCtx);
|
||||
if(Flags_GetTreasure(globalCtx, this->fountainType + 1)) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
GivePlayerRandoRewardGreatFairy(this, globalCtx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
|
||||
if (!gSaveContext.magicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) {
|
||||
Actor_Kill(&this->actor);
|
||||
|
|
|
@ -44,7 +44,9 @@ void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->somePos.x = thisx->world.pos.x;
|
||||
this->somePos.y = thisx->world.pos.y;
|
||||
this->somePos.z = thisx->world.pos.z;
|
||||
if (((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) &&
|
||||
if (((gSaveContext.infTable[7] & 0x40) ||
|
||||
(!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[4] & 0x20)) ||
|
||||
(gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_KAK_GATE))) &&
|
||||
(globalCtx->sceneNum == SCENE_SPOT01)) {
|
||||
thisx->world.pos.x = -89.0f;
|
||||
thisx->world.pos.z = -1375.0f;
|
||||
|
|
|
@ -50,7 +50,8 @@ void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
|
||||
|
||||
if (gSaveContext.eventChkInf[4] & 0x2000) {
|
||||
int bridge = GetRandoSettingValue(RSK_RAINBOW_BRIDGE);
|
||||
if (gSaveContext.eventChkInf[4] & 0x2000 || (gSaveContext.n64ddFlag && bridge == 0)) {
|
||||
this->actionFunc = func_808787A4;
|
||||
} else {
|
||||
this->dyna.actor.draw = NULL;
|
||||
|
@ -68,17 +69,155 @@ void BgGjyoBridge_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void func_808787A4(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void LaunchBridgeCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gRainbowBridgeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->actionFunc = BgGjyoBridge_SpawnBridge;
|
||||
}
|
||||
|
||||
u8 CheckPlayerPosition(Player* player, GlobalContext* globalCtx) {
|
||||
return (player->actor.world.pos.x > -70.0f) && (player->actor.world.pos.x < 300.0f) &&
|
||||
(player->actor.world.pos.y > 1340.0f) && (player->actor.world.pos.z > 1340.0f) &&
|
||||
(player->actor.world.pos.z < 1662.0f) && !Gameplay_InCsMode(globalCtx);
|
||||
}
|
||||
|
||||
u8 CheckStoneCount() {
|
||||
u8 stoneCount = 0;
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
||||
stoneCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
stoneCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
stoneCount++;
|
||||
}
|
||||
|
||||
return stoneCount;
|
||||
}
|
||||
|
||||
u8 CheckMedallionCount() {
|
||||
u8 medallionCount = 0;
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) {
|
||||
medallionCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
|
||||
medallionCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) {
|
||||
medallionCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
||||
medallionCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
|
||||
medallionCount++;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_LIGHT)) {
|
||||
medallionCount++;
|
||||
}
|
||||
|
||||
return medallionCount;
|
||||
}
|
||||
|
||||
u8 CheckDungeonCount() {
|
||||
u8 dungeonCount = 0;
|
||||
|
||||
if (gSaveContext.dungeonsDone[0] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[1] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[2] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[3] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[4] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[5] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[6] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[7] == 1) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
return dungeonCount;
|
||||
}
|
||||
|
||||
void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.world.pos.x > -70.0f) &&
|
||||
(player->actor.world.pos.x < 300.0f) && (player->actor.world.pos.y > 1340.0f) &&
|
||||
(player->actor.world.pos.z > 1340.0f) && (player->actor.world.pos.z < 1662.0f) &&
|
||||
!Gameplay_InCsMode(globalCtx)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gRainbowBridgeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->actionFunc = BgGjyoBridge_SpawnBridge;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && CheckPlayerPosition(player, globalCtx)) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
} else {
|
||||
int bridge = GetRandoSettingValue(RSK_RAINBOW_BRIDGE);
|
||||
int bridgeStoneCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_STONE_COUNT);
|
||||
int bridgeMedallionCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT);
|
||||
int bridgeRewardCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_REWARD_COUNT);
|
||||
int bridgeDungeonCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT);
|
||||
int bridgeTokenCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_TOKEN_COUNT);
|
||||
|
||||
if (CheckPlayerPosition(player, globalCtx)) {
|
||||
switch (bridge) {
|
||||
case 1:
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT)) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (CheckStoneCount() >= bridgeStoneCount) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (CheckMedallionCount() >= bridgeMedallionCount) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if ((CheckMedallionCount() + CheckStoneCount()) >= bridgeRewardCount) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (CheckDungeonCount() >= bridgeDungeonCount) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (gSaveContext.inventory.gsTokens >= bridgeTokenCount) {
|
||||
LaunchBridgeCutscene(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (this->dyna.unk_150 != 0.0f) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY && !gSaveContext.n64ddFlag && !CVar_GetS32("gDayGravePull", 0)) {
|
||||
this->dyna.unk_150 = 0.0f;
|
||||
player->stateFlags2 &= ~0x10;
|
||||
if (!Gameplay_InCsMode(globalCtx)) {
|
||||
|
|
|
@ -79,8 +79,9 @@ void BgSpot00Hanebasi_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (gSaveContext.sceneSetupIndex != 6) {
|
||||
// Don't close the bridge in rando to accomodate hyrule castle exit
|
||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
|
||||
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1)) {
|
||||
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1) && !(gSaveContext.n64ddFlag)) {
|
||||
this->dyna.actor.shape.rot.x = -0x4000;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,6 +129,18 @@ void func_808AC908(BgSpot02Objects* this, GlobalContext* globalCtx) {
|
|||
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3f pos;
|
||||
|
||||
// We want to do most of the same things in rando, but we're not in a cutscene and the flag for
|
||||
// destroying the royal tombstone is already set.
|
||||
if (gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0x2000) {
|
||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION);
|
||||
this->timer = 25;
|
||||
pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x;
|
||||
pos.y = this->dyna.actor.world.pos.y + 30.0f;
|
||||
pos.z = (Math_CosS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.z;
|
||||
EffectSsBomb2_SpawnLayered(globalCtx, &pos, &zeroVec, &zeroVec, 70, 30);
|
||||
this->actionFunc = func_808ACA08;
|
||||
}
|
||||
|
||||
if (globalCtx->csCtx.state != 0) {
|
||||
if (globalCtx->csCtx.npcActions[3] != NULL && globalCtx->csCtx.npcActions[3]->action == 2) {
|
||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION);
|
||||
|
@ -146,19 +158,23 @@ void func_808AC908(BgSpot02Objects* this, GlobalContext* globalCtx) {
|
|||
void func_808ACA08(BgSpot02Objects* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
// The visual effects play the same way whether in rando or not, we just don't want
|
||||
// to play the damage animation on link.
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
if (this->timer == 20) {
|
||||
this->dyna.actor.draw = NULL;
|
||||
EffectSsHahen_SpawnBurst(globalCtx, &this->dyna.actor.world.pos, 30.0f, 0, 25, 5, 40, OBJECT_SPOT02_OBJECTS, 20,
|
||||
object_spot02_objects_DL_012D30);
|
||||
EffectSsHahen_SpawnBurst(globalCtx, &this->dyna.actor.world.pos, 30.0f, 0, 25, 5, 40, OBJECT_SPOT02_OBJECTS,
|
||||
20, object_spot02_objects_DL_012D30);
|
||||
} else if (this->timer == 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
}
|
||||
|
||||
if (globalCtx->csCtx.frames == 402) {
|
||||
// This shouldn't execute in rando even without the check since we never
|
||||
// enter the cutscene context.
|
||||
if (globalCtx->csCtx.frames == 402 && !(gSaveContext.n64ddFlag)) {
|
||||
if (!LINK_IS_ADULT) {
|
||||
func_8002F7DC(&player->actor, NA_SE_VO_LI_DEMO_DAMAGE_KID);
|
||||
} else {
|
||||
|
@ -201,6 +217,13 @@ void BgSpot02Objects_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_808ACC34(BgSpot02Objects* this, GlobalContext* globalCtx) {
|
||||
// This is the actionFunc that the game settles on when you load the Graveyard
|
||||
// When we're in rando and the flag for the gravestone being destroyed gets set,
|
||||
// set the actionFunc to the function where the gravestone explodes.
|
||||
if (gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0X2000) {
|
||||
this->actionFunc = func_808AC908;
|
||||
}
|
||||
|
||||
if (globalCtx->csCtx.state != 0 && globalCtx->csCtx.npcActions[0] != NULL &&
|
||||
globalCtx->csCtx.npcActions[0]->action == 2) {
|
||||
this->unk_16A++;
|
||||
|
|
|
@ -150,7 +150,9 @@ void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_ProcessInitChain(thisx, sInitChainWaterPlane);
|
||||
thisx->flags = ACTOR_FLAG_4 | ACTOR_FLAG_5;
|
||||
|
||||
if (LINK_IS_ADULT && !(gSaveContext.eventChkInf[6] & 0x200)) {
|
||||
if (LINK_IS_ADULT &&
|
||||
((!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[6] & 0x200)) ||
|
||||
(gSaveContext.n64ddFlag && !gSaveContext.dungeonsDone[5]))) {
|
||||
if (gSaveContext.sceneSetupIndex < 4) {
|
||||
this->lakeHyliaWaterLevel = -681.0f;
|
||||
globalCtx->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface =
|
||||
|
|
|
@ -74,7 +74,25 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
BgTokiSwd_SetupAction(this, func_808BAF40);
|
||||
|
||||
if (LINK_IS_ADULT) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (!CUR_UPG_VALUE(UPG_BOMB_BAG)) {
|
||||
for (size_t i = 0; i < 8; i++) {
|
||||
if (gSaveContext.equips.buttonItems[i] == ITEM_BOMB) {
|
||||
gSaveContext.equips.buttonItems[i] = ITEM_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this->actor.draw = NULL;
|
||||
} else if (gSaveContext.n64ddFlag) {
|
||||
// don't give child link a kokiri sword if we don't have one
|
||||
uint32_t kokiriSwordBitMask = 1 << 0;
|
||||
if (!(gSaveContext.inventory.equipment & kokiriSwordBitMask)) {
|
||||
Player* player = GET_PLAYER(gGlobalCtx);
|
||||
player->currentSwordItem = ITEM_NONE;
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
|
||||
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.sceneSetupIndex == 5) {
|
||||
|
@ -100,7 +118,8 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
|
|||
globalCtx->csCtx.segment = D_808BBD90;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
}
|
||||
if (!LINK_IS_ADULT || ((gSaveContext.eventChkInf[5] & 0x20))) {
|
||||
|
||||
if (!LINK_IS_ADULT || (gSaveContext.eventChkInf[5] & 0x20 && !gSaveContext.n64ddFlag) || gSaveContext.n64ddFlag) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if (!LINK_IS_ADULT) {
|
||||
Item_Give(globalCtx, ITEM_SWORD_MASTER);
|
||||
|
@ -114,7 +133,9 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
BgTokiSwd_SetupAction(this, func_808BB0AC);
|
||||
} else {
|
||||
if (Actor_IsFacingPlayer(&this->actor, 0x2000)) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
if (Actor_IsFacingPlayer(&this->actor, 0x2000) &&
|
||||
(!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && player->getItemId == GI_NONE))) {
|
||||
func_8002F580(&this->actor, globalCtx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,9 +216,10 @@ void BossDodongo_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->items);
|
||||
|
||||
if (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)) { // KD is dead
|
||||
temp_s1_3 = SEGMENTED_TO_VIRTUAL(gDodongosCavernBossLavaFloorTex);
|
||||
temp_s2 = SEGMENTED_TO_VIRTUAL(sLavaFloorRockTex);
|
||||
|
||||
u16* LavaFloorTex = ResourceMgr_LoadTexByName(gDodongosCavernBossLavaFloorTex);
|
||||
u16* LavaFloorRockTex = ResourceMgr_LoadTexByName(sLavaFloorRockTex);
|
||||
temp_s1_3 = SEGMENTED_TO_VIRTUAL(LavaFloorTex);
|
||||
temp_s2 = SEGMENTED_TO_VIRTUAL(LavaFloorRockTex);
|
||||
Actor_Kill(&this->actor);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, -890.0f, -1523.76f,
|
||||
-3304.0f, 0, 0, 0, WARP_DUNGEON_CHILD);
|
||||
|
|
|
@ -559,7 +559,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
Gameplay_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE);
|
||||
this->csCamFov = 60.0f;
|
||||
|
||||
if (gSaveContext.eventChkInf[7] & 0x100) {
|
||||
if (gSaveContext.eventChkInf[7] & 0x100 || gSaveContext.n64ddFlag) {
|
||||
// watched cutscene already, skip most of it
|
||||
this->csState = 17;
|
||||
this->csTimer = 0;
|
||||
|
@ -891,7 +891,9 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
this->csTimer = 0;
|
||||
this->csCamFov = 60.0f;
|
||||
BossGanon_SetIntroCsCamera(this, 12);
|
||||
Message_StartTextbox(globalCtx, 0x70CB, NULL);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Message_StartTextbox(globalCtx, 0x70CB, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1502,7 +1504,13 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx)
|
|||
|
||||
if (this->csTimer == 180) {
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->nextEntranceIndex = 0x43F;
|
||||
if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_SKIP_TOWER_ESCAPE)) {
|
||||
Flags_SetEventChkInf(0xC7);
|
||||
globalCtx->nextEntranceIndex = 0x517;
|
||||
}
|
||||
else {
|
||||
globalCtx->nextEntranceIndex = 0x43F;
|
||||
}
|
||||
globalCtx->fadeTransition = 5;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1008,11 +1008,26 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) {
|
|||
case DEATH_THROES:
|
||||
switch (this->work[GND_ACTION_STATE]) {
|
||||
case DEATH_SPASM:
|
||||
if (Animation_OnFrame(&this->skelAnime, this->fwork[GND_END_FRAME])) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->fwork[GND_END_FRAME]) && !gSaveContext.n64ddFlag) {
|
||||
this->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonAirDamageAnim);
|
||||
Animation_Change(&this->skelAnime, &gPhantomGanonAirDamageAnim, 0.5f, 0.0f,
|
||||
this->fwork[GND_END_FRAME], ANIMMODE_ONCE_INTERP, 0.0f);
|
||||
this->fwork[GND_END_FRAME], ANIMMODE_ONCE_INTERP, 0.0f);
|
||||
this->work[GND_ACTION_STATE] = DEATH_LIMP;
|
||||
} else if (gSaveContext.n64ddFlag) {
|
||||
// Skip to death scream animation and move ganondrof to middle
|
||||
this->deathState = DEATH_SCREAM;
|
||||
this->timers[0] = 50;
|
||||
Animation_MorphToLoop(&this->skelAnime, &gPhantomGanonScreamAnim, -10.0f);
|
||||
this->actor.world.pos.x = GND_BOSSROOM_CENTER_X;
|
||||
this->actor.world.pos.y = GND_BOSSROOM_CENTER_Y + 83.0f;
|
||||
this->actor.world.pos.z = GND_BOSSROOM_CENTER_Z;
|
||||
this->actor.shape.rot.y = 0;
|
||||
this->work[GND_BODY_DECAY_INDEX] = 0;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FANTOM_LAST);
|
||||
|
||||
// Move Player out of the center of the room
|
||||
player->actor.world.pos.x = GND_BOSSROOM_CENTER_X - 200.0f;
|
||||
player->actor.world.pos.z = GND_BOSSROOM_CENTER_Z;
|
||||
}
|
||||
break;
|
||||
case DEATH_LIMP:
|
||||
|
@ -1025,6 +1040,9 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) {
|
|||
bodyDecayLevel = 1;
|
||||
break;
|
||||
}
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
break;
|
||||
}
|
||||
Math_ApproachS(&this->actor.shape.rot.y, this->work[GND_VARIANCE_TIMER] * -100, 5, 0xBB8);
|
||||
Math_ApproachF(&this->cameraNextEye.z, this->targetPos.z + 60.0f, 0.02f, 0.5f);
|
||||
Math_ApproachF(&this->actor.world.pos.y, GND_BOSSROOM_CENTER_Y + 133.0f, 0.05f, 100.0f);
|
||||
|
|
|
@ -2360,10 +2360,15 @@ void BossTw_DeathCSMsgSfx(BossTw* this, GlobalContext* globalCtx) {
|
|||
koumeAnim = 0;
|
||||
sp35 = 0;
|
||||
|
||||
// Skip ahead to last part of the cutscene in rando
|
||||
if (this->work[CS_TIMER_2] == 10 && gSaveContext.n64ddFlag) {
|
||||
this->work[CS_TIMER_2] = 860;
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_2] == 80) {
|
||||
koumeAnim = 1;
|
||||
}
|
||||
|
||||
|
||||
if (this->work[CS_TIMER_2] == 80) {
|
||||
msgId2 = 0x604B;
|
||||
sp35 = 50;
|
||||
|
@ -2539,6 +2544,16 @@ void BossTw_DeathCSMsgSfx(BossTw* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->workf[UNK_F18], 255.0f, 0.1f, 5.0f);
|
||||
}
|
||||
|
||||
// Add seperate timings for the "beam" that opens and closes around the sisters
|
||||
// Needed because we skip ahead in cutscene timer value so it never gets called otherwise
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (this->work[CS_TIMER_2] < 900) {
|
||||
Math_ApproachF(&this->workf[UNK_F18], 255.0f, 0.1f, 5.0f);
|
||||
} else if (this->work[CS_TIMER_2] > 910) {
|
||||
Math_ApproachF(&this->workf[UNK_F18], 0.0f, 1.0f, 3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_2] >= 150) {
|
||||
Math_ApproachF(&sKoumePtr->workf[UNK_F17], (Math_SinS(this->work[CS_TIMER_1] * 2000) * 0.05f) + 0.4f, 0.1f,
|
||||
0.01f);
|
||||
|
|
|
@ -121,6 +121,7 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx);
|
|||
void BossVa_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossVa_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossVa_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossVa_Reset(void);
|
||||
|
||||
void BossVa_UpdateEffects(GlobalContext* globalCtx);
|
||||
void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx);
|
||||
|
@ -204,7 +205,7 @@ const ActorInit Boss_Va_InitVars = {
|
|||
(ActorFunc)BossVa_Destroy,
|
||||
(ActorFunc)BossVa_Update,
|
||||
(ActorFunc)BossVa_Draw,
|
||||
NULL,
|
||||
(ActorResetFunc)BossVa_Reset,
|
||||
};
|
||||
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
|
@ -593,6 +594,8 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
switch (this->actor.params) {
|
||||
case BOSSVA_BODY:
|
||||
//sFightPhase = 0;
|
||||
//sBodyState = 1;
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &gBarinadeBodySkel, &gBarinadeBodyAnim, NULL, NULL, 0);
|
||||
this->actor.flags |= ACTOR_FLAG_24;
|
||||
break;
|
||||
|
@ -4032,6 +4035,8 @@ void BossVa_DrawDoor(GlobalContext* globalCtx, s16 scale) {
|
|||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
void BossVa_Reset(void) {
|
||||
sKillBari = 0;
|
||||
sCsCamera = 0;
|
||||
|
@ -4046,4 +4051,7 @@ void BossVa_Reset(void) {
|
|||
sZapperRot.z = 0;
|
||||
sPhase2Timer = 0;
|
||||
sPhase4HP = 0;
|
||||
for (u8 i = 0; i < ARRAY_SIZE(sBodyBari); i++) {
|
||||
sBodyBari[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -631,7 +631,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, GlobalContext* globalCtx) {
|
|||
|
||||
Actor_SetScale(thisx, 0.20f);
|
||||
|
||||
if (gSaveContext.entranceIndex == 0x0053) {
|
||||
if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) {
|
||||
switch (globalCtx->csCtx.npcActions[this->csActionId]->action) {
|
||||
case 2:
|
||||
DemoEffect_MedalSparkle(this, globalCtx, 0);
|
||||
|
@ -643,7 +643,8 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
switch (globalCtx->csCtx.npcActions[this->csActionId]->action) {
|
||||
case 2:
|
||||
if (gSaveContext.entranceIndex == 0x0053) {
|
||||
if (gSaveContext.entranceIndex == 0x0053 ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) {
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG);
|
||||
} else {
|
||||
func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG);
|
||||
|
@ -658,7 +659,8 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, GlobalContext* globalCtx) {
|
|||
if (this->getItem.drawId != GID_ARROW_LIGHT) {
|
||||
this->actor.shape.rot.y += this->getItem.rotation;
|
||||
}
|
||||
if (gSaveContext.entranceIndex == 0x0053) {
|
||||
if (gSaveContext.entranceIndex == 0x0053 ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) {
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG);
|
||||
} else {
|
||||
func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG);
|
||||
|
@ -1581,14 +1583,15 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
default:
|
||||
DemoEffect_MoveToCsEndpoint(this, globalCtx, this->csActionId, 0);
|
||||
if (gSaveContext.entranceIndex == 0x0053) {
|
||||
if (gSaveContext.entranceIndex == 0x0053 ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) {
|
||||
DemoEffect_MoveJewelSplit(&thisx->world, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.entranceIndex == 0x0053) {
|
||||
if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x800)) {
|
||||
hasCmdAction = globalCtx->csCtx.state && globalCtx->csCtx.npcActions[this->csActionId];
|
||||
if (!hasCmdAction) {
|
||||
|
@ -1859,6 +1862,7 @@ void DemoEffect_DrawLightEffect(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (this->light.flicker == 0) {
|
||||
this->light.flicker = 1;
|
||||
} else {
|
||||
disp = (uintptr_t)gEffFlash1DL;
|
||||
alpha = &this->light.alpha;
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, this->primXluColor[0], this->primXluColor[1],
|
||||
|
|
|
@ -898,13 +898,35 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY);
|
||||
|
||||
if (impa->parent != NULL && impa->parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F) && !GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA)) {
|
||||
func_8002F434(impa, globalCtx, getItemId, 75.0f, 50.0f);
|
||||
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
gSaveContext.eventChkInf[5] |= 0x200;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 3;
|
||||
gSaveContext.nextTransition = 3;
|
||||
globalCtx->nextEntranceIndex = 0x0594;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80986C30(DemoIm* this, GlobalContext* globalCtx) {
|
||||
if (func_80986A5C(this, globalCtx)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 0x200;
|
||||
Item_Give(globalCtx, ITEM_SONG_LULLABY);
|
||||
func_80985F54(this);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoRewardImpa(this, globalCtx, RC_SONG_FROM_IMPA);
|
||||
} else {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 0x200;
|
||||
Item_Give(globalCtx, ITEM_SONG_LULLABY);
|
||||
func_80985F54(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -928,7 +950,7 @@ void func_80986D40(DemoIm* this, GlobalContext* globalCtx) {
|
|||
if (gSaveContext.sceneSetupIndex == 6) {
|
||||
this->action = 19;
|
||||
this->drawConfig = 1;
|
||||
} else if (gSaveContext.eventChkInf[8] & 1) {
|
||||
} else if ((gSaveContext.eventChkInf[8] & 1) && !gSaveContext.n64ddFlag) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (!(gSaveContext.eventChkInf[5] & 0x200)) {
|
||||
this->action = 23;
|
||||
|
|
|
@ -788,7 +788,14 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->unk_150[i].unk_0.y = (s16)((Rand_ZeroOne() - 0.5f) * 16.0f * temp_f22);
|
||||
this->unk_150[i].unk_0.z = (s16)((Rand_ZeroOne() - 0.5f) * 16.0f * temp_f22);
|
||||
this->unk_150[i].unk_23 = 0;
|
||||
this->unk_150[i].unk_22++;
|
||||
|
||||
// Skip the first part of warp song cutscenes in rando
|
||||
if (gSaveContext.n64ddFlag && this->actor.params == DEMOKANKYO_WARP_OUT) {
|
||||
this->unk_150[i].unk_22 = 2;
|
||||
} else {
|
||||
this->unk_150[i].unk_22++;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (this->actor.params == DEMOKANKYO_WARP_OUT) {
|
||||
if (func_800BB2B4(&camPos, &sWarpRoll, &sWarpFoV, sWarpOutCameraPoints, &this->unk_150[i].unk_20,
|
||||
|
|
|
@ -73,6 +73,36 @@ s32 DemoKekkai_CheckEventFlag(s32 params) {
|
|||
return Flags_GetEventChkInf(eventFlags[params]);
|
||||
}
|
||||
|
||||
u32 TrialsDoneCount() {
|
||||
u8 trialCount = 0;
|
||||
|
||||
if (gSaveContext.trialsDone[0] == 1) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[1] == 1) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[2] == 1) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[3] == 1) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[4] == 1) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[5] == 1) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
return trialCount;
|
||||
}
|
||||
|
||||
void DemoKekkai_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
DemoKekkai* this = (DemoKekkai*)thisx;
|
||||
|
@ -96,6 +126,14 @@ void DemoKekkai_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->collider2.dim.radius = thisx->scale.x * 6100.0f;
|
||||
this->collider2.dim.height = thisx->scale.y * 5000.0f;
|
||||
this->collider2.dim.yShift = 300;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
int trialsToComplete = GetRandoSettingValue(RSK_TRIAL_COUNT);
|
||||
if (trialsToComplete <= TrialsDoneCount()) {
|
||||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEKKAI_WATER:
|
||||
case KEKKAI_LIGHT:
|
||||
|
@ -203,10 +241,35 @@ void DemoKekkai_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
|
||||
void DemoKekkai_TrialBarrierDispel(Actor* thisx, GlobalContext* globalCtx) {
|
||||
static s32 eventFlags[] = { 0xC3, 0xBC, 0xBF, 0xBE, 0xBD, 0xAD, 0xBB };
|
||||
static u16 csFrames[] = { 0, 280, 280, 280, 280, 280, 280 };
|
||||
s32 pad;
|
||||
DemoKekkai* this = (DemoKekkai*)thisx;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
switch (thisx->params) {
|
||||
case KEKKAI_WATER:
|
||||
gSaveContext.trialsDone[2] = 1;
|
||||
break;
|
||||
case KEKKAI_LIGHT:
|
||||
gSaveContext.trialsDone[5] = 1;
|
||||
break;
|
||||
case KEKKAI_FIRE:
|
||||
gSaveContext.trialsDone[1] = 1;
|
||||
break;
|
||||
case KEKKAI_SHADOW:
|
||||
gSaveContext.trialsDone[3] = 1;
|
||||
break;
|
||||
case KEKKAI_SPIRIT:
|
||||
gSaveContext.trialsDone[4] = 1;
|
||||
break;
|
||||
case KEKKAI_FOREST:
|
||||
gSaveContext.trialsDone[0] = 1;
|
||||
break;
|
||||
}
|
||||
Flags_SetEventChkInf(eventFlags[thisx->params]);
|
||||
}
|
||||
|
||||
if (globalCtx->csCtx.frames == csFrames[this->actor.params]) {
|
||||
func_800F3F3C(0xA);
|
||||
}
|
||||
|
|
|
@ -461,6 +461,44 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) {
|
||||
GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
|
||||
if (this->actor.parent != NULL && this->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
if (adult) {
|
||||
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
|
||||
func_8002DF54(globalCtx, &this->actor, 10);
|
||||
player->unk_450.x = this->actor.world.pos.x;
|
||||
player->unk_450.z = this->actor.world.pos.z;
|
||||
this->unk_1B2 = 20;
|
||||
DoorWarp1_SetupAction(this, func_8099A508);
|
||||
} else {
|
||||
if (ruto) {
|
||||
this->rutoWarpState = WARP_BLUE_RUTO_STATE_ENTERED;
|
||||
func_8002DF54(globalCtx, &this->actor, 10);
|
||||
this->unk_1B2 = 1;
|
||||
DoorWarp1_SetupAction(this, func_80999EE0);
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
OnePointCutscene_Init(globalCtx, 0x25E7, 999, &this->actor, MAIN_CAM);
|
||||
func_8002DF54(globalCtx, &this->actor, 10);
|
||||
|
||||
player->unk_450.x = this->actor.world.pos.x;
|
||||
player->unk_450.z = this->actor.world.pos.z;
|
||||
this->unk_1B2 = 1;
|
||||
|
||||
DoorWarp1_SetupAction(this, DoorWarp1_ChildWarpOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoorWarp1_ChildWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
Player* player;
|
||||
|
||||
|
@ -468,6 +506,11 @@ void DoorWarp1_ChildWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (DoorWarp1_PlayerInRange(this, globalCtx)) {
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoReward(this, player, globalCtx, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
|
@ -503,20 +546,32 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
if (globalCtx->sceneNum == SCENE_DDAN_BOSS) {
|
||||
if (!Flags_GetEventChkInf(0x25)) {
|
||||
Flags_SetEventChkInf(0x25);
|
||||
Item_Give(globalCtx, ITEM_GORON_RUBY);
|
||||
globalCtx->nextEntranceIndex = 0x13D;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
gSaveContext.dungeonsDone[0] = 1;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x47A;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_GORON_RUBY);
|
||||
globalCtx->nextEntranceIndex = 0x13D;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
}
|
||||
} else {
|
||||
globalCtx->nextEntranceIndex = 0x47A;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_YDAN_BOSS) {
|
||||
if (!Flags_GetEventChkInf(7)) {
|
||||
if (!Flags_GetEventChkInf(7) || gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(7);
|
||||
Flags_SetEventChkInf(9);
|
||||
Item_Give(globalCtx, ITEM_KOKIRI_EMERALD);
|
||||
globalCtx->nextEntranceIndex = 0xEE;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
gSaveContext.dungeonsDone[1] = 1;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x0457;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_KOKIRI_EMERALD);
|
||||
globalCtx->nextEntranceIndex = 0xEE;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
}
|
||||
} else {
|
||||
globalCtx->nextEntranceIndex = 0x457;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
|
@ -546,6 +601,12 @@ void DoorWarp1_RutoWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG);
|
||||
|
||||
if (this->rutoWarpState != WARP_BLUE_RUTO_STATE_INITIAL && DoorWarp1_PlayerInRange(this, globalCtx)) {
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoReward(this, GET_PLAYER(globalCtx), globalCtx, 1, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
this->rutoWarpState = WARP_BLUE_RUTO_STATE_ENTERED;
|
||||
func_8002DF54(globalCtx, &this->actor, 10);
|
||||
this->unk_1B2 = 1;
|
||||
|
@ -575,7 +636,9 @@ void func_80999EE0(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
Gameplay_CameraSetAtEye(globalCtx, sRutoWarpSubCamId, &at, &eye);
|
||||
Gameplay_CameraSetFov(globalCtx, sRutoWarpSubCamId, 90.0f);
|
||||
this->rutoWarpState = WARP_BLUE_RUTO_STATE_TALKING;
|
||||
Message_StartTextbox(globalCtx, 0x4022, NULL);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Message_StartTextbox(globalCtx, 0x4022, NULL);
|
||||
}
|
||||
DoorWarp1_SetupAction(this, func_80999FE4);
|
||||
}
|
||||
}
|
||||
|
@ -608,9 +671,17 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == 0xFFEF) {
|
||||
gSaveContext.eventChkInf[3] |= 0x80;
|
||||
Item_Give(globalCtx, ITEM_ZORA_SAPPHIRE);
|
||||
globalCtx->nextEntranceIndex = 0x10E;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF0;
|
||||
gSaveContext.dungeonsDone[2] = 1;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x10E;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_ZORA_SAPPHIRE);
|
||||
globalCtx->nextEntranceIndex = 0x10E;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF0;
|
||||
}
|
||||
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 7;
|
||||
}
|
||||
|
@ -652,6 +723,11 @@ void DoorWarp1_AdultWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
if (DoorWarp1_PlayerInRange(this, globalCtx)) {
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoReward(this, player, globalCtx, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
|
||||
func_8002DF54(globalCtx, &this->actor, 10);
|
||||
player->unk_450.x = this->actor.world.pos.x;
|
||||
|
@ -709,10 +785,17 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
if (globalCtx->sceneNum == SCENE_MORIBOSSROOM) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x100)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x100;
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_FOREST);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_FOREST;
|
||||
gSaveContext.dungeonsDone[3] = 1;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x608;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_FOREST);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_FOREST;
|
||||
}
|
||||
} else {
|
||||
if (!LINK_IS_ADULT) {
|
||||
globalCtx->nextEntranceIndex = 0x600;
|
||||
|
@ -724,9 +807,16 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
} else if (globalCtx->sceneNum == SCENE_FIRE_BS) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x200)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x200;
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_FIRE);
|
||||
globalCtx->nextEntranceIndex = 0xDB;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF3;
|
||||
gSaveContext.dungeonsDone[4] = 1;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x564;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_FIRE);
|
||||
globalCtx->nextEntranceIndex = 0xDB;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF3;
|
||||
}
|
||||
} else {
|
||||
if (!LINK_IS_ADULT) {
|
||||
globalCtx->nextEntranceIndex = 0x4F6;
|
||||
|
@ -738,10 +828,17 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
} else if (globalCtx->sceneNum == SCENE_MIZUSIN_BS) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x400)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x400;
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_WATER);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_WATER;
|
||||
gSaveContext.dungeonsDone[5] = 1;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x60C;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_WATER);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_WATER;
|
||||
}
|
||||
} else {
|
||||
if (!LINK_IS_ADULT) {
|
||||
globalCtx->nextEntranceIndex = 0x604;
|
||||
|
@ -751,11 +848,18 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
gSaveContext.nextCutsceneIndex = 0;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_JYASINBOSS) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_SPIRIT);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_SPIRIT;
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) || gSaveContext.n64ddFlag) {
|
||||
gSaveContext.dungeonsDone[6] = 1;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x610;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_SPIRIT);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_SPIRIT;
|
||||
}
|
||||
} else {
|
||||
if (!LINK_IS_ADULT) {
|
||||
globalCtx->nextEntranceIndex = 0x1F1;
|
||||
|
@ -765,11 +869,18 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
gSaveContext.nextCutsceneIndex = 0;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_HAKADAN_BS) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_SHADOW);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_SHADOW;
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) || gSaveContext.n64ddFlag) {
|
||||
gSaveContext.dungeonsDone[7] = 1;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x580;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
} else {
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_SHADOW);
|
||||
globalCtx->nextEntranceIndex = 0x6B;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
gSaveContext.chamberCutsceneNum = CHAMBER_CS_SHADOW;
|
||||
}
|
||||
} else {
|
||||
if (!LINK_IS_ADULT) {
|
||||
globalCtx->nextEntranceIndex = 0x568;
|
||||
|
|
|
@ -126,7 +126,12 @@ void func_809B0558(EnAni* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
gSaveContext.itemGetInf[1] |= 0x20;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +139,13 @@ void func_809B05F0(EnAni* this, GlobalContext* globalCtx) {
|
|||
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
|
||||
EnAni_SetupAction(this, func_809B0558);
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -79,7 +79,7 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
}
|
||||
|
||||
this->prizeSelect = (s16)Rand_ZeroFloat(4.99f);
|
||||
this->prizeSelect = gSaveContext.n64ddFlag ? 0 : (s16)Rand_ZeroFloat(4.99f);
|
||||
this->actor.targetMode = 1;
|
||||
this->actionFunc = EnBomBowMan_SetupWaitAsleep;
|
||||
}
|
||||
|
@ -134,11 +134,23 @@ void EnBomBowMan_BlinkAwake(EnBomBowlMan* this, GlobalContext* globalCtx) {
|
|||
if (frameCount == 30.0f) {
|
||||
this->dialogState = TEXT_STATE_EVENT;
|
||||
|
||||
// Check for beaten Dodongo's Cavern
|
||||
if ((gSaveContext.eventChkInf[2] & 0x20) || BREG(2)) {
|
||||
this->actor.textId = 0xBF;
|
||||
} else {
|
||||
this->actor.textId = 0x7058;
|
||||
// Check for beaten Dodongo's Cavern if Rando is disabled
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if ((gSaveContext.eventChkInf[2] & 0x20) || BREG(2)) {
|
||||
this->actor.textId = 0xBF;
|
||||
} else {
|
||||
this->actor.textId = 0x7058;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for Bomb Bag if Rando is enabled
|
||||
// RANDOTODO: Check for bombchu pack instead of bomb bag if bombchus are in logic
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (INV_CONTENT(ITEM_BOMB) != ITEM_NONE) {
|
||||
this->actor.textId = 0xBF;
|
||||
} else {
|
||||
this->actor.textId = 0x7058;
|
||||
}
|
||||
}
|
||||
}
|
||||
Message_ContinueTextbox(globalCtx, this->actor.textId);
|
||||
|
@ -148,6 +160,7 @@ void EnBomBowMan_BlinkAwake(EnBomBowlMan* this, GlobalContext* globalCtx) {
|
|||
this->eyeTextureIndex = 2;
|
||||
this->blinkCount++;
|
||||
if (this->blinkCount >= 3) {
|
||||
// we're still making it in here when rando'd
|
||||
this->actionFunc = EnBomBowMan_CheckBeatenDC;
|
||||
}
|
||||
}
|
||||
|
@ -164,8 +177,11 @@ void EnBomBowMan_CheckBeatenDC(EnBomBowlMan* this, GlobalContext* globalCtx) {
|
|||
this->eyeMode = CHU_GIRL_EYES_AWAKE;
|
||||
this->blinkTimer = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
|
||||
// Check for beaten Dodongo's Cavern
|
||||
if (!((gSaveContext.eventChkInf[2] & 0x20) || BREG(2))) {
|
||||
// Check for beaten Dodongo's Cavern if not rando'd
|
||||
// check for bomb bag if rando'd
|
||||
if ((!gSaveContext.n64ddFlag &&
|
||||
!((gSaveContext.eventChkInf[2] & 0x20) || BREG(2))) ||
|
||||
(gSaveContext.n64ddFlag && (INV_CONTENT(ITEM_BOMB) == ITEM_NONE))) {
|
||||
this->actionFunc = EnBomBowMan_WaitNotBeatenDC;
|
||||
} else {
|
||||
this->actor.textId = 0x18;
|
||||
|
@ -395,14 +411,25 @@ void EnBomBowMan_ChooseShowPrize(EnBomBowlMan* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case 1:
|
||||
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
|
||||
} else {
|
||||
prizeTemp = EXITEM_HEART_PIECE_BOWLING;
|
||||
if (gSaveContext.itemGetInf[1] & 4) {
|
||||
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
prizeTemp = EXITEM_BOMBCHUS_BOWLING;
|
||||
break;
|
||||
case 3:
|
||||
prizeTemp = EXITEM_HEART_PIECE_BOWLING;
|
||||
if (gSaveContext.itemGetInf[1] & 4) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
prizeTemp = EXITEM_HEART_PIECE_BOWLING;
|
||||
if (gSaveContext.itemGetInf[1] & 4) {
|
||||
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
|
||||
}
|
||||
} else {
|
||||
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -182,6 +182,22 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, GlobalContext* globalCtx) {
|
|||
this->getItemId = GI_BOMB_BAG_40;
|
||||
}
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
switch (this->prizeIndex) {
|
||||
case EXITEM_BOMB_BAG_BOWLING:
|
||||
this->getItemId =
|
||||
GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20);
|
||||
break;
|
||||
case EXITEM_HEART_PIECE_BOWLING:
|
||||
this->getItemId =
|
||||
GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE);
|
||||
break;
|
||||
case EXITEM_BOMBCHUS_BOWLING:
|
||||
this->getItemId = GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
player->stateFlags1 &= ~0x20000000;
|
||||
this->actor.parent = NULL;
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
|
||||
|
@ -198,7 +214,9 @@ void EnBomBowlPit_WaitTillPrizeGiven(EnBomBowlPit* this, GlobalContext* globalCt
|
|||
}
|
||||
|
||||
void EnBomBowlPit_Reset(EnBomBowlPit* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) &&
|
||||
Message_ShouldAdvance(globalCtx)) ||
|
||||
(gSaveContext.n64ddFlag && this->getItemId == GI_ICE_TRAP)) {
|
||||
// "Normal termination"/"completion"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST);
|
||||
if (this->getItemId == GI_HEART_PIECE) {
|
||||
|
|
|
@ -419,12 +419,66 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
osSyncPrintf("Actor_Environment_Tbox_On() %d\n", this->dyna.actor.params & 0x1F);
|
||||
Flags_SetTreasure(globalCtx, this->dyna.actor.params & 0x1F);
|
||||
|
||||
// treasure chest game rando
|
||||
if (GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) {
|
||||
if (gSaveContext.n64ddFlag && globalCtx->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) {
|
||||
if((this->dyna.actor.params & 0xF) < 2) {
|
||||
Flags_SetCollectible(globalCtx, 0x1B);
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 2 && (this->dyna.actor.params & 0xF) < 4) {
|
||||
Flags_SetCollectible(globalCtx, 0x1C);
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 4 && (this->dyna.actor.params & 0xF) < 6) {
|
||||
Flags_SetCollectible(globalCtx, 0x1D);
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 6 && (this->dyna.actor.params & 0xF) < 8) {
|
||||
Flags_SetCollectible(globalCtx, 0x1E);
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 8 && (this->dyna.actor.params & 0xF) < 10) {
|
||||
Flags_SetCollectible(globalCtx, 0x1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
player = GET_PLAYER(globalCtx);
|
||||
func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos);
|
||||
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
|
||||
Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
||||
func_8002F554(&this->dyna.actor, globalCtx, 0 - (this->dyna.actor.params >> 5 & 0x7F));
|
||||
int32_t item = GetRandomizedItemId(this->dyna.actor.params >> 5 & 0x7F, this->dyna.actor.id, this->dyna.actor.params, globalCtx->sceneNum);
|
||||
|
||||
// RANDOTODO treasure chest game rando
|
||||
if (GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) {
|
||||
if (gSaveContext.n64ddFlag && globalCtx->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) {
|
||||
if((this->dyna.actor.params & 0xF) < 2) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1B)) {
|
||||
item = GI_RUPEE_BLUE;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 2 && (this->dyna.actor.params & 0xF) < 4) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1C)) {
|
||||
item = GI_RUPEE_BLUE;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 4 && (this->dyna.actor.params & 0xF) < 6) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1D)) {
|
||||
item = GI_RUPEE_BLUE;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 6 && (this->dyna.actor.params & 0xF) < 8) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1E)) {
|
||||
item = GI_RUPEE_BLUE;
|
||||
}
|
||||
}
|
||||
if((this->dyna.actor.params & 0xF) >= 8 && (this->dyna.actor.params & 0xF) < 10) {
|
||||
if(Flags_GetCollectible(globalCtx, 0x1F)) {
|
||||
item = GI_RUPEE_BLUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F554(&this->dyna.actor, globalCtx, 0 - item);
|
||||
}
|
||||
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||
EnBox_SetupAction(this, EnBox_Open);
|
||||
|
@ -535,10 +589,12 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_SetFocus(&this->dyna.actor, 40.0f);
|
||||
}
|
||||
|
||||
if ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C && this->actionFunc == EnBox_Open &&
|
||||
this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) {
|
||||
EnBox_SpawnIceSmoke(this, globalCtx);
|
||||
}
|
||||
if (((!gSaveContext.n64ddFlag && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) ||
|
||||
(gSaveContext.n64ddFlag && GetRandomizedItemId(this->dyna.actor.params >> 5 & 0x7F,
|
||||
this->dyna.actor.id, this->dyna.actor.params,
|
||||
globalCtx->sceneNum) == GI_ICE_TRAP)) &&
|
||||
this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 &&
|
||||
this->iceSmokeTimer < 100) EnBox_SpawnIceSmoke(this, globalCtx);
|
||||
}
|
||||
|
||||
void EnBox_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) {
|
||||
|
|
|
@ -453,7 +453,7 @@ void func_809EEA00(EnDivingGame* this, GlobalContext* globalCtx) {
|
|||
if ((this->unk_292 == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx))) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.parent = NULL;
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
this->actionFunc = func_809EEA90;
|
||||
}
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ void func_809EEA90(EnDivingGame* this, GlobalContext* globalCtx) {
|
|||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_809EEAF8;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -370,19 +370,23 @@ void EnDns_Talk(EnDns* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_809EFDD0(EnDns* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.params == 0x9) {
|
||||
if (CUR_UPG_VALUE(UPG_STICKS) < 2) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GetRandomizedItemId(GI_STICK_UPGRADE_30, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f);
|
||||
} else if (CUR_UPG_VALUE(UPG_STICKS) < 2) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_STICK_UPGRADE_20, 130.0f, 100.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_STICK_UPGRADE_30, 130.0f, 100.0f);
|
||||
}
|
||||
} else if (this->actor.params == 0xA) {
|
||||
if (CUR_UPG_VALUE(UPG_NUTS) < 2) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GetRandomizedItemId(GI_NUT_UPGRADE_40, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f);
|
||||
} else if (CUR_UPG_VALUE(UPG_NUTS) < 2) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_NUT_UPGRADE_30, 130.0f, 100.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_NUT_UPGRADE_40, 130.0f, 100.0f);
|
||||
}
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->dnsItemEntry->getItemId, 130.0f, 100.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemId(this->dnsItemEntry->getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum) : this->dnsItemEntry->getItemId, 130.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,6 +135,24 @@ void EnDntDemo_Judge(EnDntDemo* this, GlobalContext* globalCtx) {
|
|||
this->judgeTimer = 0;
|
||||
}
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
switch (Player_GetMask(globalCtx)) {
|
||||
case PLAYER_MASK_SKULL:
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GiveItemWithoutActor(globalCtx, GetRandomizedItemIdFromKnownCheck(RC_DEKU_THEATER_SKULL_MASK, GI_STICK_UPGRADE_30));
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
break;
|
||||
case PLAYER_MASK_TRUTH:
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1E)) {
|
||||
GiveItemWithoutActor(globalCtx, GetRandomizedItemIdFromKnownCheck(RC_DEKU_THEATER_MASK_OF_TRUTH, GI_NUT_UPGRADE_40));
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Player_GetMask(globalCtx) != 0) && (this->subCamera == SUBCAM_FREE)) {
|
||||
this->subCamera = OnePointCutscene_Init(globalCtx, 2220, -99, &this->scrubs[3]->actor, MAIN_CAM);
|
||||
}
|
||||
|
|
|
@ -250,10 +250,14 @@ void EnDntNomal_TargetWait(EnDntNomal* this, GlobalContext* globalCtx) {
|
|||
if (!LINK_IS_ADULT && !(gSaveContext.itemGetInf[1] & 0x2000)) {
|
||||
this->hitCounter++;
|
||||
if (this->hitCounter >= 3) {
|
||||
OnePointCutscene_Init(globalCtx, 4140, -99, &this->actor, MAIN_CAM);
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
this->timer4 = 50;
|
||||
this->actionFunc = EnDntNomal_SetupTargetUnburrow;
|
||||
if(gSaveContext.n64ddFlag) {
|
||||
this->actionFunc = EnDntNomal_TargetGivePrize;
|
||||
} else {
|
||||
OnePointCutscene_Init(globalCtx, 4140, -99, &this->actor, MAIN_CAM);
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
this->timer4 = 50;
|
||||
this->actionFunc = EnDntNomal_SetupTargetUnburrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 24.0f) {
|
||||
|
|
|
@ -159,6 +159,13 @@ void EnDoor_SetupType(EnDoor* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
this->actor.world.rot.y = 0x0000;
|
||||
if (doorType == DOOR_LOCKED) {
|
||||
// unlock the door behind the hammer blocks
|
||||
// in the fire temple entryway when rando'd
|
||||
if (gSaveContext.n64ddFlag && globalCtx->sceneNum == 4) {
|
||||
// RANDOTODO don't do this when keysanity is enabled
|
||||
Flags_SetSwitch(globalCtx, 0x17);
|
||||
}
|
||||
|
||||
if (!Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) {
|
||||
this->lockTimer = 10;
|
||||
}
|
||||
|
|
|
@ -344,15 +344,19 @@ void func_809FE4A4(EnDu* this, GlobalContext* globalCtx) {
|
|||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
EnDu_SetupAction(this, func_809FE3C0);
|
||||
} else if (globalCtx->msgCtx.ocarinaMode >= OCARINA_MODE_06) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaWrongCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaWrongCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
}
|
||||
this->unk_1E8 = 1;
|
||||
EnDu_SetupAction(this, func_809FE890);
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
}
|
||||
this->unk_1E8 = 0;
|
||||
EnDu_SetupAction(this, func_809FE890);
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
|
@ -438,7 +442,10 @@ void func_809FE890(EnDu* this, GlobalContext* globalCtx) {
|
|||
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
|
||||
CsCmdActorAction* csAction;
|
||||
|
||||
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
|
||||
if (globalCtx->csCtx.state == CS_STATE_IDLE || gSaveContext.n64ddFlag) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.state = CS_STATE_IDLE;
|
||||
}
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
EnDu_SetupAction(this, func_809FEB08);
|
||||
return;
|
||||
|
@ -511,7 +518,11 @@ void func_809FEB08(EnDu* this, GlobalContext* globalCtx) {
|
|||
EnDu_SetupAction(this, func_809FE3C0);
|
||||
return;
|
||||
}
|
||||
if (CUR_UPG_VALUE(UPG_STRENGTH) <= 0) {
|
||||
if ((!gSaveContext.n64ddFlag && CUR_UPG_VALUE(UPG_STRENGTH) <= 0) ||
|
||||
(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1E))) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
}
|
||||
this->actor.textId = 0x301C;
|
||||
EnDu_SetupAction(this, func_809FEC14);
|
||||
} else {
|
||||
|
@ -537,7 +548,7 @@ void func_809FEC70(EnDu* this, GlobalContext* globalCtx) {
|
|||
EnDu_SetupAction(this, func_809FECE4);
|
||||
} else {
|
||||
f32 xzRange = this->actor.xzDistToPlayer + 1.0f;
|
||||
func_8002F434(&this->actor, globalCtx, GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GC_DARUNIAS_JOY, GI_BRACELET) : GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,12 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) {
|
|||
onCounter = true;
|
||||
case EXITEM_BOMB_BAG_BOWLING:
|
||||
this->unk_17C = func_8002EBCC;
|
||||
this->giDrawId = GID_BOMB_BAG_30;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
this->giDrawId = GetItemModelFromId(
|
||||
GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20));
|
||||
} else {
|
||||
this->giDrawId = GID_BOMB_BAG_30;
|
||||
}
|
||||
this->timer = 65;
|
||||
this->prizeRotateTimer = 35;
|
||||
this->scale = 0.5f;
|
||||
|
@ -145,7 +150,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = EnExItem_BowlPrize;
|
||||
} else {
|
||||
this->actionFunc = EnExItem_SetupBowlCounter;
|
||||
this->actor.shape.yOffset = -18.0f;
|
||||
this->actor.shape.yOffset = gSaveContext.n64ddFlag ? -10.0f : -18.0f;
|
||||
}
|
||||
break;
|
||||
case EXITEM_HEART_PIECE_COUNTER:
|
||||
|
@ -167,7 +172,12 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) {
|
|||
onCounter = true;
|
||||
case EXITEM_BOMBCHUS_BOWLING:
|
||||
this->unk_17C = func_8002EBCC;
|
||||
this->giDrawId = GID_BOMBCHU;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
this->giDrawId = GetItemModelFromId(
|
||||
GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10));
|
||||
} else {
|
||||
this->giDrawId = GID_BOMBCHU;
|
||||
}
|
||||
this->timer = 65;
|
||||
this->prizeRotateTimer = 35;
|
||||
this->scale = 0.5f;
|
||||
|
@ -219,19 +229,25 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) {
|
|||
this->scale = 0.5f;
|
||||
this->unkFloat = 0.5f;
|
||||
this->actor.velocity.y = 10.0f;
|
||||
switch (this->type) {
|
||||
case EXITEM_GREEN_RUPEE_CHEST:
|
||||
this->giDrawId = GID_RUPEE_GREEN;
|
||||
break;
|
||||
case EXITEM_BLUE_RUPEE_CHEST:
|
||||
this->giDrawId = GID_RUPEE_BLUE;
|
||||
break;
|
||||
case EXITEM_RED_RUPEE_CHEST:
|
||||
this->giDrawId = GID_RUPEE_RED;
|
||||
break;
|
||||
case EXITEM_14:
|
||||
this->giDrawId = GID_RUPEE_PURPLE;
|
||||
break;
|
||||
if (!gSaveContext.n64ddFlag || !GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) {
|
||||
switch (this->type) {
|
||||
case EXITEM_GREEN_RUPEE_CHEST:
|
||||
this->giDrawId = GID_RUPEE_GREEN;
|
||||
break;
|
||||
case EXITEM_BLUE_RUPEE_CHEST:
|
||||
this->giDrawId = GID_RUPEE_BLUE;
|
||||
break;
|
||||
case EXITEM_RED_RUPEE_CHEST:
|
||||
this->giDrawId = GID_RUPEE_RED;
|
||||
break;
|
||||
case EXITEM_14:
|
||||
this->giDrawId = GID_RUPEE_PURPLE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (globalCtx->sceneNum == 16) {
|
||||
this->giDrawId = GetChestGameRandoGiDrawId(globalCtx->roomCtx.curRoom.num, GID_RUPEE_GREEN, globalCtx);
|
||||
}
|
||||
}
|
||||
this->actionFunc = EnExItem_ExitChest;
|
||||
break;
|
||||
|
@ -361,7 +377,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->actor.shape.rot.y, -0x4000, 5, 0x1000, 0);
|
||||
}
|
||||
|
||||
if (this->timer != 0) {
|
||||
if (!gSaveContext.n64ddFlag && this->timer != 0) {
|
||||
if (this->prizeRotateTimer != 0) {
|
||||
tmpf1 = globalCtx->view.lookAt.x - globalCtx->view.eye.x;
|
||||
tmpf2 = globalCtx->view.lookAt.y - 10.0f - globalCtx->view.eye.y;
|
||||
|
@ -386,10 +402,15 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) {
|
|||
this->actor.draw = NULL;
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
this->actor.parent = NULL;
|
||||
if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) {
|
||||
getItemId = GI_BULLET_BAG_40;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GET_PLAYER(globalCtx)->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11);
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
|
||||
} else {
|
||||
getItemId = GI_BULLET_BAG_50;
|
||||
if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) {
|
||||
getItemId = GI_BULLET_BAG_40;
|
||||
} else {
|
||||
getItemId = GI_BULLET_BAG_50;
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
this->actionFunc = EnExItem_TargetPrizeGive;
|
||||
|
@ -402,7 +423,11 @@ void EnExItem_TargetPrizeGive(EnExItem* this, GlobalContext* globalCtx) {
|
|||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnExItem_TargetPrizeFinish;
|
||||
} else {
|
||||
getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
|
||||
} else {
|
||||
getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40;
|
||||
}
|
||||
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f);
|
||||
}
|
||||
|
@ -480,12 +505,42 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (this) {}
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 randoGetItemId;
|
||||
switch (this->type) {
|
||||
case EXITEM_BOMB_BAG_BOWLING:
|
||||
case EXITEM_BOMB_BAG_COUNTER:
|
||||
randoGetItemId = GetRandomizedItemIdFromKnownCheck(
|
||||
RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20);
|
||||
break;
|
||||
case EXITEM_BOMBCHUS_BOWLING:
|
||||
case EXITEM_BOMBCHUS_COUNTER:
|
||||
randoGetItemId = GetRandomizedItemIdFromKnownCheck(
|
||||
RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10);
|
||||
break;
|
||||
}
|
||||
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
}
|
||||
|
||||
GetItem_Draw(globalCtx, this->giDrawId);
|
||||
}
|
||||
|
||||
void EnExItem_DrawHeartPiece(EnExItem* this, GlobalContext* globalCtx) {
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
GetItem_Draw(globalCtx, GID_HEART_PIECE);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 randoGetItemId = GetRandomizedItemIdFromKnownCheck(
|
||||
RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE);
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId));
|
||||
} else {
|
||||
GetItem_Draw(globalCtx, GID_HEART_PIECE);
|
||||
}
|
||||
}
|
||||
|
||||
void EnExItem_DrawMagic(EnExItem* this, GlobalContext* globalCtx, s16 magicIndex) {
|
||||
|
|
|
@ -937,14 +937,22 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) {
|
|||
} else if (songIndex == FROG_STORMS) {
|
||||
if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) {
|
||||
gSaveContext.eventChkInf[13] |= sSongIndex[songIndex];
|
||||
this->reward = GI_HEART_PIECE;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
this->reward = GI_HEART_PIECE;
|
||||
} else {
|
||||
this->reward = GetRandomizedItemIdFromKnownCheck(RC_ZR_FROGS_IN_THE_RAIN, GI_HEART_PIECE);
|
||||
}
|
||||
} else {
|
||||
this->reward = GI_RUPEE_BLUE;
|
||||
}
|
||||
} else if (songIndex == FROG_CHOIR_SONG) {
|
||||
if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) {
|
||||
gSaveContext.eventChkInf[13] |= sSongIndex[songIndex];
|
||||
this->reward = GI_HEART_PIECE;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
this->reward = GI_HEART_PIECE;
|
||||
} else {
|
||||
this->reward = GetRandomizedItemIdFromKnownCheck(RC_ZR_FROGS_OCARINA_GAME, GI_HEART_PIECE);
|
||||
}
|
||||
} else {
|
||||
this->reward = GI_RUPEE_PURPLE;
|
||||
}
|
||||
|
|
|
@ -148,12 +148,31 @@ void EnFu_WaitChild(EnFu* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSongOfStorms(EnFu* windmillGuy, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
if (windmillGuy->actor.parent != NULL && windmillGuy->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
windmillGuy->actionFunc = func_80A1DBD4;
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SONG_OF_STORMS);
|
||||
func_8002F434(&windmillGuy->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_WaitForSongGive(EnFu* this, GlobalContext* globalCtx) {
|
||||
GivePlayerRandoRewardSongOfStorms(this, globalCtx, RC_SONG_FROM_WINDMILL);
|
||||
}
|
||||
|
||||
void func_80A1DB60(EnFu* this, GlobalContext* globalCtx) {
|
||||
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
|
||||
this->actionFunc = EnFu_WaitAdult;
|
||||
gSaveContext.eventChkInf[5] |= 0x800;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
this->actionFunc = func_WaitForSongGive;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A1DBA0(EnFu* this, GlobalContext* globalCtx) {
|
||||
|
@ -165,6 +184,10 @@ void func_80A1DBA0(EnFu* this, GlobalContext* globalCtx) {
|
|||
void func_80A1DBD4(EnFu* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (gSaveContext.n64ddFlag && (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING)) {
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_03;
|
||||
}
|
||||
|
||||
if (globalCtx->msgCtx.ocarinaMode >= OCARINA_MODE_04) {
|
||||
this->actionFunc = EnFu_WaitAdult;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
|
@ -173,9 +196,13 @@ void func_80A1DBD4(EnFu* this, GlobalContext* globalCtx) {
|
|||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
this->actionFunc = func_80A1DB60;
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gSongOfStormsCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
Item_Give(globalCtx, ITEM_SONG_STORMS);
|
||||
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gSongOfStormsCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
Item_Give(globalCtx, ITEM_SONG_STORMS);
|
||||
}
|
||||
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
gSaveContext.eventChkInf[6] |= 0x20;
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_02) {
|
||||
|
@ -220,7 +247,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) {
|
|||
} else if (player->stateFlags2 & 0x1000000) {
|
||||
this->actor.textId = 0x5035;
|
||||
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
|
||||
this->actionFunc = EnFu_TeachSong;
|
||||
this->actionFunc = gSaveContext.n64ddFlag ? func_80A1DBD4 : EnFu_TeachSong;
|
||||
this->behaviorFlags |= FU_WAIT;
|
||||
} else if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_80A1DBA0;
|
||||
|
|
|
@ -351,7 +351,7 @@ void func_80A2FA50(EnGb* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80A2FB40(EnGb* this, GlobalContext* globalCtx) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002F434(&this->dyna.actor, globalCtx, GI_BOTTLE, 100.0f, 10.0f);
|
||||
func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f);
|
||||
this->actionFunc = func_80A2FBB0;
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ void func_80A2FBB0(EnGb* this, GlobalContext* globalCtx) {
|
|||
this->dyna.actor.parent = NULL;
|
||||
this->actionFunc = func_80A2FC0C;
|
||||
} else {
|
||||
func_8002F434(&this->dyna.actor, globalCtx, GI_BOTTLE, 100.0f, 10.0f);
|
||||
func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@ void EnGe1_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EnGe1_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnGe1_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, GlobalContext* globalCtx);
|
||||
void EnGe1_BeginGiveItem_Archery(EnGe1* this, GlobalContext* globalCtx);
|
||||
|
||||
s32 EnGe1_CheckCarpentersFreed(void);
|
||||
void EnGe1_WatchForPlayerFrontOnly(EnGe1* this, GlobalContext* globalCtx);
|
||||
void EnGe1_SetNormalText(EnGe1* this, GlobalContext* globalCtx);
|
||||
|
@ -210,8 +213,15 @@ void EnGe1_SetAnimationIdle(EnGe1* this) {
|
|||
}
|
||||
|
||||
s32 EnGe1_CheckCarpentersFreed(void) {
|
||||
u16 carpenterFlags = gSaveContext.eventChkInf[9];
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_GERUDO_CARD)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
u16 carpenterFlags = gSaveContext.eventChkInf[9];
|
||||
if (!((carpenterFlags & 1) && (carpenterFlags & 2) && (carpenterFlags & 4) && (carpenterFlags & 8))) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -495,7 +505,16 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
|||
s32 getItemId;
|
||||
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnGe1_SetupWait_Archery;
|
||||
if (gSaveContext.n64ddFlag && gSaveContext.minigameScore >= 1500 && !(gSaveContext.infTable[25] & 1)) {
|
||||
gSaveContext.itemGetInf[0] |= 0x8000;
|
||||
gSaveContext.infTable[25] |= 1;
|
||||
this->stateFlags |= GE1_STATE_GIVE_QUIVER;
|
||||
this->actor.parent = NULL;
|
||||
return;
|
||||
} else {
|
||||
this->actionFunc = EnGe1_SetupWait_Archery;
|
||||
}
|
||||
|
||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||
gSaveContext.itemGetInf[0] |= 0x8000;
|
||||
} else {
|
||||
|
@ -503,17 +522,26 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
} else {
|
||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(
|
||||
RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
}
|
||||
} else {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
}
|
||||
|
@ -528,20 +556,26 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest: the compiler inserts a default assigning *(sp+0x24) to getItemId, which is junk data left
|
||||
//! over from the previous function run in EnGe1_Update, namely EnGe1_CueUpAnimation. The top stack variable
|
||||
//! in that function is &this->skelAnime = thisx + 198, and depending on where this loads in memory, the
|
||||
//! getItemId changes.
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_GF_HBA_1500_POINTS,
|
||||
CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
}
|
||||
} else {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
|
|
|
@ -223,6 +223,14 @@ s32 Ge2_DetectPlayerInUpdate(GlobalContext* globalCtx, EnGe2* this, Vec3f* pos,
|
|||
}
|
||||
|
||||
s32 EnGe2_CheckCarpentersFreed(void) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_GERUDO_CARD)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((u8)(gSaveContext.eventChkInf[9] & 0xF) == 0xF) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -449,7 +457,7 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnGe2_SetActionAfterTalk;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -458,7 +466,7 @@ void EnGe2_GiveCard(EnGe2* this, GlobalContext* globalCtx) {
|
|||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
this->actionFunc = EnGe2_WaitTillCardGiven;
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnGe3_Wait;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ void EnGe3_GiveCard(EnGe3* this, GlobalContext* globalCtx) {
|
|||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
this->actionFunc = EnGe3_WaitTillCardGiven;
|
||||
func_8002F434(&this->actor, globalCtx, GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -433,7 +433,7 @@ s32 EnGirlA_CanBuy_Arrows(GlobalContext* globalCtx, EnGirlA* this) {
|
|||
}
|
||||
|
||||
s32 EnGirlA_CanBuy_Bombs(GlobalContext* globalCtx, EnGirlA* this) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
if (!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
return CANBUY_RESULT_CANT_GET_NOW;
|
||||
}
|
||||
if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) {
|
||||
|
|
|
@ -111,7 +111,8 @@ u16 EnGo_GetTextID(GlobalContext* globalCtx, Actor* thisx) {
|
|||
return 0x3053;
|
||||
}
|
||||
case 0x00:
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) {
|
||||
if (gSaveContext.infTable[16] & 0x8000) {
|
||||
return 0x3042;
|
||||
} else {
|
||||
|
@ -954,7 +955,7 @@ void EnGo_GetItem(EnGo* this, GlobalContext* globalCtx) {
|
|||
this->unk_20C = 0;
|
||||
if ((this->actor.params & 0xF0) == 0x90) {
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) {
|
||||
getItemId = GI_SWORD_BGS;
|
||||
getItemId = gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS) : GI_SWORD_BGS;
|
||||
this->unk_20C = 1;
|
||||
}
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEDROPS) {
|
||||
|
|
|
@ -322,7 +322,7 @@ u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) {
|
|||
u16 EnGo2_GetTextIdGoronCityRollingBig(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (gSaveContext.infTable[17] & 0x4000) {
|
||||
return 0x3013;
|
||||
} else if (CUR_CAPACITY(UPG_BOMB_BAG) >= 20 && this->waypoint > 7 && this->waypoint < 12) {
|
||||
} else if ((CUR_CAPACITY(UPG_BOMB_BAG) >= 20 || gSaveContext.n64ddFlag) && this->waypoint > 7 && this->waypoint < 12) {
|
||||
return 0x3012;
|
||||
} else {
|
||||
return 0x3011;
|
||||
|
@ -339,7 +339,11 @@ s16 EnGo2_GetStateGoronCityRollingBig(GlobalContext* globalCtx, EnGo2* this) {
|
|||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
if (this->actor.textId == 0x3012) {
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
bombBagUpgrade = CUR_CAPACITY(UPG_BOMB_BAG) == 30 ? GI_BOMB_BAG_40 : GI_BOMB_BAG_30;
|
||||
if(!gSaveContext.n64ddFlag) {
|
||||
bombBagUpgrade = CUR_CAPACITY(UPG_BOMB_BAG) == 30 ? GI_BOMB_BAG_40 : GI_BOMB_BAG_30;
|
||||
} else {
|
||||
bombBagUpgrade = GetRandomizedItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40);
|
||||
}
|
||||
EnGo2_GetItem(this, globalCtx, bombBagUpgrade);
|
||||
Message_CloseTextbox(globalCtx);
|
||||
gSaveContext.infTable[17] |= 0x4000;
|
||||
|
@ -402,9 +406,11 @@ s16 EnGo2_GetStateGoronDmtRollingSmall(GlobalContext* globalCtx, EnGo2* this) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GetTextIdGoronDmtDcEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && LINK_IS_ADULT) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return gSaveContext.eventChkInf[2] & 0x8 ? 0x3021 : gSaveContext.infTable[14] & 0x1 ? 0x302A : 0x3008;
|
||||
|
@ -423,9 +429,11 @@ s16 EnGo2_GetStateGoronDmtDcEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GetTextIdGoronCityEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && LINK_IS_ADULT) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return gSaveContext.infTable[15] & 0x1 ? 0x3015 : 0x3014;
|
||||
|
@ -444,10 +452,12 @@ s16 EnGo2_GetStateGoronCityEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GetTextIdGoronCityIsland(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && LINK_IS_ADULT) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
return 0x3067;
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return gSaveContext.infTable[15] & 0x10 ? 0x3017 : 0x3016;
|
||||
}
|
||||
|
@ -465,9 +475,11 @@ s16 EnGo2_GetStateGoronCityIsland(GlobalContext* globalCtx, EnGo2* this) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GetTextIdGoronCityLowestFloor(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && LINK_IS_ADULT) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return CUR_UPG_VALUE(UPG_STRENGTH) != 0 ? 0x302C
|
||||
|
@ -489,6 +501,10 @@ s16 EnGo2_GetStateGoronCityLowestFloor(GlobalContext* globalCtx, EnGo2* this) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GetTextIdGoronCityLink(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if(gSaveContext.n64ddFlag) {
|
||||
return 0x3036;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
|
||||
return gSaveContext.infTable[16] & 0x8000 ? 0x3042 : 0x3041;
|
||||
} else if (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) {
|
||||
|
@ -505,16 +521,29 @@ u16 EnGo2_GetTextIdGoronCityLink(GlobalContext* globalCtx, EnGo2* this) {
|
|||
s16 EnGo2_GetStateGoronCityLink(GlobalContext* globalCtx, EnGo2* this) {
|
||||
switch (EnGo2_GetDialogState(this, globalCtx)) {
|
||||
case TEXT_STATE_CLOSING:
|
||||
switch (this->actor.textId) {
|
||||
case 0x3036:
|
||||
EnGo2_GetItem(this, globalCtx, GI_TUNIC_GORON);
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
return 2;
|
||||
case 0x3037:
|
||||
gSaveContext.infTable[16] |= 0x4000;
|
||||
default:
|
||||
if(!gSaveContext.n64ddFlag) {
|
||||
switch (this->actor.textId) {
|
||||
case 0x3036:
|
||||
EnGo2_GetItem(this, globalCtx, GI_TUNIC_GORON);
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
return 2;
|
||||
case 0x3037:
|
||||
gSaveContext.infTable[16] |= 0x4000;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
gSaveContext.infTable[16] |= 0x200;
|
||||
EnGo2_GetItem(this, globalCtx, GetRandomizedItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON));
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
return 2;
|
||||
}
|
||||
|
||||
case TEXT_STATE_CHOICE:
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
if (this->actor.textId == 0x3034) {
|
||||
|
@ -579,13 +608,22 @@ s16 EnGo2_GetStateGoronDmtBiggoron(GlobalContext* globalCtx, EnGo2* this) {
|
|||
switch (EnGo2_GetDialogState(this, globalCtx)) {
|
||||
case TEXT_STATE_DONE:
|
||||
if (this->actor.textId == 0x305E) {
|
||||
if (!gSaveContext.bgsFlag) {
|
||||
EnGo2_GetItem(this, globalCtx, GI_SWORD_BGS);
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
return 2;
|
||||
} else {
|
||||
if((!gSaveContext.n64ddFlag && gSaveContext.bgsFlag) || (gSaveContext.n64ddFlag && Flags_GetTreasure(globalCtx, 0x1F))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(gSaveContext.n64ddFlag) {
|
||||
if (INV_CONTENT(ITEM_CLAIM_CHECK) != ITEM_CLAIM_CHECK) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
EnGo2_GetItem(this, globalCtx, GetRandomizedItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS));
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else {
|
||||
EnGo2_GetItem(this, globalCtx, GI_SWORD_BGS);
|
||||
}
|
||||
this->actionFunc = EnGo2_SetupGetItem;
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1533,7 +1571,8 @@ void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
case GORON_CITY_LOWEST_FLOOR:
|
||||
case GORON_CITY_STAIRWELL:
|
||||
case GORON_CITY_LOST_WOODS:
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && LINK_IS_ADULT) {
|
||||
if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && !gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
this->actionFunc = EnGo2_CurledUp;
|
||||
|
@ -1779,7 +1818,9 @@ void EnGo2_SetGetItem(EnGo2* this, GlobalContext* globalCtx) {
|
|||
EnGo2_GetItemAnimation(this, globalCtx);
|
||||
return;
|
||||
case GI_TUNIC_GORON:
|
||||
gSaveContext.infTable[16] |= 0x200;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
gSaveContext.infTable[16] |= 0x200;
|
||||
}
|
||||
EnGo2_GetItemAnimation(this, globalCtx);
|
||||
return;
|
||||
case GI_SWORD_BGS:
|
||||
|
|
|
@ -189,10 +189,15 @@ void func_80A4E648(EnGs* this, GlobalContext* globalCtx) {
|
|||
Actor_GetScreenPos(globalCtx, &this->actor, &sp26, &sp24);
|
||||
if ((sp26 >= 0) && (sp26 <= SCREEN_WIDTH) && (sp24 >= 0) && (sp24 <= SCREEN_HEIGHT) && (this->unk_19C != 3)) {
|
||||
if (func_8002F2CC(&this->actor, globalCtx, 40.0f) == 1) {
|
||||
if (Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) {
|
||||
this->actor.textId = 0x2054;
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
// if we're rando'd, always use the non-mask text id
|
||||
this->actor.textId = 0x2053;
|
||||
} else {
|
||||
if (Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) {
|
||||
this->actor.textId = 0x2054;
|
||||
} else {
|
||||
this->actor.textId = 0x2053;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,13 +113,13 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->type != 5) {
|
||||
if (((gSaveContext.dayTime < 0xB888) || IS_DAY) && !(gSaveContext.eventChkInf[8] & 1)) {
|
||||
if (((gSaveContext.dayTime < 0xB888) || IS_DAY) && (gSaveContext.n64ddFlag || !(gSaveContext.eventChkInf[8] & 1))) {
|
||||
this->actionFunc = EnHeishi1_SetupWalk;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
} else {
|
||||
if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || (gSaveContext.eventChkInf[8] & 1)) {
|
||||
if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || (!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[8] & 1))) {
|
||||
this->actionFunc = EnHeishi1_SetupWaitNight;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
|
|
|
@ -659,7 +659,7 @@ s16 func_80A70058(GlobalContext* globalCtx, Actor* thisx) {
|
|||
gSaveContext.dogParams = 0;
|
||||
break;
|
||||
case 0x709F:
|
||||
func_80A6F7CC(this, globalCtx, (gSaveContext.infTable[25] & 2) ? GI_RUPEE_BLUE : GI_HEART_PIECE);
|
||||
func_80A6F7CC(this, globalCtx, (gSaveContext.infTable[25] & 2) ? GI_RUPEE_BLUE : gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_MARKET_LOST_DOG, GI_HEART_PIECE) : GI_HEART_PIECE);
|
||||
this->actionFunc = func_80A714C4;
|
||||
break;
|
||||
}
|
||||
|
@ -1057,19 +1057,26 @@ void func_80A714C4(EnHy* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80A71530(EnHy* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
switch (this->unkGetItemId) {
|
||||
case GI_HEART_PIECE:
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.dogIsLost = false;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (!(gSaveContext.infTable[25] & 2)) {
|
||||
gSaveContext.infTable[25] |= 2;
|
||||
break;
|
||||
case GI_RUPEE_BLUE:
|
||||
Rupees_ChangeBy(5);
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.dogIsLost = false;
|
||||
break;
|
||||
}
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.dogIsLost = false;
|
||||
} else {
|
||||
switch (this->unkGetItemId) {
|
||||
case GI_HEART_PIECE:
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.dogIsLost = false;
|
||||
gSaveContext.infTable[25] |= 2;
|
||||
break;
|
||||
case GI_RUPEE_BLUE:
|
||||
Rupees_ChangeBy(5);
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.dogIsLost = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this->actionFunc = func_80A7127C;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1421,9 +1421,29 @@ void func_80A781CC(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (!Gameplay_InCsMode(globalCtx)) {
|
||||
this->actor.update = EnIk_Update;
|
||||
this->actor.draw = EnIk_Draw;
|
||||
Cutscene_SetSegment(globalCtx, gSpiritBossNabooruKnuckleDefeatCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
// Don't initiate nabooru defeat CS in rando
|
||||
if (!(gSaveContext.n64ddFlag)) {
|
||||
Cutscene_SetSegment(globalCtx, gSpiritBossNabooruKnuckleDefeatCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
} else {
|
||||
// Because no CS in rando, we hide the death of the knuckle by spawning flames and kill the actor
|
||||
if ((this->actor.colChkInfo.health <= 10)) {
|
||||
s32 i;
|
||||
Vec3f pos;
|
||||
Vec3f sp7C = { 0.0f, 0.5f, 0.0f };
|
||||
int flameAmount = 100;
|
||||
|
||||
for (i = flameAmount; i >= 0; i--) {
|
||||
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(120.0f);
|
||||
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(120.0f);
|
||||
pos.y = this->actor.world.pos.y + 20.0f + Rand_CenteredFloat(120.0f);
|
||||
EffectSsDeadDb_Spawn(globalCtx, &pos, &sp7C, &sp7C, 100, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9,
|
||||
true);
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
gSaveContext.eventChkInf[3] |= 0x1000;
|
||||
func_80A7735C(this, globalCtx);
|
||||
}
|
||||
|
|
|
@ -1169,10 +1169,18 @@ void func_80A99048(EnKo* this, GlobalContext* globalCtx) {
|
|||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 3);
|
||||
if (ENKO_TYPE == ENKO_TYPE_CHILD_3) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
||||
this->collider.dim.height += 200;
|
||||
this->actionFunc = func_80A995CC;
|
||||
return;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
||||
this->collider.dim.height += 200;
|
||||
this->actionFunc = func_80A995CC;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Flags_GetEventChkInf(7)) {
|
||||
this->collider.dim.height += 200;
|
||||
this->actionFunc = func_80A995CC;
|
||||
return;
|
||||
}
|
||||
}
|
||||
Path_CopyLastPoint(this->path, &this->actor.world.pos);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,8 @@ static AnimationInfo sAnimationInfo[] = {
|
|||
u16 EnKz_GetTextNoMaskChild(GlobalContext* globalCtx, EnKz* this) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
if ((gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[2]) ||
|
||||
(!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) {
|
||||
return 0x402B;
|
||||
} else if (gSaveContext.eventChkInf[3] & 8) {
|
||||
return 0x401C;
|
||||
|
@ -85,10 +86,11 @@ u16 EnKz_GetTextNoMaskChild(GlobalContext* globalCtx, EnKz* this) {
|
|||
u16 EnKz_GetTextNoMaskAdult(GlobalContext* globalCtx, EnKz* this) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
// this works because both ITEM_NONE and later trade items are > ITEM_FROG
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_FROG) {
|
||||
if (!(gSaveContext.infTable[19] & 0x200)) {
|
||||
if (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2)) {
|
||||
return 0x401F;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
return CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012;
|
||||
} else {
|
||||
return 0x4012;
|
||||
}
|
||||
|
@ -236,7 +238,7 @@ void func_80A9CB18(EnKz* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (func_80A9C95C(globalCtx, this, &this->unk_1E0.unk_00, 340.0f, EnKz_GetText, func_80A9C6C0)) {
|
||||
if ((this->actor.textId == 0x401A) && !(gSaveContext.eventChkInf[3] & 8)) {
|
||||
if (((gSaveContext.n64ddFlag && LINK_IS_CHILD) || this->actor.textId == 0x401A) && !(gSaveContext.eventChkInf[3] & 8)) {
|
||||
if (func_8002F368(globalCtx) == EXCH_ITEM_LETTER_RUTO) {
|
||||
this->actor.textId = 0x401B;
|
||||
this->sfxPlayed = false;
|
||||
|
@ -250,11 +252,13 @@ void func_80A9CB18(EnKz* this, GlobalContext* globalCtx) {
|
|||
if (LINK_IS_ADULT) {
|
||||
if ((INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_PRESCRIPTION) &&
|
||||
(func_8002F368(globalCtx) == EXCH_ITEM_PRESCRIPTION)) {
|
||||
this->actor.textId = 0x4014;
|
||||
this->sfxPlayed = false;
|
||||
player->actor.textId = this->actor.textId;
|
||||
this->isTrading = true;
|
||||
return;
|
||||
if (!gSaveContext.n64ddFlag || !Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
this->actor.textId = 0x4014;
|
||||
this->sfxPlayed = false;
|
||||
player->actor.textId = this->actor.textId;
|
||||
this->isTrading = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this->isTrading = false;
|
||||
|
@ -262,7 +266,12 @@ void func_80A9CB18(EnKz* this, GlobalContext* globalCtx) {
|
|||
this->actor.textId = CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A;
|
||||
player->actor.textId = this->actor.textId;
|
||||
} else {
|
||||
this->actor.textId = CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
this->actor.textId = CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012;
|
||||
} else {
|
||||
this->actor.textId = 0x4012;
|
||||
}
|
||||
|
||||
player->actor.textId = this->actor.textId;
|
||||
}
|
||||
}
|
||||
|
@ -330,8 +339,29 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->unk_1E0.unk_00 = 0;
|
||||
Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_0);
|
||||
|
||||
if (gSaveContext.eventChkInf[3] & 8) {
|
||||
EnKz_SetMovedPos(this, globalCtx);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (gSaveContext.eventChkInf[3] & 8) {
|
||||
EnKz_SetMovedPos(this, globalCtx);
|
||||
}
|
||||
} else {
|
||||
int zorasFountain = GetRandoSettingValue(RSK_ZORAS_FOUNTAIN);
|
||||
switch (zorasFountain) {
|
||||
case 0:
|
||||
if (gSaveContext.eventChkInf[3] & 8) {
|
||||
EnKz_SetMovedPos(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (LINK_IS_ADULT) {
|
||||
EnKz_SetMovedPos(this, globalCtx);
|
||||
} else if (gSaveContext.eventChkInf[3] & 8) {
|
||||
EnKz_SetMovedPos(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
EnKz_SetMovedPos(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (LINK_IS_ADULT) {
|
||||
|
@ -432,7 +462,16 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) {
|
|||
this->unk_1E0.unk_00 = 1;
|
||||
this->actionFunc = EnKz_StartTimer;
|
||||
} else {
|
||||
getItemId = this->isTrading == true ? GI_FROG : GI_TUNIC_ZORA;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (this->isTrading) {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_ZD_TRADE_PRESCRIPTION, GI_FROG);
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_ZD_KING_ZORA_THAWED, GI_TUNIC_ZORA);
|
||||
}
|
||||
} else {
|
||||
getItemId = this->isTrading ? GI_FROG : GI_TUNIC_ZORA;
|
||||
}
|
||||
yRange = fabsf(this->actor.yDistToPlayer) + 1.0f;
|
||||
xzRange = this->actor.xzDistToPlayer + 1.0f;
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, xzRange, yRange);
|
||||
|
|
|
@ -25,6 +25,7 @@ void func_80AA106C(EnMa1* this, GlobalContext* globalCtx);
|
|||
void func_80AA10EC(EnMa1* this, GlobalContext* globalCtx);
|
||||
void func_80AA1150(EnMa1* this, GlobalContext* globalCtx);
|
||||
void EnMa1_DoNothing(EnMa1* this, GlobalContext* globalCtx);
|
||||
void EnMa1_WaitForSongGive(EnMa1* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit En_Ma1_InitVars = {
|
||||
ACTOR_EN_MA1,
|
||||
|
@ -95,8 +96,10 @@ u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* thisx) {
|
|||
if (faceReaction != 0) {
|
||||
return faceReaction;
|
||||
}
|
||||
if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
|
||||
return 0x204A;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
|
||||
return 0x204A;
|
||||
}
|
||||
}
|
||||
if (gSaveContext.eventChkInf[1] & 0x40) {
|
||||
return 0x2049;
|
||||
|
@ -271,6 +274,12 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit);
|
||||
|
||||
if (gSaveContext.n64ddFlag) { // Skip Malon's multiple textboxes before getting an item
|
||||
gSaveContext.infTable[8] |= 0x800;
|
||||
gSaveContext.infTable[8] |= 0x10;
|
||||
gSaveContext.eventChkInf[1] |= 1;
|
||||
}
|
||||
|
||||
if (!func_80AA08C4(this, globalCtx)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
|
@ -281,10 +290,14 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.targetMode = 6;
|
||||
this->unk_1E8.unk_00 = 0;
|
||||
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x10) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) {
|
||||
this->actionFunc = func_80AA0D88;
|
||||
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) { // Skip straight to "let's sing it together" textbox in the ranch
|
||||
gSaveContext.eventChkInf[1] |= 0x40;
|
||||
}
|
||||
|
||||
this->actionFunc = func_80AA0F44;
|
||||
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
|
||||
}
|
||||
|
@ -310,7 +323,7 @@ void func_80AA0D88(EnMa1* this, GlobalContext* globalCtx) {
|
|||
|
||||
if ((globalCtx->sceneNum == SCENE_SPOT15) && (gSaveContext.eventChkInf[1] & 0x10)) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (!(gSaveContext.eventChkInf[1] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
|
||||
} else if (!(gSaveContext.eventChkInf[1] & 0x10) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) {
|
||||
if (this->unk_1E8.unk_00 == 2) {
|
||||
this->actionFunc = func_80AA0EA0;
|
||||
globalCtx->msgCtx.stateTimer = 4;
|
||||
|
@ -324,7 +337,12 @@ void func_80AA0EA0(EnMa1* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
this->actionFunc = func_80AA0EFC;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_WEIRD_EGG, 120.0f, 10.0f);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(RC_HC_MALON_EGG, GI_WEIRD_EGG);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 120.0f, 10.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_WEIRD_EGG, 120.0f, 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,6 +355,24 @@ void func_80AA0EFC(EnMa1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardMalon(EnMa1* malon, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_EPONAS_SONG);
|
||||
// Prevents flag from getting set if we weren't able to get the item (i.e. Player is holding shield
|
||||
// when closing the textbox).
|
||||
if (malon->actor.parent != NULL && malon->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
// puts malon in the action that vanilla has her in after learning the song
|
||||
// (confirmed via breakpoints in a vanilla save).
|
||||
malon->actionFunc = func_80AA0D88;
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
func_8002F434(&malon->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
// make malon sing again after giving the item.
|
||||
malon->unk_1E8.unk_00 = 0;
|
||||
malon->unk_1E0 = 1;
|
||||
}
|
||||
|
||||
void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
|
@ -351,6 +387,7 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (gSaveContext.eventChkInf[1] & 0x40) {
|
||||
// When the player pulls out the Ocarina while close to Malon
|
||||
if (player->stateFlags2 & 0x1000000) {
|
||||
player->stateFlags2 |= 0x2000000;
|
||||
player->unk_6A8 = &this->actor;
|
||||
|
@ -358,10 +395,19 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
|
|||
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
|
||||
this->unk_1E8.unk_00 = 1;
|
||||
this->actor.flags |= ACTOR_FLAG_16;
|
||||
this->actionFunc = func_80AA106C;
|
||||
// when rando'ed, skip to the Item Giving. Otherwise go to the song teaching code.
|
||||
this->actionFunc = gSaveContext.n64ddFlag ? func_80AA1150 : func_80AA106C;
|
||||
} else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) {
|
||||
// somehow flags that the player is close to malon so that pulling out the Ocarina
|
||||
// triggers the code above this.
|
||||
player->stateFlags2 |= 0x800000;
|
||||
}
|
||||
// If rando'ed, a textbox is closing, it's malon's 'my mom wrote this song' text, AND we do have an ocarina
|
||||
// in our inventory. This allows us to grant the check when talking to malon with the ocarina in our inventory.
|
||||
if (gSaveContext.n64ddFlag && (Actor_TextboxIsClosing(&this->actor, globalCtx) && globalCtx->msgCtx.textId == 0x2049) &&
|
||||
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE || INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE)) {
|
||||
this->actionFunc = EnMa1_WaitForSongGive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,14 +429,48 @@ void func_80AA10EC(EnMa1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void EnMa1_WaitForSongGive(EnMa1* this, GlobalContext* globalCtx) {
|
||||
// Actually give the song check.
|
||||
GivePlayerRandoRewardMalon(this, globalCtx, RC_SONG_FROM_MALON);
|
||||
}
|
||||
|
||||
// Sets an Ocarina State necessary to not softlock in rando.
|
||||
// This function should only be called in rando.
|
||||
void EnMa1_EndTeachSong(EnMa1* this, GlobalContext* globalCtx) {
|
||||
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
|
||||
this->actionFunc = func_80AA0F44;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
// Transition to the giving the song check on the next update run.
|
||||
this->actionFunc = EnMa1_WaitForSongGive;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AA1150(EnMa1* this, GlobalContext* globalCtx) {
|
||||
GET_PLAYER(globalCtx)->stateFlags2 |= 0x800000;
|
||||
|
||||
// When rando'ed, trigger the "song learned" Ocarina mode.
|
||||
if (gSaveContext.n64ddFlag && (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING)) {
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_03;
|
||||
}
|
||||
|
||||
if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) {
|
||||
globalCtx->nextEntranceIndex = 0x157;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
globalCtx->fadeTransition = 42;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
this->actionFunc = EnMa1_DoNothing;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x157;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
globalCtx->fadeTransition = 42;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
this->actionFunc = EnMa1_DoNothing;
|
||||
} else {
|
||||
// When rando'ed, skip the cutscene, play the chime, reset some flags,
|
||||
// and give the song on next update.
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
this->actionFunc = EnMa1_EndTeachSong;
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -372,7 +372,8 @@ u16 EnMd_GetTextKokiriForest(GlobalContext* globalCtx, EnMd* this) {
|
|||
this->unk_208 = 0;
|
||||
this->unk_209 = TEXT_STATE_NONE;
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[1])) {
|
||||
return 0x1045;
|
||||
}
|
||||
|
||||
|
@ -482,6 +483,17 @@ s16 func_80AAAF04(GlobalContext* globalCtx, Actor* thisx) {
|
|||
|
||||
u8 EnMd_ShouldSpawn(EnMd* this, GlobalContext* globalCtx) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT04) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
// if we have beaten deku tree or have open forest turned on
|
||||
// or have already shown mido we have an equipped sword/shield
|
||||
if (gSaveContext.dungeonsDone[1] ||
|
||||
GetRandoSettingValue(RSK_FOREST) == 1 ||
|
||||
gSaveContext.eventChkInf[0] & 0x10) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x1000) && !(gSaveContext.eventChkInf[4] & 1)) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -197,14 +197,15 @@ void func_80AACFA0(EnMk* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = func_80AACA40;
|
||||
gSaveContext.itemGetInf[1] |= 1;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
// not sure when/how/if this is getting called
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AAD014(EnMk* this, GlobalContext* globalCtx) {
|
||||
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_80AACFA0;
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f);
|
||||
}
|
||||
|
||||
this->flags |= 1;
|
||||
|
|
|
@ -1100,7 +1100,7 @@ void EnNb_LookUp(EnNb* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) {
|
||||
if (!(gSaveContext.eventChkInf[9] & 0x20) && LINK_IS_CHILD) {
|
||||
if (!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[9] & 0x20) && LINK_IS_CHILD) {
|
||||
EnNb_UpdatePath(this, globalCtx);
|
||||
|
||||
// looking into crawlspace
|
||||
|
|
|
@ -200,7 +200,7 @@ void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
EnNiw* currentCucco;
|
||||
s32 phi_s1;
|
||||
|
||||
this->cuccosInPen = 0;
|
||||
this->cuccosInPen = gSaveContext.n64ddFlag ? (7 - GetRandoSettingValue(RSK_CUCCO_COUNT)) : 0;
|
||||
currentCucco = (EnNiw*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head;
|
||||
while (currentCucco != NULL) {
|
||||
if (currentCucco->actor.id == ACTOR_EN_NIW) {
|
||||
|
@ -303,8 +303,15 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
this->unk_26E = 0xB;
|
||||
if (!(gSaveContext.itemGetInf[0] & 0x1000)) {
|
||||
this->actor.parent = NULL;
|
||||
this->getItemId = GI_BOTTLE;
|
||||
func_8002F434(&this->actor, globalCtx, GI_BOTTLE, 100.0f, 50.0f);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 itemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_CHILD, GI_BOTTLE);
|
||||
func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 50.0f);
|
||||
} else {
|
||||
this->getItemId = GI_BOTTLE;
|
||||
func_8002F434(&this->actor, globalCtx, GI_BOTTLE, 100.0f, 50.0f);
|
||||
}
|
||||
|
||||
this->actionFunc = func_80ABAC00;
|
||||
return;
|
||||
}
|
||||
|
@ -386,7 +393,14 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
case 0:
|
||||
Message_CloseTextbox(globalCtx);
|
||||
this->actor.parent = NULL;
|
||||
func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 itemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||
func_8002F434(&this->actor, globalCtx, itemId, 200.0f, 100.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f);
|
||||
}
|
||||
|
||||
this->actionFunc = func_80ABAC00;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -439,6 +453,10 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
getItemId = this->getItemId;
|
||||
if (LINK_IS_ADULT) {
|
||||
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
||||
|
||||
if (gSaveContext.n64ddFlag && getItemId == GI_POCKET_EGG) {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||
}
|
||||
|
|
|
@ -234,7 +234,9 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) {
|
|||
if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_04) {
|
||||
this->actionFunc = func_80ABF28C;
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) {
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
if (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_DOOR_OF_TIME) != 2)) {
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
}
|
||||
if (this->switchFlag >= 0) {
|
||||
Flags_SetSwitch(globalCtx, this->switchFlag);
|
||||
}
|
||||
|
@ -244,18 +246,38 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) {
|
|||
gSaveContext.eventChkInf[3] |= 0x200;
|
||||
break;
|
||||
case 2:
|
||||
globalCtx->csCtx.segment = D_80ABF9D0;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = D_80ABF9D0;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
} else {
|
||||
gSaveContext.eventChkInf[6] |= 0x80;
|
||||
gSaveContext.eventChkInf[6] |= 0x20;
|
||||
}
|
||||
func_800F574C(1.18921f, 0x5A);
|
||||
break;
|
||||
case 4:
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
int doorOfTime = GetRandoSettingValue(RSK_DOOR_OF_TIME);
|
||||
if (doorOfTime == 2 &&
|
||||
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_OCARINA_TIME ||
|
||||
!CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) ||
|
||||
!CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) {
|
||||
func_80078884(NA_SE_SY_OCARINA_ERROR);
|
||||
break;
|
||||
} else {
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
}
|
||||
}
|
||||
globalCtx->csCtx.segment = D_80ABFB40;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
break;
|
||||
case 6:
|
||||
globalCtx->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_003C80)
|
||||
: SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_005020);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
// Don't start the cutscene in a rando save.
|
||||
if (!(gSaveContext.n64ddFlag)) {
|
||||
globalCtx->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_003C80)
|
||||
: SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_005020);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
}
|
||||
gSaveContext.eventChkInf[1] |= 0x2000;
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
break;
|
||||
|
@ -288,7 +310,7 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) {
|
|||
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
|
||||
this->unk_15A++;
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f)) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_SONG_SUN) || gSaveContext.n64ddFlag) {
|
||||
this->actor.textId = 0x5021;
|
||||
}
|
||||
yawDiffNew = ABS(yawDiff);
|
||||
|
@ -300,15 +322,31 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
if (song->actor.parent != NULL && song->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) {
|
||||
// "Open sesame sesame!"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 開けゴマゴマゴマ! ☆☆☆☆☆ %d\n" VT_RST, Message_GetState(&globalCtx->msgCtx));
|
||||
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
|
||||
Message_CloseTextbox(globalCtx);
|
||||
if (!CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
}
|
||||
} else {
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB);
|
||||
}
|
||||
}
|
||||
this->actionFunc = func_80ABF708;
|
||||
}
|
||||
|
|
|
@ -517,7 +517,8 @@ void EnOssan_TalkGoronShopkeeper(GlobalContext* globalCtx) {
|
|||
} else {
|
||||
Message_ContinueTextbox(globalCtx, 0x300F);
|
||||
}
|
||||
} else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
|
||||
} else if ((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && !gSaveContext.dungeonsDone[4])) {
|
||||
Message_ContinueTextbox(globalCtx, 0x3057);
|
||||
} else {
|
||||
Message_ContinueTextbox(globalCtx, 0x305B);
|
||||
|
@ -587,8 +588,10 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
// If you've given Zelda's Letter to the Kakariko Guard
|
||||
if (this->actor.params == OSSAN_TYPE_MASK && !(gSaveContext.infTable[7] & 0x40)) {
|
||||
// If you haven't given Zelda's Letter to the Kakariko Guard
|
||||
// or are rando'd and haven't gotten gotten the letter from zelda yet
|
||||
if (this->actor.params == OSSAN_TYPE_MASK && (!(gSaveContext.infTable[7] & 0x40) ||
|
||||
(gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[4] & 1)))) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -136,7 +136,9 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
// "conversation owl %4x no = %d, sv = %d"
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " 会話フクロウ %4x no = %d, sv = %d\n" VT_RST, this->actor.params, owlType, switchFlag);
|
||||
|
||||
if ((owlType != OWL_DEFAULT) && (switchFlag < 0x20) && Flags_GetSwitch(globalCtx, switchFlag)) {
|
||||
if (((owlType != OWL_DEFAULT) && (switchFlag < 0x20) && Flags_GetSwitch(globalCtx, switchFlag)) ||
|
||||
// Owl shortcuts at SPOT06: Lake Hylia and SPOT16: Death Mountain Trail
|
||||
(gSaveContext.n64ddFlag && !(globalCtx->sceneNum == SCENE_SPOT06 || globalCtx->sceneNum == SCENE_SPOT16))) {
|
||||
osSyncPrintf("savebitでフクロウ退避\n"); // "Save owl with savebit"
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
|
@ -628,7 +630,7 @@ void func_80ACB274(EnOwl* this, GlobalContext* globalCtx) {
|
|||
void EnOwl_WaitDeathMountainShortcut(EnOwl* this, GlobalContext* globalCtx) {
|
||||
EnOwl_LookAtLink(this, globalCtx);
|
||||
|
||||
if (!gSaveContext.magicAcquired) {
|
||||
if (!gSaveContext.magicAcquired && !gSaveContext.n64ddFlag) {
|
||||
if (func_80ACA558(this, globalCtx, 0x3062)) {
|
||||
Audio_PlayFanfare(NA_BGM_OWL);
|
||||
this->actionFunc = func_80ACB274;
|
||||
|
@ -955,11 +957,23 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) {
|
|||
osSyncPrintf(VT_FGCOL(CYAN));
|
||||
osSyncPrintf("SPOT 06 の デモがはしった\n"); // "Demo of SPOT 06 has been completed"
|
||||
osSyncPrintf(VT_RST);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x027E;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 2;
|
||||
break;
|
||||
}
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gLakeHyliaOwlCs);
|
||||
this->actor.draw = NULL;
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x0554;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 2;
|
||||
break;
|
||||
}
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gDMTOwlCs);
|
||||
this->actor.draw = NULL;
|
||||
break;
|
||||
|
|
|
@ -141,7 +141,8 @@ void EnPoRelay_SetupRace(EnPoRelay* this) {
|
|||
EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]);
|
||||
this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U;
|
||||
func_80088B34(0);
|
||||
this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE;
|
||||
this->hookshotSlotFull = (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE && !gSaveContext.n64ddFlag) ||
|
||||
(gSaveContext.n64ddFlag && Flags_GetTreasure(gGlobalCtx, 0x1E));
|
||||
this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec);
|
||||
this->actor.flags |= ACTOR_FLAG_27;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH);
|
||||
|
@ -204,6 +205,7 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) {
|
|||
multiplier = 0.0f;
|
||||
}
|
||||
speed = 30.0f * multiplier;
|
||||
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HONOTRAP,
|
||||
Math_CosS(this->unk_19A) * speed + this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
Math_SinS(this->unk_19A) * speed + this->actor.world.pos.z, 0,
|
||||
|
@ -327,21 +329,42 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.001f) != 0) {
|
||||
if (this->hookshotSlotFull != 0) {
|
||||
if(!gSaveContext.n64ddFlag) {
|
||||
if (this->hookshotSlotFull != 0) {
|
||||
sp60.x = this->actor.world.pos.x;
|
||||
sp60.y = this->actor.floorHeight;
|
||||
sp60.z = this->actor.world.pos.z;
|
||||
if (gSaveContext.timer1Value < HIGH_SCORE(HS_DAMPE_RACE)) {
|
||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
||||
}
|
||||
if (Flags_GetCollectible(globalCtx, this->actor.params) == 0 && gSaveContext.timer1Value <= 60) {
|
||||
Item_DropCollectible2(globalCtx, &sp60, (this->actor.params << 8) + (0x4000 | ITEM00_HEART_PIECE));
|
||||
} else {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, sp60.x, sp60.y, sp60.z, 0, 0, 0, 2);
|
||||
}
|
||||
} else {
|
||||
Flags_SetTempClear(globalCtx, 4);
|
||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
||||
}
|
||||
} else {
|
||||
sp60.x = this->actor.world.pos.x;
|
||||
sp60.y = this->actor.floorHeight;
|
||||
sp60.z = this->actor.world.pos.z;
|
||||
|
||||
if (this->hookshotSlotFull == 0) {
|
||||
Flags_SetTempClear(globalCtx, 4);
|
||||
Flags_SetTreasure(gGlobalCtx, 0x1E);
|
||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
||||
}
|
||||
|
||||
if (gSaveContext.timer1Value < HIGH_SCORE(HS_DAMPE_RACE)) {
|
||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
||||
}
|
||||
if (Flags_GetCollectible(globalCtx, this->actor.params) == 0 && gSaveContext.timer1Value <= 60) {
|
||||
Item_DropCollectible2(globalCtx, &sp60, (this->actor.params << 8) + (0x4000 | ITEM00_HEART_PIECE));
|
||||
} else {
|
||||
} else if (Flags_GetCollectible(globalCtx, this->actor.params) != 0) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, sp60.x, sp60.y, sp60.z, 0, 0, 0, 2);
|
||||
}
|
||||
} else {
|
||||
Flags_SetTempClear(globalCtx, 4);
|
||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
|
|
@ -179,6 +179,12 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
EnPoSisters* this = (EnPoSisters*)thisx;
|
||||
s32 pad;
|
||||
|
||||
// Skip Poe Intro Cutscene
|
||||
if (gSaveContext.n64ddFlag && thisx->params == 4124) {
|
||||
Flags_SetSwitch(globalCtx, 0x1B);
|
||||
Actor_Kill(thisx);
|
||||
}
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &gPoeSistersSkel, &gPoeSistersSwayAnim, this->jointTable,
|
||||
|
@ -850,6 +856,11 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) {
|
|||
if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) < 600.0f) {
|
||||
if (this->unk_19C != 0) {
|
||||
this->unk_19C--;
|
||||
|
||||
// Force Meg to respawn instantly after getting hit
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
this->unk_19C = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->unk_19C = 100;
|
||||
|
|
|
@ -40,7 +40,9 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Audio_PlayNatureAmbienceSequence(NATURE_ID_KOKIRI_REGION);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (this->actor.params == RS_SARIAS_SONG) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) ||
|
||||
CHECK_QUEST_ITEM(QUEST_SONG_SARIA) ||
|
||||
gSaveContext.n64ddFlag) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -387,6 +387,9 @@ s32 func_80AF5DFC(EnSa* this, GlobalContext* globalCtx) {
|
|||
return 1;
|
||||
}
|
||||
if (globalCtx->sceneNum == SCENE_SPOT05 && (gSaveContext.eventChkInf[4] & 1)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
return 5;
|
||||
}
|
||||
return CHECK_QUEST_ITEM(QUEST_SONG_SARIA) ? 2 : 5;
|
||||
}
|
||||
if (globalCtx->sceneNum == SCENE_SPOT04 && !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
||||
|
@ -614,10 +617,27 @@ void func_80AF67D0(EnSa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSaria(EnSa* saria, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
GetItemID getItemId =
|
||||
GetRandomizedItemIdFromKnownCheck(check, GI_SARIAS_SONG);
|
||||
|
||||
if (saria->actor.parent != NULL && saria->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
func_8002F434(&saria->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AF683C(EnSa* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->actor.world.pos.z >= -2220.0f) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoRewardSaria(this, globalCtx, RC_SONG_FROM_SARIA);
|
||||
return;
|
||||
}
|
||||
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(spot05_scene_Cs_005730);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->actionFunc = func_80AF68E4;
|
||||
|
|
|
@ -1035,7 +1035,7 @@ void EnSkj_SariaSongTalk(EnSkj* this, GlobalContext* globalCtx) {
|
|||
EnSkj_SetupWaitInRange(this);
|
||||
} else {
|
||||
func_80AFFE24(this);
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, EnSkj_GetItemXzRange(this),
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this),
|
||||
EnSkj_GetItemYRange(this));
|
||||
}
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ void func_80AFFE44(EnSkj* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
EnSkj_SetupPostSariasSong(this);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1527,7 +1527,12 @@ void EnSkj_WonOcarinaMiniGame(EnSkj* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnSkj_WaitToGiveReward(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3
|
||||
? GetRandomizedItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE)
|
||||
: sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum],
|
||||
26.0f, 26.0f);
|
||||
|
||||
this->actionFunc = EnSkj_GiveOcarinaGameReward;
|
||||
}
|
||||
}
|
||||
|
@ -1537,7 +1542,11 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnSkj_FinishOcarinaGameRound;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3
|
||||
? GetRandomizedItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE)
|
||||
: sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum],
|
||||
26.0f, 26.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1549,7 +1558,11 @@ void EnSkj_FinishOcarinaGameRound(EnSkj* this, GlobalContext* globalCtx) {
|
|||
gSaveContext.ocarinaGameRoundNum++;
|
||||
}
|
||||
|
||||
if (ocarinaGameRoundNum == 2) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
gSaveContext.ocarinaGameRoundNum = 3;
|
||||
}
|
||||
|
||||
if (ocarinaGameRoundNum == 2 || gSaveContext.n64ddFlag) {
|
||||
gSaveContext.itemGetInf[1] |= 0x80;
|
||||
this->actionFunc = EnSkj_CleanupOcarinaGame;
|
||||
} else {
|
||||
|
|
|
@ -239,20 +239,42 @@ void EnSth_ParentRewardObtainedWait(EnSth* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnSth_GivePlayerItem(EnSth* this, GlobalContext* globalCtx) {
|
||||
u16 getItemId = sGetItemIds[this->actor.params];
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
switch (getItemId) {
|
||||
case GI_RUPEE_GOLD:
|
||||
break;
|
||||
case GI_WALLET_ADULT:
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_10_GOLD_SKULLTULA_REWARD, GI_WALLET_ADULT);
|
||||
break;
|
||||
case GI_STONE_OF_AGONY:
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_20_GOLD_SKULLTULA_REWARD, GI_STONE_OF_AGONY);
|
||||
break;
|
||||
case GI_WALLET_GIANT:
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_30_GOLD_SKULLTULA_REWARD, GI_WALLET_GIANT);
|
||||
break;
|
||||
case GI_BOMBCHUS_10:
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_40_GOLD_SKULLTULA_REWARD, GI_BOMBCHUS_10);
|
||||
break;
|
||||
case GI_HEART_PIECE:
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_50_GOLD_SKULLTULA_REWARD, GI_HEART_PIECE);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (this->actor.params) {
|
||||
case 1:
|
||||
case 3:
|
||||
switch (CUR_UPG_VALUE(UPG_WALLET)) {
|
||||
case 0:
|
||||
getItemId = GI_WALLET_ADULT;
|
||||
break;
|
||||
|
||||
switch (this->actor.params) {
|
||||
case 1:
|
||||
case 3:
|
||||
switch (CUR_UPG_VALUE(UPG_WALLET)) {
|
||||
case 0:
|
||||
getItemId = GI_WALLET_ADULT;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
getItemId = GI_WALLET_GIANT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
getItemId = GI_WALLET_GIANT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f);
|
||||
|
|
|
@ -335,7 +335,10 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
|||
this->tempGallery = this->actor.parent;
|
||||
this->actor.parent = NULL;
|
||||
if (!LINK_IS_ADULT) {
|
||||
if (!(gSaveContext.itemGetInf[0] & 0x2000)) {
|
||||
if(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1E)) {
|
||||
this->getItemId = GetRandomizedItemIdFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50);
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
} else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x2000)) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Pachinko ☆☆☆☆☆ %d\n" VT_RST,
|
||||
CUR_UPG_VALUE(UPG_BULLET_BAG));
|
||||
if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) {
|
||||
|
@ -347,7 +350,10 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
|||
this->getItemId = GI_RUPEE_PURPLE;
|
||||
}
|
||||
} else {
|
||||
if (!(gSaveContext.itemGetInf[0] & 0x4000)) {
|
||||
if(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
this->getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50);
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x4000)) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Bow ☆☆☆☆☆ %d\n" VT_RST,
|
||||
CUR_UPG_VALUE(UPG_QUIVER));
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
|
|
|
@ -883,7 +883,7 @@ void func_80B15F54(EnTa* this, GlobalContext* globalCtx) {
|
|||
Message_CloseTextbox(globalCtx);
|
||||
this->unk_2E0 &= ~0x2;
|
||||
func_80B13AA0(this, func_80B15E80, func_80B16938);
|
||||
func_8002F434(&this->actor, globalCtx, GI_MILK_BOTTLE, 10000.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE) : GI_MILK_BOTTLE, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -404,6 +404,10 @@ s32 EnTk_ChooseReward(EnTk* this) {
|
|||
f32 luck;
|
||||
s32 reward;
|
||||
|
||||
if (gSaveContext.n64ddFlag && !Flags_GetCollectible(gGlobalCtx, 0x1F) && this->heartPieceSpawned == 0) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
luck = Rand_ZeroOne();
|
||||
|
||||
if (luck < 0.4f) {
|
||||
|
@ -596,7 +600,7 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->rewardTimer = 0;
|
||||
|
||||
if (this->validDigHere == 1) {
|
||||
if (this->validDigHere == 1 || gSaveContext.n64ddFlag) {
|
||||
rewardOrigin.x = 0.0f;
|
||||
rewardOrigin.y = 0.0f;
|
||||
rewardOrigin.z = -40.0f;
|
||||
|
@ -609,34 +613,60 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
|
|||
rewardPos.z += this->actor.world.pos.z;
|
||||
|
||||
this->currentReward = EnTk_ChooseReward(this);
|
||||
if (this->currentReward == 3) {
|
||||
/*
|
||||
* Upgrade the purple rupee reward to the heart piece if this
|
||||
* is the first grand prize dig.
|
||||
*/
|
||||
// If vanilla itemGetInf flag is not set, it's impossible for the new flag to be set, so return true.
|
||||
// Otherwise if the gGravediggingTourFix is enabled and the new flag hasn't been set, return true.
|
||||
// If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag.
|
||||
if (!heartPieceSpawned &&
|
||||
(!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) ||
|
||||
CVar_GetS32("gGravediggingTourFix", 0) &&
|
||||
!Flags_GetCollectible(globalCtx, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) {
|
||||
this->currentReward = 4;
|
||||
gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE;
|
||||
heartPieceSpawned = true;
|
||||
}
|
||||
}
|
||||
|
||||
EnItem00* reward = Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]);
|
||||
if (this->currentReward == 4) {
|
||||
reward->collectibleFlag = COLLECTFLAG_GRAVEDIGGING_HEART_PIECE;
|
||||
// merging in dampe tour fix seems messy, so i'm just wrapping this whole thing
|
||||
// in an n64dd check for now
|
||||
if(gSaveContext.n64ddFlag) {
|
||||
if (this->currentReward == 3) {
|
||||
/*
|
||||
* Upgrade the purple rupee reward to the heart piece if this
|
||||
* is the first grand prize dig.
|
||||
*/
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x1000) && !gSaveContext.n64ddFlag) {
|
||||
gSaveContext.itemGetInf[1] |= 0x1000;
|
||||
this->currentReward = 4;
|
||||
} else if (gSaveContext.n64ddFlag && !Flags_GetCollectible(gGlobalCtx, 0x1F) && this->heartPieceSpawned == 0) {
|
||||
this->currentReward = 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.n64ddFlag && this->currentReward == 4) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, rewardPos.x, rewardPos.y, rewardPos.z, 0,
|
||||
0, 0, 0x1F06);
|
||||
this->heartPieceSpawned = 1;
|
||||
} else {
|
||||
Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]);
|
||||
}
|
||||
} else {
|
||||
if (this->currentReward == 3) {
|
||||
/*
|
||||
* Upgrade the purple rupee reward to the heart piece if this
|
||||
* is the first grand prize dig.
|
||||
*/
|
||||
// If vanilla itemGetInf flag is not set, it's impossible for the new flag to be set, so return true.
|
||||
// Otherwise if the gGravediggingTourFix is enabled and the new flag hasn't been set, return true.
|
||||
// If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag.
|
||||
if (!heartPieceSpawned &&
|
||||
(!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) ||
|
||||
CVar_GetS32("gGravediggingTourFix", 0) &&
|
||||
!Flags_GetCollectible(globalCtx, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) {
|
||||
this->currentReward = 4;
|
||||
gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE;
|
||||
heartPieceSpawned = true;
|
||||
}
|
||||
}
|
||||
|
||||
EnItem00* reward = Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]);
|
||||
if (this->currentReward == 4) {
|
||||
reward->collectibleFlag = COLLECTFLAG_GRAVEDIGGING_HEART_PIECE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this->skelAnime.curFrame >= 32.0f && this->rewardTimer == 10) {
|
||||
/* Play a reward sound shortly after digging */
|
||||
if (this->validDigHere == 0) {
|
||||
if (!gSaveContext.n64ddFlag && this->validDigHere == 0) {
|
||||
/* Bad dig spot */
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR);
|
||||
} else if (this->currentReward == 4) {
|
||||
|
|
|
@ -47,6 +47,7 @@ typedef struct EnTk {
|
|||
/* 0x0296 */ Vec3s morphTable[18];
|
||||
/* 0x0304 */ Vec3f v3f_304;
|
||||
/* 0x0310 */ EnTkEff eff[20];
|
||||
u8 heartPieceSpawned;
|
||||
} EnTk; // size = 0x0770
|
||||
|
||||
#endif
|
||||
|
|
|
@ -141,7 +141,10 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx) {
|
|||
if (this->switchFlag < 0 || !Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
if ((Actor_ProcessTalkRequest(&this->actor, globalCtx))) {
|
||||
if (this->unk_156 != TEXT_STATE_DONE) {
|
||||
this->actionFunc = func_80B395F0;
|
||||
// not if we're rando'd in the temple of time talking to the altar
|
||||
if(!(gSaveContext.n64ddFlag && globalCtx->sceneNum == 67)) {
|
||||
this->actionFunc = func_80B395F0;
|
||||
}
|
||||
} else {
|
||||
if (this->switchFlag >= 0) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
|
|
|
@ -252,10 +252,42 @@ void func_80B3A4F8(EnWonderTalk2* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
this->unk_158 = 0;
|
||||
if (!this->unk_156) {
|
||||
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
|
||||
func_8002DF54(globalCtx, NULL, 8);
|
||||
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_4;
|
||||
this->actionFunc = func_80B3A3D4;
|
||||
// Whether or not to skip the text in rando
|
||||
bool randoSkipText = false;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
// Scenes for which all of this type of wonder talk should be skipped.
|
||||
switch (globalCtx->sceneNum) {
|
||||
case 0x0007: // Shadow Temple
|
||||
randoSkipText = true;
|
||||
break;
|
||||
case 0x000B: // Gerudo Training Grounds
|
||||
randoSkipText = true;
|
||||
break;
|
||||
case 0x000C: // Inside Gerudo Fortress
|
||||
randoSkipText = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// individual textIds that should be skipped, or that should be preserved
|
||||
// in a scene that otherwise has all wonder talk skipped.
|
||||
//switch (this->actor.textId) {
|
||||
// case: 0x023c //textId we want to skip
|
||||
// randoSkipText = true;
|
||||
// break;
|
||||
// case 0x023c: // textId in a skipped scene that we don't want to skip
|
||||
// randoSkipText = false;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
if (!(randoSkipText)) {
|
||||
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
|
||||
func_8002DF54(globalCtx, NULL, 8);
|
||||
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_4;
|
||||
this->actionFunc = func_80B3A3D4;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -272,6 +272,10 @@ void func_80B3C9EC(EnXc* this) {
|
|||
this->action = SHEIK_ACTION_BLOCK_PEDESTAL;
|
||||
this->drawMode = SHEIK_DRAW_DEFAULT;
|
||||
this->unk_30C = 1;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void func_80B3CA38(EnXc* this, GlobalContext* globalCtx) {
|
||||
|
@ -283,6 +287,22 @@ void func_80B3CA38(EnXc* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardSheikSong(EnXc* sheik, GlobalContext* globalCtx, RandomizerCheck check, int sheikType, GetItemID ogSongId) {
|
||||
if (sheik->actor.parent != NULL && sheik->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!(gSaveContext.eventChkInf[5] & sheikType)) {
|
||||
gSaveContext.eventChkInf[5] |= sheikType;
|
||||
} else if (!(gSaveContext.eventChkInf[5] & sheikType)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, ogSongId);
|
||||
if (check == RC_SHEIK_AT_TEMPLE && !Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
if (func_8002F434(&sheik->actor, globalCtx, getItemId, 10000.0f, 100.0f)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
} else if (check != RC_SHEIK_AT_TEMPLE) {
|
||||
func_8002F434(&sheik->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 EnXc_MinuetCS(EnXc* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.params == SHEIK_TYPE_MINUET) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
@ -290,10 +310,15 @@ s32 EnXc_MinuetCS(EnXc* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (z < -2225.0f) {
|
||||
if (!Gameplay_InCsMode(globalCtx)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 1;
|
||||
Item_Give(globalCtx, ITEM_SONG_MINUET);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 1;
|
||||
Item_Give(globalCtx, ITEM_SONG_MINUET);
|
||||
} else {
|
||||
GivePlayerRandoRewardSheikSong(this, globalCtx, RC_SHEIK_IN_FOREST, 1, GI_MINUET_OF_FOREST);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -321,10 +346,15 @@ s32 EnXc_BoleroCS(EnXc* this, GlobalContext* globalCtx) {
|
|||
if ((posRot->pos.x > -784.0f) && (posRot->pos.x < -584.0f) && (posRot->pos.y > 447.0f) &&
|
||||
(posRot->pos.y < 647.0f) && (posRot->pos.z > -446.0f) && (posRot->pos.z < -246.0f) &&
|
||||
!Gameplay_InCsMode(globalCtx)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gDeathMountainCraterBoleroCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 2;
|
||||
Item_Give(globalCtx, ITEM_SONG_BOLERO);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gDeathMountainCraterBoleroCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 2;
|
||||
Item_Give(globalCtx, ITEM_SONG_BOLERO);
|
||||
} else {
|
||||
GivePlayerRandoRewardSheikSong(this, globalCtx, RC_SHEIK_IN_CRATER, 2, GI_BOLERO_OF_FIRE);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -333,6 +363,11 @@ s32 EnXc_BoleroCS(EnXc* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnXc_SetupSerenadeAction(EnXc* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
this->action = SHEIK_ACTION_SERENADE;
|
||||
return;
|
||||
}
|
||||
|
||||
// Player is adult and does not have iron boots and has not learned Serenade
|
||||
if ((!CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4)) && LINK_IS_ADULT) {
|
||||
this->action = SHEIK_ACTION_SERENADE;
|
||||
|
@ -348,12 +383,19 @@ s32 EnXc_SerenadeCS(EnXc* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 stateFlags = player->stateFlags1;
|
||||
|
||||
if (CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4) && !(stateFlags & 0x20000000) &&
|
||||
if (((CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !gSaveContext.n64ddFlag) ||
|
||||
(Flags_GetTreasure(globalCtx, 2) && gSaveContext.n64ddFlag)) &&
|
||||
!(gSaveContext.eventChkInf[5] & 4) && !(stateFlags & 0x20000000) &&
|
||||
!Gameplay_InCsMode(globalCtx)) {
|
||||
Cutscene_SetSegment(globalCtx, &gIceCavernSerenadeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 4; // Learned Serenade of Water Flag
|
||||
Item_Give(globalCtx, ITEM_SONG_SERENADE);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Cutscene_SetSegment(globalCtx, &gIceCavernSerenadeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
gSaveContext.eventChkInf[5] |= 4; // Learned Serenade of Water Flag
|
||||
Item_Give(globalCtx, ITEM_SONG_SERENADE);
|
||||
} else {
|
||||
GivePlayerRandoRewardSheikSong(this, globalCtx, RC_SHEIK_IN_ICE_CAVERN, 4, GI_SERENADE_OF_WATER);
|
||||
return false;
|
||||
}
|
||||
osSyncPrintf("ブーツを取った!!!!!!!!!!!!!!!!!!\n");
|
||||
return true;
|
||||
}
|
||||
|
@ -2151,12 +2193,19 @@ void EnXc_InitTempleOfTime(EnXc* this, GlobalContext* globalCtx) {
|
|||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimeFirstAdultCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
func_80B3EBF0(this, globalCtx);
|
||||
} else if (!(gSaveContext.eventChkInf[5] & 0x20) && (gSaveContext.eventChkInf[4] & 0x100)) {
|
||||
gSaveContext.eventChkInf[5] |= 0x20;
|
||||
Item_Give(globalCtx, ITEM_SONG_PRELUDE);
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimePreludeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->action = SHEIK_ACTION_30;
|
||||
} else if ((!(gSaveContext.eventChkInf[5] & 0x20) && (gSaveContext.eventChkInf[4] & 0x100) &&
|
||||
!gSaveContext.n64ddFlag) ||
|
||||
(!(gSaveContext.eventChkInf[5] & 0x20) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
|
||||
gSaveContext.n64ddFlag)) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
gSaveContext.eventChkInf[5] |= 0x20;
|
||||
Item_Give(globalCtx, ITEM_SONG_PRELUDE);
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimePreludeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->action = SHEIK_ACTION_30;
|
||||
} else {
|
||||
GivePlayerRandoRewardSheikSong(this, globalCtx, RC_SHEIK_AT_TEMPLE, 0x20, GI_PRELUDE_OF_LIGHT);
|
||||
}
|
||||
} else if (!(gSaveContext.eventChkInf[5] & 0x20)) {
|
||||
func_80B3C9EC(this);
|
||||
} else {
|
||||
|
@ -2294,6 +2343,14 @@ void EnXc_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
EnXc* this = (EnXc*)thisx;
|
||||
s32 action = this->action;
|
||||
|
||||
if (this->actor.params == SHEIK_TYPE_9) {
|
||||
if (gSaveContext.n64ddFlag && LINK_IS_ADULT) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && !(gSaveContext.eventChkInf[5] & 0x20)) {
|
||||
GivePlayerRandoRewardSheikSong(this, globalCtx, RC_SHEIK_AT_TEMPLE, 0x20, GI_PRELUDE_OF_LIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((action < 0) || (action >= ARRAY_COUNT(sActionFuncs)) || (sActionFuncs[action] == NULL)) {
|
||||
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
|
||||
} else {
|
||||
|
|
|
@ -227,10 +227,27 @@ u16 EnZl4_GetText(GlobalContext* globalCtx, Actor* thisx) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
void GivePlayerRandoRewardZeldaChild(EnZl4* zelda, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
if (zelda->actor.parent != NULL && zelda->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1E)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1E) && !GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA) && Actor_TextboxIsClosing(&zelda->actor, globalCtx) &&
|
||||
(globalCtx->msgCtx.textId == 0x703C || globalCtx->msgCtx.textId == 0x703D)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
func_8002F434(&zelda->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
} else if (Flags_GetTreasure(globalCtx, 0x1E) && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.eventChkInf[4] |= 1;
|
||||
}
|
||||
}
|
||||
|
||||
s16 func_80B5B9B0(GlobalContext* globalCtx, Actor* thisx) {
|
||||
EnZl4* this = (EnZl4*)thisx;
|
||||
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -372,6 +389,12 @@ void EnZl4_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.textId = -1;
|
||||
this->eyeExpression = this->mouthExpression = ZL4_MOUTH_NEUTRAL;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0);
|
||||
this->actionFunc = EnZl4_Idle;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gSaveContext.sceneSetupIndex >= 4) {
|
||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0);
|
||||
this->actionFunc = EnZl4_TheEnd;
|
||||
|
@ -389,6 +412,7 @@ void EnZl4_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->csState = ZL4_CS_LEGEND;
|
||||
this->talkState = 0;
|
||||
}
|
||||
|
||||
this->actionFunc = EnZl4_Cutscene;
|
||||
}
|
||||
}
|
||||
|
@ -434,6 +458,7 @@ s32 EnZl4_CsWaitForPlayer(EnZl4* this, GlobalContext* globalCtx) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
playerx->world.pos = this->actor.world.pos;
|
||||
rotY = this->actor.shape.rot.y;
|
||||
playerx->world.pos.x += 56.0f * Math_SinS(rotY);
|
||||
|
@ -1196,7 +1221,13 @@ void EnZl4_Cutscene(EnZl4* this, GlobalContext* globalCtx) {
|
|||
void EnZl4_Idle(EnZl4* this, GlobalContext* globalCtx) {
|
||||
func_800343CC(globalCtx, &this->actor, &this->unk_1E0.unk_00, this->collider.dim.radius + 60.0f, EnZl4_GetText,
|
||||
func_80B5B9B0);
|
||||
|
||||
func_80B5BB78(this, globalCtx);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoRewardZeldaChild(this, globalCtx, RC_HC_ZELDAS_LETTER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void EnZl4_TheEnd(EnZl4* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -145,6 +145,7 @@ static f32 D_80B7A668 = 0.0f;
|
|||
|
||||
static u8 sSinkingLureLocation = 0;
|
||||
|
||||
/// Weight of caught fish.
|
||||
static f32 D_80B7A670 = 0.0f;
|
||||
|
||||
static u8 D_80B7A674 = true;
|
||||
|
@ -2885,6 +2886,37 @@ void Fishing_HandleAquariumDialog(Fishing* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
f32 Fishing_GetMinimumRequiredScore() {
|
||||
int32_t weight;
|
||||
// RANDOTODO: update the enhancement sliders to not allow
|
||||
// values above rando fish weight values when rando'd
|
||||
if(sLinkAge == 1) {
|
||||
weight = CVar_GetS32("gChildMinimumWeightFish", 10);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (weight > 8) {
|
||||
weight = 8;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
weight = CVar_GetS32("gAdultMinimumWeightFish", 13);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (weight > 10) {
|
||||
weight = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sqrt(((f32)weight - 0.5f) / 0.0036f);
|
||||
}
|
||||
|
||||
bool getInstantFish() {
|
||||
return CVar_GetS32("gInstantFishing", 0);
|
||||
}
|
||||
|
||||
bool getGuaranteeBite() {
|
||||
return CVar_GetS32("gGuaranteeFishingBite", 0);
|
||||
}
|
||||
|
||||
void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
s16 i;
|
||||
s16 sp134 = 10;
|
||||
|
@ -3383,8 +3415,8 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
if (D_80B7E0B6 == 2) {
|
||||
sp11C *= 5.0f;
|
||||
}
|
||||
|
||||
if (((this->unk_17A[0] == 1) || (Rand_ZeroOne() < sp11C)) &&
|
||||
if (getGuaranteeBite() == 1 ||
|
||||
((this->unk_17A[0] == 1) || (Rand_ZeroOne() < sp11C)) &&
|
||||
((Rand_ZeroOne() < (this->unk_1A8 * multiplier)) || ((this->unk_150 + 1) == KREG(69)))) {
|
||||
if (this->unk_150 == 0) {
|
||||
this->unk_158 = 3;
|
||||
|
@ -3826,7 +3858,7 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
D_80B7E0A6 = 50;
|
||||
D_80B7E11C = 0.5f;
|
||||
this->unk_152 = 0;
|
||||
} else if (this->actor.xzDistToPlayer < (KREG(59) + 50.0f)) {
|
||||
} else if (this->actor.xzDistToPlayer < (KREG(59) + 50.0f) || getInstantFish() == 1) {
|
||||
this->unk_158 = 6;
|
||||
this->unk_17A[0] = 100;
|
||||
player->unk_860 = 3;
|
||||
|
@ -3905,10 +3937,15 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
sp10C.y = -10.0f;
|
||||
sp10C.z = 5.0f;
|
||||
Matrix_MultVec3f(&sp10C, &sp100);
|
||||
Math_ApproachF(&this->actor.world.pos.x, player->bodyPartsPos[15].x + sp100.x, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.y, player->bodyPartsPos[15].y + sp100.y, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.z, player->bodyPartsPos[15].z + sp100.z, 1.0f, 6.0f);
|
||||
|
||||
if (getInstantFish() == 0) {
|
||||
Math_ApproachF(&this->actor.world.pos.x, player->bodyPartsPos[15].x + sp100.x, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.y, player->bodyPartsPos[15].y + sp100.y, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.z, player->bodyPartsPos[15].z + sp100.z, 1.0f, 6.0f);
|
||||
} else {
|
||||
this->actor.world.pos.x = player->bodyPartsPos[15].x + sp100.x;
|
||||
this->actor.world.pos.y = player->bodyPartsPos[15].y + sp100.y;
|
||||
this->actor.world.pos.z = player->bodyPartsPos[15].z + sp100.z;
|
||||
}
|
||||
D_80B7E144 = 188.0f;
|
||||
|
||||
if (this->unk_17A[0] <= 50) {
|
||||
|
@ -4880,7 +4917,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
|||
if (D_80B7A670 == 0.0f) {
|
||||
this->actor.textId = 0x408C;
|
||||
this->unk_15C = 20;
|
||||
} else if (D_80B7E07C == 0) {
|
||||
} else if (D_80B7E07C == 0 && !gSaveContext.n64ddFlag) {
|
||||
D_80B7A678 = D_80B7A670;
|
||||
if ((s16)D_80B7E078 < (s16)D_80B7A670) {
|
||||
if (D_80B7E07E == 2) {
|
||||
|
@ -4893,10 +4930,14 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
|||
this->actor.textId = 0x408B;
|
||||
this->unk_15C = 20;
|
||||
}
|
||||
} else {
|
||||
} else if (!gSaveContext.n64ddFlag) {
|
||||
this->actor.textId = 0x409B;
|
||||
this->unk_15C = 11;
|
||||
}
|
||||
else {
|
||||
this->actor.textId = 0x4086;
|
||||
this->unk_15C = 11;
|
||||
}
|
||||
Message_ContinueTextbox(globalCtx, this->actor.textId);
|
||||
break;
|
||||
case 1:
|
||||
|
@ -4998,16 +5039,24 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (sLinkAge == 1) {
|
||||
if ((D_80B7E078 >= 50.0f) && !(HIGH_SCORE(HS_FISHING) & 0x400)) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x400;
|
||||
getItemId = GI_HEART_PIECE;
|
||||
sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1;
|
||||
if (!(HIGH_SCORE(HS_FISHING) & 0x400)) {
|
||||
if (D_80B7E078 >= Fishing_GetMinimumRequiredScore()) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x400;
|
||||
sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1;
|
||||
getItemId = gSaveContext.n64ddFlag ?
|
||||
GetRandomizedItemIdFromKnownCheck(RC_LH_CHILD_FISHING, GI_HEART_PIECE) :
|
||||
GI_HEART_PIECE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((D_80B7E078 >= 60.0f) && !(HIGH_SCORE(HS_FISHING) & 0x800)) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x800;
|
||||
getItemId = GI_SCALE_GOLD;
|
||||
sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1;
|
||||
if (!(HIGH_SCORE(HS_FISHING) & 0x800)) {
|
||||
if (D_80B7E078 >= Fishing_GetMinimumRequiredScore()) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x800;
|
||||
sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1;
|
||||
getItemId = gSaveContext.n64ddFlag ?
|
||||
GetRandomizedItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD) :
|
||||
GI_SCALE_GOLD;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -5053,6 +5102,16 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE) {
|
||||
this->unk_15C = 0;
|
||||
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (gSaveContext.temporaryWeapon) {
|
||||
player->currentSwordItem = ITEM_NONE;
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
|
||||
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
|
||||
gSaveContext.temporaryWeapon = false;
|
||||
}
|
||||
|
||||
if (D_80B7A68C != 0) {
|
||||
D_80B7A688 = 1;
|
||||
D_80B7A68C = 0;
|
||||
|
@ -5067,13 +5126,20 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) {
|
|||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->unk_15C = 24;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_GOLD, 2000.0f, 1000.0f);
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, GI_SCALE_GOLD, 2000.0f, 1000.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
GetRandomizedItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD), 2000.0f,
|
||||
1000.0f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 24:
|
||||
D_80B7A674 = false;
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) ||
|
||||
(gSaveContext.n64ddFlag && GET_PLAYER(globalCtx)->getItemId == GI_ICE_TRAP)) {
|
||||
if (D_80B7E07C == 0) {
|
||||
this->unk_15C = 0;
|
||||
} else {
|
||||
|
|
|
@ -59,7 +59,12 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Flags_SetCollectible(globalCtx, 0x1F);
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_CONTAINER_2, 30.0f, 40.0f);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 40.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_CONTAINER_2, 30.0f, 40.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,18 +98,23 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
actorIt = actorIt->next;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGiHeartBorderDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGiHeartContainerDL);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GetItem_Draw(globalCtx,
|
||||
GetItemModelFromId(GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum)));
|
||||
} else {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGiHeartBorderDL);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGiHeartContainerDL);
|
||||
if (flag) {
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGiHeartBorderDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGiHeartContainerDL);
|
||||
} else {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGiHeartBorderDL);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGiHeartContainerDL);
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
|
|
@ -82,7 +82,8 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
case ITEM_ETC_LETTER:
|
||||
Actor_SetScale(&this->actor, 0.5f);
|
||||
this->futureActionFunc = func_80B858B4;
|
||||
if (gSaveContext.eventChkInf[3] & 2) {
|
||||
if ((gSaveContext.eventChkInf[3] & 2 && !gSaveContext.n64ddFlag) ||
|
||||
(gSaveContext.n64ddFlag && Flags_GetTreasure(globalCtx, 0x1E))) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
break;
|
||||
|
@ -119,13 +120,24 @@ void func_80B857D0(ItemEtcetera* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80B85824(ItemEtcetera* this, GlobalContext* globalCtx) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if ((this->actor.params & 0xFF) == 7) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->actor.params & 0xFF) == 1) {
|
||||
gSaveContext.eventChkInf[3] |= 2;
|
||||
Flags_SetSwitch(globalCtx, 0xB);
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 50.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,10 +146,22 @@ void func_80B858B4(ItemEtcetera* this, GlobalContext* globalCtx) {
|
|||
if ((this->actor.params & 0xFF) == 1) {
|
||||
gSaveContext.eventChkInf[3] |= 2;
|
||||
Flags_SetSwitch(globalCtx, 0xB);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Flags_SetTreasure(globalCtx, 0x1E);
|
||||
}
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f);
|
||||
if (0) {} // Necessary to match
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO);
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 50.0f);
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f);
|
||||
}
|
||||
|
||||
if ((globalCtx->gameplayFrames & 0xD) == 0) {
|
||||
EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f);
|
||||
}
|
||||
|
@ -203,12 +227,42 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
|
||||
if(gSaveContext.n64ddFlag && globalCtx->sceneNum == 16) {
|
||||
s32 randoGetItemId = GetChestGameRandoGetItemId(this->actor.room, this->giDrawId, globalCtx);
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
if (randoGetItemId != GI_NONE) {
|
||||
GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
GetItem_Draw(globalCtx, this->giDrawId);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ItemEtcetera* this = (ItemEtcetera*)thisx;
|
||||
s32 type = this->actor.params & 0xFF;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 randoGetItemId = GI_NONE;
|
||||
if (type == ITEM_ETC_ARROW_FIRE) {
|
||||
randoGetItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE);
|
||||
} else if (type == ITEM_ETC_LETTER) {
|
||||
randoGetItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO);
|
||||
}
|
||||
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
|
||||
if (randoGetItemId != GI_NONE) {
|
||||
this->giDrawId = GetItemModelFromId(randoGetItemId);
|
||||
}
|
||||
}
|
||||
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
|
|
|
@ -169,8 +169,16 @@ void ItemOcarina_DoNothing(ItemOcarina* this, GlobalContext* globalCtx) {
|
|||
|
||||
void ItemOcarina_StartSoTCutscene(ItemOcarina* this, GlobalContext* globalCtx) {
|
||||
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gHyruleFieldZeldaSongOfTimeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gHyruleFieldZeldaSongOfTimeCs);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
} else {
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 3;
|
||||
gSaveContext.nextTransition = 3;
|
||||
globalCtx->nextEntranceIndex = 0x050F;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +189,11 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = ItemOcarina_StartSoTCutscene;
|
||||
this->actor.draw = NULL;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_OCARINA_OOT, 30.0f, 50.0f);
|
||||
func_8002F434(&this->actor, globalCtx,
|
||||
gSaveContext.n64ddFlag
|
||||
? GetRandomizedItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT)
|
||||
: GI_OCARINA_OOT,
|
||||
30.0f, 50.0f);
|
||||
|
||||
if ((globalCtx->gameplayFrames & 13) == 0) {
|
||||
EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f);
|
||||
|
@ -200,5 +212,15 @@ void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
func_8002EBCC(thisx, globalCtx, 0);
|
||||
func_8002ED80(thisx, globalCtx, 0);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 randoGetItemId = GetRandomizedItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT);
|
||||
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
|
||||
}
|
||||
GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId));
|
||||
return;
|
||||
}
|
||||
|
||||
GetItem_Draw(globalCtx, GID_OCARINA_TIME);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,8 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) {
|
|||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
osSyncPrintf(VT_FGCOL(CYAN) "SHOT_SUN HIT!!!!!!!\n" VT_RST);
|
||||
if (INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE) {
|
||||
if ((INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE && !gSaveContext.n64ddFlag) ||
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_ETCETERA, 700.0f, -800.0f, 7261.0f, 0, 0, 0, 7);
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gLakeHyliaFireArrowsCS);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
|
|
|
@ -555,7 +555,7 @@ static GetItemEntry sGetItemTable[] = {
|
|||
GET_ITEM(ITEM_SCALE_GOLDEN, OBJECT_GI_SCALE, GID_SCALE_GOLDEN, 0xCE, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_STONE_OF_AGONY, OBJECT_GI_MAP, GID_STONE_OF_AGONY, 0x68, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_GERUDO_CARD, OBJECT_GI_GERUDO, GID_GERUDO_CARD, 0x7B, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_OCARINA_FAIRY, OBJECT_GI_OCARINA_0, GID_OCARINA_FAIRY, 0x3A, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_OCARINA_FAIRY, OBJECT_GI_OCARINA_0, GID_OCARINA_FAIRY, 0x4A, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SEEDS, OBJECT_GI_SEED, GID_SEEDS, 0xDC, 0x50, CHEST_ANIM_SHORT),
|
||||
GET_ITEM(ITEM_HEART_CONTAINER, OBJECT_GI_HEARTS, GID_HEART_CONTAINER, 0xC6, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_HEART_PIECE_2, OBJECT_GI_HEARTS, GID_HEART_PIECE, 0xC2, 0x80, CHEST_ANIM_LONG),
|
||||
|
@ -620,6 +620,48 @@ static GetItemEntry sGetItemTable[] = {
|
|||
GET_ITEM(ITEM_NUT_UPGRADE_30, OBJECT_GI_NUTS, GID_NUTS, 0xA7, 0x80, CHEST_ANIM_SHORT),
|
||||
GET_ITEM(ITEM_NUT_UPGRADE_40, OBJECT_GI_NUTS, GID_NUTS, 0xA8, 0x80, CHEST_ANIM_SHORT),
|
||||
GET_ITEM(ITEM_BULLET_BAG_50, OBJECT_GI_DEKUPOUCH, GID_BULLET_BAG_50, 0x6C, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_ARROW_ICE, OBJECT_GI_M_ARROW, GID_ARROW_ICE, 0x3C, 0x80, CHEST_ANIM_LONG), // Ice Traps
|
||||
GET_ITEM_NONE,
|
||||
|
||||
GET_ITEM(ITEM_MEDALLION_LIGHT, OBJECT_GI_MEDAL, GID_MEDALLION_LIGHT, 0x40, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_MEDALLION_FOREST, OBJECT_GI_MEDAL, GID_MEDALLION_FOREST, 0x3E, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_MEDALLION_FIRE, OBJECT_GI_MEDAL, GID_MEDALLION_FIRE, 0x3C, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_MEDALLION_WATER, OBJECT_GI_MEDAL, GID_MEDALLION_WATER, 0x3D, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_MEDALLION_SHADOW, OBJECT_GI_MEDAL, GID_MEDALLION_SHADOW, 0x41, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_MEDALLION_SPIRIT, OBJECT_GI_MEDAL, GID_MEDALLION_SPIRIT, 0x3F, 0x80, CHEST_ANIM_LONG),
|
||||
|
||||
GET_ITEM(ITEM_KOKIRI_EMERALD, OBJECT_GI_JEWEL, GID_KOKIRI_EMERALD, 0x80, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_GORON_RUBY, OBJECT_GI_JEWEL, GID_GORON_RUBY, 0x81, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_ZORA_SAPPHIRE, OBJECT_GI_JEWEL, GID_ZORA_SAPPHIRE, 0x82, 0x80, CHEST_ANIM_LONG),
|
||||
|
||||
GET_ITEM(ITEM_SONG_LULLABY, OBJECT_GI_MELODY, GID_SONG_ZELDA, 0xD4, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_SUN, OBJECT_GI_MELODY, GID_SONG_SUN, 0xD3, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_EPONA, OBJECT_GI_MELODY, GID_SONG_EPONA, 0xD2, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_STORMS, OBJECT_GI_MELODY, GID_SONG_STORM, 0xD6, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_TIME, OBJECT_GI_MELODY, GID_SONG_TIME, 0xD5, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_SARIA, OBJECT_GI_MELODY, GID_SONG_SARIA, 0xD1, 0x80, CHEST_ANIM_LONG),
|
||||
|
||||
GET_ITEM(ITEM_SONG_MINUET, OBJECT_GI_MELODY, GID_SONG_MINUET, 0x73, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_BOLERO, OBJECT_GI_MELODY, GID_SONG_BOLERO, 0x74, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_SERENADE, OBJECT_GI_MELODY, GID_SONG_SERENADE, 0x75, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_NOCTURNE, OBJECT_GI_MELODY, GID_SONG_NOCTURNE, 0x77, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_REQUIEM, OBJECT_GI_MELODY, GID_SONG_REQUIEM, 0x76, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_SONG_PRELUDE, OBJECT_GI_MELODY, GID_SONG_PRELUDE, 0x78, 0x80, CHEST_ANIM_LONG),
|
||||
|
||||
GET_ITEM(ITEM_SINGLE_MAGIC, OBJECT_GI_MAGICPOT, GID_MAGIC_SMALL, 0xE4, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_DOUBLE_MAGIC, OBJECT_GI_MAGICPOT, GID_MAGIC_LARGE, 0xE8, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_DOUBLE_DEFENSE, OBJECT_GI_HEARTS, GID_HEART_CONTAINER, 0xE9, 0x80, CHEST_ANIM_LONG),
|
||||
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_RED_POTION, OBJECT_GI_LIQUID, GID_POTION_RED, 0x43, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_GREEN_POTION, OBJECT_GI_LIQUID, GID_POTION_GREEN, 0x44, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_BLUE_POTION, OBJECT_GI_LIQUID, GID_POTION_BLUE, 0x45, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_FAIRY, OBJECT_GI_BOTTLE, GID_BOTTLE, 0x46, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_FISH, OBJECT_GI_FISH, GID_FISH, 0x47, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_BLUE_FIRE, OBJECT_GI_FIRE, GID_BLUE_FIRE, 0x5D, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_BUGS, OBJECT_GI_INSECT, GID_BUG, 0x7A, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_POE, OBJECT_GI_GHOST, GID_POE, 0x97, 0x80, CHEST_ANIM_LONG),
|
||||
GET_ITEM(ITEM_BOTTLE_WITH_BIG_POE, OBJECT_GI_GHOST, GID_BIG_POE, 0xF9, 0x80, CHEST_ANIM_LONG),
|
||||
|
||||
GET_ITEM_NONE,
|
||||
GET_ITEM_NONE,
|
||||
};
|
||||
|
@ -3561,7 +3603,7 @@ s32 func_80837B18_modified(GlobalContext* globalCtx, Player* this, s32 damage, u
|
|||
s32 modifiedDamage = damage;
|
||||
if (modified)
|
||||
{
|
||||
modifiedDamage *= CVar_GetS32("gDamageMul", 1);
|
||||
modifiedDamage *= (1 << CVar_GetS32("gDamageMul", 0));
|
||||
}
|
||||
|
||||
return Health_ChangeBy(globalCtx, modifiedDamage);
|
||||
|
@ -3794,7 +3836,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->unk_A86 != 0) {
|
||||
if (!Player_InBlockingCsMode(globalCtx, this)) {
|
||||
Player_InflictDamageModified(globalCtx, -16 * CVar_GetS32("gVoidDamageMul", 1), false);
|
||||
Player_InflictDamageModified(globalCtx, -16 * (1 << CVar_GetS32("gVoidDamageMul", 0)), false);
|
||||
this->unk_A86 = 0;
|
||||
}
|
||||
}
|
||||
|
@ -6208,12 +6250,29 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
|
|||
|
||||
iREG(67) = false;
|
||||
|
||||
if (gSaveContext.n64ddFlag && this->getItemId == GI_ICE_TRAP) {
|
||||
this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11);
|
||||
this->actor.colChkInfo.damage = 0;
|
||||
func_80837C0C(globalCtx, this, 3, 0.0f, 0.0f, 0, 20);
|
||||
return;
|
||||
}
|
||||
|
||||
s32 drop = giEntry->objectId;
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_BOWLING) || !(CVar_GetS32("gFastDrops", 0) &&
|
||||
if (gSaveContext.n64ddFlag || (globalCtx->sceneNum == SCENE_BOWLING) || !(CVar_GetS32("gFastDrops", 0) &&
|
||||
((drop == OBJECT_GI_BOMB_1) || (drop == OBJECT_GI_NUTS) || (drop == OBJECT_GI_STICK) ||
|
||||
(drop == OBJECT_GI_SEED) || (drop == OBJECT_GI_MAGICPOT) || (drop == OBJECT_GI_ARROW))) &&
|
||||
(Item_CheckObtainability(giEntry->itemId) == ITEM_NONE)) {
|
||||
|
||||
if (gSaveContext.n64ddFlag &&
|
||||
((interactedActor->id == ACTOR_EN_ITEM00 &&
|
||||
(interactedActor->params != 6 && interactedActor->params != 17)) ||
|
||||
(interactedActor->id == ACTOR_EN_KAREBABA || interactedActor->id == ACTOR_EN_DEKUBABA))) {
|
||||
func_8083E4C4(globalCtx, this, giEntry);
|
||||
this->getItemId = GI_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
func_808323B4(globalCtx, this);
|
||||
func_8083AE40(this, giEntry->objectId);
|
||||
|
||||
|
@ -6231,13 +6290,12 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
|
|||
func_8083E4C4(globalCtx, this, giEntry);
|
||||
this->getItemId = GI_NONE;
|
||||
}
|
||||
}
|
||||
else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) &&
|
||||
!(this->stateFlags2 & PLAYER_STATE2_10)) {
|
||||
} else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) &&
|
||||
!(this->stateFlags2 & PLAYER_STATE2_10)) {
|
||||
if (this->getItemId != GI_NONE) {
|
||||
GetItemEntry* giEntry = &sGetItemTable[-this->getItemId - 1];
|
||||
EnBox* chest = (EnBox*)interactedActor;
|
||||
if(CVar_GetS32("gFastChests", 0) != 0) {
|
||||
if (CVar_GetS32("gFastChests", 0) != 0) {
|
||||
giEntry->gi = -1 * abs(giEntry->gi);
|
||||
}
|
||||
|
||||
|
@ -6265,8 +6323,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
|
|||
func_80832F54(globalCtx, this, 0x28F);
|
||||
chest->unk_1F4 = 1;
|
||||
Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, 0), CAM_SET_SLOW_CHEST_CS);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
func_80832264(globalCtx, this, &gPlayerAnim_002DF8);
|
||||
chest->unk_1F4 = -1;
|
||||
}
|
||||
|
@ -6286,12 +6343,10 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
|
|||
if (sp24 == PLAYER_AP_SWORD_MASTER) {
|
||||
this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_AP_LAST_USED);
|
||||
func_8083399C(globalCtx, this, PLAYER_AP_LAST_USED);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
func_80835F44(globalCtx, this, ITEM_LAST_USED);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
s32 strength = Player_GetStrength();
|
||||
|
||||
if ((interactedActor->id == ACTOR_EN_ISHI) && ((interactedActor->params & 0xF) == 1) &&
|
||||
|
@ -8352,7 +8407,7 @@ s32 func_80843E64(GlobalContext* globalCtx, Player* this) {
|
|||
|
||||
impactInfo = &D_80854600[impactIndex];
|
||||
|
||||
if (Player_InflictDamageModified(globalCtx, impactInfo->damage * CVar_GetS32("gFallDamageMul", 1), false)) {
|
||||
if (Player_InflictDamageModified(globalCtx, impactInfo->damage * (1 << CVar_GetS32("gFallDamageMul", 0)), false)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -12596,6 +12651,12 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) {
|
|||
giEntry = &sGetItemTable[this->getItemId - 1];
|
||||
this->unk_84F = 1;
|
||||
|
||||
// make sure we get the BGS instead of giant's knife
|
||||
if(this->getItemId == GI_SWORD_BGS) {
|
||||
gSaveContext.bgsFlag = 1;
|
||||
gSaveContext.swordHealth = 8;
|
||||
}
|
||||
|
||||
Message_StartTextbox(globalCtx, giEntry->textId, &this->actor);
|
||||
Item_Give(globalCtx, giEntry->itemId);
|
||||
|
||||
|
@ -12619,7 +12680,7 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) {
|
|||
}
|
||||
else {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
|
||||
if (this->getItemId == GI_GAUNTLETS_SILVER) {
|
||||
if (this->getItemId == GI_GAUNTLETS_SILVER && !gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x0123;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
|
@ -15018,6 +15079,17 @@ s32 Player_IsDroppingFish(GlobalContext* globalCtx) {
|
|||
s32 Player_StartFishing(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
if (gSaveContext.linkAge == 1) {
|
||||
if (!CHECK_OWNED_EQUIP(EQUIP_SWORD, 0)) {
|
||||
gSaveContext.temporaryWeapon = true;
|
||||
}
|
||||
if (this->heldItemId == ITEM_NONE) {
|
||||
this->currentSwordItem = ITEM_SWORD_KOKIRI;
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
|
||||
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI);
|
||||
}
|
||||
}
|
||||
|
||||
func_80832564(globalCtx, this);
|
||||
func_80835F44(globalCtx, this, ITEM_FISHING_POLE);
|
||||
return 1;
|
||||
|
|
|
@ -203,6 +203,11 @@ void FileChoose_DrawOptions(GameState* thisx);
|
|||
void FileChoose_DrawNameEntry(GameState* thisx);
|
||||
void FileChoose_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx);
|
||||
|
||||
void HandleMouseInput(Input* input);
|
||||
u8 HandleMouseCursor(FileChooseContext* this, Input* input, int minx, int miny, int maxx, int maxy);
|
||||
Vec2f HandleMouseCursorSplit(FileChooseContext* this, Input* input, int minx, int miny, int maxx, int maxy, int countx,
|
||||
int county);
|
||||
|
||||
extern s16 D_808123F0[];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,13 +4,165 @@
|
|||
|
||||
#include "textures/title_static/title_static.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
|
||||
#include <textures/icon_item_static/icon_item_static.h>
|
||||
#include "soh/frame_interpolation.h"
|
||||
|
||||
static s16 sUnused = 106;
|
||||
|
||||
static s16 sScreenFillAlpha = 255;
|
||||
|
||||
unsigned char gFileSelRANDButtonTex[] = {
|
||||
0x0, 0x0, 0x75, 0x73, 0xfa, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7,
|
||||
0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff,
|
||||
0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7,
|
||||
0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff,
|
||||
0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xe0, 0xff, 0x51, 0x7f, 0x0, 0x0, 0x5e, 0x5c, 0xff, 0xff, 0xff, 0xff, 0xf7,
|
||||
0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff,
|
||||
0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7,
|
||||
0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff,
|
||||
0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xa0,
|
||||
0xff, 0xa0, 0xff, 0x51, 0x7f, 0xe2, 0xff, 0xf7, 0xff, 0xf2, 0xff, 0x90, 0xff, 0x97, 0xff, 0x9d, 0xff, 0xa3, 0xff,
|
||||
0xa9, 0xff, 0xb0, 0xff, 0xb6, 0xff, 0xbc, 0xff, 0xc3, 0xff, 0xca, 0xff, 0xd0, 0xff, 0xd3, 0xff, 0xce, 0xff, 0xca,
|
||||
0xff, 0xc5, 0xff, 0xc1, 0xff, 0xbc, 0xff, 0xb8, 0xff, 0xb4, 0xff, 0xaf, 0xff, 0xab, 0xff, 0xa7, 0xff, 0xa2, 0xff,
|
||||
0x9e, 0xff, 0x9a, 0xff, 0x95, 0xff, 0x91, 0xff, 0x8c, 0xff, 0x88, 0xff, 0x84, 0xff, 0x80, 0xff, 0x7c, 0xff, 0x77,
|
||||
0xff, 0x75, 0xff, 0x7f, 0xff, 0x8a, 0xff, 0x95, 0xff, 0xa1, 0xff, 0xa2, 0xff, 0x93, 0xff, 0x59, 0xff, 0xd2, 0xff,
|
||||
0xd8, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x97, 0xff, 0x9d, 0xff, 0xa3, 0xff, 0xa9, 0xff, 0xb0, 0xff, 0xb6, 0xff, 0x9a,
|
||||
0xff, 0x81, 0xff, 0x86, 0xff, 0x8a, 0xff, 0x8d, 0xff, 0xa2, 0xff, 0xca, 0xff, 0xc5, 0xff, 0xc1, 0xff, 0xbc, 0xff,
|
||||
0xb8, 0xff, 0xb4, 0xff, 0xaf, 0xff, 0xab, 0xff, 0xa7, 0xff, 0xa2, 0xff, 0x9e, 0xff, 0x9a, 0xff, 0x95, 0xff, 0x91,
|
||||
0xff, 0x8c, 0xff, 0x88, 0xff, 0x84, 0xff, 0x80, 0xff, 0x7c, 0xff, 0x77, 0xff, 0x75, 0xff, 0x63, 0xff, 0x8a, 0xff,
|
||||
0x95, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x47, 0xff, 0x3a, 0xff, 0xd2, 0xff, 0xd2, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x97,
|
||||
0xff, 0x9d, 0xff, 0xa3, 0xff, 0xa9, 0xff, 0xb0, 0xff, 0x95, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
|
||||
0x0, 0xff, 0x0, 0xff, 0x3f, 0xff, 0xe0, 0xff, 0xc1, 0xff, 0xbc, 0xff, 0xb8, 0xff, 0xb4, 0xff, 0xaf, 0xff, 0xab,
|
||||
0xff, 0xa7, 0xff, 0xa2, 0xff, 0x9e, 0xff, 0x9a, 0xff, 0x95, 0xff, 0x91, 0xff, 0x8c, 0xff, 0x88, 0xff, 0x84, 0xff,
|
||||
0x80, 0xff, 0x7c, 0xff, 0x77, 0xff, 0x20, 0xff, 0x0, 0xff, 0xba, 0xff, 0x95, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x3a,
|
||||
0xff, 0x3a, 0xff, 0xd2, 0xff, 0xd2, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x97, 0xff, 0x9d, 0xff, 0xa3, 0xff, 0xa9, 0xff,
|
||||
0xb0, 0xff, 0x83, 0xff, 0x0, 0xff, 0xd, 0xff, 0x4f, 0xff, 0x4f, 0xff, 0x4c, 0xff, 0x4, 0xff, 0x0, 0xff, 0xa5,
|
||||
0xff, 0xc6, 0xff, 0x85, 0xff, 0x5b, 0xff, 0x56, 0xff, 0x70, 0xff, 0xab, 0xff, 0xa7, 0xff, 0x79, 0xff, 0x7e, 0xff,
|
||||
0x51, 0xff, 0x48, 0xff, 0x61, 0xff, 0x8c, 0xff, 0x88, 0xff, 0x84, 0xff, 0x40, 0xff, 0x2d, 0xff, 0x3a, 0xff, 0x1d,
|
||||
0xff, 0x0, 0xff, 0xad, 0xff, 0xb7, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0xd2, 0xff, 0xd2, 0xff,
|
||||
0x8b, 0xff, 0x90, 0xff, 0x55, 0xff, 0x52, 0xff, 0x68, 0xff, 0x7e, 0xff, 0xb0, 0xff, 0x83, 0xff, 0x0, 0xff, 0x21,
|
||||
0xff, 0xf8, 0xff, 0xd6, 0xff, 0xd9, 0xff, 0x47, 0xff, 0x0, 0xff, 0x89, 0xff, 0x40, 0xff, 0x0, 0xff, 0x0, 0xff,
|
||||
0x0, 0xff, 0x0, 0xff, 0x2c, 0xff, 0xa0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x3b,
|
||||
0xff, 0xc1, 0xff, 0xf, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xad, 0xff, 0xb7, 0xff,
|
||||
0xa1, 0xff, 0xb0, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0xd2, 0xff, 0xd2, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x3d, 0xff, 0x37,
|
||||
0xff, 0x60, 0xff, 0x7e, 0xff, 0xb0, 0xff, 0x83, 0xff, 0x0, 0xff, 0x1, 0xff, 0x2d, 0xff, 0x28, 0xff, 0x24, 0xff,
|
||||
0x0, 0xff, 0x0, 0xff, 0xd1, 0xff, 0x15, 0xff, 0x15, 0xff, 0xa3, 0xff, 0xa8, 0xff, 0x1f, 0xff, 0x0, 0xff, 0xbc,
|
||||
0xff, 0x0, 0xff, 0x0, 0xff, 0x88, 0xff, 0x95, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa7, 0xff, 0x0, 0xff, 0xd, 0xff,
|
||||
0xa6, 0xff, 0x81, 0xff, 0x0, 0xff, 0x0, 0xff, 0xad, 0xff, 0xb7, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x3a, 0xff, 0x3a,
|
||||
0xff, 0xd2, 0xff, 0xd2, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x44, 0xff, 0x4f, 0xff, 0x8a, 0xff, 0x9e, 0xff, 0xb0, 0xff,
|
||||
0x83, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x4b, 0xff, 0xf5, 0xff, 0x67,
|
||||
0xff, 0x1e, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xbc, 0xff, 0x0, 0xff, 0x26, 0xff, 0xf5, 0xff,
|
||||
0x95, 0xff, 0x14, 0xff, 0x0, 0xff, 0x7d, 0xff, 0x0, 0xff, 0x73, 0xff, 0xd6, 0xff, 0x77, 0xff, 0x16, 0xff, 0x0,
|
||||
0xff, 0xad, 0xff, 0xb7, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0xd2, 0xff, 0xd2, 0xff, 0x8b, 0xff,
|
||||
0x90, 0xff, 0x59, 0xff, 0x67, 0xff, 0x97, 0xff, 0x9b, 0xff, 0xb0, 0xff, 0x83, 0xff, 0x0, 0xff, 0x21, 0xff, 0xc6,
|
||||
0xff, 0xbf, 0xff, 0x83, 0xff, 0x0, 0xff, 0x0, 0xff, 0xd1, 0xff, 0x0, 0xff, 0x0, 0xff, 0x24, 0xff, 0x30, 0xff,
|
||||
0x10, 0xff, 0x0, 0xff, 0xbc, 0xff, 0x0, 0xff, 0x28, 0xff, 0xef, 0xff, 0x95, 0xff, 0x14, 0xff, 0x0, 0xff, 0x82,
|
||||
0xff, 0x0, 0xff, 0x70, 0xff, 0xc3, 0xff, 0x77, 0xff, 0x19, 0xff, 0x0, 0xff, 0xad, 0xff, 0xb7, 0xff, 0xa1, 0xff,
|
||||
0xb0, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0xd2, 0xff, 0xd2, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x97, 0xff, 0x9d, 0xff, 0xa3,
|
||||
0xff, 0xa9, 0xff, 0xb0, 0xff, 0x83, 0xff, 0x0, 0xff, 0x21, 0xff, 0xf8, 0xff, 0xd0, 0xff, 0xd3, 0xff, 0x2e, 0xff,
|
||||
0x0, 0xff, 0x73, 0xff, 0x0, 0xff, 0x48, 0xff, 0xc5, 0xff, 0x98, 0xff, 0x16, 0xff, 0x0, 0xff, 0xbc, 0xff, 0x0,
|
||||
0xff, 0x28, 0xff, 0xef, 0xff, 0x95, 0xff, 0x14, 0xff, 0x0, 0xff, 0xa8, 0xff, 0x0, 0xff, 0x18, 0xff, 0xa1, 0xff,
|
||||
0x57, 0xff, 0x3, 0xff, 0x0, 0xff, 0xad, 0xff, 0xb7, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0xd2,
|
||||
0xff, 0xd2, 0xff, 0x8b, 0xff, 0x90, 0xff, 0x97, 0xff, 0x9d, 0xff, 0xa3, 0xff, 0xa9, 0xff, 0xb0, 0xff, 0x83, 0xff,
|
||||
0x0, 0xff, 0x21, 0xff, 0xf8, 0xff, 0xd0, 0xff, 0xd3, 0xff, 0x6b, 0xff, 0x0, 0xff, 0x2d, 0xff, 0x1, 0xff, 0x0,
|
||||
0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa8, 0xff, 0x0, 0xff, 0x28, 0xff, 0xef, 0xff, 0x95, 0xff,
|
||||
0x14, 0xff, 0x0, 0xff, 0xc1, 0xff, 0xf, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xad,
|
||||
0xff, 0xb7, 0xff, 0xa1, 0xff, 0xb0, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0xd2, 0xff, 0xc7, 0xff, 0x8b, 0xff, 0x90, 0xff,
|
||||
0x97, 0xff, 0x9d, 0xff, 0xa3, 0xff, 0xa9, 0xff, 0xb0, 0xff, 0xb6, 0xff, 0x5a, 0xff, 0x81, 0xff, 0xf0, 0xff, 0xd0,
|
||||
0xff, 0xd3, 0xff, 0xce, 0xff, 0x61, 0xff, 0x7f, 0xff, 0xee, 0xff, 0x5c, 0xff, 0x48, 0xff, 0x57, 0xff, 0x89, 0xff,
|
||||
0x70, 0xff, 0xfe, 0xff, 0x4d, 0xff, 0x82, 0xff, 0xe1, 0xff, 0x95, 0xff, 0x4b, 0xff, 0x6a, 0xff, 0xf8, 0xff, 0x84,
|
||||
0xff, 0x59, 0xff, 0x43, 0xff, 0x4f, 0xff, 0x86, 0xff, 0x6f, 0xff, 0xfb, 0xff, 0x95, 0xff, 0xa1, 0xff, 0xb0, 0xff,
|
||||
0x3a, 0xff, 0x3a, 0xff, 0xc7, 0xff, 0x84, 0xff, 0x79, 0xff, 0x90, 0xff, 0x97, 0xff, 0x9d, 0xff, 0xa3, 0xff, 0xa9,
|
||||
0xff, 0xb0, 0xff, 0xb6, 0xff, 0xbc, 0xff, 0xc3, 0xff, 0xca, 0xff, 0xd0, 0xff, 0xd3, 0xff, 0xce, 0xff, 0xca, 0xff,
|
||||
0xc5, 0xff, 0xc1, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0xbf, 0xff, 0xb7, 0xff, 0xab, 0xff, 0xa7, 0xff, 0xa2, 0xff, 0x9e,
|
||||
0xff, 0x9a, 0xff, 0x95, 0xff, 0x91, 0xff, 0x8c, 0xff, 0x88, 0xff, 0x84, 0xff, 0x80, 0xff, 0x7c, 0xff, 0x8e, 0xff,
|
||||
0x87, 0xff, 0x7f, 0xff, 0x8a, 0xff, 0x95, 0xff, 0xa1, 0xff, 0x48, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x2d, 0x5c, 0x79,
|
||||
0xff, 0x79, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff,
|
||||
0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a,
|
||||
0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff,
|
||||
0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a,
|
||||
0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x1e, 0x7f, 0x0, 0x0, 0x37, 0x71, 0x4f, 0xff, 0x3a, 0xff, 0x3a, 0xff,
|
||||
0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a,
|
||||
0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff,
|
||||
0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a,
|
||||
0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x3a, 0xff, 0x15, 0x55,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
static Gfx sScreenFillSetupDL[] = {
|
||||
gsDPPipeSync(),
|
||||
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
|
||||
|
@ -161,6 +313,75 @@ void FileChoose_FinishFadeIn(GameState* thisx) {
|
|||
}
|
||||
}
|
||||
|
||||
void SpriteLoad(FileChooseContext* this, Sprite* sprite) {
|
||||
OPEN_DISPS(this->state.gfxCtx);
|
||||
|
||||
if (sprite->im_siz == G_IM_SIZ_16b) {
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, sprite->tex, sprite->im_fmt,
|
||||
G_IM_SIZ_16b, // @TEMP until I figure out how to use sprite->im_siz
|
||||
sprite->width, sprite->height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
} else {
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, sprite->tex, sprite->im_fmt,
|
||||
G_IM_SIZ_32b, // @TEMP until I figure out how to use sprite->im_siz
|
||||
sprite->width, sprite->height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(this->state.gfxCtx);
|
||||
}
|
||||
|
||||
void SpriteDraw(FileChooseContext* this, Sprite* sprite, int left, int top, int width, int height) {
|
||||
int width_factor = (1 << 10) * sprite->width / width;
|
||||
int height_factor = (1 << 10) * sprite->height / height;
|
||||
|
||||
OPEN_DISPS(this->state.gfxCtx);
|
||||
|
||||
gSPWideTextureRectangle(POLY_OPA_DISP++, left << 2, top << 2, (left + width) << 2, (top + height) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, width_factor, height_factor);
|
||||
|
||||
CLOSE_DISPS(this->state.gfxCtx);
|
||||
}
|
||||
|
||||
void DrawSeedHashSprites(FileChooseContext* this) {
|
||||
OPEN_DISPS(this->state.gfxCtx);
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
|
||||
if (this->windowRot == 0) {
|
||||
if (this->selectMode == SM_CONFIRM_FILE) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileInfoAlpha[this->buttonIndex]);
|
||||
|
||||
u16 xStart = 64;
|
||||
// Draw Seed Icons
|
||||
for (u8 i = 0; i < 5; i++) {
|
||||
if (Save_GetSaveMetaInfo(this->selectedFileIndex)->randoSave == 1) {
|
||||
SpriteLoad(this, GetSeedTexture(Save_GetSaveMetaInfo(this->selectedFileIndex)->seedHash[i]));
|
||||
SpriteDraw(this, GetSeedTexture(Save_GetSaveMetaInfo(this->selectedFileIndex)->seedHash[i]),
|
||||
xStart + (18 * i), 136, 16, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileButtonAlpha[this->buttonIndex]);
|
||||
|
||||
if (CVar_GetS32("gRandomizer", 0) != 0 && CVar_GetString("gSpoilerLog", "") != "") {
|
||||
u16 xStart = 64;
|
||||
for (u8 i = 0; i < 5; i++) {
|
||||
SpriteLoad(this, GetSeedTexture(gSaveContext.seedIcons[i]));
|
||||
SpriteDraw(this, GetSeedTexture(gSaveContext.seedIcons[i]), xStart + (40 * i), 10, 24, 24);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
CLOSE_DISPS(this->state.gfxCtx);
|
||||
}
|
||||
|
||||
u8 generating;
|
||||
bool fileSelectSpoilerFileLoaded;
|
||||
|
||||
/**
|
||||
* Update the cursor and wait for the player to select a button to change menus accordingly.
|
||||
* If an empty file is selected, enter the name entry config mode.
|
||||
|
@ -175,11 +396,53 @@ void FileChoose_UpdateMainMenu(GameState* thisx) {
|
|||
Input* input = &this->state.input[0];
|
||||
bool dpad = CVar_GetS32("gDpadPauseName", 0);
|
||||
|
||||
if (CVar_GetS32("gRandoGenerating", 0) != 0 && generating == 0) {
|
||||
generating = 1;
|
||||
func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_HORSE, 0, 7, 1);
|
||||
return;
|
||||
} else if (CVar_GetS32("gRandoGenerating", 0) == 0 && generating) {
|
||||
Audio_PlayFanfare(NA_BGM_HORSE_GOAL);
|
||||
func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1);
|
||||
generating = 0;
|
||||
return;
|
||||
} else if (generating) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SpoilerFileExists(CVar_GetString("gSpoilerLog", ""))) {
|
||||
CVar_SetString("gSpoilerLog", "");
|
||||
fileSelectSpoilerFileLoaded = false;
|
||||
}
|
||||
|
||||
if ((CVar_GetS32("gNewFileDropped", 0) != 0) ||
|
||||
(CVar_GetS32("gNewSeedGenerated", 0) != 0) ||
|
||||
(!fileSelectSpoilerFileLoaded &&
|
||||
SpoilerFileExists(CVar_GetString("gSpoilerLog", "")))) {
|
||||
if (CVar_GetS32("gNewFileDropped", 0) != 0) {
|
||||
CVar_SetString("gSpoilerLog", CVar_GetString("gDroppedFile", "None"));
|
||||
}
|
||||
bool silent = true;
|
||||
if ((CVar_GetS32("gNewFileDropped", 0) != 0) ||
|
||||
(CVar_GetS32("gNewSeedGenerated", 0) != 0)) {
|
||||
silent = false;
|
||||
}
|
||||
CVar_SetS32("gNewSeedGenerated", 0);
|
||||
CVar_SetS32("gNewFileDropped", 0);
|
||||
CVar_SetString("gDroppedFile", "");
|
||||
fileSelectSpoilerFileLoaded = false;
|
||||
const char* fileLoc = CVar_GetString("gSpoilerLog", "");
|
||||
LoadRandomizerSettings(fileLoc);
|
||||
LoadHintLocations(fileLoc);
|
||||
LoadItemLocations(fileLoc, silent);
|
||||
fileSelectSpoilerFileLoaded = true;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_A)) {
|
||||
if (this->buttonIndex <= FS_BTN_MAIN_FILE_3) {
|
||||
if (!Save_GetSaveMetaInfo(this->buttonIndex)->valid) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
this->configMode = CM_ROTATE_TO_NAME_ENTRY;
|
||||
CVar_SetS32("gOnFileSelectNameEntry", 1);
|
||||
this->kbdButton = FS_KBD_BTN_NONE;
|
||||
this->charPage = FS_CHAR_PAGE_ENG;
|
||||
this->kbdX = 0;
|
||||
|
@ -944,7 +1207,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||
// draw file button
|
||||
gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0);
|
||||
|
||||
isActive = ((this->n64ddFlag == Save_GetSaveMetaInfo(i)->n64ddFlag) || (this->nameBoxAlpha[i] == 0)) ? 0 : 1;
|
||||
isActive = 0;
|
||||
|
||||
if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetS32("gCCFileChoosePrimR", 100), CVar_GetS32("gCCFileChoosePrimG", 150),
|
||||
|
@ -974,17 +1237,17 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||
gSP1Quadrangle(POLY_OPA_DISP++, 4, 6, 7, 5, 0);
|
||||
|
||||
// draw disk label for 64DD
|
||||
if (Save_GetSaveMetaInfo(i)->n64ddFlag) {
|
||||
if (Save_GetSaveMetaInfo(i)->randoSave) {
|
||||
if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetS32("gCCFileChoosePrimR", 0),
|
||||
CVar_GetS32("gCCFileChoosePrimG", 200), CVar_GetS32("gCCFileChoosePrimB", 255),
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetS32("gCCFileChoosePrimR", 100),
|
||||
CVar_GetS32("gCCFileChoosePrimG", 150), CVar_GetS32("gCCFileChoosePrimB", 255),
|
||||
this->nameAlpha[i]);
|
||||
} else {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0],
|
||||
sWindowContentColors[isActive][1], sWindowContentColors[isActive][2],
|
||||
this->nameAlpha[i]);
|
||||
}
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelDISKButtonTex, G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0,
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelRANDButtonTex, G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0);
|
||||
|
@ -1004,14 +1267,14 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||
G_TX_NOLOD);
|
||||
gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0);
|
||||
|
||||
if (Save_GetSaveMetaInfo(i)->n64ddFlag) {
|
||||
if (Save_GetSaveMetaInfo(i)->randoSave) {
|
||||
gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// draw file info
|
||||
for (fileIndex = 0; fileIndex < 3; fileIndex++) {
|
||||
isActive = ((this->n64ddFlag == Save_GetSaveMetaInfo(fileIndex)->n64ddFlag) || (this->nameBoxAlpha[fileIndex] == 0)) ? 0 : 1;
|
||||
isActive = 0;
|
||||
FileChoose_DrawFileInfo(&this->state, fileIndex, isActive);
|
||||
}
|
||||
|
||||
|
@ -1250,6 +1513,8 @@ void FileChoose_ConfigModeDraw(GameState* thisx) {
|
|||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
FileChoose_SetView(this, 0.0f, 0.0f, 64.0f);
|
||||
|
||||
DrawSeedHashSprites(this);
|
||||
|
||||
FrameInterpolation_RecordCloseChild();
|
||||
|
||||
CLOSE_DISPS(this->state.gfxCtx);
|
||||
|
@ -1475,6 +1740,10 @@ void FileChoose_LoadGame(GameState* thisx) {
|
|||
this->state.running = false;
|
||||
}
|
||||
|
||||
LoadRandomizerSettings("");
|
||||
LoadHintLocations("");
|
||||
LoadItemLocations("", true);
|
||||
|
||||
gSaveContext.respawn[0].entranceIndex = -1;
|
||||
gSaveContext.respawnFlag = 0;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
|
@ -1600,6 +1869,8 @@ void FileChoose_SelectModeDraw(GameState* thisx) {
|
|||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
FileChoose_SetView(this, 0.0f, 0.0f, 64.0f);
|
||||
|
||||
DrawSeedHashSprites(this);
|
||||
|
||||
CLOSE_DISPS(this->state.gfxCtx);
|
||||
}
|
||||
|
||||
|
@ -1623,15 +1894,13 @@ void FileChoose_Main(GameState* thisx) {
|
|||
};
|
||||
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||
Input* input = &this->state.input[0];
|
||||
|
||||
|
||||
if (CVar_GetS32("gTimeFlowFileSelect", 0) != 0) {
|
||||
gSaveContext.skyboxTime += 0x10;
|
||||
}
|
||||
|
||||
OPEN_DISPS(this->state.gfxCtx);
|
||||
|
||||
this->n64ddFlag = 0;
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x02, this->parameterSegment);
|
||||
|
@ -1945,6 +2214,8 @@ void FileChoose_Init(GameState* thisx) {
|
|||
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||
size_t size = (u32)_title_staticSegmentRomEnd - (u32)_title_staticSegmentRomStart;
|
||||
s32 pad;
|
||||
fileSelectSpoilerFileLoaded = false;
|
||||
CVar_SetS32("gOnFileSelectNameEntry", 0);
|
||||
|
||||
SREG(30) = 1;
|
||||
osSyncPrintf("SIZE=%x\n", size);
|
||||
|
|
|
@ -822,7 +822,7 @@ void FileChoose_EraseConfirm(GameState* thisx) {
|
|||
this->actionTimer = 8;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
} else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) {
|
||||
Save_GetSaveMetaInfo(this->selectedFileIndex)->n64ddFlag = this->connectorAlpha[this->selectedFileIndex] = 0;
|
||||
this->connectorAlpha[this->selectedFileIndex] = 0;
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_DIAMOND_SWITCH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
this->actionTimer = 8;
|
||||
this->configMode = CM_ERASE_ANIM_1;
|
||||
|
|
|
@ -386,6 +386,7 @@ void FileChoose_DrawNameEntry(GameState* thisx) {
|
|||
if (this->newFileNameCharCount < 0) {
|
||||
this->newFileNameCharCount = 0;
|
||||
this->configMode = CM_NAME_ENTRY_TO_MAIN;
|
||||
CVar_SetS32("gOnFileSelectNameEntry", 0);
|
||||
} else {
|
||||
for (i = this->newFileNameCharCount; i < 7; i++) {
|
||||
filename[i] = filename[i + 1];
|
||||
|
@ -459,6 +460,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) {
|
|||
Sram_InitSave(this);
|
||||
gSaveContext.dayTime = dayTime;
|
||||
this->configMode = CM_NAME_ENTRY_TO_MAIN;
|
||||
CVar_SetS32("gOnFileSelectNameEntry", 0);
|
||||
CVar_SetS32("gNewFileDropped", 0);
|
||||
this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200;
|
||||
this->connectorAlpha[this->buttonIndex] = 255;
|
||||
func_800AA000(300.0f, 0xB4, 0x14, 0x64);
|
||||
|
|
|
@ -33,6 +33,8 @@ void Title_PrintBuildInfo(Gfx** gfxp) {
|
|||
|
||||
#ifdef _MSC_VER
|
||||
GfxPrint_Printf(&printer, "MSVC SHIP");
|
||||
#elif __clang__
|
||||
GfxPrint_Printf(&printer, "CLANG SHIP");
|
||||
#else
|
||||
GfxPrint_Printf(&printer, "GCC SHIP");
|
||||
#endif
|
||||
|
|
|
@ -164,7 +164,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
|
|||
s16 cursorX;
|
||||
s16 cursorY;
|
||||
s16 oldCursorPoint;
|
||||
bool dpad = CVar_GetS32("gDpadPauseName", 0);
|
||||
bool dpad = (CVar_GetS32("gDpadPauseName", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
|
@ -491,7 +491,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
|
|||
KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx);
|
||||
|
||||
u16 buttonsToCheck = BTN_A | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT;
|
||||
if (CVar_GetS32("gDpadEquips", 0) != 0) {
|
||||
if (CVar_GetS32("gDpadEquips", 0) && (!CVar_GetS32("gDpadPauseName", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue