Port Dampe behavior to vanilla (#1364)

* Port Dampe behavior to vanilla

* Add Dampe winning to Enhanced preset
This commit is contained in:
Josh Bodner 2022-09-19 19:58:10 -07:00 committed by GitHub
commit e97ba37a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 7 deletions

View file

@ -408,7 +408,7 @@ s32 EnTk_ChooseReward(EnTk* this) {
f32 luck;
s32 reward;
if (gSaveContext.n64ddFlag && !Flags_GetCollectible(gGlobalCtx, 0x1F) && this->heartPieceSpawned == 0) {
if ((gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && !Flags_GetCollectible(gGlobalCtx, 0x1F) && this->heartPieceSpawned == 0) {
return 3;
}
@ -604,7 +604,7 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
this->rewardTimer = 0;
if (this->validDigHere == 1 || gSaveContext.n64ddFlag) {
if (this->validDigHere == 1 || gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) {
rewardOrigin.x = 0.0f;
rewardOrigin.y = 0.0f;
rewardOrigin.z = -40.0f;
@ -620,21 +620,21 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
// merging in dampe tour fix seems messy, so i'm just wrapping this whole thing
// in an n64dd check for now
if(gSaveContext.n64ddFlag) {
if (gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) {
if (this->currentReward == 3) {
/*
* Upgrade the purple rupee reward to the heart piece if this
* is the first grand prize dig.
*/
if (!(gSaveContext.itemGetInf[1] & 0x1000) && !gSaveContext.n64ddFlag) {
if (!(gSaveContext.itemGetInf[1] & 0x1000) && !(gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0))) {
gSaveContext.itemGetInf[1] |= 0x1000;
this->currentReward = 4;
} else if (gSaveContext.n64ddFlag && !Flags_GetCollectible(gGlobalCtx, 0x1F) && this->heartPieceSpawned == 0) {
} else if ((gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && !Flags_GetCollectible(gGlobalCtx, 0x1F) && this->heartPieceSpawned == 0) {
this->currentReward = 4;
}
}
if (gSaveContext.n64ddFlag && this->currentReward == 4) {
if ((gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && this->currentReward == 4) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, rewardPos.x, rewardPos.y, rewardPos.z, 0,
0, 0, 0x1F06);
this->heartPieceSpawned = 1;
@ -670,7 +670,7 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
if (this->skelAnime.curFrame >= 32.0f && this->rewardTimer == 10) {
/* Play a reward sound shortly after digging */
if (!gSaveContext.n64ddFlag && this->validDigHere == 0) {
if (!(gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && this->validDigHere == 0) {
/* Bad dig spot */
Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR);
} else if (this->currentReward == 4) {