Fix Swiftclaw

This commit is contained in:
Gurge44 committed 2024-01-24 19:30:29 +01:00
1 parent 31217848be
commit 1f7179c929
5 files changed
+11 -13

No files matched your search

+1 -1
View File
@@ -3097,7 +3097,6 @@ public static class Utils
CustomRoles.SecurityGuard => Options.SecurityGuardSkillCooldown.GetInt() + (includeDuration ? Options.SecurityGuardSkillDuration.GetInt() : 0),
CustomRoles.TimeMaster => Options.TimeMasterSkillCooldown.GetInt() + (includeDuration ? Options.TimeMasterSkillDuration.GetInt() : 0),
CustomRoles.Veteran => Options.VeteranSkillCooldown.GetInt() + (includeDuration ? Options.VeteranSkillDuration.GetInt() : 0),
CustomRoles.Swiftclaw => Swiftclaw.DashCD.GetInt() + (includeDuration ? Swiftclaw.DashDuration.GetInt() : 0),
CustomRoles.Perceiver => Perceiver.CD.GetInt(),
CustomRoles.Convener => Convener.CD.GetInt(),
CustomRoles.DovesOfNeace => Options.DovesOfNeaceCooldown.GetInt(),
@@ -3118,6 +3117,7 @@ public static class Utils
CustomRoles.QuickShooter => QuickShooter.ShapeshiftCooldown.GetInt(),
CustomRoles.Disperser => Disperser.DisperserShapeshiftCooldown.GetInt(),
CustomRoles.Twister => Twister.ShapeshiftCooldown.GetInt(),
CustomRoles.Swiftclaw => Swiftclaw.DashCD.GetInt() + (includeDuration ? Swiftclaw.DashDuration.GetInt() : 0),
_ => -1,
};
if (CD == -1) return;
-5
View File
@@ -602,11 +602,6 @@ class IntroCutsceneDestroyPatch
if (map != null) Main.AllAlivePlayerControls.Do(map.RandomTeleport);
}
if (Main.NormalOptions.MapId == 4)
{
Penguin.OnSpawnAirship();
}
if (Main.ResetCamPlayerList.Contains(PlayerControl.LocalPlayer.PlayerId))
{
PlayerControl.LocalPlayer.Data.Role.AffectedByLightAffectors = false;
+1 -3
View File
@@ -7,9 +7,7 @@ public static class OneWayShadowsIsIgnoredPatch
{
public static bool Prefix(OneWayShadows __instance, ref bool __result)
{
var amDesyncImpostor = Main.ResetCamPlayerList.Contains(PlayerControl.LocalPlayer.PlayerId);
if (__instance.IgnoreImpostor && amDesyncImpostor)
if (__instance.IgnoreImpostor && Main.ResetCamPlayerList.Contains(PlayerControl.LocalPlayer.PlayerId))
{
__result = true;
return false;
+2
View File
@@ -2,6 +2,7 @@ using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using TOHE.Roles.Impostor;
using UnityEngine;
namespace TOHE;
@@ -36,6 +37,7 @@ class RandomSpawn
else if (Options.StartingKillCooldown.GetInt() != 10) player.SetKillCooldown(Options.StartingKillCooldown.GetInt());
if (!Options.RandomSpawn.GetBool() && Options.CurrentGameMode != CustomGameMode.SoloKombat) return;
new AirshipSpawnMap().RandomTeleport(player);
Penguin.OnSpawnAirship();
}
}
}
+7 -4
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace TOHE.Roles.Impostor
{
@@ -15,7 +16,7 @@ namespace TOHE.Roles.Impostor
DashCD = FloatOptionItem.Create(Id + 2, "SwiftclawDashCD", new(0f, 180f, 2.5f), 15f, TabGroup.ImpostorRoles, false)
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Swiftclaw])
.SetValueFormat(OptionFormat.Seconds);
DashDuration = FloatOptionItem.Create(Id + 3, "SwiftclawDashDur", new(0f, 60f, 0.5f), 4f, TabGroup.ImpostorRoles, false)
DashDuration = IntegerOptionItem.Create(Id + 3, "SwiftclawDashDur", new(0, 60, 1), 4, TabGroup.ImpostorRoles, false)
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Swiftclaw])
.SetValueFormat(OptionFormat.Seconds);
DashSpeed = FloatOptionItem.Create(Id + 4, "SwiftclawDashSpeed", new(0.05f, 3f, 0.05f), 2f, TabGroup.ImpostorRoles, false)
@@ -33,10 +34,11 @@ namespace TOHE.Roles.Impostor
}
public static void OnFixedUpdate(PlayerControl pc)
{
if (!GameStates.IsInTask || pc == null || !DashStart.TryGetValue(pc.PlayerId, out var dashInfo) || dashInfo.StartTimeStamp + DashDuration.GetFloat() >= Utils.GetTimeStamp() || !pc.Is(CustomRoles.Swiftclaw)) return;
if (!GameStates.IsInTask || pc == null || !DashStart.TryGetValue(pc.PlayerId, out var dashInfo) || dashInfo.StartTimeStamp + DashDuration.GetInt() > Utils.GetTimeStamp()) return;
Main.AllPlayerSpeed[pc.PlayerId] = dashInfo.NormalSpeed;
pc.MarkDirtySettings();
DashStart.Remove(pc.PlayerId);
}
public static void OnReportDeadBody()
{
@@ -44,6 +46,7 @@ namespace TOHE.Roles.Impostor
{
Main.AllPlayerSpeed[item.Key] = item.Value.NormalSpeed;
}
DashStart.Clear();
}
}
}