Exemplo n.º 1
0
    /* OVERRIDES */

    private void Awake()
    {
        State = BattleState.INIT;

        // DEBUG - Set encounter data from inside scene
        if (Application.isEditor)
        {
            if (!EncounterDataStaticContainer.IsDataSet())
            {
                Debug.Log("Setting dummy data from inside BattleController - did you mean to do this?");
                EncounterDataStaticContainer.SetData(new EncounterData(debugHeroNames, debugEnemyNames));
            }
        }

        // Grab the encounter data (hopefully it was set before loading this scene)
        InitEncounterData();

        // Deserialize Hero/Enemy data and initialise objects
        SetupCombatants();

        // Discern the turn order
        InitialiseTurnOrder();

        // Start the animation coroutine handler
        StartCoroutine(AnimCoroutineManager());

        // If we're going to have to wait on the player, raise our flag
        if (CurrCombatant.Allegiance == Allegiance.PLAYER)
        {
            WaitingOnPlayerTurn = true;
            State = BattleState.PLAYERCHOICE;
        }
        else
        {
            WaitingOnPlayerTurn = false;
            State = BattleState.ENEMYCHOICE;
        }

        ResolvedAurasThisTurn = false;

        // Start the camera animation
        if (!skipIntro)
        {
            UIEnabled = false;
            cameraController.PlayIntro();
        }
        else
        {
            UIEnabled = true;
        }
    }
Exemplo n.º 2
0
 public void LoadBattle(EncounterData data)
 {
     EncounterDataStaticContainer.SetData(data);
     StartCoroutine(FadeOut(Color.white, "PT_BattleScene"));
 }
Exemplo n.º 3
0
 private void InitEncounterData()
 {
     data = EncounterDataStaticContainer.GetData();
     // Pre-load the attack ability data
     attackAbility = JsonParser.LoadAttackAbility();
 }