Skip to content

Commit

Permalink
Merge pull request #1454 from micahstairs/main-4
Browse files Browse the repository at this point in the history
Fix 8 alpha bugs
  • Loading branch information
micahstairs authored May 28, 2024
2 parents 0bf1aa5 + c63e9ed commit ffbdc0c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
7 changes: 6 additions & 1 deletion innovation.game.php
Original file line number Diff line number Diff line change
Expand Up @@ -2778,8 +2778,13 @@ function getTransferInfoWithOnePlayerInvolved($owner_from, $location_from, $loca

// Update text based on where the card is coming from
if ($location_from === 'hand') {
if ($targetable_players === null) {
$from_somewhere_for_player = clienttranslate(' from your hand');
$from_somewhere_for_others = clienttranslate(' from his hand');
} else {
$from_somewhere_for_player = clienttranslate(' from the hand of ${targetable_players}');
$from_somewhere_for_others = clienttranslate(' from the hand of ${targetable_players}');
}
} else if ($location_from === 'score') {
if ($targetable_players === null) {
$from_somewhere_for_player = clienttranslate(' from your score pile');
Expand Down Expand Up @@ -11736,7 +11741,7 @@ function stPlayerInvolvedTurn()
self::notifyAllPlayersBut($player_id, 'log', clienttranslate('Each top card on ${player_name} board has a ${crown}.'), array('player_name' => self::renderPlayerName($player_id), 'crown' => $crown));
self::transferCardFromTo($achievement, $player_id, 'achievements'); // "Claim the World achievement"
} else {
self::notifyPlayer($player_id, 'log', clienttranslate('Each top card on ${your} board has a ${crown} but the Empire achievement has already been claimed.'), array('your' => 'your', 'crown' => $crown));
self::notifyPlayer($player_id, 'log', clienttranslate('Each top card on ${your} board has a ${crown} but the World achievement has already been claimed.'), array('your' => 'your', 'crown' => $crown));
self::notifyAllPlayersBut($player_id, 'log', clienttranslate('Each top card on ${player_name} board has a ${crown} but the World achievement has already been claimed.'), array('player_name' => self::renderPlayerName($player_id), 'crown' => $crown));
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/Innovation/Cards/Artifacts/Card167.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getInteractionOptions(): array
public function handleCardChoice(array $card)
{
if (self::isFirstInteraction()) {
if (in_array(self::getValue($card), self::getValues(self::getTopCards()))) {
if (in_array(self::getValue($card), self::getValues(self::getTopCards(self::getLauncherId())))) {
self::return($card);
self::setMaxSteps(2);
} else {
Expand Down
4 changes: 3 additions & 1 deletion modules/Innovation/Cards/Artifacts/Card192_4E.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function initialExecution()
{
do {
$repeat = false;
$card = self::draw(8);
$card = self::drawAndReveal(8);
if (self::isGreen($card)) {
self::achieve($this->game->getIfTopCardOnBoard(CardIds::ACTION_COMICS));
} else if (self::hasIcon($card, Icons::EFFICIENCY)) {
Expand All @@ -27,6 +27,8 @@ public function initialExecution()
self::transferToAchievements($topCard, self::getLauncherId());
$repeat = true;
}
} else {
self::transferToHand($card);
}
} while ($repeat);
}
Expand Down
6 changes: 3 additions & 3 deletions modules/Innovation/Cards/Artifacts/Card455.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ public function getInteractionOptions(): array
}

public function handlePlayerChoice(int $playerId) {
self::removeFromAuxiliaryArray($this->game->playerIdToPlayerIndex($playerId));
self::removeFromAuxiliaryArray($playerId);
self::setAuxiliaryValue($playerId); // Track chosen player
}

public function handleChoice(array $card) {
public function handleCardChoice(array $card) {
$playerId = self::getAuxiliaryValue();
foreach (self::getTopCards($playerId) as $topCard) {
if ($topCard['color'] != $card['color']) {
self::transferToScorePile($card, $playerId);
self::transferToScorePile($topCard, $playerId);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/Innovation/Cards/Echoes/Card370_4E.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function handleCardChoice(array $card) {

public function afterInteraction()
{
if (self::isFirstInteraction()) {
if (self::isFirstNonDemand() && self::isFirstInteraction()) {
$colors = self::getAuxiliaryArray();
if (in_array(Colors::BLUE, $colors) && in_array(Colors::GREEN, $colors) && in_array(Colors::YELLOW, $colors)) {
self::drawAndForeshadow(6);
Expand Down
1 change: 1 addition & 0 deletions modules/Innovation/Cards/Echoes/Card421.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function getInteractionOptions(): array
'location_to' => 'board',
'age' => $this->game->getMaxAgeOnBoardOfColorsWithoutIcon(self::getPlayerId(), Colors::NON_YELLOW, Icons::PROSPERITY),
'color' => Colors::NON_YELLOW,
'without_icon' => Icons::PROSPERITY,
];
} else {
return [
Expand Down
2 changes: 1 addition & 1 deletion modules/Innovation/Cards/Unseen/Card563.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getInteractionOptions(): array

public function handleValueChoice(int $value) {
$didScore = false;
foreach (self::getCardsKeyedByValue(Locations::SCORE)[$value] as $card) {
foreach (self::getCardsKeyedByValue(Locations::HAND)[$value] as $card) {
self::score($card);
$didScore = true;
}
Expand Down

0 comments on commit ffbdc0c

Please sign in to comment.