mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 18:04:06 +00:00
Implement/match Ambulance::Tickle (#1021)
This commit is contained in:
committed by
GitHub
parent
ebc200bea3
commit
1f360929cb
@@ -149,7 +149,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
}
|
||||
else if (objectId == IsleScript::c_hho027en_RunAnim) {
|
||||
m_state->m_unk0x08 = 1;
|
||||
CurrentWorld()->PlaceActor(CurrentActor());
|
||||
CurrentWorld()->PlaceActor(UserActor());
|
||||
HandleClick();
|
||||
m_unk0x172 = 0;
|
||||
TickleManager()->RegisterClient(this, 40000);
|
||||
@@ -173,7 +173,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
}
|
||||
}
|
||||
else if (objectId == IsleScript::c_hpz055pa_RunAnim || objectId == IsleScript::c_hpz057ma_RunAnim) {
|
||||
CurrentWorld()->PlaceActor(CurrentActor());
|
||||
CurrentWorld()->PlaceActor(UserActor());
|
||||
HandleClick();
|
||||
SpawnPlayer(LegoGameState::e_pizzeriaExterior, TRUE, 0);
|
||||
m_unk0x172 = 0;
|
||||
@@ -197,7 +197,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
}
|
||||
}
|
||||
else if (objectId == IsleScript::c_hps117bd_RunAnim) {
|
||||
CurrentWorld()->PlaceActor(CurrentActor());
|
||||
CurrentWorld()->PlaceActor(UserActor());
|
||||
HandleClick();
|
||||
SpawnPlayer(LegoGameState::e_unk33, TRUE, 0);
|
||||
m_unk0x172 = 0;
|
||||
@@ -245,12 +245,12 @@ MxLong Ambulance::HandleClick()
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_ambulance);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
m_time = Timer()->GetTime();
|
||||
m_unk0x16a = CurrentActor()->GetActorId();
|
||||
m_unk0x16a = UserActor()->GetActorId();
|
||||
|
||||
Enter();
|
||||
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL);
|
||||
@@ -294,10 +294,58 @@ void Ambulance::FUN_10037060()
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10037160
|
||||
// FUNCTION: LEGO1 0x10037160
|
||||
// FUNCTION: BETA10 0x100237df
|
||||
MxResult Ambulance::Tickle()
|
||||
{
|
||||
// TODO
|
||||
if (m_unk0x172 == 0) {
|
||||
m_unk0x172 = 1;
|
||||
}
|
||||
else if (m_lastAction == IsleScript::c_noneIsle) {
|
||||
IsleScript::Script objectId;
|
||||
|
||||
switch ((rand() % 12) + 1) {
|
||||
case 1:
|
||||
objectId = IsleScript::c_ham034ra_PlayWav;
|
||||
break;
|
||||
case 2:
|
||||
objectId = IsleScript::c_ham035ra_PlayWav;
|
||||
break;
|
||||
case 3:
|
||||
objectId = IsleScript::c_ham036ra_PlayWav;
|
||||
break;
|
||||
case 4:
|
||||
objectId = IsleScript::c_hpz037ma_PlayWav;
|
||||
break;
|
||||
case 5:
|
||||
objectId = IsleScript::c_sns078pa_PlayWav;
|
||||
break;
|
||||
case 6:
|
||||
objectId = IsleScript::c_ham039ra_PlayWav;
|
||||
break;
|
||||
case 7:
|
||||
objectId = IsleScript::c_ham040cl_PlayWav;
|
||||
break;
|
||||
case 8:
|
||||
objectId = IsleScript::c_ham041cl_PlayWav;
|
||||
break;
|
||||
case 9:
|
||||
objectId = IsleScript::c_ham042cl_PlayWav;
|
||||
break;
|
||||
case 10:
|
||||
objectId = IsleScript::c_ham043cl_PlayWav;
|
||||
break;
|
||||
case 11:
|
||||
objectId = IsleScript::c_ham044cl_PlayWav;
|
||||
break;
|
||||
case 12:
|
||||
objectId = IsleScript::c_ham045cl_PlayWav;
|
||||
break;
|
||||
}
|
||||
|
||||
PlayAction(objectId);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ MxLong InfoCenterEntity::VTable0x50(MxParam& p_param)
|
||||
{
|
||||
switch (GameState()->GetCurrentAct()) {
|
||||
case LegoGameState::Act::e_act1: {
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -70,8 +70,8 @@ MxLong GasStationEntity::VTable0x50(MxParam& p_param)
|
||||
if (state->GetUnknown18() != 8) {
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -94,8 +94,8 @@ MxLong HospitalEntity::VTable0x50(MxParam& p_param)
|
||||
if (act1State->GetUnknown18() != 10) {
|
||||
act1State->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -118,8 +118,8 @@ MxLong PoliceEntity::VTable0x50(MxParam& p_param)
|
||||
if (state->GetUnknown18() != 10) {
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -140,8 +140,8 @@ MxLong BeachHouseEntity::VTable0x50(MxParam& p_param)
|
||||
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -161,8 +161,8 @@ MxLong RaceStandsEntity::VTable0x50(MxParam& p_param)
|
||||
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
|
||||
@@ -77,8 +77,8 @@ void Helicopter::Exit()
|
||||
|
||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
||||
GameState()->SetCurrentArea(LegoGameState::e_copter);
|
||||
if (CurrentActor() && CurrentActor()->IsA("IslePathActor")) {
|
||||
((IslePathActor*) CurrentActor())
|
||||
if (UserActor() && UserActor()->IsA("IslePathActor")) {
|
||||
((IslePathActor*) UserActor())
|
||||
->SpawnPlayer(
|
||||
LegoGameState::e_unk55,
|
||||
TRUE,
|
||||
@@ -115,9 +115,9 @@ MxLong Helicopter::HandleClick()
|
||||
|
||||
AnimationManager()->FUN_1005f6d0(FALSE);
|
||||
|
||||
if (CurrentActor()) {
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()) {
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,9 @@ MxLong IslePathActor::Notify(MxParam& p_param)
|
||||
void IslePathActor::Enter()
|
||||
{
|
||||
m_roi->SetVisibility(FALSE);
|
||||
if (CurrentActor() != this) {
|
||||
if (UserActor() != this) {
|
||||
m_previousVel = NavController()->GetMaxLinearVel();
|
||||
m_previousActor = CurrentActor();
|
||||
m_previousActor = UserActor();
|
||||
if (m_previousActor) {
|
||||
m_previousActor->ResetWorldTransform(FALSE);
|
||||
m_previousActor->SetUserNavFlag(FALSE);
|
||||
@@ -91,7 +91,7 @@ void IslePathActor::Enter()
|
||||
|
||||
NavController()->ResetMaxLinearVel(m_maxLinearVel);
|
||||
|
||||
SetCurrentActor(this);
|
||||
SetUserActor(this);
|
||||
FUN_1001b660();
|
||||
FUN_10010c30();
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void IslePathActor::Exit()
|
||||
SetUserNavFlag(FALSE);
|
||||
|
||||
if (m_previousActor != NULL) {
|
||||
SetCurrentActor(m_previousActor);
|
||||
SetUserActor(m_previousActor);
|
||||
NavController()->ResetMaxLinearVel(m_previousVel);
|
||||
m_previousActor->ResetWorldTransform(TRUE);
|
||||
m_previousActor->SetUserNavFlag(TRUE);
|
||||
|
||||
@@ -37,8 +37,8 @@ MxLong JukeBoxEntity::Notify(MxParam& p_param)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
((Isle*) FindWorld(*g_isleScript, 0))->SetDestLocation(LegoGameState::e_jukeboxw);
|
||||
|
||||
@@ -49,9 +49,9 @@ void Pizzeria::CreateState()
|
||||
undefined4 Pizzeria::HandleClick()
|
||||
{
|
||||
if (FUN_1003ef60() && m_pizzaMissionState->m_unk0x0c == 0) {
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
if (!CurrentActor()->IsA("SkateBoard")) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
if (!UserActor()->IsA("SkateBoard")) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,13 +84,13 @@ MxLong SkateBoard::HandleClick()
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_skateboard);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::TransitionType::e_mosaic, 50, FALSE, TRUE);
|
||||
|
||||
if (GameState()->GetActorId() != CurrentActor()->GetActorId()) {
|
||||
if (!CurrentActor()->IsA("SkateBoard")) {
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
if (GameState()->GetActorId() != UserActor()->GetActorId()) {
|
||||
if (!UserActor()->IsA("SkateBoard")) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (!CurrentActor()->IsA("SkateBoard")) {
|
||||
if (!UserActor()->IsA("SkateBoard")) {
|
||||
Enter();
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_SkateDashboard, NULL);
|
||||
GetCurrentAction().SetObjectId(-1);
|
||||
@@ -154,7 +154,7 @@ void SkateBoard::ActivateSceneActions()
|
||||
if (!m_act1state->m_unk0x022) {
|
||||
m_act1state->m_unk0x022 = TRUE;
|
||||
|
||||
MxMatrix mat(CurrentActor()->GetROI()->GetLocal2World());
|
||||
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
|
||||
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5);
|
||||
|
||||
AnimationManager()
|
||||
|
||||
Reference in New Issue
Block a user