MartianZoo / solarnet

Solarnet, an open-source game engine for the board game Terraforming Mars. Pets, a specification language for game component behaviors in said game.
Apache License 2.0
15 stars 2 forks source link

Custom requirements (a la custom instructions) #11

Open kevinb9n opened 1 year ago

kevinb9n commented 1 year ago

Blocks Mining{Guild,Area,Rights}.

kevinb9n commented 1 year ago

Once I add CustomRequirement this should be possible. Not pretty, but possible.

This: MrTile,
      PROD[LandArea(HAS MrTile, @bonus(Steel)): Steel \
        OR LandArea(HAS MrTile, @bonus(Titanium)): Titanium]

I think this would give correct behavior wrt https://boardgamegeek.com/thread/2663453/article/39570510#39570510

kevinb9n commented 1 year ago

Retitled this issue to be about custom requirements in general.

For issues that simply allow more cards to be implemented, I'm mostly just postponing them. But this one seems to block quite a few cards, and gets some mileage toward "proof-of-conceptness".

// Cutting Edge Technology
PlayCard<CardFront(HAS CardRequirement)>:: -2 Owed

// Vitor
CardFront(HAS PositiveVpIcon): 3

// Credicor; similar: Advertising, Spin-Off Department
CardFront(HAS 20 Cost): 4 

// Credicor
UseAction<StandardProject(HAS 20 Cost)>: 4

// Desert Settler
metric = OwnedTile<MarsArea(HAS 5 Row)>

// Polar Explorer
requirement = 3 OwnedTile<MarsArea(HAS 8 Row)>

// Mining Guild
Tile<MarsArea(HAS Bonus<Steel> OR Bonus<Titanium>)>: PROD[Steel]

// Mining Area
This: MaTile, PROD[LandArea(HAS MaTile, Bonus<Steel>): Steel \
    OR LandArea(HAS MaTile, Bonus<Titanium>): Titanium]

... and supporting this shouldn't be super hard (?) following the example of CustomInstruction.

kevinb9n commented 1 year ago

Hmmmm, it seems like many of these do have workarounds, though.

Probably I should try to get these working in such ways first and only consider if this feature if it really simplifies enough things enough.