Esempio n. 1
0
 public void OnContain106(PlayerContain106Event e)
 {
     if (!SCP457.HasSCP457())
     {
         return;
     }
     e.ActivateContainment = false;
 }
Esempio n. 2
0
 public void OnPocketDimensionEnter(PlayerPocketDimensionEnterEvent e)
 {
     if (!SCP457.HasSCP457())
     {
         return;
     }
     e.TargetPosition = e.LastPosition;
 }
Esempio n. 3
0
 public void OnSetRoleMaxHP(SetRoleMaxHPEvent e)
 {
     if (e.Role == Role.SCP_106 && SCP457.HasSCP457())
     {
         e.MaxHP = this.plugin.GetConfigInt("scp457_health");
         this.plugin.Info(string.Concat(new object[]
         {
             "Setting max health for SCP-457 to ", e.MaxHP, " for ", e.Role
         }));
     }
 }
Esempio n. 4
0
        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);
        }