public void OnPlayerDie(PlayerDeathEvent ev) { if (ev.Killer.TeamRole.Team == Smod2.API.Team.SCP) { SCPKills++; } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (!RoundSummary.RoundInProgress() || ev.Player.Teamclass().role == RoleType.Spectator) { return; } if (ev.Attacker == null) { DiscordLab.bot.NewMessage($"World killed {ev.Player.name} using {ev.DamageType.name}"); } else if (ev.Attacker.userId == ev.Player.userId) { DiscordLab.bot.NewMessage($"{ev.Player.name} committed suicide with {ev.DamageType.name}"); } else if (ev.Attacker.Teamclass().cleanTeam == ev.Player.Teamclass().cleanTeam) { DiscordLab.bot.NewMessage($"**Teamkill** \n```autohotkey\nPlayer: {ev.Attacker.Teamclass().role} {ev.Attacker.ToString()}" + $"\nKilled: {ev.Player.Teamclass().role} {ev.Player.ToString()}\nUsing: {ev.DamageType.name}```"); } else if (ev.Player.Disarmed() > 0 && !ev.Attacker.gameObject.GetComponent <CharacterClassManager>().IsAnyScp()) { DiscordLab.bot.NewMessage($"__Disarmed Kill__\n```autohotkey\nPlayer: {ev.Attacker.Teamclass().role} {ev.Attacker.ToString()}" + $"\nKilled: {ev.Player.Teamclass().role} {ev.Player.ToString()}\nUsing: {ev.DamageType.name}```"); } else { DiscordLab.bot.NewMessage($"{ev.Attacker.Teamclass().role} {ev.Attacker.name} killed {ev.Player.Teamclass().role} {ev.Player.name} with {ev.DamageType.name}"); } }
public void OnPlayerDie(PlayerDeathEvent ev) { this.Debug($"Someone die"); if (ev.Killer.PlayerId == ev.Player.PlayerId || !canLog) { return; } if ((ev.Killer.TeamRole.Team.Equals(Team.MTF) && ev.Player.TeamRole.Team.Equals(Team.RSC)) || (ev.Killer.TeamRole.Team.Equals(Team.RSC) && ev.Player.TeamRole.Team.Equals(Team.MTF)) || (ev.Killer.TeamRole.Team.Equals(Team.CHI) && ev.Player.TeamRole.Team.Equals(Team.CDP)) || (ev.Killer.TeamRole.Team.Equals(Team.CHI) && ev.Player.TeamRole.Team.Equals(Team.CHI))) { int index = RegisterKiller(ev.Killer); this.Debug($"Logging kill"); bot.Post($"{ev.Killer.Name} killed {ev.Player.Name} using {Enum.GetName(typeof(DamageType), ev.DamageTypeVar)}", $"{ev.Killer.TeamRole.Name} killed {ev.Player.TeamRole.Name}", ev.Killer.UserId + ev.Killer.IpAddress + "\tKills: " + GetKills[index].kills, 0); } else if (ev.Killer.TeamRole.Team == ev.Player.TeamRole.Team) { int index = RegisterKiller(ev.Killer); this.Debug($"Logging kill"); bot.Post($"{ev.Killer.Name} killed {ev.Player.Name} using {Enum.GetName(typeof(DamageType), ev.DamageTypeVar)}", $"{ev.Killer.TeamRole.Name} killed {ev.Player.TeamRole.Name}", ev.Killer.UserId + ev.Killer.IpAddress + "\tKills: " + GetKills[index].kills, 0); } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (!RoundSummary.RoundInProgress() || ev.Player.roleType == RoleType.Spectator) { return; } if (ev.Attacker == null || ev.Attacker.isEmpty) { DiscordLab.bot.NewMessage($"WORLD killed {ev.Player.nameClean} using {ev.DamageType.name}"); } else if (ev.Attacker.userId == ev.Player.userId) { DiscordLab.bot.NewMessage($"{ev.Player.nameClean} committed suicide with {ev.DamageType.name}"); } else if (IsTeamDamage(ev.Player.team, ev.Attacker.team)) { DiscordLab.bot.NewMessage($"**Teamkill** \n```autohotkey\nPlayer: {ev.Attacker.roleType} {ev.Attacker}" + $"\nKilled: {ev.Player.roleType} {ev.Player}\nUsing: {ev.DamageType.name}```"); } else if (ev.Player.disarmed > -1 && !ev.Attacker.refHub.characterClassManager.IsAnyScp()) { DiscordLab.bot.NewMessage($"__Disarmed Kill__\n```autohotkey\nPlayer: {ev.Attacker.roleType} {ev.Attacker}" + $"\nKilled: {ev.Player.roleType} {ev.Player}\nUsing: {ev.DamageType.name}```"); } else if (ev.DamageType == DamageTypes.Flying) { DiscordLab.bot.NewMessage($"ANTICHEAT killed {ev.Attacker.nameClean} with code {ev.HitInfo.Attacker}"); } else { DiscordLab.bot.NewMessage($"{ev.Attacker.roleType} {ev.Attacker.nameClean} killed {ev.Player.roleType} {ev.Player.nameClean} with {ev.DamageType.name}"); } }
// Start is called before the first frame update void Start() { // adds player death event playerDeathEvent = new PlayerDeathEvent(); // gets panels for minipulation healthPanelRect = healthPanel.GetComponent <RectTransform>(); imaginationPanelRect = imaginationPanel.GetComponent <RectTransform>(); // asistant healthScalingValue = healthPanelRect.sizeDelta.x; playerHealth = healthPanelRect.sizeDelta.x; imaginationScalingValue = imaginationPanelRect.sizeDelta.x; imagination = imaginationPanelRect.sizeDelta.x; // safely sets scaling vector healthScalingVector = new Vector2(healthScalingValue, 1); healthpositionVector = new Vector3(healthPanelRect.localPosition.x, healthPanelRect.localPosition.y, healthPanelRect.localPosition.z); imaginationScalingVector = new Vector2(imaginationScalingValue, 1); imaginationpositionVector = new Vector3(imaginationPanelRect.localPosition.x, imaginationPanelRect.localPosition.y, imaginationPanelRect.localPosition.z); // handles event manager needs EventManager.AddHealthChangedListeners(CheckHealthChange); EventManager.AddPlayerDeathInvokers(gameObject); }
internal void PlayerDeath(ref PlayerDeathEvent ev) { if (plugin.curMod.HasFlag(ModType.NONE) && plugin.enabledTypes.Contains(ModType.NONE)) { return; // cuz none means none } if (plugin.curMod.HasFlag(ModType.EXPLODEONDEATH) && plugin.enabledTypes.Contains(ModType.EXPLODEONDEATH)) { if (ev.Killer == null || (ev.Killer != null && ev.Killer.GetTeam() != Team.SCP && ev.Killer.GetTeam() != Team.TUT)) { GrenadeManager gm = ev.Player.GetComponent <GrenadeManager>(); GrenadeSettings set = gm.availableGrenades.FirstOrDefault(g => g.inventoryID == ItemType.GrenadeFrag); if (set == null) { } else { Grenade comp = UnityEngine.Object.Instantiate(set.grenadeInstance).GetComponent <Grenade>(); comp.fuseDuration = 0.1f; comp.InitData(gm, Vector3.zero, Vector3.zero, 10f); // commented for stable release //deathGrenades.Add(comp); NetworkServer.Spawn(comp.gameObject); } } } if (plugin.curMod.HasFlag(ModType.CLASSINFECT) && plugin.enabledTypes.Contains(ModType.CLASSINFECT)) { if (ev.Killer != null && ev.Killer != ev.Player && !plugin.noInfectRoles.Contains(ev.Killer.characterClassManager.CurClass)) { Timing.RunCoroutine(InfectLate(ev.Player, ev.Killer.characterClassManager.CurClass, ev.Killer.transform.position)); } } }
public void OnPlayerDie(PlayerDeathEvent ev) { // 判断有木有SCP-181 if (GlobalVar.scp181 == null) { return; } // 判断玩家是不是SCP-181 不是则退出本次事件 if (ev.Player.Name.Equals(GlobalVar.scp181.Name) == false) { return; } if (ev.Player.PlayerId != GlobalVar.scp181.PlayerId) { return; } // 如果debug模式开启了 if (Plugin.GetConfigBool("scp181_debug") == true) { Plugin.Info("======================SCP-181 OnDie [Debug]======================"); Plugin.Info("SCP-181: " + ev.Player.Name + "(" + ev.Player.PlayerId + ")"); Plugin.Info("Escape: " + GlobalVar.scp181_escape); Plugin.Info("Team: " + ev.Player.TeamRole.Name); } // 没有SCP-181了 GlobalVar.scp181 = null; }
public void OnPlayerDie(PlayerDeathEvent ev) { if ((ev.Killer.TeamRole.Role == Role.SCP_106) && (ev.Killer.SteamId != ev.Player.SteamId)) { if (posiciones == 4) { posiciones = 0; } if (posiciones == 0) { spawns = PluginManager.Manager.Server.Map.GetSpawnPoints(Role.SCP_106).First(); } if (posiciones == 1) { spawns = PluginManager.Manager.Server.Map.GetSpawnPoints(Role.SCP_096).First(); } if (posiciones == 2) { spawns = PluginManager.Manager.Server.Map.GetSpawnPoints(Role.SCP_939_89).First(); } if (posiciones == 3) { spawns = PluginManager.Manager.Server.Map.GetSpawnPoints(Role.SCP_049).First(); } posiciones = posiciones + 1; Timing.Run(Respawn(ev.Player, spawns)); } }
internal void Death(ref PlayerDeathEvent ev) { for (int i = 0; i < ev.Player.ammoBox.types.Length; i++) { ev.Player.ammoBox.SetOneAmount(i, PluginMain.ammo[ev.Player].ammo[i].ToString()); } }
// elimina cuerpos pero no objetos public void OnPlayerDie(PlayerDeathEvent ev) { if (ev.DamageTypeVar == DamageType.POCKET) { ev.SpawnRagdoll = false; } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (plugin.infAutoRespawn && ev.Player.Name != "Server") { Timing.RunCoroutine(autoRespawn(ev.Player)); } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (Plugin.isEnabled) { MEC.Timing.RunCoroutine(CheckReveal(ev.Player)); } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (GamemodeManager.GamemodeManager.GetCurrentMode().Equals(plugin) && !plugin.pluginManager.Server.Map.WarheadDetonated) { if (ev.Player.TeamRole.Role == Role.SCP_049) { if (ev.Killer != null && !ev.Killer.Name.Equals(ev.Player.Name)) { ev.Killer.ChangeRole(Role.SCP_049); } else { foreach (Player newplayer in plugin.pluginManager.Server.GetPlayers()) { if (newplayer.Equals(ev.Player)) { continue; } if (newplayer.TeamRole.Role != Role.SCP_049_2) { continue; } newplayer.ChangeRole(Role.SCP_049); break; } } plugin.pluginManager.Server.Map.Shake(); } } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (ev.Player.PlayerId == this.scp079id) { this.scp079id = -1; } }
public void OnDeath(PlayerDeathEvent playerDeathEvent) { InventoryOnDeath(); endGamePanel.gameObject.SetActive(true); CmdDestroy(gameObject); Destroy(gameObject); }
internal void InvokePlayerDeathEvent(Player victim, Player killer, PlayerStats.HitInfo info) { var ev = new PlayerDeathEventArgs { HitInfo = info, Killer = killer, Victim = victim }; PlayerDeathEvent?.Invoke(ev); }
// hacen daño adicional = a la vida que les falta/2 y al matar NTF obtienen botiquines public void OnPlayerDie(PlayerDeathEvent ev) { // Chaos - [Carroñero] // if ((ev.Killer.TeamRole.Role == Role.CHAOS_INSURGENCY) && (ev.Player.TeamRole.Team == Smod2.API.Team.NINETAILFOX)) { ev.Killer.GiveItem(ItemType.MEDKIT); } }
public void OnPlayerDie(PlayerDeathEvent ev) { /// <summary> /// This is called before the player is about to die. Be sure to check if player is SCP106 (classID 3) and if so, set spawnRagdoll to false. /// In case the killer can't be passed, attacker will be null, so check for that before doing something. /// </summary> plugin.SendMessageAsync(plugin.GetConfigString("discord_channel_onplayerdie"), ev.Player.Name + " (" + ev.Player.SteamId + plugin.MultiLanguage(26) + ev.Killer.Name + " (" + ev.Killer.SteamId + ")."); }
public void OnPlayerDie(PlayerDeathEvent ev) { //Pasiva del comandante [Justicia] mata al asesino del comandante si es un ntf. if ((ev.Player.TeamRole.Role == Role.NTF_COMMANDER) && (ev.Killer.TeamRole.Team == Smod2.API.Team.NINETAILFOX) && (ev.Killer.TeamRole.Role != Role.FACILITY_GUARD)) { ev.Killer.Kill(DamageType.LURE); } }
public void OnPlayerDie(PlayerDeathEvent ev) { if (scp035.Contains(ev.Player.SteamId)) { scp035.Remove(ev.Player.SteamId); plugin.pluginManager.Server.Map.AnnounceScpKill("035", ev.Killer); } }
public void OnPlayerDie(PlayerDeathEvent ev) { if ((ev.Killer.TeamRole.Role == Role.SCP_049_2) && (ev.Killer.SteamId != ev.Player.SteamId)) { ev.SpawnRagdoll = false; Timing.Run(Zi(ev.Player)); } }
public void OnPlayerDie(PlayerDeathEvent ev) { //If player dies, removes them from infected list if (SCP939.playersToDamage.Contains(ev.Player.SteamId)) { SCP939.playersToDamage.Remove(ev.Player.SteamId); } }
public void OnPlayerDie(PlayerDeathEvent ev) { Jugadoresh[ev.Player.SteamId] = 0; if (ev.Player.TeamRole.Role == Role.SCIENTIST) { Timing.Run(Respawn(ev.Player)); } if ((ev.Player.TeamRole.Role == Role.CLASSD) && (contadorpos == 0)) { Timing.Run(Respawn(ev.Player)); contadorpos = 1; } if ((ev.Player.TeamRole.Role == Role.CLASSD) && (contadorpos == 1)) { Timing.Run(RespawnD1(ev.Player)); contadorpos = 2; } if ((ev.Player.TeamRole.Role == Role.CLASSD) && (contadorpos == 2)) { Timing.Run(RespawnD2(ev.Player)); contadorpos = 0; } if ((ev.Killer.SteamId != ev.Player.SteamId) && (ev.Killer.TeamRole.Role != ev.Player.TeamRole.Role)) { Jugadores[ev.Killer.SteamId] = Jugadores[ev.Killer.SteamId] + 1; Jugadoresh[ev.Killer.SteamId] = Jugadoresh[ev.Killer.SteamId] + 1; } ev.Player.SendConsoleMessage("Has muerto, tu asesino fue: " + ev.Killer.Name, "green"); if ((ev.Player.TeamRole.Role == Role.SCIENTIST) && ((ev.Killer.TeamRole.Role == Role.SPECTATOR) || (ev.Killer.TeamRole.Team == Team.CLASSD)) && (ev.Killer.SteamId != ev.Player.SteamId)) { ev.Killer.GiveItem(ItemType.FRAG_GRENADE); Dboys = Dboys + 1; } if ((ev.Player.TeamRole.Role == Role.CLASSD) && ((ev.Killer.TeamRole.Team == Team.SCIENTIST) || (ev.Killer.TeamRole.Role == Role.SPECTATOR)) && (ev.Killer.SteamId != ev.Player.SteamId)) { ev.Killer.GiveItem(ItemType.FRAG_GRENADE); Scientists = Scientists + 1; } if (Jugadoresh[ev.Killer.SteamId] >= 1) { ev.Killer.AddHealth(50); } if (Jugadoresh[ev.Killer.SteamId] == 2) { ev.Killer.GiveItem(ItemType.COIN); PluginManager.Manager.Server.Map.Broadcast(2, ev.Killer.Name + " esta en racha de 2", true); } if (Jugadoresh[ev.Killer.SteamId] == 7) { ev.Killer.GiveItem(ItemType.CUP); PluginManager.Manager.Server.Map.Broadcast(2, "CUIDADO, " + ev.Killer.Name + " esta en racha de 7", true); } }
//////////////////////////////////////////////////////////////// public void OnPlayerDeathEvent(PlayerDeathEvent e) { if (m_IsResetting) { return; } Reset(); }
//da cambiare e da fare con raycast per evitare collisioni laterali ma per ora va bene anche cosi' private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Deadly" && !invincible) { //crea l'evento PlayerDeathEvent nel punto corrispondente al contatto e avvialo PlayerDeathEvent playerDeathEvent = collision.transform.root.GetComponent <Obstacle>().CreatePlayerDeathEvent(this, collision.GetContact(0).point); playerDeathEvent.StartDeath(); } }
/// <summary> /// In case 343 dies this will remove him from the list. /// </summary> public void OnPlayerDie(PlayerDeathEvent ev) { if (Is343(ev.Player)) { SCP_343Manager _343Manager = Get343Manager(ev.Player); _343Manager.Is343 = false; ev.Player.SetRank(_343Manager.PreviousBadgeColor, _343Manager.PreviousBadgeColor); } }
public void OnPlayerDie(PlayerDeathEvent e) { Player player = e.Player; if (SCP457.SteamIDIsSCP457(player.SteamId)) { this.plugin.RemoveSCP457(player.SteamId); } }
public static PlayerDeathEvent read(BinaryReader binaryReader) { PlayerDeathEvent newObj = new PlayerDeathEvent(); newObj.DeathMessageText = PStringChar.read(binaryReader); newObj.VictimId = binaryReader.ReadUInt32(); newObj.KillerId = binaryReader.ReadUInt32(); return(newObj); }
private void ZombieResurection(PlayerDeathEvent ev) { eventQue.Add(new DeathSync(ev)); Timer timer = new Timer(ZombieResurectCallback); int zomb_min = plugin.GetConfigInt("zombi_rez_min_time"); int zomb_max = plugin.GetConfigInt("zombi_rez_max_time"); timer.Change((int)(random.NextDouble() * (float)(zomb_max - zomb_min)) + zomb_min, Timeout.Infinite); }
private void PlayerDeath() { //Debug.Log("Did you ever hear the tragedy of Darth Plagueis the Wise?"); if (PlayerDeathEvent != null) { PlayerDeathEvent.Invoke(); } }
/// <summary> /// Called from <c>BasePlayer.Die(HitInfo)</c> . /// </summary> public static void On_PlayerDied(BasePlayer basePlayer, HitInfo info) { using (TimeWarning.New("Player.Die", 0.1f)) { if (!basePlayer.IsDead()) { if (info == null) { info = new HitInfo(); info.damageTypes.Add(basePlayer.lastDamage, Single.MaxValue); info.Initiator = (BaseEntity)basePlayer; } Player victim = Server.GetPlayer(basePlayer); if (!((bool)basePlayer.CallMethod("WoundInsteadOfDying", info))) { var pde = new PlayerDeathEvent(victim, info); OnNext("On_PlayerDied", pde); if (pde.Die) { if (info.Initiator != null) { // PlayerStats statsV = victim.Stats; if (info.Initiator is BasePlayer) { Server.GetPlayer(info.Initiator as BasePlayer).Stats.AddKill(true, false); victim.Stats.AddDeath(true, false); } else if (info.Initiator is BaseNPC) { victim.Stats.AddDeath(false, true); } } if (!pde.dropLoot) { if (basePlayer.belt != null) { Vector3 vector = new Vector3(UnityEngine.Random.Range(-2f, 2f), 0.2f, UnityEngine.Random.Range(-2f, 2f)); basePlayer.belt.DropActive(vector.normalized * 3f); } basePlayer.inventory.Strip(); } basePlayer.CallMethodOnBase(typeof(BaseCombatEntity), "Die", info); } } } } }