1
0
mirror of https://github.com/HarukaKinen/Sinmai-Internal-Damage.git synced 2024-11-12 01:30:47 +01:00

Ready to release

This commit is contained in:
Moe Kotoki 2022-02-21 20:12:44 +08:00
parent 47249779ca
commit 215410bdd4
7 changed files with 337 additions and 35 deletions

View File

@ -0,0 +1,171 @@
using System;
using Manager;
using Sinmai.Helper;
using UnityEngine;
using Random = System.Random;
namespace Sinmai.Functions
{
public class AutoPlay
{
// 实例化
private static Random rand = new Random();
// 把 NextDouble 转成 Float
public static float ToFloat(double value)
{
return (float)value;
}
// 幸运大乐透
private static float CalcCent()
{
return rand.Next(0, 100) + ToFloat(rand.NextDouble());
}
// 另一个幸运大乐透
private static int RandChoiceJudge()
{
return rand.Next(0, 4);
}
// Opposite 按顺序随机概率
public static void Opposite()
{
float cent = CalcCent();
/*Render.DrawString(new Vector2(200, 260), GameManager.AutoPlay.ToString(), false);
Render.DrawString(new Vector2(200, 280), Settings.CriticalValue.ToString(), false);
Render.DrawString(new Vector2(200, 290), Settings.PerfectValue.ToString(), false);
Render.DrawString(new Vector2(200, 300), Settings.GreatValue.ToString(), false);
Render.DrawString(new Vector2(200, 310), Settings.GoodValue.ToString(), false);
Render.DrawString(new Vector2(200, 320), Settings.MissValue.ToString(), false);
Render.DrawString(new Vector2(200, 340), cent.ToString(), false);*/
if (!Settings.LegitAutoPlayCheckBox)
return;
if (Settings.LegitMethodInt == 0)
{
if (Settings.CriticalValue != 0.0f && cent <= Settings.CriticalValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Critical;
}
else
{
if (Settings.PerfectValue != 0.0f && cent <= Settings.PerfectValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Perfect;
}
else
{
if (Settings.GreatValue != 0.0f && cent <= Settings.GreatValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Great;
}
else
{
if (Settings.GoodValue != 0.0f && cent <= Settings.GoodValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Good;
}
else
{
if (Settings.MissValue != 0.0f && cent <= Settings.MissValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.None;
}
else
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Perfect;
}
}
}
}
}
}
}
// Random Cycle 随机迴圈
public static void RandomCycle()
{
float cent = CalcCent();
int judge = RandChoiceJudge();
if (!Settings.LegitAutoPlayCheckBox)
return;
if (Settings.LegitMethodInt == 1)
{
switch (judge)
{
case 0:
if (Settings.CriticalValue != 0.0f && cent <= Settings.CriticalValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Critical;
}
break;
case 1:
if (Settings.PerfectValue != 0.0f && cent <= Settings.PerfectValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Perfect;
}
break;
case 2:
if (Settings.GreatValue != 0.0f && cent <= Settings.GreatValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Great;
}
break;
case 3:
if (Settings.GoodValue != 0.0f && cent <= Settings.GoodValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.Good;
}
break;
case 4:
if (Settings.MissValue != 0.0f && cent <= Settings.MissValue)
{
GameManager.AutoPlay = GameManager.AutoPlayMode.None;
}
break;
default:
GameManager.AutoPlay = GameManager.AutoPlayMode.Perfect;
break;
}
}
}
// 无概率强制随机
public static void Force()
{
if (!Settings.LegitAutoPlayCheckBox)
return;
if (Settings.LegitMethodInt == 2)
{
switch (RandChoiceJudge())
{
case 0:
if (Settings.CriticalToggle)
GameManager.AutoPlay = GameManager.AutoPlayMode.Critical;
break;
case 1:
if (Settings.PerfectToggle)
GameManager.AutoPlay = GameManager.AutoPlayMode.Perfect;
break;
case 2:
if (Settings.GreatToggle)
GameManager.AutoPlay = GameManager.AutoPlayMode.Great;
break;
case 3:
if (Settings.GoodToggle)
GameManager.AutoPlay = GameManager.AutoPlayMode.Good;
break;
case 4:
if (Settings.MissToggle)
GameManager.AutoPlay = GameManager.AutoPlayMode.None;
break;
}
}
}
}
}

View File

@ -1,4 +1,5 @@
using System.Globalization;
using System;
using System.Globalization;
using System.Reflection;
using Manager;
using Sinmai.Helper;
@ -8,12 +9,11 @@ namespace Sinmai.Functions
{
public class Skins
{
private static readonly BindingFlags BindFlags = BindingFlags.NonPublic | BindingFlags.Instance;
private static readonly BindingFlags pBindFlags = BindingFlags.NonPublic;
private static readonly BindingFlags iBindFlags = BindingFlags.Instance;
private static readonly BindingFlags sBindFlags = BindingFlags.Static;
private const BindingFlags pBindFlags = BindingFlags.NonPublic;
private const BindingFlags iBindFlags = BindingFlags.Instance;
private const BindingFlags sBindFlags = BindingFlags.Static;
public static void GetTimer()
/*public static void GetTimer()
{
if (!Settings.CheckBox) return;
Render.DrawString(new Vector2(200, 210), "CheckBox Checked", false);
@ -26,12 +26,12 @@ namespace Sinmai.Functions
if (lCommonTimer != null)
{
var commonTimerType = typeof(TimerController);
var countDownSecond = commonTimerType.GetField("_countDownSecond", BindFlags);
var countDownSecond = commonTimerType.GetField("_countDownSecond", pBindFlags | iBindFlags);
Render.DrawString(new Vector2(200, 240), countDownSecond.GetValue(commonTimerType).ToString(),
false);
/*// 获取左屏幕的GenericProcess
/#1#/ GenericProcess
var lGenericProcess = GameObject.Find("LeftMonitor/GenericProcess(Clone)").GetComponent<GenericProcess>();
// 定义GenericProcess的type
Type genericProcessType = typeof(GenericProcess);
@ -45,8 +45,11 @@ namespace Sinmai.Functions
FieldInfo leftMonitorTimerControllerFi = leftMonitorTimerControllerType.GetField("_countDownSecond", BindFlags);
// 修改 TimerController array 的值
leftMonitorTimerControllerFi.SetValue(timerController, 99U);
_timerController.SetValue(lGenericProcess, timerController);*/
// 操你妈 没几把用
_timerController.SetValue(lGenericProcess, timerController);#1#
}
else
{
@ -57,8 +60,8 @@ namespace Sinmai.Functions
if(Timer)
Render.DrawString(new Vector2(200, 210), Timer.ToString(), false);
else
Render.DrawString(new Vector2(200, 210), "null object", false);*/
}
Render.DrawString(new Vector2(200, 210), "null object", false);#1#
}*/
public static void PlayerOneOnly()
{
@ -88,18 +91,29 @@ namespace Sinmai.Functions
public static void UdemaeChanger()
{
if (!Settings.UdemaeCheckBox) return;
UserInformationController lUserInformationController = GameObject
.Find("LeftMonitor/CommonProcess(Clone)/RearCanvas/Sub/UI_UserInformation/UI_UserData/")
.GetComponent<UserInformationController>();
UserInformationController rUserInformationController = GameObject
.Find("RightMonitor/CommonProcess(Clone)/RearCanvas/Sub/UI_UserInformation/UI_UserData/")
.GetComponent<UserInformationController>();
int udemaeId = int.Parse(Settings.UdemaeValue);
var udemae = (UdemaeID) udemaeId;
if (lUserInformationController != null)
{
lUserInformationController.SetUdemae(udemae);
}
}
public static void ModifyVersionNum()
{
if (!Settings.FrameCheckBox)
return;
// CommonTimer (Unity.GameObject)
var UiFrame =
GameObject.Find(
"LeftMonitor/CommonProcess(Clone)/RearCanvas/Sub/UI_UserInformation/UI_UserData/UI_User/IMG_Frame/");
Render.DrawString(new Vector2(200, 220), UiFrame.ToString(), false);
}
}
}

View File

@ -27,5 +27,11 @@ namespace Sinmai.Functions
// Render.DrawString(new Vector2(200, 270), freedomTime.GetValue(null).ToString(), false);
}
public static void InfinityPrepareTime()
{
if (!Settings.InfinityFreedomTimeCheckBox)
return;
}
}
}

View File

@ -0,0 +1,20 @@
using System.Reflection;
using UnityEngine;
namespace Sinmai.Functions
{
public class Track
{
private const BindingFlags pBindFlags = BindingFlags.NonPublic;
private const BindingFlags iBindFlags = BindingFlags.Instance;
private const BindingFlags sBindFlags = BindingFlags.Static;
public static void ForceTrackSkip()
{
// LeftMonitor/GameProcess(Clone)/GameGtrl(Clone)/Notes/TrackSkipLayer/UI_GAM_TrackSkip(Clone)/
// Monitor.TrackSkip
}
}
}

View File

@ -258,9 +258,11 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Functions\AutoPlay.cs" />
<Compile Include="Functions\Sounds.cs" />
<Compile Include="Functions\Timer.cs" />
<Compile Include="Functions\Skins.cs" />
<Compile Include="Functions\Track.cs" />
<Compile Include="Loader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\Menu.cs" />

View File

@ -1,4 +1,5 @@
using Sinmai.Functions;
using PartyLink;
using Sinmai.Functions;
using Sinmai.Helper;
using UnityEngine;
@ -12,7 +13,7 @@ namespace Sinmai.UI
private void Start()
{
Window = new Rect(20f, 60f, 250f, 350f);
Window = new Rect(20f, 60f, 600f, 400f);
}
private void Update()
@ -26,16 +27,20 @@ namespace Sinmai.UI
// Draw ur epic hek here
if (MenuToggle)
Window = GUILayout.Window(0, Window, RenderMenu, "Internal Damage for Sinmai");
Render.DrawCross(new Vector2(Screen.width / 2, Screen.height / 2), new Vector2(20, 20), 1f,
new Color(0, 255, 0));
Render.DrawString(new Vector2(200, 200), "Sinmai-Internal-Damage");
Render.DrawString(new Vector2(200, 185), "Sinmai-Internal-Damage");
Render.DrawString(new Vector2(200, 200), "Build: b20220121-G");
// Call Functions in Functions
// what the fuck is this named
Skins.ModifyVersionNum();
Skins.RateChanger();
Skins.UdemaeChanger();
Timer.InfinityFreedomTime();
Timer.InfinityPrepareTime();
Skins.RateChanger();
AutoPlay.Opposite();
AutoPlay.RandomCycle();
AutoPlay.Force();
}
private void RenderMenu(int id)
@ -44,27 +49,81 @@ namespace Sinmai.UI
{
// Menu
case 0:
// Legit Autoplay
GUILayout.BeginHorizontal("Main");
GUILayout.BeginVertical("Legit");
// Legit
GUILayout.Label("Legit");
Settings.LegitAutoPlayCheckBox = GUILayout.Toggle(Settings.LegitAutoPlayCheckBox, "Legit AutoPlay");
if (Settings.LegitAutoPlayCheckBox)
{
Settings.LegitMethodInt =
GUILayout.SelectionGrid(Settings.LegitMethodInt, Settings.LegitMethod, 1);
switch (Settings.LegitMethodInt)
{
case 0:
case 1:
GUILayout.Label("Critical Value");
Settings.CriticalValue = GUILayout.HorizontalScrollbar(Settings.CriticalValue, 1.0f, 0.0f, 100.0f);
GUILayout.Label("Perfect Value");
Settings.PerfectValue = GUILayout.HorizontalScrollbar(Settings.PerfectValue, 1.0f, 0.0f, 100.0f);
GUILayout.Label("Great Value");
Settings.GreatValue = GUILayout.HorizontalScrollbar(Settings.GreatValue, 1.0f, 0.0f, 100.0f);
GUILayout.Label("Good Value");
Settings.GoodValue = GUILayout.HorizontalScrollbar(Settings.GoodValue, 1.0f, 0.0f, 100.0f);
GUILayout.Label("Miss Value");
Settings.MissValue = GUILayout.HorizontalScrollbar(Settings.MissValue, 1.0f, 0.0f, 100.0f);
break;
case 2:
Settings.CriticalToggle = GUILayout.Toggle(Settings.CriticalToggle, "Critical");
Settings.PerfectToggle = GUILayout.Toggle(Settings.PerfectToggle, "Perfect");
Settings.GreatToggle = GUILayout.Toggle(Settings.GreatToggle, "Great");
Settings.GoodToggle = GUILayout.Toggle(Settings.GoodToggle, "Good");
Settings.MissToggle = GUILayout.Toggle(Settings.MissToggle, "Miss");
break;
default:
break;
}
}
// Rage Autoplay
{
}
GUILayout.EndVertical();
// Rage
// Some cool part idk
GUILayout.BeginVertical("Skins");
// Skin Changer
GUILayout.Label("Skin Changer");
Settings.RateCheckBox = GUILayout.Toggle(Settings.RateCheckBox, "でらっくす Rating");
if (Settings.RateCheckBox)
Settings.RatingValue = GUILayout.TextArea(Settings.RatingValue, 5);
Settings.UdemaeCheckBox = GUILayout.Toggle(Settings.UdemaeCheckBox, "段位認定");
if (Settings.UdemaeCheckBox)
Settings.UdemaeValue = GUILayout.TextArea(Settings.UdemaeValue, 2);
Settings.PlateCheckBox = GUILayout.Toggle(Settings.PlateCheckBox, "Plate");
Settings.FrameCheckBox = GUILayout.Toggle(Settings.FrameCheckBox, "Frame");
Settings.TitleCheckBox = GUILayout.Toggle(Settings.TitleCheckBox, "Title");
Settings.DXPassCheckBox= GUILayout.Toggle(Settings.DXPassCheckBox, "DX Pass");
GUILayout.EndVertical();
GUILayout.BeginVertical("Misc");
// Misc
GUILayout.Label("Misc");
Settings.InfinityFreedomTimeCheckBox = GUILayout.Toggle(Settings.InfinityFreedomTimeCheckBox, "Infinity FreedomTime");
Settings.InfinityPrepareTimeCheckBox = GUILayout.Toggle(Settings.InfinityPrepareTimeCheckBox, "Infinity PrepareTime");
if (GUILayout.Button("Force Track Skip"))
;
if (GUILayout.Button("Unload"))
Loader.Unload();
// Test things
GUILayout.Label("Test Area");
Settings.FrameCheckBox = GUILayout.Toggle(Settings.FrameCheckBox, "Get Frame");
// cute break
GUILayout.EndVertical();
GUILayout.EndHorizontal();
// A cute break
break;
}

View File

@ -2,10 +2,40 @@
{
class Settings
{
public static bool CheckBox = false;
public static bool FrameCheckBox = false;
public static bool InfinityFreedomTimeCheckBox = false;
// Legit Autoplay
public static bool LegitAutoPlayCheckBox = false;
public static int LegitMethodInt = 0;
public static string[] LegitMethod = {"Opposite", "Random Cycle", "Force Random"};
public static float CriticalValue = 100.0f;
public static float PerfectValue = 0.0f;
public static float GreatValue = 0.0f;
public static float GoodValue = 0.0f;
public static float MissValue = 0.0f;
public static bool CriticalToggle = true;
public static bool PerfectToggle = false;
public static bool GreatToggle = false;
public static bool GoodToggle = false;
public static bool MissToggle = false;
// Rage Autoplay
// Some cool part idk
// Skin Changer
public static bool RateCheckBox = false;
public static string RatingValue = "13370";
public static bool UdemaeCheckBox = false;
public static string UdemaeValue = "24";
public static bool PlateCheckBox = false;
public static bool FrameCheckBox = false;
public static bool TitleCheckBox = false;
public static bool DXPassCheckBox = false;
// Misc
public static bool InfinityFreedomTimeCheckBox = false;
public static bool InfinityPrepareTimeCheckBox = false;
}
}