Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
Update BepInEx
Browse files Browse the repository at this point in the history
  • Loading branch information
xifangczy committed Sep 29, 2021
1 parent 898f55d commit 14ba865
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
26 changes: 16 additions & 10 deletions BmMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public BmMod(IntPtr intPtr) : base(intPtr) { }
public static int AttSpeedNum = 500; //射速
public static bool BulletSpeedState = true;
public static bool AttSpeedState = false; //默认关闭射速 大部分武器 射速无法调整
//快速换弹
public static bool QuickReloadBulletState = false;
//提高精准度
public static bool AccuracyState = false;
//攻击距离
Expand Down Expand Up @@ -138,6 +140,7 @@ void OnGUI()
}
}
}
public static SkillBolt.SkillCollectData final;
void Update()
{
//菜单 开关
Expand Down Expand Up @@ -191,7 +194,7 @@ void Update()
if (Input.GetKeyDown(KeyCode.F6)) { NoBulletConsumeState = !NoBulletConsumeState; }
//提高精准度
if (Input.GetKeyDown(KeyCode.F7)) { AccuracyState = !AccuracyState; }
//超远变态武器
//近战距离
if (Input.GetKeyDown(KeyCode.F8)) { AttDistanceState = !AttDistanceState; }
//射速 + 子弹飞行速度
if (Input.GetKeyDown(KeyCode.F9))
Expand All @@ -206,6 +209,8 @@ void Update()
Window.MenuRect = new Rect(Window.MenuRect.x, Window.MenuRect.y, Window.MenuRect.width, Window.MenuRect.height - 110);
}
}
//快速换弹
if (Input.GetKeyDown(KeyCode.F11)) { QuickReloadBulletState = !QuickReloadBulletState; }
//if (Input.GetKeyDown(KeyCode.G))
//{
// GM.GMManager.instance.OpenGMPanel();
Expand All @@ -231,10 +236,10 @@ void Update()
}
else
{
var CursorObj = new WarTeamerInfoManager();
CursorObj.OpenTeamerInfo();
//奇怪的实现方式 但有用
WarTeamerInfoManager.Instance.OpenTeamerInfo();
new WarTeamerInfoPanel().ShowCursor();
CursorObj.CloseTeamerInfo();
WarTeamerInfoManager.Instance.CloseTeamerInfo();
}
}
//地图提示
Expand Down Expand Up @@ -342,12 +347,15 @@ void Update()
{
CurWeaponObj.ReloadBulletImmediately();
CurWeaponObj.ModifyBulletInMagzine(100, 100);
}
//快速换弹
if (QuickReloadBulletState)
{
CurWeaponObj.WeaponAttr.FillTime = 1;

}
//提高精准度
if (AccuracyState) { CurWeaponObj.WeaponAttr.Accuracy = SetList(100, 100, 100); }
//超远变态武器
//近战距离
if (AttDistanceState)
{
CurWeaponObj.WeaponAttr.AttDis = 9999f;
Expand Down Expand Up @@ -570,10 +578,7 @@ void AimBot()
Ray ray = new Ray(HeroPos, vector);
var hits = Physics.RaycastAll(ray, Distance);
//开启了破坏护盾功能并存在护盾 执行ZoomShield
if (AimBotShieldState && hits.Any(hit => hit.collider.gameObject.tag == "Monster_Shield"))
{
ZoomShield();
}
if (AimBotShieldState && hits.Any(hit => hit.collider.gameObject.tag == "Monster_Shield")) { ZoomShield(); }
//查询是否存在阻挡
bool query = hits.Any(hit => hit.collider.gameObject.layer == 0 || hit.collider.gameObject.layer == 30 || hit.collider.gameObject.layer == 31 || hit.collider.gameObject.tag == "Monster_Shield");
if (query) { continue; }
Expand Down Expand Up @@ -646,6 +651,7 @@ void AimBotPlus()
float Distance = vector.magnitude;
Ray ray = new Ray(position, vector);
var hits = Physics.RaycastAll(ray, Distance);
if (hits.Any(hit => hit.collider.gameObject.tag == "Monster_Shield")) { ZoomShield(); }
bool query = hits.Any(hit => hit.collider.gameObject.layer == 0 || hit.collider.gameObject.layer == 30 || hit.collider.gameObject.layer == 31 || hit.collider.gameObject.tag == "Monster_Shield");
if (!query && Distance < SightRange)
{
Expand Down
14 changes: 7 additions & 7 deletions MainMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using UnhollowerRuntimeLib;
using UnityEngine;
using Item;

namespace BmMod
{
Expand Down Expand Up @@ -78,7 +79,7 @@ public static bool[] String2BoolArray(string arg)
}

//注入脚本
[HarmonyPatch(typeof(MainManager), "Awake")]
[HarmonyPatch(typeof(MainManager), "Start")]
class Inject
{
static void Prefix()
Expand All @@ -89,17 +90,17 @@ static void Prefix()
}
}
//不耗子弹
[HarmonyPatch(typeof(Item.WeaponPerformanceObj), "WeaponConsumeBullet")]
[HarmonyPatch(typeof(WeaponPerformanceObj), "WeaponConsumeBullet")]
class WeaponConsumeBullet
{
static bool Prefix() { return !BmMod.NoBulletConsumeState; }
}
[HarmonyPatch(typeof(Item.WeaponPerformanceObj), "ConsumeBulletFromMag")]
[HarmonyPatch(typeof(WeaponPerformanceObj), "ConsumeBulletFromMag")]
class ConsumeBulletFromMag
{
static bool Prefix() { return !BmMod.NoBulletConsumeState; }
}
[HarmonyPatch(typeof(Item.WeaponPerformanceObj), "ConsumeBulletFromPack")]
[HarmonyPatch(typeof(WeaponPerformanceObj), "ConsumeBulletFromPack")]
class ConsumeBulletFromPack
{
static bool Prefix() { return !BmMod.NoBulletConsumeState; }
Expand Down Expand Up @@ -153,10 +154,9 @@ class FuckDuoyi4
{
static bool Prefix() { return false; }
}

//测试
//[HarmonyPatch(typeof(NewPlayerObject), "xxx")]
//class test
//[HarmonyPatch(typeof(), "")]
//class Test
//{
// static bool Prefix()
// {
Expand Down
12 changes: 6 additions & 6 deletions Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Window : BmMod
{
public Window(IntPtr intPtr) : base(intPtr) { }

public static Rect MenuRect = new Rect(Screen.width - 250, 150, 200, 340); // 主菜单
public static Rect MenuRect = new Rect(Screen.width - 250, 150, 200, 360); // 主菜单
public static Rect TipsRect = new Rect(Screen.width - 250, 550, 200, 350); // 提示窗口
public static Rect AimBotRect = new Rect(Screen.width - 460, 40, 200, 340); // 自瞄设置
public static Rect TestRect = new Rect(Screen.width - 460, 400, 200, 220); // 实验室窗口
Expand Down Expand Up @@ -116,7 +116,7 @@ public static void MenuWindow(int windowID)
NoRecoilState = GUILayout.Toggle(NoRecoilState, NoRecoilState ? "[F5] 无后坐力 <color=lime>[开]</color>" : "[F5] 无后坐力 [关]", null);
NoBulletConsumeState = GUILayout.Toggle(NoBulletConsumeState, NoBulletConsumeState ? "[F6] 不耗子弹 <color=lime>[开]</color>" : "[F6] 不耗子弹 [关]", null);
AccuracyState = GUILayout.Toggle(AccuracyState, AccuracyState ? "[F7] 提高精度 <color=lime>[开]</color>" : "[F7] 提高精度 [关]", null);
AttDistanceState = GUILayout.Toggle(AttDistanceState, AttDistanceState ? "[F8] 超远攻击 <color=lime>[开]</color>" : "[F8] 超远攻击 [关]", null);
AttDistanceState = GUILayout.Toggle(AttDistanceState, AttDistanceState ? "[F8] 近战距离 <color=lime>[开]</color>" : "[F8] 近战距离 [关]", null);
GUILayout.BeginHorizontal(null);
if(GUILayout.Toggle(WeaponSpeedState, WeaponSpeedState ? "[F9] 提高射速 <color=lime>[开]</color>" : "[F9] 提高射速 [关]", null) != WeaponSpeedState)
{
Expand All @@ -131,19 +131,19 @@ public static void MenuWindow(int windowID)
}
}
GUILayout.EndHorizontal();

if (WeaponSpeedState)
{
AttSpeedState = GUILayout.Toggle(AttSpeedState, "开关 射速:" + AttSpeedNum, null);
AttSpeedState = GUILayout.Toggle(AttSpeedState, "射速(部分武器可用):" + AttSpeedNum, null);
AttSpeedNum = (int)GUILayout.HorizontalSlider(AttSpeedNum, 100f, 5000f, null);
BulletSpeedState = GUILayout.Toggle(BulletSpeedState, "开关 弹速:" + BulletSpeedNum, null);
BulletSpeedState = GUILayout.Toggle(BulletSpeedState, "弹速:" + BulletSpeedNum, null);
BulletSpeedNum = GUILayout.HorizontalSlider(BulletSpeedNum, 100f, 5000f, null);
if (GUILayout.Button("保存参数", null)) { MainMod.SaveConfig(); }
}
QuickReloadBulletState = GUILayout.Toggle(QuickReloadBulletState, QuickReloadBulletState ? "[F11] 快速换弹 <color=lime>[开]</color>" : "[F11] 快速换弹 [关]", null);

GUILayout.Label("[中键] 我吸!", null);
GUILayout.Label("[C/X] 地图信息", null);
GUILayout.Space(10);
GUILayout.Space(5);
GUILayout.BeginHorizontal(null);
if (GUILayout.Button("关闭窗口", null)) { MenuState = false; }
if (GUILayout.Button("实验室", null)) { TestWindowState = !TestWindowState; }
Expand Down

0 comments on commit 14ba865

Please sign in to comment.