Esempio n. 1
0
    public void AdvanceStory(string userInput)
    {
        string         characterName = GameState.Instance.CharacterState.currentCharacterName;
        string         playerId      = GameState.Instance.PlayerState.id;
        ServerResponse response      = CharacterController.AdvanceStory(characterName, playerId, userInput);

        if (!response.error)
        {
            Debug.Log($"Success: Advanced dialogue");
            CharacterReadModel character = (CharacterReadModel)ModelRepository.Get(response.modelName, response.aggregateIdentifier);
            GameReducer.Reduce(ActionTypes.MESSAGE_SET, character.currentText);
            if (character.currentStorylineCompleted == true)
            {
                GameReducer.Reduce(ActionTypes.CURRENT_STORYLINE_COMPLETED, "");
            }
        }
        else
        {
            Debug.Log("Failed");
        }
    }