triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.29k stars 381 forks source link

2.6 Resources to be tested by conditions #12642

Open TheDog-GH opened 3 weeks ago

TheDog-GH commented 3 weeks ago

The ability to test Resources and trigger actions as currently it is very limited.

Apparently a wish for many years, here are a few links https://forums.triplea-game.org/topic/2617/haveresources-as-a-condition-option https://forums.triplea-game.org/topic/587/allow-triggers-to-give-multiple-resources

Project Feature Cards https://github.com/orgs/triplea-game/projects/9/views/1

@WCSumpton @Cernelius

WCSumpton commented 3 weeks ago

This is actually two different requests. The first is the ability to check the amount of resources available for a given player. The second deals with the many different ways resources are handled. objectiveValue (deals only with PUs), resource and resourceCount, costPUs (deprecated), costResources (replaces costPUs).

I submitted a pull request, haveResources, which would deal with the first feature, but I pulled it down because it was combined with isAI. Also, there was a request for this condition to also check on projected resources.

As to the second feature, there should be a discussion on how to handle these multiple paths. Programming wise, they could all be combined into one method, but you could still have multiple xml options. (costResources, giveResources, etc...). This could also include a way to set resources so that values like "-9999" are not use to zero out a resource.

Cheers...

TheDog-GH commented 3 weeks ago

As you have given it the most time/thought it your call on how to proceed.

If you want to split it in two then do so and will link to it/them.

Shall I take it out of the Top/To Do column for now, until your are ready?

WCSumpton commented 3 weeks ago

You can leave it for now. I will give status reports on progress. At the moment I'm still working on the AvailableResources project.

Cheers...

WCSumpton commented 3 weeks ago

Speaking of request there support for air battles.

Also I know that we have discussed adding territoryEffects to AA attacks. (Can't find that discussion),

Cheers...

TheDog-GH commented 3 weeks ago

How about these? https://forums.triplea-game.org/topic/3797/paratroopers-and-u-boats/8 https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread/357