Ejemplo n.º 1
0
        private void change_phase(Class_Reel_Phases phase)
        {
            Timer  = 0;
            Action = 0;
            switch (phase)
            {
            case Class_Reel_Phases.Animation:
                White_Screen.opacity = 0;
                if (Battler == null)
                {
                    create_battler();
                }
                Burst      = null;
                Title_Back = null;
                Letters.Clear();
                Class_Banner.opacity = 0;
                Class_Banner.visible = false;
                break;

            case Class_Reel_Phases.Class_Name:
                Battler              = null;
                Battler_Action       = Class_Reel_Battler_Actions.Idle;
                Battler_Timer        = 0;
                Message              = null;
                Black_Screen.visible = true;
                Black_Bar1.visible   = false;
                Black_Bar2.visible   = false;
                Black_Bar_Timer      = -1;
                if (Phase == Class_Reel_Phases.Force_Close)
                {
                    increment_index();
                    Timer = 10;
                }
                break;

            case Class_Reel_Phases.Closing:
            case Class_Reel_Phases.Force_Close:
                Action = 0;
                break;
            }
            Phase = phase;
        }
Ejemplo n.º 2
0
 private void increment_index()
 {
     Index++;
     if (Index >= Data_Order.Count)
     {
         Closing = true;
     }
     else
     {
         Global.dispose_battle_textures();
         load_class(class_data);
         Black_Screen.TintA      = 255;
         Title_Back              = new Title_Background();
         Title_Back.stereoscopic = Config.TITLE_BG_DEPTH;
         Title_Black.TintA       = 255;
         Class_Banner_Color      = new Color(0, 0, 0, 80);
         Class_Banner.scale      = Vector2.One;
         Class_Banner.visible    = true;
         Class_Banner.offset     = new Vector2(Class_Banner.texture.Width / 2, 92 - 8);
     }
 }
Ejemplo n.º 3
0
        protected void update_class_name()
        {
            switch (Action)
            {
            // Load next class
            case 0:
                switch (Timer)
                {
                case 0:
                    increment_index();
                    Timer++;
                    break;

                case 60:
                    if (Closing)
                    {
                        Global.scene_change("Scene_Title_Load");
                    }
                    else
                    {
                        Timer = 0;
                        Action++;
                        Class_Name = "" + Unit.actor.class_name;
                    }
                    break;

                default:
                    if (Timer >= 10 && Timer < 42)
                    {
                        Title_Black.TintA      = (byte)(256 - (Timer - 9) * 5);
                        Class_Banner.opacity  += 8;
                        Class_Banner.offset.Y += Timer % 4 == 0 ? 1 : 0;
                    }
                    Timer++;
                    break;
                }
                break;

            // Create letters
            case 1:
                if (Timer == 0)
                {
                    if (Class_Name.Length == 0)
                    {
                        Action++;
                    }
                    else
                    {
                        add_letter();
                        Timer++;
                        if (Timer >= Spiral_Letter.DELAY)
                        {
                            Timer = 0;
                        }
                    }
                }
                else
                {
                    Timer++;
                    if (Timer >= Spiral_Letter.DELAY)
                    {
                        Timer = 0;
                    }
                }
                break;

            // Pause on name
            case 2:
                if (Timer >= Spiral_Letter.FLASH_TIME && Timer < Spiral_Letter.FLASH_TIME + 8)
                {
                    Class_Banner_Color.R = (byte)MathHelper.Clamp(Class_Banner_Color.R + 32, 0, 255);
                    Class_Banner_Color.G = (byte)MathHelper.Clamp(Class_Banner_Color.G + 32, 0, 255);
                    Class_Banner_Color.B = (byte)MathHelper.Clamp(Class_Banner_Color.B + 32, 0, 255);
                    Class_Banner_Color.A = (byte)MathHelper.Clamp(Class_Banner_Color.A + 22, 0, 255);
                }
                else if (Timer >= Spiral_Letter.FLASH_TIME + 16 && Timer < Spiral_Letter.FLASH_TIME + 24)
                {
                    Class_Banner_Color.A = (byte)MathHelper.Clamp(Class_Banner_Color.A - 32, 0, 255);
                }
                else if (Timer >= Spiral_Letter.TOTAL_WAIT && Timer < Spiral_Letter.TOTAL_WAIT + 32)
                {
                    int timer = Timer - Spiral_Letter.TOTAL_WAIT;
                    Class_Banner.scale    = new Vector2(1 + 2 * ((1 + timer) / 32f), 1 - (float)Math.Sqrt(timer / 32f));
                    Class_Banner.opacity -= 8;
                }
                else if (Timer == Spiral_Letter.TOTAL_WAIT + 32)
                {
                    Class_Banner.visible = false;
                    Timer = 0;
                    Action++;
                    return;
                }
                Timer++;
                break;

            // White flash
            case 3:
                switch (Timer)
                {
                case 47:
                    White_Screen.opacity = 255;
                    create_battler();
                    Burst      = null;
                    Title_Back = null;
                    Letters.Clear();
                    Timer = 0;
                    Action++;
                    break;

                default:
                    if (Timer == 0)
                    {
                        Burst              = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Pictures/burst"));
                        Burst.loc          = new Vector2(Config.WINDOW_WIDTH / 2, Config.WINDOW_HEIGHT / 2);
                        Burst.offset       = new Vector2(Burst.texture.Width / 2, Burst.texture.Height / 2);
                        Burst.blend_mode   = 1;
                        Burst.opacity      = 0;
                        Burst.stereoscopic = Config.REEL_BURST_DEPTH;
                    }
                    Burst.opacity += 8;
                    // Resize/rotate
                    if (Timer % 3 == 0)
                    {
                        Burst.scale = Vector2.One * (Timer + 1) / 100f * ((Timer + 1) / 48f + 1);
                        Burst.angle = -(Timer + 1) * 4 / 360f * MathHelper.Pi;
                    }
                    // White screen
                    if (Timer >= 16)
                    {
                        White_Screen.opacity = (Timer - 15) * 8;
                    }
                    Timer++;
                    break;
                }
                break;

            // Fade out for next phase
            case 4:
                switch (Timer)
                {
                case 47:
                    change_phase(Class_Reel_Phases.Animation);
                    break;

                default:
                    if (Timer >= 16 && Timer <= 31)
                    {
                        White_Screen.opacity = (31 - Timer) * 16;
                    }
                    Timer++;
                    break;
                }
                break;
            }
        }