Ejemplo n.º 1
0
        public void OnInteract(ActionInvokerData data)
        {
            if (InteractionDisabledByHit)
            {
                return;
            }

            if (UseDeadAction && ActorController.CurrentAiState == ActorAiState.Dead)
            {
                if (DeadInteraction != ActorInteractionType.None)
                {
                    ExecuteInteraction(DeadInteraction, DeadInteractionTarget, DeadInteractionSpecial, data);
                }
            }
            else if (CorpseContainer != null && ActorController.CurrentAiState == ActorAiState.Dead && data.Activator is PlayerController)
            {
                ContainerModal.PushModal(GameState.Instance.PlayerRpgState.Inventory, CorpseContainer, false, null);
            }
            else
            {
                if (AltInteraction != ActorInteractionType.None && AlternateCondition.Parse().Evaluate())
                {
                    ExecuteInteraction(AltInteraction, AltInteractionTarget, AltInteractionSpecial, data);
                }
                else
                {
                    ExecuteInteraction(Interaction, InteractionTarget, InteractionSpecial, data);
                }
            }
        }
Ejemplo n.º 2
0
        static void OpenSharedContainer(string container, string asShop)
        {
            var  rContainer = GameState.Instance.ContainerState[container];
            bool bIsShop    = Convert.ToBoolean(asShop);

            ContainerModal.PushModal(GameState.Instance.PlayerRpgState.Inventory, rContainer, bIsShop, null);
        }
Ejemplo n.º 3
0
        public void InvokeContainer(ActionInvokerData data) //for invoking with an action special etc
        {
            if (data.Activator == null || !(data.Activator is PlayerController))
            {
                return;
            }

            //Debug.Log("Opened container");

            ContainerModal.PushModal(GameState.Instance.PlayerRpgState.Inventory, MyContainer, IsStore, null);
        }
Ejemplo n.º 4
0
        private void GotoNext(string next)
        {
            var nextLoc = ParseLocation(next);

            if (nextLoc.Value == "default")
            {
                PresentNewFrame(CurrentScene.Default);
            }
            else if (string.IsNullOrEmpty(nextLoc.Key) || nextLoc.Key == "this" || nextLoc.Key == CurrentSceneName)
            {
                PresentNewFrame(nextLoc.Value);
            }
            else if (nextLoc.Key == "meta")
            {
                //probably the only one carried over from Garlic Gang or Katana
                if (nextLoc.Value == "return")
                {
                    CloseDialogue();
                }
            }
            else if (nextLoc.Key == "shop")
            {
                var container = GameState.Instance.ContainerState[nextLoc.Value];
                ContainerModal.PushModal(GameState.Instance.PlayerRpgState.Inventory, container, true, null);
                CloseDialogue();
            }
            else if (nextLoc.Key == "scene")
            {
                CloseDialogue();

                var sceneController = BaseSceneController.Current;

                if (sceneController != null)
                {
                    //extract additional data if possible
                    string spawnPoint = string.Empty;
                    var    arr        = next.Split('.');
                    if (arr.Length >= 3)
                    {
                        spawnPoint = arr[2];
                    }

                    //clean exit
                    WorldUtils.ChangeScene(nextLoc.Value, spawnPoint, Vector3.zero, Vector3.zero);
                }
                else
                {
                    Debug.LogWarning("DialogueController forced scene exit!");
                    SceneManager.LoadScene(nextLoc.Value); //BAD BAD BAD forced exit
                }
            }
            else if (nextLoc.Key == "script")
            {
                CloseDialogue();

                Scripting.ScriptingModule.Call(nextLoc.Value, new Scripting.ScriptExecutionContext()
                {
                    Caller = this
                }, null);
            }
            else
            {
                LoadScene(nextLoc.Key); //this loads a dialogue scene, not a Unity scene (it's confusing right?)
                PresentNewFrame(nextLoc.Value);
            }
        }