├── .github ├── ISSUE_TEMPLATE │ └── failed-to-add-rulseset.md └── workflows │ ├── debug.yml │ ├── release.yml │ └── update-deps.yml ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── LICENSE ├── README.md ├── osu.Game.Rulesets.Diva.Tests ├── .vscode │ ├── launch.json │ └── tasks.json ├── TestSceneOsuGame.cs ├── TestSceneOsuPlayer.cs ├── VisualTestRunner.cs └── osu.Game.Rulesets.Diva.Tests.csproj ├── osu.Game.Rulesets.Diva.sln ├── osu.Game.Rulesets.Diva.sln.DotSettings └── osu.Game.Rulesets.Diva ├── Beatmaps └── DivaBeatmapConverter.cs ├── Configuration └── DivaRulesetConfigManager.cs ├── Difficulty └── DivaDifficultyCalculator.cs ├── DivaInputManager.cs ├── DivaRuleset.cs ├── Extentions.cs ├── Judgements └── DivaJudgementResult.cs ├── Mods ├── DivaKeyMod.cs ├── DivaModAutoplay.cs ├── DivaModKey1.cs ├── DivaModKey2.cs ├── DivaModKey3.cs ├── DivaModKey4.cs └── DivaModNoDoubles.cs ├── Objects ├── DivaHitObject.cs ├── DoublePressButton.cs └── Drawables │ ├── DrawableDivaDoubleHitObject.cs │ ├── DrawableDivaHitObject.cs │ ├── DrawableDivaJudgement.cs │ ├── Pieces │ └── ApproachPiece.cs │ └── SkinnableLighting.cs ├── Replays ├── DivaAutoGenerator.cs ├── DivaFramedReplayInputHandler.cs └── DivaReplayFrame.cs ├── Resources ├── Samples │ └── Gameplay │ │ └── normal-hitnormal.mp3 └── Textures │ ├── CircleMove.png │ ├── CircleStat.png │ ├── CrossMove.png │ ├── CrossStat.png │ ├── Doubles │ ├── CircleMove.png │ ├── CircleStat.png │ ├── CrossMove.png │ ├── CrossStat.png │ ├── SquareMove.png │ ├── SquareStat.png │ ├── TriangleMove.png │ ├── TriangleStat.png │ └── XB │ │ ├── CircleMove.png │ │ ├── CircleStat.png │ │ ├── CrossMove.png │ │ ├── CrossStat.png │ │ ├── SquareMove.png │ │ ├── SquareStat.png │ │ ├── TriangleMove.png │ │ └── TriangleStat.png │ ├── SquareMove.png │ ├── SquareStat.png │ ├── TriangleMove.png │ ├── TriangleStat.png │ ├── XB │ ├── CircleMove.png │ ├── CircleStat.png │ ├── CrossMove.png │ ├── CrossStat.png │ ├── SquareMove.png │ ├── SquareStat.png │ ├── TriangleMove.png │ └── TriangleStat.png │ ├── archive │ ├── divaold.png │ ├── new_ps_buttons.svg │ └── resize500x500.bat │ ├── diva.png │ └── hand.png ├── Scoring ├── DivaHitWindows.cs └── DivaScoreProcessor.cs ├── UI ├── DivaPlayfield.cs ├── DivaPlayfieldAdjustmentContainer.cs ├── DivaSettingsSubsection.cs └── DrawableDivaRuleset.cs └── osu.Game.Rulesets.Diva.csproj /.github/ISSUE_TEMPLATE/failed-to-add-rulseset.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Failed to add rulseset 3 | about: When the ruleset does not work with your version Lazer. 4 | title: Dive ruleset version X.Y.Z does not work with Lazer version X.Y.Z 5 | labels: dependencies 6 | assignees: Artemis-chan 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. Describe where the error happens and in which state. Provide the exact error you got. 12 | 13 | **Did you try downloading the DLL from Actions tab as described in [Readme](https://github.com/Artemis-chan/osu-DIVA#installation)? (Make sure you do first)** 14 | Yes/No 15 | 16 | **Screenshots** 17 | If applicable, add screenshots to help explain your problem. 18 | 19 | **Device (please complete the following information):** 20 | - OS: [e.g. Windows 10] 21 | - Lazer version: [e.g. 2023.717.0] 22 | - Diva DLL version: [e.g. 2023.717.0] 23 | 24 | **Additional context** 25 | Add any other context about the problem here. 26 | -------------------------------------------------------------------------------- /.github/workflows/debug.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This workflow triggers at every commit push that changes code. 3 | # This is useful for keeping Dependabot from pushing broken dependencies. 4 | # 5 | 6 | name: dotnet-debug 7 | 8 | on: 9 | push: 10 | paths: 11 | - '**/*.cs' 12 | - '**/*.csproj' 13 | 14 | jobs: 15 | dotnet-test: 16 | name: Check if the project can still build 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout code 20 | uses: actions/checkout@v3 21 | 22 | - name: Install .NET Core 23 | uses: actions/setup-dotnet@v4 24 | with: 25 | dotnet-version: '9.0.x' 26 | - name: Build the debug DLL 27 | id: build 28 | run: dotnet build 29 | # continue-on-error: true 30 | - name: Open an issue if bump fails 31 | id: issue 32 | if: steps.build.outcome == 'failure' && github.actor == 'dependabot' 33 | uses: rishabhgupta/git-action-issue@v2 34 | with: 35 | token: ${{ secrets.GITHUB_TOKEN }} 36 | title: Incompatibility with latest version of osu! 37 | body: | 38 | Dependabot tried to build this project against the latest version of osu!, but failed with the following result: 39 | ``` 40 | ${{join(steps.build.outputs.*, '\n')}} 41 | ``` 42 | run: | 43 | echo "Opened ${{ steps.issue.outputs.issue }}" 44 | exit 1 45 | - name: Give unit tests a spin 46 | run: dotnet test --no-build 47 | - name: Upload artifact for further testing 48 | uses: actions/upload-artifact@v4 49 | with: 50 | name: release 51 | path: osu.Game.Rulesets.Diva/bin 52 | 53 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This workflow triggers whenever a new tag is created which begins with v 3 | # For example, a tag v42.0.1 will create a new version. 4 | # 5 | 6 | name: dotnet-release 7 | 8 | on: 9 | push: 10 | tags: 11 | - 'v*' 12 | 13 | jobs: 14 | dotnet-build: 15 | name: Generate release assets 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v3 20 | 21 | - uses: actions/setup-dotnet@v4 22 | with: 23 | dotnet-version: '9.0.x' 24 | - name: Build the release DLL 25 | run: dotnet publish -c Release osu.Game.Rulesets.Diva 26 | - name: Upload as asset 27 | uses: softprops/action-gh-release@v1 28 | with: 29 | files: osu.Game.Rulesets.Diva/bin/Release/*/osu.Game.Rulesets.Diva.dll 30 | env: 31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | 33 | -------------------------------------------------------------------------------- /.github/workflows/update-deps.yml: -------------------------------------------------------------------------------- 1 | name: Update Dependencies 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | update-dep: 10 | name: Bump Dependencies PR 11 | runs-on: ubuntu-latest 12 | defaults: 13 | run: 14 | shell: pwsh 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Bump nuget package version 19 | id: update-csproj 20 | run: | 21 | $jdata = curl --silent "https://api.github.com/repos/ppy/osu/releases/latest" | ConvertFrom-Json 22 | $latestVer = $jdata.tag_name 23 | $valid = ![string]::IsNullOrWhiteSpace($latestVer) 24 | if($valid) 25 | { 26 | echo $latestVer 27 | $regex = '(?<=\"ppy\.osu\.Game.*\"\s*Version\s*=\s*\")(.*)(?=\")' 28 | (Get-Content osu.Game.Rulesets.Diva\osu.Game.Rulesets.Diva.csproj) -replace $regex, $latestVer | Set-Content osu.Game.Rulesets.Diva\osu.Game.Rulesets.Diva.csproj 29 | echo "OSU_VERSION=$latestVer" >> "$GITHUB_OUTPUT" 30 | } 31 | 32 | - run: git --no-pager diff 33 | 34 | - name: Create PR 35 | uses: peter-evans/create-pull-request@v6.0.1 36 | with: 37 | token: ${{ secrets.PAT }} 38 | branch: osu-bump 39 | commit-message: 'chore: update osu packages to ${{ steps.update-csproj.outputs.OSU_VERSION }}' 40 | title: 'Update to osu! ${{ steps.update-csproj.outputs.OSU_VERSION }}' 41 | base: master 42 | body: | 43 | #skip-changelog 44 | 45 | Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request) 46 | labels: dependencies 47 | delete-branch: true 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/osu.Game.Rulesets.Diva.Tests/bin/Debug/net5.0/osu.Game.Rulesets.Diva.Tests.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}/osu.Game.Rulesets.Diva.Tests", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/osu.Game.Rulesets.Diva.Tests/osu.Game.Rulesets.Diva.Tests.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/osu.Game.Rulesets.Diva.Tests/osu.Game.Rulesets.Diva.Tests.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/osu.Game.Rulesets.Diva.Tests/osu.Game.Rulesets.Diva.Tests.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019-2020 Alten 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # osu!DIVA 2 | 3 | A try to recreate Hatsune Miku: Project DIVA as a custom mode for osu! 4 | 5 | ## Installation 6 | 7 | 1. Get the dll from: 8 | - [Releases](https://github.com/Artemis-chan/osu-DIVA/releases) 9 | - If that does not work, [GitHub Actions](https://nightly.link/Artemis-chan/osu-DIVA/workflows/debug/master/release.zip) 10 | - or [compile it yourself](#build) 11 | 2. Place it in osu! user ruleset folder 12 | 1. Open osu!Lazer 13 | 2. In setting press "Open osu! folder" 14 | 3. Copy the dll into **rulesets** folder 15 | 3. Restart osu! 16 | 17 | ## Build 18 | 19 | ### Dependencies 20 | 21 | - [.NET 8.0(min) SDK](https://dotnet.microsoft.com/en-us/download/dotnet) 22 | - [git](https://git-scm.com/downloads) (optional, you can just download this repo manually) 23 | 24 | ### Steps 25 | 26 | 1. Clone the repo 27 | `git clone https://github.com/Artemis-chan/osu-DIVA.git` 28 | 2. Get inside **osu-DIVA/osu.Game.Rulesets.Diva** folder 29 | `cd osu-DIVA/osu.Game.Rulesets.Diva` 30 | 3. Run `dotnet publish -c Release` 31 | 4. The compiled ***osu.Game.Rulesets.Diva.dll*** can be found in **bin/Release/net6.0/publish** 32 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.Tests/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "VisualTests (Debug)", 6 | "type": "coreclr", 7 | "request": "launch", 8 | "program": "dotnet", 9 | "args": [ 10 | "${workspaceRoot}/bin/Debug/netcoreapp3.1/osu.Game.Rulesets.Diva.Tests.dll" 11 | ], 12 | "cwd": "${workspaceRoot}", 13 | "preLaunchTask": "Build (Debug)", 14 | "env": {}, 15 | "console": "internalConsole" 16 | }, 17 | { 18 | "name": "VisualTests (Release)", 19 | "type": "coreclr", 20 | "request": "launch", 21 | "program": "dotnet", 22 | "args": [ 23 | "${workspaceRoot}/bin/Release/netcoreapp3.1/osu.Game.Rulesets.Diva.Tests.dll" 24 | ], 25 | "cwd": "${workspaceRoot}", 26 | "preLaunchTask": "Build (Release)", 27 | "env": {}, 28 | "console": "internalConsole" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.Tests/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Build (Debug)", 8 | "type": "shell", 9 | "command": "dotnet", 10 | "args": [ 11 | "build", 12 | "--no-restore", 13 | "osu.Game.Rulesets.Diva.Tests.csproj", 14 | "/p:GenerateFullPaths=true", 15 | "/m", 16 | "/verbosity:m" 17 | ], 18 | "group": "build", 19 | "problemMatcher": "$msCompile" 20 | }, 21 | { 22 | "label": "Build (Release)", 23 | "type": "shell", 24 | "command": "dotnet", 25 | "args": [ 26 | "build", 27 | "--no-restore", 28 | "osu.Game.Rulesets.Diva.Tests.csproj", 29 | "/p:Configuration=Release", 30 | "/p:GenerateFullPaths=true", 31 | "/m", 32 | "/verbosity:m" 33 | ], 34 | "group": "build", 35 | "problemMatcher": "$msCompile" 36 | }, 37 | { 38 | "label": "Restore", 39 | "type": "shell", 40 | "command": "dotnet", 41 | "args": [ 42 | "restore" 43 | ], 44 | "problemMatcher": [] 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.Tests/TestSceneOsuGame.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Allocation; 5 | using osu.Game.Tests.Visual; 6 | 7 | namespace osu.Game.Rulesets.Diva.Tests 8 | { 9 | public partial class TestSceneOsuGame : OsuTestScene 10 | { 11 | [BackgroundDependencyLoader] 12 | private void load() 13 | { 14 | AddGame(new OsuGame()); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.Tests/TestSceneOsuPlayer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using NUnit.Framework; 5 | using osu.Game.Tests.Visual; 6 | 7 | namespace osu.Game.Rulesets.Diva.Tests 8 | { 9 | [TestFixture] 10 | public partial class TestSceneOsuPlayer : PlayerTestScene 11 | { 12 | protected override Ruleset CreatePlayerRuleset() 13 | => new DivaRuleset(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.Tests/VisualTestRunner.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System; 5 | using osu.Framework; 6 | using osu.Framework.Platform; 7 | using osu.Game.Tests; 8 | 9 | namespace osu.Game.Rulesets.Diva.Tests 10 | { 11 | public static class VisualTestRunner 12 | { 13 | [STAThread] 14 | public static int Main(string[] args) 15 | { 16 | using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu")) 17 | { 18 | host.Run(new OsuTestBrowser()); 19 | return 0; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.Tests/osu.Game.Rulesets.Diva.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | osu.Game.Rulesets.Diva.Tests.VisualTestRunner 4 | 5 | 6 | 7 | 8 | 9 | false 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | WinExe 23 | net8.0 24 | osu.Game.Rulesets.Diva.Tests 25 | 26 | 27 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29123.88 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Diva", "osu.Game.Rulesets.Diva\osu.Game.Rulesets.Diva.csproj", "{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Diva.Tests", "osu.Game.Rulesets.Diva.Tests\osu.Game.Rulesets.Diva.Tests.csproj", "{B4577C85-CB83-462A-BCE3-22FFEB16311D}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | VisualTests|Any CPU = VisualTests|Any CPU 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 18 | {5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Debug|Any CPU.Build.0 = Debug|Any CPU 19 | {5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Release|Any CPU.ActiveCfg = Release|Any CPU 20 | {5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Release|Any CPU.Build.0 = Release|Any CPU 21 | {5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.VisualTests|Any CPU.ActiveCfg = Release|Any CPU 22 | {5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.VisualTests|Any CPU.Build.0 = Release|Any CPU 23 | {B4577C85-CB83-462A-BCE3-22FFEB16311D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {B4577C85-CB83-462A-BCE3-22FFEB16311D}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {B4577C85-CB83-462A-BCE3-22FFEB16311D}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {B4577C85-CB83-462A-BCE3-22FFEB16311D}.Release|Any CPU.Build.0 = Release|Any CPU 27 | {B4577C85-CB83-462A-BCE3-22FFEB16311D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU 28 | {B4577C85-CB83-462A-BCE3-22FFEB16311D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU 29 | {5265E0F9-AC64-49A0-9A40-303CAAC0EC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {5265E0F9-AC64-49A0-9A40-303CAAC0EC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {5265E0F9-AC64-49A0-9A40-303CAAC0EC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {5265E0F9-AC64-49A0-9A40-303CAAC0EC8E}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {5265E0F9-AC64-49A0-9A40-303CAAC0EC8E}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU 34 | {5265E0F9-AC64-49A0-9A40-303CAAC0EC8E}.VisualTests|Any CPU.Build.0 = Debug|Any CPU 35 | {C52FD88E-E5D8-4093-9E9D-507FEACB58D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {C52FD88E-E5D8-4093-9E9D-507FEACB58D6}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {C52FD88E-E5D8-4093-9E9D-507FEACB58D6}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 | {C52FD88E-E5D8-4093-9E9D-507FEACB58D6}.Release|Any CPU.Build.0 = Release|Any CPU 39 | {C52FD88E-E5D8-4093-9E9D-507FEACB58D6}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU 40 | {C52FD88E-E5D8-4093-9E9D-507FEACB58D6}.VisualTests|Any CPU.Build.0 = Debug|Any CPU 41 | EndGlobalSection 42 | GlobalSection(SolutionProperties) = preSolution 43 | HideSolutionNode = FALSE 44 | EndGlobalSection 45 | GlobalSection(ExtensibilityGlobals) = postSolution 46 | SolutionGuid = {671B0BEC-2403-45B0-9357-2C97CC517668} 47 | EndGlobalSection 48 | GlobalSection(MonoDevelopProperties) = preSolution 49 | Policies = $0 50 | $0.TextStylePolicy = $1 51 | $1.EolMarker = Windows 52 | $1.inheritsSet = VisualStudio 53 | $1.inheritsScope = text/plain 54 | $1.scope = text/x-csharp 55 | $0.CSharpFormattingPolicy = $2 56 | $2.IndentSwitchSection = True 57 | $2.NewLinesForBracesInProperties = True 58 | $2.NewLinesForBracesInAccessors = True 59 | $2.NewLinesForBracesInAnonymousMethods = True 60 | $2.NewLinesForBracesInControlBlocks = True 61 | $2.NewLinesForBracesInAnonymousTypes = True 62 | $2.NewLinesForBracesInObjectCollectionArrayInitializers = True 63 | $2.NewLinesForBracesInLambdaExpressionBody = True 64 | $2.NewLineForElse = True 65 | $2.NewLineForCatch = True 66 | $2.NewLineForFinally = True 67 | $2.NewLineForMembersInObjectInit = True 68 | $2.NewLineForMembersInAnonymousTypes = True 69 | $2.NewLineForClausesInQuery = True 70 | $2.SpacingAfterMethodDeclarationName = False 71 | $2.SpaceAfterMethodCallName = False 72 | $2.SpaceBeforeOpenSquareBracket = False 73 | $2.inheritsSet = Mono 74 | $2.inheritsScope = text/x-csharp 75 | $2.scope = text/x-csharp 76 | EndGlobalSection 77 | GlobalSection(MonoDevelopProperties) = preSolution 78 | Policies = $0 79 | $0.TextStylePolicy = $1 80 | $1.EolMarker = Windows 81 | $1.inheritsSet = VisualStudio 82 | $1.inheritsScope = text/plain 83 | $1.scope = text/x-csharp 84 | $0.CSharpFormattingPolicy = $2 85 | $2.IndentSwitchSection = True 86 | $2.NewLinesForBracesInProperties = True 87 | $2.NewLinesForBracesInAccessors = True 88 | $2.NewLinesForBracesInAnonymousMethods = True 89 | $2.NewLinesForBracesInControlBlocks = True 90 | $2.NewLinesForBracesInAnonymousTypes = True 91 | $2.NewLinesForBracesInObjectCollectionArrayInitializers = True 92 | $2.NewLinesForBracesInLambdaExpressionBody = True 93 | $2.NewLineForElse = True 94 | $2.NewLineForCatch = True 95 | $2.NewLineForFinally = True 96 | $2.NewLineForMembersInObjectInit = True 97 | $2.NewLineForMembersInAnonymousTypes = True 98 | $2.NewLineForClausesInQuery = True 99 | $2.SpacingAfterMethodDeclarationName = False 100 | $2.SpaceAfterMethodCallName = False 101 | $2.SpaceBeforeOpenSquareBracket = False 102 | $2.inheritsSet = Mono 103 | $2.inheritsScope = text/x-csharp 104 | $2.scope = text/x-csharp 105 | EndGlobalSection 106 | EndGlobal 107 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using osu.Game.Beatmaps; 7 | using osu.Game.Rulesets.Objects; 8 | using osu.Game.Rulesets.Objects.Types; 9 | using osu.Game.Rulesets.Diva.Objects; 10 | using osuTK; 11 | using System.Threading; 12 | 13 | namespace osu.Game.Rulesets.Diva.Beatmaps 14 | { 15 | public class DivaBeatmapConverter : BeatmapConverter 16 | { 17 | //todo: 18 | //make single position bursts to a line pattern 19 | //every approach piece of a combo will come from one direction 20 | //create patterns of same button 21 | 22 | public int TargetButtons; 23 | public bool AllowDoubles = true; 24 | 25 | private DivaAction prevAction = DivaAction.Triangle; 26 | 27 | private Vector2 prevObjectPos = Vector2.Zero; 28 | 29 | private float osuObjectSize = 0; 30 | private int streamLength = 0; 31 | //these variables were at the end of the class, such heresy had i done 32 | 33 | private const float approach_piece_distance = 1200; 34 | 35 | public DivaBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) 36 | : base(beatmap, ruleset) 37 | { 38 | this.TargetButtons = beatmap.BeatmapInfo.Difficulty.OverallDifficulty switch 39 | { 40 | >= 6.0f => 4, 41 | >= 4.5f => 3, 42 | >= 2f => 2, 43 | _ => 1, 44 | }; 45 | 46 | osuObjectSize = (54.4f - 4.48f * beatmap.Difficulty.CircleSize) * 2; 47 | 48 | //Console.WriteLine(this.TargetButtons); 49 | } 50 | 51 | public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasPosition); 52 | 53 | protected override IEnumerable ConvertHitObject(HitObject original, IBeatmap beatmap, CancellationToken cancellationToken) 54 | { 55 | //not sure if handling the cancellation is needed, as offical modes doesnt handle *scratches my head* or even its possible 56 | var pos = (original as IHasPosition)?.Position ?? Vector2.Zero; 57 | var newCombo = (original as IHasCombo)?.NewCombo ?? true; 58 | 59 | //currently press presses are placed in place of sliders as placeholder, but arcade slider are better suited for these 60 | //another option would be long sliders: arcade sliders, short sliders: doubles 61 | if (AllowDoubles && original is IHasPathWithRepeats) 62 | { 63 | yield return new DoublePressButton 64 | { 65 | Samples = original.Samples, 66 | StartTime = original.StartTime, 67 | Position = pos, 68 | ValidAction = ValidAction(pos, newCombo), 69 | DoubleAction = DoubleAction(prevAction), 70 | ApproachPieceOriginPosition = GetApproachPieceOriginPos(pos), 71 | }; 72 | } 73 | else 74 | { 75 | yield return new DivaHitObject 76 | { 77 | Samples = original.Samples, 78 | StartTime = original.StartTime, 79 | Position = pos, 80 | ValidAction = ValidAction(pos, newCombo), 81 | ApproachPieceOriginPosition = GetApproachPieceOriginPos(pos), 82 | }; 83 | } 84 | 85 | } 86 | 87 | private static DivaAction DoubleAction(DivaAction ac) => ac switch 88 | { 89 | DivaAction.Circle => DivaAction.Right, 90 | DivaAction.Cross => DivaAction.Down, 91 | DivaAction.Square => DivaAction.Left, 92 | _ => DivaAction.Up 93 | }; 94 | 95 | //placeholder 96 | private DivaAction ValidAction(Vector2 currentObjectPos, bool newCombo) 97 | { 98 | var distance = (prevObjectPos - currentObjectPos).Length; 99 | if (distance < osuObjectSize * 1.2 && (streamLength < 20 || !newCombo)) 100 | { 101 | streamLength++; 102 | return prevAction; 103 | } 104 | else 105 | { 106 | streamLength = 0; 107 | } 108 | 109 | var ac = DivaAction.Circle; 110 | 111 | switch (prevAction) 112 | { 113 | case DivaAction.Circle: 114 | if (this.TargetButtons < 2) break; 115 | ac = DivaAction.Cross; 116 | break; 117 | 118 | case DivaAction.Cross: 119 | if (this.TargetButtons < 3) break; 120 | ac = DivaAction.Square; 121 | break; 122 | 123 | case DivaAction.Square: 124 | if (this.TargetButtons < 4) break; 125 | ac = DivaAction.Triangle; 126 | break; 127 | } 128 | 129 | prevAction = ac; 130 | return ac; 131 | } 132 | 133 | private Vector2 GetApproachPieceOriginPos(Vector2 currentObjectPos) 134 | { 135 | var dir = (prevObjectPos - currentObjectPos); 136 | prevObjectPos = currentObjectPos; 137 | 138 | if (dir == Vector2.Zero) 139 | return new Vector2(approach_piece_distance); 140 | 141 | return dir.Normalized() * approach_piece_distance; 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Configuration/DivaRulesetConfigManager.cs: -------------------------------------------------------------------------------- 1 | using osu.Game.Configuration; 2 | using osu.Game.Rulesets.Configuration; 3 | 4 | namespace osu.Game.Rulesets.Diva.Configuration 5 | { 6 | public class DivaRulesetConfigManager : RulesetConfigManager 7 | { 8 | public DivaRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) 9 | : base(settings, ruleset, variant) 10 | { 11 | } 12 | 13 | protected override void InitialiseDefaults() 14 | { 15 | base.InitialiseDefaults(); 16 | 17 | SetDefault(DivaRulesetSettings.UseXBoxButtons, false); 18 | SetDefault(DivaRulesetSettings.EnableVisualBursts, true); 19 | } 20 | } 21 | 22 | public enum DivaRulesetSettings 23 | { 24 | UseXBoxButtons, 25 | EnableVisualBursts 26 | } 27 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Difficulty/DivaDifficultyCalculator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using osu.Game.Beatmaps; 7 | using osu.Game.Rulesets.Difficulty; 8 | using osu.Game.Rulesets.Difficulty.Preprocessing; 9 | using osu.Game.Rulesets.Difficulty.Skills; 10 | using osu.Game.Rulesets.Mods; 11 | 12 | namespace osu.Game.Rulesets.Diva 13 | { 14 | public class DivaDifficultyCalculator : DifficultyCalculator 15 | { 16 | public DivaDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap) 17 | : base(ruleset, beatmap) 18 | { 19 | } 20 | 21 | protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate) 22 | { 23 | double od = beatmap.BeatmapInfo.Difficulty.OverallDifficulty; 24 | 25 | //TODO: This will need to be rewritten once we start work on #9 26 | double difficulty = beatmap.BeatmapInfo.Difficulty.OverallDifficulty switch 27 | { 28 | >= 6.0f => 4, 29 | >= 4.5f => 3, 30 | >= 2f => 2, 31 | _ => 1, 32 | }; 33 | 34 | return new DifficultyAttributes(mods, difficulty); 35 | } 36 | 37 | protected override IEnumerable CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty(); 38 | 39 | protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[0]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/DivaInputManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.ComponentModel; 5 | using osu.Framework.Input.Bindings; 6 | using osu.Game.Rulesets.UI; 7 | 8 | namespace osu.Game.Rulesets.Diva 9 | { 10 | public partial class DivaInputManager : RulesetInputManager 11 | { 12 | public DivaInputManager(RulesetInfo ruleset) 13 | : base(ruleset, 0, SimultaneousBindingMode.All) 14 | { 15 | } 16 | } 17 | 18 | public enum DivaAction 19 | { 20 | [Description("Square")] 21 | Square, 22 | 23 | [Description("Triangle")] 24 | Triangle, 25 | 26 | [Description("Cross")] 27 | Cross, 28 | 29 | [Description("Circle")] 30 | Circle, 31 | 32 | [Description("Left")] 33 | Left, 34 | 35 | [Description("Up")] 36 | Up, 37 | 38 | [Description("Down")] 39 | Down, 40 | 41 | [Description("Right")] 42 | Right 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/DivaRuleset.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using osu.Framework.Graphics; 7 | using osu.Framework.Graphics.Sprites; 8 | using osu.Framework.Graphics.Textures; 9 | using osu.Framework.Input.Bindings; 10 | using osu.Game.Beatmaps; 11 | using osu.Game.Configuration; 12 | using osu.Game.Rulesets.Difficulty; 13 | using osu.Game.Rulesets.Osu.Mods; 14 | using osu.Game.Rulesets.Mods; 15 | using osu.Game.Rulesets.UI; 16 | using osu.Game.Rulesets.Configuration; 17 | using osu.Game.Rulesets.Diva.Beatmaps; 18 | using osu.Game.Rulesets.Diva.Mods; 19 | using osu.Game.Rulesets.Diva.UI; 20 | using osu.Game.Rulesets.Diva.Configuration; 21 | using osu.Game.Overlays.Settings; 22 | using osu.Game.Beatmaps.Legacy; 23 | using osu.Framework.Allocation; 24 | using osu.Framework.Graphics.Rendering; 25 | 26 | namespace osu.Game.Rulesets.Diva 27 | { 28 | public partial class DivaRuleset : Ruleset 29 | { 30 | public override string Description => "osu!DIVA"; 31 | 32 | public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => 33 | new DrawableDivaRuleset(this, beatmap, mods); 34 | 35 | public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => 36 | new DivaBeatmapConverter(beatmap, this); 37 | 38 | public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => 39 | new DivaDifficultyCalculator(RulesetInfo, beatmap); 40 | 41 | public override RulesetSettingsSubsection CreateSettings() => 42 | new DivaSettingsSubsection(this); 43 | 44 | public override IRulesetConfigManager CreateConfig(SettingsStore settings) => 45 | new DivaRulesetConfigManager(settings, RulesetInfo); 46 | 47 | public override IEnumerable ConvertFromLegacyMods(LegacyMods mods) 48 | { 49 | if (mods.HasFlag(LegacyMods.Nightcore)) 50 | yield return new OsuModNightcore(); 51 | else if (mods.HasFlag(LegacyMods.DoubleTime)) 52 | yield return new OsuModDoubleTime(); 53 | 54 | if (mods.HasFlag(LegacyMods.Perfect)) 55 | yield return new OsuModPerfect(); 56 | else if (mods.HasFlag(LegacyMods.SuddenDeath)) 57 | yield return new OsuModSuddenDeath(); 58 | 59 | if (mods.HasFlag(LegacyMods.Autopilot)) 60 | yield return new OsuModAutopilot(); 61 | 62 | if (mods.HasFlag(LegacyMods.Cinema)) 63 | yield return new OsuModCinema(); 64 | else if (mods.HasFlag(LegacyMods.Autoplay)) 65 | yield return new OsuModAutoplay(); 66 | 67 | if (mods.HasFlag(LegacyMods.Easy)) 68 | yield return new OsuModEasy(); 69 | 70 | if (mods.HasFlag(LegacyMods.Flashlight)) 71 | yield return new OsuModFlashlight(); 72 | 73 | if (mods.HasFlag(LegacyMods.HalfTime)) 74 | yield return new OsuModHalfTime(); 75 | 76 | if (mods.HasFlag(LegacyMods.HardRock)) 77 | yield return new OsuModHardRock(); 78 | 79 | if (mods.HasFlag(LegacyMods.Hidden)) 80 | yield return new OsuModHidden(); 81 | 82 | if (mods.HasFlag(LegacyMods.NoFail)) 83 | yield return new OsuModNoFail(); 84 | 85 | if (mods.HasFlag(LegacyMods.Relax)) 86 | yield return new OsuModRelax(); 87 | 88 | if (mods.HasFlag(LegacyMods.SpunOut)) 89 | yield return new OsuModSpunOut(); 90 | 91 | if (mods.HasFlag(LegacyMods.Target)) 92 | yield return new OsuModTargetPractice(); 93 | 94 | if (mods.HasFlag(LegacyMods.TouchDevice)) 95 | yield return new OsuModTouchDevice(); 96 | } 97 | 98 | public override IEnumerable GetModsFor(ModType type) 99 | { 100 | switch (type) 101 | { 102 | case ModType.Automation: 103 | return new Mod[] { new DivaModAutoplay() }; 104 | 105 | case ModType.DifficultyReduction: 106 | return new Mod[] 107 | { 108 | new OsuModNoFail(), 109 | new MultiMod(new OsuModHalfTime(), new OsuModDaycore()), 110 | }; 111 | 112 | case ModType.DifficultyIncrease: 113 | return new Mod[] 114 | { 115 | new OsuModSuddenDeath(), 116 | new MultiMod(new OsuModDoubleTime(), new OsuModNightcore()), 117 | }; 118 | 119 | case ModType.Conversion: 120 | return new Mod[] 121 | { 122 | new OsuModDifficultyAdjust(), 123 | new MultiMod( 124 | new DivaModKey1(), 125 | new DivaModKey2(), 126 | new DivaModKey3(), 127 | new DivaModKey4() 128 | ), 129 | new DivaModNoDoubles(), 130 | }; 131 | 132 | default: 133 | return Array.Empty(); 134 | } 135 | } 136 | 137 | public override string ShortName => "diva"; 138 | 139 | public override IEnumerable GetDefaultKeyBindings(int variant = 0) => new[] 140 | { 141 | new KeyBinding(InputKey.A, DivaAction.Square), 142 | new KeyBinding(InputKey.W, DivaAction.Triangle), 143 | new KeyBinding(InputKey.S, DivaAction.Cross), 144 | new KeyBinding(InputKey.D, DivaAction.Circle), 145 | 146 | new KeyBinding(InputKey.Left, DivaAction.Left), 147 | new KeyBinding(InputKey.Up, DivaAction.Up), 148 | new KeyBinding(InputKey.Right, DivaAction.Right), 149 | new KeyBinding(InputKey.Down, DivaAction.Down) 150 | }; 151 | 152 | public override Drawable CreateIcon() => new DivaRulesetIcon(this); 153 | 154 | public partial class DivaRulesetIcon : Sprite 155 | { 156 | private readonly Ruleset ruleset; 157 | 158 | public DivaRulesetIcon(Ruleset ruleset) 159 | { 160 | this.ruleset = ruleset; 161 | } 162 | 163 | [BackgroundDependencyLoader] 164 | private void load(IRenderer renderer) 165 | { 166 | Texture = new TextureStore(renderer, new TextureLoaderStore(ruleset.CreateResourceStore()), false).Get("Textures/diva"); 167 | } 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Extentions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using osuTK; 3 | 4 | namespace osu.Game.Rulesets.Diva 5 | { 6 | public static class Extensions 7 | { 8 | public static Vector2 CubicInterpolate(Vector2 start, Vector2 end, float blend, float offsetDistance) 9 | { 10 | if (start == end) return end; 11 | 12 | var pos = Vector2.Lerp(start, end, blend); 13 | 14 | var sdir = (end - start).Normalized().PerpendicularLeft; 15 | var mu = 1f - ((0.5f - blend) * MathF.Sign(0.5f - blend)) * 2f; 16 | pos += sdir * (-offsetDistance * mu * mu + 2 * offsetDistance * mu); 17 | 18 | return pos; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Judgements/DivaJudgementResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Game.Rulesets.Diva.Objects; 5 | using osu.Game.Rulesets.Judgements; 6 | 7 | namespace osu.Game.Rulesets.Diva.Judgements 8 | { 9 | public class DivaJudgementResult : JudgementResult 10 | { 11 | /// 12 | /// The that was judged. 13 | /// 14 | public new DivaHitObject HitObject => (DivaHitObject)base.HitObject; 15 | 16 | /// 17 | /// The judgement which this applies for. 18 | /// 19 | public new Judgement Judgement => base.Judgement; 20 | 21 | public DivaJudgementResult(DivaHitObject hitObject, Judgement judgement) 22 | : base(hitObject, judgement) 23 | { 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System; 5 | using System.Linq; 6 | using osu.Game.Beatmaps; 7 | using osu.Game.Rulesets.Diva.Beatmaps; 8 | using osu.Game.Rulesets.Mods; 9 | 10 | namespace osu.Game.Rulesets.Diva.Mods 11 | { 12 | public abstract class DivaKeyMod : Mod, IApplicableToBeatmapConverter 13 | { 14 | public override string Acronym => Name; 15 | public abstract int KeyCount { get; } 16 | public override ModType Type => ModType.Conversion; 17 | public override double ScoreMultiplier => 1; 18 | public override bool UserPlayable => true; 19 | 20 | public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter) 21 | { 22 | var bc = (DivaBeatmapConverter)beatmapConverter; 23 | 24 | bc.TargetButtons = KeyCount; 25 | } 26 | 27 | public override Type[] IncompatibleMods => new[] 28 | { 29 | typeof(DivaModKey1), 30 | typeof(DivaModKey2), 31 | typeof(DivaModKey3), 32 | typeof(DivaModKey4) 33 | }.Except(new[] { GetType() }).ToArray(); 34 | } 35 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaModAutoplay.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Game.Beatmaps; 6 | using osu.Game.Rulesets.Mods; 7 | using osu.Game.Rulesets.Diva.Replays; 8 | 9 | namespace osu.Game.Rulesets.Diva.Mods 10 | { 11 | public class DivaModAutoplay : ModAutoplay 12 | { 13 | public override ModReplayData CreateReplayData(IBeatmap beatmap, IReadOnlyList mods) => new ModReplayData 14 | ( 15 | new DivaAutoGenerator(beatmap).Generate(), 16 | new ModCreatedUser() { Username = "Autoplay" } 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Localisation; 5 | 6 | namespace osu.Game.Rulesets.Diva.Mods 7 | { 8 | public class DivaModKey1 : DivaKeyMod 9 | { 10 | public override int KeyCount => 1; 11 | public override string Name => "One Button"; 12 | public override string Acronym => "1B"; 13 | public override LocalisableString Description => @"Play with one button."; 14 | } 15 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Localisation; 5 | 6 | namespace osu.Game.Rulesets.Diva.Mods 7 | { 8 | public class DivaModKey2 : DivaKeyMod 9 | { 10 | public override int KeyCount => 2; 11 | public override string Name => "Two Buttons"; 12 | public override string Acronym => "2B"; 13 | public override LocalisableString Description => @"Play with two buttons."; 14 | } 15 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Localisation; 5 | 6 | namespace osu.Game.Rulesets.Diva.Mods 7 | { 8 | public class DivaModKey3 : DivaKeyMod 9 | { 10 | public override int KeyCount => 3; 11 | public override string Name => "Three Buttons"; 12 | public override string Acronym => "3B"; 13 | public override LocalisableString Description => @"Play with three buttons."; 14 | } 15 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Localisation; 5 | 6 | namespace osu.Game.Rulesets.Diva.Mods 7 | { 8 | public class DivaModKey4 : DivaKeyMod 9 | { 10 | public override int KeyCount => 4; 11 | public override string Name => "Four Buttons"; 12 | public override string Acronym => "4B"; 13 | public override LocalisableString Description => @"Play with four buttons."; 14 | } 15 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Mods/DivaModNoDoubles.cs: -------------------------------------------------------------------------------- 1 | using osu.Framework.Localisation; 2 | using osu.Game.Beatmaps; 3 | using osu.Game.Rulesets.Diva.Beatmaps; 4 | using osu.Game.Rulesets.Mods; 5 | 6 | namespace osu.Game.Rulesets.Diva.Mods 7 | { 8 | public class DivaModNoDoubles : Mod, IApplicableToBeatmapConverter 9 | { 10 | public override string Name => "No Doubles"; 11 | public override string Acronym => "ND"; 12 | public override LocalisableString Description => @"Only one button at a time."; 13 | public override ModType Type => ModType.Conversion; 14 | public override double ScoreMultiplier => 0.667; 15 | public override bool UserPlayable => true; 16 | 17 | public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter) 18 | { 19 | var bc = (DivaBeatmapConverter)beatmapConverter; 20 | 21 | bc.AllowDoubles = false; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/DivaHitObject.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Game.Rulesets.Judgements; 5 | using osu.Game.Rulesets.Objects; 6 | using osu.Game.Rulesets.Objects.Types; 7 | using osu.Game.Rulesets.Scoring; 8 | using osu.Game.Rulesets.Diva.Scoring; 9 | using osuTK; 10 | 11 | namespace osu.Game.Rulesets.Diva.Objects 12 | { 13 | public class DivaHitObject : HitObject, IHasPosition 14 | { 15 | public override Judgement CreateJudgement() => new Judgement(); 16 | protected override HitWindows CreateHitWindows() => new DivaHitWindows(); 17 | 18 | public Vector2 Position { get; set; } 19 | 20 | public float X 21 | { 22 | get => Position.X; 23 | set => Position = new Vector2(value, Position.Y); 24 | } 25 | 26 | public float Y 27 | { 28 | get => Position.Y; 29 | set => Position = new Vector2(Position.X, value); 30 | } 31 | 32 | public DivaAction ValidAction; 33 | public Vector2 ApproachPieceOriginPosition; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/DoublePressButton.cs: -------------------------------------------------------------------------------- 1 | namespace osu.Game.Rulesets.Diva.Objects 2 | { 3 | public class DoublePressButton : DivaHitObject 4 | { 5 | public DivaAction DoubleAction; 6 | } 7 | } -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaDoubleHitObject.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Framework.Input.Events; 6 | 7 | namespace osu.Game.Rulesets.Diva.Objects.Drawables 8 | { 9 | public partial class DrawableDivaDoubleHitObject : DrawableDivaHitObject 10 | { 11 | private const int MAX_COUNT = 2; 12 | private List inputs = new List(); 13 | private readonly DivaAction doubleAction; 14 | private int inputCount = 0; 15 | 16 | public DrawableDivaDoubleHitObject(DivaHitObject hitObject) 17 | : base(hitObject) 18 | { 19 | doubleAction = (hitObject as DoublePressButton).DoubleAction; 20 | } 21 | 22 | protected override string GetTextureLocation() => "Doubles/" + base.GetTextureLocation(); 23 | 24 | public override bool OnPressed(KeyBindingPressEvent e) 25 | { 26 | this.Samples.Play(); 27 | 28 | if (Judged || inputCount > 2) 29 | return false; 30 | 31 | 32 | if (e.Action == validAction || e.Action == doubleAction) 33 | inputCount++; 34 | 35 | if (inputCount == 2) 36 | { 37 | pressed = true; 38 | validPress = true; 39 | } 40 | 41 | // inputs.Add(action); 42 | // inputCount++; 43 | 44 | // if(inputCount == 2) 45 | // { 46 | // pressed = true; 47 | // validPress = inputs.Contains(validAction) && inputs.Contains(doubleAction); 48 | // } 49 | 50 | return true; 51 | } 52 | 53 | // public override void OnReleased(KeyBindingReleaseEvent e) 54 | // { 55 | // // inputs.Remove(action); 56 | // // inputCount--; 57 | // } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaHitObject.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Framework.Allocation; 6 | using osu.Framework.Extensions.Color4Extensions; 7 | using osu.Framework.Graphics; 8 | using osu.Framework.Graphics.Sprites; 9 | using osu.Framework.Graphics.Textures; 10 | using osu.Framework.Input.Bindings; 11 | using osu.Game.Audio; 12 | using osu.Game.Beatmaps.ControlPoints; 13 | using osu.Game.Rulesets.Objects.Drawables; 14 | using osu.Game.Rulesets.Scoring; 15 | using osu.Game.Rulesets.Diva.Objects.Drawables.Pieces; 16 | using osuTK; 17 | using osuTK.Graphics; 18 | using osu.Game.Rulesets.Diva.Configuration; 19 | using osu.Framework.Bindables; 20 | using osu.Game.Rulesets.Diva.Judgements; 21 | using osu.Game.Rulesets.Judgements; 22 | using osu.Framework.Input.Events; 23 | using osu.Game.Rulesets.Objects; 24 | 25 | namespace osu.Game.Rulesets.Diva.Objects.Drawables 26 | { 27 | public partial class DrawableDivaHitObject : DrawableHitObject, IKeyBindingHandler 28 | { 29 | public const float BASE_SIZE = 56; 30 | 31 | private const double time_preempt = 850; 32 | private const double time_fadein = 300; 33 | private const double time_action = 150; 34 | 35 | public override bool HandlePositionalInput => false; 36 | 37 | protected readonly Sprite approachHand; 38 | protected readonly ApproachPiece approachPiece; 39 | 40 | protected readonly DivaAction validAction; 41 | 42 | protected bool validPress = false; 43 | protected bool pressed = false; 44 | 45 | protected BindableBool useXB = new BindableBool(false); 46 | protected BindableBool enableVisualBursts = new BindableBool(true); 47 | 48 | protected override JudgementResult CreateResult(Judgement judgement) => new DivaJudgementResult(HitObject, judgement); 49 | 50 | public DrawableDivaHitObject(DivaHitObject hitObject) 51 | : base(hitObject) 52 | { 53 | Size = new Vector2(BASE_SIZE); 54 | 55 | Origin = Anchor.Centre; 56 | Position = hitObject.Position; 57 | 58 | AddRangeInternal(new Sprite[] 59 | { 60 | approachHand = new Sprite() 61 | { 62 | Anchor = Anchor.Centre, 63 | Origin = Anchor.Centre, 64 | RelativeSizeAxes = Axes.Both, 65 | Rotation = 180f, 66 | Depth = 1, 67 | }, 68 | approachPiece = new ApproachPiece() 69 | { 70 | Depth = 0, 71 | RelativeSizeAxes = Axes.Both, 72 | Anchor = Anchor.Centre, 73 | Origin = Anchor.Centre, 74 | Position = hitObject.ApproachPieceOriginPosition, 75 | StartPos = hitObject.ApproachPieceOriginPosition, 76 | }, 77 | }); 78 | 79 | validAction = hitObject.ValidAction; 80 | } 81 | 82 | [BackgroundDependencyLoader(true)] 83 | private void load(TextureStore textures, DivaRulesetConfigManager config) 84 | { 85 | config?.BindWith(DivaRulesetSettings.UseXBoxButtons, useXB); 86 | config?.BindWith(DivaRulesetSettings.EnableVisualBursts, enableVisualBursts); 87 | string textureLocation = GetTextureLocation(); 88 | 89 | AddInternal(new Sprite 90 | { 91 | Anchor = Anchor.Centre, 92 | Origin = Anchor.Centre, 93 | RelativeSizeAxes = Axes.Both, 94 | Texture = textures.Get($"{textureLocation}{validAction.ToString()}Stat"), 95 | Depth = 2, 96 | }); 97 | 98 | approachPiece.Texture = textures.Get($"{textureLocation}{validAction.ToString()}Move"); 99 | approachHand.Texture = textures.Get("hand"); 100 | } 101 | 102 | protected virtual string GetTextureLocation() => (useXB.Value) ? "XB/" : ""; 103 | 104 | public override IEnumerable GetSamples() => new[] 105 | { 106 | new HitSampleInfo(HitSampleInfo.HIT_NORMAL, SampleControlPoint.DEFAULT_BANK) 107 | }; 108 | 109 | public override void PlaySamples() 110 | { 111 | } 112 | 113 | protected static void ApplyMiss(JudgementResult r, DrawableHitObject s) => r.Type = HitResult.Miss; 114 | 115 | protected override void CheckForResult(bool userTriggered, double timeOffset) 116 | { 117 | if (Judged) 118 | { 119 | pressed = false; 120 | return; 121 | } 122 | 123 | if (!HitObject.HitWindows.CanBeHit(timeOffset) && base.Time.Current > HitObject.StartTime) 124 | { 125 | ApplyResult(ApplyMiss); 126 | return; 127 | } 128 | 129 | var result = HitObject.HitWindows.ResultFor(timeOffset); 130 | 131 | if (result == HitResult.None) return; 132 | 133 | if (pressed && timeOffset > (-time_action)) 134 | { 135 | if (validPress) 136 | ApplyResult((r, s) => r.Type = result); 137 | else 138 | ApplyResult(ApplyMiss); 139 | pressed = false; 140 | } 141 | } 142 | 143 | protected override double InitialLifetimeOffset => time_preempt; 144 | 145 | protected override void UpdateInitialTransforms() 146 | { 147 | this.FadeInFromZero(time_fadein); 148 | this.approachHand.ScaleTo(2, time_fadein, Easing.In); 149 | 150 | this.approachHand.RotateTo(360, time_preempt, Easing.In); 151 | //this.approachPiece.MoveTo(Vector2.Zero, time_preempt, Easing.None); 152 | } 153 | 154 | protected override void UpdateHitStateTransforms(ArmedState state) 155 | { 156 | switch (state) 157 | { 158 | case ArmedState.Hit: 159 | 160 | if (enableVisualBursts.Value) 161 | this.ScaleTo(2f, 1500, Easing.OutQuint).FadeOut(1500, Easing.OutQuint).Expire(); 162 | break; 163 | 164 | case ArmedState.Miss: 165 | const double duration = 1000; 166 | 167 | this.ScaleTo(1.1f, duration, Easing.OutQuint); 168 | this.MoveToOffset(new Vector2(0, 10), duration, Easing.In); 169 | this.FadeColour(Color4.Red.Opacity(0.5f), duration / 2, Easing.OutQuint).Then().FadeOut(duration / 2, Easing.InQuint).Expire(); 170 | break; 171 | } 172 | } 173 | 174 | protected override void Update() 175 | { 176 | var b = (float)((Time.Current - LifetimeStart) / time_preempt); 177 | if (b < 1f) 178 | this.approachPiece.UpdatePos(b); 179 | } 180 | 181 | public virtual bool OnPressed(KeyBindingPressEvent e) 182 | { 183 | this.Samples.Play(); 184 | 185 | if (Judged) 186 | return false; 187 | 188 | var action = e.Action switch 189 | { 190 | DivaAction.Right => DivaAction.Circle, 191 | DivaAction.Down => DivaAction.Cross, 192 | DivaAction.Up => DivaAction.Triangle, 193 | DivaAction.Left => DivaAction.Square, 194 | _ => e.Action, 195 | }; 196 | validPress = action == validAction; 197 | pressed = true; 198 | 199 | return true; 200 | } 201 | 202 | public virtual void OnReleased(KeyBindingReleaseEvent e) 203 | { 204 | } 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaJudgement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Allocation; 5 | using osu.Framework.Graphics; 6 | using osu.Game.Configuration; 7 | using osu.Game.Rulesets.Judgements; 8 | using osu.Game.Rulesets.Objects.Drawables; 9 | using osu.Game.Rulesets.Scoring; 10 | using osuTK; 11 | using osuTK.Graphics; 12 | 13 | namespace osu.Game.Rulesets.Diva.Objects.Drawables 14 | { 15 | public partial class DrawableDivaJudgement : DrawableJudgement 16 | { 17 | internal SkinnableLighting Lighting { get; private set; } 18 | internal Color4 AccentColour { get; private set; } 19 | 20 | [Resolved] 21 | private OsuConfigManager config { get; set; } 22 | 23 | [BackgroundDependencyLoader] 24 | private void load() 25 | { 26 | AddInternal(Lighting = new SkinnableLighting 27 | { 28 | Anchor = Anchor.Centre, 29 | Origin = Anchor.Centre, 30 | Blending = BlendingParameters.Additive, 31 | Depth = float.MaxValue, 32 | Alpha = 0 33 | }); 34 | } 35 | 36 | public override void Apply(JudgementResult result, DrawableHitObject judgedObject) 37 | { 38 | base.Apply(result, judgedObject); 39 | if (judgedObject is not DrawableDivaHitObject drawableDivaHitObject) 40 | return; 41 | 42 | AccentColour = drawableDivaHitObject.AccentColour.Value; 43 | } 44 | 45 | protected override void PrepareForUse() 46 | { 47 | base.PrepareForUse(); 48 | 49 | Lighting.ResetAnimation(); 50 | Lighting.SetColourFrom(this, Result); 51 | 52 | if (JudgedHitObject is DivaHitObject divaObject) 53 | { 54 | Position = divaObject.Position; 55 | Scale = new Vector2(1); 56 | } 57 | } 58 | 59 | protected override void ApplyHitAnimations() 60 | { 61 | bool hitLightingEnabled = config.Get(OsuSetting.HitLighting); 62 | 63 | Lighting.Alpha = 0; 64 | 65 | if (hitLightingEnabled && Lighting.Drawable != null) 66 | { 67 | // todo: this animation changes slightly based on new/old legacy skin versions. 68 | Lighting.ScaleTo(0.8f).ScaleTo(1.2f, 600, Easing.Out); 69 | Lighting.FadeIn(200).Then().Delay(200).FadeOut(1000); 70 | 71 | // extend the lifetime to cover lighting fade 72 | LifetimeEnd = Lighting.LatestTransformEndTime; 73 | } 74 | 75 | base.ApplyHitAnimations(); 76 | } 77 | 78 | protected override Drawable CreateDefaultJudgement(HitResult result) => new DivaJudgementPiece(result); 79 | 80 | private partial class DivaJudgementPiece : DefaultJudgementPiece 81 | { 82 | public DivaJudgementPiece(HitResult result) 83 | : base(result) 84 | { 85 | } 86 | 87 | public override void PlayAnimation() 88 | { 89 | base.PlayAnimation(); 90 | 91 | if (Result != HitResult.Miss) 92 | JudgementText.TransformSpacingTo(Vector2.Zero).Then().TransformSpacingTo(new Vector2(14, 0), 1800, Easing.OutQuint); 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/Drawables/Pieces/ApproachPiece.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Graphics.Sprites; 5 | using osuTK; 6 | namespace osu.Game.Rulesets.Diva.Objects.Drawables.Pieces 7 | { 8 | public partial class ApproachPiece : Sprite 9 | { 10 | private const float slerp_distance = 150; 11 | public Vector2 StartPos; 12 | public void UpdatePos(float blend) 13 | { 14 | Position = Extensions.CubicInterpolate(StartPos, Vector2.Zero, blend, slerp_distance); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Objects/Drawables/SkinnableLighting.cs: -------------------------------------------------------------------------------- 1 | // Taken from https://github.com/ppy/osu/blob/master/osu.Game.Rulesets.Osu/Objects/Drawables/SkinnableLighting.cs 2 | 3 | using osu.Game.Rulesets.Judgements; 4 | using osu.Game.Skinning; 5 | using osuTK.Graphics; 6 | 7 | namespace osu.Game.Rulesets.Diva.Objects.Drawables 8 | { 9 | internal partial class SkinnableLighting : SkinnableSprite 10 | { 11 | private DrawableDivaJudgement targetObject; 12 | private JudgementResult targetResult; 13 | 14 | public SkinnableLighting() 15 | : base("lighting") 16 | { 17 | } 18 | 19 | protected override void SkinChanged(ISkinSource skin) 20 | { 21 | base.SkinChanged(skin); 22 | updateColour(); 23 | } 24 | 25 | /// 26 | /// Updates the lighting colour from a given hitobject and result. 27 | /// 28 | /// The that's been judged. 29 | /// The that was judged with. 30 | public void SetColourFrom(DrawableDivaJudgement targetObject, JudgementResult targetResult) 31 | { 32 | this.targetObject = targetObject; 33 | this.targetResult = targetResult; 34 | 35 | updateColour(); 36 | } 37 | 38 | private void updateColour() 39 | { 40 | if (targetObject == null || targetResult == null) 41 | Colour = Color4.White; 42 | else 43 | Colour = targetResult.IsHit ? targetObject.AccentColour : Color4.Transparent; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Replays/DivaAutoGenerator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Game.Beatmaps; 6 | using osu.Game.Replays; 7 | using osu.Game.Rulesets.Diva.Objects; 8 | using osu.Game.Rulesets.Replays; 9 | using osu.Game.Rulesets.Scoring; 10 | 11 | namespace osu.Game.Rulesets.Diva.Replays 12 | { 13 | public class DivaAutoGenerator : AutoGenerator 14 | { 15 | protected Replay Replay; 16 | protected List Frames => Replay.Frames; 17 | 18 | public new Beatmap Beatmap => (Beatmap)base.Beatmap; 19 | 20 | public DivaAutoGenerator(IBeatmap beatmap) 21 | : base(beatmap) 22 | { 23 | Replay = new Replay(); 24 | } 25 | 26 | public override Replay Generate() 27 | { 28 | Frames.Add(new DivaReplayFrame()); 29 | 30 | double prevTime = 0d; 31 | for (int i = 0; i < Beatmap.HitObjects.Count; i++) 32 | { 33 | DivaHitObject hitObject = Beatmap.HitObjects[i]; 34 | var hitTime = hitObject.StartTime + hitObject.HitWindows.WindowFor(HitResult.Perfect); 35 | if (i > 0) 36 | { 37 | Frames.Add(new DivaReplayFrame(Lerp(prevTime, hitTime, 0.1))); 38 | } 39 | 40 | if (hitObject is DoublePressButton dButt) 41 | Frames.Add(new DivaReplayFrame(hitTime, hitObject.ValidAction, dButt.DoubleAction)); 42 | else 43 | Frames.Add(new DivaReplayFrame(hitTime, hitObject.ValidAction)); 44 | 45 | prevTime = hitTime; 46 | } 47 | 48 | return Replay; 49 | } 50 | 51 | double Lerp(double a, double b, double t) 52 | => a + (b - a) * t; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Replays/DivaFramedReplayInputHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Framework.Input.StateChanges; 6 | using osu.Game.Replays; 7 | using osu.Game.Rulesets.Replays; 8 | 9 | namespace osu.Game.Rulesets.Diva.Replays 10 | { 11 | public class DivaFramedReplayInputHandler : FramedReplayInputHandler 12 | { 13 | public DivaFramedReplayInputHandler(Replay replay) 14 | : base(replay) 15 | { 16 | } 17 | 18 | protected override bool IsImportant(DivaReplayFrame frame) => frame.Actions.Count > 0; 19 | 20 | protected override void CollectReplayInputs(List inputs) 21 | { 22 | inputs.Add(new ReplayState() 23 | { 24 | PressedActions = CurrentFrame?.Actions ?? new List(), 25 | }); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Replays/DivaReplayFrame.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Game.Rulesets.Replays; 6 | 7 | namespace osu.Game.Rulesets.Diva.Replays 8 | { 9 | public class DivaReplayFrame : ReplayFrame 10 | { 11 | public List Actions = new List(); 12 | 13 | public DivaReplayFrame() 14 | { 15 | } 16 | 17 | public DivaReplayFrame(double time, params DivaAction[] actions) : base(time) 18 | { 19 | Actions.AddRange(actions); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Samples/Gameplay/normal-hitnormal.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Samples/Gameplay/normal-hitnormal.mp3 -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/CircleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/CircleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/CircleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/CircleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/CrossMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/CrossMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/CrossStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/CrossStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CircleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CircleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CircleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CircleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CrossMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CrossMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CrossStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/CrossStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/SquareMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/SquareMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/SquareStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/SquareStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/TriangleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/TriangleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/TriangleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/TriangleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CircleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CircleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CircleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CircleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CrossMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CrossMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CrossStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/CrossStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/SquareMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/SquareMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/SquareStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/SquareStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/TriangleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/TriangleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/TriangleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/Doubles/XB/TriangleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/SquareMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/SquareMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/SquareStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/SquareStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/TriangleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/TriangleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/TriangleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/TriangleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/CircleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/CircleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/CircleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/CircleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/CrossMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/CrossMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/CrossStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/CrossStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/SquareMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/SquareMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/SquareStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/SquareStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/TriangleMove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/TriangleMove.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/XB/TriangleStat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/XB/TriangleStat.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/archive/divaold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/archive/divaold.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/archive/new_ps_buttons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 25 | 29 | 30 | 33 | 37 | 38 | 41 | 45 | 46 | 54 | 58 | 59 | 67 | 71 | 72 | 80 | 84 | 85 | 93 | 97 | 98 | 106 | 110 | 111 | 119 | 123 | 124 | 132 | 136 | 137 | 145 | 149 | 150 | 158 | 162 | 163 | 164 | 185 | 190 | 191 | 193 | 194 | 196 | image/svg+xml 197 | 199 | 200 | 201 | 202 | 203 | 207 | 214 | 222 | 230 | 236 | 237 | 245 | 254 | 263 | 271 | 279 | 287 | 295 | 305 | 315 | 323 | 343 | 363 | B 374 | 382 | 388 | 389 | 397 | 403 | 404 | Y 415 | A 426 | 434 | 440 | 441 | X 452 | 460 | 465 | 466 | 474 | 480 | 481 | 489 | 495 | 496 | 504 | 509 | 510 | 515 | 520 | 521 | 526 | 531 | 532 | 537 | 542 | 543 | 548 | 553 | 554 | 564 | 573 | 584 | 599 | 607 | 615 | 623 | 631 | 639 | 647 | 655 | 663 | 672 | 680 | 689 | 697 | 706 | 714 | 715 | 716 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/archive/resize500x500.bat: -------------------------------------------------------------------------------- 1 | for %%Z in (%*)do ffmpeg -i %%Z -vf "scale=500:500:force_original_aspect_ratio=decrease,pad=500:500:(ow-iw)/2:(oh-ih)/2:color=00000000,setsar=1" %%Z.png && move "%%~Z.png" %%Z 2 | pause -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/diva.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/diva.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Resources/Textures/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Artemis-chan/osu-DIVA/ed7c45caba2d925e4351dc504d1c06084f1b8838/osu.Game.Rulesets.Diva/Resources/Textures/hand.png -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Scoring/DivaHitWindows.cs: -------------------------------------------------------------------------------- 1 | using osu.Game.Rulesets.Scoring; 2 | 3 | namespace osu.Game.Rulesets.Diva.Scoring 4 | { 5 | public class DivaHitWindows : HitWindows 6 | { 7 | public override bool IsHitResultAllowed(HitResult result) 8 | { 9 | switch (result) 10 | { 11 | case HitResult.Perfect: 12 | case HitResult.Great: 13 | case HitResult.Good: 14 | case HitResult.Ok: 15 | case HitResult.Meh: 16 | case HitResult.Miss: 17 | return true; 18 | } 19 | return false; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/Scoring/DivaScoreProcessor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Game.Rulesets.Diva.Judgements; 5 | using osu.Game.Rulesets.Diva.Objects; 6 | using osu.Game.Rulesets.Judgements; 7 | using osu.Game.Rulesets.Objects; 8 | using osu.Game.Rulesets.Scoring; 9 | 10 | namespace osu.Game.Rulesets.Diva.Scoring 11 | { 12 | public partial class DivaScoreProcessor : ScoreProcessor 13 | { 14 | public DivaScoreProcessor(Ruleset ruleset) : base(ruleset) 15 | { 16 | } 17 | 18 | protected override JudgementResult CreateResult(HitObject hitObject, Judgement judgement) => 19 | new DivaJudgementResult((DivaHitObject)hitObject, judgement); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/UI/DivaPlayfield.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using osu.Framework.Allocation; 8 | using osu.Framework.Graphics; 9 | using osu.Framework.Graphics.Pooling; 10 | using osu.Framework.Graphics.Containers; 11 | using osu.Framework.Input.Bindings; 12 | using osu.Game.Skinning; 13 | using osu.Game.Audio; 14 | using osu.Game.Rulesets.Judgements; 15 | using osu.Game.Rulesets.UI; 16 | using osu.Game.Rulesets.Objects; 17 | using osu.Game.Rulesets.Objects.Drawables; 18 | using osu.Game.Rulesets.Scoring; 19 | using osu.Game.Rulesets.Diva.Scoring; 20 | using osu.Game.Rulesets.Diva.Objects.Drawables; 21 | using osu.Framework.Input.Events; 22 | 23 | namespace osu.Game.Rulesets.Diva.UI 24 | { 25 | [Cached] 26 | public partial class DivaPlayfield : Playfield, IKeyBindingHandler 27 | { 28 | SkinnableSound hitSample; 29 | private readonly JudgementContainer judgementLayer; 30 | 31 | private readonly IDictionary> poolDictionary = new Dictionary>(); 32 | 33 | private readonly Container judgementAboveHitObjectLayer; 34 | [BackgroundDependencyLoader] 35 | private void load() 36 | { 37 | AddRangeInternal(new Drawable[] 38 | { 39 | HitObjectContainer, 40 | hitSample = new SkinnableSound(new SampleInfo("normal-hitnormal")), 41 | }); 42 | } 43 | 44 | public DivaPlayfield() 45 | { 46 | InternalChildren = new Drawable[] 47 | { 48 | judgementLayer = new JudgementContainer { RelativeSizeAxes = Axes.Both }, 49 | judgementAboveHitObjectLayer = new Container { RelativeSizeAxes = Axes.Both } 50 | }; 51 | 52 | var hitWindows = new DivaHitWindows(); 53 | foreach (var result in Enum.GetValues(typeof(HitResult)).OfType().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r))) 54 | poolDictionary.Add(result, new DrawableJudgementPool(result, onJudgementLoaded)); 55 | 56 | AddRangeInternal(poolDictionary.Values); 57 | 58 | NewResult += onNewResult; 59 | } 60 | 61 | public bool OnPressed(KeyBindingPressEvent e) 62 | { 63 | this.hitSample.Play(); 64 | return true; 65 | } 66 | 67 | public void OnReleased(KeyBindingReleaseEvent e) 68 | { 69 | } 70 | 71 | private void onJudgementLoaded(DrawableDivaJudgement j) 72 | { 73 | judgementAboveHitObjectLayer.Add(j.ProxiedAboveHitObjectsContent); 74 | } 75 | 76 | private void onNewResult(DrawableHitObject judgedObject, JudgementResult result) 77 | { 78 | if (!judgedObject.DisplayResult) 79 | return; 80 | 81 | DrawableDivaJudgement explosion = poolDictionary[result.Type].Get(doj => doj.Apply(result, judgedObject)); 82 | judgementLayer.Add(explosion); 83 | } 84 | 85 | private partial class DrawableJudgementPool : DrawablePool 86 | { 87 | private readonly HitResult result; 88 | private readonly Action onLoaded; 89 | 90 | public DrawableJudgementPool(HitResult result, Action onLoaded) 91 | : base(10) 92 | { 93 | this.result = result; 94 | this.onLoaded = onLoaded; 95 | } 96 | 97 | protected override DrawableDivaJudgement CreateNewDrawable() 98 | { 99 | var judgement = base.CreateNewDrawable(); 100 | 101 | // just a placeholder to initialise the correct drawable hierarchy for this pool. 102 | judgement.Apply(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null); 103 | 104 | onLoaded?.Invoke(judgement); 105 | 106 | return judgement; 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/UI/DivaPlayfieldAdjustmentContainer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Graphics; 5 | using osu.Game.Rulesets.UI; 6 | using osuTK; 7 | 8 | namespace osu.Game.Rulesets.Diva.UI 9 | { 10 | public partial class DivaPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer 11 | { 12 | public DivaPlayfieldAdjustmentContainer() 13 | { 14 | Anchor = Anchor.Centre; 15 | Origin = Anchor.Centre; 16 | 17 | Size = new Vector2(0.8f); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/UI/DivaSettingsSubsection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using osu.Framework.Allocation; 5 | using osu.Framework.Graphics; 6 | using osu.Framework.Localisation; 7 | using osu.Game.Overlays.Settings; 8 | using osu.Game.Rulesets.Diva.Configuration; 9 | 10 | namespace osu.Game.Rulesets.Diva.UI 11 | { 12 | public partial class DivaSettingsSubsection : RulesetSettingsSubsection 13 | { 14 | protected override LocalisableString Header => new("osu!DIVA"); 15 | 16 | public DivaSettingsSubsection(Ruleset ruleset) 17 | : base(ruleset) 18 | { 19 | } 20 | 21 | [BackgroundDependencyLoader] 22 | private void load() 23 | { 24 | var config = (DivaRulesetConfigManager)Config; 25 | 26 | if (config == null) 27 | return; 28 | 29 | Children = new Drawable[] 30 | { 31 | new SettingsCheckbox 32 | { 33 | LabelText = "Use XBox Button Icons", 34 | Current = config.GetBindable(DivaRulesetSettings.UseXBoxButtons) 35 | }, 36 | new SettingsCheckbox 37 | { 38 | LabelText = "Enable visual bursts", 39 | Current = config.GetBindable(DivaRulesetSettings.EnableVisualBursts) 40 | } 41 | }; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/UI/DrawableDivaRuleset.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. 2 | // See the LICENCE file in the repository root for full licence text. 3 | 4 | using System.Collections.Generic; 5 | using osu.Framework.Allocation; 6 | using osu.Framework.Input; 7 | using osu.Game.Beatmaps; 8 | using osu.Game.Input.Handlers; 9 | using osu.Game.Replays; 10 | using osu.Game.Rulesets.Mods; 11 | using osu.Game.Rulesets.Objects.Drawables; 12 | using osu.Game.Rulesets.Diva.Objects; 13 | using osu.Game.Rulesets.Diva.Objects.Drawables; 14 | using osu.Game.Rulesets.Diva.Replays; 15 | using osu.Game.Rulesets.UI; 16 | 17 | namespace osu.Game.Rulesets.Diva.UI 18 | { 19 | [Cached] 20 | public partial class DrawableDivaRuleset : DrawableRuleset 21 | { 22 | public DrawableDivaRuleset(DivaRuleset ruleset, IBeatmap beatmap, IReadOnlyList mods = null) 23 | : base(ruleset, beatmap, mods) 24 | { 25 | } 26 | 27 | public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new DivaPlayfieldAdjustmentContainer(); 28 | 29 | protected override Playfield CreatePlayfield() => new DivaPlayfield(); 30 | 31 | protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new DivaFramedReplayInputHandler(replay); 32 | 33 | public override DrawableHitObject CreateDrawableRepresentation(DivaHitObject h) 34 | { 35 | //not sure how other rulessets do this so going with this for now 36 | switch (h) 37 | { 38 | case DoublePressButton: 39 | return new DrawableDivaDoubleHitObject(h); 40 | default: 41 | return new DrawableDivaHitObject(h); 42 | } 43 | } 44 | 45 | protected override PassThroughInputManager CreateInputManager() => new DivaInputManager(Ruleset?.RulesetInfo); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | osu.Game.Rulesets.Sample 5 | Library 6 | AnyCPU 7 | osu.Game.Rulesets.Diva 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | --------------------------------------------------------------------------------