Skip to content

Commit ba446c7

Browse files
random up the hitsounds!
1 parent 66d3f55 commit ba446c7

File tree

3 files changed

+106
-5
lines changed

3 files changed

+106
-5
lines changed

source/HealthIcon.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class HealthIcon extends FlxSprite
2626
super.update(elapsed);
2727

2828
if (sprTracker != null)
29-
setPosition(sprTracker.x + sprTracker.width + 10, sprTracker.y - 30);
29+
setPosition(sprTracker.x + sprTracker.width + 12, sprTracker.y - 30);
3030
}
3131

3232
public function swapOldIcon() {

source/PlayState.hx

Lines changed: 104 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,45 @@ class PlayState extends MusicBeatState
18071807
//PRECACHING MISS SOUNDS BECAUSE I THINK THEY CAN LAG PEOPLE AND FUCK THEM UP IDK HOW HAXE WORKS
18081808
if (hitSoundString != "none")
18091809
hitsound = FlxG.sound.load(Paths.sound("hitsounds/" + Std.string(hitSoundString).toLowerCase()));
1810+
if (hitSoundString == 'Randomized')
1811+
{
1812+
hitsound = FlxG.sound.load(Paths.sound("hitsounds/" + 'osu!mania'));
1813+
hitsound2 = FlxG.sound.load(Paths.sound("hitsounds/" + 'dave and bambi'));
1814+
hitsound3 = FlxG.sound.load(Paths.sound("hitsounds/" + 'indie cross'));
1815+
hitsound4 = FlxG.sound.load(Paths.sound("hitsounds/" + 'snap'));
1816+
hitsound5 = FlxG.sound.load(Paths.sound("hitsounds/" + 'clap'));
1817+
hitsound6 = FlxG.sound.load(Paths.sound("hitsounds/" + 'generic click'));
1818+
hitsound7 = FlxG.sound.load(Paths.sound("hitsounds/" + 'keyboard click'));
1819+
hitsound8 = FlxG.sound.load(Paths.sound("hitsounds/" + 'vine boom'));
1820+
}
18101821
if(ClientPrefs.hitsoundVolume > 0) precacheList.set('hitsound', 'sound');
1822+
if(ClientPrefs.hitsoundVolume > 0 && hitSoundString == 'Randomized')
1823+
{
1824+
precacheList.set('hitsound', 'sound');
1825+
precacheList.set('hitsound2', 'sound');
1826+
precacheList.set('hitsound3', 'sound');
1827+
precacheList.set('hitsound4', 'sound');
1828+
precacheList.set('hitsound5', 'sound');
1829+
precacheList.set('hitsound6', 'sound');
1830+
precacheList.set('hitsound7', 'sound');
1831+
precacheList.set('hitsound8', 'sound');
1832+
hitsound.volume = ClientPrefs.hitsoundVolume;
1833+
hitsound.pitch = playbackRate;
1834+
hitsound2.volume = ClientPrefs.hitsoundVolume;
1835+
hitsound2.pitch = playbackRate;
1836+
hitsound3.volume = ClientPrefs.hitsoundVolume;
1837+
hitsound3.pitch = playbackRate;
1838+
hitsound4.volume = ClientPrefs.hitsoundVolume;
1839+
hitsound4.pitch = playbackRate;
1840+
hitsound5.volume = ClientPrefs.hitsoundVolume;
1841+
hitsound5.pitch = playbackRate;
1842+
hitsound6.volume = ClientPrefs.hitsoundVolume;
1843+
hitsound6.pitch = playbackRate;
1844+
hitsound7.volume = ClientPrefs.hitsoundVolume;
1845+
hitsound7.pitch = playbackRate;
1846+
hitsound8.volume = ClientPrefs.hitsoundVolume;
1847+
hitsound8.pitch = playbackRate;
1848+
}
18111849
hitsound.volume = ClientPrefs.hitsoundVolume;
18121850
hitsound.pitch = playbackRate;
18131851
precacheList.set('missnote1', 'sound');
@@ -3734,10 +3772,9 @@ class PlayState extends MusicBeatState
37343772
if (ClientPrefs.iconBounceType == 'Golden Apple') {
37353773
iconP1.centerOffsets();
37363774
iconP2.centerOffsets();
3737-
}
3738-
37393775
iconP1.updateHitbox();
37403776
iconP2.updateHitbox();
3777+
}
37413778

37423779
var iconOffset:Int = 26;
37433780

@@ -5882,6 +5919,13 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
58825919
}
58835920

58845921
var hitsound:FlxSound;
5922+
var hitsound2:FlxSound;
5923+
var hitsound3:FlxSound;
5924+
var hitsound4:FlxSound;
5925+
var hitsound5:FlxSound;
5926+
var hitsound6:FlxSound;
5927+
var hitsound7:FlxSound;
5928+
var hitsound8:FlxSound;
58855929

58865930
function goodNoteHit(note:Note):Void
58875931
{
@@ -5895,8 +5939,18 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
58955939

58965940
if (ClientPrefs.hitsoundVolume > 0 && !note.hitsoundDisabled)
58975941
{
5942+
if (hitSoundString != 'Randomized')
5943+
{
58985944
hitsound.play(true);
5945+
}
58995946
hitsound.pitch = playbackRate;
5947+
hitsound2.pitch = playbackRate;
5948+
hitsound3.pitch = playbackRate;
5949+
hitsound4.pitch = playbackRate;
5950+
hitsound5.pitch = playbackRate;
5951+
hitsound6.pitch = playbackRate;
5952+
hitsound7.pitch = playbackRate;
5953+
hitsound8.pitch = playbackRate;
59005954
if (hitSoundString == 'vine boom')
59015955
{
59025956
SPUNCHBOB = new FlxSprite().loadGraphic(Paths.image('sadsponge'));
@@ -5915,6 +5969,53 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
59155969
}
59165970
});
59175971
}
5972+
if (ClientPrefs.hitsoundType == 'Randomized') {
5973+
var randomHitSoundType:Int = FlxG.random.int(1, 8);
5974+
switch (randomHitSoundType)
5975+
{
5976+
case 1:
5977+
hitsound.play(true);
5978+
hitsound.pitch = playbackRate;
5979+
case 2:
5980+
hitsound2.play(true);
5981+
hitsound2.pitch = playbackRate;
5982+
case 3:
5983+
hitsound3.play(true);
5984+
hitsound3.pitch = playbackRate;
5985+
case 4:
5986+
hitsound4.play(true);
5987+
hitsound4.pitch = playbackRate;
5988+
case 5:
5989+
hitsound5.play(true);
5990+
hitsound5.pitch = playbackRate;
5991+
case 6:
5992+
hitsound6.play(true);
5993+
hitsound6.pitch = playbackRate;
5994+
case 7:
5995+
hitsound7.play(true);
5996+
hitsound7.pitch = playbackRate;
5997+
case 8:
5998+
hitsound8.play(true);
5999+
hitsound8.pitch = playbackRate;
6000+
{
6001+
SPUNCHBOB = new FlxSprite().loadGraphic(Paths.image('sadsponge'));
6002+
SPUNCHBOB.antialiasing = ClientPrefs.globalAntialiasing;
6003+
SPUNCHBOB.scrollFactor.set();
6004+
SPUNCHBOB.setGraphicSize(Std.int(SPUNCHBOB.width / FlxG.camera.zoom));
6005+
SPUNCHBOB.updateHitbox();
6006+
SPUNCHBOB.screenCenter();
6007+
SPUNCHBOB.alpha = 1;
6008+
SPUNCHBOB.cameras = [camGame];
6009+
add(SPUNCHBOB);
6010+
FlxTween.tween(SPUNCHBOB, {alpha: 0}, 1 / (SONG.bpm/100) / playbackRate, {
6011+
onComplete: function(tween:FlxTween)
6012+
{
6013+
SPUNCHBOB.destroy();
6014+
}
6015+
});
6016+
}
6017+
}
6018+
}
59186019
}
59196020

59206021
if(note.hitCausesMiss) {
@@ -6470,7 +6571,7 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
64706571

64716572
iconP1.updateHitbox();
64726573
iconP2.updateHitbox();
6473-
}
6574+
}
64746575
if (ClientPrefs.iconBounceType == 'VS Steve') {
64756576
if (curBeat % gfSpeed == 0)
64766577
{

source/options/GameplaySettingsSubState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class GameplaySettingsSubState extends BaseOptionsMenu
152152
'hitsoundType',
153153
'string',
154154
'osu!mania',
155-
['osu!mania', 'Dave And Bambi', 'Indie Cross', 'Snap', 'Clap', 'Generic Click', 'Keyboard Click', 'vine boom']);
155+
['osu!mania', 'Dave And Bambi', 'Indie Cross', 'Snap', 'Clap', 'Generic Click', 'Keyboard Click', 'vine boom', 'Randomized']);
156156
addOption(option);
157157

158158
var option:Option = new Option('Rating Offset',

0 commit comments

Comments
 (0)