private void UpdatePointText()
 {
     if (this.pointsText == null)
     {
         this.pointsText = UnityEngine.Object.FindObjectOfType <ScpInterfaces>().Scp106_ability_points;
         return;
     }
     this.ultimatePoints += Time.deltaTime * 6.66f * this.teleportSpeed;
     this.ultimatePoints  = Mathf.Clamp(this.ultimatePoints, 0f, 100f);
     this.pointsText.text = TranslationReader.Get("Legancy_Interfaces", 11);
 }
Пример #2
0
    private void Start()
    {
        if (base.isLocalPlayer)
        {
            for (int i = 0; i < this.klasy.Length; i++)
            {
                this.klasy[i].fullName    = TranslationReader.Get("Class_Names", i);
                this.klasy[i].description = TranslationReader.Get("Class_Descriptions", i);
            }
            CharacterClassManager.staticClasses = this.klasy;
        }
        else if (CharacterClassManager.staticClasses == null || CharacterClassManager.staticClasses.Length == 0)
        {
            for (int j = 0; j < this.klasy.Length; j++)
            {
                this.klasy[j].description = TranslationReader.Get("Class_Descriptions", j);
                this.klasy[j].fullName    = TranslationReader.Get("Class_Names", j);
            }
        }
        else
        {
            this.klasy = CharacterClassManager.staticClasses;
        }
        this.lureSpj      = UnityEngine.Object.FindObjectOfType <LureSubjectContainer>();
        this.scp049       = base.GetComponent <Scp049PlayerScript>();
        this.scp049_2     = base.GetComponent <Scp049_2PlayerScript>();
        this.scp079       = base.GetComponent <Scp079PlayerScript>();
        this.scp106       = base.GetComponent <Scp106PlayerScript>();
        this.scp173       = base.GetComponent <Scp173PlayerScript>();
        this.scp096       = base.GetComponent <Scp096PlayerScript>();
        this.forceClass   = ConfigFile.GetInt("server_forced_class", -1);
        this.ciPercentage = (float)ConfigFile.GetInt("ci_on_start_percent", 10);
        base.StartCoroutine("Init");
        string text = ConfigFile.GetString("team_respawn_queue", "401431403144144") + "...........................";

        this.classTeamQueue.Clear();
        for (int k = 0; k < text.Length; k++)
        {
            int item = 4;
            if (!int.TryParse(text[k].ToString(), out item))
            {
                item = 4;
            }
            this.classTeamQueue.Add((Team)item);
        }
        if (!base.isLocalPlayer && TutorialManager.status)
        {
            this.ApplyProperties();
        }
    }
Пример #3
0
    public void UpdateString()
    {
        string text = TranslationReader.Get(this.keyName, this.index);

        while (text.Contains("\\n"))
        {
            text = text.Replace("\\n", Environment.NewLine);
        }
        if (base.GetComponent <TextMeshProUGUI>() != null)
        {
            base.GetComponent <TextMeshProUGUI>().text = text;
        }
        else
        {
            base.GetComponent <Text>().text = text;
        }
    }
Пример #4
0
 private void LateUpdate()
 {
     if (!TutorialManager.status)
     {
         return;
     }
     this.fpc.tutstop = false;
     if (TutorialManager.curlog >= 0 && this.logs[TutorialManager.curlog].stopPlayer)
     {
         this.fpc.tutstop = true;
     }
     if (this.timeToNext > 0f)
     {
         if (Input.GetKeyDown(KeyCode.Return))
         {
             this.timeToNext = 0f;
             this.src.Stop();
         }
         this.timeToNext -= Time.deltaTime;
         if (this.timeToNext <= 0f && TutorialManager.curlog != -1)
         {
             this.txt.text = string.Empty;
             if (this.logs[TutorialManager.curlog].jumpforward)
             {
                 this.Trigger(TutorialManager.curlog + 1);
             }
             else
             {
                 TutorialManager.curlog = -1;
             }
         }
     }
     if (TutorialManager.curlog != -1 && this.timeToNext <= 0f)
     {
         this.timeToNext = this.logs[TutorialManager.curlog].duration_en;
         if (this.logs[TutorialManager.curlog].clip_en != null)
         {
             this.src.PlayOneShot(this.logs[TutorialManager.curlog].clip_en);
         }
         if (this.logs[TutorialManager.curlog].duration_en > 0f)
         {
             this.txt.text = TranslationReader.Get("Tutorial_" + TutorialManager.levelID.ToString("00"), TutorialManager.curlog);
         }
     }
 }
Пример #5
0
 private void EscapeFromFacility()
 {
     if (!this.escaped)
     {
         if (this.ccm.klasy[this.ccm.curClass].team == Team.RSC)
         {
             this.escaped = true;
             this.ccm.RegisterEscape();
             base.StartCoroutine(this.EscapeAnim(TranslationReader.Get("Facility", 29)));
         }
         if (this.ccm.klasy[this.ccm.curClass].team == Team.CDP)
         {
             this.escaped = true;
             this.ccm.RegisterEscape();
             base.StartCoroutine(this.EscapeAnim(TranslationReader.Get("Facility", 30)));
         }
     }
 }
Пример #6
0
    private IEnumerator Animate(int classID)
    {
        this.black.gameObject.SetActive(true);
        GameObject            host = GameObject.Find("Host");
        CharacterClassManager ccm  = host.GetComponent <CharacterClassManager>();
        Class klasa = ccm.klasy[classID];

        this.youare.text = ((!TutorialManager.status) ? TranslationReader.Get("Facility", 31) : string.Empty);
        this.wmi.text    = klasa.fullName;
        this.wmi.color   = klasa.classColor;
        this.wihtd.text  = klasa.description;
        while (this.popup.transform.localScale.x < 1f)
        {
            this.popup.transform.localScale += Vector3.one * Time.deltaTime * 2f;
            if (this.popup.transform.localScale.x > 1f)
            {
                this.popup.transform.localScale = Vector3.one;
            }
            yield return(new WaitForEndOfFrame());
        }
        while (this.black.color.a > 0f)
        {
            this.black.color = new Color(0f, 0f, 0f, this.black.color.a - Time.deltaTime);
            yield return(new WaitForEndOfFrame());
        }
        yield return(new WaitForSeconds(7f));

        CanvasRenderer c  = this.youare.GetComponent <CanvasRenderer>();
        CanvasRenderer c2 = this.wmi.GetComponent <CanvasRenderer>();
        CanvasRenderer c3 = this.wihtd.GetComponent <CanvasRenderer>();

        HintManager.singleton.AddHint(0);
        while (c.GetAlpha() > 0f)
        {
            c.SetAlpha(c.GetAlpha() - Time.deltaTime / 2f);
            c2.SetAlpha(c2.GetAlpha() - Time.deltaTime / 2f);
            c3.SetAlpha(c3.GetAlpha() - Time.deltaTime / 2f);
            yield return(new WaitForEndOfFrame());
        }
        this.black.gameObject.SetActive(false);
        yield break;
    }
Пример #7
0
	public void SetDescriptionByID(int id)
	{
		if (id == -1)
		{
			this.hoveredID = -1;
			this.description.text = string.Empty;
		}
		else if (this.items.Count > id)
		{
			string text = TranslationReader.Get("Inventory", this.items[id].id).Replace("\\n", Environment.NewLine);
			string label = this.items[id].label;
			this.description.text = text;
			this.hoveredID = id;
		}
		else
		{
			this.hoveredID = -1;
			this.description.text = string.Empty;
		}
	}
Пример #8
0
    public void RpcSetSummary(RoundSummary.Summary sum, int posttime)
    {
        Radio.roundEnded = true;
        string text  = string.Empty;
        string text2 = text;

        text = string.Concat(new object[]
        {
            text2,
            "<color=#ff0000>",
            sum.classD_escaped,
            "/",
            sum.classD_start,
            "</color> ",
            TranslationReader.Get("Legancy_Interfaces", 3),
            "\n"
        });
        text2 = text;
        text  = string.Concat(new object[]
        {
            text2,
            "<color=#ff0000>",
            sum.scientists_escaped,
            "/",
            sum.scientists_start,
            "</color> ",
            TranslationReader.Get("Legancy_Interfaces", 4),
            "\n"
        });
        text2 = text;
        text  = string.Concat(new object[]
        {
            text2,
            "<color=#ff0000>",
            sum.scp_frags,
            "</color> ",
            TranslationReader.Get("Legancy_Interfaces", 5),
            "\n"
        });
        text2 = text;
        text  = string.Concat(new object[]
        {
            text2,
            "<color=#ff0000>",
            Mathf.Clamp(sum.scp_start - sum.scp_alive, 0, sum.scp_start),
            "/",
            sum.scp_start,
            "</color> ",
            TranslationReader.Get("Legancy_Interfaces", 6),
            "\n"
        });
        text2 = text;
        text  = string.Concat(new string[]
        {
            text2,
            TranslationReader.Get("Legancy_Interfaces", 7),
            ": <color=#ff0000>",
            (!sum.warheadDetonated) ? TranslationReader.Get("Legancy_Interfaces", 9) : TranslationReader.Get("Legancy_Interfaces", 8),
            "</color>\n\n"
        });
        text += TranslationReader.Get("Legancy_Interfaces", 10).Replace("[time]", posttime.ToString());
        GameObject gameObject = UserMainInterface.singleton.summary;

        gameObject.SetActive(true);
        TextMeshProUGUI component = GameObject.FindGameObjectWithTag("Summary").GetComponent <TextMeshProUGUI>();

        component.text = text;
    }
Пример #9
0
 private void Update()
 {
     if (base.isLocalPlayer)
     {
         bool       flag = false;
         RaycastHit raycastHit;
         if (Physics.Raycast(new Ray(this.spectCam.position, this.spectCam.forward), out raycastHit, this.viewRange, this.raycastMask))
         {
             NicknameSync component = raycastHit.transform.GetComponent <NicknameSync>();
             if (component != null && !component.isLocalPlayer)
             {
                 CharacterClassManager component2 = component.GetComponent <CharacterClassManager>();
                 CharacterClassManager component3 = base.GetComponent <CharacterClassManager>();
                 flag = true;
                 if (component2.curClass != -1 && !TutorialManager.status)
                 {
                     this.n_text.color = component2.klasy[component2.curClass].classColor;
                     this.n_text.text  = component.role.GetColoredRoleString() + "\n";
                     Text text = this.n_text;
                     text.text += component.myNick;
                     Text text2 = this.n_text;
                     text2.text = text2.text + "\n" + component2.klasy[component2.curClass].fullName;
                 }
                 try
                 {
                     if (component2.curClass >= 0 && component2.klasy[component2.curClass].team == Team.MTF && component3.klasy[component3.curClass].team == Team.MTF)
                     {
                         int num  = 0;
                         int num2 = 0;
                         if (component2.curClass == 4 || component2.curClass == 11)
                         {
                             num2 = 200;
                         }
                         else if (component2.curClass == 13)
                         {
                             num2 = 100;
                         }
                         else if (component2.curClass == 12)
                         {
                             num2 = 300;
                         }
                         if (component3.curClass == 4 || component3.curClass == 11)
                         {
                             num = 200;
                         }
                         else if (component3.curClass == 13)
                         {
                             num = 100;
                         }
                         else if (component3.curClass == 12)
                         {
                             num = 300;
                         }
                         Text text3 = this.n_text;
                         text3.text = text3.text + " (" + GameObject.Find("Host").GetComponent <NineTailedFoxUnits>().GetNameById(component2.ntfUnit) + ")\n\n<b>";
                         num       -= component3.ntfUnit;
                         num2      -= component2.ntfUnit;
                         if (num > num2)
                         {
                             Text text4 = this.n_text;
                             text4.text += TranslationReader.Get("Legancy_Interfaces", 0);
                         }
                         else if (num2 > num)
                         {
                             Text text5 = this.n_text;
                             text5.text += TranslationReader.Get("Legancy_Interfaces", 1);
                         }
                         else if (num2 == num)
                         {
                             Text text6 = this.n_text;
                             text6.text += TranslationReader.Get("Legancy_Interfaces", 2);
                         }
                         Text text7 = this.n_text;
                         text7.text += "</b>";
                     }
                 }
                 catch
                 {
                     MonoBehaviour.print("Error");
                 }
             }
         }
         this.transparency += Time.deltaTime * (float)((!flag) ? -3 : 3);
         if (flag)
         {
             float max = (this.viewRange - Vector3.Distance(base.transform.position, raycastHit.point)) / this.viewRange;
             this.transparency = Mathf.Clamp(this.transparency, 0f, max);
         }
         this.transparency = Mathf.Clamp01(this.transparency);
         CanvasRenderer component4 = this.n_text.GetComponent <CanvasRenderer>();
         component4.SetAlpha(this.transparency);
     }
 }
Пример #10
0
    public static string GetCause(PlayerStats.HitInfo info, bool ragdoll)
    {
        string result = TranslationReader.Get("Death_Causes", 11);
        int    num    = -1;

        if (info.tool == "NUKE")
        {
            result = TranslationReader.Get("Death_Causes", 0);
        }
        else if (info.tool == "FALLDOWN")
        {
            result = TranslationReader.Get("Death_Causes", 1);
        }
        else if (info.tool == "LURE")
        {
            result = TranslationReader.Get("Death_Causes", 2);
        }
        else if (info.tool == "POCKET")
        {
            result = TranslationReader.Get("Death_Causes", 3);
        }
        else if (info.tool == "CONTAIN")
        {
            result = TranslationReader.Get("Death_Causes", 4);
        }
        else if (info.tool == "TESLA")
        {
            result = TranslationReader.Get("Death_Causes", 5);
        }
        else if (info.tool == "WALL")
        {
            result = TranslationReader.Get("Death_Causes", 6);
        }
        else if (info.tool.Length > 7 && info.tool.Substring(0, 7) == "Weapon:" && int.TryParse(info.tool.Remove(0, 7), out num) && num != -1)
        {
            GameObject           gameObject = GameObject.Find("Host");
            WeaponManager.Weapon weapon     = gameObject.GetComponent <WeaponManager>().weapons[num];
            AmmoBox component = gameObject.GetComponent <AmmoBox>();
            result = TranslationReader.Get("Death_Causes", 7).Replace("[ammotype]", component.types[weapon.ammoType].label);
        }
        else if (info.tool.Length > 4 && info.tool.Substring(0, 4) == "SCP:" && int.TryParse(info.tool.Remove(0, 4), out num) && num != -1)
        {
            if (num == 173)
            {
                result = TranslationReader.Get("Death_Causes", 8);
            }
            else if (num == 106)
            {
                result = TranslationReader.Get("Death_Causes", 9);
            }
            else if (num == 96)
            {
                result = TranslationReader.Get("Death_Causes", 13);
            }
            else if (num == 49 || num == 492)
            {
                result = TranslationReader.Get("Death_Causes", 10);
            }
        }
        return(result);
    }
Пример #11
0
    public IEnumerator DownloadList()
    {
        this.loadingText.text = TranslationReader.Get("MainMenu", 53);
        foreach (GameObject obj in this.spawns)
        {
            UnityEngine.Object.Destroy(obj);
        }
        this.spawns.Clear();
        WWW www = new WWW("https://hubertmoszka.pl/lobbylist.php");

        yield return(www);

        Text   text  = this.loadingText;
        string text2 = TranslationReader.Get("MainMenu", 54);

        this.loadingText.text = text2;
        text.text             = text2;
        if (string.IsNullOrEmpty(www.error))
        {
            if (www.text.Contains("<br>"))
            {
                string[] results = www.text.Split(new string[]
                {
                    "<br>"
                }, StringSplitOptions.None);
                foreach (string server in results)
                {
                    if (server.Contains(":"))
                    {
                        string[] info = server.Split(new char[]
                        {
                            ':'
                        });
                        if (info.Length == 4)
                        {
                            try
                            {
                                if (this.Base64Decode(info[2]).Split(new string[]
                                {
                                    ":[:BREAK:]:"
                                }, StringSplitOptions.None)[2] == UnityEngine.Object.FindObjectOfType <CustomNetworkManager>().versionstring)
                                {
                                    string text3 = this.Base64Decode(info[2]).Split(new string[]
                                    {
                                        ":[:BREAK:]:"
                                    }, StringSplitOptions.None)[0];
                                    if (this.filters.AllowToSpawn(text3))
                                    {
                                        this.loadingText.text = string.Empty;
                                        PlayButton component = this.AddRecord().GetComponent <PlayButton>();
                                        component.ip        = this.Base64Decode(info[0]);
                                        component.port      = this.Base64Decode(info[1]);
                                        component.motd.text = text3;
                                        component.infoType  = this.Base64Decode(info[2]).Split(new string[]
                                        {
                                            ":[:BREAK:]:"
                                        }, StringSplitOptions.None)[1];
                                        component.players.text = info[3];
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                throw;
                            }
                            if (this.loadingText.text == string.Empty)
                            {
                                yield return(new WaitForEndOfFrame());
                            }
                        }
                    }
                }
            }
        }
        else
        {
            this.loadingText.text = www.error;
        }
        yield break;
    }