Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions config/coverage-evidence.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"src/MTGPocket/Game/TextParser.php": {
"pr375": "0cd33d1f46a420073ce8ce6f3db6875deea109cd0654869c86cd959ce2450bdf",
"main": "cb56be75277087578ee54849c1cf65003980604be27a7e161c30ba2433ac5d86",
"integrated": "e15659e1faff89f033ce85b0971fac106ece6232fc6e1459eb6a7a696861bf91"
"integrated": "740f15bb33390039531c3d352bd3bdbe9215bd31e78b5eb66496027f1027e63e"
},
"tests/Game/ModernCardTextTest.php": {
"pr375": "e62cfe938952097227ed0a8c76177aa98106e80c7eded44c7be7aebb1f0dadbf",
"main": "b125a7a83e29dc96d7247e0c4b638d12df4ee363f1764608f2a3298c6c0828ac",
"integrated": "b125a7a83e29dc96d7247e0c4b638d12df4ee363f1764608f2a3298c6c0828ac"
"main": "548ee1aef8132bdb27c496553736dfba743a4c07b2a417979e86d6af01c4d69c",
"integrated": "548ee1aef8132bdb27c496553736dfba743a4c07b2a417979e86d6af01c4d69c"
}
},
"historicalValidation": [
Expand Down Expand Up @@ -57,9 +57,9 @@
}
},
"sourcePins": {
"src/MTGPocket/Game/TextParser.php": "e15659e1faff89f033ce85b0971fac106ece6232fc6e1459eb6a7a696861bf91",
"src/MTGPocket/Game/TextParser.php": "740f15bb33390039531c3d352bd3bdbe9215bd31e78b5eb66496027f1027e63e",
"src/MTGPocket/Game/CardDefinition.php": "0af8c9d6c854c7ce44a0bde36298ad2780c33f42972be5d844f1cbdb43e098e7",
"src/MTGPocket/Game/Game.php": "7615a321078f11994f2256f2572685891a2962e11fc4b156f362ed0ad345c70e",
"src/MTGPocket/Game/Game.php": "5d7a9d62dce911ef6409c8e352c0547966cd751ae85341fabe4566b7125e4115",
"tests/Game/DepartingPermanentAbilityTest.php": "f3fe87cacb29081cbb9413b7280921cb8c013c279ff9cf59189c5c16df2d2f7c",
"tests/Game/DepartureCreatureStatusTest.php": "c0306ee7d419814c0aefcd524724135d5f714e41fa38750f366df2b09ab77f7b",
"src/MTGPocket/Game/Step.php": "25c8efe18d4221045bcb75a8f30c223d802e534b263a6722416dbc08d78f84e3",
Expand All @@ -86,7 +86,7 @@
"tests/Game/ArtifactGraveyardObserverTest.php": "296e0bee3502974562a61b346d81baf43d5510b4d9d0012171efde5546648c81",
"tests/Game/DepartedSourceStatisticsTest.php": "d077746e44bff3554407376f95e1b20ba7b00fc29f8a409927b68d964fd9241a",
"tests/Game/FabricateChoiceTest.php": "ddd05a50cdc5608f4e189ef53699875420113e73d6848cc6e4a64ea773a070ea",
"tests/Game/ModernCardTextTest.php": "b125a7a83e29dc96d7247e0c4b638d12df4ee363f1764608f2a3298c6c0828ac",
"tests/Game/ModernCardTextTest.php": "548ee1aef8132bdb27c496553736dfba743a4c07b2a417979e86d6af01c4d69c",
"tests/Game/DiscipleBurialChoiceTest.php": "e7a2803eb0fe908b67d782d7a882cdd5e711dc8a3d6182747395cffeb53bb4f3",
"tests/AbilityCandidatesTest.php": "6b7a382e2a7aeddfdad38212dc8afa4afa5287e0d5ece4f5b088167db3e9be06",
"tests/Game/FangrenBurialChoiceTest.php": "be9c8ac2147f7ae37afc158bb2a86114c3cfee3255580a504108d4f3c9514785",
Expand Down
8 changes: 8 additions & 0 deletions src/MTGPocket/Game/Game.php
Original file line number Diff line number Diff line change
Expand Up @@ -9390,6 +9390,14 @@ private function putOntoBattlefield(GameObject $object, int $controller, bool $t
if ($card->entersWithMinusCounters > 0) {
$object->addCounters('-1/-1', $card->entersWithMinusCounters);
}
// `Each other creature (Elf) you control enters with an additional +1/+1 counter on it.`
foreach ($this->isCreature($object) ? $this->permanents($controller) : [] as $permanent) {
foreach ($permanent->id !== $object->id ? $this->keywords($permanent) : [] as $word) {
if (str_starts_with($word, 'others enter with counter ') && (($kind = substr($word, 26)) === 'Creature' || in_array($kind, $card->subtypes, true) || in_array('changeling', $card->keywords, true))) {
$object->addCounters('+1/+1', 1);
}
}
}
$this->soulbond($object);
if ($card->chooses !== null) {
$object->chosen = $this->choiceFor($controller, $card->chooses);
Expand Down
7 changes: 7 additions & 0 deletions src/MTGPocket/Game/TextParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,13 @@ public static function parse(CardDefinition $card): array

continue;
}
// `Each other creature you control enters with an additional +1/+1 counter on it.`, `… other Elf …`; see Game::putOntoBattlefield().
if (! $spell && preg_match('/^Each other (creature|[A-Z][a-z]+(?: creature)?) you control enters(?: the battlefield)? with an additional \+1\/\+1 counter on it\.$/', $line, $match)
&& ($kind = $match[1] === 'creature' ? 'Creature' : self::subtypeOf(explode(' ', $match[1])[0])) !== null) {
$result['keywords'][] = "others enter with counter {$kind}";

continue;
}
// Wild Growth / Fertile Ground: `Whenever enchanted land is tapped for mana, its controller adds an additional {G}.`; see Game::manaSources().
if (! $spell && ($result['aura']['enchant'] ?? null) !== null && preg_match('/^Whenever enchanted land is tapped for mana, its controller adds an additional ((?:\{[WUBRGC]\})+|one mana of any colou?r)\.$/', $line, $match)) {
preg_match_all('/\{([WUBRGC])\}/', $match[1], $symbols);
Expand Down
Loading
Loading