예제 #1
0
 void AddItemToInventory()
 {
     if (thisItem)
     {
         GameState.AddItem(thisItem);
     }
 }
예제 #2
0
    public void afterDialog()
    {
        // Check if the quest is current active, and set the quest object to be active
        if ((bool)myQuest.myStory.variablesState["accepted_quest"])
        {
            GameState.SetQuestStatus(myQuest, false);
        }

        // Check if the quest is complete
        if ((bool)myQuest.myStory.variablesState["completed_quest"])
        {
            // Probably not necessary anymore. No NPCs give items anymore, so can remove (double check though)
            if (myQuest.npcGivesItem)
            {
                GameState.AddItem(myQuest.sacrificeItem);
                //myQuest.sacrificeItem.IncreaseAmount(1);
                myQuest.npcGivesItem = false;
            }

            // Update the quest object to reflect completion
            GameState.SetQuestStatus(myQuest, true);
        }

        if (myQuest.myStory.canContinue)
        {
            RefreshView();
        }
        else
        {
            if (myQuest.myStory.currentChoices.Count > 0)
            {
                MakeNewChoices();
            }
            // No more choices to make
            else
            {
                HideCanvas();
            }
            // Scrolls to the bottom
            StartCoroutine(ScrollCo());
        }
    }
예제 #3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.H) && currentDigs > 0 && GameState.CheckActiveString("Bones"))
     {
         currentDigs--;
         Collider2D item = Physics2D.OverlapCircle(this.transform.position, digRadius, diggable);
         DigResult.SetActive(true);
         if (item == null)
         {
             textObj.gameObject.GetComponent <TMP_Text>().text = "No Item Found";
         }
         else if (item.gameObject.name == "Item")
         {
             textObj.gameObject.GetComponent <TMP_Text>().text = "Tablet Found";
             Destroy(item.gameObject);
             GameState.AddItem(item_to_add);
         }
         Instantiate(digPrefab, this.transform.position, digPrefab.transform.rotation);
     }
     updateDigs();
 }
예제 #4
0
 public void Execute(GameState state, ConfigRoot config, ICommandBuffer _)
 {
     state.AddItem(new ItemState(Descriptor).WithId(Id));
 }