Beispiel #1
0
        private void Player_Died(Exiled.Events.EventArgs.DiedEventArgs ev)
        {
            var controller = ev.Target.GameObject.GetComponent <SCP457Controller>();

            ev.Target.GameObject.GetComponent <BurningComponent>().burningtime = 0;
            if (controller != null)
            {
                ev.Target.Scale = new Vector3(1f, 1f, 1f);
                controller.Destroy();
                GameObject x = null;
                foreach (GameObject gameObject in global::PlayerManager.players)
                {
                    if (gameObject.GetComponent <RemoteAdmin.QueryProcessor>().PlayerId == ev.HitInformations.PlayerId)
                    {
                        x = gameObject;
                    }
                }
                var l  = ev.Target.ReferenceHub.characterClassManager.Classes.ToList();
                int pd = 0;
                foreach (var p in l.ToArray())
                {
                    if (p.roleId == RoleType.Scp0492)
                    {
                        p.fullName = "SCP-457";
                        l[pd]      = p;
                    }
                    pd++;
                }
                ev.Target.ReferenceHub.characterClassManager.Classes = l.ToArray();
                if (x != null)
                {
                    global::NineTailedFoxAnnouncer.AnnounceScpTermination(ev.Target.ReferenceHub.characterClassManager.CurRole, ev.HitInformations, string.Empty);
                }
                else
                {
                    global::DamageTypes.DamageType damageType = ev.HitInformations.GetDamageType();
                    if (damageType == global::DamageTypes.Tesla)
                    {
                        global::NineTailedFoxAnnouncer.AnnounceScpTermination(ev.Target.ReferenceHub.characterClassManager.CurRole, ev.HitInformations, "TESLA");
                    }
                    else if (damageType == global::DamageTypes.Nuke)
                    {
                        global::NineTailedFoxAnnouncer.AnnounceScpTermination(ev.Target.ReferenceHub.characterClassManager.CurRole, ev.HitInformations, "WARHEAD");
                    }
                    else if (damageType == global::DamageTypes.Decont)
                    {
                        global::NineTailedFoxAnnouncer.AnnounceScpTermination(ev.Target.ReferenceHub.characterClassManager.CurRole, ev.HitInformations, "DECONTAMINATION");
                    }
                    else
                    {
                        global::NineTailedFoxAnnouncer.AnnounceScpTermination(ev.Target.ReferenceHub.characterClassManager.CurRole, ev.HitInformations, "UNKNOWN");
                    }
                }
                UnityEngine.Object.Destroy(controller);
                foreach (var plr in Player.List)
                {
                    if (plr.GameObject.GetComponent <BurningComponent>().burning)
                    {
                        plr.GameObject.GetComponent <BurningComponent>().burning = false;
                    }
                }
            }
        }
Beispiel #2
0
        private static void Prefix(NineTailedFoxAnnouncer __instance)
        {
            if (global::NineTailedFoxAnnouncer.scpDeaths.Count <= 0)
            {
                return;
            }
            __instance.scpListTimer += Time.deltaTime;
            if (__instance.scpListTimer <= 1f)
            {
                return;
            }
            for (int i = 0; i < global::NineTailedFoxAnnouncer.scpDeaths.Count; i++)
            {
                string text = "";
                for (int j = 0; j < global::NineTailedFoxAnnouncer.scpDeaths[i].scpSubjects.Count; j++)
                {
                    string text2 = "";
                    string text3 = global::NineTailedFoxAnnouncer.scpDeaths[i].scpSubjects[j].fullName.Split(new char[]
                    {
                        '-'
                    })[1];
                    for (int k = 0; k < text3.Length; k++)
                    {
                        text2 = text2 + text3[k].ToString() + " ";
                    }
                    if (j == 0)
                    {
                        text = text + "SCP " + text2;
                    }
                    else
                    {
                        text = text + ". SCP " + text2;
                    }
                }
                global::NineTailedFoxAnnouncer.ScpDeath scpDeath   = global::NineTailedFoxAnnouncer.scpDeaths[i];
                global::DamageTypes.DamageType          damageType = scpDeath.hitInfo.GetDamageType();
                if (damageType == global::DamageTypes.Tesla)
                {
                    text += "SUCCESSFULLY TERMINATED BY AUTOMATIC SECURITY SYSTEM";
                }
                else if (damageType == global::DamageTypes.Nuke)
                {
                    text += "SUCCESSFULLY TERMINATED BY ALPHA WARHEAD";
                }
                else if (damageType == global::DamageTypes.Decont)
                {
                    text += "LOST IN DECONTAMINATION SEQUENCE";
                }
                else
                {
                    global::CharacterClassManager characterClassManager = null;
                    foreach (GameObject gameObject in global::PlayerManager.players)
                    {
                        int playerId = gameObject.GetComponent <RemoteAdmin.QueryProcessor>().PlayerId;
                        scpDeath = global::NineTailedFoxAnnouncer.scpDeaths[i];
                        if (playerId == scpDeath.hitInfo.PlayerId)
                        {
                            characterClassManager = gameObject.GetComponent <global::CharacterClassManager>();
                        }
                    }
                    if (characterClassManager != null)
                    {
                        if (global::NineTailedFoxAnnouncer.scpDeaths[i].scpSubjects[0].roleId != global::RoleType.Scp106)
                        {
                            goto IL_207;
                        }
                        scpDeath = global::NineTailedFoxAnnouncer.scpDeaths[i];
                        if (scpDeath.hitInfo.GetDamageType() != global::DamageTypes.RagdollLess)
                        {
                            goto IL_207;
                        }
                        string text4 = "CONTAINEDSUCCESSFULLY";
IL_213:
                        string str = text4;
                        switch (characterClassManager.CurRole.team)
                        {
                        case global::Team.MTF:
                        {
                            Respawning.NamingRules.UnitNamingRule unitNamingRule;
                            string str2;
                            if (!Respawning.NamingRules.UnitNamingRules.TryGetNamingRule(Respawning.SpawnableTeamType.NineTailedFox, out unitNamingRule))
                            {
                                str2 = "UNKNOWN";
                            }
                            else
                            {
                                str2 = unitNamingRule.GetCassieUnitName(characterClassManager.CurUnitName);
                            }
                            text = text + "CONTAINEDSUCCESSFULLY CONTAINMENTUNIT " + str2;
                            goto IL_2BB;
                        }

                        case global::Team.CHI:
                            text = text + str + " BY CHAOSINSURGENCY";
                            goto IL_2BB;

                        case global::Team.RSC:
                            text = text + str + " BY SCIENCE PERSONNEL";
                            goto IL_2BB;

                        case global::Team.CDP:
                            text = text + str + " BY CLASSD PERSONNEL";
                            goto IL_2BB;

                        default:
                            text += "SUCCESSFULLY TERMINATED . CONTAINMENTUNIT UNKNOWN";
                            goto IL_2BB;
                        }
IL_207:
                        text4 = "TERMINATED";
                        goto IL_213;
                    }
                    text += "SUCCESSFULLY TERMINATED . TERMINATION CAUSE UNSPECIFIED";
                }
IL_2BB:
                int num = 0;
                bool flag = false;
                foreach (GameObject gameObject2 in global::PlayerManager.players)
                {
                    global::CharacterClassManager component = gameObject2.GetComponent <global::CharacterClassManager>();
                    if (Npc.Dictionary.ContainsKey(gameObject2) && !Npc.Dictionary[gameObject2].AffectRoundSummary)
                    {
                        continue;
                    }
                    if (component.CurClass == global::RoleType.Scp079)
                    {
                        flag = true;
                    }
                    if (component.CurRole.team == global::Team.SCP)
                    {
                        num++;
                    }
                }
                if (num == 1 && flag && global::Generator079.mainGenerator.totalVoltage < 4 && !global::Generator079.mainGenerator.forcedOvercharge)
                {
                    global::Generator079.mainGenerator.forcedOvercharge = true;
                    global::Recontainer079.BeginContainment(true);
                    text += " . ALLSECURED . SCP 0 7 9 RECONTAINMENT SEQUENCE COMMENCING . FORCEOVERCHARGE";
                }
                float num2 = (global::AlphaWarheadController.Host.timeToDetonation <= 0f) ? 3.5f : 1f;
                __instance.ServerOnlyAddGlitchyPhrase(text, UnityEngine.Random.Range(0.1f, 0.14f) * num2, UnityEngine.Random.Range(0.07f, 0.08f) * num2);
            }
            __instance.scpListTimer = 0f;
            global::NineTailedFoxAnnouncer.scpDeaths.Clear();
        }