Skip to content

Commit 05383c4

Browse files
committed
Add rumble to Fortuna exploding cutscene
1 parent 8fbef7a commit 05383c4

2 files changed

Lines changed: 122 additions & 1 deletion

File tree

patches/actor_cutscene_tagging.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ RECOMP_PATCH void ActorCutscene_Draw(ActorCutscene* this) {
220220
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->iwork[0]);
221221
gDPSetEnvColor(gMasterDisp++, 255, 255, 00, this->iwork[0]);
222222
gSPDisplayList(gMasterDisp++, aOrbDL);
223+
224+
// @recomp: Add rumble to this explosion
225+
if (gCsFrameCount == 100) {
226+
gControllerRumbleTimers[0] = 4;
227+
}
223228
break;
224229

225230
case ACTOR_CS_COMMANDER:

patches/game_fixes.c

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,4 +1638,120 @@ RECOMP_PATCH void SectorX_SxSpyborg_Update(SxSpyborg* this) {
16381638
Math_SmoothStepToF(&this->fwork[45], 0.0f, 1.0f, 0.05f, 0);
16391639
}
16401640
}
1641-
#endif
1641+
#endif
1642+
1643+
#if 1
1644+
RECOMP_PATCH s32 FoBase_ExplodeCs(FoBase* this) {
1645+
Vec3f dest;
1646+
Vec3f src;
1647+
Player* player;
1648+
s32 csState = 0;
1649+
1650+
if (this->swork[0] == 1) {
1651+
FoBase_BurnEffects(this, 8596);
1652+
player = &gPlayer[0];
1653+
csState = 1;
1654+
1655+
switch (this->swork[1]) {
1656+
case 0:
1657+
AUDIO_PLAY_SFX(NA_SE_EARTHQUAKE, this->sfxSource, 0);
1658+
AUDIO_PLAY_SFX(NA_SE_EXPLOSION_DEMO, this->sfxSource, 0);
1659+
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50);
1660+
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50);
1661+
1662+
player->cam.eye.x = this->fwork[4] = this->obj.pos.x;
1663+
player->cam.eye.y = this->fwork[5] = this->obj.pos.y + 500.0f;
1664+
player->cam.eye.z = this->fwork[6] = this->obj.pos.z + 4000.0f;
1665+
1666+
player->cam.at.x = this->obj.pos.x;
1667+
player->cam.at.y = this->obj.pos.y;
1668+
player->cam.at.z = this->obj.pos.z;
1669+
1670+
this->fwork[7] = 0.0f;
1671+
this->fwork[8] = 0.0f;
1672+
this->fwork[9] = 10.0f;
1673+
1674+
this->timer_050 = 1000;
1675+
1676+
this->swork[1] = 1;
1677+
break;
1678+
1679+
case 1:
1680+
if (this->timer_050 == 930) {
1681+
this->swork[1] = 2;
1682+
}
1683+
1684+
this->fwork[7] += 0.5f;
1685+
if (this->fwork[7] >= 360.0f) {
1686+
this->fwork[7] = 0.0f;
1687+
}
1688+
1689+
Math_SmoothStepToF(&this->fwork[9], 80.0f, 0.01f, 10000.0f, 0.0f);
1690+
Math_SmoothStepToF(&this->fwork[4], this->obj.pos.x + 0.0f, 0.02f, 10000.0f, 0.0f);
1691+
Math_SmoothStepToF(&this->fwork[5], this->obj.pos.y + 500.0f, 0.02f, 10000.0f, 0.0f);
1692+
Math_SmoothStepToF(&this->fwork[6], this->obj.pos.z + 1500.0f, 0.02f, 10000.0f, 0.0f);
1693+
1694+
// @port: Add rumble to this cutscene
1695+
gControllerRumbleTimers[0] = 60;
1696+
break;
1697+
1698+
case 2:
1699+
if (this->timer_050 == 870) {
1700+
this->swork[1] = 3;
1701+
}
1702+
1703+
this->fwork[7] += 3.0f;
1704+
if (this->fwork[7] >= 360.0f) {
1705+
this->fwork[7] = 0.0f;
1706+
}
1707+
1708+
Math_SmoothStepToF(&this->fwork[4], this->obj.pos.x + 0.0f, 0.02f, 10000.0f, 0.0f);
1709+
Math_SmoothStepToF(&this->fwork[5], this->obj.pos.y + 1500.0f, 0.02f, 10000.0f, 0.0f);
1710+
Math_SmoothStepToF(&this->fwork[6], this->obj.pos.z + 1500.0f, 0.02f, 10000.0f, 0.0f);
1711+
1712+
// @port: Add rumble to this cutscene
1713+
gControllerRumbleTimers[0] = 60;
1714+
break;
1715+
1716+
case 3:
1717+
if (this->timer_050 == 770) {
1718+
this->swork[1] = 4;
1719+
}
1720+
1721+
Math_SmoothStepToF(&this->fwork[9], 10.0f, 0.01f, 10000.0f, 0.0f);
1722+
Math_SmoothStepToF(&this->fwork[4], this->obj.pos.x + 4000.0f, 0.02f, 10000.0f, 0.0f);
1723+
Math_SmoothStepToF(&this->fwork[5], this->obj.pos.y + 2000.0f, 0.02f, 10000.0f, 0.0f);
1724+
Math_SmoothStepToF(&this->fwork[6], this->obj.pos.z + 1500.0f, 0.02f, 10000.0f, 0.0f);
1725+
break;
1726+
1727+
case 4:
1728+
csState = 2;
1729+
break;
1730+
}
1731+
1732+
if (this->swork[1] < 4) {
1733+
src.x = this->fwork[4] - this->obj.pos.x;
1734+
src.y = this->fwork[5] - this->obj.pos.y;
1735+
src.z = this->fwork[6] - this->obj.pos.z;
1736+
1737+
Matrix_Translate(gCalcMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_NEW);
1738+
Matrix_RotateY(gCalcMatrix, M_DTOR * this->fwork[7], MTXF_APPLY);
1739+
Matrix_RotateX(gCalcMatrix, M_DTOR * this->fwork[8], MTXF_APPLY);
1740+
Matrix_MultVec3f(gCalcMatrix, &src, &dest);
1741+
1742+
player->cam.eye.x = dest.x;
1743+
player->cam.eye.y = dest.y;
1744+
player->cam.eye.z = dest.z;
1745+
1746+
player->cam.at.x = this->obj.pos.x;
1747+
player->cam.at.y = this->obj.pos.x;
1748+
player->cam.at.z = this->obj.pos.x;
1749+
1750+
player->cam.at.x += COS_DEG(this->timer_050 * 60.0f) * this->fwork[9];
1751+
player->cam.at.y += SIN_DEG(this->timer_050 * 179.0f) * this->fwork[9];
1752+
}
1753+
}
1754+
1755+
return csState;
1756+
}
1757+
#endif

0 commit comments

Comments
 (0)