Implement/match Ambulance::Tickle (#1021)

This commit is contained in:
Christian Semmler
2024-06-12 09:13:52 -04:00
committed by GitHub
parent ebc200bea3
commit 1f360929cb
23 changed files with 166 additions and 118 deletions

View File

@@ -998,7 +998,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
FUN_100648f0(tranInfo, m_unk0x404);
}
else if (p_unk0x0a) {
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
if (actor != NULL) {
actor->SetState(4);
@@ -1435,7 +1435,7 @@ MxResult LegoAnimationManager::Tickle()
return SUCCESS;
}
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
LegoROI* roi;
if (actor == NULL || (roi = actor->GetROI()) == NULL) {
@@ -1658,7 +1658,7 @@ MxBool LegoAnimationManager::FUN_100623a0(AnimInfo& p_info)
LegoEntityListCursor cursor(entityList);
LegoEntity* entity;
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
while (cursor.Next(entity)) {
if (entity != actor && entity->IsA("LegoPathActor")) {
@@ -1861,7 +1861,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
if (world != NULL) {
PurgeExtra(FALSE);
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
if (actor == NULL || actor->GetWorldSpeed() <= 20.0f) {
MxU32 i;
for (i = 0; i < m_numAllowedExtras && m_extras[i].m_roi != NULL; i++) {
@@ -2478,7 +2478,7 @@ MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, Mx
{
MxU32 local2c = 12;
float destScale = ((rand() * 0.5) / 32767.0) + 0.25;
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
if (actor == NULL) {
return FALSE;
@@ -2760,7 +2760,7 @@ void LegoAnimationManager::FUN_100648f0(LegoTranInfo* p_tranInfo, MxLong p_unk0x
m_unk0x43c = viewROI->GetLocal2World();
p_tranInfo->m_unk0x2c = m_unk0x43c;
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
if (actor != NULL) {
actor->SetState(4);
actor->SetWorldSpeed(0.0f);

View File

@@ -426,7 +426,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b6b0(MxLong p_time)
MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
{
LegoROI* viewROI = VideoManager()->GetViewROI();
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
if (m_tranInfo != NULL && m_tranInfo->m_unk0x14 && m_tranInfo->m_location != -1 && actor != NULL) {
if (m_unk0x64 != NULL) {

View File

@@ -171,8 +171,8 @@ void LegoGameState::SetActor(MxU8 p_actorId)
m_actorId = p_actorId;
}
LegoPathActor* oldActor = CurrentActor();
SetCurrentActor(NULL);
LegoPathActor* oldActor = UserActor();
SetUserActor(NULL);
IslePathActor* newActor = new IslePathActor();
const char* actorName = LegoActor::GetActorName(m_actorId);
@@ -192,14 +192,14 @@ void LegoGameState::SetActor(MxU8 p_actorId)
}
newActor->ClearFlag(0x02);
SetCurrentActor(newActor);
SetUserActor(newActor);
}
// FUNCTION: LEGO1 0x10039910
void LegoGameState::RemoveActor()
{
LegoPathActor* actor = CurrentActor();
SetCurrentActor(NULL);
LegoPathActor* actor = UserActor();
SetUserActor(NULL);
delete actor;
m_actorId = 0;
}
@@ -208,7 +208,7 @@ void LegoGameState::RemoveActor()
void LegoGameState::ResetROI()
{
if (m_actorId) {
LegoPathActor* actor = CurrentActor();
LegoPathActor* actor = UserActor();
if (actor) {
LegoROI* roi = actor->GetROI();
@@ -887,7 +887,7 @@ void LegoGameState::SwitchArea(Area p_area)
case e_garadoor:
LoadIsle();
VariableTable()->SetVariable("VISIBILITY", "Hide Gas");
CurrentActor()->ResetWorldTransform(FALSE);
UserActor()->ResetWorldTransform(FALSE);
NavController()->UpdateLocation(59); // LCAMZG1 in g_cameraLocations
VideoManager()->Get3DManager()->SetFrustrum(90, 0.1f, 250.0f);
InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_GaraDoor, NULL);
@@ -901,11 +901,11 @@ void LegoGameState::SwitchArea(Area p_area)
}
else {
SetCameraControllerFromIsle();
CurrentActor()->ResetWorldTransform(TRUE);
UserActor()->ResetWorldTransform(TRUE);
AnimationManager()->Resume();
}
((IslePathActor*) CurrentActor())
((IslePathActor*) UserActor())
->SpawnPlayer(
p_area,
TRUE,
@@ -920,9 +920,9 @@ void LegoGameState::SwitchArea(Area p_area)
case e_unk33:
LoadIsle();
SetCameraControllerFromIsle();
CurrentActor()->ResetWorldTransform(TRUE);
UserActor()->ResetWorldTransform(TRUE);
AnimationManager()->Resume();
((IslePathActor*) CurrentActor())
((IslePathActor*) UserActor())
->SpawnPlayer(
p_area,
TRUE,

View File

@@ -467,8 +467,8 @@ MxBool FUN_1003ef60()
GameState()->m_currentArea != LegoGameState::e_elevdown &&
GameState()->m_currentArea != LegoGameState::e_garadoor &&
GameState()->m_currentArea != LegoGameState::e_polidoor) {
if (CurrentActor() == NULL || !CurrentActor()->IsA("TowTrack")) {
if (CurrentActor() == NULL || !CurrentActor()->IsA("Ambulance")) {
if (UserActor() == NULL || !UserActor()->IsA("TowTrack")) {
if (UserActor() == NULL || !UserActor()->IsA("Ambulance")) {
MxU32 unk0x18 = act1State->GetUnknown18();
if (unk0x18 != 10 && unk0x18 != 8 && unk0x18 != 3) {

View File

@@ -67,9 +67,9 @@ LegoNavController* NavController()
}
// FUNCTION: LEGO1 0x10015790
LegoPathActor* CurrentActor()
LegoPathActor* UserActor()
{
return LegoOmni::GetInstance()->GetCurrentActor();
return LegoOmni::GetInstance()->GetUserActor();
}
// FUNCTION: LEGO1 0x100157a0
@@ -137,9 +137,9 @@ void SetROIVisible(const char* p_name, MxBool p_visible)
}
// FUNCTION: LEGO1 0x10015880
void SetCurrentActor(LegoPathActor* p_currentActor)
void SetUserActor(LegoPathActor* p_userActor)
{
LegoOmni::GetInstance()->SetCurrentActor(p_currentActor);
LegoOmni::GetInstance()->SetUserActor(p_userActor);
}
// FUNCTION: LEGO1 0x10015890