Guard native world taps and zoom larger counting boards through real touch

This commit is contained in:
NINI
2026-10-06 23:54:11 +09:00
parent 931b5f42e7
commit 35e063b17b
3 changed files with 65 additions and 10 deletions
+6 -1
View File
@@ -34,7 +34,12 @@ function BallPoint($Board,[string]$Id) {
$scale=($height/2)/([Math]::Tan(31*[Math]::PI/180)*$local.Z)
return @([int][Math]::Round(($width/2)+$local.X*$scale),[int][Math]::Round(($height/2)-$local.Y*$scale))
}
function TapBall([string]$Name,$Board,[string]$Id) { $point=BallPoint $Board $Id; Step $Name @('shell','input','tap',"$($point[0])","$($point[1])") }
function WorldSafe($Point) { return $Point[0]-ge530-and$Point[0]-le1900-and$Point[1]-ge280-and$Point[1]-le750 }
function TapBall([string]$Name,$Board,[string]$Id) {
$point=BallPoint $Board $Id
if(!(WorldSafe $point)){throw "Refused unsafe native ball tap $Id at $($point-join',')"}
Step $Name @('shell','input','tap',"$($point[0])","$($point[1])")
}
function StagePoint([int]$Id) { $index=$Id-1; return @([int][Math]::Round((.12+($index%6)*.152)*2400),[int][Math]::Round((1-(.76-[Math]::Floor($index/6)*.123))*1080)) }
function SelectStage([string]$Name,[int]$Id) {
Step "$Name-selection" @('shell','input','tap','1200','616')