micahstairs / bga-innovation

MIT License
6 stars 2 forks source link

Oars draws a card in the second dogma effect even if cards were transferred in the first part #404

Closed ultimatefiend closed 2 years ago

ultimatefiend commented 2 years ago

Here is the log:

You draw 1 Pottery. <-- problematic line You have to execute the non-demand effect. lordmcfuzz0 draws a 1. lordmcfuzz0 transfers 1 Writing from their hand to your score pile. lordmcfuzz0 draws a 1. lordmcfuzz0 transfers 1 Code of laws from their hand to your score pile. lordmcfuzz0 draws a 1. lordmcfuzz0 transfers 1 Domestication from their hand to your score pile. The I demand effect applies on lordmcfuzz0. lordmcfuzz0 has 1 . You have 2 . You activate the dogma of 1 Oars with as the featured icon.

micahstairs commented 2 years ago

Thanks for filing this bug! Someone found this in the alpha yesterday too.

ultimatefiend commented 2 years ago

Need to set the aux value in this loop:

                    $card_transfered = false;
                    foreach (self::getCardsInHand($player_id) as $card) {
                        // "I demand you transfer a card with a crown from your hand to my score pile"
                        if (self::hasRessource($card, 1)) {
                            self::transferCardFromTo($card, $launcher_id, 'score');
                            self::executeDraw($player_id, 1); // "If you do, draw a 1"
                            $card_transfered = true; // "and repeat this dogma effect"
                            break;
                        }
                    }
                } while ($card_transfered && self::getGameStateValue('game_rules') == 1);
            } else {
micahstairs commented 2 years ago

Yeah that should be an easy fix. Did you want to take this and test a fix?

micahstairs commented 2 years ago

Please re-assign back to me if you are not interested in doing this work.

micahstairs commented 2 years ago

Actually I'm going to take this since I'm fixing a few other bugs and deploying a new release to alpha in an hour.