mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
bloodmoon stuff
This commit is contained in:
1 parent
0c1c5f3fa2
commit
bb7f9e13d9
3 files changed
+8
-6
No files matched your search
@@ -139,6 +139,7 @@ internal class TimeMaster : RoleBase
|
||||
long now = Utils.TimeStamp;
|
||||
int length = TimeMasterRewindTimeLength.GetInt();
|
||||
|
||||
Dictionary<byte, float> originalSpeeds = Main.AllPlayerSpeed.ToDictionary(x => x.Key, x => x.Value);
|
||||
Main.AllPlayerSpeed.SetAllValues(Main.MinSpeed);
|
||||
ReportDeadBodyPatch.CanReport.SetAllValues(false);
|
||||
|
||||
@@ -195,7 +196,7 @@ internal class TimeMaster : RoleBase
|
||||
}
|
||||
}
|
||||
|
||||
Main.AllPlayerSpeed.SetAllValues(Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod));
|
||||
Main.AllPlayerSpeed = originalSpeeds;
|
||||
ReportDeadBodyPatch.CanReport.SetAllValues(true);
|
||||
Utils.MarkEveryoneDirtySettings();
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ internal class Bloodmoon : IGhostRole
|
||||
foreach (KeyValuePair<byte, long> death in ScheduledDeaths)
|
||||
{
|
||||
PlayerControl player = Utils.GetPlayerById(death.Key);
|
||||
if (player == null || !player.IsAlive()) continue;
|
||||
if (!player || !player.IsAlive()) continue;
|
||||
|
||||
if (now - death.Value < Duration.GetInt())
|
||||
{
|
||||
@@ -82,7 +82,7 @@ internal class Bloodmoon : IGhostRole
|
||||
if (pc.RpcCheckAndMurder(player, true)) player.Suicide(PlayerState.DeathReason.LossOfBlood, pc);
|
||||
}
|
||||
|
||||
FastVector2.GetPlayersInRange(pc.Pos(), 4f).DoIf(x => !x.Is(Team.Impostor), x => x.Notify(string.Format(Translator.GetString("BloodmoonNearYou"), CustomRoles.Bloodmoon.ToColoredString()), sendOption: SendOption.None));
|
||||
FastVector2.GetPlayersInRange(pc.Pos(), 4f, x => !x.Is(Team.Impostor)).Do(x => x.Notify(string.Format(Translator.GetString("BloodmoonNearYou"), CustomRoles.Bloodmoon.ToColoredString()), sendOption: SendOption.None));
|
||||
}
|
||||
|
||||
public static void OnMeetingStart()
|
||||
@@ -92,9 +92,9 @@ internal class Bloodmoon : IGhostRole
|
||||
foreach (byte id in ScheduledDeaths.Keys)
|
||||
{
|
||||
PlayerControl pc = Utils.GetPlayerById(id);
|
||||
if (pc == null || !pc.IsAlive()) continue;
|
||||
if (!pc || !pc.IsAlive()) continue;
|
||||
|
||||
pc.Suicide();
|
||||
pc.Suicide(PlayerState.DeathReason.LossOfBlood);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ public class Stasis : RoleBase
|
||||
UsingAbility = true;
|
||||
|
||||
ReportDeadBodyPatch.CanReport.SetAllValues(false);
|
||||
Dictionary<byte, float> originalSpeeds = Main.AllPlayerSpeed.ToDictionary(x => x.Key, x => x.Value);
|
||||
Main.AllPlayerSpeed.SetAllValues(Main.MinSpeed);
|
||||
Main.PlayerStates.Values.DoIf(x => !x.IsDead, x => x.IsBlackOut = true);
|
||||
|
||||
@@ -149,7 +150,7 @@ public class Stasis : RoleBase
|
||||
catch (Exception e) { Utils.ThrowException(e); }
|
||||
|
||||
ReportDeadBodyPatch.CanReport.SetAllValues(true);
|
||||
Main.AllPlayerSpeed.SetAllValues(Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod));
|
||||
Main.AllPlayerSpeed = originalSpeeds;
|
||||
Main.PlayerStates.Values.Do(x => x.IsBlackOut = false);
|
||||
Utils.MarkEveryoneDirtySettings();
|
||||
|
||||
|
||||
Reference in new issue
Block a user