diff --git a/buildnumber.txt b/buildnumber.txt index 0bc965de..c5803282 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1877 \ No newline at end of file +1878 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 41815d2b..f6ac8e86 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -403,6 +403,12 @@ class PlayState extends MusicBeatState */ public var noteTypesArray:Array = [null]; + /** + * Hit window, in milliseconds. Defaults to 250ms unless changed in options. + * Base game hit window is 175ms. + */ + public var hitWindow:Float = Options.hitWindow; // is calculated in create(), is safeFrames in milliseconds + @:dox(hide) var __vocalOffsetViolation:Float = 0; @@ -1265,10 +1271,10 @@ class PlayState extends MusicBeatState if (event.__updateHitWindow) { if (daNote.mustPress) { - daNote.canBeHit = (daNote.strumTime > Conductor.songPosition - (Conductor.safeZoneOffset * daNote.latePressWindow) - && daNote.strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * daNote.earlyPressWindow)); + daNote.canBeHit = (daNote.strumTime > Conductor.songPosition - (hitWindow * daNote.latePressWindow) + && daNote.strumTime < Conductor.songPosition + (hitWindow * daNote.earlyPressWindow)); - if (daNote.strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !daNote.wasGoodHit) + if (daNote.strumTime < Conductor.songPosition - hitWindow && !daNote.wasGoodHit) daNote.tooLate = true; } else @@ -1500,19 +1506,19 @@ class PlayState extends MusicBeatState var score:Int = 300; var accuracy:Float = 1; - if (noteDiff > Conductor.safeZoneOffset * 0.9) + if (noteDiff > hitWindow * 0.9) { daRating = 'shit'; score = 50; accuracy = 0.25; } - else if (noteDiff > Conductor.safeZoneOffset * 0.75) + else if (noteDiff > hitWindow * 0.75) { daRating = 'bad'; score = 100; accuracy = 0.45; } - else if (noteDiff > Conductor.safeZoneOffset * 0.2) + else if (noteDiff > hitWindow * 0.2) { daRating = 'good'; score = 200; diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 2b0089fc..3932fdf3 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -24,6 +24,7 @@ class Options public static var volume:Float = 1; public static var week6PixelPerfect:Bool = true; public static var betaUpdates:Bool = false; + public static var hitWindow:Float = 250; /** * PLAYER 1 CONTROLS @@ -58,7 +59,7 @@ class Options public static var P2_RESET:Array = []; /** - * SOLO GETTERS & SETTERS + * SOLO GETTERS */ public static var SOLO_NOTE_LEFT(get, null):Array; public static var SOLO_NOTE_DOWN(get, null):Array; diff --git a/source/funkin/scripting/HScript.hx b/source/funkin/scripting/HScript.hx index 9ad76c8a..7807838f 100644 --- a/source/funkin/scripting/HScript.hx +++ b/source/funkin/scripting/HScript.hx @@ -53,7 +53,10 @@ class HScript extends Script { } public override function onLoad() { - if (expr != null) interp.execute(expr); + if (expr != null) { + interp.execute(expr); + call("new", []); + } } public override function reload() { diff --git a/source/funkin/system/Conductor.hx b/source/funkin/system/Conductor.hx index 17e29a91..916140ae 100644 --- a/source/funkin/system/Conductor.hx +++ b/source/funkin/system/Conductor.hx @@ -79,8 +79,6 @@ class Conductor @:dox(hide) public static var destSpeed:Float = 0; @:dox(hide) public static var offset:Float = 0; - @:dox(hide) public static var safeZoneOffset:Float = 175; // is calculated in create(), is safeFrames in milliseconds - /** * Array of all BPM changes that have been mapped. */