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?
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
It is till reproducible
https://tm.alrusdi.ru/player?id=e9789bb35efb
Fixed and merged
Most helpful comment
I think this will be simpler to implement.
canPlaycould 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.