Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
function recalcSectionState(curStep:Int, curDecStep:Float):Void { Reflect.setField(game, 'curStep', curStep); Reflect.setField(game, 'curDecStep', curDecStep); var rollbackFunc:Dynamic = Reflect.field(game, 'rollbackSection'); if (rollbackFunc != null) { Reflect.callMethod(game, rollbackFunc, []); return; } if (game.SONG == null || game.SONG.notes == null) { return; } var notes:Array
= game.SONG.notes; var totalSections:Int = notes.length; var cumulativeSteps:Int = 0; var targetSection:Int = 0; var found:Bool = false; for (i in 0...totalSections) { var section:Dynamic = notes[i]; if (section == null) continue; var sectionBeats:Float = section.sectionBeats; if (sectionBeats == null || sectionBeats <= 0) sectionBeats = 4; cumulativeSteps += Math.round(sectionBeats * 4); if (curStep < cumulativeSteps) { targetSection = i; found = true; break; } } if (!found) { targetSection = Math.max(0, totalSections - 1); } Reflect.setField(game, 'curSection', targetSection); if (cumulativeSteps <= curStep) { var beatsAhead:Float = 4; var sectionData:Dynamic = notes[targetSection]; if (sectionData != null) { beatsAhead = sectionData.sectionBeats; if (beatsAhead == null || beatsAhead <= 0) beatsAhead = 4; } cumulativeSteps = curStep + Math.round(beatsAhead * 4); } Reflect.setField(game, 'stepsToDo', cumulativeSteps); }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)