Esempio n. 1
0
    void InstantiateRoom()//Instancia uma sala aleatoria e remove ela da lista
    {
        onNewRoom?.Invoke();

        if (roomsPassed < 10)//salas faceis
        {
            int random = UnityEngine.Random.Range(0, easyRooms.Count);
            currentRoom = Instantiate(easyRooms[random], spawnRoomPoint.position, Quaternion.identity);
            easyRooms.Remove(easyRooms[random]);
        }
        else if (roomsPassed >= 10 && roomsPassed < 20)//salas medias
        {
            int random = UnityEngine.Random.Range(0, mediumRooms.Count);
            currentRoom = Instantiate(mediumRooms[random], spawnRoomPoint.position, Quaternion.identity);
            mediumRooms.Remove(mediumRooms[random]);
        }
        else if (roomsPassed >= 20 && roomsPassed <= 30)//salas dificeis
        {
            if (hardRooms.Count > 0)
            {
                int random = UnityEngine.Random.Range(0, hardRooms.Count);
                currentRoom = Instantiate(hardRooms[random], spawnRoomPoint.position, Quaternion.identity);
                hardRooms.Remove(hardRooms[random]);
            }
            else
            {
                HelpfulFunctions.LoadScene("MenuInicial");
            }
        }

        roomsPassed++;
        navMesh.BuildNavMesh();
    }
Esempio n. 2
0
 private void Start()
 {
     StartCoroutine(FadeOut());
     PlayerClass.ingredients = PlayerPrefs.GetInt("Ingredients");
     HelpfulFunctions.LoadStatus(selectedCharacter);
     UpdtadeUI();
 }
Esempio n. 3
0
    protected virtual void NetGetHit(string bodyPartHit, string hitVector, int damage, int knockbackForce)
    {
        Vector3 hitNormal = HelpfulFunctions.StringToVector3(hitVector);

        if (bodyPartHit == "Eye")
        {
            damage = Mathf.RoundToInt(damage * criticalHitMultiplier);
            audioSource.PlayOneShot(eyeHitSound);
        }
        else
        {
            audioSource.PlayOneShot(hitSound);
        }
        health -= damage;

        if (health <= 0)
        {
            Die();
        }

        if (knockbackEnabled)
        {
            rb.AddForce(-hitNormal * knockbackForce, ForceMode.Impulse);
            rb.AddTorque(hitNormal * knockbackForce, ForceMode.Impulse);
        }
    }
Esempio n. 4
0
    IEnumerator LoadScene(string cena)
    {
        AM.SetTrigger("Ficar grande");
        yield return(new WaitForSeconds(1.5f));

        HelpfulFunctions.LoadScene(cena);
    }
Esempio n. 5
0
    IEnumerator LoadScene(string sceneName)
    {
        AM.SetTrigger("Ficar grande");
        yield return(new WaitForSeconds(1.5f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStatus>().Save();
        HelpfulFunctions.LoadScene(sceneName);
    }
Esempio n. 6
0
 public void UpdtadeUI()
 {
     expBar.value             = (float)selectedCharacter.experience / selectedCharacter.experienceToNextLevel;
     levelText.text           = "Level: " + (selectedCharacter.level + 1);
     expPonts.text            = "Skill points available:  " + selectedCharacter.experiencePoints;
     ingredientes.text        = "" + PlayerClass.ingredients;
     ingredientesUpgrade.text = "" + PlayerClass.ingredients;
     HelpfulFunctions.SaveStatus(selectedCharacter);
 }
Esempio n. 7
0
 void NetProjectileHit(int index, string hitPoint)
 {
     if (hitParticles != null)
     {
         Vector3 hitVector = HelpfulFunctions.StringToVector3(hitPoint);
         Instantiate(hitParticles, hitVector, Quaternion.identity);
     }
     Destroy(projectiles[index], .5f);
 }
Esempio n. 8
0
 public Leaves()
 {
     Health         = 5;
     MinDamageToHit = 1;
     Texture        = Battle.leaves;
     Body           = new System.Windows.Shapes.Rectangle
     {
         Width  = standartSize,
         Height = standartSize,
         Fill   = HelpfulFunctions.BitmapToBrush(Texture)
     };
     Panel.SetZIndex(Body, 10);
 }
Esempio n. 9
0
 public Bomb()
 {
     Health  = 1;
     Texture = Battle.bomb;
     Body    = new System.Windows.Shapes.Rectangle
     {
         Width  = standartSize,
         Height = standartSize,
         Fill   = HelpfulFunctions.BitmapToBrush(Texture)
     };
     Panel.SetZIndex(Body, 50);
     timer = new DispatcherTimer
     {
         Interval = new TimeSpan(0, 0, 0, 0, 10)
     };
     Iterator = 0;
 }
Esempio n. 10
0
 public Gabaijito()
 {
     Speed  = 2;
     Health = 20;
     Buffs  = new ushort[maxNumberOfBuffs];
     for (int i = 0; i < maxNumberOfBuffs; ++i)
     {
         Buffs[i] = 0;
     }
     Texture = Battle.mob;
     Body    = new System.Windows.Shapes.Rectangle
     {
         Width  = standartSize,
         Height = standartSize,
         Fill   = HelpfulFunctions.BitmapToBrush(Texture)
     };
     Panel.SetZIndex(Body, 40);
 }
Esempio n. 11
0
 void Awake()
 {
     HelpfulFunctions.LoadStatus(player);
 }
Esempio n. 12
0
 public void Save()
 {
     HelpfulFunctions.SaveStatus(player);
 }