Ejemplo n.º 1
0
    // DEBUG_WAIT_ANIMATION
    private void WaitAnimation()
    {
        CheckBattleEvent() ;

        #if DEBUG_WAIT_ANIMATION
        if( true == DEBUG_IsBattleInAnimation )
        {
            return ;
        }
        #else
        // DEBUG_WAIT_ANIMATION
        if( true == m_Battle.IsInAnimation() )
        {
            return ;
        }
        #endif
        // DEBUG_WAIT_ANIMATION

        m_State = GetaPieceInterfaceState.JudgeVictory ;
    }
Ejemplo n.º 2
0
 private void WaitBattleInitialize()
 {
     if( m_Battle.IsInitialized() )
     {
         m_State = GetaPieceInterfaceState.EnterRound ;
     }
 }
Ejemplo n.º 3
0
    // DEBUG_JUDGE_VICTORY
    private void JudgeVictory()
    {
        CalculateDamageFromData() ;
        UpdateHitPointFromDataOnce() ;

        CalculateDefendSucceed() ;

        bool isVicotryJudged = false ;
        bool isPlayerWin = false ;

        if( m_Enemy.HitPoint <= 0 )
        {
            isVicotryJudged = true ;
            isPlayerWin = true ;
        }
        else if( m_Player.HitPoint <= 0 )
        {
            isVicotryJudged = true ;
            isPlayerWin = false ;
        }

        #if DEBUG_JUDGE_VICTORY
        isVicotryJudged = DEBUG_IsVicotryJudged ;
        isPlayerWin = DEBUG_IsPlayerWin ;
        #endif
        // DEBUG_JUDGE_VICTORY
        if( isVicotryJudged )
        {
            if( isPlayerWin )
            {
                m_Victory.Blend("Language_Victory_Show");
            }
            else
            {
                m_Lose.Blend("Language_Victory_Show");
            }

            m_InAttackBlockBackground.Blend("Language_StartAction_Hide");

            m_State = GetaPieceInterfaceState.EndGame ;
        }
        else
        {
            m_State = GetaPieceInterfaceState.EnterRound ;
        }

        // after check hitpoint this turn
        CalculatePowerAttackEffect() ;
    }
Ejemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        switch( m_State )
        {
        case GetaPieceInterfaceState.UnActive :
            m_State = GetaPieceInterfaceState.InterfaceInitialize ;
            break ;
        case GetaPieceInterfaceState.InterfaceInitialize :
            InterfaceInitialize() ;
            break ;
        case GetaPieceInterfaceState.BattleInitialize :
            BattleInitialize() ;
            break ;
        case GetaPieceInterfaceState.WaitBattleInitialize :
            WaitBattleInitialize() ;
            break ;
        case GetaPieceInterfaceState.EnterRound :
            EnterRound() ;
            break ;
        // case GetaPieceInterfaceState.WaitPlayerInput : break ;

        case GetaPieceInterfaceState.EnterAnimation :
            EnterAnimation() ;
            break ;
        case GetaPieceInterfaceState.WaitAnimation :
            WaitAnimation() ;
            break ;
        case GetaPieceInterfaceState.JudgeVictory :
            JudgeVictory() ;
            break ;
        case GetaPieceInterfaceState.EndGame : break ;

        }
    }
Ejemplo n.º 5
0
    private void InterfaceInitialize()
    {
        if( null == m_EnergyGridParent )
        {
            Debug.LogError("null == m_EnergyGridParent");
            return ;
        }

        if( null == m_EnergyGridBackgroundParent )
        {
            Debug.LogError("null == m_EnergyGridBackgroundParent");
            return ;
        }

        if( null == m_UnitDataGameObject )
        {
            Debug.LogError("null == m_UnitDataGameObject");
            return ;
        }

        if( null == m_PlayerHP )
        {
            Debug.LogError("null == m_PlayerHP");
            return ;
        }

        m_HitPointPlayer = m_PlayerHP.GetComponent<RectTransform>() ;
        m_HPVibrationPlayer = m_PlayerHP.GetComponent<UGUIImageVibration>() ;

        if( null == m_EnemyHP )
        {
            Debug.LogError("null == m_EnemyHP");
            return ;
        }

        m_HitPointEnemy = m_EnemyHP.GetComponent<RectTransform>() ;
        m_HPVibrationEnemy = m_EnemyHP.GetComponent<UGUIImageVibration>() ;

        InterfaceInitialize_Data() ;

        InterfaceInitialize_EnergyGrid() ;

        m_State = GetaPieceInterfaceState.BattleInitialize ;
    }
Ejemplo n.º 6
0
    private void EnterRound()
    {
        CalculateEnergyRefill() ;

        PressComponentButton( 0 , ActionKey.Concentrate ) ;
        PressComponentButton( 1 , ActionKey.Concentrate ) ;
        PressComponentButton( 2 , ActionKey.Concentrate ) ;

        m_HPVibrationPlayer.StopVibration() ;
        m_HPVibrationEnemy.StopVibration() ;

        UpdateEnergyBackground() ;
        m_IsHideEnergyInThisTurn = false ;

        CheckPowerAttackPicture() ;

        m_InAttackBlockBackground.Blend("Language_StartAction_Hide");

        m_PlayerHPSinceBattleStart = m_Player.HitPoint ;
        m_EnemyHPSinceBattleStart = m_Enemy.HitPoint ;

        m_State = GetaPieceInterfaceState.WaitPlayerInput ;
    }
Ejemplo n.º 7
0
    private void EnterAnimation()
    {
        // calculate cost
        CostEnergyForUnit( m_Player ) ;
        SetEnergyGrid( m_Player.Energy , 0 , 0 ) ;

        m_Battle.StartBattle() ;

        m_State = GetaPieceInterfaceState.WaitAnimation ;
    }
Ejemplo n.º 8
0
 private void BattleInitialize()
 {
     m_Battle.StartInitialize() ;
     m_State = GetaPieceInterfaceState.WaitBattleInitialize ;
 }
Ejemplo n.º 9
0
    public void TryStart()
    {
        // Debug.Log("TryStart" );

        // copy select actions to player
        for( int i = 0 ; i < m_SelectedActions.Length ; ++i )
        {
            m_Player.m_Action[ i ] = m_SelectedActions[ i ] ;
        }

        CalculateActionsOfEnemy() ;

        HideAllEnergyBackground() ;

        m_InAttackBlockBackground.Blend("Language_StartAction_Show");

        m_State = GetaPieceInterfaceState.EnterAnimation ;
    }