Reveal selected ball centres before native split and verify exact selected IDs
This commit is contained in:
@@ -53,13 +53,18 @@ function SplitReal([int]$Stage,[int]$Selected,[string]$Name) {
|
||||
$before=Save "$Name-before-$attempt"; $board=Board $before $Stage
|
||||
$group=@($board.groups|Sort-Object {$_.ballIds.Count} -Descending)[0]
|
||||
$ids=@(if($Stage-eq13-and$Selected-eq2){$group.ballIds[0];$group.ballIds[-1]}else{$group.ballIds|Select-Object -First $Selected})
|
||||
if(@($ids|Where-Object{!(BallClear $board $_)}).Count){Orbit "$Name-reveal-selected-$attempt" $board;continue}
|
||||
TapBall "$Name-choose-$attempt" $board $ids[0]
|
||||
Step "$Name-mode-$attempt" @('shell','input','tap','312','832')
|
||||
foreach($id in $ids){TapBall "$Name-select-$attempt-$id" $board $id}
|
||||
$point=BallPoint $board $ids[0]
|
||||
Step "$Name-drag-$attempt" @('shell','input','swipe',"$($point[0])","$($point[1])","$($point[0])","$($point[1]-160)",'500')
|
||||
$after=Save "$Name-after-$attempt"; $actual=Board $after $Stage
|
||||
if($null-eq$actual-or$actual.groups.Count-gt$board.groups.Count){return $after}
|
||||
if($null-eq$actual){$actual=$after.latestFreePlay}
|
||||
if($actual.groups.Count-gt$board.groups.Count){
|
||||
Check "$Name-exact-selected-ids-$attempt" (@($actual.groups|Where-Object{(($_.ballIds|Sort-Object)-join',')-eq(($ids|Sort-Object)-join',')}).Count-eq1) 'Native split group is exactly the tapped selection, not an occluded substitute'
|
||||
return $after
|
||||
}
|
||||
# Cancel failed selection before a new view; do not silently turn an invalid selection into a solve.
|
||||
Step "$Name-cancel-$attempt" @('shell','input','tap','312','832')
|
||||
Orbit "$Name-orbit-$attempt" $board
|
||||
|
||||
Reference in New Issue
Block a user