Merge pull request #1300 from aMannus/tokensanity-bgs-fix

Rando: Tokensanity BGS and maps/compasses fix
This commit is contained in:
briaguya 2022-08-25 16:50:21 -04:00 committed by GitHub
commit da07a8f409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -1642,12 +1642,16 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
} else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) {
gSaveContext.inventory.equipment |= gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD];
// Both Giant's Knife and Biggoron Sword have the same Item ID, so this part handles both of them
if (item == ITEM_SWORD_BGS) {
gSaveContext.swordHealth = 8;
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF
||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { // In rando, when buying Giant's Knife, also check
gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword
// In rando, when buying Giant's Knife, also check
// for 0xE in case we don't have Kokiri Sword
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF || (gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) {
gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD];
if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) {
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS;
Interface_LoadItemIcon1(globalCtx, 0);

View File

@ -205,13 +205,13 @@ void Randomizer_UpdateSkullReward(EnSi* this, GlobalContext* globalCtx) {
getItem = Randomizer_GetRandomizedItem(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum);
getItemId = getItem.getItemId;
if (getItemId == RG_ICE_TRAP) {
player->getItemEntry = getItem;
player->pendingIceTrap = true;
textId = 0xF8;
} else {
textId = getItem.textId;
giveItemId = getItem.itemId;
}
player->getItemEntry = getItem;
}
void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx) {
@ -222,5 +222,8 @@ void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx) {
} else if (getItem.modIndex == MOD_RANDOMIZER) {
Randomizer_Item_Give(globalCtx, getItem);
}
player->getItemEntry = getItem;
// RANDOTOD: Move this into Item_Give() or some other more central location
if (getItem.getItemId == GI_SWORD_BGS) {
gSaveContext.bgsFlag = true;
}
}