mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Merge pull request #20 from MelonSpeedruns/melon-randomizer
anju refactor + warp renames + impa wip
This commit is contained in:
commit
2224e344f7
3 changed files with 52 additions and 19 deletions
|
@ -898,8 +898,27 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 successImpa;
|
||||||
|
void GivePlayerRandoRewardImpa(Actor* actor, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||||
|
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_NONE);
|
||||||
|
|
||||||
|
if (successImpa && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||||
|
gSaveContext.eventChkInf[5] |= 0x200;
|
||||||
|
globalCtx->sceneLoadFlag = 0x14;
|
||||||
|
globalCtx->fadeTransition = 7;
|
||||||
|
gSaveContext.nextTransition = 3;
|
||||||
|
globalCtx->nextEntranceIndex = 0x0594;
|
||||||
|
gSaveContext.nextCutsceneIndex = 0;
|
||||||
|
} else if (!successImpa) {
|
||||||
|
successImpa = func_8002F434(&actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void func_80986C30(DemoIm* this, GlobalContext* globalCtx) {
|
void func_80986C30(DemoIm* this, GlobalContext* globalCtx) {
|
||||||
if (func_80986A5C(this, globalCtx)) {
|
if (func_80986A5C(this, globalCtx)) {
|
||||||
|
if (gSaveContext.n64ddFlag) {
|
||||||
|
GivePlayerRandoRewardImpa(this, globalCtx, SONG_FROM_IMPA);
|
||||||
|
} else {
|
||||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
|
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
|
||||||
gSaveContext.cutsceneTrigger = 1;
|
gSaveContext.cutsceneTrigger = 1;
|
||||||
gSaveContext.eventChkInf[5] |= 0x200;
|
gSaveContext.eventChkInf[5] |= 0x200;
|
||||||
|
@ -907,6 +926,7 @@ void func_80986C30(DemoIm* this, GlobalContext* globalCtx) {
|
||||||
func_80985F54(this);
|
func_80985F54(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void func_80986CC8(DemoIm* this) {
|
void func_80986CC8(DemoIm* this) {
|
||||||
if (gSaveContext.eventChkInf[4] & 1) {
|
if (gSaveContext.eventChkInf[4] & 1) {
|
||||||
|
|
|
@ -461,12 +461,11 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 success = 0;
|
u8 successWarp = 0;
|
||||||
|
|
||||||
void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) {
|
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);
|
GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||||
|
|
||||||
if (success && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
if (successWarp && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||||
if (adult) {
|
if (adult) {
|
||||||
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
|
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
|
||||||
func_8002DF54(globalCtx, &this->actor, 10);
|
func_8002DF54(globalCtx, &this->actor, 10);
|
||||||
|
@ -494,9 +493,9 @@ void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
success = 0;
|
successWarp = 0;
|
||||||
} else if (!success) {
|
} else if (!successWarp) {
|
||||||
success = func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
successWarp = func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -304,8 +304,14 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
if (!(gSaveContext.itemGetInf[0] & 0x1000)) {
|
if (!(gSaveContext.itemGetInf[0] & 0x1000)) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
|
|
||||||
this->getItemId = GetRandomizedItemId(GI_BOTTLE, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
if (gSaveContext.n64ddFlag) {
|
||||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 100.0f, 50.0f);
|
s32 itemId = GetRandomizedItemIdFromKnownCheck(GI_BOTTLE, KAK_ANJU_AS_CHILD);
|
||||||
|
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;
|
this->actionFunc = func_80ABAC00;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -387,9 +393,14 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
case 0:
|
case 0:
|
||||||
Message_CloseTextbox(globalCtx);
|
Message_CloseTextbox(globalCtx);
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
s32 itemId =
|
|
||||||
GetRandomizedItemId(GI_POCKET_EGG, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
if (gSaveContext.n64ddFlag) {
|
||||||
|
s32 itemId = GetRandomizedItemIdFromKnownCheck(GI_POCKET_EGG, KAK_ANJU_AS_ADULT);
|
||||||
func_8002F434(&this->actor, globalCtx, itemId, 200.0f, 100.0f);
|
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;
|
this->actionFunc = func_80ABAC00;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -441,8 +452,11 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
} else {
|
} else {
|
||||||
getItemId = this->getItemId;
|
getItemId = this->getItemId;
|
||||||
if (LINK_IS_ADULT) {
|
if (LINK_IS_ADULT) {
|
||||||
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000)
|
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
||||||
? GetRandomizedItemId(GI_POCKET_EGG, this->actor.id, this->actor.params, globalCtx->sceneNum) : GI_COJIRO;
|
|
||||||
|
if (gSaveContext.n64ddFlag && getItemId == GI_POCKET_EGG) {
|
||||||
|
getItemId = GetRandomizedItemIdFromKnownCheck(GI_POCKET_EGG, KAK_ANJU_AS_ADULT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue