Skip to content

Commit 80ca43b

Browse files
committed
shits break combo because read desc
this engine is spam and get away with it central like i struggled to hit a shit no joke and i did get owner approval to do this
1 parent 8f05839 commit 80ca43b

2 files changed

Lines changed: 52 additions & 7 deletions

File tree

source/funkin/game/PlayState.hx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,18 @@ class PlayState extends MusicBeatState
623623
curRating = event.rating;
624624
}
625625

626+
private function onRatingChange(rating:Rating) {
627+
if (!hits.exists(rating.name))
628+
hits.set(rating.name, 0);
629+
630+
if (Options.ghostTapping) {
631+
comboBreaks = false;
632+
for (rating in ratingManager.ratingData)
633+
comboBreaks = comboBreaks || rating.breaksCombo;
634+
} else
635+
comboBreaks = true;
636+
}
637+
626638
private inline function set_health(v:Float)
627639
return health = FlxMath.bound(v, 0, maxHealth);
628640
private inline function set_maxHealth(v:Float) {
@@ -690,6 +702,14 @@ class PlayState extends MusicBeatState
690702
detailsText = isStoryMode ? ("Story Mode: " + storyWeek.name) : "Freeplay";
691703

692704
for (rating in [for (i in ratingManager.ratingData) i.name]) hits.set(rating, 0); // Ensure all keys exist as to prevent null errors.
705+
if (Options.ghostTapping) {
706+
comboBreaks = false;
707+
for (rating in ratingManager.ratingData)
708+
comboBreaks = comboBreaks || rating.breaksCombo;
709+
} else
710+
comboBreaks = true;
711+
ratingManager.onRatingAdded.add(onRatingChange);
712+
ratingManager.onRatingRemoved.add(onRatingChange);
693713

694714
// Checks if cutscene files exists
695715
var cutscenePath = Paths.script('songs/${SONG.meta.name}/cutscene');
@@ -1946,9 +1966,9 @@ class PlayState extends MusicBeatState
19461966

19471967
var event:NoteHitEvent;
19481968
if (strumLine != null && !strumLine.cpu)
1949-
event = EventManager.get(NoteHitEvent).recycle(false, !note.isSustainNote, !note.isSustainNote, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, true, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, rating.score, note.isSustainNote ? null : rating.accuracy, 0.023, rating.name, Options.splashesEnabled && !note.isSustainNote && rating.splash, 0.5, true, 0.7, true, true, iconP1);
1969+
event = EventManager.get(NoteHitEvent).recycle(rating.breaksCombo, !note.isSustainNote, !note.isSustainNote, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, true, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, rating.score, note.isSustainNote ? null : rating.accuracy, rating.health, rating.name, Options.splashesEnabled && !note.isSustainNote && rating.splash, 0.5, true, 0.7, true, true, iconP1);
19501970
else
1951-
event = EventManager.get(NoteHitEvent).recycle(false, false, false, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, false, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, 0, null, 0, rating.name, false, 0.5, true, 0.7, true, true, iconP2);
1971+
event = EventManager.get(NoteHitEvent).recycle(rating.breaksCombo, false, false, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, false, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, 0, null, 0, rating.name, false, 0.5, true, 0.7, true, true, iconP2);
19521972
event.deleteNote = !note.isSustainNote; // work around, to allow sustain notes to be deleted
19531973
event = scripts.event(strumLine != null && !strumLine.cpu ? "onPlayerHit" : "onDadHit", event);
19541974
strumLine.onHit.dispatch(event);
@@ -1964,7 +1984,11 @@ class PlayState extends MusicBeatState
19641984
totalAccuracyAmount += event.accuracy;
19651985
updateRating();
19661986
}
1967-
if (event.countAsCombo) combo++;
1987+
if (event.misses) {
1988+
combo = 0;
1989+
misses++;
1990+
} else if (event.countAsCombo)
1991+
combo++;
19681992

19691993
if (event.showRating || (event.showRating == null && event.player))
19701994
{

source/funkin/game/scoring/RatingManager.hx

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package funkin.game.scoring;
22

33
import funkin.game.scoring.*;
44
import funkin.game.scoring.HitWindowData.WindowPreset;
5+
import flixel.util.FlxSignal;
56

67
import haxe.ds.StringMap;
78

@@ -10,6 +11,9 @@ import haxe.ds.StringMap;
1011
*/
1112
class RatingManager
1213
{
14+
public var onRatingAdded:FlxTypedSignal<Rating->Void> = new FlxTypedSignal();
15+
public var onRatingRemoved:FlxTypedSignal<Rating->Void> = new FlxTypedSignal();
16+
1317
public var hitWindows:StringMap<Float>;
1418
public var ratingData:Array<Rating> = [];
1519
public var lastHitWindow:Float = -1;
@@ -50,9 +54,9 @@ class RatingManager
5054
}
5155

5256
addRating({name: "sick", window: getWindow("sick"), accuracy: 1, score: 300, splash: true});
53-
addRating({name: "good", window: getWindow("good"), accuracy: 0.75, score: 200});
54-
addRating({name: "bad", window: getWindow("bad"), accuracy: 0.45, score: 100});
55-
addRating({name: "shit", window: getWindow("shit"), accuracy: 0.25, score: 50});
57+
addRating({name: "good", window: getWindow("good"), accuracy: 0.75, score: 200, health: 0.015});
58+
addRating({name: "bad", window: getWindow("bad"), accuracy: 0.45, score: 100, health: 0});
59+
addRating({name: "shit", window: getWindow("shit"), accuracy: 0.25, score: 50, health: -0.05, breaksCombo: true});
5660
}
5761

5862
public function addRating(data:Dynamic)
@@ -71,7 +75,9 @@ class RatingManager
7175
window: window,
7276
accuracy: data.accuracy != null ? data.accuracy : 1,
7377
score: data.score != null ? data.score : 0,
78+
health: data.health != null ? data.health : 0.023,
7479
splash: data.splash == true,
80+
breaksCombo: data.breaksCombo == true,
7581
hittable: data.hittable != null ? data.hittable : true
7682
};
7783

@@ -86,13 +92,18 @@ class RatingManager
8692
ratingData.push(newRating);
8793

8894
ratingData.sort((a, b) -> Reflect.compare(a.window, b.window));
95+
onRatingAdded.dispatch(newRating);
8996
}
9097

9198
public function removeRating(name:String):Void
9299
{
93100
if (name == null) return;
94101
name = name.toLowerCase();
95-
ratingData = ratingData.filter(r -> r.name != name);
102+
var toRemove = ratingData.filter(r -> r.name == name);
103+
for (rating in toRemove) {
104+
ratingData.remove(rating);
105+
onRatingRemoved.dispatch(rating);
106+
}
96107
}
97108

98109
public function getHitWindow(name:String):Float
@@ -126,11 +137,21 @@ final class Rating
126137
*/
127138
public var score:Int = 0;
128139

140+
/**
141+
* Amount of health given when earning this rating.
142+
*/
143+
public var health:Float = 0.023;
144+
129145
/**
130146
* If this rating was hit, a note splash will appear.
131147
*/
132148
@:optional public var splash:Bool = false;
133149

150+
/**
151+
* Whether the rating will break your combo or not.
152+
*/
153+
@:optional public var breaksCombo:Bool = false;
154+
134155
/**
135156
* Whether the rating is hittable or not.
136157
*/

0 commit comments

Comments
 (0)