mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-22 21:51:55 -05:00
Merge pull request #1303 from aMannus/rando-skulls-winnerpoh-fix
Rando: Fix Winner PoH on skulltula's
This commit is contained in:
commit
9f60a97307
@ -17,7 +17,8 @@ s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx);
|
|||||||
void func_80AFB768(EnSi* this, GlobalContext* globalCtx);
|
void func_80AFB768(EnSi* this, GlobalContext* globalCtx);
|
||||||
void func_80AFB89C(EnSi* this, GlobalContext* globalCtx);
|
void func_80AFB89C(EnSi* this, GlobalContext* globalCtx);
|
||||||
void func_80AFB950(EnSi* this, GlobalContext* globalCtx);
|
void func_80AFB950(EnSi* this, GlobalContext* globalCtx);
|
||||||
void Randomizer_GrantSkullReward(EnSi* this, GlobalContext* globalCtx);
|
void Randomizer_UpdateSkullReward(EnSi* this, GlobalContext* globalCtx);
|
||||||
|
void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx);
|
||||||
|
|
||||||
s32 textId = 0xB4;
|
s32 textId = 0xB4;
|
||||||
s32 giveItemId = ITEM_SKULL_TOKEN;
|
s32 giveItemId = ITEM_SKULL_TOKEN;
|
||||||
@ -99,21 +100,25 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) {
|
|||||||
|
|
||||||
if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) {
|
if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) {
|
||||||
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
|
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag) {
|
if (gSaveContext.n64ddFlag) {
|
||||||
Randomizer_GrantSkullReward(this, globalCtx);
|
Randomizer_UpdateSkullReward(this, globalCtx);
|
||||||
} else {
|
} else {
|
||||||
Item_Give(globalCtx, giveItemId);
|
Item_Give(globalCtx, giveItemId);
|
||||||
}
|
}
|
||||||
if ((CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) {
|
if ((CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) {
|
||||||
player->actor.freezeTimer = 20;
|
player->actor.freezeTimer = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message_StartTextbox(globalCtx, textId, NULL);
|
Message_StartTextbox(globalCtx, textId, NULL);
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
||||||
|
Randomizer_GiveSkullReward(this, globalCtx);
|
||||||
Audio_PlayFanfare_Rando(getItem);
|
Audio_PlayFanfare_Rando(getItem);
|
||||||
} else {
|
} else {
|
||||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||||
}
|
}
|
||||||
|
|
||||||
player->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
player->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||||
this->actionFunc = func_80AFB950;
|
this->actionFunc = func_80AFB950;
|
||||||
} else {
|
} else {
|
||||||
@ -133,16 +138,20 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) {
|
|||||||
|
|
||||||
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) {
|
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) {
|
||||||
if (gSaveContext.n64ddFlag) {
|
if (gSaveContext.n64ddFlag) {
|
||||||
Randomizer_GrantSkullReward(this, globalCtx);
|
Randomizer_UpdateSkullReward(this, globalCtx);
|
||||||
} else {
|
} else {
|
||||||
Item_Give(globalCtx, giveItemId);
|
Item_Give(globalCtx, giveItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Message_StartTextbox(globalCtx, textId, NULL);
|
Message_StartTextbox(globalCtx, textId, NULL);
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
||||||
|
Randomizer_GiveSkullReward(this, globalCtx);
|
||||||
Audio_PlayFanfare_Rando(getItem);
|
Audio_PlayFanfare_Rando(getItem);
|
||||||
} else {
|
} else {
|
||||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||||
}
|
}
|
||||||
|
|
||||||
player->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
player->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||||
this->actionFunc = func_80AFB950;
|
this->actionFunc = func_80AFB950;
|
||||||
}
|
}
|
||||||
@ -190,23 +199,28 @@ void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Randomizer_GrantSkullReward(EnSi* this, GlobalContext* globalCtx) {
|
void Randomizer_UpdateSkullReward(EnSi* this, GlobalContext* globalCtx) {
|
||||||
Player* player = GET_PLAYER(globalCtx);
|
Player* player = GET_PLAYER(globalCtx);
|
||||||
|
|
||||||
getItem = Randomizer_GetRandomizedItem(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
getItem = Randomizer_GetRandomizedItem(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||||
getItemId = getItem.getItemId;
|
getItemId = getItem.getItemId;
|
||||||
if (getItemId == RG_ICE_TRAP) {
|
if (getItemId == RG_ICE_TRAP) {
|
||||||
|
player->getItemEntry = getItem;
|
||||||
player->pendingIceTrap = true;
|
player->pendingIceTrap = true;
|
||||||
textId = 0xF8;
|
textId = 0xF8;
|
||||||
} else {
|
} else {
|
||||||
textId = getItem.textId;
|
textId = getItem.textId;
|
||||||
giveItemId = getItem.itemId;
|
giveItemId = getItem.itemId;
|
||||||
if (getItem.modIndex == MOD_NONE) {
|
|
||||||
Item_Give(globalCtx, giveItemId);
|
|
||||||
} else if (getItem.modIndex == MOD_RANDOMIZER) {
|
|
||||||
Randomizer_Item_Give(globalCtx, getItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// player->getItemId = getItemId;
|
}
|
||||||
|
|
||||||
|
void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx) {
|
||||||
|
Player* player = GET_PLAYER(globalCtx);
|
||||||
|
|
||||||
|
if (getItem.modIndex == MOD_NONE) {
|
||||||
|
Item_Give(globalCtx, giveItemId);
|
||||||
|
} else if (getItem.modIndex == MOD_RANDOMIZER) {
|
||||||
|
Randomizer_Item_Give(globalCtx, getItem);
|
||||||
|
}
|
||||||
player->getItemEntry = getItem;
|
player->getItemEntry = getItem;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user