mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
fixes
This commit is contained in:
1 parent
733f4ee68f
commit
5bcb616a92
3 files changed
+25
-11
No files matched your search
+16
-2
@@ -68,7 +68,7 @@ internal static class SoloPVP
|
||||
.SetColor(new Color32(245, 82, 82, byte.MaxValue))
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
|
||||
SoloPVP_ResurrectionWaitingTime = new IntegerOptionItem(66_233_006, "SoloPVP_ResurrectionWaitingTime", new(3, 990, 1), 15, TabGroup.GameSettings)
|
||||
SoloPVP_ResurrectionWaitingTime = new IntegerOptionItem(66_233_006, "SoloPVP_ResurrectionWaitingTime", new(0, 1000, 1), 15, TabGroup.GameSettings)
|
||||
.SetGameMode(CustomGameMode.SoloPVP)
|
||||
.SetColor(new Color32(245, 82, 82, byte.MaxValue))
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
@@ -253,7 +253,19 @@ internal static class SoloPVP
|
||||
|
||||
private static IEnumerator OnPlayerDead(PlayerControl target)
|
||||
{
|
||||
BackCountdown.TryAdd(target.PlayerId, SoloPVP_ResurrectionWaitingTime.GetInt());
|
||||
int waitingTime = SoloPVP_ResurrectionWaitingTime.GetInt();
|
||||
|
||||
if (waitingTime <= 1)
|
||||
{
|
||||
PlayerHP[target.PlayerId] = PlayerHPMax[target.PlayerId];
|
||||
LastHurt[target.PlayerId] = Utils.TimeStamp;
|
||||
RPC.PlaySoundRPC(target.PlayerId, Sounds.SpawnSound);
|
||||
SpawnMap.GetSpawnMap().RandomTeleport(target);
|
||||
Utils.NotifyRoles(SpecifyTarget: target, SendOption: SendOption.None);
|
||||
yield break;
|
||||
}
|
||||
|
||||
BackCountdown.TryAdd(target.PlayerId, waitingTime);
|
||||
if (target.inVent || target.MyPhysics.Animations.IsPlayingEnterVentAnimation()) LateTask.New(() => target.MyPhysics.RpcExitVent(target.GetClosestVent().Id), 0.6f, log: false);
|
||||
while (target.inVent || target.inMovingPlat || target.onLadder || target.MyPhysics.Animations.IsPlayingAnyLadderAnimation() || target.MyPhysics.Animations.IsPlayingEnterVentAnimation()) yield return null;
|
||||
if (BackCountdown.ContainsKey(target.PlayerId)) target.ExileTemporarily();
|
||||
@@ -351,6 +363,8 @@ internal static class SoloPVP
|
||||
// resume the timer
|
||||
RoundTimer.Start();
|
||||
}
|
||||
|
||||
if (!RoundTimer.IsRunning) return;
|
||||
|
||||
Utils.NotifyRoles(SendOption: SendOption.None);
|
||||
}
|
||||
|
||||
+1
-1
@@ -4638,7 +4638,7 @@ public static class Utils
|
||||
// The value of AmongUsClient.Instance.Ping is in milliseconds (ms), so ÷1000 to convert to seconds
|
||||
float divice = Options.CurrentGameMode switch
|
||||
{
|
||||
CustomGameMode.SoloPVP => 3000f,
|
||||
CustomGameMode.SoloPVP => 2000f,
|
||||
CustomGameMode.BedWars => 1500f,
|
||||
CustomGameMode.CaptureTheFlag => 1500f,
|
||||
CustomGameMode.KingOfTheZones => 1500f,
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Penguin : RoleBase
|
||||
{
|
||||
foreach (KeyValuePair<byte, PlayerState> state in Main.PlayerStates)
|
||||
{
|
||||
if (state.Value.Role is Penguin { IsEnable: true, VictimCanUseAbilities: false } pg && pg.AbductVictim != null && pg.AbductVictim.PlayerId == pc.PlayerId)
|
||||
if (state.Value.Role is Penguin { IsEnable: true, VictimCanUseAbilities: false } pg && pg.AbductVictim && pg.AbductVictim.PlayerId == pc.PlayerId)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class Penguin : RoleBase
|
||||
|
||||
public override bool CanUseImpostorVentButton(PlayerControl pc)
|
||||
{
|
||||
return AbductVictim == null && !IsGoose;
|
||||
return !AbductVictim && !IsGoose;
|
||||
}
|
||||
|
||||
public override bool CanUseKillButton(PlayerControl pc)
|
||||
@@ -229,7 +229,7 @@ public class Penguin : RoleBase
|
||||
|
||||
bool doKill = !IsGoose;
|
||||
|
||||
if (AbductVictim != null)
|
||||
if (AbductVictim)
|
||||
{
|
||||
if (target.PlayerId != AbductVictim.PlayerId)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ public class Penguin : RoleBase
|
||||
|
||||
public override void SetButtonTexts(HudManager hud, byte id)
|
||||
{
|
||||
hud.KillButton?.OverrideText(AbductVictim != null && !IsGoose ? GetString("KillButtonText") : GetString("PenguinKillButtonText"));
|
||||
hud.KillButton?.OverrideText(AbductVictim && !IsGoose ? GetString("KillButtonText") : GetString("PenguinKillButtonText"));
|
||||
}
|
||||
|
||||
public override void OnReportDeadBody()
|
||||
@@ -271,7 +271,7 @@ public class Penguin : RoleBase
|
||||
stopCount = true;
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
if (AbductVictim == null) return;
|
||||
if (!AbductVictim) return;
|
||||
|
||||
if (!IsGoose && MeetingKill && AbductVictim.IsAlive())
|
||||
Penguin_.Kill(AbductVictim);
|
||||
@@ -300,7 +300,7 @@ public class Penguin : RoleBase
|
||||
{
|
||||
if (!IsEnable) return;
|
||||
|
||||
if (AbductVictim != null) Penguin_.MarkDirtySettings();
|
||||
if (AbductVictim) Penguin_.MarkDirtySettings();
|
||||
|
||||
stopCount = false;
|
||||
}
|
||||
@@ -326,9 +326,9 @@ public class Penguin : RoleBase
|
||||
}
|
||||
}
|
||||
|
||||
if (AbductVictim != null)
|
||||
if (AbductVictim)
|
||||
{
|
||||
if (!Penguin_.IsAlive() || !AbductVictim.IsAlive())
|
||||
if (!Penguin_.IsAlive() || Pelican.IsEaten(PenguinId) || !AbductVictim.IsAlive())
|
||||
{
|
||||
RemoveVictim();
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user