make remote players disappear into paintings (#76)

This commit is contained in:
Isaac0-dev 2024-06-22 02:14:51 +10:00 committed by GitHub
parent fa2ffcdcb9
commit 8ee9fb2c32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 8 deletions

View File

@ -760,11 +760,6 @@ void initiate_warp(s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3) {
sWarpDest.arg = arg3;
}
// From Surface 0xD3 to 0xFC
#define PAINTING_WARP_INDEX_START 0x00 // Value greater than or equal to Surface 0xD3
#define PAINTING_WARP_INDEX_FA 0x2A // THI Huge Painting index left
#define PAINTING_WARP_INDEX_END 0x2D // Value less than Surface 0xFD
/**
* Check if Mario is above and close to a painting warp floor, and return the
* corresponding warp node.
@ -1220,9 +1215,7 @@ static void start_demo(void) {
gChangeLevel = gCurrLevelNum;
}
if (sDemoNumber <= 6 && sDemoNumber > -1) {
gCurrDemoInput = NULL;
alloc_anim_dma_table(&gDemo, gDemoInputs, gDemoTargetAnim);
if (sDemoNumber >= 0 && sDemoNumber <= 6) {
load_patchable_table(&gDemo, sDemoNumber, false);
gCurrDemoInput = ((struct DemoInput *) gDemo.targetAnim);
} else {

View File

@ -74,6 +74,11 @@
#define PRESS_START_DEMO_TIMER 800
// From Surface 0xD3 to 0xFC
#define PAINTING_WARP_INDEX_START 0x00 // Value greater than or equal to Surface 0xD3
#define PAINTING_WARP_INDEX_FA 0x2A // THI Huge Painting index left
#define PAINTING_WARP_INDEX_END 0x2D // Value less than Surface 0xFD
struct CreditsEntry
{
/*0x00*/ u8 levelNum;

View File

@ -2145,6 +2145,21 @@ s32 execute_mario_action(UNUSED struct Object *o) {
gMarioState->marioObj->oInteractStatus = 0;
queue_particle_rumble();
// Make remote players disappear when they enter a painting
// should use same logic as in get_painting_warp_node
if (gMarioState->playerIndex != 0) {
s32 paintingIndex = gMarioState->floor->type - SURFACE_PAINTING_WARP_D3;
if (paintingIndex >= PAINTING_WARP_INDEX_START && paintingIndex < PAINTING_WARP_INDEX_END) {
if (paintingIndex < PAINTING_WARP_INDEX_FA || gMarioState->pos[1] - gMarioState->floorHeight < 80.0f) {
struct WarpNode *warpNode = &gCurrentArea->paintingWarpNodes[paintingIndex];
if (warpNode->id != 0) {
set_mario_action(gMarioState, ACT_DISAPPEARED, 0);
gMarioState->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
}
}
}
}
return gMarioState->particleFlags;
}