[Rando] Grassanity (#4889)
* * fixes softlock when talking to Mido without Kokiri Emerald after killing Gohma * * moved scene check to hook * moved vanilla conditioon into GameInteractor_Should * * corrected hook condition * removed 'this' * * reverted GameInteractor and hook_handlers * changed actor to use existing hook * * updated kokiri emerald conditions * * missed parentheses * * Overworld pretty much done. * Known issue with Market Night + 2 bushes in KF * Known issue with Adult bush in ZR * * fixed locations post-merge * * renamed option and types to 'GRASSANITY' * changed grassnity to be a combobox option * added first 5 deku tree locations * * color is a sickly green when containing a check * added ZR 14 (adult only bush on the platform, not the same?) * * forgot to rename the files to grassanity * updated draw method to fix regrowing grass * Removed old WIP locacc files * * removed comments in bush actor * added rest of Deku Tree plus MQ * Added DC + MQ * Fixed DC incorrect pos value on 1 loc * JJB done minus after big octo * Added BotW + MQ locs * WIP grottos * Grottos done * Workaround to allow market grass during night * Seperated the 2 KF bushes into 4 checks * Hints and additional formatting * Slightly less ghastly color * Corrected the 2 JJB locs * * Renaming and removal of some locs. * Restructure in z_en_kusa.c to leave vanilla code alone. * Formatting. * * see previous (forgot to stage woops) * * Clear grassIdentity on item drop * Added check for RC on RandoDraw function Results in no extra dupe drops, and instantly correct the color of the grass when cut instead of on collecting the item. * * fixed dupe location spoiler names which caused occasional crash when writing spoiler log * * reverse should * * fixed faulty locations * * corrected KAK location names and some formatting * * Fixed market bushes by tree not working at night * * merged ZR near PoH grass into a single loc * * Changed to ShipInit (might be missing something?) * Corrected Should in z_en_kusa.c to use original draw func when setting is Off * * Renaming to Shuffle Grass * * minor fix * * keyboard fail lol * * suggestions * * removed unused function * * move grass locations into ShuffleGrass * move grass GameInteractor into GIVanillaBehavior * minor fixes * * pre-removed locs from dungeon.cpp * * pre-remove from context.cpp * * re-added Grass to context * * added Dana's amazing custom bush models * using CSMC to display flowers based on "contents" * * added Dana's grass models * refactor to lessen the clutter in the switch * * removed fairy case * Added back missing Deku Tree locations * formatting * Update soh/soh/Enhancements/randomizer/location_access/overworld/zoras_river.cpp Co-authored-by: Philip Dubé <serprex@users.noreply.github.com> * re-added suggestion from previous * removed wrong line >.> --------- Co-authored-by: Philip Dubé <serprex@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
|
||||
#include "objects/object_kusa/object_kusa.h"
|
||||
#include "vt.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_THROW_ONLY)
|
||||
|
||||
@@ -126,6 +127,10 @@ s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) {
|
||||
void EnKusa_DropCollectible(EnKusa* this, PlayState* play) {
|
||||
s16 dropParams;
|
||||
|
||||
if (!GameInteractor_Should(VB_GRASS_DROP_ITEM, true, this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this->actor.params & 3) {
|
||||
case ENKUSA_TYPE_0:
|
||||
case ENKUSA_TYPE_2:
|
||||
@@ -138,11 +143,9 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) {
|
||||
break;
|
||||
case ENKUSA_TYPE_1:
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("NoRandomDrops"), 0)) {
|
||||
}
|
||||
else if (CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) {
|
||||
} else if (CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) {
|
||||
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_SEEDS);
|
||||
}
|
||||
else if (Rand_ZeroOne() < 0.5f) {
|
||||
} else if (Rand_ZeroOne() < 0.5f) {
|
||||
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_SEEDS);
|
||||
} else {
|
||||
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_HEART);
|
||||
@@ -193,8 +196,8 @@ void EnKusa_SpawnFragments(EnKusa* this, PlayState* play) {
|
||||
|
||||
scaleIndex = (s32)(Rand_ZeroOne() * 111.1f) & 7;
|
||||
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, &pos, -100, 64, 40, 3, 0, sFragmentScales[scaleIndex], 0, 0,
|
||||
80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_KEEP, gCuttableShrubStalkDL);
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, &pos, -100, 64, 40, 3, 0, sFragmentScales[scaleIndex], 0, 0, 80,
|
||||
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_KEEP, gCuttableShrubStalkDL);
|
||||
|
||||
pos.x = this->actor.world.pos.x + (dir->x * this->actor.scale.x * 40.0f);
|
||||
pos.y = this->actor.world.pos.y + (dir->y * this->actor.scale.y * 40.0f) + 10.0f;
|
||||
@@ -206,8 +209,8 @@ void EnKusa_SpawnFragments(EnKusa* this, PlayState* play) {
|
||||
|
||||
scaleIndex = (s32)(Rand_ZeroOne() * 111.1f) % 7;
|
||||
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, &pos, -100, 64, 40, 3, 0, sFragmentScales[scaleIndex], 0, 0,
|
||||
80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_KEEP, gCuttableShrubTipDL);
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, &pos, -100, 64, 40, 3, 0, sFragmentScales[scaleIndex], 0, 0, 80,
|
||||
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_KEEP, gCuttableShrubTipDL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,8 +218,9 @@ void EnKusa_SpawnBugs(EnKusa* this, PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
Actor* bug = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1, true);
|
||||
Actor* bug =
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1, true);
|
||||
|
||||
if (bug == NULL) {
|
||||
break;
|
||||
@@ -288,6 +292,10 @@ void EnKusa_WaitObject(EnKusa* this, PlayState* play) {
|
||||
EnKusa_SetupMain(this);
|
||||
}
|
||||
|
||||
if (!GameInteractor_Should(VB_GRASS_SETUP_DRAW, true, this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->actor.draw = EnKusa_Draw;
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED;
|
||||
|
||||
@@ -20,6 +20,7 @@ typedef struct EnKusa {
|
||||
/* 0x0150 */ ColliderCylinder collider;
|
||||
/* 0x019C */ s16 timer;
|
||||
/* 0x019E */ s8 objBankIndex;
|
||||
/* */ GrassIdentity grassIdentity;
|
||||
} EnKusa; // size = 0x01A0
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user