Esempio n. 1
0
    public void PickUp(GameObject go)
    {
        if (this.gameObject != go)
        {
            return;
        }

        if (!_playerInventory.IsFull())
        {
            Item itemCopy = _item;
            _playerInventory.AddItem(itemCopy);
            GameController.errorMessage.AddMessage(string.Format("Picked up {0}", itemCopy.Name, Color.white));

            if (OlChapBehaviour.GetQuestProgression() == 2)
            {
                OlChapBehaviour.ContinuePorgression();
                ObjectiveText.SetObjectiveText("- Go back to the old man");
            }

            Destroy(this.gameObject);
            Destroy(_textScript.gameObject);
        }
        else
        {
            transform.parent.position = this.transform.position;
            _itemFlipAnimation.Play();
            GameController.errorMessage.AddMessage("Inventory is full!");
        }
    }
Esempio n. 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         if (OlChapBehaviour.GetQuestProgression() == 1)
         {
             OlChapBehaviour.ContinuePorgression();
             ObjectiveText.SetObjectiveText("- Go back to the old man");
             Destroy(this.gameObject);
         }
     }
 }
Esempio n. 3
0
 private void InteractWithDoor(GameObject gameObject)
 {
     if (gameObject == this.gameObject)
     {
         if (OlChapBehaviour.GetQuestProgression() >= 7)
         {
             GameController.mainCanvas.FadeToBlack();
             OlChapBehaviour.ContinuePorgression();
             GameObject.Find("villageElder").GetComponent <OlChapBehaviour>().DisplayQuestObjective();
             GameObject.Find("villageElder").GetComponent <AudioSource>().spatialBlend = 0;
             GetComponent <AudioSource>().Play();
         }
     }
 }
Esempio n. 4
0
    private void OpenShop(GameObject go)
    {
        if (this.gameObject != go)
        {
            return;
        }

        SetAllWindowsActive();

        if (OlChapBehaviour.GetQuestProgression() == 3)
        {
            OlChapBehaviour.ContinuePorgression();
            ObjectiveText.SetObjectiveText("- Return to the old man");
        }
    }
Esempio n. 5
0
 //Death animation
 private void PlayDyingAnimation()
 {
     if (!_animator.GetBool("isDying"))
     {
         //Play death animation here lmao
         if (!_isMeleeEnemy && OlChapBehaviour.GetQuestProgression() == 4)
         {
             OlChapBehaviour.ContinuePorgression();
             ObjectiveText.SetObjectiveText("- Go back to the old man");
         }
         SetAnimationState(AnimationState.Dying);
         GetComponent <Collider>().enabled = false;
         GetComponent <DropLoot>().DropItems(this.transform);
     }
 }
Esempio n. 6
0
    private void OpenChest(GameObject go)
    {
        if (this.gameObject != go)
        {
            return;
        }

        if (!_openChestAnimation.GetBool("isClicked"))
        {
            GetComponent <DropLoot>().DropItems(this.transform);
            _openChestAnimation.SetBool("isClicked", true);

            if (OlChapBehaviour.GetQuestProgression() == 5)
            {
                OlChapBehaviour.ContinuePorgression();
                ObjectiveText.SetObjectiveText("- Go back to the old man");
            }
        }
    }
Esempio n. 7
0
    private void TeleportPlayer()
    {
        if (Input.GetMouseButtonDown(0) && OlChapBehaviour.GetQuestProgression() > 1)
        {
            RaycastHit raycastHit = new RaycastHit();
            Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out raycastHit);
            if (raycastHit.transform.gameObject == this.gameObject)
            {
                if (GoToHubPortal)
                {
                    GameController.GoToHub();
                }
                else
                {
                    switch (OlChapBehaviour.GetQuestProgression())
                    {
                    case 2:
                        ObjectiveText.SetObjectiveText("- Kill and enemy and find an item");
                        break;

                    case 4:
                        ObjectiveText.SetObjectiveText("- Kill a radish");
                        break;

                    case 5:
                        ObjectiveText.SetObjectiveText("- Find and loot a chest");
                        break;

                    case 6:
                        ObjectiveText.SetObjectiveText("- Find keys (" + GameController.questProgress + "/5)");
                        break;
                    }
                    GameController.GoToLevel();
                }
            }
        }
    }