Merge pull request #936 from briaguya-ai/develop-zhora

zhora -> rando-next
This commit is contained in:
briaguya
2022-07-25 20:52:51 -04:00
committed by GitHub
25 changed files with 236 additions and 73 deletions
+8 -6
View File
@@ -1028,7 +1028,7 @@ s8 D_80131870 = 0;
u8 D_80131874 = 0;
u8 D_80131878 = 0;
u8 D_8013187C = 0;
u8 D_80131880 = 0;
u8 sOcarinaDropInputTimer = 0;
OcarinaNote sPierresSong[108] = {
{ 0xFF, 0, 0, 0, 0, 0, 0 },
@@ -1550,9 +1550,11 @@ void func_800ED458(s32 arg0) {
u32 phi_v1_2;
bool dpad = CVar_GetS32("gDpadOcarinaText", 0);
if (D_80130F3C != 0 && D_80131880 != 0) {
D_80131880--;
return;
if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) {
sOcarinaDropInputTimer--;
if (!CVar_GetS32("gDpadNoDropOcarinaInput", 0)) {
return;
}
}
if ((D_8016BA10 == 0) ||
@@ -2057,7 +2059,7 @@ void func_800EE6F4(void) {
}
if ((D_80130F3C != 0) && (sPrevOcarinaNoteVal != sCurOcarinaBtnVal)) {
D_80131880 = 1;
sOcarinaDropInputTimer = 1;
}
sPrevOcarinaNoteVal = sCurOcarinaBtnVal;
@@ -2110,7 +2112,7 @@ void func_800EE930(void) {
sRecordingStaff.noteIdx = OCARINA_NOTE_INVALID;
sRecordingStaff.state = 0xFF;
sRecordingStaff.pos = 0;
D_80131880 = 0;
sOcarinaDropInputTimer = 0;
}
f32 D_80131C8C = 0.0f;
+34 -18
View File
@@ -996,6 +996,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->actor.shape.shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
GetItem_Draw(globalCtx, GID_RUPEE_PURPLE);
break;
} else {
Actor_SetScale(&this->actor, 0.03f);
this->actor.shape.shadowScale = 6.0f;
@@ -1231,27 +1232,40 @@ void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, s16
case GI_PRELUDE_OF_LIGHT:
color_slot = 5;
break;
case GI_STICK_UPGRADE_20:
case GI_STICK_UPGRADE_30:
color_slot = 6;
break;
case GI_NUT_UPGRADE_30:
case GI_NUT_UPGRADE_40:
color_slot = 7;
break;
}
s16* colors[7][3] = {
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
{ 177, 35, 35 }, // Bolero and Double Defense Colors
{ 115, 251, 253 }, // Serenade Color
{ 177, 122, 35 }, // Requiem Color
{ 177, 28, 212 }, // Nocturne Color
{ 255, 255, 92 }, // Prelude Color
{ 255, 255, 255} // White Color placeholder
s16* colors[9][3] = {
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
{ 177, 35, 35 }, // Bolero and Double Defense Colors
{ 115, 251, 253 }, // Serenade Color
{ 177, 122, 35 }, // Requiem Color
{ 177, 28, 212 }, // Nocturne Color
{ 255, 255, 92 }, // Prelude Color
{ 31, 152, 49 }, // Stick Upgrade Color
{ 222, 182, 20 }, // Nut Upgrade Color
{ 255, 255, 255 } // White Color placeholder
};
s16* colorsEnv[7][3] = {
{ 30, 110, 30 }, // Minuet and Magic Upgrades Colors
{ 90, 10, 10 }, // Bolero and Double Defense Colors
{ 35, 35, 177 }, // Serenade Color
{ 70, 20, 10 }, // Requiem Color
{ 100, 20, 140 }, // Nocturne Color
{ 100, 100, 10 }, // Prelude Color
{ 154, 154, 154 } // White Color placeholder
s16* colorsEnv[9][3] = {
{ 30, 110, 30 }, // Minuet and Magic Upgrades Colors
{ 90, 10, 10 }, // Bolero and Double Defense Colors
{ 35, 35, 177 }, // Serenade Color
{ 70, 20, 10 }, // Requiem Color
{ 100, 20, 140 }, // Nocturne Color
{ 100, 100, 10 }, // Prelude Color
{ 5, 50, 10 }, // Stick Upgrade Color
{ 150, 100, 5 }, // Nut Upgrade Color
{ 154, 154, 154 } // White Color placeholder
};
static Vec3f velocity = { 0.0f, 0.2f, 0.0f };
static Vec3f accel = { 0.0f, 0.05f, 0.0f };
Color_RGBA8 primColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 };
@@ -1304,7 +1318,8 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));
@@ -1364,7 +1379,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));
+7 -2
View File
@@ -713,6 +713,11 @@ void Minimap_Draw(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
// If any of these CVars are enabled, disable toggling the minimap with L, unless gEnableMapToggle is set
bool enableMapToggle =
!(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gTurboOnL", 0)) ||
CVar_GetS32("gEnableMapToggle", 0);
if (globalCtx->pauseCtx.state < 4) {
//Minimap margins
s16 X_Margins_Minimap;
@@ -781,7 +786,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
}
}
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) {
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) {
osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx));
// clang-format off
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
@@ -948,7 +953,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
}
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) {
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) {
// clang-format off
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
&D_801333E0, &D_801333E0, &D_801333E8); }
+86 -4
View File
@@ -763,7 +763,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
color->r = CVar_GetS32("gTunic_Zora_R", sTunicColors[PLAYER_TUNIC_ZORA].r);
color->g = CVar_GetS32("gTunic_Zora_G", sTunicColors[PLAYER_TUNIC_ZORA].g);
color->b = CVar_GetS32("gTunic_Zora_B", sTunicColors[PLAYER_TUNIC_ZORA].b);
} else if (!CVar_GetS32("gUseTunicsCol",0)){
} else if (!CVar_GetS32("gUseTunicsCol",0)) {
if (tunic >= 3) {
color->r = sOriginalTunicColors[0].r;
color->g = sOriginalTunicColors[0].g;
@@ -1673,7 +1673,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
Vec3s* srcTable;
s32 i;
bool canswitchrnd = false;
s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 1);
s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 0);
MinFrameCount = CVar_GetS32("gMinFrameCount", 200);
gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800);
@@ -1699,7 +1699,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
};
s16 AnimArraySize = ARRAY_COUNT(PauseMenuAnimSet);
if (CVar_GetS32("gPauseLiveLink", !0) || CVar_GetS32("gPauseTriforce", 0)) {
if (CVar_GetS32("gPauseLiveLink", 0) || CVar_GetS32("gPauseTriforce", 0)) {
uintptr_t anim = 0; // Initialise anim
if (CUR_EQUIP_VALUE(EQUIP_SWORD) >= 3) {
@@ -1712,7 +1712,6 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
// Link is idle so revert to 0
EquipedStance = 0;
}
if (SelectedMode == 16) {
// Apply Random function
s16 SwitchAtFrame = 0;
@@ -1749,6 +1748,89 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
anim = PauseMenuAnimSet[SelectedAnim][EquipedStance];
}
FrameCountSinceLastAnim++;
} else if (SelectedMode == 17) {
// Apply Random function
s16 SwitchAtFrame = 0;
s16 CurAnimDuration = 0;
s16 LastAnim;
if (FrameCountSinceLastAnim == 0) {
// When opening Kaleido this will be passed one time
SelectedAnim = (rand() % (6 - 1 + 1)) + 1;
if (SelectedAnim == 0) {
// prevent loading 0 that would result to a crash.
SelectedAnim = 1;
}
} else if (FrameCountSinceLastAnim >= 1) {
SwitchAtFrame = Animation_GetLastFrame(PauseMenuAnimSet[SelectedAnim][EquipedStance]);
CurAnimDuration = Animation_GetLastFrame(PauseMenuAnimSet[SelectedAnim][EquipedStance]);
if (SwitchAtFrame < MinFrameCount) {
// Animation frame count is lower than minimal wait time then we wait for another round.
// This will be looped to always add current animation time if that still lower than minimum time
while (SwitchAtFrame < MinFrameCount) {
SwitchAtFrame = SwitchAtFrame + CurAnimDuration;
}
} else if (CurAnimDuration >= MinFrameCount) {
// Since we have more (or same) animation time than min duration we set the wait time to animation
// time.
SwitchAtFrame = CurAnimDuration;
}
if (FrameCountSinceLastAnim >= SwitchAtFrame) {
LastAnim = SelectedAnim;
if (LastAnim==1) {
if ((CUR_EQUIP_VALUE(EQUIP_SWORD)!=PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)!= PLAYER_SHIELD_NONE)) { // if the player has a sword and shield equipped
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) || (CUR_EQUIP_VALUE(EQUIP_SHIELD) == PLAYER_SHIELD_DEKU)) { // if he's an adult or a kid with the deku shield
SelectedAnim = (rand() % (6 - 2 + 1)) + 2; // select any 5 animations that aren't the default standing anim
} else { //else if he's a child with a shield that isn't the deku shield
s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
}
} else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) != PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)==PLAYER_SHIELD_NONE)) { // if the player has a sword equipped but no shield
s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
} else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) == PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)!=PLAYER_SHIELD_NONE)) { //if the player has a shield equipped but no sword
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) || (CUR_EQUIP_VALUE(EQUIP_SHIELD) == PLAYER_SHIELD_DEKU)) {// if he's an adult or a kid with the deku shield
s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations
if (randval==5) { //if its the sword anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
} else {
s16 randval = (rand() % (4 - 2 + 1)) + 2; // 3 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
}
} else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) == PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)==PLAYER_SHIELD_NONE)) { // if the player has no sword or shield equipped
s16 randval = (rand() % (4 - 2 + 1)) + 2; // 3 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
}
} else {
SelectedAnim = 1;
}
if (SelectedAnim == 0) {
// prevent loading 0 that would result to a crash. Also makes sure default idle is every other anim
SelectedAnim = 1;
}
FrameCountSinceLastAnim = 1;
}
anim = PauseMenuAnimSet[SelectedAnim][EquipedStance];
}
FrameCountSinceLastAnim++;
} else if (SelectedMode == 15) {
// When opening Kaleido this will be passed one time
if (FrameCountSinceLastAnim < 1) {