QOL: One fix and one feature

QOL Fix: Groundpound fall damage

QOL Feature: King Bob-omb blinking eyes
This commit is contained in:
AloXado320 2021-01-18 19:19:15 -05:00
parent eee5573c7a
commit 89935c7c35
8 changed files with 76 additions and 6 deletions

View file

@ -1,6 +1,7 @@
#include <PR/ultratypes.h>
#include <PR/gbi.h>
#include "sm64.h"
#include "macros.h"
#include "surface_terrains.h"
#include "types.h"

View file

@ -25,7 +25,12 @@ extern const Gfx king_bobomb_seg5_dl_0500B118[];
extern const Gfx king_bobomb_seg5_dl_0500B150[];
extern const Gfx king_bobomb_seg5_dl_0500B188[];
extern const Gfx king_bobomb_seg5_dl_0500B278[];
#if QOL_FEATURE_KING_BOBOMB_BLINK
extern const Gfx king_bobomb_dl_eyes[];
extern const Gfx king_bobomb_dl_eyes_blink[];
#else
extern const Gfx king_bobomb_seg5_dl_0500B2D0[];
#endif
extern const Gfx king_bobomb_seg5_dl_0500B3C8[];
extern const Gfx king_bobomb_seg5_dl_0500B418[];
extern const Gfx king_bobomb_seg5_dl_0500B5F0[];

View file

@ -35,7 +35,15 @@ const GeoLayout king_bobomb_geo[] = {
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
#if QOL_FEATURE_KING_BOBOMB_BLINK
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_ALPHA, 0, 0, 0, king_bobomb_dl_eyes),
GEO_ANIMATED_PART(LAYER_ALPHA, 0, 0, 0, king_bobomb_dl_eyes_blink),
GEO_CLOSE_NODE(),
#else
GEO_ANIMATED_PART(LAYER_ALPHA, 0, 0, 0, king_bobomb_seg5_dl_0500B2D0),
#endif
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, king_bobomb_seg5_dl_0500B418),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, king_bobomb_seg5_dl_0500B6C0),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 243, 0, NULL),

View file

@ -532,6 +532,50 @@ static const Vtx king_bobomb_seg5_vertex_0500B218[] = {
{{{ 124, -158, 493}, 0, { 990, 0}, {0x00, 0xe8, 0x7c, 0xff}}},
};
#if QOL_FEATURE_KING_BOBOMB_BLINK
const Gfx king_bobomb_dl_eyes_start_block[] = {
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsSPClearGeometryMode(G_LIGHTING),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
gsSPEndDisplayList(),
};
const Gfx king_bobomb_dl_eyes_end_block[] = {
gsSPLight(&king_bobomb_seg5_lights_0500B200.l, 1),
gsSPLight(&king_bobomb_seg5_lights_0500B200.a, 2),
gsSPVertex(king_bobomb_seg5_vertex_0500B218, 6, 0),
gsSP2Triangles( 0, 1, 2, 0x0, 3, 2, 4, 0x0),
gsSP2Triangles( 2, 3, 0, 0x0, 4, 5, 3, 0x0),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPSetGeometryMode(G_LIGHTING),
gsSPEndDisplayList(),
};
const Gfx king_bobomb_dl_eyes[] = {
gsSPDisplayList(king_bobomb_dl_eyes_start_block),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, king_bobomb_seg5_texture_05004878),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsSPDisplayList(king_bobomb_dl_eyes_end_block),
gsSPEndDisplayList(),
};
const Gfx king_bobomb_dl_eyes_blink[] = {
gsSPDisplayList(king_bobomb_dl_eyes_start_block),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, king_bobomb_seg5_texture_05005078),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsSPDisplayList(king_bobomb_dl_eyes_end_block),
gsSPEndDisplayList(),
};
#else
// 0x0500B278 - 0x0500B2D0
const Gfx king_bobomb_seg5_dl_0500B278[] = {
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, king_bobomb_seg5_texture_05004878),
@ -560,6 +604,7 @@ const Gfx king_bobomb_seg5_dl_0500B2D0[] = {
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};
#endif
// 0x0500B330
static const Lights1 king_bobomb_seg5_lights_0500B330 = gdSPDefLights1(

View file

@ -55,6 +55,8 @@
/// Adds unused cracked ice object in SL
/// More information in 'unused_poundable_platform.inc.c' comment
#define QOL_FEATURE_SSL_CRACKED_ICE (0 || QOL_FEATURES)
/// Adds blinking to King Bob-omb, reusing it's unused blinking texture
#define QOL_FEATURE_KING_BOBOMB_BLINK (0 || QOL_FEATURES)
// --| Quality of life fixes
/// Fixes bug where the castle trap sound in the entrance of Bowser 1 doesn't play
@ -107,6 +109,8 @@
#define QOL_FIX_DOOR_KEY_CUTSCENE (0 || QOL_FIXES)
/// Fixes cutscene loop code (see comment in the fix)
#define QOL_FIX_CUTSCENE_LOOP (0 || QOL_FIXES)
/// Fixes fall damage height when grounpounding
#define QOL_FIX_FALL_DAMAGE_HEIGHT (0 || QOL_FIXES)
// Debug Defines
// Skip Intro Cutscene (N64)

View file

@ -593,6 +593,9 @@
#define /*0x100*/ oKingBobombUnk100 OBJECT_FIELD_S32(0x1E)
#define /*0x104*/ oKingBobombUnk104 OBJECT_FIELD_S32(0x1F)
#define /*0x108*/ oKingBobombUnk108 OBJECT_FIELD_S32(0x20)
#if QOL_FEATURE_KING_BOBOMB_BLINK
#define /*0x108*/ oKingBobombBlinkTimer OBJECT_FIELD_S32(0x21)
#endif
/* Klepto */
#define /*0x0F4*/ oKleptoDistanceToTarget OBJECT_FIELD_F32(0x1B)

View file

@ -325,4 +325,8 @@ void bhv_king_bobomb_loop(void) {
break;
}
o->oInteractStatus = 0;
#if QOL_FEATURE_KING_BOBOMB_BLINK
curr_obj_random_blink(&o->oKingBobombBlinkTimer);
#endif
}

View file

@ -67,18 +67,18 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
fallHeight = m->peakHeight - m->pos[1];
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
#if QOL_FIX_FALL_DAMAGE_HEIGHT
if (m->action == ACT_GROUND_POUND)
#else
//! Never true
if (m->actionState == ACT_GROUND_POUND) {
if (m->actionState == ACT_GROUND_POUND)
#endif
{
damageHeight = 600.0f;
} else {
damageHeight = 1150.0f;
}
#pragma GCC diagnostic pop
if (m->action != ACT_TWIRLING && m->floor->type != SURFACE_BURNING) {
if (m->vel[1] < -55.0f) {
if (fallHeight > 3000.0f) {