Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "Salvo" mode #8

Open
retailcoder opened this issue Sep 4, 2018 · 5 comments
Open

Add a "Salvo" mode #8

retailcoder opened this issue Sep 4, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@retailcoder
Copy link
Member

Currently blocked by #7

Once there's an IGameMode interface, the game needs a SalvoMode implementation so that each turn consists of:

  • "Marking" positions on the enemy grid (click to mark, right-click to un-mark).
  • Handle a double-click to confirm marked positions and shoot them all at once.
  • Number of positions to mark depends on the number of friendly ships still afloat.
  • Number of shots per ship could be configurable, e.g. Carrier could shoot 2 positions if unharmed, or 1 if damaged; or, each ship afloat gives player 1 position to mark per turn.

The GridState enum could have a MarkedPosition value that recycles the InvalidPosition member's value, which is currently only used in the deployment phase. Because of Worksheet UI limitations with the conditional formatting of the grid, no new enum values can be added.

@retailcoder retailcoder added the enhancement New feature or request label Sep 4, 2018
@ghost
Copy link

ghost commented Oct 10, 2018

Brilliant idea but a huge advantage for player 1. A larger grid would reduce the advantage.

I would still extend the GridState enum.

IGridViewCommands
'@description("Instructs the view to that all Players have are ready to go.")
Public Sub OnPlayersComplete(Players as Dictionary)
End Sub

Adding an OnPlayersComplete method to the IGridViewCommands interface would give you a clear point in which to switch from setup to battle mode (no matter what strategy is used). At this point it you could change the Conditional Formatting rules. Dropping (-1, 0, 1, 2) aka (Unknown, PreviewShipPosition, ShipPosition, InvalidPosition) and targeting (3, 4, 5, 6, 7) aka (PreviousMiss, PreviousHit, ?, ?, ?).

@retailcoder
Copy link
Member Author

retailcoder commented Oct 12, 2018

Adding an OnPlayersComplete method to the IGridViewCommands interface would give you a clear point in which to switch from setup to battle mode

It's the other way around: IGridViewEvents fires HumanPlayerReady from the view, when HideInformationBox is invoked and ViewMode is Player1 or Player2. TBH I don't really like this "ViewMode" state, there's gotta be a better way to do this.

This is part of why the prompt "needs" to pop for each ship 😒

@ghost
Copy link

ghost commented Oct 12, 2018

Actually commenting out the deployment prompt has no effect on game play (other then not having to click it).

Public Sub ShowInfoBeginDeployShip(ByVal ShipName As String)
Mode = FleetPosition
ShowFleetStatus
' ShowInformation Replace(InfoBoxPlaceSHIPs, "%SHIP%", UCase$(ShipName))
End Sub

When I do my rewrite, I plan on moving the deployment message from the marquee to a passive information box over the opposing grid.

@ghost
Copy link

ghost commented Oct 12, 2018

Just to clarify, I think the controller should fire a OnPlayersComplete(Players as Dictionary) event after the players are ready and before the battle begins. This would give the View a clear starting point to use to transition between modes.

I also think that passing both players to the View, during this event, would unlocks the View's potential to be customized. Say for instance you wanted to add a "Player 1 vs Player 2` transition (btw IPlayer should have a name field), or if you wanted to show all the ships in PlayAIvsAI or what every.

@retailcoder
Copy link
Member Author

The IGameController interface introduced in v1.1 came with a renaming of GameController to StandardGameController; a SalvoModeGameController could be implemented without affecting the standard controller code, and the common logic could be extracted into a new GameControllerBase class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant