Tweak: CTMC/CSMC for treasure mini game reward and set loser green rupee as junk (#2652)

* set green rupee to junk category for ctmc

* allow treasure chest game reward to use CSTMC and cleanup logic
This commit is contained in:
Adam Bird
2023-03-31 22:22:45 -04:00
committed by GitHub
parent 21a3bd9f5c
commit 545bc21fbe
2 changed files with 11 additions and 7 deletions

View File

@@ -624,12 +624,14 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
EnBox_CreateExtraChestTextures();
int cvar = CVarGetInteger("gChestSizeAndTextureMatchesContents", 0);
int agonyCVar = CVarGetInteger("gChestSizeDependsStoneOfAgony", 0);
int stoneCheck = CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY);
int cstmc = CVarGetInteger("gChestSizeAndTextureMatchesContents", 0);
int requiresStoneAgony = CVarGetInteger("gChestSizeDependsStoneOfAgony", 0);
GetItemCategory getItemCategory;
if (play->sceneNum != SCENE_TAKARAYA && cvar > 0 && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
int isVanilla = cstmc == 0 || (requiresStoneAgony && !CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)) ||
(play->sceneNum == SCENE_TAKARAYA && this->dyna.actor.room != 6); // Exclude treasure game chests except for the final room
if (!isVanilla) {
getItemCategory = this->getItemEntry.getItemCategory;
// If they don't have bombchu's yet consider the bombchu item major
if (this->getItemEntry.gid == GID_BOMBCHU && INV_CONTENT(ITEM_BOMBCHU) != ITEM_BOMBCHU) {
@@ -645,7 +647,8 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
}
}
if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 3) && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
// Change size
if (!isVanilla && (cstmc == 1 || cstmc == 3)) {
switch (getItemCategory) {
case ITEM_CATEGORY_JUNK:
case ITEM_CATEGORY_SMALL_KEY:
@@ -673,7 +676,8 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
}
}
if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 2) && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
// Change texture
if (!isVanilla && (cstmc == 1 || cstmc == 2)) {
switch (getItemCategory) {
case ITEM_CATEGORY_MAJOR:
this->boxBodyDL = gGoldTreasureChestChestFrontDL;