Terraforming-mars: Stratospheric Birds in combination with Dirigibles can lock out the game

Created on 14 Jun 2020  Â·  6Comments  Â·  Source: bafolts/terraforming-mars

Steps to reproduce:
1) Play Dirigibles, have 1 floater on it
2) Try to play Stratospheric Birds and use 1 floater from Dirigibles to pay for

As result you will be asked to "Select card to remove 1 floater from" but you will have no cards with floaters to the moment and game will be locked out to continue.

@vincentneko @bafolts any strategy to fix that kind of bugs?

bug

Most helpful comment

We can add some logic to the play part of the card to test if there is no floater to remove.
If it's the case, we can suppose that the floater has been consumed by Dirigibles passive ability and therefore reduce the player M€ by 3. This could lead to negative M€ amounts or if we prevent it could be an exploit.

I think this will be simpler to implement. canPlay could check if the player has at least:
1) one other card with floaters that is not Dirigibles, or
2) total value of at least 15 (12 + value of 1 Dirigibles floater) in player's MC plus existing floaters on Dirigibles, then reduced by any discounts

In this way we could always remove 3 MC from the player as a fallback if there are no cards with floaters to remove after making payment for Stratospheric Birds, and the player's MC would never go negative.

All 6 comments

We can add some logic to the play part of the card to test if there is no floater to remove.
If it's the case, we can suppose that the floater has been consumed by Dirigibles passive ability and therefore reduce the player M€ by 3. This could lead to negative M€ amounts or if we prevent it could be an exploit.

I was thinking of something along these lines, since it is the only edge case of a card that consumes a resource which can also be used to pay for its cost. Not sure if it is workable though, have not tried it

// Handle edge case for Stratospheric Birds
if (card.name === CardName.STRATOSPHERIC_BIRDS) {
    const cardsWithFloater = (this.player.getCardsWithResources() as ICard[]).filter((card) => card.resourceType === ResourceType.FLOATER);
    if (cardsWithFloater.length === 1 && cardsWithFloater[0].name === CardName.DIRIGIBLES && htp.floaters - this.playerinput.floaters < 1) {
        this.$data.warning = "Must keep at least one floater for Stratospheric Birds";
        return;
    }
}

We can add some logic to the play part of the card to test if there is no floater to remove.
If it's the case, we can suppose that the floater has been consumed by Dirigibles passive ability and therefore reduce the player M€ by 3. This could lead to negative M€ amounts or if we prevent it could be an exploit.

I think this will be simpler to implement. canPlay could check if the player has at least:
1) one other card with floaters that is not Dirigibles, or
2) total value of at least 15 (12 + value of 1 Dirigibles floater) in player's MC plus existing floaters on Dirigibles, then reduced by any discounts

In this way we could always remove 3 MC from the player as a fallback if there are no cards with floaters to remove after making payment for Stratospheric Birds, and the player's MC would never go negative.

Fixed by @nwai90

Fixed and merged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dabewi picture dabewi  Â·  6Comments

dabewi picture dabewi  Â·  5Comments

rodrigomp84 picture rodrigomp84  Â·  5Comments

dabewi picture dabewi  Â·  3Comments

FreeLikeGNU picture FreeLikeGNU  Â·  5Comments