mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-27 02:14:18 +00:00
Implement/match Act3::ShootPizza and Act3::ShootDonut (#1203)
* Implement/match `Act3::LaunchPizza` and `Act3::LaunchDonut` * Match Helicopter::HandleControl * Rename * Adjust total function count * Rename
This commit is contained in:
committed by
GitHub
parent
07def56326
commit
c2ee761f81
@@ -344,9 +344,9 @@ void Act2Actor::FUN_100192a0(undefined4 p_param)
|
||||
|
||||
newPosition = g_unk0x100f0db8[p_param].m_position;
|
||||
newDirection = g_unk0x100f0db8[p_param].m_direction;
|
||||
LegoPathBoundary* newBoundary = m_controller->GetPathBoundary(g_unk0x100f0db8[p_param].m_boundary);
|
||||
LegoPathBoundary* newBoundary = m_pathController->GetPathBoundary(g_unk0x100f0db8[p_param].m_boundary);
|
||||
|
||||
MxResult sts = m_controller->FUN_10048310(
|
||||
MxResult sts = m_pathController->FUN_10048310(
|
||||
m_grec,
|
||||
m_roi->GetWorldPosition(),
|
||||
m_roi->GetWorldDirection(),
|
||||
|
||||
@@ -12,8 +12,8 @@ DECOMP_SIZE_ASSERT(Act3Ammo, 0x1a0)
|
||||
// FUNCTION: BETA10 0x1001d648
|
||||
Act3Ammo::Act3Ammo()
|
||||
{
|
||||
m_flags = 0;
|
||||
m_unk0x15c = 0;
|
||||
m_ammoFlag = 0;
|
||||
m_a3 = NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100538a0
|
||||
@@ -36,6 +36,38 @@ void Act3Ammo::Destroy(MxBool p_fromDestructor)
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10053980
|
||||
// STUB: BETA10 0x1001d8b3
|
||||
MxResult Act3Ammo::FUN_10053980(Act3* p_a3, MxU32 p_isDonut, MxS32 p_index)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10053b40
|
||||
// STUB: BETA10 0x1001db2a
|
||||
MxResult Act3Ammo::FUN_10053b40(Vector3& p_srcLoc, Vector3& p_srcDir, Vector3& p_srcUp)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10053cb0
|
||||
// STUB: BETA10 0x1001ddf4
|
||||
MxResult Act3Ammo::FUN_10053cb0(LegoPathController* p_controller, LegoPathBoundary* p_boundary, MxFloat p_unk0x19c)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10053d30
|
||||
// STUB: BETA10 0x1001df73
|
||||
MxResult Act3Ammo::FUN_10053d30(LegoPathController* p_controller, MxFloat p_unk0x19c)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10054050
|
||||
// STUB: BETA10 0x1001e362
|
||||
void Act3Ammo::VTable0x70(float p_time)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "legoutils.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "mxdebug.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
#include "scripts.h"
|
||||
|
||||
@@ -152,9 +153,10 @@ MxLong Helicopter::HandleClick()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100035e0
|
||||
// FUNCTION: BETA10 0x1002a587
|
||||
MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxU32 ret = 0;
|
||||
MxLong result = 0;
|
||||
MxAtomId script;
|
||||
|
||||
switch (GameState()->GetCurrentAct()) {
|
||||
@@ -169,79 +171,98 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
break;
|
||||
}
|
||||
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
if (p_param.m_unk0x28 == 1) {
|
||||
MxU32 isPizza = FALSE;
|
||||
|
||||
switch (p_param.m_clickedObjectId) {
|
||||
case IsleScript::c_HelicopterArms_Ctl:
|
||||
if (*g_act3Script == script) {
|
||||
((Act3*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
}
|
||||
else if (m_state->GetUnkown8() != 0) {
|
||||
else if (m_state->m_unk0x08 != 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
Exit();
|
||||
GameState()->m_currentArea = LegoGameState::e_unk66;
|
||||
ret = 1;
|
||||
result = 1;
|
||||
break;
|
||||
case IsleScript::c_Helicopter_TakeOff_Ctl: {
|
||||
if (*g_act3Script == script) {
|
||||
break;
|
||||
}
|
||||
|
||||
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
|
||||
if (m_state->GetUnkown8() == 0) {
|
||||
state->SetUnknown18(4);
|
||||
m_state->SetUnknown8(1);
|
||||
if (m_state->m_unk0x08 == 0) {
|
||||
state->m_unk0x018 = 4;
|
||||
m_state->m_unk0x08 = 1;
|
||||
m_world->RemoveActor(this);
|
||||
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterTakeOff_Anim, NULL);
|
||||
SetState(0);
|
||||
}
|
||||
ret = 1;
|
||||
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
case IsleScript::c_Helicopter_Land_Ctl:
|
||||
if (*g_act3Script == script) {
|
||||
break;
|
||||
}
|
||||
if (m_state->GetUnkown8() == 2) {
|
||||
m_state->SetUnknown8(3);
|
||||
|
||||
if (m_state->m_unk0x08 == 2) {
|
||||
m_state->m_unk0x08 = 3;
|
||||
m_world->RemoveActor(this);
|
||||
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterLand_Anim, NULL);
|
||||
SetState(LegoPathActor::c_bit3);
|
||||
}
|
||||
ret = 1;
|
||||
|
||||
result = 1;
|
||||
break;
|
||||
case Act3Script::c_Helicopter_Pizza_Ctl:
|
||||
if (*g_act3Script != script) {
|
||||
break;
|
||||
}
|
||||
ret = 1;
|
||||
/* fall through */
|
||||
|
||||
isPizza = TRUE;
|
||||
case Act3Script::c_Helicopter_Donut_Ctl:
|
||||
if (*g_act3Script != script) {
|
||||
break;
|
||||
}
|
||||
|
||||
assert(m_pathController);
|
||||
|
||||
if (m_world && m_world->GetCamera()) {
|
||||
Mx3DPointFloat loc, dir, lookat;
|
||||
loc = m_world->GetCamera()->GetWorldLocation();
|
||||
dir = m_world->GetCamera()->GetWorldDirection();
|
||||
lookat = dir;
|
||||
float scale = 3;
|
||||
lookat *= scale;
|
||||
lookat += loc;
|
||||
Mx3DPointFloat v68, v7c, v90(0, 1, 0), va4;
|
||||
Mx3DPointFloat location, direction, lookat;
|
||||
|
||||
location = m_world->GetCamera()->GetWorldLocation();
|
||||
direction = m_world->GetCamera()->GetWorldDirection();
|
||||
|
||||
lookat = direction;
|
||||
lookat *= 3.0f;
|
||||
location += lookat;
|
||||
|
||||
Mx3DPointFloat v68, va4, up;
|
||||
Mx3DPointFloat v90(0, 1, 0);
|
||||
v68 = m_world->GetCamera()->GetWorldUp();
|
||||
va4.EqualsCross(&v68, &dir);
|
||||
v7c.EqualsCross(&va4, &v90);
|
||||
if (ret) {
|
||||
if (((Act3*) m_world)->FUN_100727e0(m_controller, loc, dir, v7c)) {
|
||||
va4.EqualsCross(&v68, &direction);
|
||||
up.EqualsCross(&va4, &v90);
|
||||
|
||||
if (isPizza) {
|
||||
if (((Act3*) m_world)->ShootPizza(m_pathController, location, direction, up) != SUCCESS) {
|
||||
MxTrace("Shoot pizza failed\n");
|
||||
break;
|
||||
}
|
||||
else if (((Act3*) m_world)->FUN_10072980(m_controller, loc, dir, v7c)) {
|
||||
}
|
||||
else {
|
||||
if (((Act3*) m_world)->ShootDonut(m_pathController, location, direction, up) != SUCCESS) {
|
||||
MxTrace("Shoot donut failed\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ret = 1;
|
||||
|
||||
result = 1;
|
||||
break;
|
||||
/* case Act3Script::c_Helicopter_Info_Ctl: */
|
||||
case IsleScript::c_Helicopter_Info_Ctl:
|
||||
@@ -250,14 +271,21 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
Exit();
|
||||
}
|
||||
ret = 1;
|
||||
else if (*g_act3Script == script) {
|
||||
((Act3*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
}
|
||||
|
||||
result = 1;
|
||||
break;
|
||||
// Unknown object ID
|
||||
case 0x1d:
|
||||
ret = 1;
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10003c20
|
||||
|
||||
Reference in New Issue
Block a user