internal override void OnEventPlayerDeath(EventManager.BaseEventPlayer victim, EventManager.BaseEventPlayer attacker = null, HitInfo info = null) { if (victim == null) { return; } victim.OnPlayerDeath(attacker, Configuration.RespawnTime); if (attacker != null && victim != attacker && victim.Team != attacker.Team) { int score; if (attacker.Team == EventManager.Team.B) { score = teamBScore += 1; } else { score = teamAScore += 1; } attacker.OnKilledPlayer(info); if (Config.ScoreLimit > 0 && score >= Config.ScoreLimit) { winningTeam = attacker.Team; InvokeHandler.Invoke(this, EndEvent, 0.1f); return; } } UpdateScoreboard(); base.OnEventPlayerDeath(victim, attacker); }
internal override void OnEventPlayerDeath(EventManager.BaseEventPlayer victim, EventManager.BaseEventPlayer attacker = null, HitInfo info = null) { if (victim == null) { return; } if ((victim as CaptureTheFlagPlayer).IsCarryingFlag) { FlagController flagController = victim.Team == EventManager.Team.B ? TeamAFlag : TeamBFlag; if (flagController.FlagHolder == victim) { flagController.DropFlag(true); BroadcastToPlayers(GetMessage, "Notification.FlagDropped", victim.Player.displayName, flagController.Team, GetTeamColor(victim.Team), GetTeamColor(flagController.Team)); } } victim.OnPlayerDeath(attacker, Configuration.RespawnTime); if (attacker != null && victim != attacker && victim.Team != attacker.Team) { attacker.OnKilledPlayer(info); } UpdateScoreboard(); base.OnEventPlayerDeath(victim, attacker); }
internal override void OnEventPlayerDeath(EventManager.BaseEventPlayer victim, EventManager.BaseEventPlayer attacker = null, HitInfo info = null) { if (victim == null) { return; } attacker?.OnKilledPlayer(info); if (victim == slasherPlayer || GetAlivePlayerCount() <= 1) { victim.AddPlayerDeath(); if (victim == slasherPlayer) { BroadcastToPlayers(GetMessage, "Notification.HuntedWin"); } else { BroadcastToPlayers(GetMessage, "Notification.SlasherWin"); } EndRound(); return; } victim.OnPlayerDeath(attacker, 0f); UpdateScoreboard(); base.OnEventPlayerDeath(victim, attacker); }
internal override void OnEventPlayerDeath(EventManager.BaseEventPlayer victim, EventManager.BaseEventPlayer attacker = null, HitInfo info = null) { if (victim == null) { return; } victim.OnPlayerDeath(attacker, Configuration.RespawnTime); if (attacker != null && victim != attacker) { attacker.OnKilledPlayer(info); if (GetAlivePlayerCount() <= 1) { winner = attacker; InvokeHandler.Invoke(this, EndEvent, 0.1f); return; } } UpdateScoreboard(); base.OnEventPlayerDeath(victim, attacker); }
internal override void OnEventPlayerDeath(EventManager.BaseEventPlayer victim, EventManager.BaseEventPlayer attacker = null, HitInfo hitInfo = null) { if (victim == null) { return; } victim.OnPlayerDeath(attacker, Configuration.RespawnTime); if (attacker != null && victim != attacker) { if (Configuration.ResetHealthOnKill) { attacker.Player.health = attacker.Player.MaxHealth(); attacker.Player.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); } attacker.OnKilledPlayer(hitInfo); string attackersWeapon = GetWeaponShortname(hitInfo); if (!string.IsNullOrEmpty(attackersWeapon)) { if (KilledByRankedWeapon(attacker as GunGamePlayer, attackersWeapon)) { (attacker as GunGamePlayer).Rank += 1; if ((attacker as GunGamePlayer).Rank > weaponSet.Count) { winner = attacker; InvokeHandler.Invoke(this, EndEvent, 0.1f); return; } else { (attacker as GunGamePlayer).RemoveRankWeapon(); (attacker as GunGamePlayer).GiveRankWeapon(weaponSet.CreateItem((attacker as GunGamePlayer).Rank)); } } else if (KilledByDowngradeWeapon(attackersWeapon)) { (victim as GunGamePlayer).Rank = Mathf.Clamp((victim as GunGamePlayer).Rank - 1, 1, weaponSet.Count); } } } UpdateScoreboard(); base.OnEventPlayerDeath(victim, attacker); }
internal override void OnEventPlayerDeath(EventManager.BaseEventPlayer victim, EventManager.BaseEventPlayer attacker = null, HitInfo info = null) { if (victim == null) { return; } (victim as ChopperSurvivalPlayer).LivesRemaining -= 1; if (GetPlayersRemainingCount() == 0) { victim.AddPlayerDeath(null); InvokeHandler.Invoke(this, EndEvent, 0.1f); return; } victim.OnPlayerDeath(attacker, Configuration.RespawnTime); base.OnEventPlayerDeath(victim, attacker); }