This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2406dec
commit 8f86400
Showing
29 changed files
with
685 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
NovasFuckery/HarmonyPatches/BeatmapObjectSpawnControllerCallback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using BS_Utils.Utilities; | ||
using Harmony; | ||
using NovasFuckery.Util; | ||
|
||
namespace NovasFuckery.HarmonyPatches | ||
{ | ||
[HarmonyPatch(typeof(BeatmapObjectSpawnController))] | ||
[HarmonyPatch("BeatmapObjectSpawnCallback", MethodType.Normal)] | ||
class BeatmapObjectSpawnControllerCallback | ||
{ | ||
static void Prefix (ref BeatmapObjectData beatmapObjectData) { | ||
if (beatmapObjectData.beatmapObjectType == BeatmapObjectType.Note) { | ||
var noteData = (NoteData) beatmapObjectData; | ||
|
||
if (FuckeryUI.RandomEverything.Enabled) { | ||
var layer = (NoteLineLayer) UnityEngine.Random.Range(0, 3); | ||
noteData.SetProperty("noteLineLayer", layer); | ||
noteData.SetProperty("startNoteLineLayer", layer); | ||
|
||
noteData.SetProperty("lineIndex", UnityEngine.Random.Range(0, 4)); | ||
|
||
switch (UnityEngine.Random.Range(0, 3)) { | ||
case 0: | ||
break; | ||
case 1: | ||
noteData.SwitchNoteType(); | ||
break; | ||
case 2: | ||
noteData.SetProperty("noteType", NoteType.Bomb); | ||
break; | ||
} | ||
return; | ||
} | ||
|
||
if (FuckeryUI.RandomPositionY.Enabled) { | ||
var layer = (NoteLineLayer) UnityEngine.Random.Range(0, 3); | ||
noteData.SetProperty("noteLineLayer", layer); | ||
noteData.SetProperty("startNoteLineLayer", layer); | ||
} | ||
|
||
if (FuckeryUI.RandomPositionX.Enabled) { | ||
noteData.SetProperty("lineIndex", UnityEngine.Random.Range(0, 4)); | ||
} | ||
|
||
if (FuckeryUI.RandomDirection.Enabled && noteData.noteType.IsBasicNote()) { | ||
noteData.SetProperty("cutDirection", (NoteCutDirection) UnityEngine.Random.Range(1, 7)); | ||
} | ||
|
||
if(FuckeryUI.RandomColors.Enabled && FuckeryUI.RandomBombs.Enabled) { | ||
switch(UnityEngine.Random.Range(0, 3)) { | ||
case 0: | ||
break; | ||
case 1: | ||
noteData.SwitchNoteType(); | ||
break; | ||
case 2: | ||
noteData.SetProperty("noteType", NoteType.Bomb); | ||
break; | ||
} | ||
} else if (FuckeryUI.RandomColors.Enabled) { | ||
if(UnityEngine.Random.Range(0, 2) == 1) { | ||
noteData.SwitchNoteType(); | ||
} | ||
} else if (FuckeryUI.RandomBombs.Enabled) { | ||
if (UnityEngine.Random.Range(0, 2) == 1) { | ||
noteData.SetProperty("noteType", NoteType.Bomb); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
7 changes: 1 addition & 6 deletions
7
NovasFuckery/HarmonyPatches/BeatmapObjectSpawnControllerInit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.