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

feat: add new chat commands, updates a bit the commands gui, give nukes to GMs #6245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Dec 5, 2024

Even more GM tools

Change player team

This GM command allow the GM to change players from teams manually, no need for doing it just one player per turn. It is still done at the end of the round, but the teams can be reassigned freely until them.

End game

This command from the GM just ends the game, no need for voting, it may also be forced to end immediatelly. It also declares one team as victorious, but things like MHQ will keep doing what it does to decide who won the game.

Nuclear Strike & Nuclear Strike Custom

Just more modern implementations of the old command "Nuke", these can only be called by the GM.

GameListener gamePlayerStrategicAction

Triggers an event that can be picked up by MHQ whenever a player uses a nuclear strike or something else.

GUI commands

Implements some intelligence/automation for GUI Commands (the chat commands shown in a GUI). If So now there are the PlayerArgument, UnitArgument, TeamArgument, so they list the players, teams and units. This allows for a more rich experience when using those tools instead of just random numbers appearing out of nowhere.

Draw nuke

Now nukes from Arty should be drawn on the game too.

}

private JComponent getArgumentComponent(Argument<?> argument) {
if (argument instanceof CoordXArgument intArg) {

Check notice

Code scanning / CodeQL

Chain of 'instanceof' tests Note

This if block performs a chain of 13 type tests - consider alternatives, e.g. polymorphism or the visitor pattern.
1));
}

private JSpinner createSpinner(CoordXArgument coordX) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'coordX' is never used.
1));
}

private JSpinner createSpinner(CoordYArgument coordY) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'coordY' is never used.
1));
}

private JComboBox<String> createPlayerComboBox(PlayerArgument playerArgument) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'playerArgument' is never used.
return comboBox;
}

private JComboBox<String> createUnitComboBox(UnitArgument unitArgument) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'unitArgument' is never used.
return comboBox;
}

private JComboBox<String> createTeamsComboBox(TeamArgument teamArgument) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'teamArgument' is never used.
@@ -73,4 +73,6 @@
* @param event
*/
default void gameUnitChange(GameEvent event) { }

default void gamePlayerStrategicAction(GamePlayerStrategicActionEvent e) { }

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'e' is never used.
@@ -364,8 +398,23 @@
return requestedTeam;
}

/**

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TWGameManager.legacyProcessTeamChangeRequest
should be avoided because it has been deprecated.
@Scoppio Scoppio force-pushed the even-more-gm-tools branch from e2d0846 to b224fc2 Compare December 5, 2024 22:49
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.94%. Comparing base (2e45dc0) to head (b224fc2).
Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6245      +/-   ##
============================================
- Coverage     28.99%   28.94%   -0.06%     
- Complexity    13982    13984       +2     
============================================
  Files          2652     2669      +17     
  Lines        268296   268820     +524     
  Branches      47764    47815      +51     
============================================
+ Hits          77799    77805       +6     
- Misses       186615   187131     +516     
- Partials       3882     3884       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Scoppio Scoppio added the GM Tools All things related to the GM Tools project. label Dec 6, 2024
Copy link
Member

@HammerGS HammerGS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and seems to be working.

@HammerGS
Copy link
Member

HammerGS commented Dec 9, 2024

@Scoppio Just want to confirm this is complete and ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GM Tools All things related to the GM Tools project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants