public void StartGame() { if (ChoiesLanguege.Languge1 != ChoiesLanguege.Languge2 && HP.Now_Energy >= 5) { HP.Now_Energy -= 5; HP.SaveData(); //StartCoroutine(StartGameCor(2)); SceneManager.LoadScene(2); } if (HP.Now_Energy < 5) { Debug.Log(1); Window2.SetActive(true); } if (ChoiesLanguege.Languge1 == ChoiesLanguege.Languge2) { Debug.Log(2); Window1.SetActive(true); } }
public void ChoisSkills() { if (HP_PERS.PointBook >= Cost_Now_Skill) { if (Skill && HP_PERS.Skills[NumberSkill] != true) { HP_PERS.Skills[NumberSkill] = true; HP_PERS.PointBook -= Cost_Now_Skill; PointBook.text = HP_PERS.PointBook.ToString(); Button_Skill[NumberSkill].GetComponent <Image>().sprite = Activ_Button[NumberSkill]; if (NumberSkill == 4) { HP_PERS.Max_Energy += (int)(((float)HP_PERS.Max_Energy / 100.00) * 15.00 * HP_PERS.LVL_Skill[4]); } HP_PERS.SaveData(); Window_Discription.SetActive(false); } else if (Skill && HP_PERS.Skills[NumberSkill] && HP_PERS.LVL_Skill[NumberSkill] < HP_PERS.LVLBooK + 1) { HP_PERS.LVL_Skill[NumberSkill] += 1; HP_PERS.PointBook -= Cost_Now_Skill; PointBook.text = HP_PERS.PointBook.ToString(); if (NumberSkill == 4) { HP_PERS.Max_Energy += (int)(((float)HP_PERS.Max_Energy / 100.00) * 15.00 * HP_PERS.LVL_Skill[4]); } HP_PERS.SaveData(); Window_Discription.SetActive(false); } else { Need_Up_Book.SetActive(true); } } else { NO_Point_Book.SetActive(true); } }
public void Equip() { if (StatPers.Gold >= Cost_now_Item) { if (!StatPers.By_Sword[ChoisKnife]) { StatPers.By_Sword[ChoisKnife] = true; StatPers.Gold -= Cost_now_Item; Discription_Item.text = "Aтака " + StatPers.Damage_Sword[ChoisKnife] + "\n" + "Уровень предмета " + StatPers.LVl_Sword[ChoisKnife] + "\n" + "Цена " + Cost_now_Item; Equip_GameObj.SetActive(true); } else { StatPers.Damage_Sword[ChoisKnife] += 2; StatPers.Gold -= Cost_now_Item; Discription_Item.text = "Aтака " + StatPers.Damage_Sword[ChoisKnife] + "\n" + "Уровень предмета " + StatPers.LVl_Sword[ChoisKnife] + "\n" + "Цена " + Cost_now_Item; } StatPers.SaveData(); } else { NO_money.SetActive(true); } }
public void EndRound() { if (HP_G <= 0) { GerlAnimator[0].SetTrigger("Die"); int Gold_Lose = HP_Person.LVLPers * Random.Range(10, 30); if (HP_Person.Skills[11]) { Gold_Lose += ((Gold_Lose / 100) * (24 + HP_Person.LVL_Skill[11])); HP_Person.Gold += Gold_Lose; } else { HP_Person.Gold += Gold_Lose; } Gold.text = Gold_Lose.ToString(); int Rubin_Lose = 0; HP_Person.Rubin += Rubin_Lose; Rubin.text = Rubin_Lose.ToString(); HP_Person.PointBook += WordButtom.Point_now_Battel; Point.text = WordButtom.Point_now_Battel.ToString(); int EXP_lose = HP_Person.LVLPers * Random.Range(10, 20); HP_Person.NowXP += EXP_lose; Exp.text = EXP_lose.ToString(); //HP_Person.NowXP += 50; RoundPanel.SetActive(true); GameState = false; EndRaund.text = "В этот раз Усакула победил!" + "\n" + "Попробуйте улучшить оружие или запомнить больше волшебных слов ;)"; if (HP_Person.NowXP >= HP_Person.NextLVLXP) { NextLevel.text = "НОВЫЙ УРОВЕНЬ!"; } RoundPanel.transform.DOMove(Lasttransform.position, 1f); HP_Person.NextLVL(); HP_Person.SaveData(); } if (HP_E <= 0) { EnyAnimator[HP_Person.NumberEnemy].SetTrigger("Die"); int Gold_W = HP_Person.LVLPers * Random.Range(80, 100); if (HP_Person.Skills[11]) { Gold_W += ((Gold_W / 100) * (24 + HP_Person.LVL_Skill[11])); HP_Person.Gold += Gold_W; } else { HP_Person.Gold += Gold_W; } Gold.text = Gold_W.ToString(); int Rubin_W = 0; int Shois = Random.Range(0, 100); if (Shois <= 20) { Rubin_W = 1; } HP_Person.Rubin += Rubin_W; Rubin.text = Rubin_W.ToString(); HP_Person.PointBook += WordButtom.Point_now_Battel; Point.text = WordButtom.Point_now_Battel.ToString(); int EXP_W = HP_Person.LVLPers * Random.Range(80, 110); HP_Person.NowXP += EXP_W; Exp.text = EXP_W.ToString(); //HP_Person.NowXP += 250; RoundPanel.SetActive(true); GameState = false; EndRaund.text = "Вы победили! Так держать!"; if (HP_Person.NowXP >= HP_Person.NextLVLXP) { NextLevel.text = "НОВЫЙ УРОВЕНЬ!"; } RoundPanel.transform.DOMove(Lasttransform.position, 1f); HP_Person.NextLVL(); HP_Person.SaveData(); } //RoundPanel.SetActive(true); //GameState = false; //RoundPanel.transform.DOMove(Lasttransform.position, 1f); //HP_Person.NextLVL(); //HP_Person.SaveData(); }