public void On106CreatePortal(Player106CreatePortalEvent e) { if (SCP457.SteamIDIsSCP457(e.Player.SteamId)) { e.Position = new Vector(-100f, -100f, -100f); } }
public void On106Teleport(Player106TeleportEvent e) { if (SCP457.SteamIDIsSCP457(e.Player.SteamId)) { e.Position = e.Player.GetPosition(); } }
public void OnPlayerDie(PlayerDeathEvent e) { Player player = e.Player; if (SCP457.SteamIDIsSCP457(player.SteamId)) { this.plugin.RemoveSCP457(player.SteamId); } }
public void OnSetRole(PlayerSetRoleEvent e) { Player player = e.Player; if (SCP457.SteamIDIsSCP457(player.SteamId) && e.Role == Role.SCP_106) { player.SetHealth(this.plugin.GetConfigInt("scp457_health"), DamageType.NUKE); new Thread(new ThreadStart(this.DelayHealthSet)).Start(); } if (SCP457.SteamIDIsSCP457(player.SteamId) && e.Role != Role.SCP_106) { this.plugin.RemoveSCP457(player.SteamId); } }
public void OnPlayerHurt(PlayerHurtEvent ev) { if (!SCP457.SteamIDIsSCP457(ev.Attacker.SteamId) || SCP457.SteamIDIsSCP457(ev.Player.SteamId)) { return; } if (ev.Player.TeamRole.Team == Smod2.API.Team.SCP || (ev.Player.TeamRole.Team == Smod2.API.Team.TUTORIAL && this.plugin.GetConfigBool("scp457_tutorialallies"))) { return; } ev.Damage = 0f; this.damage += this.damageStep; this.damage = Math.Min(this.damage, this.maxDamage); this.damageRadius += this.damageRadiusStep; this.damageRadius = Math.Min(this.damageRadius, this.maxDamageRadius); }
public void OnUpdate(UpdateEvent e) { if (!SCP457.HasSCP457()) { return; } if (DateTime.Now < this.lastCheckTime.AddSeconds(1.0)) { return; } this.lastCheckTime = DateTime.Now; Player player = null; foreach (Player player2 in PluginManager.Manager.Server.GetPlayers("")) { if (SCP457.SteamIDIsSCP457(player2.SteamId)) { player = player2; break; } } if (player == null) { return; } GameObject pObj = (GameObject)player.GetGameObject(); Vector3 position = pObj.GetComponent <PlyMovementSync>().position; foreach (Player player3 in PluginManager.Manager.Server.GetPlayers("")) { if (player3.TeamRole.Team != Smod2.API.Team.SCP) { if (player3.TeamRole.Team == Smod2.API.Team.TUTORIAL && this.plugin.GetConfigBool("scp457_tutorialallies")) { return; } GameObject pObj2 = (GameObject)player3.GetGameObject(); Vector3 position2 = pObj2.GetComponent <PlyMovementSync>().position; if (Vector3.Distance(position, position2) <= this.damageRadius) { player3.Damage(checked ((int)this.damage), DamageType.POCKET); } } } foreach (Player player4 in PluginManager.Manager.Server.GetPlayers("")) { if (player4.TeamRole.Team == Smod2.API.Team.SCP) { if (player4.TeamRole.Team == Smod2.API.Team.TUTORIAL && this.plugin.GetConfigBool("scp457_tutorialallies")) { return; } GameObject pObj3 = (GameObject)player4.GetGameObject(); Vector3 position3 = pObj3.GetComponent <PlyMovementSync>().position; if (Vector3.Distance(position, position3) <= this.damageRadius) { Role role = player4.TeamRole.Role; /*this.plugin.Debug("Performing SCP-457 health check."); * this.plugin.Debug(string.Concat(new object[] * { * "Player health is ", player4.GetHealth(), ", player max health is ", this.GetRoleMaxHealth(role), " and player SteamID is ", player4.SteamId * }));*/ if (!SCP457.SteamIDIsSCP457(player4.SteamId) && player4.GetHealth() < this.GetRoleMaxHealth(role)) { this.plugin.Debug(string.Concat(new object[] { "Healing Player '", player4.Name, "'!" })); int damagePercentHealth = rng.Next((int)(this.GetRoleMaxHealth(role) * this.minHealthHeal), (int)(this.GetRoleMaxHealth(role) * this.maxHealthHeal)); int newHealth = Math.Min(this.GetRoleMaxHealth(role), player4.GetHealth() + damagePercentHealth); player4.SetHealth(newHealth, DamageType.NUKE); } } } } float damageNum = (this.damage > this.baseDamage) ? (-this.damageDecrease) : this.damageDecrease; this.damage += damageNum; this.damage = ((Math.Sign(damageNum) == -1) ? Math.Max(this.baseDamage, this.damage) : Math.Min(this.baseDamage, this.damage)); this.damage = Math.Max(1f, this.damage); float damageRadiusNum = (this.damageRadius > this.baseDamageRadius) ? (-this.damageRadiusDecrease) : this.damageRadiusDecrease; this.damageRadius += damageRadiusNum; this.damageRadius = ((Math.Sign(damageRadiusNum) == -1) ? Math.Max(this.baseDamageRadius, this.damageRadius) : Math.Min(this.baseDamageRadius, this.damageRadius)); this.damageRadius = Math.Max(0f, this.damageRadius); }