Exemple #1
0
    // called when we get to the shogun panel
    void InitShogunPanel()
    {
        Skinning.ResetSkin(selectedSkin);

        if (shogunManager == null)
        {
            Debug.LogError(debuguableInterface.debugLabel + "ShogunManager component shouldn't be null. If we can't get scene references we can't do anything.");
            return;
        }

        EnemyBundle bundle = gameData.enemyContent.Find(item => { return(item.enemy == actualEnemy); });

        GeneralDialogue selectedGeneral = bundle.shogunDialogue;

        selectedGeneral.Init();

        CombatDialogue selectedCombat = bundle.combatDialogue;

        shogunManager.Init(useCheats, () =>
        {
            popupManager.Pop(GamePopup.SHOGUN_DEDUCTION);
            audioProjectManager.FadeMusicOut();
        }, audioProjectManager.FadePopupMusicIn);

        popupManager.GetPopupFromType <ShogunPopup>().SpecificInit(
            useCheats,
            selectedGeneral.GetAllClues(),
            selectedGeneral.unlockableConclusions,
            shogunManager.characters,
            selectedGeneral.goodDeityFeedback,
            selectedGeneral.badDeityFeedback,
            () =>
        {
            popupManager.CancelPop();
            audioProjectManager.FadeMusicIn();
        },
            () =>
        {
            audioProjectManager.FadeMusicOut();
            audioProjectManager.FadePopupMusicOut();

            panelManager.JumpTo(GamePhase.FIGHT, () =>
            {
                fightManager = FindObjectOfType <FightManager>();
                fightManager.PreInit(selectedCombat);

                audioProjectManager.FadeMusicOut();
            });
        },
            selectedCombat.actualState
            );

        if (selectedCombat.actualState == GameState.NORMAL)
        {
            gameData.ResetPlayerClues();
        }

        actualTutorial.Init(() => shogunManager.StartDialogue(selectedGeneral));
    }
Exemple #2
0
    void InitConsequencesPanel()
    {
        Skinning.ResetSkin(selectedSkin);

        if (consequencesManager == null)
        {
            Debug.LogError(debuguableInterface.debugLabel + "ConsequencesManager component shouldn't be null. If we can't get scene references we can't do anything.");
        }

        EnemyBundle    bundle         = gameData.enemyContent.Find(item => { return(item.enemy == actualEnemy); });
        CombatDialogue selectedCombat = bundle.combatDialogue;

        string textToShow = string.Empty;

        switch (selectedCombat.actualState)
        {
        case GameData.GameState.GAME_OVER_GENERAL:
            textToShow = bundle.combatDialogue.playerLoseGeneralConsequence;
            break;

        case GameData.GameState.GAME_OVER_FINISHER:
            textToShow = bundle.combatDialogue.playerLoseFinalConsequence;
            break;

        default:
            textToShow = bundle.combatDialogue.playerWinConsequence;
            break;
        }

        consequencesManager.Init(
            selectedCombat.actualState,
            (int)actualEnemy,
            () => panelManager.JumpTo(GamePhase.END, () =>
        {
            endManager = FindObjectOfType <EndManager>();
            audioProjectManager.FadeMusicOut();
        }),
            () => panelManager.JumpTo(GamePhase.SHOGUN, () =>
        {
            shogunManager = FindObjectOfType <ShogunManager>();
            shogunManager.PreInit(
                selectedCombat.actualState,
                gameData.enemyContent.Find(item => { return(item.enemy == actualEnemy); }).shogunDialogue,
                AddClueToPlayer
                );

            audioProjectManager.FadeMusicOut();
        }),
            () => panelManager.JumpTo(GamePhase.FIGHT, () =>
        {
            fightManager = FindObjectOfType <FightManager>();
            fightManager.PreInit(selectedCombat);
            audioProjectManager.FadeMusicOut();
        }),
            () => actualEnemy++,
            textToShow
            );
    }