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

Commit

Permalink
Fix 我吸
Browse files Browse the repository at this point in the history
  • Loading branch information
xifangczy committed Aug 25, 2021
1 parent c5f0c10 commit a4200d6
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 54 deletions.
70 changes: 43 additions & 27 deletions BmMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ public BmMod(IntPtr intPtr) : base(intPtr) { }
public static bool[] AimBotKeyConfig = { true, true, true, true, true, true };
//射速 + 子弹飞行速度 开关
public static bool WeaponSpeedState = false;
public static bool WeaponSpeedWindowState = false;
public static float BulletSpeedNum = 500; //飞行速度
public static float BulletSpeedNum = 1000; //弹速
public static int AttSpeedNum = 500; //射速
public static bool BulletSpeedState = true;
public static bool AttSpeedState = false; //默认关闭射速 大部分武器 射速无法调整
//提高精准度
public static bool AccuracyState = false;
//攻击距离
public static bool AttDistanceState = false;
//起飞
public static bool SuperJumpState = false;
public static readonly string[] SuperJumpStr = { "[关]", "<color=lime>[超级跳]</color>", "<color=lime>[零重力]</color>" };
public static int SuperJumpNum = 0;
public static int SuperJumpOrig = 0;
float OrigGravity = 11.65f;
public static int SuperJumpType = 0;
readonly float OrigGravity = 11.65f;
//超级速度
public static bool SuperRunState = false;
public static int SuperRunOrig = 600;
Expand All @@ -67,8 +67,8 @@ public BmMod(IntPtr intPtr) : base(intPtr) { }
//自瞄设置
public static bool AimBotWindowState = false;
public static float AimBotSightRange = 0.1f; //默认自瞄范围
public static bool AimBotModelMagneticState = true; //磁力自瞄 默认
public static bool AimBotModelForceState = false; //暴力自瞄
public static bool AimBotMagneticState = true; //磁力自瞄 默认
public static bool AimBotForceState = false; //暴力自瞄
public static bool AimBotPlusState = false; //转起来
public static float AimBotForceDistance = 5; // 优先瞄准离自己距离多少以内的敌人
public static bool AimBotShieldState = false; // 干掉盾牌
Expand Down Expand Up @@ -170,16 +170,17 @@ void Update()
//切换起飞模式
if (Input.GetKeyDown(KeyCode.F3))
{
SuperJumpState = !SuperJumpState;
if (SuperJumpState)
SuperJumpType++;
SuperJumpState = true;
if (SuperJumpType == 1)
{
Window.MenuRect = new Rect(Window.MenuRect.x, Window.MenuRect.y, Window.MenuRect.width, Window.MenuRect.height + 20);
SuperJumpNum = SuperJumpOrig == 0 ? 1 : SuperJumpOrig;
Window.MenuRect = new Rect(Window.MenuRect.x, Window.MenuRect.y, Window.MenuRect.width, Window.MenuRect.height + 20);
}
else
else if(SuperJumpType == 3)
{
SuperJumpType = 0;
SuperJumpState = false;
Window.MenuRect = new Rect(Window.MenuRect.x, Window.MenuRect.y, Window.MenuRect.width, Window.MenuRect.height - 20);
SuperJumpNum = 0;
}
}
//超级移速
Expand All @@ -193,7 +194,18 @@ void Update()
//超远变态武器
if (Input.GetKeyDown(KeyCode.F8)) { AttDistanceState = !AttDistanceState; }
//射速 + 子弹飞行速度
if (Input.GetKeyDown(KeyCode.F9)) { WeaponSpeedState = !WeaponSpeedState; }
if (Input.GetKeyDown(KeyCode.F9))
{
WeaponSpeedState = !WeaponSpeedState;
if (WeaponSpeedState)
{
Window.MenuRect = new Rect(Window.MenuRect.x, Window.MenuRect.y, Window.MenuRect.width, Window.MenuRect.height + 110);
}
else
{
Window.MenuRect = new Rect(Window.MenuRect.x, Window.MenuRect.y, Window.MenuRect.width, Window.MenuRect.height - 110);
}
}
//if (Input.GetKeyDown(KeyCode.G))
//{
// GM.GMManager.instance.OpenGMPanel();
Expand All @@ -206,7 +218,7 @@ void Update()
WeaponPerformanceObj CurWeaponObj = HeroCameraManager.HeroObj.BulletPreFormCom.ReturnWeapon(CurWeaponID);
if (Input.GetKeyDown(KeyCode.Keypad0))
{
//MainMod.Log.LogWarning(HeroMoveManager.HMMJS.movement.gravity);
//MainMod.Log.LogWarning();
}

//隐藏显示鼠标
Expand Down Expand Up @@ -234,25 +246,24 @@ void Update()
if (Input.GetKeyDown(KeyCode.Mouse2))
{
/*
* Shape 5504 魂
* (ServerDefine.FightType)16777225 魂
* (ServerDefine.FightType)16777225 && Shape 5504 魂
* NWARRIOR_DROP_CASH 钱
* NWARRIOR_DROP_BULLET 子弹 次技能
* NWARRIOR_DROP_EQUIP 武器
* NWARRIOR_DROP_RELIC 卷轴
* NWARRIOR_NPC_GOLDENCUP 金爵
* NWARRIOR_DROP_TRIGGER 包子
* NWARRIOR_DROP_TRIGGER && Shape 5513 包子
* keyValuePair.Value.DropOPCom.FlyMeToTheMoon(HeroCameraManager.HeroID); 有BUG
* 东西过多 使用 修改AutoPickRange属性 会造成卡顿
*/
foreach (var keyValuePair in NewPlayerManager.PlayerDict)
{
if (keyValuePair.Value.FightType == ServerDefine.FightType.NWARRIOR_DROP_BULLET || keyValuePair.Value.FightType == ServerDefine.FightType.NWARRIOR_DROP_TRIGGER)
if (keyValuePair.Value.FightType == ServerDefine.FightType.NWARRIOR_DROP_BULLET || keyValuePair.Value.Shape == 5513)
{
keyValuePair.Value.DropOPCom.AutoPickRange = 99999f;
continue;
}
if (keyValuePair.Value.FightType == (ServerDefine.FightType)16777225 || keyValuePair.Value.FightType == ServerDefine.FightType.NWARRIOR_DROP_CASH)
if (keyValuePair.Value.Shape == 5504 || keyValuePair.Value.FightType == ServerDefine.FightType.NWARRIOR_DROP_CASH)
{
Vector3 HeroPosition = HeroCameraManager.HeroTran.position;
keyValuePair.Value.gameTrans.position = new Vector3(HeroPosition.x, HeroPosition.y, HeroPosition.z);
Expand Down Expand Up @@ -317,9 +328,14 @@ void Update()
//射速 弹速设置
if (WeaponSpeedState)
{
CurWeaponObj.WeaponAttr.BulletSpeed = BulletSpeedNum;
CurWeaponObj.WeaponAttr.AttSpeed = SetList(AttSpeedNum, 0, 0, 10000);

if (AttSpeedState)
{
CurWeaponObj.WeaponAttr.AttSpeed = SetList(AttSpeedNum, 0, 0, 10000);
}
if (BulletSpeedState)
{
CurWeaponObj.WeaponAttr.BulletSpeed = BulletSpeedNum;
}
}
//无限子弹
if (AmmoState)
Expand All @@ -341,15 +357,15 @@ void Update()
//恢复重力
if (HeroMoveManager.HMMJS.movement.gravity == 0)
{
if (SuperJumpNum != 2)
if (SuperJumpType != 2)
{
HeroMoveManager.HMMJS.movement.gravity = OrigGravity;
}
}
//起飞
if (SuperJumpNum == 1 && Input.GetKey(KeyCode.Space) && !HeroMoveManager.HMMJS.inputJump) { HeroCameraManager.HeroTran.Translate(Vector3.up * 0.3f); }
if (SuperJumpType == 1 && Input.GetKey(KeyCode.Space) && !HeroMoveManager.HMMJS.inputJump) { HeroCameraManager.HeroTran.Translate(Vector3.up * 0.3f); }
//零重力
if (SuperJumpNum == 2)
if (SuperJumpType == 2)
{
HeroMoveManager.HMMJS.movement.gravity = 0;
if (Input.GetKey(KeyCode.Space))
Expand Down Expand Up @@ -580,7 +596,7 @@ void AimBot()
}
if (ResTran != null)
{
if (AimBotModelMagneticState)
if (AimBotMagneticState)
{
//磁吸 代码修改自 https://github.com/shalzuth/AutoGunfireReborn/blob/e4a24e3e08fb6197418acf74084206122714782b/GunfireRebornMods/Mods/Aimbot.cs#L56
Vector3 position = ResTran.position + new Vector3(0, 0.2f);
Expand Down
22 changes: 16 additions & 6 deletions MainMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class MainMod : BasePlugin
public static new ConfigFile Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "BmMod.cfg"), true);
public static ConfigEntry<int> SuperRunSet = Config.Bind("config", "SuperRunSet", BmMod.SuperRunSet);
public static ConfigEntry<float> AimBotSightRange = Config.Bind("config", "AimBotSightRange", BmMod.AimBotSightRange);
public static ConfigEntry<bool> AimBotModelMagneticState = Config.Bind("config", "AimBotModelMagneticState", BmMod.AimBotModelMagneticState);
public static ConfigEntry<bool> AimBotModelForceState = Config.Bind("config", "AimBotModelForceState", BmMod.AimBotModelForceState);
public static ConfigEntry<bool> AimBotMagneticState = Config.Bind("config", "AimBotMagneticState", BmMod.AimBotMagneticState);
public static ConfigEntry<bool> AimBotForceState = Config.Bind("config", "AimBotForceState", BmMod.AimBotForceState);
public static ConfigEntry<string> AimBotKeyConfig = Config.Bind("config", "AimBotKeyConfig", BoolArray2String(BmMod.AimBotKeyConfig));
public static ConfigEntry<float> BulletSpeedNum = Config.Bind("config", "BulletSpeedNum", BmMod.BulletSpeedNum);
public static ConfigEntry<int> AttSpeedNum = Config.Bind("config", "AttSpeedNum", BmMod.AttSpeedNum);
Expand All @@ -31,8 +31,8 @@ public override void Load()
//配置内容传递给BmMod
BmMod.SuperRunSet = SuperRunSet.Value;
BmMod.AimBotSightRange = AimBotSightRange.Value;
BmMod.AimBotModelMagneticState = AimBotModelMagneticState.Value;
BmMod.AimBotModelForceState = AimBotModelForceState.Value;
BmMod.AimBotMagneticState = AimBotMagneticState.Value;
BmMod.AimBotForceState = AimBotForceState.Value;
BmMod.AimBotKeyConfig = String2BoolArray(AimBotKeyConfig.Value);
BmMod.BulletSpeedNum = BulletSpeedNum.Value;
BmMod.AttSpeedNum = AttSpeedNum.Value;
Expand All @@ -47,8 +47,8 @@ public static void SaveConfig()
{
SuperRunSet.Value = BmMod.SuperRunSet;
AimBotSightRange.Value = BmMod.AimBotSightRange;
AimBotModelMagneticState.Value = BmMod.AimBotModelMagneticState;
AimBotModelForceState.Value = BmMod.AimBotModelForceState;
AimBotMagneticState.Value = BmMod.AimBotMagneticState;
AimBotForceState.Value = BmMod.AimBotForceState;
AimBotKeyConfig.Value = BoolArray2String(BmMod.AimBotKeyConfig);
BulletSpeedNum.Value = BmMod.BulletSpeedNum;
AttSpeedNum.Value = BmMod.AttSpeedNum;
Expand Down Expand Up @@ -153,4 +153,14 @@ class FuckDuoyi4
{
static bool Prefix() { return false; }
}

//测试
//[HarmonyPatch(typeof(NewPlayerObject), "xxx")]
//class test
//{
// static bool Prefix()
// {
// return true;
// }
//}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ https://builds.bepis.io/projects/bepinex_be
下载本项目DLL文件到 BepInEx\plugins 目录内

本项目实验性质,为了学习Unity 和 C#
因为辅助造成的问题,概不负责。
因辅助造成的问题,概不负责。
39 changes: 19 additions & 20 deletions Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void MenuWindow(int windowID)
AmmoState = GUILayout.Toggle(AmmoState, AmmoState ? "[F1] 无限子弹 <color=lime>[开]</color>" : "[F1] 无限子弹 [关]", null);

GUILayout.BeginHorizontal(null);
if (GUILayout.Toggle(AimBotState, "[F2] 自瞄" + AimBotKeyStr[AimBotKeyNum], null) != AimBotState)
if (GUILayout.Toggle(AimBotState, "[F2] 自瞄 " + AimBotKeyStr[AimBotKeyNum], null) != AimBotState)
{
AimBotState = !AimBotState;
if (AimBotState)
Expand Down Expand Up @@ -61,29 +61,28 @@ public static void MenuWindow(int windowID)
GUILayout.EndHorizontal();
}

if (GUILayout.Toggle(SuperJumpState, "[F3] 起飞 " + SuperJumpStr[SuperJumpNum], null) != SuperJumpState)
if (GUILayout.Toggle(SuperJumpState, "[F3] 起飞 " + SuperJumpStr[SuperJumpType], null) != SuperJumpState)
{
SuperJumpState = !SuperJumpState;
if (SuperJumpState)
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height + 20);
SuperJumpNum = SuperJumpOrig == 0 ? 1 : SuperJumpOrig;
SuperJumpType = 1;
}
else
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height - 20);
SuperJumpNum = 0;
SuperJumpType = 0;
}
}
GUILayout.BeginHorizontal(null);
if (SuperJumpState)
{
for (int i = 1; i < SuperJumpStr.Length; i++)
{
if (GUILayout.Toggle(SuperJumpNum == i, SuperJumpStr[i], null))
if (GUILayout.Toggle(SuperJumpType == i, SuperJumpStr[i], null))
{
SuperJumpNum = i;
SuperJumpOrig = i;
SuperJumpType = i;
}
}
}
Expand Down Expand Up @@ -119,11 +118,10 @@ public static void MenuWindow(int windowID)
AccuracyState = GUILayout.Toggle(AccuracyState, AccuracyState ? "[F7] 提高精度 <color=lime>[开]</color>" : "[F7] 提高精度 [关]", null);
AttDistanceState = GUILayout.Toggle(AttDistanceState, AttDistanceState ? "[F8] 超远攻击 <color=lime>[开]</color>" : "[F8] 超远攻击 [关]", null);
GUILayout.BeginHorizontal(null);
WeaponSpeedState = GUILayout.Toggle(WeaponSpeedState, WeaponSpeedState ? "[F9] 提高射速 <color=lime>[开]</color>" : "[F9] 提高射速 [关]", null);
if (GUILayout.Button("设置", null))
if(GUILayout.Toggle(WeaponSpeedState, WeaponSpeedState ? "[F9] 提高射速 <color=lime>[开]</color>" : "[F9] 提高射速 [关]", null) != WeaponSpeedState)
{
WeaponSpeedWindowState = !WeaponSpeedWindowState;
if (WeaponSpeedWindowState)
WeaponSpeedState = !WeaponSpeedState;
if (WeaponSpeedState)
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height + 110);
}
Expand All @@ -133,11 +131,12 @@ public static void MenuWindow(int windowID)
}
}
GUILayout.EndHorizontal();
if (WeaponSpeedWindowState)

if (WeaponSpeedState)
{
GUILayout.Label("射速 " + AttSpeedNum, null);
AttSpeedState = GUILayout.Toggle(AttSpeedState, "开关 射速:" + AttSpeedNum, null);
AttSpeedNum = (int)GUILayout.HorizontalSlider(AttSpeedNum, 100f, 5000f, null);
GUILayout.Label("子弹飞行速度 " + BulletSpeedNum, null);
BulletSpeedState = GUILayout.Toggle(BulletSpeedState, "开关 弹速:" + BulletSpeedNum, null);
BulletSpeedNum = GUILayout.HorizontalSlider(BulletSpeedNum, 100f, 5000f, null);
if (GUILayout.Button("保存参数", null)) { MainMod.SaveConfig(); }
}
Expand Down Expand Up @@ -223,15 +222,15 @@ public static void AimBotWindow(int windowID)
GUILayout.EndHorizontal();

GUILayout.Space(5);
if (GUILayout.Toggle(AimBotModelMagneticState, "磁吸自瞄(微自瞄)", null))
if (GUILayout.Toggle(AimBotMagneticState, "磁吸自瞄(微自瞄)", null))
{
AimBotModelMagneticState = true;
AimBotModelForceState = false;
AimBotMagneticState = true;
AimBotForceState = false;
}
if (GUILayout.Toggle(AimBotModelForceState, "暴力自瞄", null))
if (GUILayout.Toggle(AimBotForceState, "暴力自瞄", null))
{
AimBotModelForceState = true;
AimBotModelMagneticState = false;
AimBotForceState = true;
AimBotMagneticState = false;
}
GUILayout.Space(5);
GUILayout.Label("自瞄范围 " + AimBotSightRange, null);
Expand Down

0 comments on commit a4200d6

Please sign in to comment.