-
Notifications
You must be signed in to change notification settings - Fork 291
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: New GM Commands, princess commands on map menu, graphics for some explosions #6183
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6183 +/- ##
============================================
- Coverage 29.09% 29.06% -0.03%
- Complexity 13981 13982 +1
============================================
Files 2647 2647
Lines 267373 267642 +269
Branches 47650 47674 +24
============================================
+ Hits 77793 77794 +1
- Misses 185696 185964 +268
Partials 3884 3884 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
…nditions, orbital bombardment, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you requested I review this.
I don’t have enough working knowledge of the mm side of our codebase, so try not to review mm-specific stuff unless it’s super basic - and even then, I prefer not to get involved. Didn’t want you thinking I was just ignoring your request. :)
I'm pretty excited to see this in progress. I've been turning over code in my head for making command line orbital bombardment work. I was going to borrow code from the nuke commands. I hope these commands see implementation! |
Random thought...how hard would it be to create a "GM Command GUI" a simple GUI that lists the commands and lets you input the values |
I think its doable, I will do those in small steps. I want to release those first the way they are. I just need to make sure the terrain damage is not too bad. |
Thanks, I picked the nuke as an example and turns out it is pretty standard. Actually the nuke doesnt take things into considerations like VTOL. It also is very expensive because it reachs the entire board and the scale of it is madness (amount of damage, garanteed kill on hit, etc). So I had to reimplement alot of stuff, but there is still too much code duplication here, and not everything of the Terrain Factor and terrain damage is properly implemented. I think I will implement the damage terrain in small steps until it is completely implemented, but at least it will be "good enough" for the narrative play. |
1117d85
to
9f36d77
Compare
This was a request from the forums If reworking the GM commands, can we get the Princess Ignore command on a right click menu somehow? |
I will take a look, depending of complexity I can push for a next release |
Added Nuke graphics, added controls for allied Princesses on the contextual map menu (right mouse button click on the map). |
@@ -96,7 +96,7 @@ public static List<Coords> findCFWarningsMovement(Game g, Entity e, Board b) { | |||
|
|||
List<Coords> hexesToCheck = new ArrayList<Coords>(); | |||
if (pos != null) { | |||
hexesToCheck = pos.allAtDistanceOrLess(range + 1); | |||
hexesToCheck = pos.allAtDistanceOrLess(range); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the bug in the function so the fix isnt necessary anymore
return menu; | ||
} else { | ||
|
||
if (client.getLocalPlayer().getGameMaster()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to move those things to another class, will do it on a next PR
int lv = nhex.getLevel(); | ||
if (lv < level) { | ||
surrounded = false; | ||
if (nhex != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another instance where it may very well be null and there was no null guard
* Returns a list of all coordinates at the given distance (dist - 1) | ||
* and anything less than dist as well. | ||
*/ | ||
public ArrayList<Coords> allLessThanDistance(int dist) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
places in the code that were using the previous version of the function allAtDistanceOrLess
were changed to use this one instead. This implements the behavior that the previous/bugged version had (same functionality)
if (hex == null) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another null check guard that was missing
if (destHex == null) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really want to give this program a pass with SonarQube
/** | ||
* @author dirk | ||
*/ | ||
public class SpecialHexDisplay implements Serializable { | ||
private static final long serialVersionUID = 27470795993329492L; | ||
|
||
public enum Type { | ||
ARTILLERY_AUTOHIT(new MegaMekFile(Configuration.hexesDir(), "artyauto.gif").toString()) { | ||
ARTILLERY_AUTOHIT(new MegaMekFile(Configuration.hexesDir(), "artyauto.gif")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so far, changing this from string to MegaMegFile seem to be working as expected. This also gave more flexibility on how to access those image files.
public Image getDefaultImage() { | ||
if (type.useFolderStructure()) { | ||
return type.getImage(imageSignature); | ||
} | ||
return type.getDefaultImage(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allows to access files in folders, very handy for images that are split in multiple pieces
aca9459
to
5b203a4
Compare
I saw the comment about feature creep, and agree that we should pause new things and only work testing things. Then get this merged. Plus of course polishing anything in here that needs polish. |
"You cannot start a fire in a tornado" gets printed to the round report movement phase. |
This is interesting and new... the only way for it to print this message is if it tries to ignite a hex, let me run a test here quickly. |
Space tornados!!!!If the server currently allows you to set planetary conditions in space... I'd say its either a feature or a bug, could go both ways. I'm not against it, mostly because I want the tools to give narrative freedom to people. Fire wont ignite on a tornadoAbout the cant start fire in a tornado, it seems to be correct IF the current weather is a tornado. It will print in the phase you are, so if you run the command to start a fire or to start a firestorm while a tornado is happening then the server won't allow the hexes to ignite |
Using an orbital bombardment with a larger than default radius will throw a lot of errors in the log, and won't render correctly.
|
…ather in space, no fire in space
Fixed error with radius different than 4, it uses the bomb-hit graphic for other radii values (ortillery with default radius keeps the original image) Added safeguards for the firestorm, firestart and change weather, now they cant be activated when in space (they still work for ground and atmosphere games). |
9efb970
to
a2e0cdb
Compare
a2e0cdb
to
7da1ad0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and everything seems to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and everything seems to work.
New GM Commands & Much More!
All the commands listed here are GM only, they allow the player who is a Game Master more freedom to change the game to the way they want the story to play out.
They would allow co-op games and RPG or dramatized games to have more events and give the GM more control over how they go.
Examples:
Custom scenario, a battle is happening while a space battle goes, every turn there is a chance a stray shot from a warship hits the ground mid battle.
A F5 hurrinane is moving towards the base and you need to evacuate the vehicles and people as fast as possible before they all die.
In the middle of the battle the day becomes night as the moon engulfs the sun.
The star of the system is pulsating, during round 10 it goes super nova, the planet you are playing is far away enough to not be instantaneously destroyed, but the temperature gets extreme and the atmosphere of the planetoid is stripped instantaneously, everyone that was outside a battlemek is dead. Is it worth keeping the fight?
GamemasterServerCommand
New type of ServerCommand, can only be used by gamemaster, it also has an automatic parser for its arguments with automatic error handling. Also has automated "documentation", using the descriptions for each variable as input for itself.
This extra complexity also allows for an automatic "dialog" setup that I implemented (its only in a functional state, not a good state).
Added a new type of server command, the gamemaster server command, it has automated parsing, error handling, argument assertion, automated documentation (for /help), it also implements the necessary tools to automate the GM Menu commands.
New server commands accept both positional arguments and named arguments. Positional and named arguments can be used in the same command but positional arguments must come first. Named arguments may be used in any order (after positional arguments if those are being used). Example:
Command KILL - When you want something DEAD
/kill <id>
Kills (ID) unit at GM's discretion, needs to be enabled in the game options.
Command NOSMOKE - Clear skies
/nosmoke
Clears all smoke clouds in the board.
Command WEATHER - Change planetary conditions
/weather [...args]
Allows the GM to change the weather on demand
Command Disaster - Disasters
/gomorrah <type>
Cast a disaster (like in the old days of SimCity) to spicy things up (WIP)!
The cheat is a homage to SimCity "gomorrah" cheat code which would start a nuclear disaster.
Command OB - Orbital Bombardment
/ob <x> <y> [damage=#] [radius=4]
Calls in orbital bombardment at the end of the next weapons firing phase (WIP)!
Command ChangeOwner - Traitor 2.0
/changeOwner <UnitID> <PlayerID>
Gives a unit to a player.
Command Rescue
/rescue <UnitID>
Rescue from the board a single unit. A "forced flee" if you will.
(Very crude) GM command dialogs
Allows the gamemaster to manually enter the commands
Features:
GM Contextual Menu (Map Menu)
Ps: Some screenshots were taken early in development, so mileage may vary.
Added more functions to the map menu for GMs, most notable being:
Quick Access to Princess controls
Graphics for BIG BOOM
Nukes and orbital bombardment have graphics.
Support for BIG BOOM
Exploding a nuke on the game is a sure way to grind everything to a halt, your big powerful PC may simply sit down crunching numbers with CPU at 100% for many minutes, and the result is a 5 miles long report with all the units taking tens of thousands of damage points. I added an early exit check that identifies if the unit is already "devastated", if true then it consider the damage processing for that unit done and goes for the next one.
With this small change, now releasing nukes that boil lakes and turn cities into craters is nothing but childsplay!