1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
private void Update()
{
if (Input.GetKeyDown(KeyCode.F8))
{
PublicLogger.LogInfo($"Patch Invincible");
InvincibleFlag = !InvincibleFlag;
}
else if (Input.GetKeyDown(KeyCode.F9))
{
PublicLogger.LogInfo($"Patch AdjustmentFlag");
AdjustmentFlag = !AdjustmentFlag;
if(AdjustmentFlag)
{
PatchAdjustmentAngle = 360;
}
else
{
PatchAdjustmentAngle = OriginalAdjustmentAngle;
}
}
else if (Input.GetKeyDown(KeyCode.F7))
{
PublicLogger.LogInfo($"Patch AutoAttack");
AutoAttackFlag = !AutoAttackFlag;
}
}

# 无敌

1
2
3
4
5
6
7
8
9
[HarmonyPatch(typeof(Player), "Invincible", MethodType.Getter)] 
[HarmonyPostfix]
public static void PatchInvincible(object[] __args, ref bool __result)
{
if (InvincibleFlag)
{
__result = true;
}
}

# 自瞄

手柄生效

1
2
3
4
5
6
7
8
9
10
11
12
13
[HarmonyPatch(typeof(PlayerShoot), "CalcShootAngleAndDir")]
[HarmonyPrefix]
public static void PatchAimAssist(PlayerShoot __instance)
{
if (OriginalAdjustmentAngle == -65535)
{
OriginalAdjustmentAngle = __instance.ShootDataSetting.AdjustRange;
PublicLogger.LogInfo($"Get OriginalAdjustmentAngle: {OriginalAdjustmentAngle}");
PatchAdjustmentAngle = OriginalAdjustmentAngle;
}
__instance.ShootDataSetting.AdjustRange = PatchAdjustmentAngle;
__instance.ShootDataSetting.AdjustRangeMouse = PatchAdjustmentAngle;
}

# 自动射击

手柄生效

1
2
3
4
5
6
7
8
9
[HarmonyPatch(typeof(InputMgr), "PlayerIsShoot1", MethodType.Getter)] 
[HarmonyPostfix]
public static void PatchAutoAttack(object[] __args, ref bool __result)
{
if (AutoAttackFlag)
{
__result = true;
}
}
更新于 阅读次数