diff --git a/Assets/MagnetismHeroes/Editor/PresentationAssets.cs b/Assets/MagnetismHeroes/Editor/PresentationAssets.cs index a15cf70..a7f79bc 100644 --- a/Assets/MagnetismHeroes/Editor/PresentationAssets.cs +++ b/Assets/MagnetismHeroes/Editor/PresentationAssets.cs @@ -63,7 +63,7 @@ namespace MagnetismHeroes.Editor var cape = badge.transform.Find("RibbonCape"); var line = cape.GetComponent(); line.sharedMaterial = ribbonMaterial; line.useWorldSpace = false; line.positionCount = 10; line.widthMultiplier = .065f; - line.startColor = new Color(.1f, .35f, .8f, .9f); line.endColor = new Color(.9f, .15f, .12f, .45f); + line.startColor = new Color(.8f, .15f, .12f, .9f); line.endColor = new Color(.1f, .25f, .75f, .85f); data.ApplyModifiedPropertiesWithoutUndo(); var number = badge.GetComponentInChildren(); number.fontSize = 3.5f; number.rectTransform.sizeDelta = new Vector2(1, .6f); var numberMaterial = AssetDatabase.LoadAssetAtPath(Root + "Materials/NumberOutline.mat"); diff --git a/Assets/MagnetismHeroes/Editor/PresentationProof.cs b/Assets/MagnetismHeroes/Editor/PresentationProof.cs index e9830a6..3d9addb 100644 --- a/Assets/MagnetismHeroes/Editor/PresentationProof.cs +++ b/Assets/MagnetismHeroes/Editor/PresentationProof.cs @@ -83,6 +83,7 @@ namespace MagnetismHeroes.Editor camera.targetTexture = target; camera.aspect = (float)width / height; canvas.renderMode = RenderMode.ScreenSpaceCamera; canvas.worldCamera = camera; canvas.planeDistance = .5f; safe.enabled = false; safeRect.anchorMin = new Vector2(inset / width, 0); safeRect.anchorMax = new Vector2(1 - inset / width, 1); + foreach (var ball in app.Presenter.Balls.Values) ball.SendMessage("Update"); app.Presenter.SendMessage("LateUpdate"); Canvas.ForceUpdateCanvases(); if (expression >= 0) foreach (var face in app.GetComponentsInChildren()) face.sprite = AssetDatabase.LoadAssetAtPath($"Assets/MagnetismHeroes/UnityRuntime/Presentation/Sprites/Face{expression}.asset"); diff --git a/Assets/MagnetismHeroes/UnityRuntime/Presentation/BoardPresenter.cs b/Assets/MagnetismHeroes/UnityRuntime/Presentation/BoardPresenter.cs index aaa6be4..53e8701 100644 --- a/Assets/MagnetismHeroes/UnityRuntime/Presentation/BoardPresenter.cs +++ b/Assets/MagnetismHeroes/UnityRuntime/Presentation/BoardPresenter.cs @@ -181,7 +181,15 @@ namespace MagnetismHeroes.UnityRuntime.Presentation var original = number; for (int attempt = 0; attempt < 25; attempt++) { - if (attempt > 0) + if (attempt > 0 && attempt <= 4) + { + var side = attempt % 2 == 1 ? -1 : 1; + number = _camera.WorldToViewportPoint(representative + _camera.transform.right * side * 1.08f + + _camera.transform.up * (attempt <= 2 ? .55f : -.55f)); + number.x = Mathf.Clamp(number.x, width + .02f, .98f - width); + number.y = Mathf.Clamp(number.y, height + .25f, .84f - height); + } + else if (attempt > 4) { int column = (attempt - 1) % 5; float side = column == 0 ? 0 : column % 2 == 0 ? -column / 2 : (column + 1) / 2; diff --git a/Assets/MagnetismHeroes/UnityRuntime/Presentation/Prefabs/GroupBadge.prefab b/Assets/MagnetismHeroes/UnityRuntime/Presentation/Prefabs/GroupBadge.prefab index d014f22..2e6e58c 100644 --- a/Assets/MagnetismHeroes/UnityRuntime/Presentation/Prefabs/GroupBadge.prefab +++ b/Assets/MagnetismHeroes/UnityRuntime/Presentation/Prefabs/GroupBadge.prefab @@ -112,8 +112,8 @@ LineRenderer: m_RotationOrder: 4 colorGradient: serializedVersion: 2 - key0: {r: 0.101960786, g: 0.34901962, b: 0.8, a: 0.9019608} - key1: {r: 0.9019608, g: 0.14901961, b: 0.12156863, a: 0.4509804} + key0: {r: 0.8, g: 0.14901961, b: 0.12156863, a: 0.9019608} + key1: {r: 0.101960786, g: 0.2509804, b: 0.7490196, a: 0.8509804} key2: {r: 0, g: 0, b: 0, a: 0} key3: {r: 0, g: 0, b: 0, a: 0} key4: {r: 0, g: 0, b: 0, a: 0} diff --git a/tools/android/exercise-content.ps1 b/tools/android/exercise-content.ps1 index ff7ece0..f866612 100644 --- a/tools/android/exercise-content.ps1 +++ b/tools/android/exercise-content.ps1 @@ -32,6 +32,11 @@ function BallPoint($Board,[string]$Id) { 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 MergeStage([string]$Name,[int]$Id) { + $save=Save "$Name-before"; $board=@($save.puzzleStates | Where-Object stageId -eq $Id)[0] + $start=BallPoint $board $board.groups[0].ballIds[0]; $end=BallPoint $board $board.groups[1].ballIds[0] + Step $Name @('shell','input','swipe',"$($start[0])","$($start[1])","$($end[0]-45)","$($end[1])",'650') +} 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') @@ -91,7 +96,7 @@ try { CompareAudio 'audio-one-offline' @('guide_collect','guide_find','guide_count','count_01') StartAudio 'audio-two-help' 23 Step 'next-two' @('shell','input','tap','2064','648') 2500; Step 'two-help-find' @('shell','input','tap','312','713') 4500 - Step 'two-direct-merge' @('shell','input','swipe','1009','510','1291','510','650') 4000 + MergeStage 'two-direct-merge' 2; Start-Sleep -Seconds 4 $twoCollected=Save 'two-collected'; $board=@($twoCollected.puzzleStates | Where-Object stageId -eq 2)[0] Check 'two-real-collected' ($board.groups.Count -eq 1 -and $board.collectedBallIds.Count -eq 2) 'Real confirmed merge collects both' TapBall 'two-first-count' $board $board.balls[0].id; Start-Sleep -Seconds 1 @@ -115,13 +120,14 @@ try { CompareAudio 'audio-six-demo' @('demo_merge6','guide_merge') Restart 'six-reentry'; SelectStage 'six-reentered' 6 $sixAgain=Save 'six-reentry-save'; Check 'six-seen-board-preserved' (Same $sixBefore $sixAgain) 'Reentry preserves seen merge and real unfinished board' - Step 'six-real-solve' @('shell','input','swipe','1009','510','1291','510','650') + MergeStage 'six-real-solve' 6 $sixSuccess=Save 'six-success'; Check 'six-free-final' ($sixSuccess.completedStageIds -contains 6 -and $sixSuccess.latestFreePlay.groups.Count -eq 1 -and $sixSuccess.latestFreePlay.groups[0].ballIds.Count -eq 2) 'Actual merge solves6 to one2 group' Step 'next-seven' @('shell','input','tap','2064','648'); $seven=Save 'seven-next'; $sevenBoard=@($seven.puzzleStates | Where-Object stageId -eq 7)[0] Check 'actual-next-seven' ($sevenBoard.stageId -eq 7) 'Next enters7 without automatic prior transition' - Step 'seven-partial-drag' @('shell','input','swipe','1106','503','1050','503','650') + $point=BallPoint $sevenBoard $sevenBoard.groups[0].ballIds[0] + Step 'seven-partial-drag' @('shell','input','swipe',"$($point[0])","$($point[1])","$($point[0]-60)","$($point[1])",'650') $sevenPartial=Save 'seven-partial'; Step 'seven-home' @('shell','input','tap','312','108'); SelectStage 'six-replay-again' 6 - Step 'six-replay-solve' @('shell','input','swipe','1009','510','1291','510','650'); Step 'next-seven-resume' @('shell','input','tap','2064','648') + MergeStage 'six-replay-solve' 6; Step 'next-seven-resume' @('shell','input','tap','2064','648') $sevenResume=Save 'seven-next-resumed'; Check 'next-prefers-seven-save' (Same @($sevenPartial.puzzleStates | Where-Object stageId -eq 7)[0] @($sevenResume.puzzleStates | Where-Object stageId -eq 7)[0]) 'Next resumes existing7 state' Fixture 10; StartAudio 'audio-ten-demo-help' 20 $ten=StagePoint 10; Step 'ten-ghost-start' @('shell','input','tap',"$($ten[0])","$($ten[1])") 1200 @@ -132,8 +138,9 @@ try { CompareAudio 'audio-ten-demo-help' @('demo_split10','guide_split_2_1') Restart 'ten-reentry'; SelectStage 'ten-reentered' 10 Check 'ten-seen-and-board-preserved' (Same $tenBefore (Save 'ten-reentry-save')) 'No second first-entry mutation' - Step 'ten-choose-real' @('shell','input','tap','1120','510'); Step 'ten-split-mode' @('shell','input','tap','312','832'); Step 'ten-select-real' @('shell','input','tap','1120','510') - Step 'ten-real-split' @('shell','input','swipe','1120','510','850','510','650'); $tenSuccess=Save 'ten-success' + $point=BallPoint $tenBefore.puzzleStates[0] $tenBefore.puzzleStates[0].groups[0].ballIds[0] + TapBall 'ten-choose-real' $tenBefore.puzzleStates[0] $tenBefore.puzzleStates[0].groups[0].ballIds[0]; Step 'ten-split-mode' @('shell','input','tap','312','832'); TapBall 'ten-select-real' $tenBefore.puzzleStates[0] $tenBefore.puzzleStates[0].groups[0].ballIds[0] + Step 'ten-real-split' @('shell','input','swipe',"$($point[0])","$($point[1])","$($point[0]-190)","$($point[1])",'650'); $tenSuccess=Save 'ten-success' Check 'ten-final-one-one' ($tenSuccess.completedStageIds -contains 10 -and $tenSuccess.latestFreePlay.groups.Count -eq 2 -and @($tenSuccess.latestFreePlay.groups | Where-Object {$_.ballIds.Count -ne 1}).Count -eq 0) 'Actual select/drag yields1,1 and success' Step 'next-eleven-cloud' @('shell','input','tap','2064','648'); $eleven=Save 'eleven-next' Check 'actual-next-eleven' (@($eleven.puzzleStates | Where-Object stageId -eq 11)[0].stageId -eq 11) 'Stage11 opens with its Cloud theme source' diff --git a/tools/android/exercise-persistence.ps1 b/tools/android/exercise-persistence.ps1 index 84bee8a..3ebb8c0 100644 --- a/tools/android/exercise-persistence.ps1 +++ b/tools/android/exercise-persistence.ps1 @@ -76,7 +76,9 @@ try { $one=Save 'one-collected'; TapBall 'one-count-success' $one.puzzleStates[0] $one.puzzleStates[0].balls[0].id $free=Save 'one-free'; Check 'one-completion-atomic' ($free.completedStageIds.Count -eq 1 -and $free.completedStageIds[0] -eq 1 -and $free.puzzleStates.Count -eq 0 -and $free.latestFreePlay.sourceStageId -eq 1) 'Completed1, removed puzzle1, latestFree1 in one file' Step 'one-home' @('shell','input','tap','312','108'); SelectStage 'two' 2 - Step 'two-merge-collect' @('shell','input','swipe','1009','510','1291','510','650') + $twoInitial=Save 'two-initial'; $board=@($twoInitial.puzzleStates | Where-Object stageId -eq 2)[0] + $start=BallPoint $board $board.groups[0].ballIds[0]; $end=BallPoint $board $board.groups[1].ballIds[0] + Step 'two-merge-collect' @('shell','input','swipe',"$($start[0])","$($start[1])","$($end[0]-45)","$($end[1])",'650') $two=Save 'two-collected'; $board=@($two.puzzleStates | Where-Object stageId -eq 2)[0] Check 'two-real-collection' ($board.groups.Count -eq 1 -and $board.collectedBallIds.Count -eq 2 -and $board.countedBallIds.Count -eq 0) 'Actual confirmed drag merged both balls and collected both' TapBall 'two-count-one-of-two' $board $board.balls[0].id @@ -100,7 +102,8 @@ try { $fixture=Save 'before-unlock-fixture'; $fixture.completedStageIds=@(1..5) $fixturePath=Join-Path $EvidenceDir 'fixture-completion-access-six.json'; $fixture | ConvertTo-Json -Depth 12 | Set-Content -LiteralPath $fixturePath -Encoding utf8 Adb @('push',$fixturePath,$remote) | Out-Null; Step 'six-access-home' @('shell','am','start','-W','-n',$activity) 6500; SelectStage 'six' 6 - Step 'six-real-move-unfinished' @('shell','input','swipe','1009','510','930','560','650') + $sixInitial=Save 'six-initial'; $board=@($sixInitial.puzzleStates | Where-Object stageId -eq 6)[0]; $point=BallPoint $board $board.groups[0].ballIds[0] + Step 'six-real-move-unfinished' @('shell','input','swipe',"$($point[0])","$($point[1])","$($point[0]-55)","$($point[1]+35)",'650') $six=Save 'two-unfinished-before'; Check 'two-independent-unfinished' ($six.puzzleStates.Count -eq 2 -and (Same $partialBoard @($six.puzzleStates | Where-Object stageId -eq 2)[0]) -and @($six.puzzleStates | Where-Object stageId -eq 6)[0].groups.Count -eq 2) 'Stage02 partially counted and Stage06 actually moved coexist' Step 'six-home' @('shell','input','tap','312','108'); Step 'free-continue' @('shell','input','tap','1200','810') $freeBefore=Save 'free-before-move'; $point=BallPoint $freeBefore.latestFreePlay $freeBefore.latestFreePlay.balls[0].id