Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 89dc424

Browse files
committed
Allow player to make multiple deliveries while holding MOVE_UP or MOVE_DOWN
1 parent 97436aa commit 89dc424

File tree

1 file changed

+31
-41
lines changed

1 file changed

+31
-41
lines changed

Activities/GameActivity.cpp

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,8 +1684,7 @@ void GameActivity::Update()
16841684

16851685
else if (m_ViewState[player] == ViewState::LandingZoneSelect)
16861686
{
1687-
// Continuously display LZ message
1688-
g_FrameMan.SetScreenText("Choose your landing zone...", ScreenOfPlayer(player));
1687+
g_FrameMan.SetScreenText("Choose your landing zone... Hold UP or DOWN to place multiple orders", ScreenOfPlayer(player));
16891688

16901689
// Save the x pos so we can see which direction the user is moving it
16911690
float prevLZX = m_LandingZone[player].m_X;
@@ -1731,24 +1730,15 @@ void GameActivity::Update()
17311730
}
17321731

17331732
// Interface for the craft AI post-delivery mode
1734-
if (m_PlayerController[player].IsState(PRESS_DOWN))// || m_PlayerController[player].IsState(PRESS_SECONDARY))
1735-
{
1736-
if (m_AIReturnCraft[player])
1737-
g_GUISound.SelectionChangeSound()->Play(player);
1738-
else
1739-
g_GUISound.UserErrorSound()->Play(player);
1733+
if (m_PlayerController[player].IsState(PRESS_DOWN)) {
1734+
if (m_AIReturnCraft[player]) { g_GUISound.SelectionChangeSound()->Play(player); }
17401735

1741-
m_AIReturnCraft[player] = false;
1742-
}
1743-
else if (m_PlayerController[player].IsState(PRESS_UP))// || m_PlayerController[player].IsState(PRESS_SECONDARY))
1744-
{
1745-
if (!m_AIReturnCraft[player])
1746-
g_GUISound.SelectionChangeSound()->Play(player);
1747-
else
1748-
g_GUISound.UserErrorSound()->Play(player);
1736+
m_AIReturnCraft[player] = false;
1737+
} else if (m_PlayerController[player].IsState(PRESS_UP)) {
1738+
if (!m_AIReturnCraft[player]) { g_GUISound.SelectionChangeSound()->Play(player); }
17491739

1750-
m_AIReturnCraft[player] = true;
1751-
}
1740+
m_AIReturnCraft[player] = true;
1741+
}
17521742

17531743
// Player canceled the order while selecting LZ - can't be done in pregame
17541744
if (m_PlayerController[player].IsState(PRESS_SECONDARY) && m_ActivityState != ActivityState::PreGame)
@@ -1761,29 +1751,29 @@ void GameActivity::Update()
17611751
g_GUISound.UserErrorSound()->Play(player);
17621752
// Flash the same actor, jsut to show the control went back to him
17631753
m_pPieMenu[player]->DoDisableAnimation();
1764-
}
1765-
// Player is done selecting LZ,
1766-
else if (m_PlayerController[player].IsState(PRESS_FACEBUTTON) || m_PlayerController[player].IsState(PRESS_PRIMARY))
1767-
{
1768-
// Set the LZ cursor to be just over terran, to avoid getting stuck at halfway interpolating there
1769-
m_LandingZone[player].m_Y = 0;
1770-
m_LandingZone[player].m_Y = g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10);
1771-
// Complete the purchase by getting the order from the BuyGUI, build it, and stuff it into a delivery
1772-
CreateDelivery(player);
1773-
// If there are no other Actors on this team, just view the LZ we have selected
1774-
if (!g_MovableMan.GetNextTeamActor(team))
1775-
{
1776-
m_ObservationTarget[player] = m_LandingZone[player];
1777-
m_ViewState[player] = ViewState::Observe;
1778-
}
1779-
// If there are other guys around, switch back to normal view
1780-
else
1781-
m_ViewState[player] = ViewState::Normal;
1782-
// Stop displaying the LZ message
1783-
g_FrameMan.ClearScreenText(ScreenOfPlayer(player));
1784-
// Flash the same actor, jsut to show the control went back to him
1785-
m_pPieMenu[player]->DoDisableAnimation();
1786-
}
1754+
} else if (m_PlayerController[player].IsState(PRESS_FACEBUTTON) || m_PlayerController[player].IsState(PRESS_PRIMARY)) {
1755+
m_LandingZone[player].m_Y = 0;
1756+
float lzOffsetY = 0;
1757+
// Holding up or down will allow the player to make multiple orders without exiting the delivery phase. TODO: this should probably have a cooldown?
1758+
if (!m_PlayerController[player].IsState(MOVE_UP) && !m_PlayerController[player].IsState(MOVE_DOWN)) {
1759+
m_LandingZone[player].m_Y = g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10);
1760+
if (!g_MovableMan.GetNextTeamActor(team)) {
1761+
m_ObservationTarget[player] = m_LandingZone[player];
1762+
m_ViewState[player] = ViewState::Observe;
1763+
} else {
1764+
m_ViewState[player] = ViewState::Normal;
1765+
}
1766+
g_FrameMan.ClearScreenText(ScreenOfPlayer(player));
1767+
m_pPieMenu[player]->DoDisableAnimation();
1768+
} else {
1769+
// Place the new marker above the cursor so that they don't intersect with each other.
1770+
lzOffsetY += m_AIReturnCraft[player] ? -32.0F : 32.0F;
1771+
}
1772+
m_LandingZone[player].m_Y = g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10) + lzOffsetY;
1773+
CreateDelivery(player);
1774+
// Revert the Y offset so that the cursor doesn't flinch.
1775+
m_LandingZone[player].m_Y -= lzOffsetY;
1776+
}
17871777

17881778
bool wrapped = g_SceneMan.ForceBounds(m_LandingZone[player]);
17891779

0 commit comments

Comments
 (0)