mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-23 06:35:33 -07:00
malon wip + zelda done + impa done + anju fix
This commit is contained in:
parent
acf63791f9
commit
72ef5de447
9 changed files with 89 additions and 46 deletions
|
@ -447,7 +447,6 @@ s8 func_8002F368(GlobalContext* globalCtx);
|
||||||
void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* x, s16* y);
|
void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* x, s16* y);
|
||||||
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx);
|
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx);
|
||||||
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange);
|
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange);
|
||||||
s32 GiveItem_Impa(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange);
|
|
||||||
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId);
|
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId);
|
||||||
void func_8002F580(Actor* actor, GlobalContext* globalCtx);
|
void func_8002F580(Actor* actor, GlobalContext* globalCtx);
|
||||||
u32 Actor_HasNoParent(Actor* actor, GlobalContext* globalCtx);
|
u32 Actor_HasNoParent(Actor* actor, GlobalContext* globalCtx);
|
||||||
|
|
|
@ -179,7 +179,7 @@ typedef struct {
|
||||||
/* 0x1420 */ s16 worldMapArea;
|
/* 0x1420 */ s16 worldMapArea;
|
||||||
/* 0x1422 */ s16 sunsSongState; // controls the effects of suns song
|
/* 0x1422 */ s16 sunsSongState; // controls the effects of suns song
|
||||||
/* 0x1424 */ s16 healthAccumulator;
|
/* 0x1424 */ s16 healthAccumulator;
|
||||||
ItemLocation itemLocations[266];
|
ItemLocation itemLocations[268];
|
||||||
Sprite seedIcons[5];
|
Sprite seedIcons[5];
|
||||||
} SaveContext; // size = 0x1428
|
} SaveContext; // size = 0x1428
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,7 @@ typedef enum {
|
||||||
GANONS_CASTLE_SPIRIT_TRIAL_CRYSTAL_SWITCH_CHEST,
|
GANONS_CASTLE_SPIRIT_TRIAL_CRYSTAL_SWITCH_CHEST,
|
||||||
GANONS_CASTLE_SPIRIT_TRIAL_INVISIBLE_CHEST,
|
GANONS_CASTLE_SPIRIT_TRIAL_INVISIBLE_CHEST,
|
||||||
GANONS_TOWER_BOSS_KEY_CHEST,
|
GANONS_TOWER_BOSS_KEY_CHEST,
|
||||||
|
HC_ZELDAS_LETTER,
|
||||||
UNKNOWN_CHECK
|
UNKNOWN_CHECK
|
||||||
} RandomizerCheck;
|
} RandomizerCheck;
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,7 @@ std::unordered_map<std::string, RandomizerCheck> SpoilerfileCheckNameToEnum = {
|
||||||
{"GF Chest", GF_CHEST},
|
{"GF Chest", GF_CHEST},
|
||||||
{"GF HBA 1000 Points", GF_HBA_1000_POINTS},
|
{"GF HBA 1000 Points", GF_HBA_1000_POINTS},
|
||||||
{"GF HBA 1500 Points", GF_HBA_1500_POINTS},
|
{"GF HBA 1500 Points", GF_HBA_1500_POINTS},
|
||||||
|
{"HC Zeldas Letter", HC_ZELDAS_LETTER},
|
||||||
{"Wasteland Chest", WASTELAND_CHEST},
|
{"Wasteland Chest", WASTELAND_CHEST},
|
||||||
{"Colossus Great Fairy Reward", COLOSSUS_GREAT_FAIRY_REWARD},
|
{"Colossus Great Fairy Reward", COLOSSUS_GREAT_FAIRY_REWARD},
|
||||||
{"Colossus Freestanding PoH", COLOSSUS_FREESTANDING_POH},
|
{"Colossus Freestanding PoH", COLOSSUS_FREESTANDING_POH},
|
||||||
|
@ -1095,6 +1096,7 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId)
|
||||||
return GI_REQUIEM_OF_SPIRIT;
|
return GI_REQUIEM_OF_SPIRIT;
|
||||||
case PRELUDE_OF_LIGHT:
|
case PRELUDE_OF_LIGHT:
|
||||||
return GI_PRELUDE_OF_LIGHT;
|
return GI_PRELUDE_OF_LIGHT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ogItemId;
|
return ogItemId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1947,35 +1947,6 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 GiveItem_Impa(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
|
|
||||||
Player* player = GET_PLAYER(globalCtx);
|
|
||||||
|
|
||||||
if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
|
|
||||||
if ((((player->heldActor != NULL) || (actor == player->targetActor)) && (getItemId > GI_NONE) &&
|
|
||||||
(getItemId < GI_MAX)) ||
|
|
||||||
(!(player->stateFlags1 & 0x20000800))) {
|
|
||||||
f32 playerPosX = player->actor.world.pos.x;
|
|
||||||
f32 thisPosX = actor->world.pos.x;
|
|
||||||
|
|
||||||
if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) {
|
|
||||||
s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y;
|
|
||||||
s32 absYawDiff = ABS(yawDiff);
|
|
||||||
|
|
||||||
if ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) {
|
|
||||||
player->getItemId = getItemId;
|
|
||||||
player->interactRangeActor = actor;
|
|
||||||
player->getItemDirection = absYawDiff;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) {
|
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) {
|
||||||
func_8002F434(actor, globalCtx, getItemId, 50.0f, 10.0f);
|
func_8002F434(actor, globalCtx, getItemId, 50.0f, 10.0f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -899,18 +899,22 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 successImpa;
|
u8 successImpa;
|
||||||
void GivePlayerRandoRewardImpa(Actor* actor, GlobalContext* globalCtx, RandomizerCheck check) {
|
void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_NONE);
|
if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||||
|
if (successImpa == 0) {
|
||||||
|
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||||
|
|
||||||
if (successImpa && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
if (func_8002F434(impa, globalCtx, getItemId, 100.0f, 50.0f) == true) {
|
||||||
gSaveContext.eventChkInf[5] |= 0x200;
|
successImpa = 1;
|
||||||
globalCtx->sceneLoadFlag = 0x14;
|
}
|
||||||
globalCtx->fadeTransition = 7;
|
} else if (successImpa == 1) {
|
||||||
gSaveContext.nextTransition = 3;
|
gSaveContext.eventChkInf[5] |= 0x200;
|
||||||
globalCtx->nextEntranceIndex = 0x0594;
|
globalCtx->sceneLoadFlag = 0x14;
|
||||||
gSaveContext.nextCutsceneIndex = 0;
|
globalCtx->fadeTransition = 3;
|
||||||
} else if (!successImpa) {
|
gSaveContext.nextTransition = 3;
|
||||||
successImpa = GiveItem_Impa(&actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
globalCtx->nextEntranceIndex = 0x0594;
|
||||||
|
gSaveContext.nextCutsceneIndex = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -271,6 +271,10 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit);
|
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit);
|
||||||
|
|
||||||
|
if (gSaveContext.n64ddFlag) {
|
||||||
|
gSaveContext.infTable[8] |= 0x800;
|
||||||
|
}
|
||||||
|
|
||||||
if (!func_80AA08C4(this, globalCtx)) {
|
if (!func_80AA08C4(this, globalCtx)) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
return;
|
return;
|
||||||
|
@ -324,7 +328,13 @@ void func_80AA0EA0(EnMa1* this, GlobalContext* globalCtx) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
this->actionFunc = func_80AA0EFC;
|
this->actionFunc = func_80AA0EFC;
|
||||||
} else {
|
} else {
|
||||||
func_8002F434(&this->actor, globalCtx, GI_WEIRD_EGG, 120.0f, 10.0f);
|
|
||||||
|
if (gSaveContext.n64ddFlag) {
|
||||||
|
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(HC_GREAT_FAIRY_REWARD, GI_LETTER_ZELDA);
|
||||||
|
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 +347,22 @@ void func_80AA0EFC(EnMa1* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 malonSuccess;
|
||||||
|
void GivePlayerRandoRewardMalon(EnMa1* zelda, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||||
|
if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||||
|
if (malonSuccess == 0) {
|
||||||
|
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||||
|
|
||||||
|
if (func_8002F434(&zelda->actor, globalCtx, getItemId, 100.0f, 50.0f) == true) {
|
||||||
|
malonSuccess = 1;
|
||||||
|
}
|
||||||
|
} else if (malonSuccess == 1) {
|
||||||
|
gSaveContext.unk_13EE = 0x32;
|
||||||
|
gSaveContext.eventChkInf[4] |= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
|
void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
|
||||||
Player* player = GET_PLAYER(globalCtx);
|
Player* player = GET_PLAYER(globalCtx);
|
||||||
|
|
||||||
|
@ -394,6 +420,13 @@ void func_80AA1150(EnMa1* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (gSaveContext.n64ddFlag) {
|
||||||
|
GivePlayerRandoRewardMalon(this, globalCtx, HC_ZELDAS_LETTER);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void EnMa1_DoNothing(EnMa1* this, GlobalContext* globalCtx) {
|
void EnMa1_DoNothing(EnMa1* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag) {
|
if (gSaveContext.n64ddFlag) {
|
||||||
s32 itemId = GetRandomizedItemIdFromKnownCheck(GI_BOTTLE, KAK_ANJU_AS_CHILD);
|
s32 itemId = GetRandomizedItemIdFromKnownCheck(KAK_ANJU_AS_CHILD, GI_BOTTLE);
|
||||||
func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 50.0f);
|
func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 50.0f);
|
||||||
} else {
|
} else {
|
||||||
this->getItemId = GI_BOTTLE;
|
this->getItemId = GI_BOTTLE;
|
||||||
|
@ -395,7 +395,7 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag) {
|
if (gSaveContext.n64ddFlag) {
|
||||||
s32 itemId = GetRandomizedItemIdFromKnownCheck(GI_POCKET_EGG, KAK_ANJU_AS_ADULT);
|
s32 itemId = GetRandomizedItemIdFromKnownCheck(KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||||
func_8002F434(&this->actor, globalCtx, itemId, 200.0f, 100.0f);
|
func_8002F434(&this->actor, globalCtx, itemId, 200.0f, 100.0f);
|
||||||
} else {
|
} else {
|
||||||
func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f);
|
func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f);
|
||||||
|
@ -455,7 +455,7 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag && getItemId == GI_POCKET_EGG) {
|
if (gSaveContext.n64ddFlag && getItemId == GI_POCKET_EGG) {
|
||||||
getItemId = GetRandomizedItemIdFromKnownCheck(GI_POCKET_EGG, KAK_ANJU_AS_ADULT);
|
getItemId = GetRandomizedItemIdFromKnownCheck(KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||||
|
|
|
@ -227,10 +227,29 @@ u16 EnZl4_GetText(GlobalContext* globalCtx, Actor* thisx) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 zeldaSuccess;
|
||||||
|
void GivePlayerRandoRewardZeldaChild(EnZl4* zelda, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||||
|
if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||||
|
if (zeldaSuccess == 0) {
|
||||||
|
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||||
|
|
||||||
|
if (func_8002F434(&zelda->actor, globalCtx, getItemId, 100.0f, 50.0f) == true) {
|
||||||
|
zeldaSuccess = 1;
|
||||||
|
}
|
||||||
|
} else if (zeldaSuccess == 1) {
|
||||||
|
gSaveContext.unk_13EE = 0x32;
|
||||||
|
gSaveContext.eventChkInf[4] |= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s16 func_80B5B9B0(GlobalContext* globalCtx, Actor* thisx) {
|
s16 func_80B5B9B0(GlobalContext* globalCtx, Actor* thisx) {
|
||||||
|
EnZl4* this = (EnZl4*)thisx;
|
||||||
|
|
||||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
|
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,6 +391,12 @@ void EnZl4_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
this->actor.textId = -1;
|
this->actor.textId = -1;
|
||||||
this->eyeExpression = this->mouthExpression = ZL4_MOUTH_NEUTRAL;
|
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) {
|
if (gSaveContext.sceneSetupIndex >= 4) {
|
||||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0);
|
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0);
|
||||||
this->actionFunc = EnZl4_TheEnd;
|
this->actionFunc = EnZl4_TheEnd;
|
||||||
|
@ -389,6 +414,7 @@ void EnZl4_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
this->csState = ZL4_CS_LEGEND;
|
this->csState = ZL4_CS_LEGEND;
|
||||||
this->talkState = 0;
|
this->talkState = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->actionFunc = EnZl4_Cutscene;
|
this->actionFunc = EnZl4_Cutscene;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,6 +460,7 @@ s32 EnZl4_CsWaitForPlayer(EnZl4* this, GlobalContext* globalCtx) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
playerx->world.pos = this->actor.world.pos;
|
playerx->world.pos = this->actor.world.pos;
|
||||||
rotY = this->actor.shape.rot.y;
|
rotY = this->actor.shape.rot.y;
|
||||||
playerx->world.pos.x += 56.0f * Math_SinS(rotY);
|
playerx->world.pos.x += 56.0f * Math_SinS(rotY);
|
||||||
|
@ -1196,7 +1223,13 @@ void EnZl4_Cutscene(EnZl4* this, GlobalContext* globalCtx) {
|
||||||
void EnZl4_Idle(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_800343CC(globalCtx, &this->actor, &this->unk_1E0.unk_00, this->collider.dim.radius + 60.0f, EnZl4_GetText,
|
||||||
func_80B5B9B0);
|
func_80B5B9B0);
|
||||||
|
|
||||||
func_80B5BB78(this, globalCtx);
|
func_80B5BB78(this, globalCtx);
|
||||||
|
|
||||||
|
if (gSaveContext.n64ddFlag) {
|
||||||
|
GivePlayerRandoRewardZeldaChild(this, globalCtx, HC_ZELDAS_LETTER);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnZl4_TheEnd(EnZl4* this, GlobalContext* globalCtx) {
|
void EnZl4_TheEnd(EnZl4* this, GlobalContext* globalCtx) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue