mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
kill count excludes self kill
This commit is contained in:
1 parent
c2bef8f212
commit
53cb868ffb
4 files changed
+5
-5
No files matched your search
@@ -410,9 +410,9 @@ public class PlayerState(byte playerId)
|
||||
return IsDead && RealKiller.TimeStamp != DateTime.MinValue ? RealKiller.ID : byte.MaxValue;
|
||||
}
|
||||
|
||||
public int GetKillCount(bool excludeSelfKill = false)
|
||||
public int GetKillCount()
|
||||
{
|
||||
return Main.PlayerStates.Values.Count(state => !(excludeSelfKill && state.PlayerId == PlayerId) && state.GetRealKiller() == PlayerId);
|
||||
return Main.PlayerStates.Values.Count(state => state.PlayerId != PlayerId && state.GetRealKiller() == PlayerId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ClockBlocker : RoleBase
|
||||
|
||||
private int GetAddedTime()
|
||||
{
|
||||
return !Main.PlayerStates.TryGetValue(ClockBlockerId, out PlayerState state) || (state.IsDead && !CountAddedTimeAfterDeath.GetBool()) ? 0 : EmergencyCooldownIncreasePerKill.GetInt() * state.GetKillCount(true);
|
||||
return !Main.PlayerStates.TryGetValue(ClockBlockerId, out PlayerState state) || (state.IsDead && !CountAddedTimeAfterDeath.GetBool()) ? 0 : EmergencyCooldownIncreasePerKill.GetInt() * state.GetKillCount();
|
||||
}
|
||||
|
||||
public static int GetTotalTime(int originalTime)
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Mercenary : RoleBase
|
||||
|
||||
private static bool HasKilled(PlayerControl pc)
|
||||
{
|
||||
return pc != null && pc.Is(CustomRoles.Mercenary) && pc.IsAlive() && (Main.PlayerStates[pc.PlayerId].GetKillCount(true) > 0 || !WaitFor1Kill.GetBool());
|
||||
return pc != null && pc.Is(CustomRoles.Mercenary) && pc.IsAlive() && (Main.PlayerStates[pc.PlayerId].GetKillCount() > 0 || !WaitFor1Kill.GetBool());
|
||||
}
|
||||
|
||||
public override bool OnCheckMurder(PlayerControl killer, PlayerControl target)
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TimeThief : RoleBase
|
||||
private static int StolenTime(byte id)
|
||||
{
|
||||
return PlayerIdList.Contains(id) && (Utils.GetPlayerById(id).IsAlive() || !ReturnStolenTimeUponDeath.GetBool())
|
||||
? DecreaseMeetingTime.GetInt() * Main.PlayerStates[id].GetKillCount(true)
|
||||
? DecreaseMeetingTime.GetInt() * Main.PlayerStates[id].GetKillCount()
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user