Add option to remove Yoshi in settings

This commit is contained in:
Llennpie 2021-10-28 19:45:56 -04:00
parent 7ad78dd09e
commit 64745d3abc
5 changed files with 28 additions and 1 deletions

View File

@ -7,13 +7,15 @@
// so o->oHomeY is never updated.
static s16 sYoshiHomeLocations[] = { 0, -5625, -1364, -5912, -1403, -4609, -1004, -5308 };
u8 enableYoshi;
void bhv_yoshi_init(void) {
o->oGravity = 2.0f;
o->oFriction = 0.9f;
o->oBuoyancy = 1.3f;
o->oInteractionSubtype = INT_SUBTYPE_NPC;
if (save_file_get_total_star_count(gCurrSaveFileNum - 1, 0, 24) < 120 || sYoshiDead == TRUE) {
if (save_file_get_total_star_count(gCurrSaveFileNum - 1, 0, 24) < 120 || sYoshiDead == TRUE || enableYoshi == 0) {
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
}
}
@ -22,6 +24,10 @@ void yoshi_walk_loop(void) {
UNUSED s16 sp26;
s16 sp24 = o->header.gfx.unk38.animFrame;
if (enableYoshi == 0) {
o->oAction = YOSHI_ACT_WALK_JUMP_OFF_ROOF;
}
o->oForwardVel = 10.0f;
sp26 = object_step();
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oYoshiTargetYaw, 0x500);
@ -47,6 +53,10 @@ void yoshi_idle_loop(void) {
s16 chosenHome;
UNUSED s16 sp1C = o->header.gfx.unk38.animFrame;
if (enableYoshi == 0) {
o->oAction = YOSHI_ACT_WALK_JUMP_OFF_ROOF;
}
if (o->oTimer > 90) {
chosenHome = random_float() * 3.99;

View File

@ -0,0 +1,6 @@
#ifndef YoshiInc
#define YoshiInc
extern u8 enableYoshi;
#endif

View File

@ -645,6 +645,7 @@ namespace MoonInternal {
ImGui::SliderInt("###rumble_strength", (int*)&configRumbleStrength, 0, 50);
ImGui::Checkbox("Precache Textures", &configPrecacheRes);
ImGui::Checkbox("Skip Intro", &configSkipIntro);
ImGui::Checkbox("Enable Yoshi", &enable_yoshi);
}
ImGui::End();

View File

@ -24,6 +24,8 @@ extern "C" {
#include "game/level_update.h"
#include "game/mario.h"
#include "sm64.h"
#include "game/behavior_actions.h"
#include "game/behaviors/yoshi.inc.h"
}
bool camera_frozen;
@ -36,11 +38,13 @@ bool show_menu_bar;
float camera_speed = 0.8f;
bool enable_cap_logo;
bool enable_overall_buttons;
bool enable_yoshi;
// Second Check
bool has_changed_cap_logo;
bool has_changed_overall_buttons;
bool has_changed_yoshi;
namespace MoonInternal {
@ -66,6 +70,7 @@ namespace MoonInternal {
enable_shadows = true;
enable_cap_logo = true;
enable_overall_buttons = true;
enable_yoshi = false;
MoonInternal::load_cc_directory();
@ -142,6 +147,10 @@ namespace MoonInternal {
saturn_toggle_m_buttons();
has_changed_overall_buttons = false;
}
// Yoshi
enableYoshi = (enable_yoshi) ? 1 : 0;
}});
}
}

View File

@ -17,5 +17,6 @@ extern bool show_menu_bar;
extern float camera_speed;
extern bool enable_cap_logo;
extern bool enable_overall_buttons;
extern bool enable_yoshi;
#endif