* forgot to rename the files to grassanity

* updated draw method to fix regrowing grass
This commit is contained in:
Fredrik Andréasson 2025-01-16 05:49:49 +01:00
parent 4cc675ab4b
commit 6df13afccf
3 changed files with 15 additions and 15 deletions

View File

@ -1,11 +1,11 @@
#include "ShuffleGrass.h" #include "grassanity.h"
#include "soh_assets.h" #include "soh_assets.h"
#include "static_data.h" #include "static_data.h"
extern "C" { extern "C" {
#include "variables.h" #include "variables.h"
#include "overlays/actors/ovl_En_Kusa/z_en_kusa.h" #include "overlays/actors/ovl_En_Kusa/z_en_kusa.h"
#include <objects/gameplay_field_keep/gameplay_field_keep.h> #include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "objects/object_kusa/object_kusa.h" #include "objects/object_kusa/object_kusa.h"
extern PlayState* gPlayState; extern PlayState* gPlayState;
} }
@ -14,21 +14,21 @@ extern void EnItem00_DrawRandomizedItem(EnItem00* enItem00, PlayState* play);
extern "C" void EnKusa_RandomizerDraw(Actor* thisx, PlayState* play) { extern "C" void EnKusa_RandomizerDraw(Actor* thisx, PlayState* play) {
//float grassSize = 0.5f; static Gfx* dLists[] = { (Gfx*)gFieldBushDL, (Gfx*)object_kusa_DL_000140, (Gfx*)object_kusa_DL_000140 };
auto grassActor = ((EnKusa*)thisx);
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
//Matrix_Scale(grassSize, grassSize, grassSize, MTXMODE_APPLY);
gDPSetGrayscaleColor(POLY_OPA_DISP++, 0, 255, 0, 255); gDPSetGrayscaleColor(POLY_OPA_DISP++, 0, 255, 0, 255);
gSPGrayscale(POLY_OPA_DISP++, true);
//gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), if (Flags_GetRandomizerInf(grassActor->grassIdentity.randomizerInf) == 0) {
// G_MTX_MODELVIEW | G_MTX_LOAD); gSPGrayscale(POLY_OPA_DISP++, true);
}
if (thisx->params == -255) { if (grassActor->actor.flags & ACTOR_FLAG_GRASS_DESTROYED) {
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)object_kusa_DL_000140); Gfx_DrawDListOpa(play, (Gfx*)object_kusa_DL_0002E0);
} else { } else {
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFieldBushDL); Gfx_DrawDListOpa(play, dLists[grassActor->actor.params & 3]);
} }
gSPGrayscale(POLY_OPA_DISP++, false); gSPGrayscale(POLY_OPA_DISP++, false);
@ -41,7 +41,7 @@ uint8_t EnKusa_RandomizerHoldsItem(EnKusa* grassActor, PlayState* play) {
uint8_t isDungeon = Rando::StaticData::GetLocation(rc)->IsDungeon(); uint8_t isDungeon = Rando::StaticData::GetLocation(rc)->IsDungeon();
uint8_t grassSetting = Rando::Context::GetInstance()->GetOption(RSK_GRASSANITY).GetContextOptionIndex(); uint8_t grassSetting = Rando::Context::GetInstance()->GetOption(RSK_GRASSANITY).GetContextOptionIndex();
// Don't pull randomized item if pot isn't randomized or is already checked // Don't pull randomized item if grass isn't randomized or is already checked
if (!IS_RANDO || (grassSetting == RO_SHUFFLE_GRASS_OVERWORLD && isDungeon) || if (!IS_RANDO || (grassSetting == RO_SHUFFLE_GRASS_OVERWORLD && isDungeon) ||
(grassSetting == RO_SHUFFLE_GRASS_DUNGEONS && !isDungeon) || (grassSetting == RO_SHUFFLE_GRASS_DUNGEONS && !isDungeon) ||
Flags_GetRandomizerInf(grassActor->grassIdentity.randomizerInf) || Flags_GetRandomizerInf(grassActor->grassIdentity.randomizerInf) ||

View File

@ -1,5 +1,5 @@
#ifndef SHUFFLEGRASS_H #ifndef GRASSANITY_H
#define SHUFFLEGRASS_H #define GRASSANITY_H
#include <z64.h> #include <z64.h>
#include <soh/OTRGlobals.h> #include <soh/OTRGlobals.h>
@ -14,4 +14,4 @@ void EnKusa_RandomizerInit(void* actorRef);
void ShuffleGrass_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs); void ShuffleGrass_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs);
#endif //SHUFFLEGRASS_H #endif //GRASSANITY_H

View File

@ -16,7 +16,7 @@
#include "soh/Notification/Notification.h" #include "soh/Notification/Notification.h"
#include "soh/SaveManager.h" #include "soh/SaveManager.h"
#include "soh/Enhancements/randomizer/ShuffleFairies.h" #include "soh/Enhancements/randomizer/ShuffleFairies.h"
#include "soh/Enhancements/randomizer/ShuffleGrass.h" #include "soh/Enhancements/randomizer/grassanity.h"
extern "C" { extern "C" {
#include "macros.h" #include "macros.h"