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.

4 changes: 2 additions & 2 deletions config/coverage-evidence.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
}
},
"sourcePins": {
"src/MTGPocket/Game/TextParser.php": "58652519da1ee2f2e0c8ff52f33a4dd939417a953a5cbf75813d17994cee5359",
"src/MTGPocket/Game/TextParser.php": "ecd9662213bf67db65d1d4bc8baa94ca66edb06cdcafe92649a92f80e3dd59af",
"src/MTGPocket/Game/CardDefinition.php": "0af8c9d6c854c7ce44a0bde36298ad2780c33f42972be5d844f1cbdb43e098e7",
"src/MTGPocket/Game/Game.php": "255be31deddd8bebbb502204afe2afc776c35bcb189c78a61cd3df3f469c4b49",
"tests/Game/DepartingPermanentAbilityTest.php": "f3fe87cacb29081cbb9413b7280921cb8c013c279ff9cf59189c5c16df2d2f7c",
Expand Down Expand Up @@ -329,7 +329,7 @@
"tests/Game/ArtifactGraveyardObserverTest.php": "296e0bee3502974562a61b346d81baf43d5510b4d9d0012171efde5546648c81",
"tests/Game/DepartedSourceStatisticsTest.php": "d077746e44bff3554407376f95e1b20ba7b00fc29f8a409927b68d964fd9241a",
"tests/Game/FabricateChoiceTest.php": "ddd05a50cdc5608f4e189ef53699875420113e73d6848cc6e4a64ea773a070ea",
"tests/Game/ModernCardTextTest.php": "182693a6c35f652634acbb42c1c11663be23d3476549cc2776e4f92d0da144bc",
"tests/Game/ModernCardTextTest.php": "8c047910e19ade3367c975f73161d416a89ebdfb7a35110aff69900cef3232de",
"tests/Game/DiscipleBurialChoiceTest.php": "e7a2803eb0fe908b67d782d7a882cdd5e711dc8a3d6182747395cffeb53bb4f3",
"tests/AbilityCandidatesTest.php": "6b7a382e2a7aeddfdad38212dc8afa4afa5287e0d5ece4f5b088167db3e9be06",
"tests/Game/FangrenBurialChoiceTest.php": "be9c8ac2147f7ae37afc158bb2a86114c3cfee3255580a504108d4f3c9514785",
Expand Down
4 changes: 4 additions & 0 deletions src/MTGPocket/Game/TextParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4022,6 +4022,10 @@ private static function sentenceEffects(string $sentence): ?array
&& count($found) === 1 && ($found[0]['per'] ?? null) === 'yours:creature') {
return [['per' => 'yours:countered creature'] + $found[0]];
}
// `Draw a card and lose 1 life.`: as `You draw a card and you lose 1 life.`
if (preg_match('/^[Dd]raw (\w+ cards?) and lose (\w+) life$/', $sentence, $m)) {
return self::sentenceEffects("You draw {$m[1]} and you lose {$m[2]} life");
}
// `Each opponent discards a card and loses 2 life.`: one action, then the other, by the same players.
if (preg_match('/^([Ee]ach (?:opponent|player)) (discards|loses|mills|draws|sacrifices|gains) (.+?) and (discards|loses|mills|draws|sacrifices|gains) (.+)$/', $sentence, $m)
&& ($first = self::sentenceEffects("{$m[1]} {$m[2]} {$m[3]}")) !== null && ($second = self::sentenceEffects("{$m[1]} {$m[4]} {$m[5]}")) !== null) {
Expand Down
Loading
Loading