public void DropBarricade() { SetBarricadeDown(); // Will do nicer thing with animation, trigger, etc later trigger.Triggered = true; trigger.Save(); Debug.Log("Dropped barricade"); }
public void BossBattleWin() { // make character join party RPGsys.Character newMember = Utility.InstantiateSameName <RPGsys.Character>(partyMemberPrefab); newMember.transform.SetParent(GameController.Instance.playerTeam.transform); encounterWon.Triggered = true; encounterWon.Save(); // TODO some effect on character joining instead of just disappearing gameObject.SetActive(false); }
IEnumerator OpenChestRoutine(InteractionUser user) { // Suspend interactions SceneLoader.Instance.currentSceneController.SetBusy(); // TODO factor out dialogue stuff to some other class // HACK this feels dirty bool wait = true; UnityEngine.Events.UnityAction continueAction = () => wait = false; System.Func <bool> waitP = () => { return(wait); }; dialogue.SetTitle("Treasure Chest"); dialogue.ClearButtons(); dialogue.AddButton("Next", continueAction); dialogue.SetPortrait(treasureImage); dialogue.ShowBox(); if (contents.Count > 0) { internalGlow.Play(); animator.SetTrigger("Opening"); dialogue.SetDialogue("It was full of treasure!"); yield return(new WaitWhile(waitP)); wait = true; dialogue.SetDialogue("You found:\n" + ContentsText()); dialogue.ClearButtons(); dialogue.AddButton("Exit", continueAction); dialogue.RebuildLayout(); // Add items to inventory foreach (RPGItems.Item item in contents) { GameController.Instance.inventory.Add(Instantiate(item)); } EmptyChest(); trigger.Triggered = true; trigger.Save(); yield return(new WaitWhile(waitP)); } else { dialogue.SetDialogue("The chest was empty"); dialogue.ClearButtons(); dialogue.AddButton("Exit", continueAction); dialogue.RebuildLayout(); yield return(new WaitWhile(waitP)); } dialogue.ClearButtons(); dialogue.HideBox(); SceneLoader.Instance.currentSceneController.ClearBusy(); }
//HACK private void OnTriggerEnter(Collider other) { if (!trigger.Triggered && other.GetComponent <CharacterController>() != null) { // Add this conversation's actors to manager foreach (KeyValuePair <string, Dialogue.DialogueActor> entry in m_actorDict) { dialogueManager.actors[entry.Key] = entry.Value; } dialogueManager.StartConversation(conversation); trigger.Triggered = true; trigger.Save(); } }