mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
refactor some actors
This commit is contained in:
parent
f60df39a68
commit
2bd7914941
7 changed files with 57 additions and 66 deletions
|
@ -1441,11 +1441,11 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId)
|
|||
case RG_RUTOS_LETTER:
|
||||
return GI_LETTER_RUTO;
|
||||
case RG_ARROWS_5:
|
||||
return GI_ARROWS_SMALL;
|
||||
return CUR_UPG_VALUE(UPG_QUIVER) ? GI_ARROWS_SMALL : GI_RUPEE_BLUE;
|
||||
case RG_ARROWS_10:
|
||||
return GI_ARROWS_MEDIUM;
|
||||
return CUR_UPG_VALUE(UPG_QUIVER) ? GI_ARROWS_MEDIUM : GI_RUPEE_BLUE;
|
||||
case RG_ARROWS_30:
|
||||
return GI_ARROWS_LARGE;
|
||||
return CUR_UPG_VALUE(UPG_QUIVER) ? GI_ARROWS_LARGE : GI_RUPEE_BLUE;
|
||||
case RG_DEKU_STICK_1:
|
||||
return GI_STICKS_1;
|
||||
|
||||
|
|
|
@ -225,10 +225,7 @@ void BossDodongo_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_BREAKWALL, -890.0f, -1523.76f, -3304.0f, 0, 0, 0, 0x6000);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, -690.0f, -1523.76f, -3304.0f, 0, 0, 0, 0);
|
||||
|
||||
for (i = 0; i < 2048; i++) {
|
||||
temp_v0 = i;
|
||||
temp_s1_3[temp_v0] = temp_s2[temp_v0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
|
|
|
@ -898,24 +898,21 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
u8 successImpa;
|
||||
void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
if (successImpa == 0 && (globalCtx->actorCtx.titleCtx.delayTimer == 0) &&
|
||||
(globalCtx->actorCtx.titleCtx.alpha == 0)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY);
|
||||
|
||||
if (func_8002F434(impa, globalCtx, getItemId, 100.0f, 50.0f) == true) {
|
||||
successImpa = 1;
|
||||
}
|
||||
} else if (successImpa == 1) {
|
||||
gSaveContext.eventChkInf[5] |= 0x200;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 3;
|
||||
gSaveContext.nextTransition = 3;
|
||||
globalCtx->nextEntranceIndex = 0x0594;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
}
|
||||
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)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,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;
|
||||
|
@ -289,7 +291,7 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actionFunc = func_80AA0D88;
|
||||
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (gSaveContext.n64ddFlag) { // Straight to singing textbox
|
||||
gSaveContext.eventChkInf[1] |= 0x40;
|
||||
}
|
||||
|
||||
|
@ -318,7 +320,8 @@ 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 && Flags_GetTreasure(globalCtx, 0x1F))) {
|
||||
if (this->unk_1E8.unk_00 == 2) {
|
||||
this->actionFunc = func_80AA0EA0;
|
||||
globalCtx->msgCtx.stateTimer = 4;
|
||||
|
@ -351,19 +354,16 @@ void func_80AA0EFC(EnMa1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void GivePlayerRandoRewardMalon(EnMa1* malon, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_EPONAS_SONG);
|
||||
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1F) &&
|
||||
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE || INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE) &&
|
||||
Actor_TextboxIsClosing(&malon->actor, globalCtx)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_EPONAS_SONG);
|
||||
|
||||
if (func_8002F434(&malon->actor, globalCtx, getItemId, 100.0f, 50.0f) == true) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
} else if (Flags_GetTreasure(globalCtx, 0x1F) && !Player_InBlockingCsMode(globalCtx, player)) {
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.eventChkInf[4] |= 1;
|
||||
if (malon->actor.parent != NULL && malon->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
|
||||
!Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
} else if (!Flags_GetTreasure(globalCtx, 0x1F) &&
|
||||
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE || INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE) &&
|
||||
Actor_TextboxIsClosing(&malon->actor, globalCtx) &&
|
||||
(globalCtx->msgCtx.textId == 0x2049 || globalCtx->msgCtx.textId == 0x204A)) {
|
||||
func_8002F434(&malon->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 itemId = GetRandomizedItemIdFromKnownCheck(KAK_ANJU_AS_CHILD, GI_BOTTLE);
|
||||
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;
|
||||
|
@ -395,7 +395,7 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
s32 itemId = GetRandomizedItemIdFromKnownCheck(KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||
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);
|
||||
|
@ -455,7 +455,7 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
||||
|
||||
if (gSaveContext.n64ddFlag && getItemId == GI_POCKET_EGG) {
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||
getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||
}
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||
|
|
|
@ -618,17 +618,16 @@ void func_80AF67D0(EnSa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void GivePlayerRandoRewardSaria(EnSa* saria, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
GetItemID getItemId =
|
||||
GetRandomizedItemIdFromKnownCheck(check, GI_SARIAS_SONG);
|
||||
|
||||
if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1F) &&
|
||||
gSaveContext.eventChkInf[4] & 1) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SARIAS_SONG);
|
||||
|
||||
if (func_8002F434(&saria->actor, globalCtx, getItemId, 100000.0f, 100000.0f) == true) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
}
|
||||
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);
|
||||
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -637,7 +636,7 @@ void func_80AF683C(EnSa* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (!(player->actor.world.pos.z >= -2220.0f) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoRewardSaria(this, globalCtx, SONG_FROM_SARIA);
|
||||
GivePlayerRandoRewardSaria(this, globalCtx, RC_SONG_FROM_SARIA);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -228,19 +228,17 @@ u16 EnZl4_GetText(GlobalContext* globalCtx, Actor* thisx) {
|
|||
}
|
||||
|
||||
void GivePlayerRandoRewardZeldaChild(EnZl4* zelda, GlobalContext* globalCtx, RandomizerCheck check) {
|
||||
if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
if (!Flags_GetTreasure(globalCtx, 0x1F) && Actor_TextboxIsClosing(&zelda->actor, globalCtx) &&
|
||||
gSaveContext.eventChkInf[4] != 1 && (globalCtx->actorCtx.titleCtx.delayTimer == 0) &&
|
||||
(globalCtx->actorCtx.titleCtx.alpha == 0)) {
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
|
||||
|
||||
if (func_8002F434(&zelda->actor, globalCtx, getItemId, 100.0f, 50.0f) == true) {
|
||||
Flags_SetTreasure(globalCtx, 0x1F);
|
||||
}
|
||||
} else if (Flags_GetTreasure(globalCtx, 0x1F)) {
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.eventChkInf[4] |= 1;
|
||||
}
|
||||
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) && Actor_TextboxIsClosing(&zelda->actor, globalCtx) &&
|
||||
globalCtx->msgCtx.textId == 0x703C) {
|
||||
func_8002F434(&zelda->actor, globalCtx, getItemId, 10000.0f, 100.0f);
|
||||
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.eventChkInf[4] |= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1228,7 +1226,7 @@ void EnZl4_Idle(EnZl4* this, GlobalContext* globalCtx) {
|
|||
func_80B5BB78(this, globalCtx);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
GivePlayerRandoRewardZeldaChild(this, globalCtx, HC_ZELDAS_LETTER);
|
||||
GivePlayerRandoRewardZeldaChild(this, globalCtx, RC_HC_ZELDAS_LETTER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue