Пример #1
0
    IEnumerator EnemeyAttackRoutin(int attackRate)
    {
        while (_isEnemyDead == false)
        {
            yield return(new WaitForSeconds(attackRate));

            if (_player.isPlayerDead == false)
            {
                _animator.SetTrigger("Attack1Trigger");
                _player.TakeDame(_localUser.currentDefenderScore + 100);//Enemy Attach damage Rate
            }
            else
            {
                if (_isEnemyDead != true)
                {
                    FightSet fightSet = new FightSet(_localUser.currentEventId, _localUser.userID, false, _localUser.currentMutex);
                    StartCoroutine(_gameNetwork.SetFightSatus("https://harryspotter.eu.ngrok.io/setFightStatus", fightSet.Serialize().ToString()));
                    _uIManagerFight.DisplayEndPanel(false);//player lost show panel
                    break;
                }
            }

            print(_player.isPlayerDead);
        }
    }
Пример #2
0
    public void OnExitButtonClick()
    {
        FightSet fightSet = new FightSet(_localUser.currentEventId, _localUser.userID, false, _localUser.currentMutex);

        StartCoroutine(_gameNetwork.SetFightSatus("https://harryspotter.eu.ngrok.io/setFightStatus", fightSet.Serialize().ToString()));
        SceneManager.LoadScene("Map");
    }
Пример #3
0
        public static void s()
        {
            String KeyIn = Input.getInput();

            if (KeyIn.Equals("idarkbasement"))
            {
                Inventory.flask      = true;
                Inventory.sack       = true;
                Inventory.bottle     = true;
                Inventory.flashlight = true;
                Inventory.rug        = true;
                UnderGround.DarkBasement();
            }
            if (KeyIn.Equals("ilightbasement"))
            {
                Inventory.flask      = true;
                Inventory.sack       = true;
                Inventory.bottle     = true;
                Inventory.flashlight = true;
                Inventory.rug        = true;
                UnderGround.LightBasement();
            }
            if (KeyIn.Equals("in1"))
            {
                Inventory.flask      = true;
                Inventory.sack       = true;
                Inventory.bottle     = true;
                Inventory.flashlight = true;
                Inventory.rug        = true;
                UnderGround.N1();
            }
            if (KeyIn.Equals("inymph1"))
            {
                Inventory.flashlight        = true;
                Inventory.flask             = true;
                Inventory.sack              = true;
                Inventory.bottle            = true;
                Inventory.rug               = true;
                Inventory.Nmm               = true;
                Inventory.NmmR              = 16;
                Inventory.NmmRBasementTaken = true;
                Inventory.FlareGun          = true;
                Inventory.Flare             = 2;
                Inventory.flareN1Taken      = true;
                FightSet.Fight(Inventory.Nymph1HP, Inventory.Nymph1DMG, "Nymph", Inventory.Nymph1Alive);
            }
            else
            {
                Console.WriteLine("I don't understand");
                s();
            }
        }
Пример #4
0
 private void TakeDame(int damge)
 {
     if (_enemyCurrentHealth > 0)
     {
         _enemyCurrentHealth = _enemyCurrentHealth - damge;
         _healthBar.SetHealth(_enemyCurrentHealth);
     }
     else
     {
         _enemyCurrentHealth = 0;
         _isEnemyDead        = true;
         FightSet fightSet = new FightSet(_localUser.currentEventId, _localUser.userID, true, _localUser.currentMutex);
         StartCoroutine(_gameNetwork.SetFightSatus("https://harryspotter.eu.ngrok.io/setFightStatus", fightSet.Serialize().ToString()));
         _uIManagerFight.DisplayEndPanel(true);//player won show panel
     }
 }